Correction expérience sur résistance

This commit is contained in:
2025-11-13 00:10:08 +01:00
parent 659ddbd0a4
commit 878efab321
7 changed files with 38 additions and 14 deletions
+2 -1
View File
@@ -15,8 +15,9 @@
- jets suite à appel à la chance - jets suite à appel à la chance
- gestion des écailles d'efficacité sur les armes - gestion des écailles d'efficacité sur les armes
- permettre de faire une attaque même si l'initiative n'est pas faite - permettre de faire une attaque même si l'initiative n'est pas faite
- Les messages de défense s'affichent correctement avec plusieurs joueurs - les messages de défense s'affichent correctement avec plusieurs joueurs
- les particulières en force/rapidité sont correctement affichées dans le tchat - les particulières en force/rapidité sont correctement affichées dans le tchat
- l'expérience sur jet de résistance est limitée à 1 point
## 13.0.18 - Le reflet d'Illysis ## 13.0.18 - Le reflet d'Illysis
+1 -1
View File
@@ -208,7 +208,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
} }
// Points de reve actuel // Points de reve actuel
this.html.find('.roll-reve-actuel').click(async event => await this.actor.rollCarac(CARACS.REVE_ACTUEL, { resistance: true })) this.html.find('.roll-reve-actuel').click(async event => await this.actor.rollReveActuel({ resistance: true }))
this.html.find('.action-empoignade').click(async event => await RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor))) this.html.find('.action-empoignade').click(async event => await RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
this.html.find('.roll-arme').click(async event => { this.html.find('.roll-arme').click(async event => {
+3 -2
View File
@@ -1636,7 +1636,8 @@ export class RdDActor extends RdDBaseActorSang {
return return
} }
hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM) hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM)
let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence, rollData.jetResistance); let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence,
rollData.v2 ? rollData.type.resistance : rollData.jetResistance);
if (xpData.length) { if (xpData.length) {
const content = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.hbs`, { const content = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.hbs`, {
actor: this, actor: this,
@@ -2264,7 +2265,7 @@ export class RdDActor extends RdDBaseActorSang {
const xpCompetence = competence ? xp - xpCarac : 0; const xpCompetence = competence ? xp - xpCarac : 0;
if (jetResistance) { if (jetResistance) {
const message = `Jet de résistance ${jetResistance}, l'expérience est limitée à 1`; const message = `Jet de résistance, l'expérience est limitée à 1`;
ui.notifications.info(message); ui.notifications.info(message);
console.log(message) console.log(message)
// max 1 xp sur jets de résistance // max 1 xp sur jets de résistance
+28 -3
View File
@@ -26,7 +26,7 @@ import { BASE_CORPS_A_CORPS, BASE_ESQUIVE, POSSESSION_SANS_DRACONIC } from "../i
import { RollDataAjustements } from "../rolldata-ajustements-v1.js"; import { RollDataAjustements } from "../rolldata-ajustements-v1.js";
import { MappingCreatureArme } from "../item/mapping-creature-arme.mjs"; import { MappingCreatureArme } from "../item/mapping-creature-arme.mjs";
import RollDialog from "../roll/roll-dialog.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 { OptionsAvancees, ROLL_DIALOG_V2 } from "../settings/options-avancees.js";
import { PART_COMP } from "../roll/roll-part-comp.mjs"; 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 = {}) { async rollCarac(caracName, options = {}) {
if (Grammar.equalsInsensitive(caracName, CARACS.TAILLE)) { if (Grammar.equalsInsensitive(caracName, CARACS.TAILLE)) {
return return
@@ -365,10 +385,15 @@ export class RdDBaseActorReve extends RdDBaseActor {
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) { if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
const rollData = { const rollData = {
ids: { actorId: this.id }, 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: { selected: {
carac: { key: caracName }, 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) return await RollDialog.create(rollData, options)
+1 -1
View File
@@ -77,7 +77,7 @@ export class RollDialogAdapter {
const compKey = rollData.current.comp?.key const compKey = rollData.current.comp?.key
if (compKey) { if (compKey) {
rollData.competence = rollData.refs[PART_COMP].all.find(it => it.key == compKey)?.comp rollData.competence = rollData.refs[PART_COMP].all.find(it => it.key == compKey)?.comp
rollData.jetResistance = rollData.type.jetResistance rollData.jetResistance = rollData.type.resistance
} }
if (rollData.type.current == ROLL_TYPE_OEUVRE) { if (rollData.type.current == ROLL_TYPE_OEUVRE) {
const oeuvreKey = rollData.current.oeuvre?.key const oeuvreKey = rollData.current.oeuvre?.key
+3 -5
View File
@@ -16,11 +16,9 @@ export class RollPartCarac extends RollPartSelect {
const selected = this.getSelected(rollData) const selected = this.getSelected(rollData)
const actor = rollData.active.actor const actor = rollData.active.actor
refs.all = [...this.$getActorCaracs(actor), ...this.$getCaracCompetenceCreature(actor)] refs.all = [...this.$getActorCaracs(actor), ...this.$getCaracCompetenceCreature(actor)]
.filter(c => !selected.forced || if (selected.forced && selected.key) {
(selected.key ? refs.all = refs.all.filter(c => c.key == selected.key || Grammar.includesLowerCaseNoAccent(c.label, selected.key))
Grammar.includesLowerCaseNoAccent(c.label, selected.key) }
: c.key == '')
)
refs.caracs = refs.all refs.caracs = refs.all
this.$selectCarac(rollData) this.$selectCarac(rollData)
} }
-1
View File
@@ -23,7 +23,6 @@ export class RollType {
setRollDataType(rollData) { setRollDataType(rollData) {
rollData.type.opposed = rollData.opponent != undefined rollData.type.opposed = rollData.opponent != undefined
rollData.type.resistance = false /** TODO */
} }
onSelect(rollData) { onSelect(rollData) {