silver vs poly'd hero (trunk only)
<Someone> reported that thitu() was adding d20 damage for silver object hitting silver-hating hero even though all the callers were using dmgval() which also does that, resulting in doubled silver bonus/penalty. This fixes that (including for boomerangs thrown by player, which weren't using dmgval(), to handle a hyptothetical silver boomerang). While testing it, I noticed that there was no "the silver sears your flesh" message when a monster hit you with a wielded silver weapon, so this fixes that too. (How did we miss that? And how did <Someone>? :-)
This commit is contained in:
@@ -134,6 +134,8 @@ eating gold in front of the vault guard will make the guard angry
|
|||||||
calculate engulf time differently for non-digestion attacks than for digestion
|
calculate engulf time differently for non-digestion attacks than for digestion
|
||||||
preform autopickup and/or report on objects at the spot when a failed #untrap
|
preform autopickup and/or report on objects at the spot when a failed #untrap
|
||||||
attempt causes the hero to move onto a trap's location
|
attempt causes the hero to move onto a trap's location
|
||||||
|
thrown silver weapon hitting silver-hating poly'd hero got double silver damage
|
||||||
|
wielded silver weapon hitting silver-hating poly'd hero lacked silver message
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
@@ -2507,7 +2507,7 @@ E void FDECL(hit, (const char *,struct monst *,const char *));
|
|||||||
E void FDECL(miss, (const char *,struct monst *));
|
E void FDECL(miss, (const char *,struct monst *));
|
||||||
E struct monst *FDECL(bhit, (int,int,int,int,int (*)(MONST_P,OBJ_P),
|
E struct monst *FDECL(bhit, (int,int,int,int,int (*)(MONST_P,OBJ_P),
|
||||||
int (*)(OBJ_P,OBJ_P),struct obj **));
|
int (*)(OBJ_P,OBJ_P),struct obj **));
|
||||||
E struct monst *FDECL(boomhit, (int,int));
|
E struct monst *FDECL(boomhit, (struct obj *,int,int));
|
||||||
E int FDECL(burn_floor_paper, (int,int,BOOLEAN_P,BOOLEAN_P));
|
E int FDECL(burn_floor_paper, (int,int,BOOLEAN_P,BOOLEAN_P));
|
||||||
E void FDECL(buzz, (int,int,XCHAR_P,XCHAR_P,int,int));
|
E void FDECL(buzz, (int,int,XCHAR_P,XCHAR_P,int,int));
|
||||||
E void FDECL(melt_ice, (XCHAR_P,XCHAR_P,const char *));
|
E void FDECL(melt_ice, (XCHAR_P,XCHAR_P,const char *));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)dothrow.c 3.5 2005/12/02 */
|
/* SCCS Id: @(#)dothrow.c 3.5 2006/04/05 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -949,7 +949,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
|
|||||||
} else if(obj->otyp == BOOMERANG && !Underwater) {
|
} else if(obj->otyp == BOOMERANG && !Underwater) {
|
||||||
if(Is_airlevel(&u.uz) || Levitation)
|
if(Is_airlevel(&u.uz) || Levitation)
|
||||||
hurtle(-u.dx, -u.dy, 1, TRUE);
|
hurtle(-u.dx, -u.dy, 1, TRUE);
|
||||||
mon = boomhit(u.dx, u.dy);
|
mon = boomhit(obj, u.dx, u.dy);
|
||||||
if(mon == &youmonst) { /* the thing was caught */
|
if(mon == &youmonst) { /* the thing was caught */
|
||||||
exercise(A_DEX, TRUE);
|
exercise(A_DEX, TRUE);
|
||||||
obj = addinv(obj);
|
obj = addinv(obj);
|
||||||
|
|||||||
@@ -940,6 +940,9 @@ hitmu(mtmp, mattk)
|
|||||||
artifact_hit(mtmp, &youmonst, otmp, &dmg,dieroll)))
|
artifact_hit(mtmp, &youmonst, otmp, &dmg,dieroll)))
|
||||||
hitmsg(mtmp, mattk);
|
hitmsg(mtmp, mattk);
|
||||||
if (!dmg) break;
|
if (!dmg) break;
|
||||||
|
if (objects[otmp->otyp].oc_material == SILVER &&
|
||||||
|
hates_silver(youmonst.data))
|
||||||
|
pline_The("silver sears your flesh!");
|
||||||
if (u.mh > 1 && u.mh > ((u.uac>0) ? dmg : dmg+u.uac) &&
|
if (u.mh > 1 && u.mh > ((u.uac>0) ? dmg : dmg+u.uac) &&
|
||||||
objects[otmp->otyp].oc_material == IRON &&
|
objects[otmp->otyp].oc_material == IRON &&
|
||||||
(u.umonnum==PM_BLACK_PUDDING
|
(u.umonnum==PM_BLACK_PUDDING
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const char *name; /* if null, then format `obj' */
|
|||||||
|
|
||||||
if (obj && objects[obj->otyp].oc_material == SILVER
|
if (obj && objects[obj->otyp].oc_material == SILVER
|
||||||
&& hates_silver(youmonst.data)) {
|
&& hates_silver(youmonst.data)) {
|
||||||
dam += rnd(20);
|
/* extra damage already applied by dmgval() */
|
||||||
pline_The("silver sears your flesh!");
|
pline_The("silver sears your flesh!");
|
||||||
exercise(A_CON, FALSE);
|
exercise(A_CON, FALSE);
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/zap.c
10
src/zap.c
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)zap.c 3.5 2006/01/30 */
|
/* SCCS Id: @(#)zap.c 3.5 2006/04/05 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -3010,7 +3010,8 @@ struct obj **pobj; /* object tossed/used, set to NULL
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct monst *
|
struct monst *
|
||||||
boomhit(dx, dy)
|
boomhit(obj, dx, dy)
|
||||||
|
struct obj *obj;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
{
|
{
|
||||||
register int i, ct;
|
register int i, ct;
|
||||||
@@ -3045,8 +3046,9 @@ int dx, dy;
|
|||||||
if(bhitpos.x == u.ux && bhitpos.y == u.uy) { /* ct == 9 */
|
if(bhitpos.x == u.ux && bhitpos.y == u.uy) { /* ct == 9 */
|
||||||
if(Fumbling || rn2(20) >= ACURR(A_DEX)) {
|
if(Fumbling || rn2(20) >= ACURR(A_DEX)) {
|
||||||
/* we hit ourselves */
|
/* we hit ourselves */
|
||||||
(void) thitu(10, rnd(10), (struct obj *)0,
|
(void) thitu(10 + obj->spe,
|
||||||
"boomerang");
|
dmgval(obj, &youmonst),
|
||||||
|
obj, "boomerang");
|
||||||
break;
|
break;
|
||||||
} else { /* we catch it */
|
} else { /* we catch it */
|
||||||
tmp_at(DISP_END, 0);
|
tmp_at(DISP_END, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user