fix issue #1459 - Half_physical_damage vs missiles
Issue reported by Tomsod nearly six months ago: missile damage against hero was not honoring the Half_physical_damage attribute when hero had that. Fixes #1459
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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!",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
13
src/trap.c
13
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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user