feat: Cards writings and balancing (M8)

This commit is contained in:
gauvainboiche
2026-10-25 18:30:43 +01:00
parent 04193e2013
commit c2103c32e7
43 changed files with 25930 additions and 397 deletions
+4 -1
View File
@@ -43,7 +43,10 @@ export function encodeSave(state) {
// Upgrades older saves one version at a time. Add an entry here whenever STATE_VERSION
// changes: MIGRATIONS[n] turns a version n state into a version n+1 state.
export const MIGRATIONS = {};
export const MIGRATIONS = {
// v2 added the world cycle: older saves start it at neutral.
1: (s) => ({ ...s, version: 2, world: { cycle: 0 } }),
};
export function migrate(state) {
if (!Number.isInteger(state?.version)) return { ok: false, error: "format" };