From faefe95339306baf3a4724605cfd3d50def5c600 Mon Sep 17 00:00:00 2001 From: Shark that walks like a man <106829671+stwlam@users.noreply.github.com> Date: Wed, 31 Aug 2022 01:42:19 -0500 Subject: [PATCH] Have Hand of the Apprentice feat enlarge focus pool (#3700) --- .../data/feats.db/hand-of-the-apprentice.json | 9 ++++++- packs/data/iconics.db/ezren-level-3.json | 9 ++++++- packs/data/iconics.db/ezren-level-5.json | 9 ++++++- packs/scripts/run-migration.ts | 2 ++ .../migrations/777-hand-of-the-apprentice.ts | 25 +++++++++++++++++++ src/module/migration/migrations/index.ts | 1 + src/module/migration/runner/base.ts | 2 +- 7 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 src/module/migration/migrations/777-hand-of-the-apprentice.ts diff --git a/packs/data/feats.db/hand-of-the-apprentice.json b/packs/data/feats.db/hand-of-the-apprentice.json index af0df96c9a4..671631c573f 100644 --- a/packs/data/feats.db/hand-of-the-apprentice.json +++ b/packs/data/feats.db/hand-of-the-apprentice.json @@ -29,7 +29,14 @@ } ] }, - "rules": [], + "rules": [ + { + "key": "ActiveEffectLike", + "mode": "add", + "path": "system.resources.focus.max", + "value": 1 + } + ], "source": { "value": "Pathfinder Core Rulebook" }, diff --git a/packs/data/iconics.db/ezren-level-3.json b/packs/data/iconics.db/ezren-level-3.json index 188533acd51..1267b98cb02 100644 --- a/packs/data/iconics.db/ezren-level-3.json +++ b/packs/data/iconics.db/ezren-level-3.json @@ -4817,7 +4817,14 @@ } ] }, - "rules": [], + "rules": [ + { + "key": "ActiveEffectLike", + "mode": "add", + "path": "system.resources.focus.max", + "value": 1 + } + ], "slug": "hand-of-the-apprentice", "source": { "value": "Pathfinder Core Rulebook" diff --git a/packs/data/iconics.db/ezren-level-5.json b/packs/data/iconics.db/ezren-level-5.json index ff971728f38..5d11020cd26 100644 --- a/packs/data/iconics.db/ezren-level-5.json +++ b/packs/data/iconics.db/ezren-level-5.json @@ -4608,7 +4608,14 @@ } ] }, - "rules": [], + "rules": [ + { + "key": "ActiveEffectLike", + "mode": "add", + "path": "system.resources.focus.max", + "value": 1 + } + ], "slug": "hand-of-the-apprentice", "source": { "value": "Pathfinder Core Rulebook" diff --git a/packs/scripts/run-migration.ts b/packs/scripts/run-migration.ts index 02ff205969c..3d118cdce08 100644 --- a/packs/scripts/run-migration.ts +++ b/packs/scripts/run-migration.ts @@ -36,6 +36,7 @@ import { Migration773ReligiousSymbolUsage } from "@module/migration/migrations/7 import { Migration774UnpersistCraftingEntries } from "@module/migration/migrations/774-unpersist-crafting-entries"; import { Migration775AgileFinesseRanged } from "@module/migration/migrations/775-agile-finesse-ranged"; import { Migration776SlugifyConditionOverrides } from "@module/migration/migrations/776-sluggify-condition-overrides"; +import { Migration777HandOfTheApprentice } from "@module/migration/migrations/777-hand-of-the-apprentice"; // ^^^ don't let your IDE use the index in these imports. you need to specify the full path ^^^ const { window } = new JSDOM(); @@ -74,6 +75,7 @@ const migrations: MigrationBase[] = [ new Migration774UnpersistCraftingEntries(), new Migration775AgileFinesseRanged(), new Migration776SlugifyConditionOverrides(), + new Migration777HandOfTheApprentice(), ]; global.deepClone = (original: T): T => { diff --git a/src/module/migration/migrations/777-hand-of-the-apprentice.ts b/src/module/migration/migrations/777-hand-of-the-apprentice.ts new file mode 100644 index 00000000000..ec1aac08fae --- /dev/null +++ b/src/module/migration/migrations/777-hand-of-the-apprentice.ts @@ -0,0 +1,25 @@ +import { ItemSourcePF2e } from "@item/data"; +import { AELikeSource } from "@module/rules/rule-element/ae-like"; +import { MigrationBase } from "../base"; + +/** Have Hand of the Apprentice feat enlarge focus pool */ +export class Migration777HandOfTheApprentice extends MigrationBase { + static override version = 0.777; + + override async updateItem(source: ItemSourceWithAELikes): Promise { + if (source.type === "feat" && source.system.slug === "hand-of-the-apprentice") { + source.system.rules = [ + { + key: "ActiveEffectLike", + mode: "add", + path: "system.resources.focus.max", + value: 1, + }, + ]; + } + } +} + +type ItemSourceWithAELikes = ItemSourcePF2e & { + system: { rules: AELikeSource[] }; +}; diff --git a/src/module/migration/migrations/index.ts b/src/module/migration/migrations/index.ts index 998d07edbc5..ad20876912b 100644 --- a/src/module/migration/migrations/index.ts +++ b/src/module/migration/migrations/index.ts @@ -174,3 +174,4 @@ export { Migration773ReligiousSymbolUsage } from "./773-religious-symbol-usage"; export { Migration774UnpersistCraftingEntries } from "./774-unpersist-crafting-entries"; export { Migration775AgileFinesseRanged } from "./775-agile-finesse-ranged"; export { Migration776SlugifyConditionOverrides } from "./776-sluggify-condition-overrides"; +export { Migration777HandOfTheApprentice } from "./777-hand-of-the-apprentice"; diff --git a/src/module/migration/runner/base.ts b/src/module/migration/runner/base.ts index 2101df2a832..21b667c2f9b 100644 --- a/src/module/migration/runner/base.ts +++ b/src/module/migration/runner/base.ts @@ -14,7 +14,7 @@ interface CollectionDiff