Rivers and bridges: water and lava tiles, bridge tool, burning in lava
- New tile kinds (appended for the savegame codec): water, lava, wooden bridge, stone bridge, core shard - Sunken river beds with banks, bridge decks with rails, lava glow and lights - Bridge tool (key U, rooms category): bridges grow from own ground, 30 gold/tile over water, 75 over lava - Selling a bridge drops the units on it into the river (water: swim to the bank, lava: burn) - Cannon blasts and punches knock units back; into lava = burnt (heroes still pay their bounty) - Heroes cannot path through rivers; texts EN/DE; tests for bridges and lava Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
af6be62805
commit
75dc445d3b
9 files changed
+536
-22
No files matched your search
+40
-3
@@ -49,10 +49,15 @@ pub enum Kind {
|
||||
Torture,
|
||||
Tower, // floor tile occupied by a defence tower (not walkable)
|
||||
Temple,
|
||||
Water, // underground river: not walkable, needs a bridge
|
||||
Lava, // lava river: not walkable, burns what falls in
|
||||
Bridge, // wooden bridge over water (walkable)
|
||||
LavaBridge, // stone bridge over lava (walkable)
|
||||
Shard, // floor with a shard of the soul core (campaign)
|
||||
}
|
||||
|
||||
// order matters for the packed savegame codec: only append new kinds
|
||||
const KINDS: [Kind; 15] = [
|
||||
const KINDS: [Kind; 20] = [
|
||||
Kind::Rock,
|
||||
Kind::Earth,
|
||||
Kind::Gold,
|
||||
@@ -68,6 +73,11 @@ const KINDS: [Kind; 15] = [
|
||||
Kind::Torture,
|
||||
Kind::Tower,
|
||||
Kind::Temple,
|
||||
Kind::Water,
|
||||
Kind::Lava,
|
||||
Kind::Bridge,
|
||||
Kind::LavaBridge,
|
||||
Kind::Shard,
|
||||
];
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
@@ -117,9 +127,36 @@ impl Tile {
|
||||
pub fn walkable(&self) -> bool {
|
||||
matches!(
|
||||
self.kind,
|
||||
Kind::Floor | Kind::Treasury | Kind::Lair | Kind::Farm | Kind::Training | Kind::Library | Kind::Portal | Kind::Gate | Kind::Torture | Kind::Temple
|
||||
Kind::Floor
|
||||
| Kind::Treasury
|
||||
| Kind::Lair
|
||||
| Kind::Farm
|
||||
| Kind::Training
|
||||
| Kind::Library
|
||||
| Kind::Portal
|
||||
| Kind::Gate
|
||||
| Kind::Torture
|
||||
| Kind::Temple
|
||||
| Kind::Bridge
|
||||
| Kind::LavaBridge
|
||||
| Kind::Shard
|
||||
)
|
||||
}
|
||||
// river tiles (open, but nobody can walk there)
|
||||
pub fn liquid(&self) -> bool {
|
||||
matches!(self.kind, Kind::Water | Kind::Lava)
|
||||
}
|
||||
pub fn bridge(&self) -> bool {
|
||||
matches!(self.kind, Kind::Bridge | Kind::LavaBridge)
|
||||
}
|
||||
// the river below a bridge or river tile
|
||||
pub fn river(&self) -> Option<Kind> {
|
||||
match self.kind {
|
||||
Kind::Water | Kind::Bridge => Some(Kind::Water),
|
||||
Kind::Lava | Kind::LavaBridge => Some(Kind::Lava),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn idx(x: i32, y: i32) -> usize {
|
||||
@@ -441,7 +478,7 @@ impl Map {
|
||||
Kind::Earth if tl.reinforced => Some(70),
|
||||
Kind::Earth => Some(7),
|
||||
Kind::Gold => Some(12),
|
||||
Kind::Rock | Kind::Core | Kind::Tower => None,
|
||||
Kind::Rock | Kind::Core | Kind::Tower | Kind::Water | Kind::Lava => None,
|
||||
_ => Some(1),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user