Correction sur init + assistance au combat dans la fenetre de dialogue
This commit is contained in:
@ -2,6 +2,12 @@
|
||||
import { HawkmoonCombat } from "./hawkmoon-combat.js";
|
||||
import { HawkmoonCommands } from "./hawkmoon-commands.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const __distanceDifficulte = { "porteecourte": 5, "porteemoyenne": 9, "porteelongue": 14}
|
||||
const __tireurDeplacement = { immobile: 0, lent: 3, rapide: 5}
|
||||
const __cibleCouvert = { aucun: 0, leger: 5, complet: 10}
|
||||
const __tailleCible = { normal: 0, main: 10, enfant: 3, maison: -10}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class HawkmoonUtility {
|
||||
|
||||
@ -145,7 +151,7 @@ export class HawkmoonUtility {
|
||||
let message = game.messages.get(messageId)
|
||||
let rollData = message.getFlag("world", "hawkmoon-roll")
|
||||
let actor = this.getActorFromRollData(rollData)
|
||||
actor.rollArmeDegats(rollData.arme._id, rollData.targetVigueur)
|
||||
actor.rollArmeDegats(rollData.arme._id, rollData.targetVigueur, rollData)
|
||||
})
|
||||
}
|
||||
|
||||
@ -393,7 +399,34 @@ export class HawkmoonUtility {
|
||||
} else {
|
||||
rollData.diceFormula += `+${rollData.attr.value}*${rollData.multiplier}+${rollData.modificateur}+${rollData.bonusMalusContext}`
|
||||
}
|
||||
|
||||
// Bonus arme naturelle en défense
|
||||
if (rollData.bonusArmeNaturelle) {
|
||||
rollData.diceFormula += `+${rollData.bonusArmeNaturelle}`
|
||||
}
|
||||
if (rollData.defenseurAuSol) {
|
||||
rollData.diceFormula += `+3`
|
||||
}
|
||||
if (rollData.defenseurAveugle) {
|
||||
rollData.diceFormula += `+10`
|
||||
}
|
||||
if (rollData.defenseurDeDos) {
|
||||
rollData.diceFormula += `+5`
|
||||
}
|
||||
if (rollData.defenseurRestreint) {
|
||||
rollData.diceFormula += `+3`
|
||||
}
|
||||
if (rollData.defenseurImmobilise) {
|
||||
rollData.diceFormula += `+5`
|
||||
}
|
||||
|
||||
if (rollData.arme && rollData.arme.system.isDistance) {
|
||||
rollData.difficulte = __distanceDifficulte[rollData.distanceTir]
|
||||
rollData.difficulte += __tireurDeplacement[rollData.tireurDeplacement]
|
||||
rollData.difficulte += __cibleCouvert[rollData.cibleCouvert]
|
||||
rollData.difficulte += __tailleCible[rollData.tailleCible]
|
||||
rollData.difficulte += rollData.cibleDeplace ? 3 : 0
|
||||
rollData.difficulte += rollData.cibleCaC ? 3 : 0
|
||||
}
|
||||
// Ajout adversités
|
||||
rollData.diceFormula += `-${rollData.nbAdversites}`
|
||||
|
||||
@ -528,7 +561,17 @@ export class HawkmoonUtility {
|
||||
pointAmeOptions: this.getPointAmeOptions(),
|
||||
difficulte: 0,
|
||||
modificateur: 0,
|
||||
bonusMalusContext: 0
|
||||
bonusMalusContext: 0,
|
||||
bonusArmeNaturelle: 0,
|
||||
defenseurAveugle: false,
|
||||
defenseurDeDos: false,
|
||||
defenseurAuSol: false,
|
||||
defenseurRestreint: false,
|
||||
defenseurImmobilise: false,
|
||||
tailleCible: "normal",
|
||||
tireurDeplacement: "immobile",
|
||||
cibleCouvert: "aucun",
|
||||
distanceTir: "porteemoyenne"
|
||||
}
|
||||
return rollData
|
||||
}
|
||||
@ -541,8 +584,14 @@ export class HawkmoonUtility {
|
||||
let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor
|
||||
rollData.armeDefense = defender.getBestDefenseValue()
|
||||
rollData.targetVigueur = defender.getVigueur()
|
||||
rollData.protectionDefenseur = defender.getProtection()
|
||||
if (rollData.armeDefense) {
|
||||
rollData.difficulte = rollData.armeDefense.system.totalDefensif
|
||||
if ( !rollData.arme.system.armenaturelle && !rollData.arme.system.armefortune ){
|
||||
if (rollData.armeDefense.system.armenaturelle || rollData.armeDefense.system.armefortune) {
|
||||
rollData.bonusArmeNaturelle = 3
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ui.notifications.warn("Aucune arme de défense équipée, difficulté manuelle à positionner.")
|
||||
}
|
||||
|
Reference in New Issue
Block a user