Skip to content

Commit

Permalink
Update savedata with two new cutscenes
Browse files Browse the repository at this point in the history
  • Loading branch information
albrow committed Feb 26, 2024
1 parent 606b933 commit cff476f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion web/contexts/save_data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ShortId } from "../lib/tutorial_shorts";
import { sleep } from "../lib/utils";
import { SectionName } from "../components/journal/sections";

export const SAVE_DATA_VERSION = 16;
export const SAVE_DATA_VERSION = 17;
const LOCAL_STORAGE_KEY = "elara.save";

// Amount of time (in milliseconds) to wait for further updates before
Expand Down Expand Up @@ -331,6 +331,18 @@ function migrateSaveData(saveData: SaveData): SaveData {
newData.seenCutscenes = ["intro"];
}

// Version 17 added two new cutscenes. They should be marked as seen if
// the user has already the levels that come immediately afterwards.
if (newData.version === 16) {
newData.version = 17;
if (newData.levelStates.partly_disabled_movement?.completed) {
newData.seenCutscenes.push("grover_damaged");
}
if (newData.levelStates.telepad_part_one?.completed) {
newData.seenCutscenes.push("grover_repaired");
}
}

return newData;
}

Expand Down

0 comments on commit cff476f

Please sign in to comment.