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
@@ -704,7 +704,9 @@ impl Ui {
|
||||
for (i, t) in g.map.t.iter().enumerate() {
|
||||
let (x, y) = xy(i);
|
||||
let mut c = minimap_color(t);
|
||||
if t.marked {
|
||||
if !g.map.shown(i) {
|
||||
c = [0, 0, 0, 255];
|
||||
} else if t.marked {
|
||||
c = [255, 230, 90, 255];
|
||||
}
|
||||
self.minimap_img.set_pixel(x as u32, y as u32, Color::from_rgba(c[0], c[1], c[2], c[3]));
|
||||
@@ -717,7 +719,7 @@ impl Ui {
|
||||
draw_texture_ex(&self.minimap_tex, mrx, mry, WHITE, DrawTextureParams { dest_size: Some(vec2(map_w, map_h)), ..Default::default() });
|
||||
let dot = (2.0 * px).max(ms);
|
||||
for e in &g.ents {
|
||||
if e.alive && !e.held {
|
||||
if e.alive && !e.held && !crate::render3d::unit_hidden(g, e) {
|
||||
let c = if e.hero {
|
||||
Color::new(0.6, 0.85, 1.0, 1.0)
|
||||
} else if e.dwarf() {
|
||||
@@ -1146,6 +1148,10 @@ pub fn hover_info(g: &Game, ent: Option<usize>, tile: Option<(i32, i32)>) -> Vec
|
||||
return out;
|
||||
}
|
||||
let Some((x, y)) = tile else { return out };
|
||||
if !g.map.shown(idx(x, y)) {
|
||||
out.push((tr("tile.unexplored"), DIM));
|
||||
return out;
|
||||
}
|
||||
if let Some(tr) = g.trap_at(idx(x, y)) {
|
||||
use crate::traps::*;
|
||||
out.push((tr_name(tr.kind), FRAME_HI));
|
||||
|
||||
Reference in new issue
Block a user