E boolean FDECL(hmon, (struct monst *,struct obj *,int));
E int FDECL(damageum, (struct monst *,struct attack *));
E void FDECL(missum, (struct monst *,struct attack *,BOOLEAN_P));
-E int FDECL(passive, (struct monst *,BOOLEAN_P,int,UCHAR_P));
+E int FDECL(passive, (struct monst *,BOOLEAN_P,int,UCHAR_P,BOOLEAN_P));
E void FDECL(passive_obj, (struct monst *,struct obj *,struct attack *));
E void FDECL(stumble_onto_mimic, (struct monst *));
E int FDECL(flash_hits_mon, (struct monst *,struct obj *));
}
}
- (void) passive(mon, TRUE, mon->mhp > 0, AT_KICK);
+ (void) passive(mon, TRUE, mon->mhp > 0, AT_KICK, FALSE);
if (mon->mhp <= 0 && !trapkilled) killed(mon);
/* may bring up a dialog, so put this after all messages */
} else if (tmp > (kickdieroll = rnd(20))) {
You("kick %s.", mon_nam(mon));
sum = damageum(mon, uattk);
- (void)passive(mon, (boolean)(sum > 0), (sum != 2), AT_KICK);
+ (void)passive(mon, (boolean)(sum > 0), (sum != 2), AT_KICK, FALSE);
if (sum == 2)
break; /* Defender died */
} else {
missum(mon, uattk, (tmp + armorpenalty > kickdieroll));
- (void)passive(mon, 0, 1, AT_KICK);
+ (void)passive(mon, 0, 1, AT_KICK,FALSE);
}
}
return;
!is_flyer(mon->data)) {
pline("Floating in the air, you miss wildly!");
exercise(A_DEX, FALSE);
- (void) passive(mon, FALSE, 1, AT_KICK);
+ (void) passive(mon, FALSE, 1, AT_KICK, FALSE);
return;
}
if(!rn2((i < j/10) ? 2 : (i < j/5) ? 3 : 4)) {
if(martial() && !rn2(2)) goto doit;
Your("clumsy kick does no damage.");
- (void) passive(mon, FALSE, 1, AT_KICK);
+ (void) passive(mon, FALSE, 1, AT_KICK, FALSE);
return;
}
if(i < j/10) clumsy = TRUE;
if(!nohands(mon->data) && !rn2(martial() ? 5 : 3)) {
pline("%s blocks your %skick.", Monnam(mon),
clumsy ? "clumsy " : "");
- (void) passive(mon, FALSE, 1, AT_KICK);
+ (void) passive(mon, FALSE, 1, AT_KICK, FALSE);
return;
} else {
mnexto(mon);
"slides" : "jumps"),
clumsy ? "easily" : "nimbly",
clumsy ? "clumsy " : "");
- (void) passive(mon, FALSE, 1, AT_KICK);
+ (void) passive(mon, FALSE, 1, AT_KICK, FALSE);
return;
}
}
struct monst *mon;
struct attack *uattk;
{
- boolean malive;
+ boolean malive, wep_was_destroyed = FALSE;
+ struct obj *wepbefore = uwep;
int armorpenalty, attknum = 0,
x = u.ux + u.dx, y = u.uy + u.dy,
tmp = find_roll_to_hit(mon, uattk->aatyp, uwep,
malive = known_hitum(mon, uswapwep, &mhit,
tmp, armorpenalty, uattk);
}
-
- (void) passive(mon, mhit, malive, AT_WEAP);
+ if (wepbefore && !uwep) wep_was_destroyed = TRUE;
+ (void) passive(mon, mhit, malive, AT_WEAP, wep_was_destroyed);
return(malive);
}
rehumanize();
}
if (sum[i] == 2)
- return((boolean)passive(mon, 1, 0, mattk->aatyp));
+ return((boolean)passive(mon, 1, 0, mattk->aatyp, FALSE));
/* defender dead */
else {
- (void) passive(mon, sum[i], 1, mattk->aatyp);
+ (void) passive(mon, sum[i], 1, mattk->aatyp, FALSE);
nsum |= sum[i];
}
if (!Upolyd)
/* Special (passive) attacks on you by monsters done here. */
int
-passive(mon, mhit, malive, aatyp)
+passive(mon, mhit, malive, aatyp, wep_was_destroyed)
register struct monst *mon;
register boolean mhit;
register int malive;
uchar aatyp;
+boolean wep_was_destroyed;
{
register struct permonst *ptr = mon->data;
register int i, tmp;
if (aatyp == AT_MAGC) protector = W_ARMG;
if (protector == 0L || /* no protection */
- (protector == W_ARMG && !uarmg && !uwep) ||
+ (protector == W_ARMG && !uarmg && !uwep && !wep_was_destroyed) ||
(protector == W_ARMF && !uarmf) ||
(protector == W_ARMH && !uarmh) ||
(protector == (W_ARMC|W_ARMG) && (!uarmc || !uarmg))) {