Add monsetr sheet

This commit is contained in:
2025-01-15 14:20:21 +01:00
parent 4e70cbfaf8
commit cc8c1f9864
47 changed files with 1949 additions and 461 deletions

View File

@ -135,8 +135,32 @@ export default class LethalFantasyRoll extends Roll {
} else {
dice = "1D20"
maxValue = 20
hasFavor = true
}
} else if (options.rollType === "monster-attack" || options.rollType === "monster-defense") {
hasD30 = true
options.rollName = options.rollTarget.name
dice = "1D20"
baseFormula = "D20"
maxValue = 20
hasModifier = true
hasChangeDice = false
hasFavor = true
if (options.rollType === "monster-attack") {
options.rollTarget.value = options.rollTarget.attackModifier
options.rollTarget.charModifier = 0
} else {
options.rollTarget.value = options.rollTarget.defenseModifier
options.rollTarget.charModifier = 0
}
} else if (options.rollType === "resist") {
dice = "1D20"
maxValue = 20
hasFavor = true
options.rollName = options.rollTarget.rollKey
} else if (options.rollType === "skill") {
options.rollName = options.rollTarget.name
dice = "1D100"
@ -200,8 +224,20 @@ export default class LethalFantasyRoll extends Roll {
dice = dice.replace("E", "")
baseFormula = dice
maxValue = 20
} else if (options.rollType.includes("monster-damage")) {
options.rollName = options.rollTarget.name
hasModifier = true
hasChangeDice = false
options.rollTarget.value = 0
options.rollTarget.charModifier = 0
dice = options.rollTarget.damageDice
dice = dice.replace("E", "")
baseFormula = dice
maxValue = 20
}
if (options.rollType === "save" && options.rollTarget.rollKey === "pain") {
dice = options.rollTarget.rollDice
baseFormula = options.rollTarget.rollDice
@ -336,7 +372,7 @@ export default class LethalFantasyRoll extends Roll {
let rollBase = new this(baseFormula, options.data, rollData)
const rollModifier = new Roll(modifierFormula, options.data, rollData)
rollModifier.evaluate()
await rollModifier.evaluate()
await rollBase.evaluate()
let rollFavor
@ -372,7 +408,7 @@ export default class LethalFantasyRoll extends Roll {
if (hasD30) {
let rollD30 = await new Roll("1D30").evaluate()
if (game?.dice3d) {
await game.dice3d.showForRoll(rollFavor, game.user, true)
game.dice3d.showForRoll(rollD30, game.user, true)
}
options.D30result = rollD30.total
}