forked from public/foundryvtt-reve-de-dragon
Nouvelle fenêtre de jets de dés
This commit is contained in:
@@ -37,21 +37,37 @@ const TABLE_CARACTERISTIQUES_DERIVEES = {
|
||||
32: { xp: 180, niveau: 11, poids: "1501-2000", poidsMin: 1501, poidsMax: 2000, plusdom: +11, sconst: 10, sust: 17 }
|
||||
};
|
||||
|
||||
export const CARACS = {
|
||||
TAILLE: 'taille',
|
||||
APPARENCE: 'apparence',
|
||||
CONSTITUTION: 'constitution',
|
||||
FORCE: 'force',
|
||||
AGILITE: 'agilite',
|
||||
DEXTERITE: 'dexterite',
|
||||
VUE: 'vue',
|
||||
OUIE: 'ouie',
|
||||
ODORATGOUT: 'odoratgout',
|
||||
VOLONTE: 'volonte',
|
||||
INTELLECT: 'intellect',
|
||||
EMPATHIE: 'empathie',
|
||||
REVE: 'reve',
|
||||
CHANCE: 'chance',
|
||||
}
|
||||
export const LIST_CARAC_PERSONNAGE = {
|
||||
'taille': { code: 'taille', label: 'Taille', isCarac: true, path: 'system.carac.taille.value' },
|
||||
'apparence': { code: 'apparence', label: 'Apparence', isCarac: true, path: 'system.carac.apparence.value' },
|
||||
'constitution': { code: 'constitution', label: 'Constitution', isCarac: true, path: 'system.carac.constitution.value' },
|
||||
'force': { code: 'force', label: 'Force', isCarac: true, path: 'system.carac.force.value' },
|
||||
'agilite': { code: 'agilite', label: 'Agilité', isCarac: true, path: 'system.carac.agilite.value' },
|
||||
'dexterite': { code: 'dexterite', label: 'Dextérité', isCarac: true, path: 'system.carac.dexterite.value' },
|
||||
'vue': { code: 'vue', label: 'Vue', isCarac: true, path: 'system.carac.vue.value' },
|
||||
'ouie': { code: 'ouie', label: 'Ouïe', isCarac: true, path: 'system.carac.ouie.value' },
|
||||
'odoratgout': { code: 'odoratgout', label: 'Odorat-Goût', isCarac: true, path: 'system.carac.odoratgout.value' },
|
||||
'volonte': { code: 'volonte', label: 'Volonté', isCarac: true, path: 'system.carac.volonte.value' },
|
||||
'intellect': { code: 'intellect', label: 'Intellect', isCarac: true, path: 'system.carac.intellect.value' },
|
||||
'empathie': { code: 'empathie', label: 'Empathie', isCarac: true, path: 'system.carac.empathie.value' },
|
||||
'reve': { code: 'reve', label: 'Rêve', isCarac: true, path: 'system.carac.reve.value' },
|
||||
'chance': { code: 'chance', label: 'Chance', isCarac: true, path: 'system.carac.chance.value' },
|
||||
[CARACS.TAILLE]: { code: CARACS.TAILLE, label: 'Taille', isCarac: true, path: 'system.carac.taille.value' },
|
||||
[CARACS.APPARENCE]: { code: CARACS.APPARENCE, label: 'Apparence', isCarac: true, path: 'system.carac.apparence.value' },
|
||||
[CARACS.CONSTITUTION]: { code: CARACS.CONSTITUTION, label: 'Constitution', isCarac: true, path: 'system.carac.constitution.value' },
|
||||
[CARACS.FORCE]: { code: CARACS.FORCE, label: 'Force', isCarac: true, path: 'system.carac.force.value' },
|
||||
[CARACS.AGILITE]: { code: CARACS.AGILITE, label: 'Agilité', isCarac: true, path: 'system.carac.agilite.value' },
|
||||
[CARACS.DEXTERITE]: { code: CARACS.DEXTERITE, label: 'Dextérité', isCarac: true, path: 'system.carac.dexterite.value' },
|
||||
[CARACS.VUE]: { code: CARACS.VUE, label: 'Vue', isCarac: true, path: 'system.carac.vue.value' },
|
||||
[CARACS.OUIE]: { code: CARACS.OUIE, label: 'Ouïe', isCarac: true, path: 'system.carac.ouie.value' },
|
||||
[CARACS.ODORATGOUT]: { code: CARACS.ODORATGOUT, label: 'Odorat-Goût', isCarac: true, path: 'system.carac.odoratgout.value' },
|
||||
[CARACS.VOLONTE]: { code: CARACS.VOLONTE, label: 'Volonté', isCarac: true, path: 'system.carac.volonte.value' },
|
||||
[CARACS.INTELLECT]: { code: CARACS.INTELLECT, label: 'Intellect', isCarac: true, path: 'system.carac.intellect.value' },
|
||||
[CARACS.EMPATHIE]: { code: CARACS.EMPATHIE, label: 'Empathie', isCarac: true, path: 'system.carac.empathie.value' },
|
||||
[CARACS.REVE]: { code: CARACS.REVE, label: 'Rêve', isCarac: true, path: 'system.carac.reve.value' },
|
||||
[CARACS.CHANCE]: { code: CARACS.CHANCE, label: 'Chance', isCarac: true, path: 'system.carac.chance.value' },
|
||||
'protection': { code: 'protection', label: 'Protection naturelle', isCarac: false, path: 'system.attributs.protection.value' },
|
||||
'beaute': { code: 'beaute', label: 'Beauté', isCarac: false, path: 'system.background.beaute.value' }
|
||||
}
|
||||
@@ -69,7 +85,7 @@ const LIST_CARAC_DERIVEE = {
|
||||
'reve-actuel': { code: "reve-actuel", label: 'Rêve actuel', path: 'system.reve.reve.value' },
|
||||
}
|
||||
|
||||
const LIST_CARAC_ROLL = Object.values(LIST_CARAC_PERSONNAGE).filter(it => it.isCarac && it.code != 'taille')
|
||||
export const LIST_CARAC_ROLL = Object.values(LIST_CARAC_PERSONNAGE).filter(it => it.isCarac && it.code != 'taille')
|
||||
.concat(Object.values(LIST_CARAC_AUTRES))
|
||||
.concat(Object.values(LIST_CARAC_DERIVEE))
|
||||
|
||||
@@ -95,27 +111,41 @@ export class RdDCarac {
|
||||
return Object.values(LIST_CARAC_PERSONNAGE).filter(filter)
|
||||
}
|
||||
|
||||
static isAgiliteOuDerobee(selectedCarac) {
|
||||
return selectedCarac?.label.match(/(Agilité|Dérobée)/);
|
||||
static isAgiliteOuDerobee(caracLabel) {
|
||||
return RdDCarac.isAgilite(caracLabel)
|
||||
|| RdDCarac.isDerobee(caracLabel)
|
||||
}
|
||||
|
||||
static isVolonte(selectedCarac) {
|
||||
return selectedCarac?.label == 'Volonté';
|
||||
static isDerobee(caracLabel) {
|
||||
return Grammar.equalsInsensitive(caracLabel, LIST_CARAC_PERSONNAGE.agilite.code);
|
||||
}
|
||||
static isChance(selectedCarac) {
|
||||
return selectedCarac?.label?.toLowerCase()?.match(/chance( actuelle)?/);
|
||||
|
||||
static isAgilite(caracLabel) {
|
||||
return Grammar.equalsInsensitive(caracLabel, LIST_CARAC_DERIVEE.derobee.code);
|
||||
}
|
||||
static isReve(selectedCarac) {
|
||||
return selectedCarac?.label?.toLowerCase()?.match(/r(e|ê)ve(( |-)actuel)?/);
|
||||
|
||||
static isIntellect(caracLabel) {
|
||||
return Grammar.toLowerCaseNoAccent(caracLabel) == 'intellect';
|
||||
}
|
||||
|
||||
static isVolonte(caracLabel) {
|
||||
return Grammar.toLowerCaseNoAccent(caracLabel) == 'volonte';
|
||||
}
|
||||
static isChance(caracLabel) {
|
||||
return Grammar.toLowerCaseNoAccent(caracLabel)?.match(/chance(( |-)?actuelle)?/);
|
||||
}
|
||||
static isReve(caracLabel) {
|
||||
return Grammar.toLowerCaseNoAccent(caracLabel)?.match(/reve(( |-)?actuel)?/);
|
||||
}
|
||||
|
||||
/**
|
||||
* L’appel à la chance n’est possible que pour recommencer les jets d’actions physiques :
|
||||
* tous les jets de combat, de FORCE, d’AGILITÉ, de DEXTÉRITÉ, de Dérobée, d’APPARENCE,
|
||||
* ainsi que de Perception active et volontaire.
|
||||
* Le moral ne s'utilise aussi que sur les actions physiques
|
||||
*/
|
||||
static isActionPhysique(selectedCarac) {
|
||||
return Grammar.toLowerCaseNoAccent(selectedCarac?.label)
|
||||
static isActionPhysique(caracLabel) {
|
||||
return Grammar.toLowerCaseNoAccent(caracLabel)
|
||||
?.match(/(apparence|force|agilite|dexterite|vue|ouie|gout|odorat|empathie|melee|tir|lancer|derobee)/) != null
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user