Make mimics mimicing walls or trees also block light

This commit is contained in:
Pasi Kallinen
2016-01-06 01:44:18 +02:00
parent a049cd070b
commit db4120012d
5 changed files with 15 additions and 6 deletions

View File

@@ -84,6 +84,7 @@ guard macros available for mextra fields similar to those for oextra fields
compile-time option for an alternate paniclog format for public server use
make monsters forget where they stepped when fleeing or teleporting
requiver pickup_thrown objects if quiver is empty
make mimics mimicing walls or trees also block light
Platform- and/or Interface-Specific Fixes

View File

@@ -159,6 +159,16 @@ struct monst {
#define is_vampshifter(mon) \
((mon)->cham == PM_VAMPIRE || (mon)->cham == PM_VAMPIRE_LORD \
|| (mon)->cham == PM_VLAD_THE_IMPALER)
/* mimic appearances that block vision/light */
#define is_lightblocker_mappear(mon) \
(is_obj_mappear(mon, BOULDER) || \
((mon)->m_ap_type == M_AP_FURNITURE \
&& ((mon)->mappearance == S_hcdoor \
|| (mon)->mappearance == S_vcdoor \
|| (mon)->mappearance < S_ndoor /* = walls */ \
|| (mon)->mappearance == S_tree)))
#define is_door_mappear(mon) ((mon)->m_ap_type == M_AP_FURNITURE \
&& ((mon)->mappearance == S_hcdoor || (mon)->mappearance == S_vcdoor))
#define is_obj_mappear(mon,otyp) ((mon)->m_ap_type == M_AP_OBJECT \

View File

@@ -1201,8 +1201,7 @@ set_mimic_blocking()
for (mon = fmon; mon; mon = mon->nmon) {
if (DEADMONSTER(mon))
continue;
if (mon->minvis && (is_door_mappear(mon)
|| is_obj_mappear(mon,BOULDER))) {
if (mon->minvis && is_lightblocker_mappear(mon)) {
if (See_invisible)
block_point(mon->mx, mon->my);
else

View File

@@ -2616,8 +2616,7 @@ void
seemimic(mtmp)
register struct monst *mtmp;
{
boolean is_blocker_appear = (is_door_mappear(mtmp)
|| is_obj_mappear(mtmp, BOULDER));
boolean is_blocker_appear = (is_lightblocker_mappear(mtmp));
if (has_mcorpsenm(mtmp))
freemcorpsenm(mtmp);

View File

@@ -175,9 +175,9 @@ register struct rm *lev;
if (obj->otyp == BOULDER)
return 1;
/* Mimics mimicing a door or boulder block light. */
/* Mimics mimicing a door or boulder or ... block light. */
if ((mon = m_at(x, y)) && (!mon->minvis || See_invisible)
&& (is_door_mappear(mon) || is_obj_mappear(mon,BOULDER)))
&& is_lightblocker_mappear(mon))
return 1;
return 0;