summaryrefslogtreecommitdiff
path: root/resources/js/memory.js
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-08-30 21:35:28 +0200
committerDaniel Weipert <code@drogueronin.de>2023-08-30 21:35:28 +0200
commit5214cdfbf26bc0bdee5d669a237fb8aefffb78d5 (patch)
tree7bec19278a0cf8fc1772e8eb6d985391d402c614 /resources/js/memory.js
parent5e2e6753966c19616822915c14795bf62b589f68 (diff)
story!
Diffstat (limited to 'resources/js/memory.js')
-rw-r--r--resources/js/memory.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/resources/js/memory.js b/resources/js/memory.js
index 709a084..b403037 100644
--- a/resources/js/memory.js
+++ b/resources/js/memory.js
@@ -181,6 +181,7 @@ const Memory = {
*/
const loadedState = saveData;
+ Memory.state.Settings.name = loadedState.Settings.name;
Memory.state.Settings.language = loadedState.Settings.language;
await fetchTranslation(Memory.state.Settings.language);
applyTranslation();
@@ -197,6 +198,8 @@ const Memory = {
}
Memory.state.currentArea = await loadArea(loadedState.currentArea);
Memory.state.lastVisitedTown = loadedState.lastVisitedTown;
+ Memory.state.storyProgress = loadedState.storyProgress;
+ Memory.state.currentStory = loadedState.currentStory;
Memory.state.turn = loadedState.turn;
Memory.state.money = loadedState.money;
@@ -227,6 +230,8 @@ const Memory = {
UI.drawArea();
UI.drawStatus();
UI.closeAllPopups();
+
+ Story.progress(Memory.state.currentStory);
},
/**
@@ -240,3 +245,10 @@ const Memory = {
Memory.loadFromString(localStorage.getItem('state'));
},
};
+
+async function initializeState () {
+ Memory.state.currentArea = await fetchArea('paper-town');
+ Memory.state.player = new Trainer({ monsters: [] });
+ Memory.state.opponent = new Trainer({ monsters: [] });
+ Memory.state.activeTechnique = await fetchTechnique('all_in');
+}