diff --git a/module/data-models.mjs b/module/data-models.mjs index b3541e5..2425cd9 100644 --- a/module/data-models.mjs +++ b/module/data-models.mjs @@ -76,24 +76,45 @@ export class HenchDataModel extends foundry.abstract.TypeDataModel { static migrateData(source) { // Draft 0 -> Draft 1 if(!source.version || source.version === versions.DRAFT_0) { - // Changes - // Update stress cap. - if(source.stress > 8) { - source.stress = 8; - } - - // Add exp trigger. - source.experienceTriggers.splice(2, 0, { - marked: false, - description: "You got on the boss's nerves.", - }); - - source.version = versions.DRAFT_1; + source = this.migrateFromDraft0(source); } return super.migrateData(source); } + static migrateFromDraft0(source) { + // Update stress cap. + if(source.stress > 8) { + source.stress = 8; + } + + // Add exp trigger. + source.experienceTriggers.splice(2, 0, { + marked: false, + description: "You got on the boss's nerves.", + }); + + // Update playbooks details + const playbook = lookupPlaybook(source.playbook); + switch(source.playbook) { + case "SUPERFAN": + // Change first detail. Wipe response. + source.details[0] = playbook.details[0]; + + // Update forum lurker. retain 'marked' + const forumLurkerMarked = source.moves[4].marked; + source.moves[4] = playbook.moves[4]; + source.moves[4].marked = forumLurkerMarked; + break; + default: + break; + } + + source.version = versions.DRAFT_1; + + return source; + } + /** @override */ async _preCreate(data, options, user) { await super._preCreate(data, options, user); diff --git a/module/playbooks.mjs b/module/playbooks.mjs index 7963525..0900e30 100644 --- a/module/playbooks.mjs +++ b/module/playbooks.mjs @@ -185,7 +185,7 @@ const playbooks = { { marked: false, name: "Forum Lurker", - description: `As a downtime move you can trawl the web for information about a piece of the setting. State a single fact about this thing and draw. Ignore the cue, and use the rank: + description: `As a prep action you can trawl the web for information about a piece of the setting. State a single fact about this thing and draw. Ignore the cue, and use the rank: