Modifier la loc pour les créatures
This commit is contained in:
parent
54a937c620
commit
375d452e7e
@ -2646,7 +2646,7 @@ export class RdDActor extends Actor {
|
||||
let encaissement = RdDUtility.selectEncaissement(jetTotal, rollData.dmg.mortalite)
|
||||
let over20 = Math.max(jetTotal - 20, 0);
|
||||
encaissement.dmg = rollData.dmg;
|
||||
encaissement.dmg.loc = rollData.dmg.loc ?? RdDUtility.getLocalisation();
|
||||
encaissement.dmg.loc = rollData.dmg.loc ?? RdDUtility.getLocalisation( this.data.type );
|
||||
encaissement.dmg.loc.label = encaissement.dmg.loc.label ?? 'Corps;'
|
||||
encaissement.roll = roll;
|
||||
encaissement.armure = armure;
|
||||
|
@ -578,18 +578,23 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getLocalisation() {
|
||||
// TODO: bouger dans une RollTable du compendium et chercher dans les RoolTable puis compendium pour permettre le changement?
|
||||
static getLocalisation( type = 'personnage' ) {
|
||||
let result = new Roll("1d20").roll().total;
|
||||
let txt = ""
|
||||
if (result <= 3) txt = "Jambe, genou, pied, jarret";
|
||||
else if (result <= 7) txt = "Hanche, cuisse, fesse";
|
||||
else if (result <= 9) txt = "Ventre, reins";
|
||||
else if (result <= 12) txt = "Poitrine, dos";
|
||||
else if (result <= 14) txt = "Avant-bras, main, coude";
|
||||
else if (result <= 18) txt = "Epaule, bras, omoplate";
|
||||
else if (result == 19) txt = "Tête";
|
||||
else if (result == 20) txt = "Tête (visage)";
|
||||
if ( type == 'personnage') {
|
||||
if (result <= 3) txt = "Jambe, genou, pied, jarret";
|
||||
else if (result <= 7) txt = "Hanche, cuisse, fesse";
|
||||
else if (result <= 9) txt = "Ventre, reins";
|
||||
else if (result <= 12) txt = "Poitrine, dos";
|
||||
else if (result <= 14) txt = "Avant-bras, main, coude";
|
||||
else if (result <= 18) txt = "Epaule, bras, omoplate";
|
||||
else if (result == 19) txt = "Tête";
|
||||
else if (result == 20) txt = "Tête (visage)";
|
||||
} else {
|
||||
if (result <= 7) txt = "Jambes/Pattes";
|
||||
else if (result <= 18) txt = "Corps";
|
||||
else if (result <= 20) txt = "Tête";
|
||||
}
|
||||
|
||||
return { result: result, label: txt };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user