Gestion attaques v2 et initiative
This commit is contained in:
@@ -136,12 +136,12 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
listActions({ isAttaque = false, isEquipe = false }) {
|
||||
// Recupération des armes
|
||||
// Recupération des attaques
|
||||
const actions = this.listActionsAttaque()
|
||||
.filter(it => !isEquipe || it.arme.system.equipe)
|
||||
|
||||
if (!isAttaque && this.system.attributs.hautrevant.value) {
|
||||
actions.push({ name: "Draconic", action: 'haut-reve', initOnly: true })
|
||||
actions.push({ label: "Draconic", action: 'haut-reve', initOnly: true })
|
||||
}
|
||||
return actions
|
||||
}
|
||||
@@ -177,7 +177,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
const actions = []
|
||||
const uniques = []
|
||||
|
||||
const addAttaque = (arme, main) => {
|
||||
const addAttaque = (arme, main = undefined, action = 'attaque') => {
|
||||
const dommagesArme = RdDItemArme.valeurMain(arme.system.dommages, main)
|
||||
const forceRequise = RdDItemArme.valeurMain(arme.system.force ?? 0, main)
|
||||
const ecaillesEfficacite = arme.system.magique ? arme.system.ecaille_efficacite : 0;
|
||||
@@ -196,7 +196,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
const ajustement = (arme.parent?.getEtatGeneral() ?? 0) + ecaillesEfficacite
|
||||
|
||||
actions.push({
|
||||
name: arme.name + (main ? ' ' + main : ''),
|
||||
label: arme.name + (main ? ' ' + main : ''),
|
||||
action: 'attaque',
|
||||
initOnly: false,
|
||||
arme: arme,
|
||||
@@ -206,22 +206,23 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
equipe: arme.system.equipe,
|
||||
dommagesArme: dommagesArme,
|
||||
forceRequise: forceRequise,
|
||||
initiative: RdDInitiative.calculInitiative(niveau, caracValue, ajustement)
|
||||
initiative: RdDInitiative.getRollInitiative(caracValue, niveau, ajustement)
|
||||
})
|
||||
}
|
||||
|
||||
addAttaque(RdDItemArme.empoignade(this))
|
||||
addAttaque(RdDItemArme.corpsACorps(this))
|
||||
|
||||
this.itemTypes[ITEM_TYPES.arme]
|
||||
.filter(it => it.isAttaque())
|
||||
.sort(Misc.ascending(it => it.name))
|
||||
.forEach(arme => {
|
||||
if (arme.system.unemain && arme.system.competence) { addAttaque(arme, ATTAQUE_TYPE.UNE_MAIN) }
|
||||
if (arme.system.deuxmains && arme.system.competence) { addAttaque(arme, ATTAQUE_TYPE.DEUX_MAINS) }
|
||||
if (arme.system.lancer) { addAttaque(arme, ATTAQUE_TYPE.LANCER) }
|
||||
if (arme.system.unemain && arme.system.competence && arme.system.resistance > 0) { addAttaque(arme, ATTAQUE_TYPE.UNE_MAIN) }
|
||||
if (arme.system.deuxmains && arme.system.competence && arme.system.resistance > 0) { addAttaque(arme, ATTAQUE_TYPE.DEUX_MAINS) }
|
||||
if (arme.system.lancer && arme.system.resistance > 0) { addAttaque(arme, ATTAQUE_TYPE.LANCER) }
|
||||
if (arme.system.tir) { addAttaque(arme, ATTAQUE_TYPE.TIR) }
|
||||
})
|
||||
|
||||
addAttaque(RdDItemArme.corpsACorps(this), ATTAQUE_TYPE.CORPS_A_CORPS)
|
||||
addAttaque(RdDItemArme.empoignade(this), ATTAQUE_TYPE.CORPS_A_CORPS, 'empoignade')
|
||||
|
||||
return actions
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user