From c2c76117ad181712b852d4c84a08058dc5fd6f88 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Thu, 31 Oct 2024 05:33:13 -0700 Subject: [PATCH 1/3] Roll cinder/wraith/cursed dice with no DSN --- src/module/features/dice/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/module/features/dice/index.ts b/src/module/features/dice/index.ts index ff223746d..101dfee5b 100644 --- a/src/module/features/dice/index.ts +++ b/src/module/features/dice/index.ts @@ -42,14 +42,14 @@ export function cinderAndWraithifyRoll(roll: Roll) { const cd0options = challengeDice[0].options as any cd0options.appearance = { - labelColor: (game.dice3d as any).exports?.Utils?.contrastOf(cinderColor), + labelColor: (game.dice3d as any)?.exports?.Utils?.contrastOf(cinderColor), background: cinderColor, outline: cinderColor, edge: cinderColor } const cd1options = challengeDice[1].options as any cd1options.appearance = { - labelColor: (game.dice3d as any).exports?.Utils?.contrastOf(wraithColor), + labelColor: (game.dice3d as any)?.exports?.Utils?.contrastOf(wraithColor), background: wraithColor, outline: wraithColor, edge: wraithColor @@ -60,7 +60,7 @@ export function cursifyRoll(roll: Roll) { const die = roll.dice[0] const cursedColor = '#228822' ;(die.options as any).appearance = { - labelColor: (game.dice3d as any).exports?.Utils?.contrastOf(cursedColor), + labelColor: (game.dice3d as any)?.exports?.Utils?.contrastOf(cursedColor), background: cursedColor, outline: cursedColor, edge: cursedColor From 1959710dd0779265d25081f57154581a3f931d22 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Thu, 31 Oct 2024 05:35:32 -0700 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 456bc3dd3..cb20b11ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next Release +- Fix a bug where cinder/wraith and cursed-die rolls wouldn't work unless Dice So Nice was enabled ([#1035](https://github.com/ben/foundry-ironsworn/pull/1035)) + ## 1.24.4 - Fix an issue where new Ironsworn characters would have a blank sheet the first time they were opened ([#1030](https://github.com/ben/foundry-ironsworn/pull/1030)) From 4585efa1d7371b1f0ef0289c2a627e359fca89ec Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Thu, 31 Oct 2024 05:40:16 -0700 Subject: [PATCH 3/3] Fix some type issues --- src/module/roll-table/oracle-table.ts | 5 +++-- src/module/vue/sf-truths.vue | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/module/roll-table/oracle-table.ts b/src/module/roll-table/oracle-table.ts index bf705520c..a16244c20 100644 --- a/src/module/roll-table/oracle-table.ts +++ b/src/module/roll-table/oracle-table.ts @@ -427,9 +427,10 @@ export class OracleTable extends RollTable { // Draw from the cursed table const cursedResult = cursedTable.results.find( (x) => - originalRoll.total >= x.range[0] && originalRoll.total <= x.range[1] + (originalRoll.total ?? -1) >= x.range[0] && + (originalRoll.total ?? -1) <= x.range[1] ) - return { cursedResults: [cursedResult], cursedDie } + return { cursedResults: compact([cursedResult]), cursedDie } } } diff --git a/src/module/vue/sf-truths.vue b/src/module/vue/sf-truths.vue index 8f9053de3..03b6c9d68 100644 --- a/src/module/vue/sf-truths.vue +++ b/src/module/vue/sf-truths.vue @@ -33,7 +33,7 @@ ref="categoryComponents" :key="(truth.je()._id as string)" :je="truth.je" - v-model="categoryModels[truth.je()._id]" + v-model="categoryModels[truth.je()._id ?? '']" /> @@ -75,7 +75,7 @@ async function saveTruths() { // Fetch values from the category components const contentSections: string[] = [] for (const t of props.data.truths) { - const model = categoryModels.value[t.je()._id] + const model = categoryModels.value[t.je()._id ?? ''] if (model.valid) contentSections.push( `

${model.title}