Campaign mission system: 20 mission definitions, goals, unlocks, carry-over

- campaign.rs: missions as key data (size, rivers, fortresses, goals, waves, time limit, gifts);
  start_mission builds the map with the generator; tools unlock step by step; the strongest
  5 creatures and 20% of the gold are carried into the next mission; campaign progress type
- Map generator options (portals, treasure caves, hero gate) and meandering rivers with
  knight bridges
- Mission goals: shards, gate of the order, all knights, vault loot, knight towers, waves;
  time limits; waves and gate defenders only where the mission wants them
- Locked tools are shown dark and cannot be chosen; HUD shows gate/waves/time only when used
- Fix: patrol routes no longer start on tower spots
- Tests: every mission builds, its goals are possible, wave heroes reach the core

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-03 11:11:53 +01:00
1 parent e15b16cc60
commit 46755d68ac
8 files changed
+758 -85

No files matched your search

+6 -1
View File
@@ -1,6 +1,7 @@
// DungeonCraft – dungeon building & defence in the browser (Rust + macroquad, WASM).
mod audio;
mod campaign;
mod cloud;
mod fortress;
mod game;
@@ -413,7 +414,7 @@ async fn main() {
// ---------------- keyboard (only while playing)
if playing {
for i in 0..TOOLS.len() {
if is_key_pressed(key(Action::Tool(i))) {
if is_key_pressed(key(Action::Tool(i))) && app.game.tool_allowed(i) {
ui.tool = TOOLS[i];
inp.ldown = None;
}
@@ -664,6 +665,10 @@ async fn main() {
app.game.hints = app.settings.hints;
}
UiAction::OpenMenu => menu.page = Some(Page::Pause),
UiAction::Locked => {
app.game.msg("msg.tool_locked", vec![]);
app.game.sfx_ui(game::Sfx::Error);
}
UiAction::CloseHelp | UiAction::SelectLanguage(_) | UiAction::Consumed => {}
UiAction::None => {
if touch_mode {