foundryvtt-reve-de-dragon/module/item-competence.js
Vincent Vandemeulebrouck cd36331702 #42 Tchat message attaque
2021-01-02 04:40:21 +01:00

22 lines
904 B
JavaScript

export class RdDItemCompetence extends Item {
/* -------------------------------------------- */
static isCompetenceMelee(name) {
return name.toLowerCase().match(/(epée|épée|hache|fleau|fléau|masse|lance|hast|dague|bouclier)/);
}
static isArmeUneMain(competence) {
return competence && competence.name.toLowerCase().includes("1 main");
}
static isMalusEncombrementTotal(competence) {
return competence && competence.name.toLowerCase().match(/(natation|acrobatie)/);
}
static setRollDataCreature(rollData) {
rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.data.carac_value } };
rollData.competence = duplicate(rollData.competence);
rollData.competence.data.defaut_carac = "carac_creature";
rollData.competence.data.categorie = "creature";
rollData.selectedCarac = rollData.carac.carac_creature
}
}