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:
Pasi Kallinen
2022-01-31 19:00:15 +02:00
parent 260e015067
commit 218c0d4a3b
6 changed files with 50 additions and 5 deletions

View File

@@ -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;
}