Mushroom groves: unclaimable moss where giant mushrooms grow slowly and glow when ready to fell

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-06 10:25:24 +01:00
1 parent 368a338ccf
commit f8eda88bb3
26 files changed
+321 -43

No files matched your search

+9 -1
View File
@@ -35,7 +35,7 @@ enum Cat {
const CATS: [Cat; 9] = [Cat::Terrain, Cat::Rooms, Cat::Places, Cat::Units, Cat::Towers, Cat::Traps, Cat::Forts, Cat::Zones, Cat::Erase];
const TERRAIN: [&str; 16] = ["floor", "earth", "reinforced", "rock", "water", "lava", "bridge", "lavabridge", "gold", "silver", "ruby", "diamond", "steel", "mushroom", "grass", "tree"];
const TERRAIN: [&str; 17] = ["floor", "earth", "reinforced", "rock", "water", "lava", "bridge", "lavabridge", "gold", "silver", "ruby", "diamond", "steel", "mushroom", "grove", "grass", "tree"];
const PLACES: [&str; 7] = ["core", "portal", "gate", "spring", "shard", "chest", "chained"];
const OWNERS: [Owner; 6] = [Owner::Player, Owner::Hero, Owner::Rival1, Owner::Rival2, Owner::Rival3, Owner::None];
const ZONE_SHAPES: [&str; 4] = ["rect", "circle", "tiles", "line"];
@@ -76,6 +76,7 @@ fn kind_of_terrain(t: &str) -> (Kind, bool) {
"bridge" => (Kind::Bridge, false),
"lavabridge" => (Kind::LavaBridge, false),
"mushroom" => (Kind::Mushroom, false),
"grove" => (Kind::Grove, false),
"grass" => (Kind::Floor, false),
"tree" => (Kind::Tree, false),
"gold" => (Kind::Gold, false),
@@ -218,6 +219,13 @@ impl MapEdit {
self.game.torches.retain(|tr| tr.wall != i);
let owner = if k == Kind::Floor || reinforced || matches!(k, Kind::Bridge | Kind::LavaBridge) { OWNERS[self.owner] } else { Owner::None };
let tl = &mut self.game.map.t[i];
// a mushroom painted into a grove belongs to it (it leaves moss when felled); fully grown
if k == Kind::Mushroom {
tl.res = if tl.kind == Kind::Grove || tl.res & crate::map::MUSH_GROVE != 0 { crate::map::MUSH_GROVE } else { 0 };
tl.food = 0.0;
} else if tl.kind == Kind::Mushroom {
tl.res = 0;
}
tl.kind = k;
tl.reinforced = reinforced;
tl.owner = if reinforced && owner == Owner::None { Owner::Player } else { owner };