1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-07-26 15:22:23 +01:00

Fix r'lyehian sight and implement it for players (as detection)

! and ( being swapped was causing flight/levitation to block r'lyehian
sight.

Also update changelog.

# Conflicts:
#	changelog-nndnh.txt
This commit is contained in:
Ron Nazarov 2024-04-14 03:14:23 +01:00 committed by chris
parent 3abe760868
commit b20d39ece9
4 changed files with 28 additions and 13 deletions

View file

@ -32,8 +32,14 @@
/* 2b. hero is using a telepathy inducing */\ /* 2b. hero is using a telepathy inducing */\
/* object and in range */\ /* object and in range */\
(Unblind_telepat && (distu(mon->mx, mon->my) <= etele_dist)))) (Unblind_telepat && (distu(mon->mx, mon->my) <= etele_dist))))
/* R'lyehian psychic sight, see minds, blocked by water */
#define rlyehian_sensemon(mon) \
(rlyehiansight(youmonst.data) && !mindless_mon(mon) \
&& (!is_pool(u.ux, u.uy, FALSE) || Flying || Levitation || Wwalking) \
&& (!is_pool(mon->mx, mon->my, FALSE) || !is_underswimmer(mon->data) || \
mon_resistance(mon,FLYING) || mon_resistance(mon,LEVITATION)))
#define sensemon(mon) (tp_sensemon(mon) || Detect_monsters || MATCH_WARN_OF_MON(mon) || sense_by_scent(mon)) #define sensemon(mon) (tp_sensemon(mon) || Detect_monsters || MATCH_WARN_OF_MON(mon) || sense_by_scent(mon) || rlyehian_sensemon(mon))
/* /*
* mon_warning() is used to warn of any dangerous monsters in your * mon_warning() is used to warn of any dangerous monsters in your

View file

@ -699,7 +699,7 @@ feel_location(x, y)
/* draw monster on top if we can sense it */ /* draw monster on top if we can sense it */
if ((x != u.ux || y != u.uy) && (mon = m_at(x,y)) && sensemon(mon)) if ((x != u.ux || y != u.uy) && (mon = m_at(x,y)) && sensemon(mon))
display_monster(x, y, mon, display_monster(x, y, mon,
(tp_sensemon(mon) || MATCH_WARN_OF_MON(mon)) ? PHYSICALLY_SEEN : DETECTED, (tp_sensemon(mon) || MATCH_WARN_OF_MON(mon) || rlyehian_sensemon(mon)) ? PHYSICALLY_SEEN : DETECTED,
is_worm_tail(mon)); is_worm_tail(mon));
} }
@ -771,7 +771,7 @@ echo_location(x, y)
/* draw monster on top if we can sense it */ /* draw monster on top if we can sense it */
if ((x != u.ux || y != u.uy) && (sensemon(mon) || sensemon(mon) || mon->m_ap_type)) if ((x != u.ux || y != u.uy) && (sensemon(mon) || sensemon(mon) || mon->m_ap_type))
display_monster(x, y, mon, display_monster(x, y, mon,
(tp_sensemon(mon) || MATCH_WARN_OF_MON(mon)) ? PHYSICALLY_SEEN : DETECTED, (tp_sensemon(mon) || MATCH_WARN_OF_MON(mon) || rlyehian_sensemon(mon)) ? PHYSICALLY_SEEN : DETECTED,
is_worm_tail(mon)); is_worm_tail(mon));
else if (!(canspotmon(mon) || sensemon(mon) || mon->m_ap_type)) { else if (!(canspotmon(mon) || sensemon(mon) || mon->m_ap_type)) {
map_invisible(x, y); map_invisible(x, y);
@ -843,7 +843,8 @@ newsym(x,y)
worm_tail = is_worm_tail(mon); worm_tail = is_worm_tail(mon);
see_it = mon && (worm_tail see_it = mon && (worm_tail
? (!mon->minvis || See_invisible(mon->mx, mon->my)) ? (!mon->minvis || See_invisible(mon->mx, mon->my))
: (mon_visible(mon)) || tp_sensemon(mon) || MATCH_WARN_OF_MON(mon) || sense_by_scent(mon)); : (mon_visible(mon)) || tp_sensemon(mon) || MATCH_WARN_OF_MON(mon)
|| sense_by_scent(mon) || rlyehian_sensemon(mon));
if (mon && (see_it || (!worm_tail && Detect_monsters))) { if (mon && (see_it || (!worm_tail && Detect_monsters))) {
if (mon->mtrapped) { if (mon->mtrapped) {
struct trap *trap = t_at(x, y); struct trap *trap = t_at(x, y);
@ -876,12 +877,13 @@ newsym(x,y)
if (!restoring && senseself()) display_self(); if (!restoring && senseself()) display_self();
} }
else if ((mon = m_at(x,y)) else if ((mon = m_at(x,y))
&& ((see_it = (tp_sensemon(mon) || MATCH_WARN_OF_MON(mon) && ((see_it = (tp_sensemon(mon) || MATCH_WARN_OF_MON(mon) || rlyehian_sensemon(mon)
|| ((see_with_infrared(mon) || see_with_bloodsense(mon) || see_with_lifesense(mon) || see_with_senseall(mon)) || ((see_with_infrared(mon) || see_with_bloodsense(mon)
&& mon_visible(mon)) || see_with_earthsense(mon))) || see_with_lifesense(mon) || see_with_senseall(mon))
|| Detect_monsters && mon_visible(mon)) || see_with_earthsense(mon)))
|| sense_by_scent(mon)) || Detect_monsters
&& !is_worm_tail(mon)) { || sense_by_scent(mon))
&& !is_worm_tail(mon)) {
/* Monsters are printed every time. */ /* Monsters are printed every time. */
/* This also gets rid of any invisibility glyph */ /* This also gets rid of any invisibility glyph */
display_monster(x, y, mon, see_it ? 0 : DETECTED, 0); display_monster(x, y, mon, see_it ? 0 : DETECTED, 0);

View file

@ -2834,10 +2834,10 @@ mon_can_see_mon(looker, lookie)
if(distmin(looker->mx,looker->my,lookie->mx,lookie->my) <= 1 && !rn2(8)) if(distmin(looker->mx,looker->my,lookie->mx,lookie->my) <= 1 && !rn2(8))
return TRUE; return TRUE;
/* R'lyehian psyichic sight, see minds, blocked by water */ /* R'lyehian psychic sight, see minds, blocked by water */
if(rlyehiansight(looker->data) && !mindless_mon(lookie) if(rlyehiansight(looker->data) && !mindless_mon(lookie)
&& !(is_pool(looker->mx, looker->my, FALSE) || mon_resistance(looker,FLYING) || mon_resistance(looker,LEVITATION)) && (!is_pool(looker->mx, looker->my, FALSE) || mon_resistance(looker,FLYING) || mon_resistance(looker,LEVITATION))
&& !(is_pool(lookie->mx, lookie->my, FALSE) || !is_underswimmer(lookie->data) || mon_resistance(lookie,FLYING) || mon_resistance(lookie,LEVITATION)) && (!is_pool(lookie->mx, lookie->my, FALSE) || !is_underswimmer(lookie->data) || mon_resistance(lookie,FLYING) || mon_resistance(lookie,LEVITATION))
) )
return TRUE; return TRUE;

View file

@ -624,6 +624,9 @@ lookat(x, y, buf, monbuf, shapebuff)
/* telepathy */ /* telepathy */
if (tp_sensemon(mtmp)) if (tp_sensemon(mtmp))
ways_seen++; ways_seen++;
/* r'lyehian sight */
if (rlyehian_sensemon(mtmp))
ways_seen++;
/* xray */ /* xray */
if (useemon && xraydist > 0 && if (useemon && xraydist > 0 &&
distu(mtmp->mx, mtmp->my) <= xraydist) { distu(mtmp->mx, mtmp->my) <= xraydist) {
@ -678,6 +681,10 @@ lookat(x, y, buf, monbuf, shapebuff)
Strcat(monbuf, "telepathy"); Strcat(monbuf, "telepathy");
if (ways_seen-- > 1) Strcat(monbuf, ", "); if (ways_seen-- > 1) Strcat(monbuf, ", ");
} }
if (rlyehian_sensemon(mtmp)) {
Strcat(monbuf, "r'lyehian sight");
if (ways_seen-- > 1) Strcat(monbuf, ", ");
}
if (useemon && xraydist > 0 && if (useemon && xraydist > 0 &&
distu(mtmp->mx, mtmp->my) <= xraydist) { distu(mtmp->mx, mtmp->my) <= xraydist) {
/* Eyes of the Overworld */ /* Eyes of the Overworld */