version 1.46 | | version 1.47 |
---|
| | |
/* | | /* |
* static char *rcsid_monster_c = | | * static char *rcsid_monster_c = |
* "$Id: monster.c,v 1.46 2002/07/30 06:37:22 mwedel Exp $"; | | * "$Id: monster.c,v 1.47 2002/08/26 07:14:11 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* the dark. */ | | * the dark. */ |
| | |
else if(op->map&&op->map->darkness>0&&enemy&&!enemy->invisible&& | | else if(op->map&&op->map->darkness>0&&enemy&&!enemy->invisible&& |
!stand_in_light(enemy)&&(!QUERY_FLAG(op,FLAG_SEE_IN_DARK)|| | | !stand_in_light(enemy) && |
!QUERY_FLAG(op,FLAG_SEE_INVISIBLE))) { | | (!QUERY_FLAG(op,FLAG_SEE_IN_DARK) || !QUERY_FLAG(op,FLAG_SEE_INVISIBLE))) { |
int dark = radius/(op->map->darkness); | | int dark = radius/(op->map->darkness); |
radius = (dark>MIN_MON_RADIUS)?(dark+1):MIN_MON_RADIUS; | | radius = (dark>MIN_MON_RADIUS)?(dark+1):MIN_MON_RADIUS; |
} | | } |
| | |
if(enemy->invisible && (!enemy->contr || !enemy->contr->tmp_invis)) | | if(enemy->invisible && (!enemy->contr || !enemy->contr->tmp_invis)) |
return 0; | | return 0; |
| | |
| | |
/* use this for invis also */ | | /* use this for invis also */ |
hide_discovery = op->stats.Int/5; | | hide_discovery = op->stats.Int/5; |
| | |
| | |
| | |
/* we dont give a full treatment of xrays here (shorter range than normal, | | /* we dont give a full treatment of xrays here (shorter range than normal, |
* see through walls). Should we change the code elsewhere to make you | | * see through walls). Should we change the code elsewhere to make you |
* blind even if you can xray? */ | | * blind even if you can xray? |
| | */ |
if(QUERY_FLAG(looker,FLAG_BLIND)&& | | if(QUERY_FLAG(looker,FLAG_BLIND)&& |
(!QUERY_FLAG(looker,FLAG_SEE_INVISIBLE)||QUERY_FLAG(looker,FLAG_XRAYS))) | | (!QUERY_FLAG(looker,FLAG_SEE_INVISIBLE)||QUERY_FLAG(looker,FLAG_XRAYS))) |
return 0; | | return 0; |
| | |
/* checking for invisible things */ | | /* checking for invisible things */ |
if(enemy->invisible) { | | if(enemy->invisible) { |
| | |
/* HIDDEN ENEMY. by definition, you can't see hidden stuff! | | /* HIDDEN ENEMY. by definition, you can't see hidden stuff! |
* However,if you carry any source of light, then the hidden | | * However,if you carry any source of light, then the hidden |
* creature is seeable (and stupid) */ | | * creature is seeable (and stupid) */ |
| | |
if(has_carried_lights(enemy)) { | | if(has_carried_lights(enemy)) { |
if(enemy->hide) { | | if(enemy->hide) { |
make_visible(enemy); | | make_visible(enemy); |
| | |
return 1; | | return 1; |
} else if (enemy->hide) return 0; | | } else if (enemy->hide) return 0; |
| | |
/* INVISIBLE ENEMY. */ | | /* Invisible enemy. Break apart the check for invis undead/invis looker |
if(!QUERY_FLAG(looker,FLAG_SEE_INVISIBLE) | | * into more simple checks - the QUERY_FLAG doesn't return 1/0 values, |
&&(is_true_undead(looker)==(QUERY_FLAG(enemy,FLAG_INVIS_UNDEAD)?1:0))) | | * and making it a conditional makes the code pretty ugly. |
return 0; | | */ |
| | if (!QUERY_FLAG(looker,FLAG_SEE_INVISIBLE)) { |
| | if (is_true_undead(looker) && QUERY_FLAG(enemy, FLAG_INVIS_UNDEAD)) return 0; |
| | else if (!is_true_undead(looker) && !QUERY_FLAG(enemy, FLAG_INVIS_UNDEAD)) return 0; |
| | } |
} else if(looker->type==PLAYER) /* for players, a (possible) shortcut */ | | } else if(looker->type==PLAYER) /* for players, a (possible) shortcut */ |
if(player_can_view(looker,enemy)) return 1; | | if(player_can_view(looker,enemy)) return 1; |
| | |