is_lminion should only match lawful minions

When Angels were introduced, they were always lawful.  Somewhere along the
line, non-lawful angels were added, but is_lminion and uses of it was never
updated to address this change.  Among other things, this resulted in
non-lawful angels delivering messages via #chat that are only appropriate
for lawful angels.  That is addressed simply by changing the definition of
is_lminion, which must take a struct monst, not a permonst, to return valid
results.  Also, non-lawful angels should summon appropriate monsters, not
lawful minions.
This commit is contained in:
cohrs
2002-10-24 04:13:56 +00:00
parent 71480033c6
commit ff8512b36b
8 changed files with 55 additions and 16 deletions

View File

@@ -960,7 +960,7 @@ E int FDECL(doseduce, (struct monst *));
/* ### minion.c ### */
E void FDECL(msummon, (struct permonst *));
E void FDECL(msummon, (struct monst *));
E void FDECL(summon_minion, (ALIGNTYP_P,BOOLEAN_P));
E int FDECL(demon_talk, (struct monst *));
E long FDECL(bribe, (struct monst *));

View File

@@ -19,6 +19,11 @@
#define resists_acid(mon) (((mon)->mintrinsics & MR_ACID) != 0)
#define resists_ston(mon) (((mon)->mintrinsics & MR_STONE) != 0)
#define is_lminion(mon) (is_minion((mon)->data) && \
(mon)->data->maligntyp >= A_COALIGNED && \
((mon)->data != &mons[PM_ANGEL] || \
EPRI(mon)->shralign > 0))
#define is_flyer(ptr) (((ptr)->mflags1 & M1_FLY) != 0L)
#define is_floater(ptr) ((ptr)->mlet == S_EYE)
#define is_clinger(ptr) (((ptr)->mflags1 & M1_CLING) != 0L)
@@ -106,8 +111,6 @@
#define is_dlord(ptr) (is_demon(ptr) && is_lord(ptr))
#define is_dprince(ptr) (is_demon(ptr) && is_prince(ptr))
#define is_minion(ptr) ((ptr)->mflags2 & M2_MINION)
#define is_lminion(ptr) (is_minion(ptr) && \
(ptr)->maligntyp >= A_COALIGNED)
#define likes_gold(ptr) (((ptr)->mflags2 & M2_GREEDY) != 0L)
#define likes_gems(ptr) (((ptr)->mflags2 & M2_JEWELS) != 0L)
#define likes_objs(ptr) (((ptr)->mflags2 & M2_COLLECT) != 0L || \