fix #H6104 - no potion handling in thitu()

thitu() is mostly used for arrows and darts "thrown" by traps, but
scatter() uses it on items launched by a land mine explosion.  Traps
had no need for potion handling, but scattering does.  Changing thitu()
to call potionhit() required that more information be passed to the
latter in case killer reason was needed, and thitu()'s callers needed
to be updated since it now might use up its missile (only when that's
a potion, so scatter() is only caller which actually needed to care).

Quite a bit of work--especially the testing--for something which will
never be noticed in actual play.  In hindsight, it would have been
much simpler just to make scatter destroy all potions rather than
allow the 1% chance of remaining intact (via obj_resists()), or else
leave any intact ones at the explosion spot instead of launching them.
This commit is contained in:
PatR
2017-09-25 10:42:43 -07:00
parent 596bc64341
commit 719af503e7
11 changed files with 79 additions and 53 deletions

View File

@@ -40,7 +40,7 @@ struct obj {
unsigned owt;
long quan; /* number of items */
schar spe; /* quality of weapon, armor or ring (+ or -);
schar spe; /* quality of weapon, weptool, armor or ring (+ or -);
number of charges for wand or charged tool ( >= -1 );
marks your eggs, tin variety and spinach tins;
Schroedinger's Box (1) or royal coffers for a court (2);
@@ -373,6 +373,12 @@ struct obj {
#define ER_DAMAGED 2 /* object was damaged in some way */
#define ER_DESTROYED 3 /* object was destroyed */
/* propeller method for potionhit() */
#define POTHIT_HERO_BASH 0 /* wielded by hero */
#define POTHIT_HERO_THROW 1 /* thrown by hero */
#define POTHIT_MONST_THROW 2 /* thrown by a monster */
#define POTHIT_OTHER_THROW 3 /* propelled by some other means [scatter()] */
/*
* Notes for adding new oextra structures:
*