Minor fixes
This commit is contained in:
parent
d09cf781d6
commit
fad02f45e1
@ -897,6 +897,7 @@ export class RdDActor extends Actor {
|
|||||||
if (this.type == 'personnage')
|
if (this.type == 'personnage')
|
||||||
minValue = name == "vie" ? Number(-this.data.data.attributs.sconst.value) : 0;
|
minValue = name == "vie" ? Number(-this.data.data.attributs.sconst.value) : 0;
|
||||||
let newValue = Math.max(minValue, Math.min(data.value + inc, data.max));
|
let newValue = Math.max(minValue, Math.min(data.value + inc, data.max));
|
||||||
|
//console.log("New value ", inc, minValue, newValue);
|
||||||
|
|
||||||
if (name == "endurance" && this.data.type != 'entite' ) {
|
if (name == "endurance" && this.data.type != 'entite' ) {
|
||||||
if ( sante.fatigue && inc < 0 ) { // Each endurance lost -> fatigue lost
|
if ( sante.fatigue && inc < 0 ) { // Each endurance lost -> fatigue lost
|
||||||
@ -1291,15 +1292,15 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
encaisserDommages( attackerRoll ) {
|
async encaisserDommages( attackerRoll ) {
|
||||||
console.log("encaisserDommages", attackerRoll )
|
console.log("encaisserDommages", attackerRoll )
|
||||||
const armure = this.computeArmure( attackerRoll.loc, attackerRoll.domArmePlusDom);
|
const armure = this.computeArmure( attackerRoll.loc, attackerRoll.domArmePlusDom);
|
||||||
let degatsReel = attackerRoll.degats - armure;
|
let degatsReel = attackerRoll.degats - armure;
|
||||||
|
|
||||||
let result = RdDUtility.computeBlessuresSante(degatsReel, attackerRoll.mortalite);
|
let result = RdDUtility.computeBlessuresSante(degatsReel, attackerRoll.mortalite);
|
||||||
if ( this.data.type != 'entite') // Pas de PV chez les entités
|
if ( this.data.type != 'entite') // Pas de PV chez les entités
|
||||||
this.santeIncDec("vie", result.vie);
|
await this.santeIncDec("vie", result.vie);
|
||||||
this.santeIncDec("endurance", result.endurance);
|
await this.santeIncDec("endurance", result.endurance);
|
||||||
result.locName = (attackerRoll.loc) ? attackerRoll.loc.label : "Corps";
|
result.locName = (attackerRoll.loc) ? attackerRoll.loc.label : "Corps";
|
||||||
|
|
||||||
this.manageBlessures(result); // Will upate the result table
|
this.manageBlessures(result); // Will upate the result table
|
||||||
|
@ -33,9 +33,11 @@ export class RdDEncaisser extends Dialog {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
performEncaisser(html, mortalite = "mortel") {
|
performEncaisser(html, mortalite = "mortel") {
|
||||||
|
const ajustement = Number(this.modifier);
|
||||||
|
const encaissement = new Roll("2d10").roll().total + ajustement;
|
||||||
this.actor.encaisserDommages({
|
this.actor.encaisserDommages({
|
||||||
degats: new Roll("2d10").roll().total,
|
degats: encaissement,
|
||||||
domArmePlusDom: Number(this.modifier),
|
domArmePlusDom: ajustement,
|
||||||
loc: { result: 0, label: "Corps" },
|
loc: { result: 0, label: "Corps" },
|
||||||
mortalite: mortalite
|
mortalite: mortalite
|
||||||
});
|
});
|
||||||
|
@ -508,7 +508,7 @@ export class RdDUtility {
|
|||||||
let encaissement = RdDUtility.selectEncaissement(degats, mortalite)
|
let encaissement = RdDUtility.selectEncaissement(degats, mortalite)
|
||||||
let over20 = degats > 20 ? degats - 20 : 0
|
let over20 = degats > 20 ? degats - 20 : 0
|
||||||
encaissement.endurance = - RdDUtility._evaluatePerte(encaissement.endurance, over20)
|
encaissement.endurance = - RdDUtility._evaluatePerte(encaissement.endurance, over20)
|
||||||
encaissement.vie = - RdDUtility._evaluatePerte(encaissement.vie, degats, over20)
|
encaissement.vie = - RdDUtility._evaluatePerte(encaissement.vie, over20)
|
||||||
return encaissement;
|
return encaissement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "foundryvtt-reve-de-dragon",
|
"name": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||||
"version": "0.9.95",
|
"version": "0.9.96",
|
||||||
"minimumCoreVersion": "0.7.5",
|
"minimumCoreVersion": "0.7.5",
|
||||||
"compatibleCoreVersion": "0.7.6",
|
"compatibleCoreVersion": "0.7.6",
|
||||||
"templateVersion": 51,
|
"templateVersion": 51,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user