Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CF: hiding bug fix...
Undead creatures couldnt find stuff in the dark!
Also, we got excessive messageing (may be still
too much?) from monsters searching for hidden
players.
-b.t.
*** monster.c.orig Tue Sep 30 06:06:06 1997
--- monster.c Tue Sep 30 06:57:36 1997
***************
*** 1401,1411 ****
radius=radius<MIN_MON_RADIUS?MIN_MON_RADIUS:radius;
}
else
bonus -= enemy->level;
radius += bonus/5;
! hide_discovery+= bonus/5;
}
/* the stealth adjustment. Only if you are stealthy
* will you be able to sneak up closer to creatures */
if(QUERY_FLAG(enemy,FLAG_STEALTH))
--- 1401,1411 ----
radius=radius<MIN_MON_RADIUS?MIN_MON_RADIUS:radius;
}
else
bonus -= enemy->level;
radius += bonus/5;
! hide_discovery += bonus*5;
}
/* the stealth adjustment. Only if you are stealthy
* will you be able to sneak up closer to creatures */
if(QUERY_FLAG(enemy,FLAG_STEALTH))
***************
*** 1435,1445 ****
* can detect the enemy. This means the longer you hide
* near something, the greater the chance you have of
* being discovered. */
if((x_dist<radius&&y_dist<radius)
||(enemy->hide&&(x_dist<=1||y_dist<=1)
! &&RANDOM()%100<=(hide_discovery>0?hide_discovery:0))
) {
/* make hidden/tmp invisible (player) enemies visible */
if(enemy->invisible && (enemy->hide || !QUERY_FLAG(enemy,FLAG_MAKE_INVIS)))
{
make_visible(enemy);
--- 1435,1445 ----
* can detect the enemy. This means the longer you hide
* near something, the greater the chance you have of
* being discovered. */
if((x_dist<radius&&y_dist<radius)
||(enemy->hide&&(x_dist<=1||y_dist<=1)
! &&RANDOM()%100<=(hide_discovery>0?hide_discovery:1))
) {
/* make hidden/tmp invisible (player) enemies visible */
if(enemy->invisible && (enemy->hide || !QUERY_FLAG(enemy,FLAG_MAKE_INVIS)))
{
make_visible(enemy);
***************
*** 1448,1458 ****
new_draw_info(NDI_UNIQUE,0, enemy,"You are discovered!");
}
return 1; /* detected enemy */
} else if(enemy->hide /* Nearby Hidden enemies */
! && (x_dist==radius||y_dist==radius)
) {
/* Since the enemy is nearby we excellerate the time of
* becoming unhidden (ie as finding the enemy is easier)
* In order to leave actual discovery (hide==0 state) to
* be handled above (not here) we only decrement so that
--- 1448,1458 ----
new_draw_info(NDI_UNIQUE,0, enemy,"You are discovered!");
}
return 1; /* detected enemy */
} else if(enemy->hide /* Nearby Hidden enemies */
! && (x_dist<=((radius/5)+1)||y_dist<=((radius/5)+1))
) {
/* Since the enemy is nearby we excellerate the time of
* becoming unhidden (ie as finding the enemy is easier)
* In order to leave actual discovery (hide==0 state) to
* be handled above (not here) we only decrement so that
***************
*** 1532,1542 ****
* However,if you carry any source of light, then the hidden
* creature is seeable (and stupid) */
if(has_carried_lights(enemy)) {
if(enemy->hide) {
make_visible(enemy);
! new_draw_info(NDI_UNIQUE,0, enemy,
"Your light reveals your hidding spot!");
}
return 1;
} else if (enemy->hide) return 0;
--- 1532,1542 ----
* However,if you carry any source of light, then the hidden
* creature is seeable (and stupid) */
if(has_carried_lights(enemy)) {
if(enemy->hide) {
make_visible(enemy);
! new_draw_info(NDI_UNIQUE,0, enemy,
"Your light reveals your hidding spot!");
}
return 1;
} else if (enemy->hide) return 0;
***************
*** 1547,1559 ****
}
#ifdef USE_LIGHTING
/* ENEMY IN DARK MAP. Without infravision, the enemy is not seen
! * unless they carry a light or stand in light. */
if(looker->map->darkness>0&&!stand_in_light(enemy)
! &&(!QUERY_FLAG(looker,FLAG_SEE_IN_DARK)||!QUERY_FLAG(looker,FLAG_XRAYS)))
return 0;
#endif
return 1;
}
--- 1547,1562 ----
}
#ifdef USE_LIGHTING
/* ENEMY IN DARK MAP. Without infravision, the enemy is not seen
! * unless they carry a light or stand in light. Darkness doesnt
! * inhibit the undead per se (but we should give their archs
! * CAN_SEE_IN_DARK, this is just a safety */
if(looker->map->darkness>0&&!stand_in_light(enemy)
! &&(!QUERY_FLAG(looker,FLAG_SEE_IN_DARK)||
! !is_true_undead(looker)||!QUERY_FLAG(looker,FLAG_XRAYS)))
return 0;
#endif
return 1;
}
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]