Surface world: grass in daylight, forests, cliffs with cave mouths; free-game and editor option

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-05 22:35:46 +01:00
1 parent ef10b5c432
commit 8a35a903de
32 files changed
+343 -24

No files matched your search

+6
View File
@@ -48,6 +48,7 @@ pub struct MissionDef {
pub rivals: Vec<(f32, f32, u8, u8)>, // rival masters: position (fraction of the map), difficulty, side (2 Mossgrim, 3 Lady Nightwell)
pub islands: Vec<IslandDef>,
pub caves: Vec<CaveDef>,
pub surface: f32, // share of the width from where the map lies above ground (0: none)
}
// an island in a lake of water or lava, with treasure and/or a mana spring
@@ -166,6 +167,7 @@ fn base(key: &str, size: (usize, usize), seed: u32, goals: Vec<Goal>) -> Mission
rivals: Vec::new(),
islands: Vec::new(),
caves: Vec::new(),
surface: 0.0,
}
}
@@ -181,6 +183,7 @@ pub fn mission_def_from_doc(d: &crate::campaign_doc::MissionDoc) -> MissionDef {
out.gate = d.waves;
out.gate_defenders = d.waves;
out.time_limit = d.time_limit;
out.surface = if d.gen.surface { 0.5 } else { 0.0 };
out
}
@@ -537,6 +540,9 @@ fn start_mission_def(d: &MissionDef, i: usize, carry: Option<&Carry>, coop: bool
}
g.place_dwarf_caves(d.seed);
g.add_wilds(d.seed, false);
if d.surface > 0.0 {
g.add_surface(d.seed, d.surface, 2 + (h / 64) as u32);
}
g.init_research(Some(i));
g.init_fog();
let heart = d.gate || d.forts.iter().any(|f| f.heart);