From 093c0685b6c9c1054a2e712d5f6bdac9622eb90f Mon Sep 17 00:00:00 2001 From: Eric Fredricksen Date: Tue, 22 Nov 2022 00:27:47 -0800 Subject: [PATCH 1/3] Patch the way spells got screwy with spelling fixes --- moderna.html | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 moderna.html diff --git a/moderna.html b/moderna.html new file mode 100644 index 0000000..36a570c --- /dev/null +++ b/moderna.html @@ -0,0 +1,103 @@ +

Tonsil Inoculator

+ \ No newline at end of file From 9d66148e6cfdd49e6b3b26d98ed416ef420a2637 Mon Sep 17 00:00:00 2001 From: Eric Fredricksen Date: Mon, 28 Nov 2022 10:15:16 -0800 Subject: [PATCH 2/3] Patch around spell spelling correction mistake [sic] --- main.js | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/main.js b/main.js index 6363560..6a101ca 100644 --- a/main.js +++ b/main.js @@ -1104,14 +1104,6 @@ function LoadGame(sheet) { game = sheet; - /* - if (!window.localStorage) { - // Cookies can't hold a whole game save - storage.removeItem("roster"); - storage = null; - } -*/ - if (document) { var title = "Progress Quest - " + GameSaveName(); $("#title").text(title); @@ -1119,7 +1111,6 @@ function LoadGame(sheet) { document.title = title; } - randseed(game.seed); $.each(AllBars.concat(AllLists), function (i, e) { e.load(game); }); if (Kill) @@ -1128,6 +1119,30 @@ function LoadGame(sheet) { $.each([Plots,Quests], function () { this.CheckAll(true); }); + + // Patch correctly spelled spells showing up as new spells when + // the incorretly spelled spell was there already. + function patch(from, to) { + function count(spell) { + let t = game.Spells.filter(a => a[0] == spell); + return t.length == 1 ? toArabic(t[0][1]) : 0; + } + let tf = count(from); + if (!tf) return; + let tt = count(to); + let total = tf + tt; + console.log('Patching ' + from + ' to ' + to); + game.Spells = game.Spells.filter(a => a[0] != to); + for (let spell of game.Spells) { + if (spell[0] == from) { + spell[0] = to; + spell[1] = toRoman(total); + } + } + } + patch('Innoculate', 'Inoculate'); + patch('Tonsilectomy', 'Tonsillectomy'); + Log('Loaded game: ' + game.Traits.Name); if (!game.elapsed) Brag('s'); From b478b2ef891756aec667ad6b5df0ed45eae4b164 Mon Sep 17 00:00:00 2001 From: Eric Fredricksen Date: Mon, 28 Nov 2022 10:33:56 -0800 Subject: [PATCH 3/3] This error is patched in the game now, so no need for the bandaid --- moderna.html | 103 --------------------------------------------------- 1 file changed, 103 deletions(-) delete mode 100644 moderna.html diff --git a/moderna.html b/moderna.html deleted file mode 100644 index 36a570c..0000000 --- a/moderna.html +++ /dev/null @@ -1,103 +0,0 @@ -

Tonsil Inoculator

- \ No newline at end of file