-/* NetHack 3.6 apply.c $NHDT-Date: 1519598527 2018/02/25 22:42:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.243 $ */
+/* NetHack 3.6 apply.c $NHDT-Date: 1553363415 2019/03/23 17:50:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.272 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
old = u.ucreamed;
u.ucreamed += rn1(10, 3);
#if 0 /*JP*/
- pline("Yecch! Your %s %s gunk on it!", body_part(FACE),
+ pline("Yecch! Your %s %s gunk on it!", body_part(FACE),
(old ? "has more" : "now has"));
#else
pline("\83Q\83F\81[\81I\82 \82È\82½\82Ì%s\82Í%s\82×\82Æ\82×\82Æ\82É\82È\82Á\82½\81I", body_part(FACE),
/* (most corpses don't retain the monster's sex, so
we're usually forced to use generic pronoun here) */
if (mtmp) {
- mptr = &mons[mtmp->mnum];
- /* can't use mhe() here; it calls pronoun_gender() which
- expects monster to be on the map (visibility check) */
- if ((humanoid(mptr) || (mptr->geno & G_UNIQ)
- || type_is_pname(mptr)) && !is_neuter(mptr))
- gndr = (int) mtmp->female;
+ mptr = mtmp->data = &mons[mtmp->mnum];
+ /* TRUE: override visibility check--it's not on the map */
+ gndr = pronoun_gender(mtmp, TRUE);
} else {
mptr = &mons[corpse->corpsenm];
if (is_female(mptr))
int visglyph, corpseglyph;
visglyph = glyph_at(rx, ry);
- corpseglyph = obj_to_glyph(corpse);
+ corpseglyph = obj_to_glyph(corpse, rn2);
if (Blind && (visglyph != corpseglyph))
map_object(corpse, TRUE);
mtmp->mundetected = 0;
newsym(mtmp->mx, mtmp->my);
} else if (mtmp->mappearance) {
+/*JP
const char *what = "thing";
+*/
+ const char *what = "\95¨\91Ì";
- switch (mtmp->m_ap_type) {
+ switch (M_AP_TYPE(mtmp)) {
case M_AP_OBJECT:
what = simple_typename(mtmp->mappearance);
break;
You_hear(hollow_str, "passage");
*/
You_hear(hollow_str, "\92Ê\98H");
- lev->typ = CORR;
+ lev->typ = CORR, lev->flags = 0;
unblock_point(rx, ry);
feel_newsym(rx, ry);
return res;
}
/* mimic must be revealed before we know whether it
actually moves because line-of-sight may change */
- if (mtmp->m_ap_type)
+ if (M_AP_TYPE(mtmp))
seemimic(mtmp);
omx = mtmp->mx, omy = mtmp->my;
mnexto(mtmp);
corpse less likely to remain tame after revival */
xkilled(mtmp, XKILL_NOMSG);
/* life-saving doesn't ordinarily reset this */
- if (mtmp->mhp > 0)
+ if (!DEADMONSTER(mtmp))
u.uconduct.killer = save_pacifism;
} else {
/*JP
(void) rloc(mtmp, TRUE);
} else if (!is_unicorn(mtmp->data) && !humanoid(mtmp->data)
&& (!mtmp->minvis || perceives(mtmp->data)) && rn2(5)) {
- if (vis)
+ boolean do_react = TRUE;
+
+ if (mtmp->mfrozen) {
+ if (vis)
+/*JP
+ You("discern no obvious reaction from %s.", mon_nam(mtmp));
+*/
+ You("%s\82©\82ç\82Ì\96¾\82ç\82©\82È\94½\89\9e\82Í\8e¯\95Ê\82Å\82«\82È\82©\82Á\82½\81D", mon_nam(mtmp));
+ else
+/*JP
+ You_feel("a bit silly gesturing the mirror in that direction.");
+*/
+ You_feel("\8b¾\82ð\82»\82Ì\95û\8cü\82É\8cü\82¯\82é\82Ì\82Í\82¿\82å\82Á\82Æ\82¨\82©\82µ\82È\8ds\93®\82¾\82Æ\8a´\82¶\82½\81D");
+ do_react = FALSE;
+ }
+ if (do_react) {
+ if (vis)
/*JP
pline("%s is frightened by its reflection.", Monnam(mtmp));
*/
pline("%s\82Í\8e©\95ª\82Ì\8ep\82ð\8c©\82Ä\95|\82ª\82Á\82½\81D", Monnam(mtmp));
- monflee(mtmp, d(2, 4), FALSE, FALSE);
+ monflee(mtmp, d(2, 4), FALSE, FALSE);
+ }
} else if (!Blind) {
if (mtmp->minvis && !See_invisible)
;
You("pull yourself above the %s!", hliquid("lava"));
*/
You("%s\82©\82ç\94ò\82Ñ\8fo\82½\81I", hliquid("\97n\8aâ"));
- u.utrap = 0;
+ reset_utrap(TRUE);
return 1;
case TT_BURIEDBALL:
case TT_INFLOOR:
*/
pline("\89½\82à\8bN\82«\82È\82©\82Á\82½\82æ\82¤\82¾\81D");
make_deaf((HDeaf & TIMEOUT) + lcount, TRUE);
- context.botl = TRUE;
break;
}
return;
}
}
+ if (did_attr || did_prop)
+ context.botl = TRUE;
if (did_attr)
#if 0 /*JP*/
pline("This makes you feel %s!",
*/
pline("\89½\82à\8bN\82«\82È\82©\82Á\82½\82æ\82¤\82¾\81D");
- context.botl = (did_attr || did_prop);
#undef PROP_COUNT
#undef ATTR_COUNT
#undef prop2trbl
and_vanish[0] = '\0';
if ((mtmp->minvis && !See_invisible)
|| (mtmp->data->mlet == S_MIMIC
- && mtmp->m_ap_type != M_AP_NOTHING))
+ && M_AP_TYPE(mtmp) != M_AP_NOTHING))
suppress_see = TRUE;
if (mtmp->mundetected) {
if (!figurine_location_checks(obj, &cc, FALSE))
return;
#if 0 /*JP*/
- You("%s and it transforms.",
+ You("%s and it %stransforms.",
(u.dx || u.dy) ? "set the figurine beside you"
: (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
|| is_pool(cc.x, cc.y))
? "release the figurine"
: (u.dz < 0 ? "toss the figurine into the air"
- : "set the figurine on the ground"));
+ : "set the figurine on the ground"),
+ Blind ? "supposedly " : "");
#else
You("%s\81D\82·\82é\82Æ\82»\82ê\82Í\95Ï\8c`\82µ\82½\81D",
(u.dx || u.dy) ? "\82»\82Î\82É\90l\8c`\82ð\92u\82¢\82½"
: (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
|| is_pool(cc.x, cc.y))
? "\90l\8c`\82ð\95ú\82Á\82½"
- : (u.dz < 0 ? "\90l\8c`\82ð\8bó\92\86\82É\93\8a\82°\82½"
- : "\90l\8c`\82ð\92n\96Ê\82É\92u\82¢\82½"));
+ : (u.dz < 0 ? "\90l\8c`\82ð\8bó\92\86\82É\93\8a\82°\82½"
+ : "\90l\8c`\82ð\92n\96Ê\82É\92u\82¢\82½"));
#endif
(void) make_familiar(obj, cc.x, cc.y, FALSE);
(void) stop_timer(FIG_TRANSFORM, obj_to_any(obj));
useup(obj);
+ if (Blind)
+ map_invisible(cc.x, cc.y);
*optr = 0;
}
You("resume setting %s%s.", shk_your(buf, otmp),
*/
You("%s\82ð\8ed\8a|\82¯\82é\82Ì\82ð\8dÄ\8aJ\82µ\82½\81D",
- defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
+ defsyms[trap_to_defsym(what_trap(ttyp, rn2))].explanation);
set_occupation(set_trap, occutext, 0);
return;
}
Sprintf(buf, "Continue your attempt to set %s?",
*/
Sprintf(buf, "%s\82Ì\8ed\8a|\82¯\82ð\91±\82¯\82é\81H",
- the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation));
+ the(defsyms[trap_to_defsym(what_trap(ttyp, rn2))]
+ .explanation));
if (yn(buf) == 'y') {
if (chance) {
switch (ttyp) {
You("drop %s!",
*/
You("%s\82ð\97\8e\82Æ\82µ\82½\81I",
- the(defsyms[trap_to_defsym(what_trap(ttyp))]
+ the(defsyms[trap_to_defsym(what_trap(ttyp, rn2))]
.explanation));
dropx(otmp);
return;
You("begin setting %s%s.", shk_your(buf, otmp),
*/
You("%s%s\82ð\8ed\8a|\82¯\82Í\82¶\82ß\82½\81D", shk_your(buf, otmp),
- defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
+ defsyms[trap_to_defsym(what_trap(ttyp, rn2))].explanation);
set_occupation(set_trap, occutext, 0);
return;
}
You("finish arming %s.",
*/
You("%s\82ð\8ed\8a|\82¯\8fI\82¦\82½\81D",
- the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation));
+ the(defsyms[trap_to_defsym(what_trap(ttyp, rn2))].explanation));
if (((otmp->cursed || Fumbling) && (rnl(10) > 5))
|| trapinfo.force_bungle)
dotrap(ttmp,
losehp(Maybe_Half_Phys(dam), buf, NO_KILLER_PREFIX);
#else
Strcpy(buf, "\8e©\95ª\8e©\90g\82ð\95Ú\91Å\82Á\82Ä");
- losehp(dam, buf, KILLED_BY);
+ losehp(Maybe_Half_Phys(dam), buf, KILLED_BY);
#endif
- context.botl = 1;
return 1;
} else if ((Fumbling || Glib) && !rn2(5)) {
*/
You("\82®\82¢\82Æ\88ø\82Á\82Ï\82Á\82Ä\8c\8a\82©\82ç\94²\82¯\8fo\82µ\82½\81I");
teleds(cc.x, cc.y, TRUE);
- u.utrap = 0;
+ reset_utrap(TRUE);
vision_full_recalc = 1;
}
} else {
}
wakeup(mtmp, TRUE);
} else {
- if (mtmp->m_ap_type && !Protection_from_shape_changers
+ if (M_AP_TYPE(mtmp) && !Protection_from_shape_changers
&& !sensemon(mtmp))
stumble_onto_mimic(mtmp);
else
int min_range, max_range;
{
struct monst *mtmp;
- struct monst *selmon = (struct monst *) 0;
+ coord mpos;
+ boolean impaired;
+ int x, y, lo_x, hi_x, lo_y, hi_y, rt, glyph;
- for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
- if (mtmp && !DEADMONSTER(mtmp) && !mtmp->mtame
- && cansee(mtmp->mx, mtmp->my)
- && distu(mtmp->mx, mtmp->my) <= max_range
- && distu(mtmp->mx, mtmp->my) >= min_range) {
- if (selmon)
- return FALSE;
- selmon = mtmp;
+ if (Blind)
+ return FALSE; /* must be able to see target location */
+ impaired = (Confusion || Stunned || Hallucination);
+ mpos.x = mpos.y = 0; /* no candidate location yet */
+ rt = isqrt(max_range);
+ lo_x = max(u.ux - rt, 1), hi_x = min(u.ux + rt, COLNO - 1);
+ lo_y = max(u.uy - rt, 0), hi_y = min(u.uy + rt, ROWNO - 1);
+ for (x = lo_x; x <= hi_x; ++x) {
+ for (y = lo_y; y <= hi_y; ++y) {
+ if (distu(x, y) < min_range || distu(x, y) > max_range
+ || !isok(x, y) || !cansee(x, y))
+ continue;
+ glyph = glyph_at(x, y);
+ if (!impaired
+ && glyph_is_monster(glyph)
+ && (mtmp = m_at(x, y)) != 0
+ && (mtmp->mtame || (mtmp->mpeaceful && flags.confirm)))
+ continue;
+ if (glyph_is_monster(glyph)
+ || glyph_is_warning(glyph)
+ || glyph_is_invisible(glyph)
+ || (glyph_is_statue(glyph) && impaired)) {
+ if (mpos.x)
+ return FALSE; /* more than one candidate location */
+ mpos.x = x, mpos.y = y;
+ }
}
- if (!selmon)
- return FALSE;
- pos->x = selmon->mx;
- pos->y = selmon->my;
+ }
+ if (!mpos.x)
+ return FALSE; /* no candidate location */
+ *pos = mpos;
return TRUE;
}
static int polearm_range_max = -1;
STATIC_OVL boolean
-get_valid_polearm_position(x,y)
-int x,y;
+get_valid_polearm_position(x, y)
+int x, y;
{
return (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
&& distu(x, y) >= polearm_range_min
return res;
}
- context.polearm.hitmon = NULL;
+ context.polearm.hitmon = (struct monst *) 0;
/* Attack the monster there */
bhitpos = cc;
if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != (struct monst *) 0) {
(void) thitmonst(mtmp, uwep);
return 1;
}
- /* FALL THROUGH */
+ /*FALLTHRU*/
case 3: /* Surface */
if (IS_AIR(levl[cc.x][cc.y].typ) || is_pool(cc.x, cc.y))
/*JP
*/
typ = fillholetyp(x, y, FALSE);
if (typ != ROOM) {
- levl[x][y].typ = typ;
+ levl[x][y].typ = typ, levl[x][y].flags = 0;
liquid_flow(x, y, typ, t_at(x, y),
fillmsg
? (char *) 0