Fi saves and challenges rolls

This commit is contained in:
LeRatierBretonnien 2024-12-30 10:29:42 +01:00
parent ddf547b959
commit a7f7e26d01
33 changed files with 193 additions and 147 deletions

View File

@ -314,7 +314,7 @@ i.lethalfantasy {
.lethalfantasy .character-main .character-saves .character-save { .lethalfantasy .character-main .character-saves .character-save {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 1rem; margin-right: 0.2rem;
} }
.lethalfantasy .character-main .character-saves .character-save .rollable:hover, .lethalfantasy .character-main .character-saves .character-save .rollable:hover,
.lethalfantasy .character-main .character-saves .character-save .rollable:focus { .lethalfantasy .character-main .character-saves .character-save .rollable:focus {
@ -322,12 +322,13 @@ i.lethalfantasy {
cursor: pointer; cursor: pointer;
} }
.lethalfantasy .character-main .character-saves .character-save .name { .lethalfantasy .character-main .character-saves .character-save .name {
flex: 1; flex: 0;
min-width: 3rem; min-width: 5rem;
margin-left: 0.5rem; max-width: 5rem;
margin-left: 0.7rem;
} }
.lethalfantasy .character-main .character-saves .character-save .form-group { .lethalfantasy .character-main .character-saves .character-save .form-group {
flex: 1; flex: 0;
padding-left: 5px; padding-left: 5px;
} }
.lethalfantasy .character-main .character-saves .character-save .form-group .form-fields { .lethalfantasy .character-main .character-saves .character-save .form-group .form-fields {

View File

@ -478,6 +478,8 @@
"Platinums": "Platinum" "Platinums": "Platinum"
}, },
"Label": { "Label": {
"titleChallenge": "Challenge",
"titleSave": "Save",
"Movement": "Movement", "Movement": "Movement",
"movement": { "movement": {
"walk": "Walk", "walk": "Walk",
@ -550,6 +552,7 @@
}, },
"Roll": { "Roll": {
"save": "Save roll {save}", "save": "Save roll {save}",
"modifierBonusMalus": "Modifier bonus/malus",
"changeDice": "Change dice", "changeDice": "Change dice",
"damage": "Jet de dégâts <br> {item}", "damage": "Jet de dégâts <br> {item}",
"attack": "Jet d'attaque <br> {item}", "attack": "Jet d'attaque <br> {item}",

View File

@ -172,14 +172,15 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
console.log(event, target) console.log(event, target)
const rollType = event.target.dataset.rollType const rollType = event.target.dataset.rollType
let rollTarget let rollTarget
let rollKey = event.target.dataset.rollKey
switch (rollType) { switch (rollType) {
case "challenge": case "challenge":
let rollKey = event.target.dataset.rollKey
rollTarget = foundry.utils.duplicate(this.document.system.challenges[rollKey]) rollTarget = foundry.utils.duplicate(this.document.system.challenges[rollKey])
rollTarget.rollKey = rollKey rollTarget.rollKey = rollKey
break break
case ROLL_TYPE.RESOURCE: case "save":
rollTarget = elt.dataset.rollTarget rollTarget = foundry.utils.duplicate(this.document.system.saves[rollKey])
rollTarget.rollKey = rollKey
break break
case ROLL_TYPE.DAMAGE: case ROLL_TYPE.DAMAGE:
rollTarget = elt.dataset.itemId rollTarget = elt.dataset.itemId

View File

@ -71,7 +71,9 @@ export const CHOICE_DICE = {
"D4": "D4", "D4": "D4",
"D6": "D6", "D6": "D6",
"D8": "D8", "D8": "D8",
"D10": "D10" "D10": "D10",
"D12": "D12",
"D20": "D20"
} }
export const CHOICE_MODIFIERS = { export const CHOICE_MODIFIERS = {

View File

@ -12,20 +12,8 @@ export default class LethalFantasyRoll extends Roll {
return this.options.type return this.options.type
} }
get isChallenge() { get titleFormula() {
return this.type === "challenge" return this.options.titleFormula
}
get isSave() {
return this.type === ROLL_TYPE.SAVE
}
get isResource() {
return this.type === ROLL_TYPE.RESOURCE
}
get isDamage() {
return this.type === ROLL_TYPE.DAMAGE
} }
get target() { get target() {
@ -167,14 +155,14 @@ export default class LethalFantasyRoll extends Roll {
static async prompt(options = {}) { static async prompt(options = {}) {
let dice = "1D20" let dice = "1D20"
let maxValue = 20 let maxValue = 20
let formula = "1D20" let baseFormula = "1D20"
let modifierFormula = "1d0"
let hasModifier = true let hasModifier = true
let hasChangeDice = false let hasChangeDice = false
if (options.rollType === "challenge") { if (options.rollType === "challenge" || options.rollType === "save") {
if ( options.rollTarget.rollKey === "dying") { if ( options.rollTarget.rollKey === "dying") {
dice = options.rollTarget.value dice = options.rollTarget.value
maxValue = Number(options.rollTarget.value.match(/\d+/)[0]) maxValue = Number(options.rollTarget.value.match(/\d+/)[0])
formula = `${dice}`
hasModifier = false hasModifier = false
hasChangeDice = true hasChangeDice = true
} else { } else {
@ -198,8 +186,7 @@ export default class LethalFantasyRoll extends Roll {
let targetName let targetName
let dialogContext = { let dialogContext = {
isSave: options.rollType === "save", rollType: options.rollType,
isChallenge: options.rollType === "challenge",
rollTarget: options.rollTarget, rollTarget: options.rollTarget,
rollModes, rollModes,
hasModifier, hasModifier,
@ -209,7 +196,7 @@ export default class LethalFantasyRoll extends Roll {
fieldRollMode, fieldRollMode,
choiceModifier, choiceModifier,
choiceDice, choiceDice,
formula, baseFormula,
dice, dice,
hasTarget: options.hasTarget, hasTarget: options.hasTarget,
modifier, modifier,
@ -241,36 +228,40 @@ export default class LethalFantasyRoll extends Roll {
// If the user cancels the dialog, exit // If the user cancels the dialog, exit
if (rollContext === null) return if (rollContext === null) return
let treshold
let fullModifier = 0 let fullModifier = 0
let titleFormula = ""
dice = rollContext.changeDice || dice dice = rollContext.changeDice || dice
if (options.rollType === "challenge") { if (options.rollType === "challenge" || options.rollType === "save") {
if (hasModifier) { if (hasModifier) {
let bonus = (options.rollTarget.rollKey === "dying") ? 0 : Number(options.rollTarget.value) let bonus = Number(options.rollTarget.value)
fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus
if (fullModifier < 0) { if (fullModifier === 0) {
modifierFormula = "0"
} else {
let modAbs = Math.abs(fullModifier) let modAbs = Math.abs(fullModifier)
formula = `${dice} - (d${modAbs + 1} - 1)` modifierFormula = `d${modAbs + 1} - 1`
} else if (fullModifier > 0) {
formula = `${dice} + (d${fullModifier + 1} - 1)`
} else {
formula = `${dice} + 1d0`
} }
let sign = fullModifier < 0 ? "-" : "+"
titleFormula = `${dice}E ${sign} ${modifierFormula}`
} else { } else {
modifierFormula = "0"
fullModifier = 0 fullModifier = 0
formula = `${dice}` baseFormula = `${dice}`
titleFormula = `${dice}E`
} }
} }
maxValue = Number(dice.match(/\d+/)[0]) maxValue = Number(baseFormula.match(/\d+$/)[0]) // Update the max value agains
const rollData = { const rollData = {
type: options.rollType, type: options.rollType,
rollType: options.rollType,
target: options.rollTarget, target: options.rollTarget,
actorId: options.actorId, actorId: options.actorId,
actorName: options.actorName, actorName: options.actorName,
actorImage: options.actorImage, actorImage: options.actorImage,
rollMode: rollContext.visibility, rollMode: rollContext.visibility,
hasTarget: options.hasTarget, hasTarget: options.hasTarget,
titleFormula,
targetName, targetName,
...rollContext, ...rollContext,
} }
@ -285,39 +276,45 @@ export default class LethalFantasyRoll extends Roll {
*/ */
if (Hooks.call("fvtt-lethal-fantasy.preRoll", options, rollData) === false) return if (Hooks.call("fvtt-lethal-fantasy.preRoll", options, rollData) === false) return
const roll = new this(formula, options.data, rollData) const rollBase = new this(baseFormula, options.data, rollData)
await roll.evaluate() await rollBase.evaluate()
const rollModifier = new Roll(modifierFormula, options.data, rollData)
await rollModifier.evaluate()
let rollTotal = -1 let rollTotal = -1
let diceResults = [] let diceResults = []
let resultType let resultType
if (options.rollType === "challenge") { if (options.rollType === "challenge" || options.rollType === "save") {
let d20result = roll.dice[0].results[0].result let diceResult = rollBase.dice[0].results[0].result
diceResults.push({ dice: `${dice}`, value: d20result}) diceResults.push({ dice: `${dice}`, value: diceResult})
let d20sum = d20result let diceSum = diceResult
while (d20result === maxValue) { while (diceResult === maxValue) {
let r = await new Roll(`${dice}`).evaluate() let r = await new Roll(baseFormula).evaluate()
d20result = r.dice[0].results[0].result diceResult = r.dice[0].results[0].result
diceResults.push( {dice: `${dice}-1`, value: d20result-1}) diceResults.push( {dice: `${dice}-1`, value: diceResult-1})
d20sum += (d20result - 1) diceSum += (diceResult - 1)
} }
if (hasModifier) { if (fullModifier !== 0) {
let minus1 = (fullModifier === 0) ? 0 : 1 diceResults.push({ dice: `${rollModifier.formula}`, value: rollModifier.total })
diceResults.push({ dice: `${roll.dice[1].formula}-${minus1}`, value: roll.dice[1].results[0].result - minus1 }) if ( fullModifier < 0) {
rollTotal = Math.max(d20sum + roll.dice[1].results[0].result - minus1, 0) rollTotal = Math.max(diceSum - rollModifier.total, 0)
} else { } else {
rollTotal = d20sum rollTotal = diceSum + rollModifier.total
}
} else {
rollTotal = diceSum
} }
} else if (options.rollType === ROLL_TYPE.RESOURCE) { } else if (options.rollType === ROLL_TYPE.RESOURCE) {
//resultType = roll.total === 1 || roll.total === 2 ? "failure" : "success" //resultType = roll.total === 1 || roll.total === 2 ? "failure" : "success"
} }
roll.options.resultType = resultType rollBase.options.resultType = resultType
roll.options.introText = roll._createIntroText() rollBase.options.introText = rollBase._createIntroText()
roll.options.introTextTooltip = roll._createIntroTextTooltip() rollBase.options.introTextTooltip = rollBase._createIntroTextTooltip()
roll.options.rollTotal = rollTotal rollBase.options.rollTotal = rollTotal
roll.options.diceResults = diceResults rollBase.options.diceResults = diceResults
roll.options.rollTarget = options.rollTarget rollBase.options.rollTarget = options.rollTarget
rollBase.options.titleFormula = titleFormula
/** /**
* A hook event that fires after the roll has been made. * A hook event that fires after the roll has been made.
@ -328,9 +325,9 @@ export default class LethalFantasyRoll extends Roll {
@param {LethalFantasyRoll} roll The resulting roll. @param {LethalFantasyRoll} roll The resulting roll.
* @returns {boolean} Explicitly return `false` to prevent roll to be made. * @returns {boolean} Explicitly return `false` to prevent roll to be made.
*/ */
if (Hooks.call("fvtt-lethal-fantasy.Roll", options, rollData, roll) === false) return if (Hooks.call("fvtt-lethal-fantasy.Roll", options, rollData, rollBase) === false) return
return roll return rollBase
} }
/** /**
@ -343,9 +340,9 @@ export default class LethalFantasyRoll extends Roll {
static createTitle(type, target) { static createTitle(type, target) {
switch (type) { switch (type) {
case "challenge": case "challenge":
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleSave")} : ${game.i18n.localize(`LETHALFANTASY.Manager.${target}`)}` return `${game.i18n.localize("LETHALFANTASY.Label.titleChallenge")}`
case ROLL_TYPE.RESOURCE: case "save":
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleResource")} : ${game.i18n.localize(`LETHALFANTASY.Manager.${target}`)}` return `${game.i18n.localize("LETHALFANTASY.Label.titleSave")}`
case ROLL_TYPE.DAMAGE: case ROLL_TYPE.DAMAGE:
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleDamage")} : ${target}` return `${game.i18n.localize("LETHALFANTASY.Dialog.titleDamage")} : ${target}`
case ROLL_TYPE.ATTACK: case ROLL_TYPE.ATTACK:
@ -395,11 +392,10 @@ export default class LethalFantasyRoll extends Roll {
diceTotal: this.dice.reduce((t, d) => t + d.total, 0), diceTotal: this.dice.reduce((t, d) => t + d.total, 0),
isGM: game.user.isGM, isGM: game.user.isGM,
formula: this.formula, formula: this.formula,
titleFormula: this.titleFormula,
rollType: this.type, rollType: this.type,
rollTarget: this.rollTarget, rollTarget: this.rollTarget,
total: this.rollTotal, total: this.rollTotal,
isSave: this.isSave,
isChallenge: this.isChallenge,
isFailure: this.isFailure, isFailure: this.isFailure,
actorId: this.actorId, actorId: this.actorId,
diceResults: this.diceResults, diceResults: this.diceResults,

BIN
packs/lf-equipment/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/MANIFEST-000042 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/MANIFEST-000046 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
packs/lf-gifts/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/MANIFEST-000038 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/MANIFEST-000042 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
packs/lf-skills/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/MANIFEST-000042 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/MANIFEST-000046 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
packs/lf-vulnerabilities/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/MANIFEST-000038 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/MANIFEST-000042 (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -201,19 +201,20 @@
.character-save { .character-save {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 1rem; margin-right: 0.2rem;
.rollable:hover, .rollable:hover,
.rollable:focus { .rollable:focus {
text-shadow: 0 0 8px var(--color-shadow-primary); text-shadow: 0 0 8px var(--color-shadow-primary);
cursor: pointer; cursor: pointer;
} }
.name { .name {
flex: 1; flex: 0;
min-width: 3rem; min-width: 5rem;
margin-left: 0.5rem; max-width: 5rem;
margin-left: 0.7rem;
} }
.form-group { .form-group {
flex: 1; flex: 0;
padding-left: 5px; padding-left: 5px;
.form-fields { .form-fields {
flex: none; flex: none;

View File

@ -19,21 +19,27 @@
</div> </div>
<div class="flexrow character-hp"> <div class="flexrow character-hp">
<span class="name">{{localize "LETHALFANTASY.Label.perception"}}</span> <span class="name">{{localize "LETHALFANTASY.Label.perception"}}</span>
{{formInput systemFields.perception.fields.value value=system.perception.value disabled=isPlayMode classes="character-hp"}} {{formInput systemFields.perception.fields.value value=system.perception.value disabled=isPlayMode
classes="character-hp"}}
<span class="name">{{localize "LETHALFANTASY.Label.bonus"}}</span> <span class="name">{{localize "LETHALFANTASY.Label.bonus"}}</span>
{{formInput systemFields.perception.fields.bonus value=system.perception.bonus disabled=isPlayMode classes="character-hp"}} {{formInput systemFields.perception.fields.bonus value=system.perception.bonus disabled=isPlayMode
classes="character-hp"}}
</div> </div>
<div class="flexrow character-hp"> <div class="flexrow character-hp">
<span class="name">{{localize "LETHALFANTASY.Label.grit"}}</span> <span class="name">{{localize "LETHALFANTASY.Label.grit"}}</span>
{{formInput systemFields.grit.fields.current value=system.grit.current disabled=isPlayMode classes="character-hp"}} {{formInput systemFields.grit.fields.current value=system.grit.current disabled=isPlayMode
classes="character-hp"}}
<span class="name">{{localize "LETHALFANTASY.Label.gritEarned"}}</span> <span class="name">{{localize "LETHALFANTASY.Label.gritEarned"}}</span>
{{formInput systemFields.grit.fields.earned value=system.grit.earned disabled=isPlayMode classes="character-hp"}} {{formInput systemFields.grit.fields.earned value=system.grit.earned disabled=isPlayMode
classes="character-hp"}}
</div> </div>
<div class="flexrow character-hp"> <div class="flexrow character-hp">
<span class="name">{{localize "LETHALFANTASY.Label.luck"}}</span> <span class="name">{{localize "LETHALFANTASY.Label.luck"}}</span>
{{formInput systemFields.luck.fields.current value=system.luck.current disabled=isPlayMode classes="character-hp"}} {{formInput systemFields.luck.fields.current value=system.luck.current disabled=isPlayMode
classes="character-hp"}}
<span class="name">{{localize "LETHALFANTASY.Label.luckEarned"}}</span> <span class="name">{{localize "LETHALFANTASY.Label.luckEarned"}}</span>
{{formInput systemFields.luck.fields.earned value=system.luck.earned disabled=isPlayMode classes="character-hp"}} {{formInput systemFields.luck.fields.earned value=system.luck.earned disabled=isPlayMode
classes="character-hp"}}
</div> </div>
</fieldset> </fieldset>
@ -51,26 +57,53 @@
<legend>{{localize "LETHALFANTASY.Label.Saves"}}</legend> <legend>{{localize "LETHALFANTASY.Label.Saves"}}</legend>
<div class="character-saves"> <div class="character-saves">
<div class="character-save"> <div class="character-save">
<span class="name">{{localize "LETHALFANTASY.Label.saves.will"}}</span> <span class="name"><a class="rollable" data-roll-type="save" data-roll-key="will"><i
{{formField systemFields.saves.fields.will.fields.value value=system.saves.will.value disabled=isPlayMode class="lf-roll-small fa-solid fa-dice-d20"></i>
classes="rollable" data-save-id="will" }} {{localize "LETHALFANTASY.Label.saves.will"}}
<span class="name">{{localize "LETHALFANTASY.Label.saves.dodge"}}</span> </a></span>
{{formField systemFields.saves.fields.dodge.fields.value value=system.saves.dodge.value disabled=isPlayMode {{formField systemFields.saves.fields.will.fields.value value=system.saves.will.value
classes="rollable" data-save-id="dodge" }} disabled=isPlayMode}}
<span class="name">{{localize "LETHALFANTASY.Label.saves.toughness"}}</span> <span class="name">
<a class="rollable" data-roll-type="save" data-roll-key="dodge"><i
class="lf-roll-small fa-solid fa-dice-d20"></i>
{{localize "LETHALFANTASY.Label.saves.dodge"}}
</a>
</span>
{{formField systemFields.saves.fields.dodge.fields.value value=system.saves.dodge.value
disabled=isPlayMode}}
<span class="name">
<a class="rollable" data-roll-type="save" data-roll-key="toughness"><i
class="lf-roll-small fa-solid fa-dice-d20"></i>
{{localize "LETHALFANTASY.Label.saves.toughness"}}
</a>
</span>
{{formField systemFields.saves.fields.toughness.fields.value value=system.saves.toughness.value {{formField systemFields.saves.fields.toughness.fields.value value=system.saves.toughness.value
disabled=isPlayMode classes="rollable" data-save-id="toughness" }} disabled=isPlayMode}}
</div> </div>
<div class="character-save"> <div class="character-save">
<span class="name">{{localize "LETHALFANTASY.Label.saves.contagion"}}</span> <span class="name">
<a class="rollable" data-roll-type="save" data-roll-key="contagion"><i
class="lf-roll-small fa-solid fa-dice-d20"></i>
{{localize "LETHALFANTASY.Label.saves.contagion"}}
</a>
</span>
{{formField systemFields.saves.fields.contagion.fields.value value=system.saves.contagion.value {{formField systemFields.saves.fields.contagion.fields.value value=system.saves.contagion.value
disabled=isPlayMode classes="rollable" data-save-id="contagion" }} disabled=isPlayMode }}
<span class="name">{{localize "LETHALFANTASY.Label.saves.poison"}}</span>
<span class="name">
<a class="rollable" data-roll-type="save" data-roll-key="poison"><i
class="lf-roll-small fa-solid fa-dice-d20"></i>
{{localize "LETHALFANTASY.Label.saves.poison"}}
</a>
</span>
{{formField systemFields.saves.fields.poison.fields.value value=system.saves.poison.value {{formField systemFields.saves.fields.poison.fields.value value=system.saves.poison.value
disabled=isPlayMode classes="rollable" data-save-id="poison" }} disabled=isPlayMode }}
<span class="name">{{localize "LETHALFANTASY.Label.saves.pain"}}</span>
{{formField systemFields.saves.fields.pain.fields.value value=system.saves.pain.value disabled=isPlayMode <span class="name">
classes="rollable" data-save-id="pain" }} <a class="rollable" data-roll-type="save" data-roll-key="pain"><i
class="lf-roll-small fa-solid fa-dice-d20"></i>
{{localize "LETHALFANTASY.Label.saves.pain"}}</span>
{{formField systemFields.saves.fields.pain.fields.value value=system.saves.pain.value disabled=isPlayMode}}
</div> </div>
</div> </div>
</fieldset> </fieldset>
@ -79,13 +112,21 @@
<legend>{{localize "LETHALFANTASY.Label.Challenges"}}</legend> <legend>{{localize "LETHALFANTASY.Label.Challenges"}}</legend>
<div class="character-challenges"> <div class="character-challenges">
<div class="character-challenge"> <div class="character-challenge">
<span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="str"><i class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize "LETHALFANTASY.Label.challenges.strength"}}</a></span> <span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="str"><i
{{formField systemFields.challenges.fields.str.fields.value value=system.challenges.str.value disabled=isPlayMode class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
"LETHALFANTASY.Label.challenges.strength"}}</a></span>
{{formField systemFields.challenges.fields.str.fields.value value=system.challenges.str.value
disabled=isPlayMode
}} }}
<span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="agility"><i class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize "LETHALFANTASY.Label.challenges.agility"}}</a></span> <span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="agility"><i
{{formField systemFields.challenges.fields.agility.fields.value value=system.challenges.agility.value disabled=isPlayMode class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
"LETHALFANTASY.Label.challenges.agility"}}</a></span>
{{formField systemFields.challenges.fields.agility.fields.value value=system.challenges.agility.value
disabled=isPlayMode
}} }}
<span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="dying"><i class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize "LETHALFANTASY.Label.challenges.dying"}}</a></span> <span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="dying"><i
class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
"LETHALFANTASY.Label.challenges.dying"}}</a></span>
{{formField systemFields.challenges.fields.dying.fields.value value=system.challenges.dying.value {{formField systemFields.challenges.fields.dying.fields.value value=system.challenges.dying.value
disabled=isPlayMode }} disabled=isPlayMode }}
</div> </div>

View File

@ -8,6 +8,7 @@
<div class="intro-right"> <div class="intro-right">
<span>{{upperFirst rollType}} : {{upperCase rollTarget.rollKey}}</span> <span>{{upperFirst rollType}} : {{upperCase rollTarget.rollKey}}</span>
<span>Formula : {{titleFormula}}</span>
{{#each diceResults as |result|}} {{#each diceResults as |result|}}
<span>{{result.dice}} : {{result.value}}</span> <span>{{result.dice}} : {{result.value}}</span>
{{/each}} {{/each}}
@ -41,8 +42,6 @@
{{#unless isPrivate}} {{#unless isPrivate}}
<div class="dice-result"> <div class="dice-result">
<h4 class="dice-total">{{total}}</h4> <h4 class="dice-total">{{total}}</h4>
<div class="dice-formula">{{formula}}</div>
{{{tooltip}}}
</div> </div>
{{/unless}} {{/unless}}
</div> </div>

View File

@ -1,19 +1,22 @@
{{log "roll-dialog" this}} {{log "roll-dialog" this}}
<div class="lethalfantasy-roll-dialog"> <div class="lethalfantasy-roll-dialog">
{{#if isChallenge}}
<fieldSet> <fieldSet>
{{#if (eq rollType "challenge")}}
<legend>{{localize "LETHALFANTASY.Label.challenge"}}</legend> <legend>{{localize "LETHALFANTASY.Label.challenge"}}</legend>
{{#if hasModifier}}
<div class="dialog-save">{{upperCase rollTarget.rollKey}} : {{formula}} + {{baseValue}}</div>
{{else}} {{else}}
<div class="dialog-save">{{upperCase rollTarget.rollKey}} : {{formula}}</div> <legend>{{localize "LETHALFANTASY.Label.save"}}</legend>
{{/if}}
{{#if hasModifier}}
<div class="dialog-save">{{upperCase rollTarget.rollKey}} : {{baseFormula}} + {{baseValue}}</div>
{{else}}
<div class="dialog-save">{{upperCase rollTarget.rollKey}} : {{baseFormula}}</div>
{{/if}} {{/if}}
</fieldSet> </fieldSet>
{{#if hasModifier}} {{#if hasModifier}}
<fieldSet class="dialog-modifier"> <fieldSet class="dialog-modifier">
<legend>{{localize "LETHALFANTASY.Roll.modifier"}}</legend> <legend>{{localize "LETHALFANTASY.Roll.modifierBonusMalus"}}</legend>
<select name="modifier" data-tooltip-direction="UP"> <select name="modifier" data-tooltip-direction="UP">
{{selectOptions choiceModifier selected=modifier}} {{selectOptions choiceModifier selected=modifier}}
</select> </select>
@ -29,7 +32,6 @@
</fieldSet> </fieldSet>
{{/if}} {{/if}}
{{/if}}
<fieldSet> <fieldSet>
<legend>{{localize "LETHALFANTASY.Roll.visibility"}}</legend> <legend>{{localize "LETHALFANTASY.Roll.visibility"}}</legend>
<select name="visibility"> <select name="visibility">