Stinking clouds block line of sight
... you will also get a message when a seen stinking cloud or the one surrounding the hero dissipates. Original feature comes from Fourk, but this version (with some minor changes) comes from xnethack by copperwater <aosdict@gmail.com>
This commit is contained in:
14
src/vision.c
14
src/vision.c
@@ -134,14 +134,14 @@ vision_init(void)
|
||||
/*
|
||||
* does_block()
|
||||
*
|
||||
* Returns true if the level feature, object, or monster at (x,y) blocks
|
||||
* sight.
|
||||
* Returns true if something at (x,y) blocks sight.
|
||||
*/
|
||||
int
|
||||
does_block(int x, int y, struct rm *lev)
|
||||
{
|
||||
struct obj *obj;
|
||||
struct monst *mon;
|
||||
int i;
|
||||
|
||||
/* Features that block . . */
|
||||
if (IS_ROCK(lev->typ) || lev->typ == TREE
|
||||
@@ -163,6 +163,16 @@ does_block(int x, int y, struct rm *lev)
|
||||
&& is_lightblocker_mappear(mon))
|
||||
return 1;
|
||||
|
||||
/* Clouds (poisonous or not) block light. */
|
||||
for (i = 0; i < g.n_regions; i++) {
|
||||
/* Ignore regions with ttl == 0 - expire_gas_cloud must unblock its
|
||||
* points prior to being removed itself. */
|
||||
if (g.regions[i]->ttl > 0 && g.regions[i]->visible
|
||||
&& inside_region(g.regions[i], x, y)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user