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:
@@ -446,6 +446,8 @@ fix buffer overflow in wizard mode for '#' command when 'extmenu' option is on
|
|||||||
fix mention_walls reporting secret doors as solid walls
|
fix mention_walls reporting secret doors as solid walls
|
||||||
corpses and other flammable items not subject to direct burning or fire-based
|
corpses and other flammable items not subject to direct burning or fire-based
|
||||||
erosion which were thrown or dropped into lava remained intact
|
erosion which were thrown or dropped into lava remained intact
|
||||||
|
if a potion on the floor survived a land mine explosion and got propelled at
|
||||||
|
the hero, it didn't behave like a potion if it hit
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
+2
-2
@@ -1533,7 +1533,7 @@ E void FDECL(Delay, (int));
|
|||||||
|
|
||||||
/* ### mthrowu.c ### */
|
/* ### mthrowu.c ### */
|
||||||
|
|
||||||
E int FDECL(thitu, (int, int, struct obj *, const char *));
|
E int FDECL(thitu, (int, int, struct obj **, const char *));
|
||||||
E int FDECL(ohitmon, (struct monst *, struct obj *, int, BOOLEAN_P));
|
E int FDECL(ohitmon, (struct monst *, struct obj *, int, BOOLEAN_P));
|
||||||
E void FDECL(thrwmu, (struct monst *));
|
E void FDECL(thrwmu, (struct monst *));
|
||||||
E int FDECL(spitmu, (struct monst *, struct attack *));
|
E int FDECL(spitmu, (struct monst *, struct attack *));
|
||||||
@@ -1883,7 +1883,7 @@ E int FDECL(dopotion, (struct obj *));
|
|||||||
E int FDECL(peffects, (struct obj *));
|
E int FDECL(peffects, (struct obj *));
|
||||||
E void FDECL(healup, (int, int, BOOLEAN_P, BOOLEAN_P));
|
E void FDECL(healup, (int, int, BOOLEAN_P, BOOLEAN_P));
|
||||||
E void FDECL(strange_feeling, (struct obj *, const char *));
|
E void FDECL(strange_feeling, (struct obj *, const char *));
|
||||||
E void FDECL(potionhit, (struct monst *, struct obj *, BOOLEAN_P));
|
E void FDECL(potionhit, (struct monst *, struct obj *, int));
|
||||||
E void FDECL(potionbreathe, (struct obj *));
|
E void FDECL(potionbreathe, (struct obj *));
|
||||||
E int NDECL(dodip);
|
E int NDECL(dodip);
|
||||||
E void FDECL(mongrantswish, (struct monst **));
|
E void FDECL(mongrantswish, (struct monst **));
|
||||||
|
|||||||
+7
-1
@@ -40,7 +40,7 @@ struct obj {
|
|||||||
unsigned owt;
|
unsigned owt;
|
||||||
long quan; /* number of items */
|
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 );
|
number of charges for wand or charged tool ( >= -1 );
|
||||||
marks your eggs, tin variety and spinach tins;
|
marks your eggs, tin variety and spinach tins;
|
||||||
Schroedinger's Box (1) or royal coffers for a court (2);
|
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_DAMAGED 2 /* object was damaged in some way */
|
||||||
#define ER_DESTROYED 3 /* object was destroyed */
|
#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:
|
* Notes for adding new oextra structures:
|
||||||
*
|
*
|
||||||
|
|||||||
+2
-3
@@ -2786,9 +2786,8 @@ struct obj *obj;
|
|||||||
int hitu, hitvalu;
|
int hitu, hitvalu;
|
||||||
|
|
||||||
hitvalu = 8 + otmp->spe;
|
hitvalu = 8 + otmp->spe;
|
||||||
hitu = thitu(hitvalu,
|
hitu = thitu(hitvalu, dmgval(otmp, &youmonst),
|
||||||
dmgval(otmp, &youmonst),
|
&otmp, (char *)0);
|
||||||
otmp, (char *)0);
|
|
||||||
if (hitu) {
|
if (hitu) {
|
||||||
pline_The("%s hits you as you try to snatch it!",
|
pline_The("%s hits you as you try to snatch it!",
|
||||||
the(onambuf));
|
the(onambuf));
|
||||||
|
|||||||
+3
-3
@@ -884,7 +884,7 @@ boolean hitsroof;
|
|||||||
/* object now hits you */
|
/* object now hits you */
|
||||||
|
|
||||||
if (obj->oclass == POTION_CLASS) {
|
if (obj->oclass == POTION_CLASS) {
|
||||||
potionhit(&youmonst, obj, TRUE);
|
potionhit(&youmonst, obj, POTHIT_HERO_THROW);
|
||||||
} else if (breaktest(obj)) {
|
} else if (breaktest(obj)) {
|
||||||
int otyp = obj->otyp;
|
int otyp = obj->otyp;
|
||||||
int blindinc;
|
int blindinc;
|
||||||
@@ -1086,7 +1086,7 @@ boolean
|
|||||||
&& rn2(6)) {
|
&& rn2(6)) {
|
||||||
/* alternative to prayer or wand of opening/spell of knock
|
/* alternative to prayer or wand of opening/spell of knock
|
||||||
for dealing with cursed saddle: throw holy water > */
|
for dealing with cursed saddle: throw holy water > */
|
||||||
potionhit(u.usteed, obj, TRUE);
|
potionhit(u.usteed, obj, POTHIT_HERO_THROW);
|
||||||
} else {
|
} else {
|
||||||
hitfloor(obj);
|
hitfloor(obj);
|
||||||
}
|
}
|
||||||
@@ -1614,7 +1614,7 @@ register struct obj *obj; /* thrownobj or kickedobj or uwep */
|
|||||||
|
|
||||||
} else if (obj->oclass == POTION_CLASS
|
} else if (obj->oclass == POTION_CLASS
|
||||||
&& (guaranteed_hit || ACURR(A_DEX) > rnd(25))) {
|
&& (guaranteed_hit || ACURR(A_DEX) > rnd(25))) {
|
||||||
potionhit(mon, obj, TRUE);
|
potionhit(mon, obj, POTHIT_HERO_THROW);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
} else if (befriend_with_obj(mon->data, obj)
|
} else if (befriend_with_obj(mon->data, obj)
|
||||||
|
|||||||
+8
-7
@@ -570,7 +570,7 @@ struct obj *obj; /* only scatter this obj */
|
|||||||
struct scatter_chain *schain = (struct scatter_chain *) 0;
|
struct scatter_chain *schain = (struct scatter_chain *) 0;
|
||||||
long total = 0L;
|
long total = 0L;
|
||||||
|
|
||||||
while ((otmp = individual_object ? obj : level.objects[sx][sy]) != 0) {
|
while ((otmp = (individual_object ? obj : level.objects[sx][sy])) != 0) {
|
||||||
if (otmp->quan > 1L) {
|
if (otmp->quan > 1L) {
|
||||||
qtmp = otmp->quan - 1L;
|
qtmp = otmp->quan - 1L;
|
||||||
if (qtmp > LARGEST_INT)
|
if (qtmp > LARGEST_INT)
|
||||||
@@ -584,8 +584,8 @@ struct obj *obj; /* only scatter this obj */
|
|||||||
used_up = FALSE;
|
used_up = FALSE;
|
||||||
|
|
||||||
/* 9 in 10 chance of fracturing boulders or statues */
|
/* 9 in 10 chance of fracturing boulders or statues */
|
||||||
if ((scflags & MAY_FRACTURE)
|
if ((scflags & MAY_FRACTURE) != 0
|
||||||
&& ((otmp->otyp == BOULDER) || (otmp->otyp == STATUE))
|
&& (otmp->otyp == BOULDER || otmp->otyp == STATUE)
|
||||||
&& rn2(10)) {
|
&& rn2(10)) {
|
||||||
if (otmp->otyp == BOULDER) {
|
if (otmp->otyp == BOULDER) {
|
||||||
if (cansee(sx, sy))
|
if (cansee(sx, sy))
|
||||||
@@ -614,7 +614,7 @@ struct obj *obj; /* only scatter this obj */
|
|||||||
used_up = TRUE;
|
used_up = TRUE;
|
||||||
|
|
||||||
/* 1 in 10 chance of destruction of obj; glass, egg destruction */
|
/* 1 in 10 chance of destruction of obj; glass, egg destruction */
|
||||||
} else if ((scflags & MAY_DESTROY)
|
} else if ((scflags & MAY_DESTROY) != 0
|
||||||
&& (!rn2(10) || (objects[otmp->otyp].oc_material == GLASS
|
&& (!rn2(10) || (objects[otmp->otyp].oc_material == GLASS
|
||||||
|| otmp->otyp == EGG))) {
|
|| otmp->otyp == EGG))) {
|
||||||
if (breaks(otmp, (xchar) sx, (xchar) sy))
|
if (breaks(otmp, (xchar) sx, (xchar) sy))
|
||||||
@@ -622,8 +622,7 @@ struct obj *obj; /* only scatter this obj */
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!used_up) {
|
if (!used_up) {
|
||||||
stmp = (struct scatter_chain *)
|
stmp = (struct scatter_chain *) alloc(sizeof *stmp);
|
||||||
alloc(sizeof (struct scatter_chain));
|
|
||||||
stmp->next = (struct scatter_chain *) 0;
|
stmp->next = (struct scatter_chain *) 0;
|
||||||
stmp->obj = otmp;
|
stmp->obj = otmp;
|
||||||
stmp->ox = sx;
|
stmp->ox = sx;
|
||||||
@@ -679,7 +678,9 @@ struct obj *obj; /* only scatter this obj */
|
|||||||
if (bigmonst(youmonst.data))
|
if (bigmonst(youmonst.data))
|
||||||
hitvalu++;
|
hitvalu++;
|
||||||
hitu = thitu(hitvalu, dmgval(stmp->obj, &youmonst),
|
hitu = thitu(hitvalu, dmgval(stmp->obj, &youmonst),
|
||||||
stmp->obj, (char *) 0);
|
&stmp->obj, (char *) 0);
|
||||||
|
if (!stmp->obj)
|
||||||
|
stmp->stopped = TRUE;
|
||||||
if (hitu) {
|
if (hitu) {
|
||||||
stmp->range -= 3;
|
stmp->range -= 3;
|
||||||
stop_occupation();
|
stop_occupation();
|
||||||
|
|||||||
+27
-18
@@ -29,11 +29,12 @@ extern boolean notonhead; /* for long worms */
|
|||||||
|
|
||||||
/* hero is hit by something other than a monster */
|
/* hero is hit by something other than a monster */
|
||||||
int
|
int
|
||||||
thitu(tlev, dam, obj, name)
|
thitu(tlev, dam, objp, name)
|
||||||
int tlev, dam;
|
int tlev, dam;
|
||||||
struct obj *obj;
|
struct obj **objp;
|
||||||
const char *name; /* if null, then format `obj' */
|
const char *name; /* if null, then format `*objp' */
|
||||||
{
|
{
|
||||||
|
struct obj *obj = objp ? *objp : 0;
|
||||||
const char *onm, *knm;
|
const char *onm, *knm;
|
||||||
boolean is_acid;
|
boolean is_acid;
|
||||||
int kprefix = KILLED_BY_AN;
|
int kprefix = KILLED_BY_AN;
|
||||||
@@ -42,8 +43,8 @@ const char *name; /* if null, then format `obj' */
|
|||||||
if (!name) {
|
if (!name) {
|
||||||
if (!obj)
|
if (!obj)
|
||||||
panic("thitu: name & obj both null?");
|
panic("thitu: name & obj both null?");
|
||||||
name =
|
name = strcpy(onmbuf,
|
||||||
strcpy(onmbuf, (obj->quan > 1L) ? doname(obj) : mshot_xname(obj));
|
(obj->quan > 1L) ? doname(obj) : mshot_xname(obj));
|
||||||
knm = strcpy(knmbuf, killer_xname(obj));
|
knm = strcpy(knmbuf, killer_xname(obj));
|
||||||
kprefix = KILLED_BY; /* killer_name supplies "an" if warranted */
|
kprefix = KILLED_BY; /* killer_name supplies "an" if warranted */
|
||||||
} else {
|
} else {
|
||||||
@@ -70,14 +71,20 @@ const char *name; /* if null, then format `obj' */
|
|||||||
else
|
else
|
||||||
You("are hit by %s%s", onm, exclam(dam));
|
You("are hit by %s%s", onm, exclam(dam));
|
||||||
|
|
||||||
if (obj && objects[obj->otyp].oc_material == SILVER && Hate_silver) {
|
|
||||||
/* extra damage already applied by dmgval() */
|
|
||||||
pline_The("silver sears your flesh!");
|
|
||||||
exercise(A_CON, FALSE);
|
|
||||||
}
|
|
||||||
if (is_acid && Acid_resistance) {
|
if (is_acid && Acid_resistance) {
|
||||||
pline("It doesn't seem to hurt you.");
|
pline("It doesn't seem to hurt you.");
|
||||||
|
} else if (obj && obj->oclass == POTION_CLASS) {
|
||||||
|
/* an explosion which scatters objects might hit hero with one
|
||||||
|
(potions deliberately thrown at hero are handled by m_throw) */
|
||||||
|
potionhit(&youmonst, obj, POTHIT_OTHER_THROW);
|
||||||
|
*objp = obj = 0; /* potionhit() uses up the potion */
|
||||||
} else {
|
} else {
|
||||||
|
if (obj && objects[obj->otyp].oc_material == SILVER
|
||||||
|
&& Hate_silver) {
|
||||||
|
/* extra damage already applied by dmgval() */
|
||||||
|
pline_The("silver sears your flesh!");
|
||||||
|
exercise(A_CON, FALSE);
|
||||||
|
}
|
||||||
if (is_acid)
|
if (is_acid)
|
||||||
pline("It burns!");
|
pline("It burns!");
|
||||||
losehp(dam, knm, kprefix); /* acid damage */
|
losehp(dam, knm, kprefix); /* acid damage */
|
||||||
@@ -110,9 +117,9 @@ int x, y;
|
|||||||
else
|
else
|
||||||
create = 1;
|
create = 1;
|
||||||
|
|
||||||
if (create
|
if (create && !((mtmp = m_at(x, y)) != 0 && mtmp->mtrapped
|
||||||
&& !((mtmp = m_at(x, y)) && (mtmp->mtrapped) && (t = t_at(x, y))
|
&& (t = t_at(x, y)) != 0
|
||||||
&& ((t->ttyp == PIT) || (t->ttyp == SPIKED_PIT)))) {
|
&& (t->ttyp == PIT || t->ttyp == SPIKED_PIT))) {
|
||||||
int objgone = 0;
|
int objgone = 0;
|
||||||
|
|
||||||
if (down_gate(x, y) != -1)
|
if (down_gate(x, y) != -1)
|
||||||
@@ -329,7 +336,9 @@ boolean verbose; /* give message(s) even when you can't see what happened */
|
|||||||
mtmp->msleeping = 0;
|
mtmp->msleeping = 0;
|
||||||
if (vis)
|
if (vis)
|
||||||
otmp->dknown = 1;
|
otmp->dknown = 1;
|
||||||
potionhit(mtmp, otmp, FALSE);
|
/* probably thrown by a monster rather than 'other', but the
|
||||||
|
distinction only matters when hitting the hero */
|
||||||
|
potionhit(mtmp, otmp, POTHIT_OTHER_THROW);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
damage = dmgval(otmp, mtmp);
|
damage = dmgval(otmp, mtmp);
|
||||||
@@ -549,7 +558,7 @@ struct obj *obj; /* missile (or stack providing it) */
|
|||||||
if (singleobj->oclass == POTION_CLASS) {
|
if (singleobj->oclass == POTION_CLASS) {
|
||||||
if (!Blind)
|
if (!Blind)
|
||||||
singleobj->dknown = 1;
|
singleobj->dknown = 1;
|
||||||
potionhit(&youmonst, singleobj, FALSE);
|
potionhit(&youmonst, singleobj, POTHIT_MONST_THROW);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
oldumort = u.umortality;
|
oldumort = u.umortality;
|
||||||
@@ -565,7 +574,7 @@ struct obj *obj; /* missile (or stack providing it) */
|
|||||||
/* fall through */
|
/* fall through */
|
||||||
case CREAM_PIE:
|
case CREAM_PIE:
|
||||||
case BLINDING_VENOM:
|
case BLINDING_VENOM:
|
||||||
hitu = thitu(8, 0, singleobj, (char *) 0);
|
hitu = thitu(8, 0, &singleobj, (char *) 0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dam = dmgval(singleobj, &youmonst);
|
dam = dmgval(singleobj, &youmonst);
|
||||||
@@ -585,7 +594,7 @@ struct obj *obj; /* missile (or stack providing it) */
|
|||||||
hitv += 8 + singleobj->spe;
|
hitv += 8 + singleobj->spe;
|
||||||
if (dam < 1)
|
if (dam < 1)
|
||||||
dam = 1;
|
dam = 1;
|
||||||
hitu = thitu(hitv, dam, singleobj, (char *) 0);
|
hitu = thitu(hitv, dam, &singleobj, (char *) 0);
|
||||||
}
|
}
|
||||||
if (hitu && singleobj->opoisoned && is_poisonable(singleobj)) {
|
if (hitu && singleobj->opoisoned && is_poisonable(singleobj)) {
|
||||||
char onmbuf[BUFSZ], knmbuf[BUFSZ];
|
char onmbuf[BUFSZ], knmbuf[BUFSZ];
|
||||||
@@ -888,7 +897,7 @@ struct monst *mtmp;
|
|||||||
if (dam < 1)
|
if (dam < 1)
|
||||||
dam = 1;
|
dam = 1;
|
||||||
|
|
||||||
(void) thitu(hitv, dam, otmp, (char *) 0);
|
(void) thitu(hitv, dam, &otmp, (char *) 0);
|
||||||
stop_occupation();
|
stop_occupation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-6
@@ -1243,24 +1243,28 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* potion obj hits monster mon, which might be youmounst; obj always use up */
|
||||||
void
|
void
|
||||||
potionhit(mon, obj, your_fault)
|
potionhit(mon, obj, how)
|
||||||
register struct monst *mon;
|
struct monst *mon;
|
||||||
register struct obj *obj;
|
struct obj *obj;
|
||||||
boolean your_fault;
|
int how;
|
||||||
{
|
{
|
||||||
const char *botlnam = bottlename();
|
const char *botlnam = bottlename();
|
||||||
boolean isyou = (mon == &youmonst);
|
boolean isyou = (mon == &youmonst);
|
||||||
int distance, tx, ty;
|
int distance, tx, ty;
|
||||||
struct obj *saddle = (struct obj *) 0;
|
struct obj *saddle = (struct obj *) 0;
|
||||||
boolean hit_saddle = FALSE;
|
boolean hit_saddle = FALSE, your_fault = (how <= POTHIT_HERO_THROW);
|
||||||
|
|
||||||
if (isyou) {
|
if (isyou) {
|
||||||
tx = u.ux, ty = u.uy;
|
tx = u.ux, ty = u.uy;
|
||||||
distance = 0;
|
distance = 0;
|
||||||
pline_The("%s crashes on your %s and breaks into shards.", botlnam,
|
pline_The("%s crashes on your %s and breaks into shards.", botlnam,
|
||||||
body_part(HEAD));
|
body_part(HEAD));
|
||||||
losehp(Maybe_Half_Phys(rnd(2)), "thrown potion", KILLED_BY_AN);
|
losehp(Maybe_Half_Phys(rnd(2)),
|
||||||
|
(how == POTHIT_OTHER_THROW) ? "propelled potion" /* scatter */
|
||||||
|
: "thrown potion",
|
||||||
|
KILLED_BY_AN);
|
||||||
} else {
|
} else {
|
||||||
tx = mon->mx, ty = mon->my;
|
tx = mon->mx, ty = mon->my;
|
||||||
/* sometimes it hits the saddle */
|
/* sometimes it hits the saddle */
|
||||||
@@ -1314,6 +1318,7 @@ boolean your_fault;
|
|||||||
case POT_ACID:
|
case POT_ACID:
|
||||||
if (!Acid_resistance) {
|
if (!Acid_resistance) {
|
||||||
int dmg;
|
int dmg;
|
||||||
|
|
||||||
pline("This burns%s!",
|
pline("This burns%s!",
|
||||||
obj->blessed ? " a little"
|
obj->blessed ? " a little"
|
||||||
: obj->cursed ? " a lot" : "");
|
: obj->cursed ? " a lot" : "");
|
||||||
|
|||||||
+14
-11
@@ -844,7 +844,7 @@ register struct trap *trap;
|
|||||||
unsigned trflags;
|
unsigned trflags;
|
||||||
{
|
{
|
||||||
register int ttype = trap->ttyp;
|
register int ttype = trap->ttyp;
|
||||||
register struct obj *otmp;
|
struct obj *otmp;
|
||||||
boolean already_seen = trap->tseen,
|
boolean already_seen = trap->tseen,
|
||||||
forcetrap = (trflags & FORCETRAP) != 0,
|
forcetrap = (trflags & FORCETRAP) != 0,
|
||||||
webmsgok = (trflags & NOWEBMSG) == 0,
|
webmsgok = (trflags & NOWEBMSG) == 0,
|
||||||
@@ -915,8 +915,9 @@ unsigned trflags;
|
|||||||
otmp->opoisoned = 0;
|
otmp->opoisoned = 0;
|
||||||
if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) { /* nothing */
|
if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) { /* nothing */
|
||||||
;
|
;
|
||||||
} else if (thitu(8, dmgval(otmp, &youmonst), otmp, "arrow")) {
|
} else if (thitu(8, dmgval(otmp, &youmonst), &otmp, "arrow")) {
|
||||||
obfree(otmp, (struct obj *) 0);
|
if (otmp)
|
||||||
|
obfree(otmp, (struct obj *) 0);
|
||||||
} else {
|
} else {
|
||||||
place_object(otmp, u.ux, u.uy);
|
place_object(otmp, u.ux, u.uy);
|
||||||
if (!Blind)
|
if (!Blind)
|
||||||
@@ -944,13 +945,15 @@ unsigned trflags;
|
|||||||
oldumort = u.umortality;
|
oldumort = u.umortality;
|
||||||
if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) { /* nothing */
|
if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) { /* nothing */
|
||||||
;
|
;
|
||||||
} else if (thitu(7, dmgval(otmp, &youmonst), otmp, "little dart")) {
|
} else if (thitu(7, dmgval(otmp, &youmonst), &otmp, "little dart")) {
|
||||||
if (otmp->opoisoned)
|
if (otmp) {
|
||||||
poisoned("dart", A_CON, "little dart",
|
if (otmp->opoisoned)
|
||||||
/* if damage triggered life-saving,
|
poisoned("dart", A_CON, "little dart",
|
||||||
poison is limited to attrib loss */
|
/* if damage triggered life-saving,
|
||||||
(u.umortality > oldumort) ? 0 : 10, TRUE);
|
poison is limited to attrib loss */
|
||||||
obfree(otmp, (struct obj *) 0);
|
(u.umortality > oldumort) ? 0 : 10, TRUE);
|
||||||
|
obfree(otmp, (struct obj *) 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
place_object(otmp, u.ux, u.uy);
|
place_object(otmp, u.ux, u.uy);
|
||||||
if (!Blind)
|
if (!Blind)
|
||||||
@@ -1802,7 +1805,7 @@ int style;
|
|||||||
if (multi)
|
if (multi)
|
||||||
nomul(0);
|
nomul(0);
|
||||||
if (thitu(9 + singleobj->spe, dmgval(singleobj, &youmonst),
|
if (thitu(9 + singleobj->spe, dmgval(singleobj, &youmonst),
|
||||||
singleobj, (char *) 0))
|
&singleobj, (char *) 0))
|
||||||
stop_occupation();
|
stop_occupation();
|
||||||
}
|
}
|
||||||
if (style == ROLL) {
|
if (style == ROLL) {
|
||||||
|
|||||||
+2
-1
@@ -731,7 +731,8 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
|
|||||||
else
|
else
|
||||||
setuwep((struct obj *) 0);
|
setuwep((struct obj *) 0);
|
||||||
freeinv(obj);
|
freeinv(obj);
|
||||||
potionhit(mon, obj, TRUE);
|
potionhit(mon, obj,
|
||||||
|
hand_to_hand ? POTHIT_HERO_BASH : POTHIT_HERO_THROW);
|
||||||
if (mon->mhp <= 0)
|
if (mon->mhp <= 0)
|
||||||
return FALSE; /* killed */
|
return FALSE; /* killed */
|
||||||
hittxt = TRUE;
|
hittxt = TRUE;
|
||||||
|
|||||||
@@ -3429,7 +3429,7 @@ 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 + obj->spe, dmgval(obj, &youmonst), obj,
|
(void) thitu(10 + obj->spe, dmgval(obj, &youmonst), &obj,
|
||||||
"boomerang");
|
"boomerang");
|
||||||
endmultishot(TRUE);
|
endmultishot(TRUE);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user