Type de jet: Jet de résistance

This commit is contained in:
2026-05-09 23:14:28 +02:00
parent f17996b1c8
commit aec4364889
7 changed files with 83 additions and 19 deletions

View File

@@ -10,6 +10,7 @@ export const ROLL_TYPE_OEUVRE = 'oeuvre'
export const ROLL_TYPE_SORT = 'sort'
export const ROLL_TYPE_TACHE = 'tache'
export const ROLL_TYPE_APPEL_CHANCE = 'appel-chance'
export const ROLL_TYPE_REVE_RESISTANCE = 'reve-resistance'
export const ATTAQUE_ROLL_TYPES = [ROLL_TYPE_ATTAQUE]
export const COMBAT_ROLL_TYPES = [ROLL_TYPE_ATTAQUE, ROLL_TYPE_DEFENSE]

View File

@@ -51,6 +51,7 @@ import { RollTypePossession } from "./roll-type-possession.mjs";
import { RollPartPossession } from "./roll-part-possession.mjs";
import { RollPartApprecier } from "./roll-part-apprecier.mjs";
import { RollTypeAppelChance } from "./roll-type-appel-chance.mjs";
import { RollTypeReveResistance } from "./roll-type-resistance.mjs";
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api
@@ -67,7 +68,7 @@ export const ALL_ROLL_TYPES = [
new RollTypeOeuvre(),
new RollTypeJeu(),
new RollTypeAppelChance(),
// new RollTypeResistance ??
new RollTypeReveResistance(),
// new RollTypeFixedCarac ??
]

View File

@@ -2,19 +2,6 @@ import { CARACS } from "../rdd-carac.js"
import { DIFF, ROLL_TYPE_APPEL_CHANCE } from "./roll-constants.mjs"
import { RollType } from "./roll-type.mjs"
const SPECIAL_ROLL_TYPES_DETAILS = {
label: "fait appel à la chance",
icon: `systems/foundryvtt-reve-de-dragon/assets/ui/chance.svg`,
rollData: {
selected: {
carac: { key: CARACS.CHANCE_ACTUELLE, forced: true },
diff: { value: 0, type: '' },
comp: { key: '', forced: true },
conditions: { hide: true }
}
}
}
export class RollTypeAppelChance extends RollType {
get code() { return ROLL_TYPE_APPEL_CHANCE }
get name() { return `fait appel à la chance` }

View File

@@ -0,0 +1,31 @@
import { CARACS } from "../rdd-carac.js"
import { DIFF, ROLL_TYPE_REVE_RESISTANCE } from "./roll-constants.mjs"
import { RollType } from "./roll-type.mjs"
export class RollTypeReveResistance extends RollType {
get code() { return ROLL_TYPE_REVE_RESISTANCE }
get name() { return `fait un jet de résistance` }
get icon() { return `systems/foundryvtt-reve-de-dragon/assets/ui/resistance.svg` }
get chatResultTemplate() { return `systems/foundryvtt-reve-de-dragon/templates/roll/result/chat-reve-resistance.hbs` }
title(rollData) {
return this.name
}
setRollDataType(rollData) {
foundry.utils.mergeObject(rollData, {
selected: {
carac: { key: CARACS.REVE_ACTUEL, forced: true },
diff: { value: -8, type: '' },
comp: { key: '', forced: true },
conditions: { hide: true }
}
})
super.setRollDataType(rollData)
}
onSelect(rollData) {
this.setDiffType(rollData, DIFF.DEFAUT)
}
}