#20 Gestion des RollModes et gestion initiative plus fine
This commit is contained in:
parent
2cbd496517
commit
ba66f79f63
@ -670,16 +670,17 @@ export class RdDUtility {
|
||||
const combatant = game.combat.getCombatant(combatantId);
|
||||
const actor = combatant.actor;
|
||||
|
||||
if ( arme.name == "Autre action") {
|
||||
game.combat.rollInitiative(combatantId, "1d6" );
|
||||
} else if ( arme.name == "Draconic") {
|
||||
game.combat.rollInitiative(combatantId, "1d6+200" );
|
||||
} else {
|
||||
let initOffset = 0;
|
||||
let caracForInit = 0;
|
||||
let competence = RdDUtility.findCompetence( combatant.actor.data.items, arme.data.competence);
|
||||
|
||||
if ( actor.data.type == 'creature' || actor.data.type == 'entite') {
|
||||
caracForInit = competence.data.carac_value;
|
||||
} else {
|
||||
if (arme.name == "Draconic") {
|
||||
initOffset = 200;
|
||||
competence = { name: "Draconic", data : { niveau: 0 } }; // Fake
|
||||
} else {
|
||||
caracForInit = actor.data.data.carac[competence.data.defaut_carac].value;
|
||||
if (competence.data.categorie == "lancer" ) { // Offset de principe pour les armes de jet
|
||||
@ -689,11 +690,10 @@ export class RdDUtility {
|
||||
initOffset = 80;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Cas des créatures et entités vs personnages
|
||||
let rollFormula = "1d6+" + competence.data.niveau + "+" + Math.ceil(caracForInit/2) + "+" + initOffset;
|
||||
game.combat.rollInitiative(combatantId, rollFormula );
|
||||
console.log("Roll !", competence, arme, rollFormula );
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -719,6 +719,7 @@ export class RdDUtility {
|
||||
armesList.push( { name: "Corps à corps", data: { niveau: cc.data.niveau, description: "", force: 6, competence: "Corps à corps", dommages: combatant.actor.data.data.attributs.plusdom.value } } );
|
||||
armesList.push( { name: "Draconic", data: { competence: "Draconic" } } );
|
||||
}
|
||||
armesList.push( { name: "Autre action", data: { competence: "Autre action" } } );
|
||||
// Build the relevant submenu
|
||||
if ( armesList ) {
|
||||
let menuItems = [];
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||
"version": "0.9.83",
|
||||
"version": "0.9.84",
|
||||
"minimumCoreVersion": "0.7.5",
|
||||
"compatibleCoreVersion": "0.7.6",
|
||||
"templateVersion": 48,
|
||||
|
Loading…
Reference in New Issue
Block a user