Skip to content

Commit

Permalink
Add unified Effect: Energizing Rune and migrate old links (#7316)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonward committed Apr 16, 2023
1 parent d0fd238 commit 89b0ea3
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 232 deletions.
2 changes: 2 additions & 0 deletions build/run-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { Migration832ChoiceSetFlags } from "@module/migration/migrations/832-cho
import { Migration833AddRogueToysFixPrecision } from "@module/migration/migrations/833-add-rogue-toys-fix-precision.ts";
import { Migration834FeatCategories } from "@module/migration/migrations/834-feat-categories.ts";
import { Migration835InitiativeLongform } from "@module/migration/migrations/835-initiative-longform.ts";
import { Migration836EnergizingConsolidation } from "@module/migration/migrations/836-energizing-consolidation.ts";

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

Expand Down Expand Up @@ -69,6 +70,7 @@ const migrations: MigrationBase[] = [
new Migration833AddRogueToysFixPrecision(),
new Migration834FeatCategories(),
new Migration835InitiativeLongform(),
new Migration836EnergizingConsolidation(),
];

global.deepClone = <T>(original: T): T => {
Expand Down
46 changes: 0 additions & 46 deletions packs/data/equipment-effects.db/effect-energizing-rune-acid.json

This file was deleted.

46 changes: 0 additions & 46 deletions packs/data/equipment-effects.db/effect-energizing-rune-cold.json

This file was deleted.

This file was deleted.

46 changes: 0 additions & 46 deletions packs/data/equipment-effects.db/effect-energizing-rune-fire.json

This file was deleted.

46 changes: 0 additions & 46 deletions packs/data/equipment-effects.db/effect-energizing-rune-sonic.json

This file was deleted.

92 changes: 92 additions & 0 deletions packs/data/equipment-effects.db/effect-energizing-rune.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"_id": "R5ywXEYZFV1WBe8t",
"img": "systems/pf2e/icons/equipment/runes/weapon-property-runes/energizing-rune-fire.webp",
"name": "Effect: Energizing Rune",
"system": {
"badge": null,
"description": {
"value": "<p>Granted by @UUID[Compendium.pf2e.equipment-srd.Energizing]{Energizing}</p>\n<p>The weapon becomes imbued with the triggering energy type. It deals an additional 1d8 damage of the triggering type until the end of your next turn.</p>"
},
"duration": {
"expiry": "turn-end",
"sustained": false,
"unit": "rounds",
"value": 1
},
"level": {
"value": 6
},
"rules": [
{
"choices": {
"includeHandwraps": true,
"ownedItems": true,
"predicate": [
"item:rune:property:energizing"
],
"types": [
"weapon"
]
},
"flag": "weapon",
"key": "ChoiceSet",
"prompt": "PF2E.SpecificRule.Prompt.Weapon"
},
{
"choices": [
{
"img": "systems/pf2e/icons/equipment/runes/weapon-property-runes/energizing-rune-acid.webp",
"label": "PF2E.TraitAcid",
"value": "acid"
},
{
"img": "systems/pf2e/icons/equipment/runes/weapon-property-runes/energizing-rune-cold.webp",
"label": "PF2E.TraitCold",
"value": "cold"
},
{
"img": "systems/pf2e/icons/equipment/runes/weapon-property-runes/energizing-rune-electricity.webp",
"label": "PF2E.TraitElectricity",
"value": "electricity"
},
{
"img": "systems/pf2e/icons/equipment/runes/weapon-property-runes/energizing-rune-fire.webp",
"label": "PF2E.TraitFire",
"value": "fire"
},
{
"img": "systems/pf2e/icons/equipment/runes/weapon-property-runes/energizing-rune-sonic.webp",
"label": "PF2E.TraitSonic",
"value": "sonic"
}
],
"flag": "energyType",
"key": "ChoiceSet",
"prompt": "PF2E.SpecificRule.Prompt.EnergyType"
},
{
"damageType": "{item|flags.pf2e.rulesSelections.energyType}",
"diceNumber": 1,
"dieSize": "d8",
"key": "DamageDice",
"selector": "{item|flags.pf2e.rulesSelections.weapon}-damage"
}
],
"source": {
"value": "Pathfinder Lost Omens: The Grand Bazaar"
},
"start": {
"initiative": null,
"value": 0
},
"target": null,
"tokenIcon": {
"show": true
},
"traits": {
"value": []
},
"unidentified": false
},
"type": "effect"
}
2 changes: 1 addition & 1 deletion packs/data/equipment.db/energizing.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"baseItem": null,
"containerId": "null",
"description": {
"value": "<p>A weapon with this rune can absorb energy damage to empower it.</p>\n<hr />\n<p><strong>Activate</strong> <span class=\"pf2-icon\">r</span> envision</p>\n<p><strong>Trigger</strong> You take acid, cold, electricity, fire, or sonic damage</p>\n<hr />\n<p><strong>Effect</strong> The weapon becomes imbued with the triggering energy type. It deals an additional 1d8 damage of the triggering type until the end of your next turn. As normal, if you use this reaction again during the duration, the damage doesn't combine; instead, change the 1d8 damage to the new triggering type of damage and change the duration to the end of your next turn.</p>\n<p>@UUID[Compendium.pf2e.equipment-effects.Effect: Energizing Rune (Acid)]{Effect: Energizing Rune (Acid)}</p>\n<p>@UUID[Compendium.pf2e.equipment-effects.Effect: Energizing Rune (Cold)]{Effect: Energizing Rune (Cold)}</p>\n<p>@UUID[Compendium.pf2e.equipment-effects.Effect: Energizing Rune (Electricity)]{Effect: Energizing Rune (Electricity)}</p>\n<p>@UUID[Compendium.pf2e.equipment-effects.Effect: Energizing Rune (Fire)]{Effect: Energizing Rune (Fire)}</p>\n<p>@UUID[Compendium.pf2e.equipment-effects.Effect: Energizing Rune (Sonic)]{Effect: Energizing Rune (Sonic)}</p>"
"value": "<p>A weapon with this rune can absorb energy damage to empower it.</p>\n<hr />\n<p><strong>Activate</strong> <span class=\"pf2-icon\">r</span> envision</p>\n<p><strong>Trigger</strong> You take acid, cold, electricity, fire, or sonic damage</p>\n<hr />\n<p><strong>Effect</strong> The weapon becomes imbued with the triggering energy type. It deals an additional 1d8 damage of the triggering type until the end of your next turn. As normal, if you use this reaction again during the duration, the damage doesn't combine; instead, change the 1d8 damage to the new triggering type of damage and change the duration to the end of your next turn.</p>\n<p>@UUID[Compendium.pf2e.equipment-effects.Effect: Energizing Rune]{Effect: Energizing Rune}</p>"
},
"equippedBulk": {
"value": ""
Expand Down
23 changes: 23 additions & 0 deletions src/module/migration/migrations/836-energizing-consolidation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ItemSourcePF2e } from "@item/data/index.ts";
import { MigrationBase } from "../base.ts";

/** Rename references to retired compendiums */
export class Migration836EnergizingConsolidation extends MigrationBase {
static override version = 0.836;

#rename(text: string): string {
const newEffectEnergizingRune = "equipment-effects.R5ywXEYZFV1WBe8t";
return text
.replace("equipment-effects.ClsVhp5baFRjZQ23", newEffectEnergizingRune)
.replace("equipment-effects.68xcDyxsNgD3JddD", newEffectEnergizingRune)
.replace("equipment-effects.9BsFdrEc7hkPWgSd", newEffectEnergizingRune)
.replace("equipment-effects.ascxqSlMEN9R6OOy", newEffectEnergizingRune)
.replace("equipment-effects.4RnEUeYEzC919GZR", newEffectEnergizingRune);
}

override async updateItem(source: ItemSourcePF2e): Promise<void> {
if (source.system.description.value.includes("equipment-effects")) {
source.system.description.value = this.#rename(source.system.description.value);
}
}
}
1 change: 1 addition & 0 deletions src/module/migration/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,4 @@ export { Migration832ChoiceSetFlags } from "./832-choice-set-flags.ts";
export { Migration833AddRogueToysFixPrecision } from "./833-add-rogue-toys-fix-precision.ts";
export { Migration834FeatCategories } from "./834-feat-categories.ts";
export { Migration835InitiativeLongform } from "./835-initiative-longform.ts";
export { Migration836EnergizingConsolidation } from "./836-energizing-consolidation.ts";
2 changes: 1 addition & 1 deletion src/module/migration/runner/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface CollectionDiff<T extends foundry.documents.ActiveEffectSource | ItemSo
export class MigrationRunnerBase {
migrations: MigrationBase[];

static LATEST_SCHEMA_VERSION = 0.835;
static LATEST_SCHEMA_VERSION = 0.836;

static MINIMUM_SAFE_VERSION = 0.618;

Expand Down

0 comments on commit 89b0ea3

Please sign in to comment.