fix #H172 - inconsistent damage calculation for negative AC
Reported last August by <email deleted>: the code that decided whether hero poly'd into a pudding would be split when being hit by an iron weapon always reduced damage by u.uac if armor class is negative, whereas the normal amount is -rnd(-u.uac). So player pudding with good armor always got maximum reduction. Probably had little actual effect on game play; puddings can't wear armor so would need to be using rings and/or spell of protection and/or have eaten rings of protection while in some previous metallivoric form in order to get good enough AC for this to matter.
This commit is contained in:
@@ -204,6 +204,8 @@ wielded bow shouldn't affect outcome of kicked arrows
|
|||||||
ranged polearm hit can divide puddings and can use confuse monster effect
|
ranged polearm hit can divide puddings and can use confuse monster effect
|
||||||
charge for kicked shop-owned food if it gets used up taming a monster
|
charge for kicked shop-owned food if it gets used up taming a monster
|
||||||
give better feedback when thrown shop-owned food gets used up taming a monster
|
give better feedback when thrown shop-owned food gets used up taming a monster
|
||||||
|
effect of negative AC on damage received was calculated differently than
|
||||||
|
normal when deciding whether hero poly'd into pudding would split
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+18
-14
@@ -930,6 +930,8 @@ hitmu(mtmp, mattk)
|
|||||||
}
|
}
|
||||||
} else { /* hand to hand weapon */
|
} else { /* hand to hand weapon */
|
||||||
if(mattk->aatyp == AT_WEAP && otmp) {
|
if(mattk->aatyp == AT_WEAP && otmp) {
|
||||||
|
int tmp;
|
||||||
|
|
||||||
if (otmp->otyp == CORPSE
|
if (otmp->otyp == CORPSE
|
||||||
&& touch_petrifies(&mons[otmp->corpsenm])) {
|
&& touch_petrifies(&mons[otmp->corpsenm])) {
|
||||||
dmg = 1;
|
dmg = 1;
|
||||||
@@ -949,21 +951,23 @@ hitmu(mtmp, mattk)
|
|||||||
pline_The("silver sears your flesh!");
|
pline_The("silver sears your flesh!");
|
||||||
exercise(A_CON, FALSE);
|
exercise(A_CON, FALSE);
|
||||||
}
|
}
|
||||||
if (u.mh > 1 && u.mh > ((u.uac>0) ? dmg : dmg+u.uac) &&
|
/* this redundancy necessary because you have
|
||||||
objects[otmp->otyp].oc_material == IRON &&
|
to take the damage _before_ being cloned;
|
||||||
(u.umonnum==PM_BLACK_PUDDING
|
need to have at least 2 hp left to split */
|
||||||
|| u.umonnum==PM_BROWN_PUDDING)) {
|
tmp = dmg;
|
||||||
/* This redundancy necessary because you have to
|
if (u.uac < 0) tmp -= rnd(-u.uac);
|
||||||
* take the damage _before_ being cloned.
|
if (tmp < 1) tmp = 1;
|
||||||
*/
|
if (u.mh - tmp > 1 &&
|
||||||
if (u.uac < 0) dmg += u.uac;
|
objects[otmp->otyp].oc_material == IRON &&
|
||||||
if (dmg < 1) dmg = 1;
|
(u.umonnum == PM_BLACK_PUDDING ||
|
||||||
if (dmg > 1) exercise(A_STR, FALSE);
|
u.umonnum == PM_BROWN_PUDDING)) {
|
||||||
u.mh -= dmg;
|
if (tmp > 1) exercise(A_STR, FALSE);
|
||||||
|
/* inflict damage now; we know it can't be fatal */
|
||||||
|
u.mh -= tmp;
|
||||||
context.botl = 1;
|
context.botl = 1;
|
||||||
dmg = 0;
|
dmg = 0; /* don't inflict more damage below */
|
||||||
if(cloneu())
|
if (cloneu())
|
||||||
You("divide as %s hits you!",mon_nam(mtmp));
|
You("divide as %s hits you!", mon_nam(mtmp));
|
||||||
}
|
}
|
||||||
urustm(mtmp, otmp);
|
urustm(mtmp, otmp);
|
||||||
} else if (mattk->aatyp != AT_TUCH || dmg != 0 ||
|
} else if (mattk->aatyp != AT_TUCH || dmg != 0 ||
|
||||||
|
|||||||
Reference in New Issue
Block a user