-/* NetHack 3.6 dbridge.c $NHDT-Date: 1449269914 2015/12/04 22:58:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.35 $ */
+/* NetHack 3.6 dbridge.c $NHDT-Date: 1503355815 2017/08/21 22:50:15 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.39 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
* dir is the direction.
* flag must be put to TRUE if we want the drawbridge to be opened.
*/
-
boolean
create_drawbridge(x, y, dir, flag)
int x, y, dir;
* Generates capitalized entity name, makes 2nd -> 3rd person conversion on
* verb, where necessary.
*/
-
STATIC_OVL const char *
E_phrase(etmp, verb)
struct entity *etmp;
/*
* Simple-minded "can it be here?" routine
*/
-
STATIC_OVL boolean
e_survives_at(etmp, x, y)
struct entity *etmp;
/*
* These are never directly affected by a bridge or portcullis.
*/
-
STATIC_OVL boolean
automiss(etmp)
struct entity *etmp;
/*
* Does falling drawbridge or portcullis miss etmp?
*/
-
STATIC_OVL boolean
e_missed(etmp, chunks)
struct entity *etmp;
/*
* Can etmp jump from death?
*/
-
STATIC_OVL boolean
e_jumps(etmp)
struct entity *etmp;
}
} else {
if (crm->typ == DRAWBRIDGE_DOWN) {
+ if (is_u(etmp)) {
+ killer.format = NO_KILLER_PREFIX;
+ Strcpy(killer.name,
+ "crushed to death underneath a drawbridge");
+ }
pline("%s crushed underneath the drawbridge.",
E_phrase(etmp, "are")); /* no jump */
e_died(etmp,
/*
* Here's where we try to do relocation. Assumes that etmp is not
- * arriving
- * at the portcullis square while the drawbridge is falling, since this
- * square
- * would be inaccessible (i.e. etmp started on drawbridge square) or
- * unnecessary (i.e. etmp started here) in such a situation.
+ * arriving at the portcullis square while the drawbridge is
+ * falling, since this square would be inaccessible (i.e. etmp
+ * started on drawbridge square) or unnecessary (i.e. etmp started
+ * here) in such a situation.
*/
debugpline0("Doing relocation.");
newx = oldx;
debugpline0("Checking new square for occupancy.");
if (relocates && (e_at(newx, newy))) {
/*
- * Standoff problem: one or both entities must die, and/or both
- * switch
- * places. Avoid infinite recursion by checking first whether the
- * other
- * entity is staying put. Clean up if we happen to move/die in
- * recursion.
+ * Standoff problem: one or both entities must die, and/or
+ * both switch places. Avoid infinite recursion by checking
+ * first whether the other entity is staying put. Clean up if
+ * we happen to move/die in recursion.
*/
struct entity *other;
}
}
+/* clear stale reason for death before returning */
+#define nokiller() (killer.name[0] = '\0', killer.format = 0)
+
/*
* Close the drawbridge located at x,y
*/
-
void
close_drawbridge(x, y)
int x, y;
newsym(x, y);
newsym(x2, y2);
block_point(x2, y2); /* vision */
+ nokiller();
}
/*
* Open the drawbridge located at x,y
*/
-
void
open_drawbridge(x, y)
int x, y;
unblock_point(x2, y2); /* vision */
if (Is_stronghold(&u.uz))
u.uevent.uopened_dbridge = TRUE;
+ nokiller();
}
/*
* Let's destroy the drawbridge located at x,y
*/
-
void
destroy_drawbridge(x, y)
int x, y;
|| (lev1->drawbridgemask & DB_UNDER) == DB_LAVA) {
struct obj *otmp2;
boolean lava = (lev1->drawbridgemask & DB_UNDER) == DB_LAVA;
+
if (lev1->typ == DRAWBRIDGE_UP) {
if (cansee(x2, y2))
pline_The("portcullis of the drawbridge falls into the %s!",
do_entity(etmp1);
}
}
+ nokiller();
}
/*dbridge.c*/
-/* NetHack 3.6 explode.c $NHDT-Date: 1496103440 2017/05/30 00:17:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.49 $ */
+/* NetHack 3.6 explode.c $NHDT-Date: 1503355817 2017/08/21 22:50:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.50 $ */
/* Copyright (C) 1990 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
if (olet == MON_EXPLODE) {
str = killer.name;
- do_hallu = Hallucination && strstri(str, "'s explosion");
+ do_hallu = (Hallucination
+ && (strstri(str, "'s explosion")
+ || strstri(str, "s' explosion")));
adtyp = AD_PHYS;
} else
switch (abs(type) % 10) {
-/* NetHack 3.6 mon.c $NHDT-Date: 1502753408 2017/08/14 23:30:08 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.242 $ */
+/* NetHack 3.6 mon.c $NHDT-Date: 1503355818 2017/08/21 22:50:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.243 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
Sprintf(killer.name, "%s explosion", s_suffix(mdat->mname));
killer.format = KILLED_BY_AN;
explode(mon->mx, mon->my, -1, tmp, MON_EXPLODE, EXPL_NOXIOUS);
+ killer.name[0] = '\0';
+ killer.format = 0;
return FALSE;
}
}