feat(meowdoku): identity, gifts, achievements and wallpapers

Local-only v0.8.0 build. Adds player name/ID, achievements, claimable 7-day gift, daily share/stats, saved boards, 2048px rat-track wallpapers, difficulty/volume settings, and save v6. Not pushed or published.
This commit is contained in:
Ratdoku Builder committed 2026-12-03 21:21:59 -06:00
1 parent 5c00b35e90
commit 6d302f5cb9
21 files changed
+623 -41

No files matched your search

+33 -4
View File
@@ -46,6 +46,7 @@ func _run() -> void:
_test_daily(save)
_test_frames(save)
_test_avatars_and_streak(save)
_test_v6_features(save)
_test_game_data(save)
_test_icons()
@@ -192,7 +193,7 @@ func _test_save_migrations(save) -> void:
# (a) No save file at all -> fresh version-4 defaults.
_remove_save(save)
save.load_game()
_check(int(save.data.get("version", 0)) == 5, "fresh save should be version 5")
_check(int(save.data.get("version", 0)) == 6, "fresh save should be version 6")
_check(bool(save.get_setting("double_tap_place")), "fresh save should default to double-tap")
_check(_is_default_daily(save, save.daily_data()), "fresh save should have default daily stats")
_check(save.selected_frame() == "plain", "fresh save should select the plain frame")
@@ -207,7 +208,7 @@ func _test_save_migrations(save) -> void:
v1.erase("profile_frame")
_write_save(save, v1)
save.load_game()
_check(int(save.data.get("version", 0)) == 5, "version 1 should migrate to version 5")
_check(int(save.data.get("version", 0)) == 6, "version 1 should migrate to version 6")
_check(bool(save.get_setting("double_tap_place")), "version 1 should migrate to double-tap")
_check(_is_default_daily(save, save.daily_data()), "version 1 missing daily should become defaults")
_check(save.selected_frame() == "plain", "version 1 missing frame should become plain")
@@ -220,7 +221,7 @@ func _test_save_migrations(save) -> void:
v2.erase("profile_frame")
_write_save(save, v2)
save.load_game()
_check(int(save.data.get("version", 0)) == 5, "version 2 should migrate to version 5")
_check(int(save.data.get("version", 0)) == 6, "version 2 should migrate to version 6")
_check(not bool(save.get_setting("double_tap_place")), "version 2 double_tap=false should stay false")
_check(_is_default_daily(save, save.daily_data()), "version 2 missing daily should become defaults")
_check(save.selected_frame() == "plain", "version 2 missing frame should become plain")
@@ -233,7 +234,7 @@ func _test_save_migrations(save) -> void:
else:
_check(false, "could not write wrong-shape save")
save.load_game()
_check(int(save.data.get("version", 0)) == 5, "wrong-shape save should restore version 5 defaults")
_check(int(save.data.get("version", 0)) == 6, "wrong-shape save should restore version 6 defaults")
_check(bool(save.get_setting("double_tap_place")), "wrong-shape save should restore double-tap default")
_check(_is_default_daily(save, save.daily_data()), "wrong-shape save should restore daily defaults")
_check(save.selected_frame() == "plain", "wrong-shape save should restore plain frame")
@@ -470,6 +471,34 @@ func _test_frames(save) -> void:
# 4. Level and guest data
# ---------------------------------------------------------------------------
func _test_v6_features(save) -> void:
_note("6. v6 systems")
_check(save.player_name() == "Innkeeper", "default player name should be Innkeeper")
_check(save.player_id().begins_with("RAT-"), "player ID should be generated")
save.set_player_name("Ahri")
_check(save.player_name() == "Ahri", "player name should save")
_check(bool(save.get_setting("music")), "music should default on")
_check(absf(float(save.get_setting("music_volume")) - 0.7) < 0.001, "music volume should default to 0.7")
_check(bool(save.get_setting("sfx")), "sfx should default on")
_check(save.theme_id() == "cream", "default wallpaper should be cream")
_check(not save.is_theme_unlocked("gold"), "gold wallpaper should start locked")
save.data["daily"]["best_streak"] = 7
save.save_game()
_check(save.claim_gift(), "7-day gift should be claimable")
_check(not save.claim_gift(), "7-day gift should not double claim")
_check(save.is_theme_unlocked("gold"), "gift should unlock gold wallpaper")
save.select_theme("gold")
_check(save.theme_id() == "gold", "gold wallpaper should be selectable")
var snap := {"level_id": "probe", "n": 8, "cells": [], "auto_x": [], "history": []}
save.save_board("campaign", snap)
_check(save.load_board("campaign") == snap, "board snapshot should round trip")
save.clear_board("campaign")
_check(save.load_board("campaign").is_empty(), "board snapshot should clear")
var state: Dictionary = save.achievements()
_check(bool(state.get("streak_7", false)), "achievements should reflect streak")
_reset_to_clean(save)
func _test_game_data(save) -> void:
_note("4. level/guest data")