add extended command #kick
when choosing an inventory item and '-' for bare-hands/fingers/no-ammo is a
choice, include that in the inventory menu if player types '?' or '*'
+feedback from probing of long worm now includes number of segments it has
Platform- and/or Interface-Specific New Features
-/* NetHack 3.6 extern.h $NHDT-Date: 1455672983 2016/02/17 01:36:23 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.548 $ */
+/* NetHack 3.6 extern.h $NHDT-Date: 1456528594 2016/02/26 23:16:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.549 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
E int FDECL(count_wsegs, (struct monst *));
E boolean FDECL(worm_known, (struct monst *));
E boolean FDECL(worm_cross, (int, int, int, int));
+E int FDECL(wseg_at, (struct monst *, int, int));
/* ### worn.c ### */
-/* NetHack 3.6 apply.c $NHDT-Date: 1456526104 2016/02/26 22:35:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.221 $ */
+/* NetHack 3.6 apply.c $NHDT-Date: 1456528594 2016/02/26 23:16:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.222 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
context.stethoscope_move = moves;
context.stethoscope_movement = youmonst.movement;
+ bhitpos.x = u.ux, bhitpos.y = u.uy; /* tentative, reset below */
+ notonhead = u.uswallow;
if (u.usteed && u.dz > 0) {
if (interference) {
pline("%s interferes.", Monnam(u.ustuck));
const char *mnm = x_monnam(mtmp, ARTICLE_A, (const char *) 0,
SUPPRESS_IT | SUPPRESS_INVISIBLE, FALSE);
+ /* bhitpos needed by mstatusline() iff mtmp is a long worm */
+ bhitpos.x = rx, bhitpos.y = ry;
+ notonhead = (mtmp->mx != rx || mtmp->my != ry);
+
if (mtmp->mundetected) {
if (!canspotmon(mtmp))
There("is %s hidden there.", mnm);
} else if (flags.verbose && !canspotmon(mtmp)) {
There("is %s there.", mnm);
}
+
mstatusline(mtmp);
if (!canspotmon(mtmp))
map_invisible(rx, ry);
newsym(rx, ry);
pline_The("invisible monster must have moved.");
}
+
lev = &levl[rx][ry];
switch (lev->typ) {
case SDOOR:
-/* NetHack 3.6 pline.c $NHDT-Date: 1455672995 2016/02/17 01:36:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.48 $ */
+/* NetHack 3.6 pline.c $NHDT-Date: 1456528597 2016/02/26 23:16:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.49 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
}
} else if (mtmp->mpeaceful)
Strcat(info, ", peaceful");
+
+ if (mtmp->data == &mons[PM_LONG_WORM]) {
+ int segndx, nsegs = count_wsegs(mtmp);
+
+ /* the worm code internals don't consider the head of be one of
+ the worm's segments, but we count it as such when presenting
+ worm feedback to the player */
+ if (!nsegs) {
+ Strcat(info, ", single segment");
+ } else {
+ ++nsegs; /* include head in the segment count */
+ segndx = wseg_at(mtmp, bhitpos.x, bhitpos.y);
+ Sprintf(eos(info), ", %d%s of %d segments",
+ segndx, ordin(segndx), nsegs);
+ }
+ }
if (mtmp->cham >= LOW_PM && mtmp->data != &mons[mtmp->cham])
/* don't reveal the innate form (chameleon, vampire, &c),
just expose the fact that this current form isn't it */
-/* NetHack 3.6 worm.c $NHDT-Date: 1446887540 2015/11/07 09:12:20 $ $NHDT-Branch: master $:$NHDT-Revision: 1.19 $ */
+/* NetHack 3.6 worm.c $NHDT-Date: 1456528599 2016/02/26 23:16:39 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.20 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
while (new_wormno < MAX_NUM_WORMS) {
if (!wheads[new_wormno])
- return new_wormno; /* found an empty wtails[] slot at new_wormno
- */
+ return new_wormno; /* found empty wtails[] slot at new_wormno */
new_wormno++;
}
-
return 0; /* level infested with worms */
}
/* if (!wnum) return; bullet proofing */
/* This does not work right now because mattacku() thinks that the head
- * is
- * out of range of the player. We might try to kludge, and bring the
- * head
- * within range for a tiny moment, but this needs a bit more looking at
- * before we decide to do this.
+ * is out of range of the player. We might try to kludge, and bring
+ * the head within range for a tiny moment, but this needs a bit more
+ * looking at before we decide to do this.
*/
for (seg = wtails[wnum]; seg; seg = seg->nseg)
if (distu(seg->wx, seg->wy) < 3)
* it's head at "curr" and its tail at "new_tail". The old worm
* must be at least level 3 in order to produce a new worm.
*/
-
new_worm = 0;
new_wnum = (worm->m_lev >= 3 && !rn2(3)) ? get_wormno() : 0;
if (new_wnum) {
}
/* count_wsegs()
- * returns the number of visible segments that a worm has.
+ * returns the number of segments that a worm has.
*/
int
count_wsegs(mtmp)
struct monst *mtmp;
{
register int i = 0;
- register struct wseg *curr = (wtails[mtmp->wormno])->nseg;
+ register struct wseg *curr;
- /* if (!mtmp->wormno) return 0; bullet proofing */
-
- while (curr) {
- i++;
- curr = curr->nseg;
+ if (mtmp->wormno) {
+ for (curr = wtails[mtmp->wormno]->nseg; curr; curr = curr->nseg)
+ i++;
}
-
return i;
}
return FALSE;
}
+/* construct an index number for a worm tail segment */
+int
+wseg_at(worm, x, y)
+struct monst *worm;
+int x, y;
+{
+ int res = 0;
+
+ if (worm && worm->wormno && m_at(x, y) == worm) {
+ struct wseg *curr;
+ int i, n;
+ xchar wx = (xchar) x, wy = (xchar) y;
+
+ for (i = 0, curr = wtails[worm->wormno]; curr; curr = curr->nseg) {
+ if (curr->wx == wx && curr->wy == wy)
+ break;
+ ++i;
+ }
+ for (n = i; curr; curr = curr->nseg)
+ ++n;
+ res = n - i;
+ }
+ return res;
+}
+
/*worm.c*/
-/* NetHack 3.6 zap.c $NHDT-Date: 1449669396 2015/12/09 13:56:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.238 $ */
+/* NetHack 3.6 zap.c $NHDT-Date: 1456528600 2016/02/26 23:16:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.247 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
STATIC_VAR const char are_blinded_by_the_flash[] =
"are blinded by the flash!";
-const char *const flash_types[] =
- { /* also used in buzzmu(mcastu.c) */
- "magic missile", /* Wands must be 0-9 */
- "bolt of fire", "bolt of cold", "sleep ray", "death ray",
- "bolt of lightning", "", "", "", "",
-
- "magic missile", /* Spell equivalents must be 10-19 */
- "fireball", "cone of cold", "sleep ray", "finger of death",
- "bolt of lightning", /* There is no spell, used for retribution */
- "", "", "", "",
-
- "blast of missiles", /* Dragon breath equivalents 20-29*/
- "blast of fire", "blast of frost", "blast of sleep gas",
- "blast of disintegration", "blast of lightning", "blast of poison gas",
- "blast of acid", "", ""
+const char *const flash_types[] = /* also used in buzzmu(mcastu.c) */
+ {
+ "magic missile", /* Wands must be 0-9 */
+ "bolt of fire", "bolt of cold", "sleep ray", "death ray",
+ "bolt of lightning", "", "", "", "",
+
+ "magic missile", /* Spell equivalents must be 10-19 */
+ "fireball", "cone of cold", "sleep ray", "finger of death",
+ "bolt of lightning", /* there is no spell, used for retribution */
+ "", "", "", "",
+
+ "blast of missiles", /* Dragon breath equivalents 20-29*/
+ "blast of fire", "blast of frost", "blast of sleep gas",
+ "blast of disintegration", "blast of lightning",
+ "blast of poison gas", "blast of acid", "", ""
};
/*
int dmg, otyp = otmp->otyp;
const char *zap_type_text = "spell";
struct obj *obj;
- boolean disguised_mimic =
- (mtmp->data->mlet == S_MIMIC && mtmp->m_ap_type != M_AP_NOTHING);
+ boolean disguised_mimic = (mtmp->data->mlet == S_MIMIC
+ && mtmp->m_ap_type != M_AP_NOTHING);
if (u.uswallow && mtmp == u.ustuck)
reveal_invis = FALSE;
+ notonhead = (mtmp->mx != bhitpos.x || mtmp->my != bhitpos.y);
switch (otyp) {
case WAN_STRIKING:
zap_type_text = "wand";
{
int steedhit = FALSE;
+ bhitpos.x = u.usteed->mx, bhitpos.y = u.usteed->my;
+ notonhead = FALSE;
switch (obj->otyp) {
/*
* Wands that are allowed to hit the steed
if (type >= 0)
mon->mstrategy &= ~STRAT_WAITMASK;
buzzmonst:
+ notonhead = (mon->mx != bhitpos.x || mon->my != bhitpos.y);
if (zap_hit(find_mac(mon), spell_type)) {
if (mon_reflects(mon, (char *) 0)) {
if (cansee(mon->mx, mon->my)) {