This commit is contained in:
@ -181,10 +181,10 @@ export default class CthulhuEternalUtils {
|
||||
|
||||
}
|
||||
|
||||
static async nudgeRoll(rollMessage) {
|
||||
static async nudgeRoll(rollMessage) {
|
||||
|
||||
let dialogContext = rollMessage.rolls[0]?.options
|
||||
let actor = game.actors.get(dialogContext.actorId)
|
||||
let actor = game.actors.get(dialogContext.actorId)
|
||||
dialogContext.wpValue = actor.system.wp.value
|
||||
dialogContext.rollResultIndex = rollMessage.rolls[0].total - 1
|
||||
dialogContext.minValue = Math.max(rollMessage.rolls[0].total - (dialogContext.wpValue * 5), 1)
|
||||
@ -193,9 +193,9 @@ export default class CthulhuEternalUtils {
|
||||
|
||||
// Build options table for the select operator between minValue and maxValue
|
||||
dialogContext.nudgeOptions = Array.from({ length: dialogContext.maxValue - dialogContext.minValue + 1 }, (_, i) => dialogContext.minValue + i)
|
||||
console.log(dialogContext)
|
||||
|
||||
const content = await renderTemplate("systems/fvtt-cthulhu-eternal/templates/nudge-dialog.hbs", dialogContext)
|
||||
console.log(dialogContext)
|
||||
|
||||
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-cthulhu-eternal/templates/nudge-dialog.hbs", dialogContext)
|
||||
|
||||
const title = game.i18n.localize("CTHULHUETERNAL.Roll.nudgeRoll")
|
||||
const rollContext = await foundry.applications.api.DialogV2.wait({
|
||||
@ -236,7 +236,7 @@ export default class CthulhuEternalUtils {
|
||||
if (rollContext === null || dialogContext.wpCost === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
const roll = new CthulhuEternalRoll(String(dialogContext.nudgedValue))
|
||||
await roll.evaluate()
|
||||
roll.options = dialogContext
|
||||
|
Reference in New Issue
Block a user