Compare commits
3 Commits
c1066d70f6
...
a7666ec307
Author | SHA1 | Date | |
---|---|---|---|
a7666ec307 | |||
0773493851 | |||
da982678b7 |
@ -1800,17 +1800,14 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
};
|
||||
RollDataAjustements.calcul(rollData, this);
|
||||
await RdDResolutionTable.rollData(rollData);
|
||||
this._gererExperience(rollData);
|
||||
this.gererExperience(rollData);
|
||||
await RdDRollResult.displayRollData(rollData, this)
|
||||
return rollData.rolled;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
gererExperience(rollData) {
|
||||
const callback = this.createCallbackExperience();
|
||||
if (callback.condition(rollData)) {
|
||||
callback.action(rollData);
|
||||
}
|
||||
this.createCallbackExperience().action(rollData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -4,9 +4,9 @@ const RARETE_FREQUENTE = { code: 'Frequente', label: 'Fréquente', frequence: 18
|
||||
const RARETE_RARE = { code: 'Rare', label: 'Rare', frequence: 6, min: 3, max: 12 };
|
||||
const RARETE_RARISSIME = { code: 'Rarissime', label: 'Rarissime', frequence: 2, min: 1, max: 4 };
|
||||
const RARETE_INEXISTANT = { code: 'Inexistant', label: 'Inexistant', frequence: 0, min: 0, max: 0 };
|
||||
const RARETE_EGALE = { code: 'eqal', label: 'Egal', frequence: 1, min: 1, max: 1 };
|
||||
const RARETE_EGALE = { code: 'egal', label: 'Egal', frequence: 1, min: 1, max: 1 };
|
||||
|
||||
const RARETES = [
|
||||
export const RARETES = [
|
||||
RARETE_COMMUNE,
|
||||
RARETE_FREQUENTE,
|
||||
RARETE_RARE,
|
||||
|
@ -238,7 +238,7 @@ export class Misc {
|
||||
/* -------------------------------------------- */
|
||||
static findFirstLike(value, elements, options = {}) {
|
||||
options = foundry.utils.mergeObject(DEFAULT_FIND_OPTIONS, options, { overwrite: true, inplace: false });
|
||||
const subset = this.findAllLike(value, elements, options);
|
||||
const subset = this.findAllLike(value, elements, options)
|
||||
if (subset.length == 0) {
|
||||
console.log(`Aucune ${options.description} pour ${value}`);
|
||||
return undefined
|
||||
@ -263,7 +263,8 @@ export class Misc {
|
||||
}
|
||||
value = Grammar.toLowerCaseNoAccent(value);
|
||||
const subset = elements.filter(options.preFilter)
|
||||
.filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value));
|
||||
.filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value))
|
||||
.sort(Misc.ascending(it => options.mapper? options.mapper(it) : it))
|
||||
if (subset.length == 0) {
|
||||
options.onMessage(`Pas de ${options.description} correspondant à ${value}`);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user