Minot fixes

This commit is contained in:
2025-01-22 08:59:31 +01:00
parent 0d0c604496
commit f00a69e9b4
32 changed files with 112 additions and 109 deletions

View File

@ -122,11 +122,11 @@ export default class LethalFantasyRoll extends Roll {
let hasChangeDice = false
let hasD30 = false
let hasFavor = false
let hasMaxValue = true
let hasGrantedDice = false
let hasMaxValue = true
let hasGrantedDice = false
if (options.rollType === "challenge" || options.rollType === "save") {
options.rollName = game.i18n.localize( `LETHALFANTASY.Label.${options.rollTarget.rollKey}` )
options.rollName = game.i18n.localize(`LETHALFANTASY.Label.${options.rollTarget.rollKey}`)
hasD30 = options.rollType === "save"
if (options.rollTarget.rollKey === "dying") {
dice = options.rollTarget.value
@ -168,11 +168,14 @@ export default class LethalFantasyRoll extends Roll {
options.rollTarget.charModifier = 0
}
} else if (options.rollType === "resist") {
dice = "1D20"
maxValue = 20
} else if (options.rollType === "monster-skill") {
options.rollName = game.i18n.localize(`LETHALFANTASY.Label.${options.rollTarget.rollKey}`)
dice = "1D100"
baseFormula = "D100"
maxValue = 100
hasModifier = true
hasFavor = true
options.rollName = options.rollTarget.rollKey
hasChangeDice = false
} else if (options.rollType === "skill") {
options.rollName = options.rollTarget.name
@ -336,7 +339,7 @@ export default class LethalFantasyRoll extends Roll {
if (fullModifier === 0) {
modifierFormula = "0"
} else {
if (options.rollType === "skill") {
if (options.rollType === "skill" || options.rollType === "monster-skill") {
modifierFormula = `${fullModifier}`
} else {
let modAbs = Math.abs(fullModifier)
@ -452,7 +455,7 @@ export default class LethalFantasyRoll extends Roll {
let r = await new Roll(baseFormula).evaluate()
if (game?.dice3d) {
await game.dice3d.showForRoll(r, game.user, true)
}
}
diceResult = r.dice[0].results[0].result
diceResults.push({ dice: `${singleDice}-1`, value: diceResult - 1 })
diceSum += (diceResult - 1)
@ -461,14 +464,14 @@ export default class LethalFantasyRoll extends Roll {
}
}
if ( hasGrantedDice) {
let grantedRoll = new Roll(options.rollTarget.grantedDice)
await grantedRoll.evaluate()
if (game?.dice3d) {
await game.dice3d.showForRoll(grantedRoll, game.user, true)
}
diceResults.push({ dice: `${options.rollTarget.grantedDice}`, value: grantedRoll.total })
rollTotal += grantedRoll.total
if (hasGrantedDice) {
let grantedRoll = new Roll(options.rollTarget.grantedDice)
await grantedRoll.evaluate()
if (game?.dice3d) {
await game.dice3d.showForRoll(grantedRoll, game.user, true)
}
diceResults.push({ dice: `${options.rollTarget.grantedDice}`, value: grantedRoll.total })
rollTotal += grantedRoll.total
}
if (fullModifier !== 0) {
@ -787,6 +790,7 @@ export default class LethalFantasyRoll extends Roll {
return `${game.i18n.localize("LETHALFANTASY.Label.titleChallenge")}`
case "save":
return `${game.i18n.localize("LETHALFANTASY.Label.titleSave")}`
case "monster-skill":
case "skill":
return `${game.i18n.localize("LETHALFANTASY.Label.titleSkill")}`
case "weapon-attack":