Define engulfing_u, making clearer code

This commit is contained in:
Pasi Kallinen
2021-12-31 21:12:21 +02:00
parent 776064933a
commit 8db18275a6
16 changed files with 37 additions and 36 deletions
+2
View File
@@ -233,6 +233,8 @@ struct monst {
#define troll_baned(m,o) \ #define troll_baned(m,o) \
((m)->data->mlet == S_TROLL && (o) && (o)->oartifact == ART_TROLLSBANE) ((m)->data->mlet == S_TROLL && (o) && (o)->oartifact == ART_TROLLSBANE)
#define engulfing_u(mon) (u.uswallow && (u.ustuck == (mon)))
/* Get the maximum difficulty monsters that can currently be generated, /* Get the maximum difficulty monsters that can currently be generated,
given the current level difficulty and the hero's level. */ given the current level difficulty and the hero's level. */
#define monmax_difficulty(levdif) (((levdif) + u.ulevel) / 2) #define monmax_difficulty(levdif) (((levdif) + u.ulevel) / 2)
+3 -3
View File
@@ -1147,7 +1147,7 @@ artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp,
boolean youdefend = (mdef == &g.youmonst); boolean youdefend = (mdef == &g.youmonst);
boolean vis = (!youattack && magr && cansee(magr->mx, magr->my)) boolean vis = (!youattack && magr && cansee(magr->mx, magr->my))
|| (!youdefend && cansee(mdef->mx, mdef->my)) || (!youdefend && cansee(mdef->mx, mdef->my))
|| (youattack && u.uswallow && mdef == u.ustuck && !Blind); || (youattack && engulfing_u(mdef) && !Blind);
boolean realizes_damage; boolean realizes_damage;
const char *wepdesc; const char *wepdesc;
static const char you[] = "you"; static const char you[] = "you";
@@ -1241,7 +1241,7 @@ artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp,
if (otmp->oartifact == ART_TSURUGI_OF_MURAMASA && dieroll == 1) { if (otmp->oartifact == ART_TSURUGI_OF_MURAMASA && dieroll == 1) {
wepdesc = "The razor-sharp blade"; wepdesc = "The razor-sharp blade";
/* not really beheading, but so close, why add another SPFX */ /* not really beheading, but so close, why add another SPFX */
if (youattack && u.uswallow && mdef == u.ustuck) { if (youattack && engulfing_u(mdef)) {
You("slice %s wide open!", mon_nam(mdef)); You("slice %s wide open!", mon_nam(mdef));
*dmgptr = 2 * mdef->mhp + FATAL_DAMAGE_MODIFIER; *dmgptr = 2 * mdef->mhp + FATAL_DAMAGE_MODIFIER;
return TRUE; return TRUE;
@@ -1287,7 +1287,7 @@ artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp,
static const char *const behead_msg[2] = { "%s beheads %s!", static const char *const behead_msg[2] = { "%s beheads %s!",
"%s decapitates %s!" }; "%s decapitates %s!" };
if (youattack && u.uswallow && mdef == u.ustuck) if (youattack && engulfing_u(mdef))
return FALSE; return FALSE;
wepdesc = artilist[ART_VORPAL_BLADE].name; wepdesc = artilist[ART_VORPAL_BLADE].name;
if (!youdefend) { if (!youdefend) {
+1 -1
View File
@@ -1734,7 +1734,7 @@ x_monnam(
do_invis = mtmp->minvis && !(suppress & SUPPRESS_INVISIBLE); do_invis = mtmp->minvis && !(suppress & SUPPRESS_INVISIBLE);
do_it = !canspotmon(mtmp) && article != ARTICLE_YOUR do_it = !canspotmon(mtmp) && article != ARTICLE_YOUR
&& !g.program_state.gameover && mtmp != u.usteed && !g.program_state.gameover && mtmp != u.usteed
&& !(u.uswallow && mtmp == u.ustuck) && !(suppress & SUPPRESS_IT); && !engulfing_u(mtmp) && !(suppress & SUPPRESS_IT);
do_saddle = !(suppress & SUPPRESS_SADDLE); do_saddle = !(suppress & SUPPRESS_SADDLE);
do_name = !(suppress & SUPPRESS_NAME) || type_is_pname(mdat); do_name = !(suppress & SUPPRESS_NAME) || type_is_pname(mdat);
augment_it = (suppress & AUGMENT_IT) != 0; augment_it = (suppress & AUGMENT_IT) != 0;
+1 -1
View File
@@ -924,7 +924,7 @@ dokick(void)
to an unseen square doesn't leave an I behind */ to an unseen square doesn't leave an I behind */
&& mtmp->mx == x && mtmp->my == y && mtmp->mx == x && mtmp->my == y
&& !glyph_is_invisible(glyph) && !glyph_is_invisible(glyph)
&& !(u.uswallow && mtmp == u.ustuck)) { && !engulfing_u(mtmp)) {
map_invisible(x, y); map_invisible(x, y);
} }
/* recoil if floating */ /* recoil if floating */
+1 -1
View File
@@ -1678,7 +1678,7 @@ thitmonst(register struct monst *mon,
register int tmp; /* Base chance to hit */ register int tmp; /* Base chance to hit */
register int disttmp; /* distance modifier */ register int disttmp; /* distance modifier */
int otyp = obj->otyp, hmode; int otyp = obj->otyp, hmode;
boolean guaranteed_hit = (u.uswallow && mon == u.ustuck); boolean guaranteed_hit = engulfing_u(mon);
int dieroll; int dieroll;
hmode = (obj == uwep) ? HMON_APPLIED hmode = (obj == uwep) ? HMON_APPLIED
+1 -1
View File
@@ -363,7 +363,7 @@ explode(
} while (*hallu_buf != lowc(*hallu_buf)); } while (*hallu_buf != lowc(*hallu_buf));
str = hallu_buf; str = hallu_buf;
} }
if (u.uswallow && mtmp == u.ustuck) { if (engulfing_u(mtmp)) {
const char *adj = (char *) 0; const char *adj = (char *) 0;
if (is_animal(u.ustuck->data)) { if (is_animal(u.ustuck->data)) {
+1 -1
View File
@@ -4428,7 +4428,7 @@ display_minventory(struct monst *mon, int dflags, char *title)
int n; int n;
menu_item *selected = 0; menu_item *selected = 0;
int do_all = (dflags & MINV_ALL) != 0, int do_all = (dflags & MINV_ALL) != 0,
incl_hero = (do_all && u.uswallow && mon == u.ustuck), incl_hero = (do_all && engulfing_u(mon)),
have_inv = (mon->minvent != 0), have_any = (have_inv || incl_hero), have_inv = (mon->minvent != 0), have_any = (have_inv || incl_hero),
pickings = (dflags & MINV_PICKMASK); pickings = (dflags & MINV_PICKMASK);
+2 -2
View File
@@ -124,7 +124,7 @@ fightm(register struct monst *mtmp)
if (itsstuck(mtmp)) if (itsstuck(mtmp))
return 0; return 0;
} }
has_u_swallowed = (u.uswallow && (mtmp == u.ustuck)); has_u_swallowed = engulfing_u(mtmp);
for (mon = fmon; mon; mon = nmon) { for (mon = fmon; mon; mon = nmon) {
nmon = mon->nmon; nmon = mon->nmon;
@@ -486,7 +486,7 @@ mattackm(register struct monst *magr, register struct monst *mdef)
if (distmin(magr->mx, magr->my, mdef->mx, mdef->my) > 1) if (distmin(magr->mx, magr->my, mdef->mx, mdef->my) > 1)
continue; continue;
/* Engulfing attacks are directed at the hero if possible. -dlc */ /* Engulfing attacks are directed at the hero if possible. -dlc */
if (u.uswallow && magr == u.ustuck) if (engulfing_u(magr))
strike = 0; strike = 0;
else if ((strike = (tmp > rnd(20 + i))) != 0) else if ((strike = (tmp > rnd(20 + i))) != 0)
res[i] = gulpmm(magr, mdef, mattk); res[i] = gulpmm(magr, mdef, mattk);
+5 -5
View File
@@ -808,7 +808,7 @@ minliquid_core(struct monst* mtmp)
/* hero used fire to melt ice that monster was on */ /* hero used fire to melt ice that monster was on */
You("drown %s.", mon_nam(mtmp)); You("drown %s.", mon_nam(mtmp));
} }
if (u.ustuck && u.uswallow && u.ustuck == mtmp) { if (engulfing_u(mtmp)) {
/* This can happen after a purple worm plucks you off a /* This can happen after a purple worm plucks you off a
flying steed while you are over water. */ flying steed while you are over water. */
pline("%s sinks as %s rushes in and flushes you out.", pline("%s sinks as %s rushes in and flushes you out.",
@@ -907,7 +907,7 @@ mcalcdistress(void)
/* possibly polymorph shapechangers and lycanthropes */ /* possibly polymorph shapechangers and lycanthropes */
if (mtmp->cham >= LOW_PM) if (mtmp->cham >= LOW_PM)
decide_to_shapeshift(mtmp, (canspotmon(mtmp) decide_to_shapeshift(mtmp, (canspotmon(mtmp)
|| (u.uswallow && mtmp == u.ustuck)) || engulfing_u(mtmp))
? SHIFT_MSG : 0); ? SHIFT_MSG : 0);
were_change(mtmp); were_change(mtmp);
@@ -2748,7 +2748,7 @@ monstone(struct monst* mdef)
newsym(x, y); newsym(x, y);
/* We don't currently trap the hero in the statue in this case but we /* We don't currently trap the hero in the statue in this case but we
* could */ * could */
if (u.uswallow && u.ustuck == mdef) if (engulfing_u(mdef))
wasinside = TRUE; wasinside = TRUE;
mondead(mdef); mondead(mdef);
if (wasinside) { if (wasinside) {
@@ -2864,7 +2864,7 @@ xkilled(
struct obj *otmp; struct obj *otmp;
struct trap *t; struct trap *t;
boolean be_sad; boolean be_sad;
boolean wasinside = u.uswallow && (u.ustuck == mtmp), boolean wasinside = engulfing_u(mtmp),
burycorpse = FALSE, burycorpse = FALSE,
nomsg = (xkill_flags & XKILL_NOMSG) != 0, nomsg = (xkill_flags & XKILL_NOMSG) != 0,
nocorpse = (xkill_flags & XKILL_NOCORPSE) != 0, nocorpse = (xkill_flags & XKILL_NOCORPSE) != 0,
@@ -3111,7 +3111,7 @@ vamp_stone(struct monst* mtmp)
set_mon_min_mhpmax(mtmp, 10); /* mtmp->mhpmax=max(m_lev+1,10) */ set_mon_min_mhpmax(mtmp, 10); /* mtmp->mhpmax=max(m_lev+1,10) */
mtmp->mhp = mtmp->mhpmax; mtmp->mhp = mtmp->mhpmax;
/* this can happen if previously a fog cloud */ /* this can happen if previously a fog cloud */
if (u.uswallow && (mtmp == u.ustuck)) if (engulfing_u(mtmp))
expels(mtmp, mtmp->data, FALSE); expels(mtmp, mtmp->data, FALSE);
if (in_door) { if (in_door) {
coord new_xy; coord new_xy;
+2 -2
View File
@@ -1136,7 +1136,7 @@ m_move(register struct monst* mtmp, register int after)
gx = mtmp->mux; gx = mtmp->mux;
gy = mtmp->muy; gy = mtmp->muy;
appr = mtmp->mflee ? -1 : 1; appr = mtmp->mflee ? -1 : 1;
if (mtmp->mconf || (u.uswallow && mtmp == u.ustuck)) { if (mtmp->mconf || engulfing_u(mtmp)) {
appr = 0; appr = 0;
} else { } else {
boolean should_see = (couldsee(omx, omy) boolean should_see = (couldsee(omx, omy)
@@ -1617,7 +1617,7 @@ m_move(register struct monst* mtmp, register int after)
return 2; /* mon died (position already updated) */ return 2; /* mon died (position already updated) */
/* set also in domove(), hack.c */ /* set also in domove(), hack.c */
if (u.uswallow && mtmp == u.ustuck if (engulfing_u(mtmp)
&& (mtmp->mx != omx || mtmp->my != omy)) { && (mtmp->mx != omx || mtmp->my != omy)) {
/* If the monster moved, then update */ /* If the monster moved, then update */
u.ux0 = u.ux; u.ux0 = u.ux;
+2 -2
View File
@@ -950,7 +950,7 @@ query_objlist(const char *qstr, /* query string */
/* can't depend upon 'engulfer' because that's used to indicate whether /* can't depend upon 'engulfer' because that's used to indicate whether
hero should be shown as an extra, fake item */ hero should be shown as an extra, fake item */
engulfer_minvent = (olist && olist->where == OBJ_MINVENT engulfer_minvent = (olist && olist->where == OBJ_MINVENT
&& u.uswallow && olist->ocarry == u.ustuck); && engulfing_u(olist->ocarry));
if (engulfer_minvent && n == 1 && olist->owornmask != 0L) { if (engulfer_minvent && n == 1 && olist->owornmask != 0L) {
qflags &= ~AUTOSELECT_SINGLE; qflags &= ~AUTOSELECT_SINGLE;
} }
@@ -1629,7 +1629,7 @@ pickup_object(struct obj *obj, long count,
if (obj == uchain) { /* do not pick up attached chain */ if (obj == uchain) { /* do not pick up attached chain */
return 0; return 0;
} else if (obj->where == OBJ_MINVENT && obj->owornmask != 0L } else if (obj->where == OBJ_MINVENT && obj->owornmask != 0L
&& u.uswallow && obj->ocarry == u.ustuck) { && engulfing_u(obj->ocarry)) {
You_cant("pick %s up.", ysimple_name(obj)); You_cant("pick %s up.", ysimple_name(obj));
return 0; return 0;
} else if (obj->oartifact && !touch_artifact(obj, &g.youmonst)) { } else if (obj->oartifact && !touch_artifact(obj, &g.youmonst)) {
+2 -2
View File
@@ -2152,7 +2152,7 @@ drop_boulder_on_monster(int x, int y, boolean confused, boolean byu)
pline("%s is hit by %s!", Monnam(mtmp), doname(otmp2)); pline("%s is hit by %s!", Monnam(mtmp), doname(otmp2));
if (mtmp->minvis && !canspotmon(mtmp)) if (mtmp->minvis && !canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my); map_invisible(mtmp->mx, mtmp->my);
} else if (u.uswallow && mtmp == u.ustuck) } else if (engulfing_u(mtmp))
You_hear("something hit %s %s over your %s!", You_hear("something hit %s %s over your %s!",
s_suffix(mon_nam(mtmp)), mbodypart(mtmp, STOMACH), s_suffix(mon_nam(mtmp)), mbodypart(mtmp, STOMACH),
body_part(HEAD)); body_part(HEAD));
@@ -2185,7 +2185,7 @@ drop_boulder_on_monster(int x, int y, boolean confused, boolean byu)
wakeup(mtmp, byu); wakeup(mtmp, byu);
} }
wake_nearto(x, y, 4 * 4); wake_nearto(x, y, 4 * 4);
} else if (u.uswallow && mtmp == u.ustuck) { } else if (engulfing_u(mtmp)) {
obfree(otmp2, (struct obj *) 0); obfree(otmp2, (struct obj *) 0);
/* fall through to player */ /* fall through to player */
drop_boulder_on_player(confused, TRUE, FALSE, TRUE); drop_boulder_on_player(confused, TRUE, FALSE, TRUE);
+1 -1
View File
@@ -518,7 +518,7 @@ mpickobj(register struct monst* mtmp, register struct obj* otmp)
the light to be extinguished rather than letting it shine thru */ the light to be extinguished rather than letting it shine thru */
if (obj_sheds_light(otmp) && attacktype(mtmp->data, AT_ENGL)) { if (obj_sheds_light(otmp) && attacktype(mtmp->data, AT_ENGL)) {
/* this is probably a burning object that you dropped or threw */ /* this is probably a burning object that you dropped or threw */
if (u.uswallow && mtmp == u.ustuck && !Blind) if (engulfing_u(mtmp) && !Blind)
pline("%s out.", Tobjnam(otmp, "go")); pline("%s out.", Tobjnam(otmp, "go"));
snuff_otmp = TRUE; snuff_otmp = TRUE;
} }
+1 -1
View File
@@ -1654,7 +1654,7 @@ u_teleport_mon(struct monst* mtmp, boolean give_feedback)
if (give_feedback) if (give_feedback)
pline("%s resists your magic!", Monnam(mtmp)); pline("%s resists your magic!", Monnam(mtmp));
return FALSE; return FALSE;
} else if (u.uswallow && mtmp == u.ustuck && noteleport_level(mtmp)) { } else if (engulfing_u(mtmp) && noteleport_level(mtmp)) {
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);
+5 -6
View File
@@ -124,7 +124,7 @@ attack_checks(
/* if you're close enough to attack, alert any waiting monster */ /* if you're close enough to attack, alert any waiting monster */
mtmp->mstrategy &= ~STRAT_WAITMASK; mtmp->mstrategy &= ~STRAT_WAITMASK;
if (u.uswallow && mtmp == u.ustuck) if (engulfing_u(mtmp))
return FALSE; return FALSE;
if (g.context.forcefight) { if (g.context.forcefight) {
@@ -503,7 +503,7 @@ do_attack(struct monst *mtmp)
*/ */
if (g.context.forcefight && !DEADMONSTER(mtmp) && !canspotmon(mtmp) if (g.context.forcefight && !DEADMONSTER(mtmp) && !canspotmon(mtmp)
&& !glyph_is_invisible(levl[u.ux + u.dx][u.uy + u.dy].glyph) && !glyph_is_invisible(levl[u.ux + u.dx][u.uy + u.dy].glyph)
&& !(u.uswallow && mtmp == u.ustuck)) && !engulfing_u(mtmp))
map_invisible(u.ux + u.dx, u.uy + u.dy); map_invisible(u.ux + u.dx, u.uy + u.dy);
return TRUE; return TRUE;
@@ -544,7 +544,7 @@ known_hitum(struct monst *mon, struct obj *weapon, int *mhit, int rollneeded,
if (malive) { if (malive) {
/* monster still alive */ /* monster still alive */
if (!rn2(25) && mon->mhp < mon->mhpmax / 2 if (!rn2(25) && mon->mhp < mon->mhpmax / 2
&& !(u.uswallow && mon == u.ustuck)) { && !engulfing_u(mon)) {
/* maybe should regurgitate if swallowed? */ /* maybe should regurgitate if swallowed? */
monflee(mon, !rn2(3) ? rnd(100) : 0, FALSE, TRUE); monflee(mon, !rn2(3) ? rnd(100) : 0, FALSE, TRUE);
@@ -2366,13 +2366,12 @@ mhitm_ad_tlpt(struct monst *magr, struct attack *mattk, struct monst *mdef,
mhm->damage = 1; mhm->damage = 1;
if (!negated) { if (!negated) {
char nambuf[BUFSZ]; char nambuf[BUFSZ];
boolean u_saw_mon = (canseemon(mdef) boolean u_saw_mon = (canseemon(mdef) || engulfing_u(mdef));
|| (u.uswallow && u.ustuck == mdef));
/* record the name before losing sight of monster */ /* record the name before losing sight of monster */
Strcpy(nambuf, Monnam(mdef)); Strcpy(nambuf, Monnam(mdef));
if (u_teleport_mon(mdef, FALSE) && u_saw_mon if (u_teleport_mon(mdef, FALSE) && u_saw_mon
&& !(canseemon(mdef) || (u.uswallow && u.ustuck == mdef))) && !(canseemon(mdef) || engulfing_u(mdef)))
pline("%s suddenly disappears!", nambuf); pline("%s suddenly disappears!", nambuf);
if (mhm->damage >= mdef->mhp) { /* see hitmu(mhitu.c) */ if (mhm->damage >= mdef->mhp) { /* see hitmu(mhitu.c) */
if (mdef->mhp == 1) if (mdef->mhp == 1)
+7 -7
View File
@@ -140,7 +140,7 @@ bhitm(struct monst *mtmp, struct obj *otmp)
boolean disguised_mimic = (mtmp->data->mlet == S_MIMIC boolean disguised_mimic = (mtmp->data->mlet == S_MIMIC
&& M_AP_TYPE(mtmp) != M_AP_NOTHING); && M_AP_TYPE(mtmp) != M_AP_NOTHING);
if (u.uswallow && mtmp == u.ustuck) if (engulfing_u(mtmp))
reveal_invis = FALSE; reveal_invis = FALSE;
g.notonhead = (mtmp->mx != g.bhitpos.x || mtmp->my != g.bhitpos.y); g.notonhead = (mtmp->mx != g.bhitpos.x || mtmp->my != g.bhitpos.y);
@@ -177,7 +177,7 @@ bhitm(struct monst *mtmp, struct obj *otmp)
seemimic(mtmp); seemimic(mtmp);
mon_adjust_speed(mtmp, -1, otmp); mon_adjust_speed(mtmp, -1, otmp);
m_dowear(mtmp, FALSE); /* might want speed boots */ m_dowear(mtmp, FALSE); /* might want speed boots */
if (u.uswallow && (mtmp == u.ustuck) && is_whirly(mtmp->data)) { if (engulfing_u(mtmp) && is_whirly(mtmp->data)) {
You("disrupt %s!", mon_nam(mtmp)); You("disrupt %s!", mon_nam(mtmp));
pline("A huge hole opens up..."); pline("A huge hole opens up...");
expels(mtmp, mtmp->data, TRUE); expels(mtmp, mtmp->data, TRUE);
@@ -229,7 +229,7 @@ bhitm(struct monst *mtmp, struct obj *otmp)
boolean polyspot = (otyp != POT_POLYMORPH), boolean polyspot = (otyp != POT_POLYMORPH),
give_msg = (!Hallucination give_msg = (!Hallucination
&& (canseemon(mtmp) && (canseemon(mtmp)
|| (u.uswallow && mtmp == u.ustuck))); || engulfing_u(mtmp)));
/* dropped inventory (due to death by system shock, /* dropped inventory (due to death by system shock,
or loss of wielded weapon and/or worn armor due to or loss of wielded weapon and/or worn armor due to
@@ -258,7 +258,7 @@ bhitm(struct monst *mtmp, struct obj *otmp)
&& newcham(mtmp, &mons[mtmp->cham], && newcham(mtmp, &mons[mtmp->cham],
polyspot, give_msg) != 0)) { polyspot, give_msg) != 0)) {
if (give_msg && (canspotmon(mtmp) if (give_msg && (canspotmon(mtmp)
|| (u.uswallow && mtmp == u.ustuck))) || engulfing_u(mtmp)))
learn_it = TRUE; learn_it = TRUE;
} }
@@ -529,7 +529,7 @@ probe_monster(struct monst *mtmp)
(char *) 0); (char *) 0);
} else { } else {
pline("%s is not carrying anything%s.", noit_Monnam(mtmp), pline("%s is not carrying anything%s.", noit_Monnam(mtmp),
(u.uswallow && mtmp == u.ustuck) ? " besides you" : ""); engulfing_u(mtmp) ? " besides you" : "");
} }
} }
@@ -3308,7 +3308,7 @@ hit(const char *str, struct monst *mtmp,
const char *force) /* usually either "." or "!" */ const char *force) /* usually either "." or "!" */
{ {
if ((!cansee(g.bhitpos.x, g.bhitpos.y) && !canspotmon(mtmp) if ((!cansee(g.bhitpos.x, g.bhitpos.y) && !canspotmon(mtmp)
&& !(u.uswallow && mtmp == u.ustuck)) || !flags.verbose) && !engulfing_u(mtmp)) || !flags.verbose)
pline("%s %s it.", The(str), vtense(str, "hit")); pline("%s %s it.", The(str), vtense(str, "hit"));
else else
pline("%s %s %s%s", The(str), vtense(str, "hit"), pline("%s %s %s%s", The(str), vtense(str, "hit"),
@@ -3860,7 +3860,7 @@ zhitm(
if (spellcaster) if (spellcaster)
tmp = spell_damage_bonus(tmp); tmp = spell_damage_bonus(tmp);
if (!resists_blnd(mon) if (!resists_blnd(mon)
&& !(type > 0 && u.uswallow && mon == u.ustuck)) { && !(type > 0 && engulfing_u(mon))) {
register unsigned rnd_tmp = rnd(50); register unsigned rnd_tmp = rnd(50);
mon->mcansee = 0; mon->mcansee = 0;
if ((mon->mblinded + rnd_tmp) > 127) if ((mon->mblinded + rnd_tmp) > 127)