Debug demo map: four allied masters with every room and creature against an endless hero gate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-07 23:04:34 +01:00
1 parent 5f70992cfb
commit 210f17773a
23 files changed
+536 -3

No files matched your search

+26 -2
View File
@@ -12,6 +12,7 @@ mod campaign_doc;
mod cloud;
mod commands;
mod demo;
mod demo_map;
mod editor;
mod events;
mod dwarves;
@@ -1660,6 +1661,28 @@ app.pending_briefing = briefing_of(&menu.campaign_doc, i);
ui.show_help = false;
autosave_t = 0.0;
}
MenuAction::DemoMap => {
// debug: four allied masters with every room and creature against an
// endless gate (never autosaved, counts for no achievement)
if app.match_mode || app.game.in_match() {
app.leave_match();
}
app.seed = next_seed(app.seed);
(app.game, app.cam) = Game::new_demo_map(app.seed);
apply_game_settings(&mut app.game, &app.settings);
app.coop = false;
app.recorded = false;
app.tutorial = false;
app.custom_campaign = None;
app.custom_progress = None;
app.custom_mission_index = None;
app.custom_next_index = None;
menu.page = None;
r3d.invalidate();
ui.log.clear();
ui.show_help = false;
autosave_t = 0.0;
}
MenuAction::OpenRepo => platform::open_url(menu::REPO_URL),
MenuAction::OpenClaudeCode => platform::open_url(menu::CLAUDE_CODE_URL),
MenuAction::OpenOpenCode => platform::open_url(menu::OPENCODE_URL),
@@ -1700,7 +1723,7 @@ app.pending_briefing = briefing_of(&menu.campaign_doc, i);
app.tutorial = false;
if app.match_mode || app.game.in_match() {
app.leave_match();
} else if app.game.state == 0 {
} else if app.game.state == 0 && app.game.demo_map.is_none() {
platform::storage_set(save::AUTOSAVE_KEY, &app.autosave_json());
menu.has_autosave = true;
}
@@ -1980,7 +2003,8 @@ app.pending_briefing = briefing_of(&campaign, i);
// the world runs in fixed steps: the speed setting only feeds more time into them
app.game.update(dt * app.settings.game_speed.max(1.0));
// autosave: snapshot for leaving the tab + regular autosave
if app.game.state == 0 && !app.match_mode {
// (the debug demo map never replaces the autosave)
if app.game.state == 0 && !app.match_mode && app.game.demo_map.is_none() {
cache_t += dt;
autosave_t += dt;
if cache_t >= AUTOSAVE_CACHE_EVERY {