inappropriate polyself spit attacks

Submitted by <Someone> 12/3/05.  player poly'd as guardian naga produced a
different attack than a real guardian naga.  The fix causes an algorithm
similar to that used in spitmnu to be used in dospit.
This commit is contained in:
cohrs
2006-02-05 03:29:45 +00:00
parent dfb1d04b6a
commit 88a5b95e65
2 changed files with 21 additions and 4 deletions

View File

@@ -788,12 +788,28 @@ int
dospit()
{
struct obj *otmp;
struct attack *mattk;
if (!getdir((char *)0)) return(0);
otmp = mksobj(u.umonnum==PM_COBRA ? BLINDING_VENOM : ACID_VENOM,
TRUE, FALSE);
otmp->spe = 1; /* to indicate it's yours */
throwit(otmp, 0L, FALSE);
mattk = attacktype_fordmg(youmonst.data, AT_SPIT, AD_ANY);
if (!mattk) {
impossible("bad spit attack?");
} else {
switch (mattk->adtyp) {
case AD_BLND:
case AD_DRST:
otmp = mksobj(BLINDING_VENOM, TRUE, FALSE);
break;
default:
impossible("bad attack type in dospit");
/* fall through */
case AD_ACID:
otmp = mksobj(ACID_VENOM, TRUE, FALSE);
break;
}
otmp->spe = 1; /* to indicate it's yours */
throwit(otmp, 0L, FALSE);
}
return(1);
}