Correction expérience sur résistance
This commit is contained in:
@@ -26,7 +26,7 @@ import { BASE_CORPS_A_CORPS, BASE_ESQUIVE, POSSESSION_SANS_DRACONIC } from "../i
|
||||
import { RollDataAjustements } from "../rolldata-ajustements-v1.js";
|
||||
import { MappingCreatureArme } from "../item/mapping-creature-arme.mjs";
|
||||
import RollDialog from "../roll/roll-dialog.mjs";
|
||||
import { ATTAQUE_ROLL_TYPES, DEFAULT_ROLL_TYPES, DIFF, ROLL_TYPE_ATTAQUE, ROLL_TYPE_COMP, ROLL_TYPE_JEU, ROLL_TYPE_MEDITATION, ROLL_TYPE_OEUVRE, ROLL_TYPE_TACHE } from "../roll/roll-constants.mjs";
|
||||
import { ATTAQUE_ROLL_TYPES, DEFAULT_ROLL_TYPES, DIFF, DIFFS, ROLL_TYPE_ATTAQUE, ROLL_TYPE_COMP, ROLL_TYPE_JEU, ROLL_TYPE_MEDITATION, ROLL_TYPE_OEUVRE, ROLL_TYPE_TACHE } from "../roll/roll-constants.mjs";
|
||||
import { OptionsAvancees, ROLL_DIALOG_V2 } from "../settings/options-avancees.js";
|
||||
import { PART_COMP } from "../roll/roll-part-comp.mjs";
|
||||
|
||||
@@ -358,6 +358,26 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
})
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollReveActuel({ diff = 0, resistance = false }) {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: [PART_COMP],
|
||||
current: PART_COMP,
|
||||
resistance: resistance
|
||||
},
|
||||
selected: {
|
||||
carac: { key: CARACS.REVE_ACTUEL, forced: true },
|
||||
comp: resistance ? { key: undefined, forced: true } : undefined,
|
||||
diff: { type: DIFF.DEFAUT, value: diff }
|
||||
}
|
||||
}
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
return this.rollCarac(CARACS.REVE_ACTUEL, { diff, resistance })
|
||||
}
|
||||
|
||||
async rollCarac(caracName, options = {}) {
|
||||
if (Grammar.equalsInsensitive(caracName, CARACS.TAILLE)) {
|
||||
return
|
||||
@@ -365,10 +385,15 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: DEFAULT_ROLL_TYPES, current: PART_COMP },
|
||||
type: {
|
||||
allowed: options.resistance ? [PART_COMP] : DEFAULT_ROLL_TYPES,
|
||||
current: PART_COMP,
|
||||
resistance: options.resistance
|
||||
},
|
||||
selected: {
|
||||
carac: { key: caracName },
|
||||
comp: options.resistance ? { key: undefined, forced: true } : undefined
|
||||
comp: options.resistance ? { key: undefined, forced: true } : undefined,
|
||||
diff: { type: DIFF.DEFAUT, value: options.diff ?? 0 }
|
||||
}
|
||||
}
|
||||
return await RollDialog.create(rollData, options)
|
||||
|
||||
Reference in New Issue
Block a user