make attack result macros more distinguishable from makemon macros
Use the MM_ prefix only for the makemon macros, and change these five as follows: MM_MISS 0x0 -> M_ATTK_MISS /* aggressor missed */ MM_HIT 0x1 -> M_ATTK_HIT /* aggressor hit defender */ MM_DEF_DIED 0x2 -> M_ATTK_DEF_DIED /* defender died */ MM_AGR_DIED 0x4 -> M_ATTK_AGR_DIED /* aggressor died */ MM_AGR_DONE 0x8 -> M_ATTK_AGR_DONE /* aggressor is done with their turn */ include/hack.h:#define NO_MM_FLAGS 0x000000L /* use this rather than plain 0 */ include/hack.h:#define MM_NOWAIT 0x000002L /* don't set STRAT_WAITMASK flags */ include/hack.h:#define MM_NOCOUNTBIRTH 0x000004L /* don't increment born count (for revival) */ include/hack.h:#define MM_IGNOREWATER 0x000008L /* ignore water when positioning */ include/hack.h:#define MM_ADJACENTOK 0x000010L /* acceptable to use adjacent coordinates */ include/hack.h:#define MM_ANGRY 0x000020L /* monster is created angry */ include/hack.h:#define MM_NONAME 0x000040L /* monster is not christened */ include/hack.h:#define MM_EGD 0x000100L /* add egd structure */ include/hack.h:#define MM_EPRI 0x000200L /* add epri structure */ include/hack.h:#define MM_ESHK 0x000400L /* add eshk structure */ include/hack.h:#define MM_EMIN 0x000800L /* add emin structure */ include/hack.h:#define MM_EDOG 0x001000L /* add edog structure */ include/hack.h:#define MM_ASLEEP 0x002000L /* monsters should be generated asleep */ include/hack.h:#define MM_NOGRP 0x004000L /* suppress creation of monster groups */ include/hack.h:#define MM_NOTAIL 0x008000L /* if a long worm, don't give it a tail */ include/hack.h:#define MM_MALE 0x010000L /* male variation */ include/hack.h:#define MM_FEMALE 0x020000L /* female variation */ include/hack.h:#define MM_NOMSG 0x040000L /* no appear message */ include/hack.h:#define MM_NOEXCLAM 0x400000L /* more sedate "<mon> appears." mesg for ^G */ include/hack.h:#define MM_IGNORELAVA 0x800000L /* ignore lava when positioning */
This commit is contained in:
@@ -876,7 +876,7 @@ pet_ranged_attk(struct monst *mtmp)
|
||||
|
||||
/* Hungry pets are unlikely to use breath/spit attacks */
|
||||
if (mtarg && (!hungry || !rn2(5))) {
|
||||
int mstatus = MM_MISS;
|
||||
int mstatus = M_ATTK_MISS;
|
||||
|
||||
if (mtarg == &gy.youmonst) {
|
||||
if (mattacku(mtmp))
|
||||
@@ -887,19 +887,19 @@ pet_ranged_attk(struct monst *mtmp)
|
||||
* and "attacked but didn't die" cases, and this is preferable
|
||||
* to letting the pet attack the player and continuing to move.
|
||||
*/
|
||||
mstatus = MM_HIT;
|
||||
mstatus = M_ATTK_HIT;
|
||||
} else {
|
||||
mstatus = mattackm(mtmp, mtarg);
|
||||
|
||||
/* Shouldn't happen, really */
|
||||
if (mstatus & MM_AGR_DIED)
|
||||
if (mstatus & M_ATTK_AGR_DIED)
|
||||
return MMOVE_DIED;
|
||||
|
||||
/* Allow the targeted nasty to strike back - if
|
||||
* the targeted beast doesn't have a ranged attack,
|
||||
* nothing will happen.
|
||||
*/
|
||||
if ((mstatus & MM_HIT) && !(mstatus & MM_DEF_DIED)
|
||||
if ((mstatus & M_ATTK_HIT) && !(mstatus & M_ATTK_DEF_DIED)
|
||||
&& rn2(4) && mtarg != &gy.youmonst) {
|
||||
|
||||
/* Can monster see? If it can, it can retaliate
|
||||
@@ -909,7 +909,7 @@ pet_ranged_attk(struct monst *mtmp)
|
||||
*/
|
||||
if (mtarg->mcansee && haseyes(mtarg->data)) {
|
||||
mstatus = mattackm(mtarg, mtmp);
|
||||
if (mstatus & MM_DEF_DIED)
|
||||
if (mstatus & M_ATTK_DEF_DIED)
|
||||
return MMOVE_DIED;
|
||||
}
|
||||
}
|
||||
@@ -922,9 +922,9 @@ pet_ranged_attk(struct monst *mtmp)
|
||||
* only ever try ranged options
|
||||
* 2. if the only attacks available to mattackm are ranged
|
||||
* options, and the monster cannot make a ranged attack, it
|
||||
* will return MM_MISS.
|
||||
* will return M_ATTK_MISS.
|
||||
*/
|
||||
if (mstatus != MM_MISS)
|
||||
if (mstatus != M_ATTK_MISS)
|
||||
return MMOVE_DONE;
|
||||
}
|
||||
return MMOVE_NOTHING;
|
||||
@@ -1097,16 +1097,16 @@ dog_move(register struct monst *mtmp,
|
||||
mstatus = mattackm(mtmp, mtmp2);
|
||||
|
||||
/* aggressor (pet) died */
|
||||
if (mstatus & MM_AGR_DIED)
|
||||
if (mstatus & M_ATTK_AGR_DIED)
|
||||
return MMOVE_DIED;
|
||||
|
||||
if ((mstatus & MM_HIT) && !(mstatus & MM_DEF_DIED) && rn2(4)
|
||||
if ((mstatus & M_ATTK_HIT) && !(mstatus & M_ATTK_DEF_DIED) && rn2(4)
|
||||
&& mtmp2->mlstmv != gm.moves
|
||||
&& !onscary(mtmp->mx, mtmp->my, mtmp2)
|
||||
/* monnear check needed: long worms hit on tail */
|
||||
&& monnear(mtmp2, mtmp->mx, mtmp->my)) {
|
||||
mstatus = mattackm(mtmp2, mtmp); /* return attack */
|
||||
if (mstatus & MM_DEF_DIED)
|
||||
if (mstatus & M_ATTK_DEF_DIED)
|
||||
return MMOVE_DIED;
|
||||
}
|
||||
return MMOVE_DONE;
|
||||
@@ -1117,7 +1117,7 @@ dog_move(register struct monst *mtmp,
|
||||
register struct monst *mtmp2 = m_at(nx, ny);
|
||||
|
||||
mstatus = mdisplacem(mtmp, mtmp2, FALSE); /* displace monster */
|
||||
if (mstatus & MM_DEF_DIED)
|
||||
if (mstatus & M_ATTK_DEF_DIED)
|
||||
return MMOVE_DIED;
|
||||
return MMOVE_NOTHING;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user