diff --git a/include/extern.h b/include/extern.h index c7ccd2856..6aaec4e26 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1778,6 +1778,8 @@ extern void dealloc_mextra(struct monst *); extern boolean usmellmon(struct permonst *); extern void mimic_hit_msg(struct monst *, short); extern void adj_erinys(unsigned); +extern void see_monster_closeup(struct monst *) NONNULLARG1; +extern void see_nearby_monsters(void); /* ### mondata.c ### */ diff --git a/src/allmain.c b/src/allmain.c index b8de1f7a5..c10446417 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -14,7 +14,6 @@ staticfn void moveloop_preamble(boolean); staticfn void u_calc_moveamt(int); -staticfn void see_nearby_monsters(void); staticfn void maybe_do_tutorial(void); #ifdef POSITIONBAR staticfn void do_positionbar(void); @@ -155,28 +154,6 @@ u_calc_moveamt(int wtcap) u.umovement = 0; } -/* mark a monster type as seen when we see it next to us */ -staticfn void -see_nearby_monsters(void) -{ - coordxy x, y; - - if (Blind || !Role_if(PM_TOURIST)) - return; - - for (x = u.ux - 1; x <= u.ux + 1; x++) - for (y = u.uy - 1; y <= u.uy + 1; y++) - if (isok(x, y) && MON_AT(x, y)) { - struct monst *mtmp = m_at(x, y); - - if (canseemon(mtmp) && !svm.mvitals[monsndx(mtmp->data)].seen_close) { - svm.mvitals[monsndx(mtmp->data)].seen_close = TRUE; - more_experienced(experience(mtmp, 0), 0); - newexplevel(); - } - } -} - #if defined(MICRO) || defined(WIN32) static int mvl_abort_lev; #endif diff --git a/src/apply.c b/src/apply.c index 6f1112359..c585afa7e 100644 --- a/src/apply.c +++ b/src/apply.c @@ -63,8 +63,11 @@ do_blinding_ray(struct obj *obj) (int (*) (OBJ_P, OBJ_P)) 0, &obj); obj->ox = u.ux, obj->oy = u.uy; /* flash_hits_mon() wants this */ - if (mtmp) + if (mtmp) { (void) flash_hits_mon(mtmp, obj); + if (obj->otyp == EXPENSIVE_CAMERA) + see_monster_closeup(mtmp); + } /* normally bhit() would do this but for FLASHED_LIGHT we want it to be deferred until after flash_hits_mon() */ transient_light_cleanup(); diff --git a/src/mon.c b/src/mon.c index a87241014..795d8ef0f 100644 --- a/src/mon.c +++ b/src/mon.c @@ -5805,4 +5805,37 @@ adj_erinys(unsigned abuse) pm->difficulty = min(10 + (u.ualign.abuse / 3), 25); } +/* mark monster type as seen from close-up */ +void +see_monster_closeup(struct monst *mtmp) +{ + if (!svm.mvitals[monsndx(mtmp->data)].seen_close) { + svm.mvitals[monsndx(mtmp->data)].seen_close = TRUE; + if (Role_if(PM_TOURIST)) { + more_experienced(experience(mtmp, 0), 0); + newexplevel(); + } + } +} + +/* mark a monster type as seen clse-up when we see it next to us */ +void +see_nearby_monsters(void) +{ + coordxy x, y; + + /* currently used only for tourists ... */ + if (Blind || !Role_if(PM_TOURIST)) + return; + + for (x = u.ux - 1; x <= u.ux + 1; x++) + for (y = u.uy - 1; y <= u.uy + 1; y++) + if (isok(x, y) && MON_AT(x, y)) { + struct monst *mtmp = m_at(x, y); + + if (canseemon(mtmp)) + see_monster_closeup(mtmp); + } +} + /*mon.c*/