Wood: giant mushrooms underground, felled by imps; wooden bridges and doors cost wood

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:07:59 +01:00
1 parent c5adc3e902
commit 398bb95681
28 files changed
+447 -31

No files matched your search

+12 -2
View File
@@ -70,6 +70,8 @@ pub enum Kind {
Altar, // room: sacrifices
Drawbridge, // bridge that can be raised (res: see DB_RAISED, DB_AUTO, DB_LAVA)
Obsidian, // lava cooled by frost: walkable until it melts again
Mushroom, // giant mushroom on open ground: imps fell it for wood (grows back)
Tree, // tree above ground: imps fell it for wood
}
// drawbridge state in Tile::res
@@ -103,7 +105,7 @@ pub struct River {
}
// order matters for the packed savegame codec: only append new kinds
const KINDS: [Kind; 36] = [
const KINDS: [Kind; 38] = [
Kind::Rock,
Kind::Earth,
Kind::Gold,
@@ -140,6 +142,8 @@ const KINDS: [Kind; 36] = [
Kind::Altar,
Kind::Drawbridge,
Kind::Obsidian,
Kind::Mushroom,
Kind::Tree,
];
// treasures (veins, treasury content, imp loads): 0 gold, 1 silver, 2 ruby, 3 diamond
@@ -223,7 +227,11 @@ impl Tile {
matches!(self.kind, Kind::Rock | Kind::Earth | Kind::Gold | Kind::Silver | Kind::Ruby | Kind::Diamond | Kind::Steel)
}
pub fn diggable(&self) -> bool {
matches!(self.kind, Kind::Earth | Kind::Gold | Kind::Silver | Kind::Ruby | Kind::Diamond | Kind::Steel)
matches!(self.kind, Kind::Earth | Kind::Gold | Kind::Silver | Kind::Ruby | Kind::Diamond | Kind::Steel | Kind::Mushroom | Kind::Tree)
}
// a giant mushroom or a tree: felled like a wall is dug, gives wood
pub fn plant(&self) -> bool {
matches!(self.kind, Kind::Mushroom | Kind::Tree)
}
// the treasure of a vein (None for everything else)
pub fn vein(&self) -> Option<u8> {
@@ -751,6 +759,8 @@ impl Map {
Kind::Gold | Kind::Silver | Kind::Ruby | Kind::Diamond => Some(12),
Kind::Rock | Kind::Core | Kind::Tower | Kind::Water | Kind::Lava => None,
Kind::Door => Some(10),
Kind::Mushroom | Kind::Tree => Some(6),
Kind::Drawbridge if tl.res & DB_RAISED != 0 => None,
_ => Some(1),
}
}