implement #986 - camera flash 'tweak'
Implement the suggested feature that a camera's flash actually update hero's memory of the map as it traverses across the level. Turned out to be more work than anticipated despite having the code for a thrown or kicked lit candle or lamp to build upon. Among other things it needed to update the circle code to handle previously unused radius 0 to operate on the center point only. I've never touched that before and hope this hasn't introduced any bugs. Also removes several instances of vision code operating on column #0. (At least one is still present.)
This commit is contained in:
10
src/zap.c
10
src/zap.c
@@ -3320,6 +3320,8 @@ struct obj **pobj; /* object tossed/used, set to NULL
|
||||
|
||||
/* iron bars will block anything big enough and break some things */
|
||||
if (weapon == THROWN_WEAPON || weapon == KICKED_WEAPON) {
|
||||
if (obj->lamplit && !Blind)
|
||||
show_transient_light(obj, g.bhitpos.x, g.bhitpos.y);
|
||||
if (typ == IRONBARS
|
||||
&& hits_bars(pobj, x - ddx, y - ddy, g.bhitpos.x, g.bhitpos.y,
|
||||
point_blank ? 0 : !rn2(5), 1)) {
|
||||
@@ -3328,9 +3330,11 @@ struct obj **pobj; /* object tossed/used, set to NULL
|
||||
g.bhitpos.x -= ddx;
|
||||
g.bhitpos.y -= ddy;
|
||||
break;
|
||||
} else if (obj->lamplit && !Blind) {
|
||||
show_transient_light(obj, g.bhitpos.x, g.bhitpos.y);
|
||||
}
|
||||
} else if (weapon == FLASHED_LIGHT) {
|
||||
if (!Blind)
|
||||
show_transient_light((struct obj *) 0,
|
||||
g.bhitpos.x, g.bhitpos.y);
|
||||
}
|
||||
|
||||
if (weapon == ZAPPED_WAND && find_drawbridge(&x, &y)) {
|
||||
@@ -3546,6 +3550,8 @@ struct obj **pobj; /* object tossed/used, set to NULL
|
||||
pay_for_damage("destroy", FALSE);
|
||||
|
||||
bhit_done:
|
||||
/* note: for FLASHED_LIGHT, _caller_ must call transient_light_cleanup()
|
||||
after possibly calling flash_hits_mon() */
|
||||
if (weapon == THROWN_WEAPON || weapon == KICKED_WEAPON)
|
||||
transient_light_cleanup();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user