diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index b4078d700..e7e375504 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2203,6 +2203,7 @@ mounted hero was able to deliver joust hits when trapped timer sanity check for melting ice gave false complaint about non-ice for frozen moat under open drawbridge mhitm_ad_phys() was not applying Half_physical_damage when hero was target +callers of thitu() were not applyibg Half_physical_damage either throwing crystal plate mail or helm of brilliance up against the ceiling could result in the item being cracked and then vanishing yn_function (used all over the place) sometimes triggered an impossible() diff --git a/src/apply.c b/src/apply.c index 0fa915a42..40aefc3d9 100644 --- a/src/apply.c +++ b/src/apply.c @@ -3190,10 +3190,11 @@ use_whip(struct obj *obj) if (!rn2(25)) { /* proficient with whip, but maybe not so proficient at catching weapons */ - int hitu, hitvalu; + int dam, hitvalu, hitu; + dam = dmgval(otmp, &gy.youmonst); hitvalu = 8 + otmp->spe; - hitu = thitu(hitvalu, dmgval(otmp, &gy.youmonst), + hitu = thitu(hitvalu, Maybe_Half_Phys(dam), &otmp, (char *) 0); if (hitu) { pline_The("%s hits you as you try to snatch it!", diff --git a/src/explode.c b/src/explode.c index 36c3aca59..70f4c8307 100644 --- a/src/explode.c +++ b/src/explode.c @@ -718,10 +718,11 @@ struct scatter_chain { /* returns number of scattered objects */ long -scatter(coordxy sx, coordxy sy, /* location of objects to scatter */ - int blastforce, /* force behind the scattering */ - unsigned int scflags, - struct obj *obj) /* only scatter this obj */ +scatter( + coordxy sx, coordxy sy, /* location of objects to scatter */ + int blastforce, /* force behind the scattering */ + unsigned int scflags, + struct obj *obj) /* only scatter this obj */ { struct obj *otmp; int tmp; @@ -864,14 +865,15 @@ scatter(coordxy sx, coordxy sy, /* location of objects to scatter */ } } else if (u_at(gb.bhitpos.x, gb.bhitpos.y)) { if (scflags & MAY_HITYOU) { - int hitvalu, hitu; + int dam, hitvalu, hitu; if (gm.multi) nomul(0); + dam = dmgval(stmp->obj, &gy.youmonst); hitvalu = 8 + stmp->obj->spe; if (bigmonst(gy.youmonst.data)) hitvalu++; - hitu = thitu(hitvalu, dmgval(stmp->obj, &gy.youmonst), + hitu = thitu(hitvalu, Maybe_Half_Phys(dam), &stmp->obj, (char *) 0); if (!stmp->obj) stmp->stopped = TRUE; diff --git a/src/mthrowu.c b/src/mthrowu.c index 24001738a..1e9a299c6 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -93,7 +93,7 @@ thitu( kprefix = KILLED_BY; /* killer_name supplies "an" if warranted */ } else { knm = name; - /* [perhaps ought to check for plural here to] */ + /* [perhaps ought to check for plural here too] */ if (!strncmpi(name, "the ", 4) || !strncmpi(name, "an ", 3) || !strncmpi(name, "a ", 2)) kprefix = KILLED_BY; diff --git a/src/trap.c b/src/trap.c index 630334228..c6b5d7227 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1193,6 +1193,7 @@ trapeffect_arrow_trap( unsigned trflags UNUSED) { struct obj *otmp; + int dam; if (mtmp == &gy.youmonst) { if (trap->once && trap->tseen && !rn2(15)) { @@ -1206,9 +1207,10 @@ trapeffect_arrow_trap( seetrap(trap); pline("An arrow shoots out at you!"); otmp = t_missile(ARROW, trap); + dam = dmgval(otmp, &gy.youmonst); if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) { ; /* nothing */ - } else if (thitu(8, dmgval(otmp, &gy.youmonst), &otmp, "arrow")) { + } else if (thitu(8, Maybe_Half_Phys(dam), &otmp, "arrow")) { if (otmp) obfree(otmp, (struct obj *) 0); } else { @@ -1252,6 +1254,7 @@ trapeffect_dart_trap( unsigned int trflags UNUSED) { struct obj *otmp; + int dam; if (mtmp == &gy.youmonst) { int oldumort = u.umortality; @@ -1269,10 +1272,10 @@ trapeffect_dart_trap( otmp = t_missile(DART, trap); if (!rn2(6)) otmp->opoisoned = 1; + dam = dmgval(otmp, &gy.youmonst); if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) { ; /* nothing */ - } else if (thitu(7, dmgval(otmp, &gy.youmonst), - &otmp, "little dart")) { + } else if (thitu(7, Maybe_Half_Phys(dam), &otmp, "little dart")) { if (otmp) { if (otmp->opoisoned) poisoned("dart", A_CON, "little dart", @@ -3395,9 +3398,11 @@ launch_obj( break; } } else if (u_at(x, y)) { + int dam = dmgval(singleobj, &gy.youmonst); + if (gm.multi) nomul(0); - if (thitu(9 + singleobj->spe, dmgval(singleobj, &gy.youmonst), + if (thitu(9 + singleobj->spe, Maybe_Half_Phys(dam), &singleobj, (char *) 0)) stop_occupation(); } diff --git a/src/zap.c b/src/zap.c index ac6d8e760..bdaa54cec 100644 --- a/src/zap.c +++ b/src/zap.c @@ -4201,8 +4201,10 @@ boomhit(struct obj *obj, int dx, int dy) } if (u_at(gb.bhitpos.x, gb.bhitpos.y)) { /* ct == 9 */ if (Fumbling || rn2(20) >= ACURR(A_DEX)) { + int dam = dmgval(obj, &gy.youmonst); + /* we hit ourselves */ - (void) thitu(10 + obj->spe, dmgval(obj, &gy.youmonst), &obj, + (void) thitu(10 + obj->spe, Maybe_Half_Phys(dam), &obj, "boomerang"); endmultishot(TRUE); break;