Accessibility: give a message when teleporting a monster
Teleporting a monster only updated the map. Give a message so blind players can get the same information. Making a monster invisible gives the same message, if you cannot detect invisible. Several other places where monsters teleported themselves now also give the same message.
This commit is contained in:
@@ -710,6 +710,7 @@ extend 3.6.1 fix to explicitly use name of unseen shopkeeper instead of "It"
|
|||||||
fix some inconsistencies with applied bullwhip vs monster
|
fix some inconsistencies with applied bullwhip vs monster
|
||||||
polymorphing while wearing an amulet of strangulation from a form that wasn't
|
polymorphing while wearing an amulet of strangulation from a form that wasn't
|
||||||
vulnerable to one that was gave wrong message ("still constricts")
|
vulnerable to one that was gave wrong message ("still constricts")
|
||||||
|
for accessibility reasons, give a message when monster teleports
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
+4
-3
@@ -1454,9 +1454,9 @@ extern void killed(struct monst *);
|
|||||||
extern void xkilled(struct monst *, int);
|
extern void xkilled(struct monst *, int);
|
||||||
extern void mon_to_stone(struct monst *);
|
extern void mon_to_stone(struct monst *);
|
||||||
extern void m_into_limbo(struct monst *);
|
extern void m_into_limbo(struct monst *);
|
||||||
extern void mnexto(struct monst *);
|
extern void mnexto(struct monst *, unsigned);
|
||||||
extern void maybe_mnexto(struct monst *);
|
extern void maybe_mnexto(struct monst *);
|
||||||
extern int mnearto(struct monst *, xchar, xchar, boolean);
|
extern int mnearto(struct monst *, xchar, xchar, boolean, unsigned);
|
||||||
extern void m_respond(struct monst *);
|
extern void m_respond(struct monst *);
|
||||||
extern void setmangry(struct monst *, boolean);
|
extern void setmangry(struct monst *, boolean);
|
||||||
extern void wakeup(struct monst *, boolean);
|
extern void wakeup(struct monst *, boolean);
|
||||||
@@ -2576,7 +2576,8 @@ extern void domagicportal(struct trap *);
|
|||||||
extern void tele_trap(struct trap *);
|
extern void tele_trap(struct trap *);
|
||||||
extern void level_tele_trap(struct trap *, unsigned);
|
extern void level_tele_trap(struct trap *, unsigned);
|
||||||
extern void rloc_to(struct monst *, int, int);
|
extern void rloc_to(struct monst *, int, int);
|
||||||
extern boolean rloc(struct monst *, boolean);
|
extern void rloc_to_flag(struct monst *, int, int, unsigned);
|
||||||
|
extern boolean rloc(struct monst *, unsigned);
|
||||||
extern boolean tele_restrict(struct monst *);
|
extern boolean tele_restrict(struct monst *);
|
||||||
extern void mtele_trap(struct monst *, struct trap *, int);
|
extern void mtele_trap(struct monst *, struct trap *, int);
|
||||||
extern int mlevel_tele_trap(struct monst *, struct trap *, boolean, int);
|
extern int mlevel_tele_trap(struct monst *, struct trap *, boolean, int);
|
||||||
|
|||||||
@@ -442,6 +442,12 @@ typedef struct sortloot_item Loot;
|
|||||||
#define SUPPRESS_HISTORY 4
|
#define SUPPRESS_HISTORY 4
|
||||||
#define URGENT_MESSAGE 8
|
#define URGENT_MESSAGE 8
|
||||||
|
|
||||||
|
/* rloc() flags */
|
||||||
|
#define RLOC_NONE 0x00
|
||||||
|
#define RLOC_ERR 0x01 /* allow impossible() if no rloc */
|
||||||
|
#define RLOC_MSG 0x02 /* show vanish/appear msg */
|
||||||
|
#define RLOC_NOMSG 0x04 /* prevent appear msg, even for STRAT_APPEARMSG */
|
||||||
|
|
||||||
/* Lua callback functions */
|
/* Lua callback functions */
|
||||||
enum nhcore_calls {
|
enum nhcore_calls {
|
||||||
NHCORE_START_NEW_GAME = 0,
|
NHCORE_START_NEW_GAME = 0,
|
||||||
|
|||||||
+1
-1
@@ -690,7 +690,7 @@ newgame(void)
|
|||||||
check_special_room(FALSE);
|
check_special_room(FALSE);
|
||||||
|
|
||||||
if (MON_AT(u.ux, u.uy))
|
if (MON_AT(u.ux, u.uy))
|
||||||
mnexto(m_at(u.ux, u.uy));
|
mnexto(m_at(u.ux, u.uy), RLOC_NOMSG);
|
||||||
(void) makedog();
|
(void) makedog();
|
||||||
docrt();
|
docrt();
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -507,7 +507,8 @@ use_magic_whistle(struct obj *obj)
|
|||||||
if (M_AP_TYPE(mtmp))
|
if (M_AP_TYPE(mtmp))
|
||||||
seemimic(mtmp);
|
seemimic(mtmp);
|
||||||
omx = mtmp->mx, omy = mtmp->my;
|
omx = mtmp->mx, omy = mtmp->my;
|
||||||
mnexto(mtmp);
|
if (distu(omx, omy) > 2)
|
||||||
|
mnexto(mtmp, RLOC_MSG);
|
||||||
if (mtmp->mx != omx || mtmp->my != omy) {
|
if (mtmp->mx != omx || mtmp->my != omy) {
|
||||||
mtmp->mundetected = 0; /* reveal non-mimic hider */
|
mtmp->mundetected = 0; /* reveal non-mimic hider */
|
||||||
if (canspotmon(mtmp))
|
if (canspotmon(mtmp))
|
||||||
@@ -732,7 +733,7 @@ next_to_u(void)
|
|||||||
continue;
|
continue;
|
||||||
if (mtmp->mleashed) {
|
if (mtmp->mleashed) {
|
||||||
if (distu(mtmp->mx, mtmp->my) > 2)
|
if (distu(mtmp->mx, mtmp->my) > 2)
|
||||||
mnexto(mtmp);
|
mnexto(mtmp, RLOC_NOMSG);
|
||||||
if (distu(mtmp->mx, mtmp->my) > 2) {
|
if (distu(mtmp->mx, mtmp->my) > 2) {
|
||||||
for (otmp = g.invent; otmp; otmp = otmp->nobj)
|
for (otmp = g.invent; otmp; otmp = otmp->nobj)
|
||||||
if (otmp->otyp == LEASH
|
if (otmp->otyp == LEASH
|
||||||
@@ -994,7 +995,7 @@ use_mirror(struct obj *obj)
|
|||||||
freeinv(obj);
|
freeinv(obj);
|
||||||
(void) mpickobj(mtmp, obj);
|
(void) mpickobj(mtmp, obj);
|
||||||
if (!tele_restrict(mtmp))
|
if (!tele_restrict(mtmp))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
} else if (!is_unicorn(mtmp->data) && !humanoid(mtmp->data)
|
} else if (!is_unicorn(mtmp->data) && !humanoid(mtmp->data)
|
||||||
&& (!mtmp->minvis || perceives(mtmp->data)) && rn2(5)) {
|
&& (!mtmp->minvis || perceives(mtmp->data)) && rn2(5)) {
|
||||||
boolean do_react = TRUE;
|
boolean do_react = TRUE;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ mkcavepos(xchar x, xchar y, int dist, boolean waslit, boolean rockit)
|
|||||||
return; /* don't cover the portal */
|
return; /* don't cover the portal */
|
||||||
if ((mtmp = m_at(x, y)) != 0) /* make sure crucial monsters survive */
|
if ((mtmp = m_at(x, y)) != 0) /* make sure crucial monsters survive */
|
||||||
if (!passes_walls(mtmp->data))
|
if (!passes_walls(mtmp->data))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_NOMSG);
|
||||||
} else if (lev->typ == ROOM)
|
} else if (lev->typ == ROOM)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -1255,7 +1255,7 @@ u_collide_m(struct monst *mtmp)
|
|||||||
&& distu(cc.x, cc.y) <= 2)
|
&& distu(cc.x, cc.y) <= 2)
|
||||||
u_on_newpos(cc.x, cc.y); /*[maybe give message here?]*/
|
u_on_newpos(cc.x, cc.y); /*[maybe give message here?]*/
|
||||||
else
|
else
|
||||||
mnexto(mtmp);
|
mnexto(mtmp, RLOC_NOMSG);
|
||||||
|
|
||||||
if ((mtmp = m_at(u.ux, u.uy)) != 0) {
|
if ((mtmp = m_at(u.ux, u.uy)) != 0) {
|
||||||
/* there was an unconditional impossible("mnexto failed")
|
/* there was an unconditional impossible("mnexto failed")
|
||||||
@@ -1263,7 +1263,7 @@ u_collide_m(struct monst *mtmp)
|
|||||||
with the situation, so only say something when debugging */
|
with the situation, so only say something when debugging */
|
||||||
if (wizard)
|
if (wizard)
|
||||||
pline("(monster in hero's way)");
|
pline("(monster in hero's way)");
|
||||||
if (!rloc(mtmp, TRUE) || (mtmp = m_at(u.ux, u.uy)) != 0)
|
if (!rloc(mtmp, RLOC_NOMSG) || (mtmp = m_at(u.ux, u.uy)) != 0)
|
||||||
/* no room to move it; send it away, to return later */
|
/* no room to move it; send it away, to return later */
|
||||||
m_into_limbo(mtmp);
|
m_into_limbo(mtmp);
|
||||||
}
|
}
|
||||||
@@ -1977,7 +1977,7 @@ revive_mon(anything *arg, long timeout UNUSED)
|
|||||||
boolean notice_it = canseemon(mtmp); /* before rloc() */
|
boolean notice_it = canseemon(mtmp); /* before rloc() */
|
||||||
char *monname = Monnam(mtmp);
|
char *monname = Monnam(mtmp);
|
||||||
|
|
||||||
if (rloc(mtmp, TRUE)) {
|
if (rloc(mtmp, RLOC_NOMSG)) {
|
||||||
if (notice_it && !canseemon(mtmp))
|
if (notice_it && !canseemon(mtmp))
|
||||||
pline("%s vanishes.", monname);
|
pline("%s vanishes.", monname);
|
||||||
else if (!notice_it && canseemon(mtmp))
|
else if (!notice_it && canseemon(mtmp))
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ mon_arrive(struct monst *mtmp, boolean with_you)
|
|||||||
&& !rn2(mtmp->mtame ? 10 : mtmp->mpeaceful ? 5 : 2))
|
&& !rn2(mtmp->mtame ? 10 : mtmp->mpeaceful ? 5 : 2))
|
||||||
rloc_to(mtmp, u.ux, u.uy);
|
rloc_to(mtmp, u.ux, u.uy);
|
||||||
else
|
else
|
||||||
mnexto(mtmp);
|
mnexto(mtmp, RLOC_NOMSG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -470,9 +470,9 @@ mon_arrive(struct monst *mtmp, boolean with_you)
|
|||||||
mtmp->mx = 0; /*(already is 0)*/
|
mtmp->mx = 0; /*(already is 0)*/
|
||||||
mtmp->my = xyflags;
|
mtmp->my = xyflags;
|
||||||
if (xlocale)
|
if (xlocale)
|
||||||
failed_to_place = !mnearto(mtmp, xlocale, ylocale, FALSE);
|
failed_to_place = !mnearto(mtmp, xlocale, ylocale, FALSE, RLOC_NOMSG);
|
||||||
else
|
else
|
||||||
failed_to_place = !rloc(mtmp, TRUE);
|
failed_to_place = !rloc(mtmp, RLOC_NOMSG);
|
||||||
|
|
||||||
if (failed_to_place)
|
if (failed_to_place)
|
||||||
m_into_limbo(mtmp); /* try again next time hero comes to this level */
|
m_into_limbo(mtmp); /* try again next time hero comes to this level */
|
||||||
|
|||||||
+1
-1
@@ -2014,7 +2014,7 @@ gem_accept(register struct monst *mon, register struct obj *obj)
|
|||||||
if (!Blind)
|
if (!Blind)
|
||||||
pline1(buf);
|
pline1(buf);
|
||||||
if (!tele_restrict(mon))
|
if (!tele_restrict(mon))
|
||||||
(void) rloc(mon, TRUE);
|
(void) rloc(mon, RLOC_MSG);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2497,7 +2497,7 @@ spoteffects(boolean pick)
|
|||||||
pline("%s attacks you by surprise!", Amonnam(mtmp));
|
pline("%s attacks you by surprise!", Amonnam(mtmp));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mnexto(mtmp); /* have to move the monster */
|
mnexto(mtmp, RLOC_NOMSG); /* have to move the monster */
|
||||||
}
|
}
|
||||||
spotdone:
|
spotdone:
|
||||||
if (!--inspoteffects) {
|
if (!--inspoteffects) {
|
||||||
|
|||||||
+1
-1
@@ -1038,7 +1038,7 @@ mon_poly(struct monst *magr, struct monst *mdef, int dmg)
|
|||||||
if (magr == &g.youmonst)
|
if (magr == &g.youmonst)
|
||||||
tele();
|
tele();
|
||||||
else if (!tele_restrict(magr))
|
else if (!tele_restrict(magr))
|
||||||
(void) rloc(magr, TRUE);
|
(void) rloc(magr, RLOC_MSG);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (g.vis && flags.verbose)
|
if (g.vis && flags.verbose)
|
||||||
|
|||||||
+3
-3
@@ -233,7 +233,7 @@ expels(struct monst *mtmp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
unstuck(mtmp); /* ball&chain returned in unstuck() */
|
unstuck(mtmp); /* ball&chain returned in unstuck() */
|
||||||
mnexto(mtmp);
|
mnexto(mtmp, RLOC_NOMSG);
|
||||||
newsym(u.ux, u.uy);
|
newsym(u.ux, u.uy);
|
||||||
spoteffects(TRUE);
|
spoteffects(TRUE);
|
||||||
/* to cover for a case where mtmp is not in a next square */
|
/* to cover for a case where mtmp is not in a next square */
|
||||||
@@ -1885,7 +1885,7 @@ doseduce(struct monst *mon)
|
|||||||
/* else no regret message if can't see or hear seducer */
|
/* else no regret message if can't see or hear seducer */
|
||||||
|
|
||||||
if (!tele_restrict(mon))
|
if (!tele_restrict(mon))
|
||||||
(void) rloc(mon, TRUE);
|
(void) rloc(mon, RLOC_MSG);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (u.ualign.type == A_CHAOTIC)
|
if (u.ualign.type == A_CHAOTIC)
|
||||||
@@ -2018,7 +2018,7 @@ doseduce(struct monst *mon)
|
|||||||
if (!rn2(25))
|
if (!rn2(25))
|
||||||
mon->mcan = 1; /* monster is worn out */
|
mon->mcan = 1; /* monster is worn out */
|
||||||
if (!tele_restrict(mon))
|
if (!tele_restrict(mon))
|
||||||
(void) rloc(mon, TRUE);
|
(void) rloc(mon, RLOC_MSG);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -299,7 +299,7 @@ demon_talk(register struct monst *mtmp)
|
|||||||
else if (canseemon(mtmp))
|
else if (canseemon(mtmp))
|
||||||
pline("%s says something.", Amonnam(mtmp));
|
pline("%s says something.", Amonnam(mtmp));
|
||||||
if (!tele_restrict(mtmp))
|
if (!tele_restrict(mtmp))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
cash = money_cnt(g.invent);
|
cash = money_cnt(g.invent);
|
||||||
|
|||||||
+5
-5
@@ -334,7 +334,7 @@ put_lregion_here(
|
|||||||
if ((mtmp = m_at(x, y)) != 0) {
|
if ((mtmp = m_at(x, y)) != 0) {
|
||||||
/* move the monster if no choice, or just try again */
|
/* move the monster if no choice, or just try again */
|
||||||
if (oneshot) {
|
if (oneshot) {
|
||||||
if (!rloc(mtmp, TRUE))
|
if (!rloc(mtmp, RLOC_NOMSG))
|
||||||
m_into_limbo(mtmp);
|
m_into_limbo(mtmp);
|
||||||
} else
|
} else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -431,7 +431,7 @@ baalz_fixup(void)
|
|||||||
levl[x][y].typ = (levl[x][y].typ == TLWALL) ? BRCORNER : BLCORNER;
|
levl[x][y].typ = (levl[x][y].typ == TLWALL) ? BRCORNER : BLCORNER;
|
||||||
levl[x][y + 1].typ = HWALL;
|
levl[x][y + 1].typ = HWALL;
|
||||||
if ((mtmp = m_at(x, y)) != 0) /* something at temporary pool... */
|
if ((mtmp = m_at(x, y)) != 0) /* something at temporary pool... */
|
||||||
(void) rloc(mtmp, FALSE);
|
(void) rloc(mtmp, RLOC_ERR|RLOC_NOMSG);
|
||||||
}
|
}
|
||||||
|
|
||||||
x = g.bughack.delarea.x2, y = g.bughack.delarea.y2;
|
x = g.bughack.delarea.x2, y = g.bughack.delarea.y2;
|
||||||
@@ -440,7 +440,7 @@ baalz_fixup(void)
|
|||||||
levl[x][y].typ = (levl[x][y].typ == TLWALL) ? TRCORNER : TLCORNER;
|
levl[x][y].typ = (levl[x][y].typ == TLWALL) ? TRCORNER : TLCORNER;
|
||||||
levl[x][y - 1].typ = HWALL;
|
levl[x][y - 1].typ = HWALL;
|
||||||
if ((mtmp = m_at(x, y)) != 0) /* something at temporary pool... */
|
if ((mtmp = m_at(x, y)) != 0) /* something at temporary pool... */
|
||||||
(void) rloc(mtmp, FALSE);
|
(void) rloc(mtmp, RLOC_ERR|RLOC_NOMSG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reset bughack region; set low end to <COLNO,ROWNO> so that
|
/* reset bughack region; set low end to <COLNO,ROWNO> so that
|
||||||
@@ -1867,7 +1867,7 @@ mv_bubble(struct bubble* b, int dx, int dy, boolean ini)
|
|||||||
|
|
||||||
/* mnearto() might fail. We can jump right to elemental_clog
|
/* mnearto() might fail. We can jump right to elemental_clog
|
||||||
from here rather than deal_with_overcrowding() */
|
from here rather than deal_with_overcrowding() */
|
||||||
if (!mnearto(mon, cons->x, cons->y, TRUE))
|
if (!mnearto(mon, cons->x, cons->y, TRUE, RLOC_NOMSG))
|
||||||
elemental_clog(mon);
|
elemental_clog(mon);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1880,7 +1880,7 @@ mv_bubble(struct bubble* b, int dx, int dy, boolean ini)
|
|||||||
newsym(ux0, uy0); /* clean up old position */
|
newsym(ux0, uy0); /* clean up old position */
|
||||||
|
|
||||||
if (mtmp) {
|
if (mtmp) {
|
||||||
mnexto(mtmp);
|
mnexto(mtmp, RLOC_NOMSG);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -750,7 +750,7 @@ minliquid_core(struct monst* mtmp)
|
|||||||
/* not fair...? hero doesn't automatically teleport away
|
/* not fair...? hero doesn't automatically teleport away
|
||||||
from lava, just from water */
|
from lava, just from water */
|
||||||
if (can_teleport(mtmp->data) && !tele_restrict(mtmp)) {
|
if (can_teleport(mtmp->data) && !tele_restrict(mtmp)) {
|
||||||
if (rloc(mtmp, TRUE))
|
if (rloc(mtmp, RLOC_MSG))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!resists_fire(mtmp)) {
|
if (!resists_fire(mtmp)) {
|
||||||
@@ -783,7 +783,7 @@ minliquid_core(struct monst* mtmp)
|
|||||||
if (!DEADMONSTER(mtmp)) {
|
if (!DEADMONSTER(mtmp)) {
|
||||||
(void) fire_damage_chain(mtmp->minvent, FALSE, FALSE,
|
(void) fire_damage_chain(mtmp->minvent, FALSE, FALSE,
|
||||||
mtmp->mx, mtmp->my);
|
mtmp->mx, mtmp->my);
|
||||||
(void) rloc(mtmp, FALSE);
|
(void) rloc(mtmp, RLOC_ERR|RLOC_NOMSG);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@@ -798,7 +798,7 @@ minliquid_core(struct monst* mtmp)
|
|||||||
/* like hero with teleport intrinsic or spell, teleport away
|
/* like hero with teleport intrinsic or spell, teleport away
|
||||||
if possible */
|
if possible */
|
||||||
if (can_teleport(mtmp->data) && !tele_restrict(mtmp)) {
|
if (can_teleport(mtmp->data) && !tele_restrict(mtmp)) {
|
||||||
if (rloc(mtmp, TRUE))
|
if (rloc(mtmp, RLOC_MSG))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (cansee(mtmp->mx, mtmp->my)) {
|
if (cansee(mtmp->mx, mtmp->my)) {
|
||||||
@@ -820,7 +820,7 @@ minliquid_core(struct monst* mtmp)
|
|||||||
xkilled(mtmp, XKILL_NOMSG);
|
xkilled(mtmp, XKILL_NOMSG);
|
||||||
if (!DEADMONSTER(mtmp)) {
|
if (!DEADMONSTER(mtmp)) {
|
||||||
water_damage_chain(mtmp->minvent, FALSE);
|
water_damage_chain(mtmp->minvent, FALSE);
|
||||||
if (!rloc(mtmp, TRUE))
|
if (!rloc(mtmp, RLOC_NOMSG))
|
||||||
deal_with_overcrowding(mtmp);
|
deal_with_overcrowding(mtmp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -3256,10 +3256,9 @@ elemental_clog(struct monst* mon)
|
|||||||
/* make monster mtmp next to you (if possible);
|
/* make monster mtmp next to you (if possible);
|
||||||
might place monst on far side of a wall or boulder */
|
might place monst on far side of a wall or boulder */
|
||||||
void
|
void
|
||||||
mnexto(struct monst* mtmp)
|
mnexto(struct monst* mtmp, unsigned int rlocflags)
|
||||||
{
|
{
|
||||||
coord mm;
|
coord mm;
|
||||||
boolean couldspot = canspotmon(mtmp);
|
|
||||||
|
|
||||||
if (mtmp == u.usteed) {
|
if (mtmp == u.usteed) {
|
||||||
/* Keep your steed in sync with you instead */
|
/* Keep your steed in sync with you instead */
|
||||||
@@ -3272,13 +3271,7 @@ mnexto(struct monst* mtmp)
|
|||||||
deal_with_overcrowding(mtmp);
|
deal_with_overcrowding(mtmp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rloc_to(mtmp, mm.x, mm.y);
|
rloc_to_flag(mtmp, mm.x, mm.y, rlocflags);
|
||||||
if (!g.in_mklev && (mtmp->mstrategy & STRAT_APPEARMSG)) {
|
|
||||||
mtmp->mstrategy &= ~STRAT_APPEARMSG; /* one chance only */
|
|
||||||
if (!couldspot && canspotmon(mtmp))
|
|
||||||
pline("%s suddenly %s!", Amonnam(mtmp),
|
|
||||||
!Blind ? "appears" : "arrives");
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3331,7 +3324,8 @@ mnearto(
|
|||||||
register struct monst *mtmp,
|
register struct monst *mtmp,
|
||||||
xchar x,
|
xchar x,
|
||||||
xchar y,
|
xchar y,
|
||||||
boolean move_other) /* make sure mtmp gets to x, y! so move m_at(x, y) */
|
boolean move_other, /* make sure mtmp gets to x, y! so move m_at(x, y) */
|
||||||
|
unsigned int rlocflags)
|
||||||
{
|
{
|
||||||
struct monst *othermon = (struct monst *) 0;
|
struct monst *othermon = (struct monst *) 0;
|
||||||
xchar newx, newy;
|
xchar newx, newy;
|
||||||
@@ -3371,11 +3365,11 @@ mnearto(
|
|||||||
newx = mm.x;
|
newx = mm.x;
|
||||||
newy = mm.y;
|
newy = mm.y;
|
||||||
}
|
}
|
||||||
rloc_to(mtmp, newx, newy);
|
rloc_to_flag(mtmp, newx, newy, rlocflags);
|
||||||
|
|
||||||
if (move_other && othermon) {
|
if (move_other && othermon) {
|
||||||
res = 2; /* moving another monster out of the way */
|
res = 2; /* moving another monster out of the way */
|
||||||
if (!mnearto(othermon, x, y, FALSE)) /* no 'move_other' this time */
|
if (!mnearto(othermon, x, y, FALSE, rlocflags)) /* no 'move_other' this time */
|
||||||
deal_with_overcrowding(othermon);
|
deal_with_overcrowding(othermon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -481,7 +481,7 @@ dochug(register struct monst* mtmp)
|
|||||||
/* some monsters teleport */
|
/* some monsters teleport */
|
||||||
if (mtmp->mflee && !rn2(40) && can_teleport(mdat) && !mtmp->iswiz
|
if (mtmp->mflee && !rn2(40) && can_teleport(mdat) && !mtmp->iswiz
|
||||||
&& !noteleport_level(mtmp)) {
|
&& !noteleport_level(mtmp)) {
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (mdat->msound == MS_SHRIEK && !um_dist(mtmp->mx, mtmp->my, 1))
|
if (mdat->msound == MS_SHRIEK && !um_dist(mtmp->mx, mtmp->my, 1))
|
||||||
@@ -538,7 +538,7 @@ dochug(register struct monst* mtmp)
|
|||||||
if (is_demon(g.youmonst.data)) {
|
if (is_demon(g.youmonst.data)) {
|
||||||
/* "Good hunting, brother" */
|
/* "Good hunting, brother" */
|
||||||
if (!tele_restrict(mtmp))
|
if (!tele_restrict(mtmp))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
} else {
|
} else {
|
||||||
mtmp->minvis = mtmp->perminvis = 0;
|
mtmp->minvis = mtmp->perminvis = 0;
|
||||||
/* Why? For the same reason in real demon talk */
|
/* Why? For the same reason in real demon talk */
|
||||||
@@ -1077,9 +1077,9 @@ m_move(register struct monst* mtmp, register int after)
|
|||||||
if (ptr == &mons[PM_TENGU] && !rn2(5) && !mtmp->mcan
|
if (ptr == &mons[PM_TENGU] && !rn2(5) && !mtmp->mcan
|
||||||
&& !tele_restrict(mtmp)) {
|
&& !tele_restrict(mtmp)) {
|
||||||
if (mtmp->mhp < 7 || mtmp->mpeaceful || rn2(2))
|
if (mtmp->mhp < 7 || mtmp->mpeaceful || rn2(2))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
else
|
else
|
||||||
mnexto(mtmp);
|
mnexto(mtmp, RLOC_MSG);
|
||||||
mmoved = 1;
|
mmoved = 1;
|
||||||
goto postmov;
|
goto postmov;
|
||||||
}
|
}
|
||||||
@@ -1402,7 +1402,7 @@ m_move(register struct monst* mtmp, register int after)
|
|||||||
mtmp->mtrack[0].y = omy;
|
mtmp->mtrack[0].y = omy;
|
||||||
} else {
|
} else {
|
||||||
if (is_unicorn(ptr) && rn2(2) && !tele_restrict(mtmp)) {
|
if (is_unicorn(ptr) && rn2(2) && !tele_restrict(mtmp)) {
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* for a long worm, shrink it (by discarding end of tail) when
|
/* for a long worm, shrink it (by discarding end of tail) when
|
||||||
|
|||||||
+1
-1
@@ -123,7 +123,7 @@ mk_mplayer(struct permonst *ptr, xchar x, xchar y, boolean special)
|
|||||||
return ((struct monst *) 0);
|
return ((struct monst *) 0);
|
||||||
|
|
||||||
if (MON_AT(x, y))
|
if (MON_AT(x, y))
|
||||||
(void) rloc(m_at(x, y), FALSE); /* insurance */
|
(void) rloc(m_at(x, y), RLOC_ERR|RLOC_NOMSG); /* insurance */
|
||||||
|
|
||||||
if (!In_endgame(&u.uz))
|
if (!In_endgame(&u.uz))
|
||||||
special = FALSE;
|
special = FALSE;
|
||||||
|
|||||||
+2
-2
@@ -720,7 +720,7 @@ use_defensive(struct monst* mtmp)
|
|||||||
}
|
}
|
||||||
if (oseen && how)
|
if (oseen && how)
|
||||||
makeknown(how);
|
makeknown(how);
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
return 2;
|
return 2;
|
||||||
case MUSE_WAN_TELEPORTATION:
|
case MUSE_WAN_TELEPORTATION:
|
||||||
g.zap_oseen = oseen;
|
g.zap_oseen = oseen;
|
||||||
@@ -1395,7 +1395,7 @@ mbhitm(register struct monst* mtmp, register struct obj* otmp)
|
|||||||
if (cansee(mtmp->mx, mtmp->my))
|
if (cansee(mtmp->mx, mtmp->my))
|
||||||
pline("%s resists the magic!", Monnam(mtmp));
|
pline("%s resists the magic!", Monnam(mtmp));
|
||||||
} else if (!tele_restrict(mtmp))
|
} else if (!tele_restrict(mtmp))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+2
-2
@@ -232,7 +232,7 @@ priestini(d_level *lvl, struct mkroom *sroom, int sx, int sy,
|
|||||||
px = sx, py = sy;
|
px = sx, py = sy;
|
||||||
|
|
||||||
if (MON_AT(px, py))
|
if (MON_AT(px, py))
|
||||||
(void) rloc(m_at(px, py), FALSE); /* insurance */
|
(void) rloc(m_at(px, py), RLOC_NOMSG); /* insurance */
|
||||||
|
|
||||||
priest = makemon(prim, px, py, MM_EPRI);
|
priest = makemon(prim, px, py, MM_EPRI);
|
||||||
if (priest) {
|
if (priest) {
|
||||||
@@ -672,7 +672,7 @@ mk_roamer(struct permonst *ptr, aligntyp alignment, xchar x, xchar y,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (MON_AT(x, y))
|
if (MON_AT(x, y))
|
||||||
(void) rloc(m_at(x, y), FALSE); /* insurance */
|
(void) rloc(m_at(x, y), RLOC_NOMSG); /* insurance */
|
||||||
|
|
||||||
if (!(roamer = makemon(ptr, x, y, MM_ADJACENTOK | MM_EMIN)))
|
if (!(roamer = makemon(ptr, x, y, MM_ADJACENTOK | MM_EMIN)))
|
||||||
return (struct monst *) 0;
|
return (struct monst *) 0;
|
||||||
|
|||||||
@@ -1046,7 +1046,7 @@ home_shk(register struct monst* shkp, register boolean killkops)
|
|||||||
{
|
{
|
||||||
register xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y;
|
register xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y;
|
||||||
|
|
||||||
(void) mnearto(shkp, x, y, TRUE);
|
(void) mnearto(shkp, x, y, TRUE, RLOC_MSG);
|
||||||
g.level.flags.has_shop = 1;
|
g.level.flags.has_shop = 1;
|
||||||
if (killkops) {
|
if (killkops) {
|
||||||
kops_gone(TRUE);
|
kops_gone(TRUE);
|
||||||
@@ -3440,7 +3440,8 @@ shkcatch(register struct obj* obj, register xchar x, register xchar y)
|
|||||||
&& dist2(shkp->mx, shkp->my, x, y) < 3
|
&& dist2(shkp->mx, shkp->my, x, y) < 3
|
||||||
/* if it is the shk's pos, you hit and anger him */
|
/* if it is the shk's pos, you hit and anger him */
|
||||||
&& (shkp->mx != x || shkp->my != y)) {
|
&& (shkp->mx != x || shkp->my != y)) {
|
||||||
if (mnearto(shkp, x, y, TRUE) == 2 && !Deaf && !muteshk(shkp))
|
if (mnearto(shkp, x, y, TRUE, RLOC_NOMSG) == 2
|
||||||
|
&& !Deaf && !muteshk(shkp))
|
||||||
verbalize("Out of my way, scum!");
|
verbalize("Out of my way, scum!");
|
||||||
if (cansee(x, y)) {
|
if (cansee(x, y)) {
|
||||||
pline("%s nimbly%s catches %s.", Shknam(shkp),
|
pline("%s nimbly%s catches %s.", Shknam(shkp),
|
||||||
@@ -4053,7 +4054,7 @@ shopdig(register int fall)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (distu(shkp->mx, shkp->my) > 2) {
|
if (distu(shkp->mx, shkp->my) > 2) {
|
||||||
mnexto(shkp);
|
mnexto(shkp, RLOC_MSG);
|
||||||
/* for some reason the shopkeeper can't come next to you */
|
/* for some reason the shopkeeper can't come next to you */
|
||||||
if (distu(shkp->mx, shkp->my) > 2) {
|
if (distu(shkp->mx, shkp->my) > 2) {
|
||||||
if (lang == 2)
|
if (lang == 2)
|
||||||
@@ -4197,7 +4198,7 @@ pay_for_damage(const char* dmgstr, boolean cant_mollify)
|
|||||||
if (um_dist(shkp->mx, shkp->my, 1)
|
if (um_dist(shkp->mx, shkp->my, 1)
|
||||||
&& !um_dist(shkp->mx, shkp->my, 3)) {
|
&& !um_dist(shkp->mx, shkp->my, 3)) {
|
||||||
pline("%s leaps towards you!", Shknam(shkp));
|
pline("%s leaps towards you!", Shknam(shkp));
|
||||||
mnexto(shkp);
|
mnexto(shkp, RLOC_NOMSG);
|
||||||
}
|
}
|
||||||
pursue = um_dist(shkp->mx, shkp->my, 1);
|
pursue = um_dist(shkp->mx, shkp->my, 1);
|
||||||
if (pursue)
|
if (pursue)
|
||||||
@@ -4226,7 +4227,7 @@ pay_for_damage(const char* dmgstr, boolean cant_mollify)
|
|||||||
growl(shkp);
|
growl(shkp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(void) mnearto(shkp, x, y, TRUE);
|
(void) mnearto(shkp, x, y, TRUE, RLOC_MSG);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((um_dist(x, y, 1) && !uinshp) || cant_mollify
|
if ((um_dist(x, y, 1) && !uinshp) || cant_mollify
|
||||||
|
|||||||
+1
-1
@@ -632,7 +632,7 @@ shkinit(const struct shclass* shp, struct mkroom* sroom)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (MON_AT(sx, sy))
|
if (MON_AT(sx, sy))
|
||||||
(void) rloc(m_at(sx, sy), FALSE); /* insurance */
|
(void) rloc(m_at(sx, sy), RLOC_NOMSG); /* insurance */
|
||||||
|
|
||||||
/* now initialize the shopkeeper monster structure */
|
/* now initialize the shopkeeper monster structure */
|
||||||
if (!(shk = makemon(&mons[PM_SHOPKEEPER], sx, sy, MM_ESHK)))
|
if (!(shk = makemon(&mons[PM_SHOPKEEPER], sx, sy, MM_ESHK)))
|
||||||
|
|||||||
+4
-4
@@ -107,7 +107,7 @@ stealgold(register struct monst* mtmp)
|
|||||||
(Levitation || Flying) ? "beneath" : "between", whose, what);
|
(Levitation || Flying) ? "beneath" : "between", whose, what);
|
||||||
if (!ygold || !rn2(5)) {
|
if (!ygold || !rn2(5)) {
|
||||||
if (!tele_restrict(mtmp))
|
if (!tele_restrict(mtmp))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
monflee(mtmp, 0, FALSE, FALSE);
|
monflee(mtmp, 0, FALSE, FALSE);
|
||||||
}
|
}
|
||||||
} else if (ygold) {
|
} else if (ygold) {
|
||||||
@@ -123,7 +123,7 @@ stealgold(register struct monst* mtmp)
|
|||||||
add_to_minv(mtmp, ygold);
|
add_to_minv(mtmp, ygold);
|
||||||
Your("purse feels lighter.");
|
Your("purse feels lighter.");
|
||||||
if (!tele_restrict(mtmp))
|
if (!tele_restrict(mtmp))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
monflee(mtmp, 0, FALSE, FALSE);
|
monflee(mtmp, 0, FALSE, FALSE);
|
||||||
g.context.botl = 1;
|
g.context.botl = 1;
|
||||||
}
|
}
|
||||||
@@ -186,7 +186,7 @@ stealarm(void)
|
|||||||
so we don't set mavenge bit here. */
|
so we don't set mavenge bit here. */
|
||||||
monflee(mtmp, 0, FALSE, FALSE);
|
monflee(mtmp, 0, FALSE, FALSE);
|
||||||
if (!tele_restrict(mtmp))
|
if (!tele_restrict(mtmp))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -622,7 +622,7 @@ stealamulet(struct monst* mtmp)
|
|||||||
(void) mpickobj(mtmp, otmp); /* could merge and free otmp but won't */
|
(void) mpickobj(mtmp, otmp); /* could merge and free otmp but won't */
|
||||||
pline("%s steals %s!", Monnam(mtmp), buf);
|
pline("%s steals %s!", Monnam(mtmp), buf);
|
||||||
if (can_teleport(mtmp->data) && !tele_restrict(mtmp))
|
if (can_teleport(mtmp->data) && !tele_restrict(mtmp))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -602,7 +602,7 @@ dismount_steed(
|
|||||||
if (enexto(&cc, u.ux, u.uy, mtmp->data))
|
if (enexto(&cc, u.ux, u.uy, mtmp->data))
|
||||||
rloc_to(mtmp, cc.x, cc.y);
|
rloc_to(mtmp, cc.x, cc.y);
|
||||||
else /* evidently no room nearby; move steed elsewhere */
|
else /* evidently no room nearby; move steed elsewhere */
|
||||||
(void) rloc(mtmp, FALSE);
|
(void) rloc(mtmp, RLOC_ERR|RLOC_NOMSG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+56
-9
@@ -9,6 +9,7 @@ static boolean tele_jump_ok(int, int, int, int);
|
|||||||
static boolean teleok(int, int, boolean);
|
static boolean teleok(int, int, boolean);
|
||||||
static void vault_tele(void);
|
static void vault_tele(void);
|
||||||
static boolean rloc_pos_ok(int, int, struct monst *);
|
static boolean rloc_pos_ok(int, int, struct monst *);
|
||||||
|
static void rloc_to_core(struct monst *, int, int, unsigned);
|
||||||
static void mvault_tele(struct monst *);
|
static void mvault_tele(struct monst *);
|
||||||
|
|
||||||
/* teleporting is prevented on this level for this monster? */
|
/* teleporting is prevented on this level for this monster? */
|
||||||
@@ -1201,16 +1202,31 @@ rloc_pos_ok(
|
|||||||
* a value because mtmp is a migrating_mon. Worm tails are always
|
* a value because mtmp is a migrating_mon. Worm tails are always
|
||||||
* placed randomly around the head of the worm.
|
* placed randomly around the head of the worm.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
rloc_to(struct monst* mtmp, register int x, register int y)
|
rloc_to_core(struct monst* mtmp,
|
||||||
|
int x, int y,
|
||||||
|
unsigned int rlocflags)
|
||||||
{
|
{
|
||||||
register int oldx = mtmp->mx, oldy = mtmp->my;
|
register int oldx = mtmp->mx, oldy = mtmp->my;
|
||||||
boolean resident_shk = mtmp->isshk && inhishop(mtmp);
|
boolean resident_shk = mtmp->isshk && inhishop(mtmp);
|
||||||
|
boolean preventmsg = (rlocflags & RLOC_NOMSG) != 0;
|
||||||
|
boolean vanishmsg = (rlocflags & RLOC_MSG) != 0;
|
||||||
|
boolean appearmsg = (mtmp->mstrategy & STRAT_APPEARMSG) != 0;
|
||||||
|
boolean domsg = !g.in_mklev && (vanishmsg || appearmsg) && !preventmsg;
|
||||||
|
boolean telemsg = FALSE;
|
||||||
|
|
||||||
if (x == mtmp->mx && y == mtmp->my && m_at(x, y) == mtmp)
|
if (x == mtmp->mx && y == mtmp->my && m_at(x, y) == mtmp)
|
||||||
return; /* that was easy */
|
return; /* that was easy */
|
||||||
|
|
||||||
if (oldx) { /* "pick up" monster */
|
if (oldx) { /* "pick up" monster */
|
||||||
|
if (domsg && canspotmon(mtmp)) {
|
||||||
|
if (couldsee(x, y) || sensemon(mtmp)) {
|
||||||
|
telemsg = TRUE;
|
||||||
|
} else {
|
||||||
|
pline("%s vanishes!", Monnam(mtmp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mtmp->wormno) {
|
if (mtmp->wormno) {
|
||||||
remove_worm(mtmp);
|
remove_worm(mtmp);
|
||||||
} else {
|
} else {
|
||||||
@@ -1238,6 +1254,24 @@ rloc_to(struct monst* mtmp, register int x, register int y)
|
|||||||
maybe_unhide_at(x, y);
|
maybe_unhide_at(x, y);
|
||||||
newsym(x, y); /* update new location */
|
newsym(x, y); /* update new location */
|
||||||
set_apparxy(mtmp); /* orient monster */
|
set_apparxy(mtmp); /* orient monster */
|
||||||
|
if (domsg && (canspotmon(mtmp) || appearmsg)) {
|
||||||
|
mtmp->mstrategy &= ~STRAT_APPEARMSG; /* one chance only */
|
||||||
|
if (telemsg && (couldsee(x, y) || sensemon(mtmp))) {
|
||||||
|
pline("%s vanishes and reappears%s.",
|
||||||
|
Monnam(mtmp),
|
||||||
|
distu(x, y) <= 2 ? " next to you"
|
||||||
|
: (distu(x, y) <= (BOLT_LIM * BOLT_LIM)) ? " close by"
|
||||||
|
: (distu(x, y) < distu(oldx, oldy)) ? " closer to you"
|
||||||
|
: " further away");
|
||||||
|
} else {
|
||||||
|
pline("%s %s%s%s!",
|
||||||
|
appearmsg ? Amonnam(mtmp) : Monnam(mtmp),
|
||||||
|
appearmsg ? "suddenly " : "",
|
||||||
|
!Blind ? "appears" : "arrives",
|
||||||
|
distu(x, y) <= 2 ? " next to you"
|
||||||
|
: (distu(x, y) <= (BOLT_LIM * BOLT_LIM)) ? " close by" : "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* shopkeepers will only teleport if you zap them with a wand of
|
/* shopkeepers will only teleport if you zap them with a wand of
|
||||||
teleportation or if they've been transformed into a jumpy monster;
|
teleportation or if they've been transformed into a jumpy monster;
|
||||||
@@ -1250,6 +1284,18 @@ rloc_to(struct monst* mtmp, register int x, register int y)
|
|||||||
(void) mintrap(mtmp);
|
(void) mintrap(mtmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
rloc_to(struct monst *mtmp, int x, int y)
|
||||||
|
{
|
||||||
|
rloc_to_core(mtmp, x, y, RLOC_NOMSG);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
rloc_to_flag(struct monst *mtmp, int x, int y, unsigned int rlocflags)
|
||||||
|
{
|
||||||
|
rloc_to_core(mtmp, x, y, rlocflags);
|
||||||
|
}
|
||||||
|
|
||||||
static stairway *
|
static stairway *
|
||||||
stairway_find_forwiz(boolean isladder, boolean up)
|
stairway_find_forwiz(boolean isladder, boolean up)
|
||||||
{
|
{
|
||||||
@@ -1263,10 +1309,11 @@ stairway_find_forwiz(boolean isladder, boolean up)
|
|||||||
|
|
||||||
/* place a monster at a random location, typically due to teleport */
|
/* place a monster at a random location, typically due to teleport */
|
||||||
/* return TRUE if successful, FALSE if not */
|
/* return TRUE if successful, FALSE if not */
|
||||||
|
/* rlocflags is RLOC_foo flags */
|
||||||
boolean
|
boolean
|
||||||
rloc(
|
rloc(
|
||||||
struct monst *mtmp, /* mx==0 implies migrating monster arrival */
|
struct monst *mtmp, /* mx==0 implies migrating monster arrival */
|
||||||
boolean suppress_impossible)
|
unsigned int rlocflags)
|
||||||
{
|
{
|
||||||
register int x, y, trycount;
|
register int x, y, trycount;
|
||||||
|
|
||||||
@@ -1312,12 +1359,12 @@ rloc(
|
|||||||
goto found_xy;
|
goto found_xy;
|
||||||
|
|
||||||
/* level either full of monsters or somehow faulty */
|
/* level either full of monsters or somehow faulty */
|
||||||
if (!suppress_impossible)
|
if ((rlocflags & RLOC_ERR) != 0)
|
||||||
impossible("rloc(): couldn't relocate monster");
|
impossible("rloc(): couldn't relocate monster");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
found_xy:
|
found_xy:
|
||||||
rloc_to(mtmp, x, y);
|
rloc_to_core(mtmp, x, y, rlocflags);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1331,7 +1378,7 @@ mvault_tele(struct monst* mtmp)
|
|||||||
rloc_to(mtmp, c.x, c.y);
|
rloc_to(mtmp, c.x, c.y);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
@@ -1364,7 +1411,7 @@ mtele_trap(struct monst* mtmp, struct trap* trap, int in_sight)
|
|||||||
if (trap->once)
|
if (trap->once)
|
||||||
mvault_tele(mtmp);
|
mvault_tele(mtmp);
|
||||||
else
|
else
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_NONE);
|
||||||
|
|
||||||
if (in_sight) {
|
if (in_sight) {
|
||||||
if (canseemon(mtmp))
|
if (canseemon(mtmp))
|
||||||
@@ -1611,12 +1658,12 @@ u_teleport_mon(struct monst* mtmp, boolean give_feedback)
|
|||||||
if (give_feedback)
|
if (give_feedback)
|
||||||
You("are no longer inside %s!", mon_nam(mtmp));
|
You("are no longer inside %s!", mon_nam(mtmp));
|
||||||
unstuck(mtmp);
|
unstuck(mtmp);
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
} else if (is_rider(mtmp->data) && rn2(13)
|
} else if (is_rider(mtmp->data) && rn2(13)
|
||||||
&& enexto(&cc, u.ux, u.uy, mtmp->data))
|
&& enexto(&cc, u.ux, u.uy, mtmp->data))
|
||||||
rloc_to(mtmp, cc.x, cc.y);
|
rloc_to(mtmp, cc.x, cc.y);
|
||||||
else
|
else
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-7
@@ -2318,7 +2318,8 @@ mhitm_ad_sgld(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
|||||||
if (!tele_restrict(magr)) {
|
if (!tele_restrict(magr)) {
|
||||||
boolean couldspot = canspotmon(magr);
|
boolean couldspot = canspotmon(magr);
|
||||||
|
|
||||||
(void) rloc(magr, TRUE);
|
(void) rloc(magr, RLOC_NOMSG);
|
||||||
|
/* TODO: use RLOC_MSG instead? */
|
||||||
if (g.vis && couldspot && !canspotmon(magr))
|
if (g.vis && couldspot && !canspotmon(magr))
|
||||||
pline("%s suddenly disappears!", buf);
|
pline("%s suddenly disappears!", buf);
|
||||||
}
|
}
|
||||||
@@ -2412,7 +2413,8 @@ mhitm_ad_tlpt(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
|||||||
if (g.vis && wasseen)
|
if (g.vis && wasseen)
|
||||||
Strcpy(mdef_Monnam, Monnam(mdef));
|
Strcpy(mdef_Monnam, Monnam(mdef));
|
||||||
mdef->mstrategy &= ~STRAT_WAITFORU;
|
mdef->mstrategy &= ~STRAT_WAITFORU;
|
||||||
(void) rloc(mdef, TRUE);
|
(void) rloc(mdef, RLOC_NOMSG);
|
||||||
|
/* TODO: use RLOC_MSG instead? */
|
||||||
if (g.vis && wasseen && !canspotmon(mdef) && mdef != u.usteed)
|
if (g.vis && wasseen && !canspotmon(mdef) && mdef != u.usteed)
|
||||||
pline("%s suddenly disappears!", mdef_Monnam);
|
pline("%s suddenly disappears!", mdef_Monnam);
|
||||||
if (mhm->damage >= mdef->mhp) { /* see hitmu(mhitu.c) */
|
if (mhm->damage >= mdef->mhp) { /* see hitmu(mhitu.c) */
|
||||||
@@ -3687,7 +3689,7 @@ mhitm_ad_heal(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
|||||||
return;
|
return;
|
||||||
} else if (!rn2(33)) {
|
} else if (!rn2(33)) {
|
||||||
if (!tele_restrict(magr))
|
if (!tele_restrict(magr))
|
||||||
(void) rloc(magr, TRUE);
|
(void) rloc(magr, RLOC_MSG);
|
||||||
monflee(magr, d(3, 6), TRUE, FALSE);
|
monflee(magr, d(3, 6), TRUE, FALSE);
|
||||||
mhm->done = TRUE;
|
mhm->done = TRUE;
|
||||||
mhm->hitflags = MM_HIT | MM_DEF_DIED; /* return 3??? */
|
mhm->hitflags = MM_HIT | MM_DEF_DIED; /* return 3??? */
|
||||||
@@ -3966,7 +3968,7 @@ mhitm_ad_sedu(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
|||||||
? "brags about the goods some dungeon explorer provided"
|
? "brags about the goods some dungeon explorer provided"
|
||||||
: "makes some remarks about how difficult theft is lately");
|
: "makes some remarks about how difficult theft is lately");
|
||||||
if (!tele_restrict(magr))
|
if (!tele_restrict(magr))
|
||||||
(void) rloc(magr, TRUE);
|
(void) rloc(magr, RLOC_MSG);
|
||||||
mhm->hitflags = MM_AGR_DONE; /* return 3??? */
|
mhm->hitflags = MM_AGR_DONE; /* return 3??? */
|
||||||
mhm->done = TRUE;
|
mhm->done = TRUE;
|
||||||
return;
|
return;
|
||||||
@@ -3978,7 +3980,7 @@ mhitm_ad_sedu(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
|||||||
flags.female ? "unaffected" : "uninterested");
|
flags.female ? "unaffected" : "uninterested");
|
||||||
if (rn2(3)) {
|
if (rn2(3)) {
|
||||||
if (!tele_restrict(magr))
|
if (!tele_restrict(magr))
|
||||||
(void) rloc(magr, TRUE);
|
(void) rloc(magr, RLOC_MSG);
|
||||||
mhm->hitflags = MM_AGR_DONE; /* return 3??? */
|
mhm->hitflags = MM_AGR_DONE; /* return 3??? */
|
||||||
mhm->done = TRUE;
|
mhm->done = TRUE;
|
||||||
return;
|
return;
|
||||||
@@ -3995,7 +3997,7 @@ mhitm_ad_sedu(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
|||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
if (!is_animal(magr->data) && !tele_restrict(magr))
|
if (!is_animal(magr->data) && !tele_restrict(magr))
|
||||||
(void) rloc(magr, TRUE);
|
(void) rloc(magr, RLOC_MSG);
|
||||||
if (is_animal(magr->data) && *buf) {
|
if (is_animal(magr->data) && *buf) {
|
||||||
if (canseemon(magr))
|
if (canseemon(magr))
|
||||||
pline("%s tries to %s away with %s.", Monnam(magr),
|
pline("%s tries to %s away with %s.", Monnam(magr),
|
||||||
@@ -4050,7 +4052,8 @@ mhitm_ad_sedu(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
|||||||
if (pa->mlet == S_NYMPH && !tele_restrict(magr)) {
|
if (pa->mlet == S_NYMPH && !tele_restrict(magr)) {
|
||||||
boolean couldspot = canspotmon(magr);
|
boolean couldspot = canspotmon(magr);
|
||||||
|
|
||||||
(void) rloc(magr, TRUE);
|
(void) rloc(magr, RLOC_NOMSG);
|
||||||
|
/* TODO: use RLOC_MSG instead? */
|
||||||
if (g.vis && couldspot && !canspotmon(magr))
|
if (g.vis && couldspot && !canspotmon(magr))
|
||||||
pline("%s suddenly disappears!", buf);
|
pline("%s suddenly disappears!", buf);
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -75,7 +75,7 @@ clear_fcorr(struct monst *grd, boolean forceshow)
|
|||||||
} else {
|
} else {
|
||||||
if (mtmp->mtame)
|
if (mtmp->mtame)
|
||||||
yelp(mtmp);
|
yelp(mtmp);
|
||||||
if (!rloc(mtmp, TRUE))
|
if (!rloc(mtmp, RLOC_MSG))
|
||||||
m_into_limbo(mtmp);
|
m_into_limbo(mtmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -607,7 +607,7 @@ wallify_vault(struct monst *grd)
|
|||||||
if ((mon = m_at(x, y)) != 0 && mon != grd) {
|
if ((mon = m_at(x, y)) != 0 && mon != grd) {
|
||||||
if (mon->mtame)
|
if (mon->mtame)
|
||||||
yelp(mon);
|
yelp(mon);
|
||||||
(void) rloc(mon, FALSE);
|
(void) rloc(mon, RLOC_ERR);
|
||||||
}
|
}
|
||||||
/* move gold at wall locations into the vault */
|
/* move gold at wall locations into the vault */
|
||||||
if ((gold = g_at(x, y)) != 0) {
|
if ((gold = g_at(x, y)) != 0) {
|
||||||
@@ -672,7 +672,7 @@ gd_mv_monaway(struct monst *grd, int nx, int ny)
|
|||||||
if (MON_AT(nx, ny) && !(nx == grd->mx && ny == grd->my)) {
|
if (MON_AT(nx, ny) && !(nx == grd->mx && ny == grd->my)) {
|
||||||
if (!Deaf)
|
if (!Deaf)
|
||||||
verbalize("Out of my way, scum!");
|
verbalize("Out of my way, scum!");
|
||||||
if (!rloc(m_at(nx, ny), FALSE) || MON_AT(nx, ny))
|
if (!rloc(m_at(nx, ny), RLOC_ERR|RLOC_MSG) || MON_AT(nx, ny))
|
||||||
m_into_limbo(m_at(nx, ny));
|
m_into_limbo(m_at(nx, ny));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -796,7 +796,7 @@ gd_move(struct monst *grd)
|
|||||||
if (!u_in_vault
|
if (!u_in_vault
|
||||||
&& (grd_in_vault || (in_fcorridor(grd, grd->mx, grd->my)
|
&& (grd_in_vault || (in_fcorridor(grd, grd->mx, grd->my)
|
||||||
&& !in_fcorridor(grd, u.ux, u.uy)))) {
|
&& !in_fcorridor(grd, u.ux, u.uy)))) {
|
||||||
(void) rloc(grd, TRUE);
|
(void) rloc(grd, RLOC_MSG);
|
||||||
wallify_vault(grd);
|
wallify_vault(grd);
|
||||||
if (!in_fcorridor(grd, grd->mx, grd->my))
|
if (!in_fcorridor(grd, grd->mx, grd->my))
|
||||||
(void) clear_fcorr(grd, TRUE);
|
(void) clear_fcorr(grd, TRUE);
|
||||||
@@ -833,7 +833,7 @@ gd_move(struct monst *grd)
|
|||||||
n = grd->my;
|
n = grd->my;
|
||||||
if (!Deaf)
|
if (!Deaf)
|
||||||
verbalize("You've been warned, knave!");
|
verbalize("You've been warned, knave!");
|
||||||
mnexto(grd);
|
mnexto(grd, RLOC_NOMSG);
|
||||||
levl[m][n].typ = egrd->fakecorr[0].ftyp;
|
levl[m][n].typ = egrd->fakecorr[0].ftyp;
|
||||||
levl[m][n].flags = egrd->fakecorr[0].flags;
|
levl[m][n].flags = egrd->fakecorr[0].flags;
|
||||||
newsym(m, n);
|
newsym(m, n);
|
||||||
@@ -850,7 +850,7 @@ gd_move(struct monst *grd)
|
|||||||
if (u_carry_gold) { /* player teleported */
|
if (u_carry_gold) { /* player teleported */
|
||||||
m = grd->mx;
|
m = grd->mx;
|
||||||
n = grd->my;
|
n = grd->my;
|
||||||
(void) rloc(grd, TRUE);
|
(void) rloc(grd, RLOC_MSG);
|
||||||
levl[m][n].typ = egrd->fakecorr[0].ftyp;
|
levl[m][n].typ = egrd->fakecorr[0].ftyp;
|
||||||
levl[m][n].flags = egrd->fakecorr[0].flags;
|
levl[m][n].flags = egrd->fakecorr[0].flags;
|
||||||
newsym(m, n);
|
newsym(m, n);
|
||||||
@@ -1111,7 +1111,7 @@ paygd(boolean silently)
|
|||||||
if (grd->mpeaceful) /* peaceful guard has no "right" to your gold */
|
if (grd->mpeaceful) /* peaceful guard has no "right" to your gold */
|
||||||
goto remove_guard;
|
goto remove_guard;
|
||||||
|
|
||||||
mnexto(grd);
|
mnexto(grd, RLOC_NOMSG);
|
||||||
if (!silently)
|
if (!silently)
|
||||||
pline("%s remits your gold to the vault.", Monnam(grd));
|
pline("%s remits your gold to the vault.", Monnam(grd));
|
||||||
gx = g.rooms[EGD(grd)->vroom].lx + rn2(2);
|
gx = g.rooms[EGD(grd)->vroom].lx + rn2(2);
|
||||||
|
|||||||
+6
-6
@@ -361,9 +361,9 @@ tactics(struct monst *mtmp)
|
|||||||
if (In_W_tower(mx, my, &u.uz)
|
if (In_W_tower(mx, my, &u.uz)
|
||||||
|| (mtmp->iswiz && !sx && !mon_has_amulet(mtmp))) {
|
|| (mtmp->iswiz && !sx && !mon_has_amulet(mtmp))) {
|
||||||
if (!rn2(3 + mtmp->mhp / 10))
|
if (!rn2(3 + mtmp->mhp / 10))
|
||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, RLOC_MSG);
|
||||||
} else if (sx && (mx != sx || my != sy)) {
|
} else if (sx && (mx != sx || my != sy)) {
|
||||||
if (!mnearto(mtmp, sx, sy, TRUE)) {
|
if (!mnearto(mtmp, sx, sy, TRUE, RLOC_MSG)) {
|
||||||
/* couldn't move to the target spot for some reason,
|
/* couldn't move to the target spot for some reason,
|
||||||
so stay where we are (don't actually need rloc_to()
|
so stay where we are (don't actually need rloc_to()
|
||||||
because mtmp is still on the map at <mx,my>... */
|
because mtmp is still on the map at <mx,my>... */
|
||||||
@@ -382,7 +382,7 @@ tactics(struct monst *mtmp)
|
|||||||
|
|
||||||
case STRAT_NONE: /* harass */
|
case STRAT_NONE: /* harass */
|
||||||
if (!rn2(!mtmp->mflee ? 5 : 33))
|
if (!rn2(!mtmp->mflee ? 5 : 33))
|
||||||
mnexto(mtmp);
|
mnexto(mtmp, RLOC_MSG);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
default: /* kill, maim, pillage! */
|
default: /* kill, maim, pillage! */
|
||||||
@@ -397,7 +397,7 @@ tactics(struct monst *mtmp)
|
|||||||
}
|
}
|
||||||
if ((u.ux == tx && u.uy == ty) || where == STRAT_PLAYER) {
|
if ((u.ux == tx && u.uy == ty) || where == STRAT_PLAYER) {
|
||||||
/* player is standing on it (or has it) */
|
/* player is standing on it (or has it) */
|
||||||
mnexto(mtmp);
|
mnexto(mtmp, RLOC_MSG);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (where == STRAT_GROUND) {
|
if (where == STRAT_GROUND) {
|
||||||
@@ -419,12 +419,12 @@ tactics(struct monst *mtmp)
|
|||||||
} else {
|
} else {
|
||||||
/* a monster is standing on it - cause some trouble */
|
/* a monster is standing on it - cause some trouble */
|
||||||
if (!rn2(5))
|
if (!rn2(5))
|
||||||
mnexto(mtmp);
|
mnexto(mtmp, RLOC_MSG);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else { /* a monster has it - 'port beside it. */
|
} else { /* a monster has it - 'port beside it. */
|
||||||
mx = mtmp->mx, my = mtmp->my;
|
mx = mtmp->mx, my = mtmp->my;
|
||||||
if (!mnearto(mtmp, tx, ty, FALSE))
|
if (!mnearto(mtmp, tx, ty, FALSE, RLOC_MSG))
|
||||||
rloc_to(mtmp, mx, my); /* no room? stay put */
|
rloc_to(mtmp, mx, my); /* no room? stay put */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user