Corrections des tirages tmr/rencontres
- on n'affiche plus le compendium d'origine des rencontres dans le tchat - utilisation de ChatMessageData#rolls (compat future v14) - le résultat d'un d100 n'a pas à afficher de signe '%' - utilistaion des types de TMR plutôt que les noms en minuscules
This commit is contained in:
@ -284,18 +284,18 @@ export class TMRUtility {
|
||||
static findTMRLike(type, options = { inclusMauvaise: true }) {
|
||||
const choix = [...Object.values(TMRType)]
|
||||
if (options.inclusMauvaise) {
|
||||
choix.push({ name: 'Mauvaise' });
|
||||
choix.push({ name: 'Mauvaise', type: 'mauvaise'});
|
||||
}
|
||||
const selection = Misc.findAllLike(type, choix).map(it => it.name);
|
||||
const selection = Misc.findAllLike(type, choix)
|
||||
if (selection.length == 0) {
|
||||
ui.notifications.warn(`Un type de TMR doit être indiqué, '${type}' n'est pas trouvé dans ${choix}`);
|
||||
return undefined;
|
||||
return undefined
|
||||
}
|
||||
if (selection.length > 1) {
|
||||
ui.notifications.warn(`Plusieurs types de TMR pourraient correspondre à '${type}': ${selection}`);
|
||||
ui.notifications.warn(`Plusieurs types de TMR pourraient correspondre à '${type}': ${selection.map(it => it.name)}`);
|
||||
return undefined;
|
||||
}
|
||||
return selection[0];
|
||||
return selection[0]
|
||||
}
|
||||
|
||||
static typeTmrName(type) {
|
||||
@ -320,7 +320,7 @@ export class TMRUtility {
|
||||
/* -------------------------------------------- */
|
||||
static deplacement(coordOrig, moveName) {
|
||||
const tmrMove = TMR_MOVE[moveName];
|
||||
if (! tmrMove) {
|
||||
if (!tmrMove) {
|
||||
ui.notifications.error(`Le déplacement dans les TMR '${moveName}' est inconnu`)
|
||||
return coordOrig
|
||||
}
|
||||
|
Reference in New Issue
Block a user