This commit is contained in:
@@ -218,6 +218,7 @@ export default class LethalFantasyActor extends Actor {
|
||||
if (available.length > 1) {
|
||||
const buttons = available.map(([id]) => ({
|
||||
action: id,
|
||||
type: "button",
|
||||
label: id.charAt(0).toUpperCase() + id.slice(1),
|
||||
callback: () => id,
|
||||
}))
|
||||
|
||||
@@ -391,6 +391,8 @@ export default class LethalFantasyRoll extends Roll {
|
||||
position,
|
||||
buttons: [
|
||||
{
|
||||
action: "roll",
|
||||
type: "button",
|
||||
label: label,
|
||||
callback: (event, button, dialog) => {
|
||||
log("Roll context", event, button, dialog)
|
||||
@@ -445,7 +447,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
if (hasModifier) {
|
||||
let bonus = Number(options.rollTarget.value)
|
||||
fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus
|
||||
fullModifier += (rollContext.saveSpell) ? options.rollTarget.actorModifiers.saveModifier : 0
|
||||
fullModifier += (rollContext.saveSpell) ? (options.rollTarget.actorModifiers?.saveModifier ?? 0) : 0
|
||||
if (Number(rollContext.attackerAim) > 0) {
|
||||
fullModifier += Number(rollContext.attackerAim)
|
||||
}
|
||||
@@ -719,6 +721,8 @@ export default class LethalFantasyRoll extends Roll {
|
||||
content,
|
||||
buttons: [
|
||||
{
|
||||
action: "initiative",
|
||||
type: "button",
|
||||
label: label,
|
||||
callback: (event, button) => {
|
||||
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
||||
@@ -796,6 +800,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
}
|
||||
buttons.push({
|
||||
action: "roll",
|
||||
type: "button",
|
||||
label: weaponLabel,
|
||||
callback: (event, button) => {
|
||||
let pos = $('#combat-action-dialog').position()
|
||||
@@ -822,6 +827,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
}
|
||||
buttons.push({
|
||||
action: "roll",
|
||||
type: "button",
|
||||
label: label,
|
||||
callback: (event, button) => {
|
||||
let pos = $('#combat-action-dialog').position()
|
||||
@@ -833,6 +839,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
} else {
|
||||
buttons.push({
|
||||
action: "roll",
|
||||
type: "button",
|
||||
label: "Select action",
|
||||
callback: (event, button) => {
|
||||
let pos = $('#combat-action-dialog').position()
|
||||
@@ -848,6 +855,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
}
|
||||
buttons.push({
|
||||
action: "cancel",
|
||||
type: "button",
|
||||
label: "Other action, not listed here",
|
||||
callback: (event, button) => {
|
||||
let pos = $('#combat-action-dialog').position()
|
||||
@@ -915,6 +923,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
content: `<div class="grit-luck-dialog"><p><strong>${selectedItem.name}</strong> has multiple damage tiers.</p><p>Choose which damage to use when the attack lands:</p></div>`,
|
||||
buttons: tiers.map(t => ({
|
||||
action: t.id,
|
||||
type: "button",
|
||||
label: `${t.label} (${t.dice.toUpperCase()})`,
|
||||
icon: "fa-solid fa-wand-magic-sparkles",
|
||||
callback: () => t.id
|
||||
@@ -1119,6 +1128,8 @@ export default class LethalFantasyRoll extends Roll {
|
||||
content,
|
||||
buttons: [
|
||||
{
|
||||
action: "rangeDefense",
|
||||
type: "button",
|
||||
label: label,
|
||||
callback: (event, button) => {
|
||||
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
||||
@@ -1278,6 +1289,8 @@ export default class LethalFantasyRoll extends Roll {
|
||||
content,
|
||||
buttons: [
|
||||
{
|
||||
action: "rangedAttack",
|
||||
type: "button",
|
||||
label,
|
||||
callback: (event, button) => {
|
||||
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
||||
|
||||
Reference in New Issue
Block a user