Rework fiches, jets de dés et CSS

This commit is contained in:
2026-04-03 16:22:51 +02:00
parent e001ec0dc9
commit 1fb80f6abe
21 changed files with 3091 additions and 1316 deletions

View File

@@ -774,7 +774,7 @@ export class MournbladeCYD2Actor extends Actor {
/* -------------------------------------------- */
async rollAttribut(attrKey, isInit = false) {
let rollData = this.getCommonRollData(attrKey)
rollData.multiplier = (isInit) ? 1 : 2
rollData.multiplier = 1 // 1d10 + attr (optionally + attr2 if chosen in dialog)
rollData.isInit = isInit
await MournbladeCYD2RollDialog.create(this, rollData)
}
@@ -842,6 +842,33 @@ export class MournbladeCYD2Actor extends Actor {
await MournbladeCYD2RollDialog.create(this, rollData)
}
/* -------------------------------------------- */
subPointsAme(runeMode, value) {
let ame = foundry.utils.duplicate(this.system.ame)
if (runeMode == "prononcer") {
ame.etat += value
ame.etat = Math.min(ame.etat, ame.nbame)
} else {
ame.max = (ame.max || 0) + value
}
this.update({ 'system.ame': ame })
}
/* -------------------------------------------- */
async rollRune(runeId) {
let comp = this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "savoir : runes")
if (!comp) {
ui.notifications.warn("La compétence « Savoir : Runes » n'a pas été trouvée sur ce personnage.")
return
}
let rollData = this.getCommonRollData("cla", comp.id)
rollData.rune = foundry.utils.duplicate(this.items.get(runeId) || {})
rollData.difficulte = rollData.rune?.system?.seuil || 0
rollData.runemode = "prononcer"
rollData.runeame = 1
await MournbladeCYD2RollDialog.create(this, rollData)
}
/* -------------------------------------------- */
async rollArmeDegats(armeId, targetVigueur = undefined, rollDataInput = undefined) {
let arme = this.items.get(armeId)
@@ -886,6 +913,7 @@ export class MournbladeCYD2Actor extends Actor {
//console.log(roll)
let rollData = {
arme: arme,
diceResult: roll.dice[0]?.total ?? roll.total,
finalResult: roll.total,
formula: roll.formula,
alias: this.name,