adopt pull request #328 - steam clouds
This adds a superset of the code from github pull request #328 to create a short-lived cloud of steam when fire hits a pool or fountain. The original code required C99; this doesn't. It also allowed vapor clouds on the Plane of Water where they don't work sanely becaure regions don't understand air bubble movement and/or vice versa. This inhibits the clouds there [the same ought to be done for scrolls of stinking cloud]. It also left as-is the code that reported when fountains got used up even though conceptually the steam should interfere with being able to see that. This adds a glyph-check hack to augment cansee() so that fountains that boil away entirely are hidden at the time. Regions that block line of slight should be calling block_point() when created and unblock_point() when removed but a naive attempt to introduce that didn't work as expected so I'm giving up on. Fixes #328
This commit is contained in:
@@ -204,15 +204,22 @@ boolean isyou;
|
||||
if (yn("Dry up fountain?") == 'n')
|
||||
return;
|
||||
}
|
||||
/* FIXME: sight-blocking clouds should use block_point() when
|
||||
being created and unblock_point() when going away, then this
|
||||
glyph hackery wouldn't be necessary */
|
||||
if (cansee(x, y)) {
|
||||
int glyph = glyph_at(x, y);
|
||||
|
||||
if (!glyph_is_cmap(glyph) || glyph_to_cmap(glyph) != S_cloud)
|
||||
pline_The("fountain dries up!");
|
||||
}
|
||||
/* replace the fountain with ordinary floor */
|
||||
levl[x][y].typ = ROOM, levl[x][y].flags = 0;
|
||||
levl[x][y].blessedftn = 0;
|
||||
if (cansee(x, y))
|
||||
pline_The("fountain dries up!");
|
||||
g.level.flags.nfountains--;
|
||||
/* The location is seen if the hero/monster is invisible
|
||||
or felt if the hero is blind. */
|
||||
newsym(x, y);
|
||||
g.level.flags.nfountains--;
|
||||
if (isyou && in_town(x, y))
|
||||
(void) angry_guards(FALSE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user