Correction initiative et meilleur affichage sur jet D20
All checks were successful
Release Creation / build (release) Successful in 51s
All checks were successful
Release Creation / build (release) Successful in 51s
This commit is contained in:
@@ -75,7 +75,7 @@ export class HawkmoonActor extends Actor {
|
||||
let combat = this.getCombatValues()
|
||||
if (arme.system.typearme == "contact" || arme.system.typearme == "contactjet") {
|
||||
let bonusDefense = this.getBonusDefenseFromTalents()
|
||||
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée"))
|
||||
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée") ?? {system:{niveau:0}})
|
||||
arme.system.attrKey = "pui"
|
||||
arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal
|
||||
arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff + (this.system.combat.monte ? 3 : 0)
|
||||
@@ -86,7 +86,7 @@ export class HawkmoonActor extends Actor {
|
||||
arme.system.isDistance = false
|
||||
}
|
||||
if (arme.system.typearme == "jet" || arme.system.typearme == "tir") {
|
||||
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "armes à distance"))
|
||||
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "armes à distance") ?? {system:{niveau:0}})
|
||||
arme.system.attrKey = "adr"
|
||||
arme.system.totalOffensif = this.system.attributs.adr.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
|
||||
arme.system.totalDegats = arme.system.degats
|
||||
@@ -188,7 +188,8 @@ export class HawkmoonActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getVitesseBase() {
|
||||
return 5 + __vitesseBonus[this.system.attributs.adr.value]
|
||||
const idx = Math.min(this.system.attributs.adr.value, __vitesseBonus.length - 1)
|
||||
return 5 + (__vitesseBonus[idx] ?? 0)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getProtection() {
|
||||
@@ -305,7 +306,7 @@ export class HawkmoonActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
checkAttribut(attribut, minLevel) {
|
||||
let attr = this.system.attributs.find(at => at.labelnorm == attribut.toLowerCase())
|
||||
let attr = Object.values(this.system.attributs).find(at => at.labelnorm == attribut.toLowerCase())
|
||||
if (attr && attr.value >= minLevel) {
|
||||
return { isValid: true, attr: foundry.utils.duplicate(attr) }
|
||||
}
|
||||
@@ -403,12 +404,13 @@ export class HawkmoonActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getAttribute(attrKey) {
|
||||
return this.system.attributes[attrKey]
|
||||
return this.system.attributs[attrKey]
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getBonusDegats() {
|
||||
return 0;
|
||||
const idx = Math.min(this.system.attributs.pui.value, __degatsBonus.length - 1)
|
||||
return __degatsBonus[idx] ?? 0
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -655,6 +657,9 @@ export class HawkmoonActor extends Actor {
|
||||
let rollData = this.getCommonRollData(attrKey)
|
||||
rollData.multiplier = (isInit) ? 1 : 2
|
||||
rollData.isInit = isInit
|
||||
if (isInit) {
|
||||
rollData.initbonus = this.system.combat.initbonus ?? 0
|
||||
}
|
||||
await HawkmoonRollDialog.create(this, rollData)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user