#159 Affiche d'informations sur l'init
This commit is contained in:
parent
155990610a
commit
1f61c955b7
@ -94,7 +94,7 @@ const _patch_initiative = () => {
|
|||||||
alias: c.token.name,
|
alias: c.token.name,
|
||||||
sound: CONFIG.sounds.dice,
|
sound: CONFIG.sounds.dice,
|
||||||
},
|
},
|
||||||
flavor: `${c.token.name} a fait son jet d'Initiative`,
|
flavor: `${c.token.name} a fait son jet d'Initiative (${messageOptions.initInfo})`,
|
||||||
},
|
},
|
||||||
messageOptions
|
messageOptions
|
||||||
);
|
);
|
||||||
|
@ -723,21 +723,28 @@ export class RdDUtility {
|
|||||||
const combatant = game.combat.getCombatant(combatantId);
|
const combatant = game.combat.getCombatant(combatantId);
|
||||||
const actor = combatant.actor;
|
const actor = combatant.actor;
|
||||||
|
|
||||||
|
let initInfo = "";
|
||||||
let initOffset = 0;
|
let initOffset = 0;
|
||||||
let caracForInit = 0;
|
let caracForInit = 0;
|
||||||
let compNiveau = 0;
|
let compNiveau = 0;
|
||||||
|
let competence = { name: "Aucune"};
|
||||||
if (actor.getSurprise() == "totale") {
|
if (actor.getSurprise() == "totale") {
|
||||||
initOffset = -1; // To force 0
|
initOffset = -1; // To force 0
|
||||||
|
initInfo = "Surprise Totale"
|
||||||
} else if (actor.getSurprise() == "demi") {
|
} else if (actor.getSurprise() == "demi") {
|
||||||
initOffset = 0;
|
initOffset = 0;
|
||||||
|
initInfo = "Demi Surprise"
|
||||||
} else if (arme.name == "Autre action") {
|
} else if (arme.name == "Autre action") {
|
||||||
initOffset = 2;
|
initOffset = 2;
|
||||||
|
initInfo = "Autre Action"
|
||||||
} else if (arme.name == "Draconic") {
|
} else if (arme.name == "Draconic") {
|
||||||
initOffset = 7;
|
initOffset = 7;
|
||||||
|
initInfo = "Draconic"
|
||||||
} else {
|
} else {
|
||||||
initOffset = 3; // Melée = 3.XX
|
initOffset = 3; // Melée = 3.XX
|
||||||
let competence = RdDItemCompetence.findCompetence(combatant.actor.data.items, arme.data.competence);
|
competence = RdDItemCompetence.findCompetence(combatant.actor.data.items, arme.data.competence);
|
||||||
compNiveau = competence.data.niveau;
|
compNiveau = competence.data.niveau;
|
||||||
|
initInfo = arme.name + " / " + arme.data.competence;
|
||||||
|
|
||||||
if (actor.data.type == 'creature' || actor.data.type == 'entite') {
|
if (actor.data.type == 'creature' || actor.data.type == 'entite') {
|
||||||
caracForInit = competence.data.carac_value;
|
caracForInit = competence.data.carac_value;
|
||||||
@ -762,7 +769,7 @@ export class RdDUtility {
|
|||||||
let rollFormula = initOffset + "+ ( (" + RdDUtility.calculInitiative(compNiveau, caracForInit) + " + " + malus + ") /100)";
|
let rollFormula = initOffset + "+ ( (" + RdDUtility.calculInitiative(compNiveau, caracForInit) + " + " + malus + ") /100)";
|
||||||
// Garder la trace de l'arme/compétence utilisée pour l'iniative
|
// Garder la trace de l'arme/compétence utilisée pour l'iniative
|
||||||
combatant.initiativeData = { arme: arme } // pour reclasser l'init au round 0
|
combatant.initiativeData = { arme: arme } // pour reclasser l'init au round 0
|
||||||
game.combat.rollInitiative(combatantId, rollFormula);
|
game.combat.rollInitiative(combatantId, rollFormula, { initInfo: initInfo});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
Loading…
Reference in New Issue
Block a user