Refonte complète : dialogues de jet + messages de chat
- Nouveau layout roll-dialog.hbs : header, grille lune 3×3, sélecteur visibility, ligne Destin avec compteur disponible, preview formule améliorée - Fix JS : data-moon-bonus sur chaque option, formule − si négatif - Fix roll.mjs : passe destActuel au dialog, déduit automatiquement 1 point de Destin (system.destin.lvl++) après chaque jet avec Destin - character.mjs : passe destActuel = 8 - destin.lvl au prompt() - chat-message.hbs : icônes résultat (✦✦/✖✖ pour critiques), label Formule, margin-badge right-aligned vs difficulté left-aligned - roll.less : refonte complète couleurs (#0c4c0c/#e07b00), grille lune, destin row, visibility subtil, bandeau critiques améliorés - lang/fr.json : clés Roll.visibility*, destinAvailable, destinNone, destinBonus, formula Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -69,6 +69,7 @@ export class CelestopolRoll extends Roll {
|
||||
moonPhaseChoices,
|
||||
defaultDifficulty: options.difficulty ?? "normal",
|
||||
defaultMoonPhase: options.moonPhase ?? "none",
|
||||
destActuel: options.destActuel ?? null,
|
||||
}
|
||||
|
||||
const content = await foundry.applications.handlebars.renderTemplate(
|
||||
@@ -142,8 +143,18 @@ export class CelestopolRoll extends Roll {
|
||||
roll.computeResult()
|
||||
await roll.toMessage({}, { rollMode: rollData.rollMode })
|
||||
|
||||
// Mémoriser les préférences sur l'acteur
|
||||
// Déduire automatiquement 1 point de Destin si utilisé
|
||||
const actor = game.actors.get(options.actorId)
|
||||
if (useDestin && actor && (options.destActuel ?? 1) > 0) {
|
||||
const currentLvl = actor.system.destin?.lvl ?? 0
|
||||
const newLvl = Math.min(8, currentLvl + 1)
|
||||
await actor.update({
|
||||
"system.destin.lvl": newLvl,
|
||||
[`system.destin.d${newLvl}.checked`]: true,
|
||||
})
|
||||
}
|
||||
|
||||
// Mémoriser les préférences sur l'acteur
|
||||
if (actor) {
|
||||
await actor.update({
|
||||
"system.prefs.moonPhase": moonPhase,
|
||||
|
||||
@@ -177,18 +177,19 @@ export default class CelestopolCharacter extends foundry.abstract.TypeDataModel
|
||||
if (!skill) return null
|
||||
|
||||
return CelestopolRoll.prompt({
|
||||
actorId: this.parent.id,
|
||||
actorName: this.parent.name,
|
||||
actorImage: this.parent.img,
|
||||
actorId: this.parent.id,
|
||||
actorName: this.parent.name,
|
||||
actorImage: this.parent.img,
|
||||
statId,
|
||||
skillId,
|
||||
statLabel: SYSTEM.STATS[statId]?.label,
|
||||
skillLabel: skill.label,
|
||||
skillValue: skill.value,
|
||||
woundMalus: this.getWoundMalus(),
|
||||
woundLevel: this.blessures.lvl,
|
||||
moonPhase: this.prefs.moonPhase,
|
||||
difficulty: this.prefs.difficulty,
|
||||
statLabel: SYSTEM.STATS[statId]?.label,
|
||||
skillLabel: skill.label,
|
||||
skillValue: skill.value,
|
||||
woundMalus: this.getWoundMalus(),
|
||||
woundLevel: this.blessures.lvl,
|
||||
moonPhase: this.prefs.moonPhase,
|
||||
difficulty: this.prefs.difficulty,
|
||||
destActuel: Math.max(0, 8 - (this.destin.lvl ?? 0)),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user