Add damage management and DR for monsters also
All checks were successful
Release Creation / build (release) Successful in 1m48s
All checks were successful
Release Creation / build (release) Successful in 1m48s
This commit is contained in:
@@ -80,14 +80,26 @@ export default class LethalFantasyActor extends Actor {
|
||||
|
||||
/* *************************************************/
|
||||
computeDamageReduction() {
|
||||
let naturalDR = Number(this.system.biodata.naturalDR) || 0
|
||||
let magicDR = Number(this.system.biodata.magicDR) || 0
|
||||
// Pour les monstres, utiliser hp.damageResistance et combat.damageReduction
|
||||
if (this.type === "monster") {
|
||||
let hpDR = Number(this.system.hp?.damageResistance) || 0
|
||||
let combatDR = Number(this.system.combat?.damageReduction) || 0
|
||||
return hpDR + combatDR
|
||||
}
|
||||
// Pour les personnages, utiliser biodata et items
|
||||
let naturalDR = Number(this.system.biodata?.naturalDR) || 0
|
||||
let magicDR = Number(this.system.biodata?.magicDR) || 0
|
||||
let armorDR = this.getArmorDR()
|
||||
return naturalDR + magicDR + armorDR
|
||||
}
|
||||
|
||||
/* *************************************************/
|
||||
getShieldDR() {
|
||||
// Pour les monstres, utiliser combat.shieldDamageReduction
|
||||
if (this.type === "monster") {
|
||||
return Number(this.system.combat?.shieldDamageReduction) || 0
|
||||
}
|
||||
// Pour les personnages, utiliser les items de type shield
|
||||
let dr = 0
|
||||
for (let item of this.items) {
|
||||
if (item.type === "shield" && item.system.equipped) {
|
||||
|
||||
Reference in New Issue
Block a user