Skip to content

Commit

Permalink
Migrate actionCategory.value to category (foundryvtt#7805)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosFdez committed May 15, 2023
1 parent 812dcdc commit a2126dd
Show file tree
Hide file tree
Showing 5,333 changed files with 23,215 additions and 69,412 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 4 additions & 5 deletions build/lib/extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ class PackExtractor {
return this.#sortItemsWithOverrides(docName, actions, overrides);
}

/** Sorts actions by category, only called for NPCs */
#sortActions(docName: string, actions: Set<ItemSourcePF2e>): ItemSourcePF2e[] {
const notActions: [string, string][] = [
["Innate Spells", "spellcastingEntry"],
Expand All @@ -695,15 +696,13 @@ class PackExtractor {
`Error in ${docName}: ${notActionMatch[0]} has type action but should be type ${notActionMatch[1]}!`
);
}
if (!actionData.system.actionCategory?.value) {
if (!actionData.system.category) {
if (this.emitWarnings) {
console.log(
`Warning in ${docName}: Action item '${actionData.name}' has no actionCategory defined!`
);
console.log(`Warning in ${docName}: Action item '${actionData.name}' has no category defined!`);
}
actionsMap.get("other")!.push(actionData);
} else {
let actionCategory = actionData.system.actionCategory.value;
let actionCategory: string = actionData.system.category;
if (!actionsMap.has(actionCategory)) {
actionCategory = "other";
}
Expand Down
2 changes: 2 additions & 0 deletions build/run-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { Migration835InitiativeLongform } from "@module/migration/migrations/835
import { Migration836EnergizingConsolidation } from "@module/migration/migrations/836-energizing-consolidation.ts";
import { Migration837MoveHazardBookSources } from "@module/migration/migrations/837-move-hazard-book-source.ts";
import { Migration838StrikeAttackRollSelector } from "@module/migration/migrations/838-strike-attack-roll-selector.ts";
import { Migration839ActionCategories } from "@module/migration/migrations/839-action-categories.ts";

// ^^^ don't let your IDE use the index in these imports. you need to specify the full path ^^^

Expand Down Expand Up @@ -55,6 +56,7 @@ const migrations: MigrationBase[] = [
new Migration836EnergizingConsolidation(),
new Migration837MoveHazardBookSources(),
new Migration838StrikeAttackRollSelector(),
new Migration839ActionCategories(),
];

global.deepClone = <T>(original: T): T => {
Expand Down
28 changes: 7 additions & 21 deletions packs/data/abomination-vaults-bestiary.db/afflicted-irnakurse.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,13 @@
"name": "Darkvision",
"sort": 400000,
"system": {
"actionCategory": {
"value": "interaction"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "interaction",
"description": {
"value": "<p>@Localize[PF2E.NPC.Abilities.Glossary.Darkvision]</p>"
},
Expand Down Expand Up @@ -181,15 +179,13 @@
"name": "Attack of Opportunity",
"sort": 500000,
"system": {
"actionCategory": {
"value": "defensive"
},
"actionType": {
"value": "reaction"
},
"actions": {
"value": null
},
"category": "defensive",
"description": {
"value": "<p>@Localize[PF2E.NPC.Abilities.Glossary.AttackOfOpportunity]</p>"
},
Expand Down Expand Up @@ -220,15 +216,13 @@
"name": "Fearful Curse",
"sort": 600000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "offensive",
"description": {
"value": "<p>The irnakurse is permanently @UUID[Compendium.pf2e.conditionitems.Frightened]{Frightened 2}, which lowers its effective level by 1.</p>"
},
Expand Down Expand Up @@ -256,15 +250,13 @@
"name": "Mind Lash",
"sort": 700000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "offensive",
"description": {
"value": "<p>A non-evil creature hit by an irnakurse's tentacle is overwhelmed with corrupted images of a ruined life and must succeed at a @Check[type:will|dc:28] save or be @UUID[Compendium.pf2e.conditionitems.Stunned]{Stunned 2} (or @UUID[Compendium.pf2e.conditionitems.Stunned]{Stunned 4} on a critical failure).</p>\n<p>After attempting this save, a creature is temporarily immune to Mind Lash for 24 hours.</p>"
},
Expand Down Expand Up @@ -305,15 +297,13 @@
"name": "Rend",
"sort": 800000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "action"
},
"actions": {
"value": 1
},
"category": "offensive",
"description": {
"value": "<p>Tentacle</p>\n<hr />\n<p>@Localize[PF2E.NPC.Abilities.Glossary.Rend]</p>"
},
Expand Down Expand Up @@ -344,15 +334,13 @@
"name": "Soul Scream",
"sort": 900000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "action"
},
"actions": {
"value": 2
},
"category": "offensive",
"description": {
"value": "<p><strong>Frequency</strong> once per day</p>\n<hr />\n<p><strong>Effect</strong> The irnakurse unleashes an alien shriek of nightmarish horror and pain. All non-evil creatures within a @Template[type:emanation|distance:10] must attempt a @Check[type:will|dc:28] save. The irnakurse can Sustain Soul Scream for up to 6 rounds; each time it does, it repeats the effect.</p>\n<hr />\n<p><strong>Critical Success</strong> The creature is unaffected, and is temporarily immune to Soul Scream for 24 hours.</p>\n<p><strong>Success</strong> The creature is @UUID[Compendium.pf2e.conditionitems.Stupefied]{Stupefied 1} for 1 round.</p>\n<p><strong>Failure</strong> The creature is stupefied 1. Further failed saves against Soul Scream increase the condition value by 1, to a maximum of stupefied 4. Each time the character gets a full night's rest, the stupefied condition gained from Soul Scream decreases by 1.</p>\n<p><strong>Critical Failure</strong> As failure, except the stupefied value increases by 2 instead of by 1.</p>"
},
Expand Down Expand Up @@ -390,15 +378,13 @@
"name": "Storm of Tentacles",
"sort": 1000000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "action"
},
"actions": {
"value": 2
},
"category": "offensive",
"description": {
"value": "<p>The irnakurse makes up to four tentacle Strikes, each against a different target. These attacks count toward the irnakurse's multiple attack penalty, but the multiple attack penalty doesn't increase until after it makes all of its attacks.</p>"
},
Expand Down
24 changes: 6 additions & 18 deletions packs/data/abomination-vaults-bestiary.db/aller-rosk.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,13 @@
"name": "Darkvision",
"sort": 300000,
"system": {
"actionCategory": {
"value": "interaction"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "interaction",
"description": {
"value": "<p>@Localize[PF2E.NPC.Abilities.Glossary.Darkvision]</p>"
},
Expand Down Expand Up @@ -144,15 +142,13 @@
"name": "Negative Healing",
"sort": 400000,
"system": {
"actionCategory": {
"value": "defensive"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "defensive",
"description": {
"value": "<p>@Localize[PF2E.NPC.Abilities.Glossary.NegativeHealing]</p>"
},
Expand Down Expand Up @@ -195,15 +191,13 @@
"name": "Consume Tattooed Flesh",
"sort": 500000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "action"
},
"actions": {
"value": 1
},
"category": "offensive",
"description": {
"value": "<p><strong>Requirements</strong> Aller is adjacent to a tattooed scrap of flesh or to the corpse of a creature that died within the last hour</p>\n<p>Aller devours a bite of flesh and regains [[/r 4d6[healing]]]{4d6 Hit Points}. If the piece of flesh was tattooed, he is also @UUID[Compendium.pf2e.conditionitems.Quickened]{Quickened 1} and can use this extra action to make a jaws Strike.</p>\n<p>Aller then can't Consume Flesh for [[/br 1d4 #Consume Flesh Recharge]]{1d4 rounds}. He has one piece of tattooed flesh on his person.</p>"
},
Expand Down Expand Up @@ -241,15 +235,13 @@
"name": "Ghoul Fever",
"sort": 600000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "offensive",
"description": {
"value": "<p><strong>Saving Throw</strong> @Check[type:fortitude|dc:22]</p>\n<hr />\n<p><strong>Stage 1</strong> carrier with no ill effect (1 day)</p>\n<p><strong>Stage 2</strong> [[/r 2d6[negative]]] damage and regains half as many Hit Points from all healing (1 day)</p>\n<p><strong>Stage 3</strong> as stage 2 (1 day)</p>\n<p><strong>Stage 4</strong> [[/r 2d6[negative]]] damage and gains no benefit from healing (1 day)</p>\n<p><strong>Stage 5</strong> as stage 4 (1 day)</p>\n<p><strong>Stage 6</strong> dead, and rises as a @UUID[Compendium.pf2e.pathfinder-bestiary.Ghoul]{Ghoul} the next midnight.</p>"
},
Expand Down Expand Up @@ -287,15 +279,13 @@
"name": "Paralysis",
"sort": 700000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "offensive",
"description": {
"value": "<p>Any living, non-elf creature hit by Aller's attack must succeed at a @Check[type:fortitude|dc:22] save or become @UUID[Compendium.pf2e.conditionitems.Paralyzed]{Paralyzed}. It can attempt a new save at the end of each of its turns, and the DC cumulatively decreases by 1 on each such save.</p>"
},
Expand Down Expand Up @@ -335,15 +325,13 @@
"name": "Swift Leap",
"sort": 800000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "action"
},
"actions": {
"value": 1
},
"category": "offensive",
"description": {
"value": "<p>Aller jumps up to half his Speed. This movement doesn't trigger reactions.</p>"
},
Expand Down
32 changes: 8 additions & 24 deletions packs/data/abomination-vaults-bestiary.db/augrael.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,13 @@
"name": "Darkvision",
"sort": 300000,
"system": {
"actionCategory": {
"value": "interaction"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "interaction",
"description": {
"value": "<p>@Localize[PF2E.NPC.Abilities.Glossary.Darkvision]</p>"
},
Expand Down Expand Up @@ -144,15 +142,13 @@
"name": "Light Blindness",
"sort": 400000,
"system": {
"actionCategory": {
"value": "interaction"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "interaction",
"description": {
"value": "<p>@Localize[PF2E.NPC.Abilities.Glossary.LightBlindness]</p>"
},
Expand Down Expand Up @@ -188,15 +184,13 @@
"name": "Negative Healing",
"sort": 500000,
"system": {
"actionCategory": {
"value": "defensive"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "defensive",
"description": {
"value": "<p>@Localize[PF2E.NPC.Abilities.Glossary.NegativeHealing]</p>"
},
Expand Down Expand Up @@ -239,15 +233,13 @@
"name": "Consume Flesh",
"sort": 600000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "action"
},
"actions": {
"value": 1
},
"category": "offensive",
"description": {
"value": "<p><strong>Requirements</strong> Augrael is adjacent to the corpse of an undead creature that was destroyed within the last hour.</p>\n<hr />\n<p><strong>Effect</strong> Augrael devours a chunk of the destroyed undead creature and regains [[/r 2d6[healing]]]{2d6 Hit Points}.</p>\n<p>He can regain Hit Points from any given corpse only once.</p>"
},
Expand Down Expand Up @@ -285,15 +277,13 @@
"name": "Ghoul Fever",
"sort": 700000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "offensive",
"description": {
"value": "<p><strong>Saving Throw</strong> @Check[type:fortitude|dc:20]</p>\n<hr />\n<p><strong>Stage 1</strong> carrier with no ill effect (1 day)</p>\n<p><strong>Stage 2</strong> [[/r 2d6[negative]]] damage and regains half as many Hit Points from all healing (1 day)</p>\n<p><strong>Stage 3</strong> as stage 2 (1 day)</p>\n<p><strong>Stage 4</strong> [[/r 2d6[negative]]] damage and gains no benefit from healing (1 day)</p>\n<p><strong>Stage 5</strong> as stage 4 (1 day)</p>\n<p><strong>Stage 6</strong> dead, and rises as a @UUID[Compendium.pf2e.pathfinder-bestiary.Ghoul]{Ghoul} the next midnight.</p>"
},
Expand Down Expand Up @@ -331,15 +321,13 @@
"name": "Paralysis",
"sort": 800000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "offensive",
"description": {
"value": "<p>Any living, non-elf creature hit by Augrael's attack must succeed at a @Check[type:fortitude|dc:20] save or become @UUID[Compendium.pf2e.conditionitems.Paralyzed]{Paralyzed}. It can attempt a new save at the end of each of its turns, and the DC cumulatively decreases by 1 on each such save.</p>"
},
Expand Down Expand Up @@ -379,15 +367,13 @@
"name": "Sneak Attack",
"sort": 900000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "passive"
},
"actions": {
"value": null
},
"category": "offensive",
"description": {
"value": "<p>Augrael deals an extra 1d6 precision damage to flat-footed creatures.</p>\n<hr />\n<p>@Localize[PF2E.NPC.Abilities.Glossary.SneakAttack]</p>"
},
Expand Down Expand Up @@ -455,15 +441,13 @@
"name": "Swift Leap",
"sort": 1000000,
"system": {
"actionCategory": {
"value": "offensive"
},
"actionType": {
"value": "action"
},
"actions": {
"value": 1
},
"category": "offensive",
"description": {
"value": "<p>Augrael jumps up to half his Speed. This movement doesn't trigger reactions.</p>"
},
Expand Down
Loading

0 comments on commit a2126dd

Please sign in to comment.