From: cohrs Date: Sun, 5 Feb 2006 03:29:45 +0000 (+0000) Subject: inappropriate polyself spit attacks X-Git-Tag: MOVE2GIT~1131 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88a5b95e65a9f97e5f43ebaee54ee5a66da6fb88;p=nethack inappropriate polyself spit attacks Submitted by 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. --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 75b7166c9..dacace43f 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -117,6 +117,7 @@ don't see objects or read engraving when hero changes location (random teleport) or position (levitation timeout) while asleep or fainted polymorphed spellbooks may turn blank or be too faint to read avoid inappropriate message when using a cursed lamp while blind +player polymorphed as a guardian naga spit the wrong kind of venom Platform- and/or Interface-Specific Fixes diff --git a/src/polyself.c b/src/polyself.c index 3dada624e..687242abc 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -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); }