-/* NetHack 3.6 steed.c $NHDT-Date: 1445906867 2015/10/27 00:47:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.47 $ */
+/* NetHack 3.6 steed.c $NHDT-Date: 1545441042 2018/12/22 01:10:42 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.62 $ */
/* Copyright (c) Kevin Hugo, 1998-1999. */
/* NetHack may be freely redistributed. See license for details. */
+/* JNetHack Copyright */
+/* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
+/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2019 */
+/* JNetHack may be freely redistributed. See license for details. */
+
#include "hack.h"
/* Monsters that might be ridden */
void
rider_cant_reach()
{
+/*JP
You("aren't skilled enough to reach from %s.", y_monnam(u.usteed));
+*/
+ You("\82Ü\82¾\8f\\95ª\82É\8bZ\97Ê\82ð\90Ï\82ñ\82Å\82¢\82È\82¢\82Ì\82Å\81C%s\82©\82ç\93Í\82©\82È\82¢\81D", y_monnam(u.usteed));
}
/*** Putting the saddle on ***/
return 0;
}
if (!u.dx && !u.dy) {
+/*JP
pline("Saddle yourself? Very funny...");
+*/
+ pline("\8e©\95ª\8e©\90g\82É\88Æ\81H\82¨\82à\82µ\82ë\82¢\81D\81D\81D");
return 0;
}
if (!isok(u.ux + u.dx, u.uy + u.dy)
|| !(mtmp = m_at(u.ux + u.dx, u.uy + u.dy)) || !canspotmon(mtmp)) {
+/*JP
pline("I see nobody there.");
+*/
+ pline("\82»\82±\82É\82Í\92N\82à\82¢\82È\82¢\82æ\82¤\82É\8c©\82¦\82é\81D");
return 1;
}
/* Is this a valid monster? */
if (mtmp->misc_worn_check & W_SADDLE || which_armor(mtmp, W_SADDLE)) {
+/*JP
pline("%s doesn't need another one.", Monnam(mtmp));
+*/
+ pline("%s\82Í\82à\82¤\88Æ\82ª\8eæ\82è\82Â\82¯\82ç\82ê\82Ä\82¢\82é\81D", Monnam(mtmp));
return 1;
}
ptr = mtmp->data;
if (touch_petrifies(ptr) && !uarmg && !Stone_resistance) {
char kbuf[BUFSZ];
+/*JP
You("touch %s.", mon_nam(mtmp));
+*/
+ You("%s\82É\90G\82ê\82½\81D", mon_nam(mtmp));
if (!(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) {
+/*JP
Sprintf(kbuf, "attempting to saddle %s", an(mtmp->data->mname));
+*/
+ Sprintf(kbuf, "%s\82É\88Æ\82ð\8eæ\82è\82Â\82¯\82æ\82¤\82Æ\82µ\82Ä", mtmp->data->mname);
instapetrify(kbuf);
}
}
if (ptr == &mons[PM_INCUBUS] || ptr == &mons[PM_SUCCUBUS]) {
+/*JP
pline("Shame on you!");
+*/
+ pline("\92p\82ð\92m\82ê\81I");
exercise(A_WIS, FALSE);
return 1;
}
if (mtmp->isminion || mtmp->isshk || mtmp->ispriest || mtmp->isgd
|| mtmp->iswiz) {
+/*JP
pline("I think %s would mind.", mon_nam(mtmp));
+*/
+ pline("%s\82Í\8c\99\82ª\82Á\82Ä\82¢\82é\82æ\82¤\82¾\81D", mon_nam(mtmp));
return 1;
}
if (!can_saddle(mtmp)) {
+/*JP
You_cant("saddle such a creature.");
+*/
+ You("\82»\82Ì\90¶\82«\95¨\82É\88Æ\82Í\82Æ\82è\82Â\82¯\82ç\82ê\82È\82¢\81D");
return 1;
}
if (Confusion || Fumbling || Glib)
chance -= 20;
else if (uarmg && (s = OBJ_DESCR(objects[uarmg->otyp])) != (char *) 0
+/*JP
&& !strncmp(s, "riding ", 7))
+*/
+ && !strncmp(s, "\8fæ\94n\97p\82Ì", 8))
/* Bonus for wearing "riding" (but not fumbling) gloves */
chance += 10;
else if (uarmf && (s = OBJ_DESCR(objects[uarmf->otyp])) != (char *) 0
+/*JP
&& !strncmp(s, "riding ", 7))
+*/
+ && !strncmp(s, "\8fæ\94n\97p\82Ì", 8))
/* ... or for "riding boots" */
chance += 10;
if (otmp->cursed)
/* Make the attempt */
if (rn2(100) < chance) {
+/*JP
You("put the saddle on %s.", mon_nam(mtmp));
+*/
+ You("\88Æ\82ð%s\82É\8eæ\82è\82Â\82¯\82½\81D", mon_nam(mtmp));
if (otmp->owornmask)
remove_worn_item(otmp, FALSE);
freeinv(otmp);
- /* mpickobj may free otmp it if merges, but we have already
- checked for a saddle above, so no merger should happen */
- (void) mpickobj(mtmp, otmp);
- mtmp->misc_worn_check |= W_SADDLE;
- otmp->owornmask = W_SADDLE;
- otmp->leashmon = mtmp->m_id;
- update_mon_intrinsics(mtmp, otmp, TRUE, FALSE);
+ put_saddle_on_mon(otmp, mtmp);
} else
+/*JP
pline("%s resists!", Monnam(mtmp));
+*/
+ pline("%s\82Í\8b\91\94Û\82µ\82½\81I", Monnam(mtmp));
return 1;
}
+void
+put_saddle_on_mon(saddle, mtmp)
+struct obj *saddle;
+struct monst *mtmp;
+{
+ if (!can_saddle(mtmp) || which_armor(mtmp, W_SADDLE))
+ return;
+ if (mpickobj(mtmp, saddle))
+ panic("merged saddle?");
+ mtmp->misc_worn_check |= W_SADDLE;
+ saddle->owornmask = W_SADDLE;
+ saddle->leashmon = mtmp->m_id;
+ update_mon_intrinsics(mtmp, saddle, TRUE, FALSE);
+}
+
/*** Riding the monster ***/
/* Can we ride this monster? Caller should also check can_saddle() */
if (u.usteed) {
dismount_steed(DISMOUNT_BYCHOICE);
} else if (getdir((char *) 0) && isok(u.ux + u.dx, u.uy + u.dy)) {
+/*JP
if (wizard && yn("Force the mount to succeed?") == 'y')
+*/
+ if (wizard && yn("\96³\97\9d\96î\97\9d\90¬\8c÷\82³\82¹\82Ü\82·\82©\81H") == 'y')
forcemount = TRUE;
return (mount_steed(m_at(u.ux + u.dx, u.uy + u.dy), forcemount));
} else {
/* Sanity checks */
if (u.usteed) {
+/*JP
You("are already riding %s.", mon_nam(u.usteed));
+*/
+ You("\82à\82¤%s\82É\8fæ\82Á\82Ä\82¢\82é\81D", mon_nam(u.usteed));
return (FALSE);
}
/* Is the player in the right form? */
if (Hallucination && !force) {
+#if 0 /*JP*/
pline("Maybe you should find a designated driver.");
+#else
+ pline("\82¨\82»\82ç\82\82 \82È\82½\82Í\8ew\92è\83h\83\89\83C\83o\81[\82ð\92T\82·\82×\82«\82¾\82ë\82¤\81D");
+#endif
return (FALSE);
}
/* While riding Wounded_legs refers to the steed's,
* temporary 1 point Dex loss become permanent.]
*/
if (Wounded_legs) {
+/*JP
Your("%s are in no shape for riding.", makeplural(body_part(LEG)));
+*/
+ pline("%s\82ð\89ö\89ä\82µ\82Ä\82¢\82é\82Ì\82Å\8fæ\82ê\82È\82¢\81D", makeplural(body_part(LEG)));
if (force && wizard && yn("Heal your legs?") == 'y')
- HWounded_legs = EWounded_legs = 0;
+ HWounded_legs = EWounded_legs = 0L;
else
return (FALSE);
}
if (Upolyd && (!humanoid(youmonst.data) || verysmall(youmonst.data)
|| bigmonst(youmonst.data) || slithy(youmonst.data))) {
+/*JP
You("won't fit on a saddle.");
+*/
+ You("\88Æ\82É\8d\87\82í\82È\82¢\81D");
return (FALSE);
}
if (!force && (near_capacity() > SLT_ENCUMBER)) {
+/*JP
You_cant("do that while carrying so much stuff.");
+*/
+ You("\91ò\8eR\95¨\82ð\8e\9d\82¿\82·\82¬\82Ä\82¨\82è\8fo\97\88\82È\82¢\81D");
return (FALSE);
}
/* Can the player reach and see the monster? */
if (!mtmp || (!force && ((Blind && !Blind_telepat) || mtmp->mundetected
- || mtmp->m_ap_type == M_AP_FURNITURE
- || mtmp->m_ap_type == M_AP_OBJECT))) {
+ || M_AP_TYPE(mtmp) == M_AP_FURNITURE
+ || M_AP_TYPE(mtmp) == M_AP_OBJECT))) {
+/*JP
pline("I see nobody there.");
+*/
+ pline("\82»\82±\82É\82Í\89½\82à\8c©\82¦\82È\82¢\81D");
return (FALSE);
}
+ if (mtmp->data == &mons[PM_LONG_WORM]
+ && (u.ux + u.dx != mtmp->mx || u.uy + u.dy != mtmp->my)) {
+ /* 3.6.2: test_move(below) is used to check for trying to mount
+ diagonally into or out of a doorway or through a tight squeeze;
+ attempting to mount a tail segment when hero was not adjacent
+ to worm's head could trigger an impossible() in worm_cross()
+ called from test_move(), so handle not-on-head before that */
+/*JP
+ You("couldn't ride %s, let alone its tail.", a_monnam(mtmp));
+*/
+ You("%s\82É\82Í\8fæ\82ê\82È\82¢\81C\82à\82¿\82ë\82ñ\90K\94ö\82É\82à\8fæ\82ê\82È\82¢\81D", a_monnam(mtmp));
+ return FALSE;
+ }
if (u.uswallow || u.ustuck || u.utrap || Punished
|| !test_move(u.ux, u.uy, mtmp->mx - u.ux, mtmp->my - u.uy,
TEST_MOVE)) {
if (Punished || !(u.uswallow || u.ustuck || u.utrap))
+/*JP
You("are unable to swing your %s over.", body_part(LEG));
+*/
+ You("\88Æ\82ð\82Ü\82½\82®\82±\82Æ\82ª\82Å\82«\82È\82¢\81D");
else
+/*JP
You("are stuck here for now.");
+*/
+ You("\82Í\82Ü\82Á\82Ä\82¢\82é\82Ì\82Å\8fo\97\88\82È\82¢\81D");
return (FALSE);
}
/* Is this a valid monster? */
otmp = which_armor(mtmp, W_SADDLE);
if (!otmp) {
+/*JP
pline("%s is not saddled.", Monnam(mtmp));
+*/
+ pline("%s\82É\82Í\88Æ\82ª\8eæ\82è\82Â\82¯\82ç\82ê\82Ä\82¢\82È\82¢\81D", Monnam(mtmp));
return (FALSE);
}
ptr = mtmp->data;
if (touch_petrifies(ptr) && !Stone_resistance) {
char kbuf[BUFSZ];
+/*JP
You("touch %s.", mon_nam(mtmp));
+*/
+ You("%s\82É\90G\82ê\82½\81D", mon_nam(mtmp));
+/*JP
Sprintf(kbuf, "attempting to ride %s", an(mtmp->data->mname));
+*/
+ Sprintf(kbuf, "%s\82É\8fæ\82ë\82¤\82Æ\82µ\82Ä", a_monnam(mtmp));
instapetrify(kbuf);
}
if (!mtmp->mtame || mtmp->isminion) {
+/*JP
pline("I think %s would mind.", mon_nam(mtmp));
+*/
+ pline("%s\82Í\8c\99\82ª\82Á\82Ä\82¢\82é\82æ\82¤\82¾\81D", mon_nam(mtmp));
return (FALSE);
}
if (mtmp->mtrapped) {
struct trap *t = t_at(mtmp->mx, mtmp->my);
+#if 0 /*JP*/
You_cant("mount %s while %s's trapped in %s.", mon_nam(mtmp),
mhe(mtmp), an(defsyms[trap_to_defsym(t->ttyp)].explanation));
+#else
+ You("%s\82É\95ß\82Ü\82Á\82Ä\82¢\82é%s\82É\82Í\8fæ\82ê\82È\82¢\81D",
+ defsyms[trap_to_defsym(t->ttyp)].explanation, mon_nam(mtmp));
+#endif
return (FALSE);
}
if (!force && !Role_if(PM_KNIGHT) && !(--mtmp->mtame)) {
/* no longer tame */
newsym(mtmp->mx, mtmp->my);
+#if 0 /*JP*/
pline("%s resists%s!", Monnam(mtmp),
mtmp->mleashed ? " and its leash comes off" : "");
+#else
+ pline("%s\82Í\8b\91\94Û%s\81I", Monnam(mtmp),
+ mtmp->mleashed ? "\82µ\82Ä\81C\95R\82ð\82Í\82¸\82µ\82½" : "\82µ\82½");
+#endif
if (mtmp->mleashed)
m_unleash(mtmp, FALSE);
return (FALSE);
}
if (!force && Underwater && !is_swimmer(ptr)) {
- You_cant("ride that creature while under water.");
+#if 0 /*JP*/
+ You_cant("ride that creature while under %s.",
+ hliquid("water"));
+#else /*\82Æ\82è\82 \82¦\82¸\90\85\82¾\82¯*/
+ You("\90\85\92\86\82Å\8fæ\82é\82±\82Æ\82Í\82Å\82«\82È\82¢\81D");
+#endif
return (FALSE);
}
if (!can_saddle(mtmp) || !can_ride(mtmp)) {
+/*JP
You_cant("ride such a creature.");
- return (0);
+*/
+ You("\82»\82Ì\90¶\82«\95¨\82É\8fæ\82é\82±\82Æ\82Í\82Å\82«\82È\82¢\81D");
+ return FALSE;
}
/* Is the player impaired? */
if (!force && !is_floater(ptr) && !is_flyer(ptr) && Levitation
&& !Lev_at_will) {
+/*JP
You("cannot reach %s.", mon_nam(mtmp));
+*/
+ You("%s\82É\93Í\82©\82È\82¢\81D", mon_nam(mtmp));
return (FALSE);
}
if (!force && uarm && is_metallic(uarm) && greatest_erosion(uarm)) {
+#if 0 /*JP*/
Your("%s armor is too stiff to be able to mount %s.",
uarm->oeroded ? "rusty" : "corroded", mon_nam(mtmp));
+#else
+ Your("%s\8aZ\82Í\83M\83V\83M\83V\82¢\82Á\82Ä\82¨\82è%s\82É\8fæ\82ê\82È\82¢\81D",
+ uarm->oeroded ? "\8eK\82Ñ\82½" : "\95\85\90H\82µ\82½", mon_nam(mtmp));
+#endif
return (FALSE);
}
if (!force
&& (Confusion || Fumbling || Glib || Wounded_legs || otmp->cursed
|| (u.ulevel + mtmp->mtame < rnd(MAXULEV / 2 + 5)))) {
if (Levitation) {
+/*JP
pline("%s slips away from you.", Monnam(mtmp));
+*/
+ pline("%s\82Í\82 \82È\82½\82©\82ç\82Í\82È\82ê\82Ä\82¢\82Á\82½\81D", Monnam(mtmp));
return FALSE;
}
+/*JP
You("slip while trying to get on %s.", mon_nam(mtmp));
+*/
+ You("%s\82É\8fæ\82ë\82¤\82Æ\82µ\82Ä\82·\82×\82Á\82½\81D", mon_nam(mtmp));
+/*JP
Sprintf(buf, "slipped while mounting %s",
+*/
+ Sprintf(buf, "%s\82É\8fæ\82ë\82¤\82Æ\82µ\82Ä\82·\82×\82è\97\8e\82¿\82Ä",
/* "a saddled mumak" or "a saddled pony called Dobbin" */
x_monnam(mtmp, ARTICLE_A, (char *) 0,
SUPPRESS_IT | SUPPRESS_INVISIBLE
| SUPPRESS_HALLUCINATION,
TRUE));
+#if 0 /*JP*/
losehp(Maybe_Half_Phys(rn1(5, 10)), buf, NO_KILLER_PREFIX);
+#else
+ losehp(Maybe_Half_Phys(rn1(5, 10)), buf, KILLED_BY);
+#endif
return (FALSE);
}
if (!force) {
if (Levitation && !is_floater(ptr) && !is_flyer(ptr))
/* Must have Lev_at_will at this point */
+/*JP
pline("%s magically floats up!", Monnam(mtmp));
+*/
+ pline("%s\82Í\96\82\96@\82Ì\97Í\82Å\95\82\82¢\82½\81I", Monnam(mtmp));
+/*JP
You("mount %s.", mon_nam(mtmp));
+*/
+ You("%s\82É\8fæ\82Á\82½\81D", mon_nam(mtmp));
+ if (Flying)
+/*JP
+ You("and %s take flight together.", mon_nam(mtmp));
+*/
+ You("\82Æ%s\82Í\88ê\8f\8f\82É\8bó\82ð\94ò\82ñ\82¾\81D", mon_nam(mtmp));
}
/* setuwep handles polearms differently when you're mounted */
if (uwep && is_pole(uwep))
u.usteed = mtmp;
remove_monster(mtmp->mx, mtmp->my);
teleds(mtmp->mx, mtmp->my, TRUE);
- return (TRUE);
+ context.botl = TRUE;
+ return TRUE;
}
/* You and your steed have moved */
return;
/* It takes many turns of riding to exercise skill */
- if (u.urideturns++ >= 100) {
+ if (++u.urideturns >= 100) {
u.urideturns = 0;
use_skill(P_RIDING, 1);
}
#if 0 /*JP*/
char He[4];
#else
- /* role.c Gender.he \82Ì\92l\82ª\83R\83s\81[\82³\82ê\82é */
- char He[16];
+ /* role.c Gender.he \82Ì\92l\82ª\83R\83s\81[\82³\82ê\82é */
+ char He[16];
#endif
if (!u.usteed)
return;
u.usteed->mcanmove = 1;
}
if (u.usteed->msleeping || !u.usteed->mcanmove)
+#if 0 /*JP*/
pline("%s stirs.", He);
+#else
+ pline("%s\82Í\90g\82¶\82ë\82¬\82µ\82½\81D", He);
+#endif
else
+#if 0 /*JP*/
pline("%s rouses %sself!", He, mhim(u.usteed));
+#else
+ pline("%s\82Í\95±\8bN\82µ\82½\81I", He);
+#endif
} else
+#if 0 /*JP*/
pline("%s does not respond.", He);
+#else
+ pline("%s\82Í\94½\89\9e\82µ\82È\82¢\81D", He);
+#endif
return;
}
return;
}
+/*JP
pline("%s gallops!", Monnam(u.usteed));
+*/
+ pline("%s\82Í\91¬\91«\82É\82È\82Á\82½\81I", Monnam(u.usteed));
u.ugallop += rn1(20, 30);
return;
}
{
struct monst *mtmp;
struct obj *otmp;
- coord cc;
+ coord cc, steedcc;
+/*JP
const char *verb = "fall";
+*/
+ const char *verb = "\97\8e\82¿\82½";
boolean repair_leg_damage = (Wounded_legs != 0L);
unsigned save_utrap = u.utrap;
boolean have_spot = landing_spot(&cc, reason, 0);
otmp = which_armor(mtmp, W_SADDLE);
switch (reason) {
case DISMOUNT_THROWN:
+/*JP
verb = "are thrown";
+*/
+ verb = "\82Ó\82è\97\8e\82³\82ê\82½";
+ /*FALLTHRU*/
case DISMOUNT_FELL:
+/*JP
You("%s off of %s!", verb, mon_nam(mtmp));
+*/
+ You("%s\82©\82ç%s\81I", mon_nam(mtmp), verb);
if (!have_spot)
have_spot = landing_spot(&cc, reason, 1);
+/*JP
losehp(Maybe_Half_Phys(rn1(10, 10)), "riding accident", KILLED_BY_AN);
+*/
+ losehp(Maybe_Half_Phys(rn1(10, 10)), "\8bR\8fæ\8e\96\8cÌ\82Å", KILLED_BY_AN);
set_wounded_legs(BOTH_SIDES, (int) HWounded_legs + rn1(5, 5));
repair_leg_damage = FALSE;
break;
case DISMOUNT_POLY:
+/*JP
You("can no longer ride %s.", mon_nam(u.usteed));
+*/
+ You("%s\82É\8fæ\82Á\82Ä\82ç\82ê\82È\82¢\81D", mon_nam(u.usteed));
if (!have_spot)
have_spot = landing_spot(&cc, reason, 1);
break;
case DISMOUNT_BYCHOICE:
default:
if (otmp && otmp->cursed) {
+#if 0 /*JP*/
You("can't. The saddle %s cursed.",
otmp->bknown ? "is" : "seems to be");
+#else
+ You("\8d~\82è\82ç\82ê\82È\82¢\81D\88Æ\82Í\8eô\82í\82ê\82Ä\82¢\82é%s\81D",
+ otmp->bknown ? "" : "\82æ\82¤\82¾");
+#endif
otmp->bknown = TRUE;
return;
}
if (!have_spot) {
- You("can't. There isn't anywhere for you to stand.");
+/*JP
+ You("can't. There isn't anywhere for you to stand.");
+*/
+ pline("\82 \82È\82½\82Ì\97§\82Â\8fê\8f\8a\82ª\82È\82¢\82Ì\82Å\8d~\82è\82ç\82ê\82È\82¢\81D");
return;
}
if (!has_mname(mtmp)) {
+/*JP
pline("You've been through the dungeon on %s with no name.",
+*/
+ pline("\82 \82È\82½\82Í\96¼\91O\82Ì\82È\82¢%s\82Æ\8b¤\82É\96À\8b{\93à\82É\82¢\82é\81D",
an(mtmp->data->mname));
if (Hallucination)
+/*JP
pline("It felt good to get out of the rain.");
+*/
+ pline("\89J\82ª\8d~\82ç\82È\82¢\82Ì\82Æ\82¢\82¤\82Ì\82Í\82¢\82¢\8bC\95ª\82¾\82Á\82½\81D");
} else
+/*JP
You("dismount %s.", mon_nam(mtmp));
+*/
+ You("%s\82©\82ç\8d~\82è\82½\81D", mon_nam(mtmp));
}
/* While riding, Wounded_legs refers to the steed's legs;
after dismounting, it reverts to the hero's legs. */
- if (repair_leg_damage) {
- /* [TODO: make heal_legs() take a parameter to handle this] */
- in_steed_dismounting = TRUE;
- heal_legs();
- in_steed_dismounting = FALSE;
- }
+ if (repair_leg_damage)
+ heal_legs(1);
/* Release the steed and saddle */
u.usteed = 0;
u.ugallop = 0L;
+ /*
+ * rloc(), rloc_to(), and monkilled()->mondead()->m_detach() all
+ * expect mtmp to be on the map or else have mtmp->mx be 0, but
+ * setting the latter to 0 here would interfere with dropping
+ * the saddle. Prior to 3.6.2, being off the map didn't matter.
+ *
+ * place_monster() expects mtmp to be alive and not be u.usteed.
+ *
+ * Unfortunately, <u.ux,u.uy> (former steed's implicit location)
+ * might now be occupied by an engulfer, so we can't just put mtmp
+ * at that spot. An engulfer's previous spot will be unoccupied
+ * but we don't know where that was and even if we did, it might
+ * be hostile terrain.
+ */
+ steedcc.x = u.ux, steedcc.y = u.uy;
+ if (m_at(u.ux, u.uy)) {
+ /* hero's spot has a monster in it; hero must have been plucked
+ from saddle as engulfer moved into his spot--other dismounts
+ shouldn't run into this situation; find nearest viable spot */
+ if (!enexto(&steedcc, u.ux, u.uy, mtmp->data)
+ /* no spot? must have been engulfed by a lurker-above over
+ water or lava; try requesting a location for a flyer */
+ && !enexto(&steedcc, u.ux, u.uy, &mons[PM_BAT]))
+ /* still no spot; last resort is any spot within bounds */
+ (void) enexto(&steedcc, u.ux, u.uy, &mons[PM_GHOST]);
+ }
+ if (!m_at(steedcc.x, steedcc.y)) {
+ if (mtmp->mhp < 1)
+ mtmp->mhp = 0; /* make sure it isn't negative */
+ mtmp->mhp++; /* force at least one hit point, possibly resurrecting */
+ place_monster(mtmp, steedcc.x, steedcc.y);
+ mtmp->mhp--; /* take the extra hit point away: cancel resurrection */
+ } else {
+ impossible("Dismounting: can't place former steed on map.");
+ }
+
+ if (!DEADMONSTER(mtmp)) {
+ /* if for bones, there's no reason to place the hero;
+ we want to make room for potential ghost, so move steed */
+ if (reason == DISMOUNT_BONES) {
+ /* move the steed to an adjacent square */
+ if (enexto(&cc, u.ux, u.uy, mtmp->data))
+ rloc_to(mtmp, cc.x, cc.y);
+ else /* evidently no room nearby; move steed elsewhere */
+ (void) rloc(mtmp, FALSE);
+ return;
+ }
- /* Set player and steed's position. Try moving the player first
- unless we're in the midst of creating a bones file. */
- if (reason == DISMOUNT_BONES) {
- /* move the steed to an adjacent square */
- if (enexto(&cc, u.ux, u.uy, mtmp->data))
- rloc_to(mtmp, cc.x, cc.y);
- else /* evidently no room nearby; move steed elsewhere */
- (void) rloc(mtmp, FALSE);
- return;
- }
- if (mtmp->mhp > 0) {
- place_monster(mtmp, u.ux, u.uy);
+ /* Set hero's and/or steed's positions. Try moving the hero first. */
if (!u.uswallow && !u.ustuck && have_spot) {
struct permonst *mdat = mtmp->data;
if (!is_flyer(mdat) && !is_floater(mdat) && !is_clinger(mdat)) {
if (is_pool(u.ux, u.uy)) {
if (!Underwater)
+/*JP
pline("%s falls into the %s!", Monnam(mtmp),
+*/
+ pline("%s\82Í%s\82É\97\8e\82¿\82½\81I", Monnam(mtmp),
surface(u.ux, u.uy));
if (!is_swimmer(mdat) && !amphibious(mdat)) {
killed(mtmp);
adjalign(-1);
}
} else if (is_lava(u.ux, u.uy)) {
- pline("%s is pulled into the lava!", Monnam(mtmp));
+#if 0 /*JP*/
+ pline("%s is pulled into the %s!", Monnam(mtmp),
+ hliquid("lava"));
+#else
+ pline("%s\82Í%s\82Ì\92\86\82É\82Ð\82Á\82Ï\82ç\82ê\82½\81I", Monnam(mtmp),
+ hliquid("\97n\8aâ"));
+#endif
if (!likes_lava(mdat)) {
killed(mtmp);
adjalign(-1);
* falling into the hole).
*/
/* [ALI] No need to move the player if the steed died. */
- if (mtmp->mhp > 0) {
+ if (!DEADMONSTER(mtmp)) {
/* Keep steed here, move the player to cc;
* teleds() clears u.utrap
*/
if (save_utrap)
(void) mintrap(mtmp);
}
- /* Couldn't... try placing the steed */
+
+ /* Couldn't move hero... try moving the steed. */
} else if (enexto(&cc, u.ux, u.uy, mtmp->data)) {
/* Keep player here, move the steed to cc */
rloc_to(mtmp, cc.x, cc.y);
/* Player stays put */
- /* Otherwise, kill the steed */
+
+ /* Otherwise, kill the steed. */
} else {
- killed(mtmp);
- adjalign(-1);
+ if (reason == DISMOUNT_BYCHOICE) {
+ /* [un]#ride: hero gets credit/blame for killing steed */
+ killed(mtmp);
+ adjalign(-1);
+ } else {
+ /* other dismount: kill former steed with no penalty;
+ damage type is just "neither AD_DGST nor -AD_RBRE" */
+ monkilled(mtmp, "", -AD_PHYS);
+ }
}
- }
+ } /* !DEADMONST(mtmp) */
- /* Return the player to the floor */
- if (reason != DISMOUNT_ENGULFED) {
+ /* usually return the hero to the surface */
+ if (reason != DISMOUNT_ENGULFED && reason != DISMOUNT_BONES) {
in_steed_dismounting = TRUE;
(void) float_down(0L, W_SADDLE);
in_steed_dismounting = FALSE;
- context.botl = 1;
+ context.botl = TRUE;
(void) encumber_msg();
vision_full_recalc = 1;
} else
- context.botl = 1;
+ context.botl = TRUE;
/* polearms behave differently when not mounted */
if (uwep && is_pole(uwep))
unweapon = TRUE;
}
}
if (wasimmobile && !steed->msleeping && steed->mcanmove)
+/*JP
pline("%s wakes up.", Monnam(steed));
+*/
+ pline("%s\82Í\8bN\82«\82½\81D", Monnam(steed));
/* regardless of waking, terminate any meal in progress */
finish_meating(steed);
}
if (steed) {
/* check whether steed can move */
if (steed->msleeping || !steed->mcanmove) {
+/*JP
pline("%s won't move!", upstart(y_monnam(steed)));
+*/
+ pline("%s\82Í\93®\82¯\82È\82¢\81I", y_monnam(steed));
return TRUE;
}
/* optionally check whether steed is in the midst of a meal */
if (checkfeeding && steed->meating) {
+/*JP
pline("%s is still eating.", upstart(y_monnam(steed)));
+*/
+ pline("%s\82Í\82Ü\82¾\90H\82×\82Ä\82¢\82é\81D", y_monnam(steed));
return TRUE;
}
}
struct monst *mon;
int x, y;
{
+ /* normal map bounds are <1..COLNO-1,0..ROWNO-1> but sometimes
+ vault guards (either living or dead) are parked at <0,0> */
+ if (!isok(x, y) && (x != 0 || y != 0 || !mon->isgd)) {
+ impossible("trying to place monster at <%d,%d>", x, y);
+ x = y = 0;
+ }
if (mon == u.usteed
/* special case is for convoluted vault guard handling */
|| (DEADMONSTER(mon) && !(mon->isgd && x == 0 && y == 0))) {
(mon == u.usteed) ? "steed" : "defunct monster");
return;
}
+ if (level.monsters[x][y])
+ impossible("placing monster over another at <%d,%d>?", x, y);
mon->mx = x, mon->my = y;
level.monsters[x][y] = mon;
}