polyself weapon attack (trunk only)
From the newsgroup: hero poly'd into various monster forms would be
incapable of turning a target to stone when wielding a cockatrice corpse.
Monster forms with a claw attack as their very first attack (second for
incubus and sucubus, handled as a special case) would have that be
converted into a weapon attack. But some monster forms start with bite
attacks and have their claw attacks later; a hero poly'd into such form
wouldn't use his/her wielded weapon.
This fixes that, but it's actually academic (or about to become so).
The only monster capable of wielding a weapon which would then be ignored
was jabberwock, and I think leaving NOHANDS off the jabberwock definition
is a bug in itself (next patch...).
This commit is contained in:
@@ -374,6 +374,8 @@ for poly'd hero hiding on ceiling, attack by sea monsters won't move them
|
|||||||
for poly'd hero hiding on ceiling, attack by long worm might fill hero's
|
for poly'd hero hiding on ceiling, attack by long worm might fill hero's
|
||||||
destination with worm's tail, so double check and maybe choose again
|
destination with worm's tail, so double check and maybe choose again
|
||||||
when shop prices are adjusted, handle roundoff (integer truncation) better
|
when shop prices are adjusted, handle roundoff (integer truncation) better
|
||||||
|
for hero poly'd into a monster form that lacks a weapon attack but has a claw
|
||||||
|
attack, use wielded weapon even when claw attack isn't the very first
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+14
-18
@@ -2027,7 +2027,7 @@ register struct monst *mon;
|
|||||||
{
|
{
|
||||||
struct attack *mattk, alt_attk;
|
struct attack *mattk, alt_attk;
|
||||||
struct obj *weapon;
|
struct obj *weapon;
|
||||||
boolean altwep = FALSE;
|
boolean altwep = FALSE, weapon_used = FALSE;
|
||||||
int i, tmp, armorpenalty, sum[NATTK],
|
int i, tmp, armorpenalty, sum[NATTK],
|
||||||
nsum = 0, dhit = 0, attknum = 0;
|
nsum = 0, dhit = 0, attknum = 0;
|
||||||
|
|
||||||
@@ -2041,7 +2041,9 @@ use_weapon:
|
|||||||
* but players who polymorph into them have hands or claws and thus
|
* but players who polymorph into them have hands or claws and thus
|
||||||
* should be able to use weapons. This shouldn't prohibit the use
|
* should be able to use weapons. This shouldn't prohibit the use
|
||||||
* of most special abilities, either.
|
* of most special abilities, either.
|
||||||
|
* If a monster has multiple claw attacks, only one can use weapon.
|
||||||
*/
|
*/
|
||||||
|
weapon_used = TRUE;
|
||||||
/* Potential problem: if the monster gets multiple weapon attacks,
|
/* Potential problem: if the monster gets multiple weapon attacks,
|
||||||
* we currently allow the player to get each of these as a weapon
|
* we currently allow the player to get each of these as a weapon
|
||||||
* attack. Is this really desirable?
|
* attack. Is this really desirable?
|
||||||
@@ -2069,24 +2071,18 @@ use_weapon:
|
|||||||
sum[i] = damageum(mon,mattk);
|
sum[i] = damageum(mon,mattk);
|
||||||
break;
|
break;
|
||||||
case AT_CLAW:
|
case AT_CLAW:
|
||||||
if (i == 0 && uwep && !cantwield(youmonst.data))
|
if (uwep && !cantwield(youmonst.data) &&
|
||||||
goto use_weapon;
|
!weapon_used) goto use_weapon;
|
||||||
#ifdef SEDUCE
|
/*FALLTHRU*/
|
||||||
/* succubi/incubi are humanoid, but their _second_
|
case AT_TUCH:
|
||||||
* attack is AT_CLAW, not their first...
|
if (uwep && youmonst.data->mlet == S_LICH &&
|
||||||
*/
|
!weapon_used) goto use_weapon;
|
||||||
if (SYSOPT_SEDUCE && i==1 && uwep &&
|
/*FALLTHRU*/
|
||||||
(u.umonnum == PM_SUCCUBUS ||
|
|
||||||
u.umonnum == PM_INCUBUS)) goto use_weapon;
|
|
||||||
#endif
|
|
||||||
case AT_KICK:
|
case AT_KICK:
|
||||||
case AT_BITE:
|
case AT_BITE:
|
||||||
case AT_STNG:
|
case AT_STNG:
|
||||||
case AT_TUCH:
|
|
||||||
case AT_BUTT:
|
case AT_BUTT:
|
||||||
case AT_TENT:
|
case AT_TENT:
|
||||||
if (i == 0 && uwep && youmonst.data->mlet == S_LICH)
|
|
||||||
goto use_weapon;
|
|
||||||
tmp = find_roll_to_hit(mon, mattk->aatyp,
|
tmp = find_roll_to_hit(mon, mattk->aatyp,
|
||||||
(struct obj *)0,
|
(struct obj *)0,
|
||||||
&attknum, &armorpenalty);
|
&attknum, &armorpenalty);
|
||||||
@@ -2193,10 +2189,10 @@ use_weapon:
|
|||||||
/* No check for uwep; if wielding nothing we want to
|
/* No check for uwep; if wielding nothing we want to
|
||||||
* do the normal 1-2 points bare hand damage...
|
* do the normal 1-2 points bare hand damage...
|
||||||
*/
|
*/
|
||||||
if (i==0 && (youmonst.data->mlet==S_KOBOLD
|
if ((youmonst.data->mlet == S_KOBOLD ||
|
||||||
|| youmonst.data->mlet==S_ORC
|
youmonst.data->mlet == S_ORC ||
|
||||||
|| youmonst.data->mlet==S_GNOME
|
youmonst.data->mlet == S_GNOME) &&
|
||||||
)) goto use_weapon;
|
!weapon_used) goto use_weapon;
|
||||||
|
|
||||||
case AT_NONE:
|
case AT_NONE:
|
||||||
case AT_BOOM:
|
case AT_BOOM:
|
||||||
|
|||||||
Reference in New Issue
Block a user