Add initiative rolls
This commit is contained in:
@@ -65,6 +65,8 @@ export default class OathHammerRollDialog {
|
||||
}
|
||||
|
||||
const availableLuck = sys.luck?.value ?? 0
|
||||
const isHuman = (sys.lineage?.name ?? "").toLowerCase() === "human"
|
||||
const luckDicePerPoint = isHuman ? 3 : 2
|
||||
const rollModes = foundry.utils.duplicate(CONFIG.Dice.rollModes)
|
||||
|
||||
// Build select option arrays
|
||||
@@ -85,7 +87,7 @@ export default class OathHammerRollDialog {
|
||||
|
||||
const luckOptions = Array.from({ length: availableLuck + 1 }, (_, i) => ({
|
||||
value: i,
|
||||
label: i === 0 ? `0` : `${i} (+${i * 2}d)`,
|
||||
label: i === 0 ? `0` : `${i} (+${i * luckDicePerPoint}d)`,
|
||||
selected: i === 0,
|
||||
}))
|
||||
|
||||
@@ -103,6 +105,7 @@ export default class OathHammerRollDialog {
|
||||
colorLabel,
|
||||
threshold,
|
||||
availableLuck,
|
||||
isHuman,
|
||||
attrOptions,
|
||||
isDualAttr: !!dualDef,
|
||||
rollModes,
|
||||
@@ -145,13 +148,14 @@ export default class OathHammerRollDialog {
|
||||
const attrOverride = result.attrOverride || defaultAttrKey
|
||||
|
||||
return {
|
||||
dv: Math.max(0, parseInt(result.dv) ?? 2),
|
||||
bonus: parseInt(result.bonus) || 0,
|
||||
luckSpend: Math.min(Math.max(0, parseInt(result.luckSpend) || 0), availableLuck),
|
||||
supporters: Math.max(0, parseInt(result.supporters) || 0),
|
||||
explodeOn5: result.explodeOn5 === "true",
|
||||
dv: Math.max(0, parseInt(result.dv) ?? 2),
|
||||
bonus: parseInt(result.bonus) || 0,
|
||||
luckSpend: Math.min(Math.max(0, parseInt(result.luckSpend) || 0), availableLuck),
|
||||
luckIsHuman: result.luckIsHuman === "true",
|
||||
supporters: Math.max(0, parseInt(result.supporters) || 0),
|
||||
explodeOn5: result.explodeOn5 === "true",
|
||||
attrOverride,
|
||||
visibility: result.visibility ?? game.settings.get("core", "rollMode"),
|
||||
visibility: result.visibility ?? game.settings.get("core", "rollMode"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user