fix #H1554, #H1736, github issue #240 - silver )

Fixes #240

Monster versus monster (melee and throwing) didn't handle shades
(need silver or blessed weapon to take damage) or silver feedback
(extra info when silver-haters are hit).

I did a lot of test, revise, re-test but didn't always re-test
everything that had previously been tested, so bugs that I thought
were quashed might have crept in.

Now if a missile weapon "passes harmlessly through the shade" it
will continue on and maybe hit something else.  (Regular misses
still stop at the missed target.)

A couple of minor ball&chain changes accidentally got included.
This commit is contained in:
PatR
2019-11-13 15:47:46 -08:00
parent 55bac90292
commit f3a923d647
8 changed files with 187 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mhitu.c $NHDT-Date: 1562800504 2019/07/10 23:15:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.166 $ */
/* NetHack 3.6 mhitu.c $NHDT-Date: 1573688693 2019/11/13 23:44:53 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.167 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1793,8 +1793,7 @@ struct attack *mattk;
if (!engulf_target(mtmp, &youmonst))
return 0;
if ((t && is_pit(t->ttyp))
&& sobj_at(BOULDER, u.ux, u.uy))
if ((t && is_pit(t->ttyp)) && sobj_at(BOULDER, u.ux, u.uy))
return 0;
if (Punished)
@@ -1877,6 +1876,14 @@ struct attack *mattk;
if (mtmp != u.ustuck)
return 0;
if (Punished) {
/* ball&chain are in limbo while swallowed; update their internal
location to be at swallower's spot */
if (uchain->where == OBJ_FREE)
uchain->ox = mtmp->mx, uchain->oy = mtmp->my;
if (uball->where == OBJ_FREE)
uball->ox = mtmp->mx, uball->oy = mtmp->my;
}
if (u.uswldtim > 0)
u.uswldtim -= 1;