Fix after testing
This commit is contained in:
@@ -360,18 +360,6 @@ export class HeritiersActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async prepareData() {
|
||||
|
||||
let pvMax = (this.system.caracteristiques.con.rang * 3) + 9 + this.system.pv.mod
|
||||
if (this.system.pv.max != pvMax) {
|
||||
this.update({ 'system.pv.max': pvMax })
|
||||
}
|
||||
if (this.system.biodata.magie || this.type == "pnj") {
|
||||
let pointsAmes = this.system.caracteristiques.esp.rang + this.system.caracteristiques.san.rang + this.getMaxRangMagie()
|
||||
if (this.system.magie.pointsame.max != pointsAmes) {
|
||||
this.update({ 'system.magie.pointsame.max': pointsAmes })
|
||||
}
|
||||
}
|
||||
|
||||
super.prepareData();
|
||||
}
|
||||
|
||||
@@ -395,6 +383,15 @@ export class HeritiersActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
prepareDerivedData() {
|
||||
// Calculate derived PV max
|
||||
let pvMax = (this.system.caracteristiques.con.rang * 3) + 9 + this.system.pv.mod
|
||||
this.system.pv.max = pvMax
|
||||
|
||||
// Calculate derived Points d'Âme max
|
||||
if (this.system.biodata.magie || this.type == "pnj") {
|
||||
let pointsAmes = this.system.caracteristiques.esp.rang + this.system.caracteristiques.san.rang + this.getMaxRangMagie()
|
||||
this.system.magie.pointsame.max = pointsAmes
|
||||
}
|
||||
|
||||
if (this.type == 'personnage') {
|
||||
}
|
||||
@@ -713,8 +710,7 @@ export class HeritiersActor extends Actor {
|
||||
rollData.caracKey = "per"
|
||||
}
|
||||
rollData.carac = this.system.caracteristiques[rollData.caracKey]
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -723,8 +719,7 @@ export class HeritiersActor extends Actor {
|
||||
rollData.mode = "carac"
|
||||
rollData.carac = this.system.caracteristiques[key]
|
||||
rollData.caracKey = key
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -733,8 +728,7 @@ export class HeritiersActor extends Actor {
|
||||
rollData.mode = "rang"
|
||||
rollData.rang = this.system.rang[key]
|
||||
rollData.rangKey = key
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollRootCompetence(compKey) {
|
||||
@@ -742,8 +736,7 @@ export class HeritiersActor extends Actor {
|
||||
rollData.mode = "competence"
|
||||
rollData.competence = { name: this.system.competences[compKey].label, system: { niveau: this.system.competences[compKey].niveau } }
|
||||
console.log("RollDatra", rollData)
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -751,8 +744,7 @@ export class HeritiersActor extends Actor {
|
||||
let rollData = this.getCommonRollData(compId)
|
||||
rollData.mode = "competence"
|
||||
console.log("RollDatra", rollData)
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -824,8 +816,7 @@ export class HeritiersActor extends Actor {
|
||||
rollData.caracKey = sort.system.carac1
|
||||
}
|
||||
console.log("RollData", rollData)
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
|
||||
|
||||
@@ -846,13 +837,13 @@ export class HeritiersActor extends Actor {
|
||||
rollData.caracKey = key
|
||||
rollData.arme = arme
|
||||
rollData.mode = "arme"
|
||||
rollData.attackType = "Attaque normale"
|
||||
rollData.armes = this.getOtherMeleeWeapons(arme)
|
||||
if (rollData.defenderTokenId && arme.system.isMelee) {
|
||||
rollData.cacheDifficulte = true
|
||||
}
|
||||
console.log(">>>> ARME", rollData)
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -868,10 +859,10 @@ export class HeritiersActor extends Actor {
|
||||
rollData.caracKey = key
|
||||
rollData.arme = foundry.utils.duplicate(arme)
|
||||
rollData.mode = "attaquebrutale"
|
||||
rollData.attackType = "Attaque brutale"
|
||||
rollData.armes = this.getOtherMeleeWeapons(arme)
|
||||
rollData.rulesMalus.push({ name: "Attaque brutale", value: -2 })
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
@@ -887,8 +878,8 @@ export class HeritiersActor extends Actor {
|
||||
rollData.arme = foundry.utils.duplicate(arme)
|
||||
rollData.armes = this.getOtherMeleeWeapons(arme)
|
||||
rollData.mode = "attaquecharge"
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
rollData.attackType = "Attaque en charge"
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -903,11 +894,11 @@ export class HeritiersActor extends Actor {
|
||||
rollData.caracKey = "agi"
|
||||
rollData.arme = foundry.utils.duplicate(arme)
|
||||
rollData.mode = "assommer"
|
||||
rollData.attackType = "Assommer"
|
||||
if (rollData.defenderTokenId) {
|
||||
rollData.cacheDifficulte = true
|
||||
}
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1001,8 +992,7 @@ export class HeritiersActor extends Actor {
|
||||
//ui.notifications.warn("Le pouvoir actif " + pouvoir.name + " a été utilisé, dépense de " + pouvoirPointsUsage + " points d'usage")
|
||||
}
|
||||
}
|
||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HeritiersRollDialog.create(this, rollData)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user