Fog of war: unexplored darkness until the dungeon's ground, creatures or towers come close
- explored tiles stay known (saved compactly as bits), enemies are only drawn while in sight; sight runs along open ground, walls block it - unexplored tiles are black blocks; units, towers, torches, furniture, portals, gate and rival cores in the dark are hidden; minimap and tile info too - the nearest portal is known from the start; the seer's eye opens a wide area for 20 seconds without remembering it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7f4d5ca7b4
commit
240e89d9cb
11 files changed
+244
-17
No files matched your search
@@ -483,6 +483,8 @@ pub struct Game {
|
||||
#[serde(default)]
|
||||
pub reveals: Vec<(f32, f32, f32)>, // seer's eye: x, y, seconds left
|
||||
#[serde(skip)]
|
||||
pub fog_t: f32, // fog of war: seconds until the next update
|
||||
#[serde(skip)]
|
||||
pub forge_work: f32, // work done in the forge this frame
|
||||
#[serde(skip)]
|
||||
pub demo: Option<crate::demo::Demo>, // the endless bridge battle behind the title menu
|
||||
@@ -576,6 +578,7 @@ impl Game {
|
||||
g.guard_treasures();
|
||||
g.place_dwarf_caves(seed);
|
||||
g.init_research(None);
|
||||
g.init_fog();
|
||||
g.msg("msg.welcome1", vec![]);
|
||||
g.msg("msg.welcome2", vec![]);
|
||||
g.msg("msg.welcome3", vec![]);
|
||||
@@ -652,6 +655,7 @@ impl Game {
|
||||
rollers: Vec::new(),
|
||||
clouds: Vec::new(),
|
||||
forge_work: 0.0,
|
||||
fog_t: 0.0,
|
||||
reveals: Vec::new(),
|
||||
known: Vec::new(),
|
||||
researchable: Vec::new(),
|
||||
@@ -1105,6 +1109,7 @@ impl Game {
|
||||
self.update_forge(dt);
|
||||
self.update_research();
|
||||
self.update_reveals(dt);
|
||||
self.update_fog(dt);
|
||||
if !self.rivals.is_empty() {
|
||||
self.update_rivals(dt);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user