Buzz macros and related stuff
Add macros to convert AD_foo, WAN_foo, and SPE_foo to relative values for passing to BZ_U_foo and BZ_M_foo macros. Change some return values in monster spellcasting function from magic numbers to MM_MISS or MM_HIT. Make buzzmu consider hero resistances - previously the monster with innate zapping ray (Angels and Asmodeus) would just keep doing that attack, but they will now just curse if it saw the hero resist the attack.
This commit is contained in:
@@ -3381,6 +3381,7 @@ extern struct monst *bhit(coordxy, coordxy, int, enum bhit_call_types,
|
||||
extern struct monst *boomhit(struct obj *, coordxy, coordxy);
|
||||
extern int zhitm(struct monst *, int, int, struct obj **);
|
||||
extern int burn_floor_objects(coordxy, coordxy, boolean, boolean);
|
||||
extern void ubuzz(int, int);
|
||||
extern void buzz(int, int, coordxy, coordxy, int, int);
|
||||
extern void dobuzz(int, int, coordxy, coordxy, int, int, boolean);
|
||||
extern void melt_ice(coordxy, coordxy, const char *);
|
||||
|
||||
@@ -642,6 +642,25 @@ enum getobj_callback_returns {
|
||||
* it. */
|
||||
#define PHYS_EXPL_TYPE -1
|
||||
|
||||
/* macros for dobuzz() type */
|
||||
#define BZ_VALID_ADTYP(adtyp) ((adtyp) >= AD_MAGM && (adtyp) <= AD_SPC2)
|
||||
|
||||
#define BZ_OFS_AD(adtyp) (abs((adtyp) - AD_MAGM) % 10)
|
||||
#define BZ_OFS_WAN(otyp) (abs((otyp) - WAN_MAGIC_MISSILE) % 10)
|
||||
#define BZ_OFS_SPE(otyp) (abs((otyp) - SPE_MAGIC_MISSILE) % 10)
|
||||
/* hero shooting a wand */
|
||||
#define BZ_U_WAND(bztyp) (0 + (bztyp))
|
||||
/* hero casting a spell */
|
||||
#define BZ_U_SPELL(bztyp) (10 + (bztyp))
|
||||
/* hero breathing as a monster */
|
||||
#define BZ_U_BREATH(bztyp) (20 + (bztyp))
|
||||
/* monster casting a spell */
|
||||
#define BZ_M_SPELL(bztyp) (-10 - (bztyp))
|
||||
/* monster breathing */
|
||||
#define BZ_M_BREATH(bztyp) (-20 - (bztyp))
|
||||
/* monster shooting a wand */
|
||||
#define BZ_M_WAND(bztyp) (-30 - (bztyp))
|
||||
|
||||
/*
|
||||
* option setting restrictions
|
||||
*/
|
||||
|
||||
@@ -1203,6 +1203,7 @@ SCROLL("blank paper", "unlabeled", 0, 28, 60, SCR_BLANK_PAPER),
|
||||
#define PAPER LEATHER /* override enum for use in SPELL() expansion */
|
||||
SPELL("dig", "parchment",
|
||||
P_MATTER_SPELL, 20, 6, 5, 1, RAY, HI_LEATHER, SPE_DIG),
|
||||
/* magic missile ... finger of death must be in this order; see buzz() */
|
||||
SPELL("magic missile", "vellum",
|
||||
P_ATTACK_SPELL, 45, 2, 2, 1, RAY, HI_LEATHER, SPE_MAGIC_MISSILE),
|
||||
#undef PAPER /* revert to normal material */
|
||||
@@ -1382,6 +1383,7 @@ WAND("probing", "uranium", 30, 150, 1, IMMEDIATE, METAL, HI_METAL,
|
||||
WAN_PROBING),
|
||||
WAND("digging", "iron", 55, 150, 1, RAY, IRON, HI_METAL,
|
||||
WAN_DIGGING),
|
||||
/* magic missile ... lightning must be in this order; see buzz() */
|
||||
WAND("magic missile", "steel", 50, 150, 1, RAY, IRON, HI_METAL,
|
||||
WAN_MAGIC_MISSILE),
|
||||
WAND("fire", "hexagonal", 40, 175, 1, RAY, IRON, HI_METAL,
|
||||
|
||||
Reference in New Issue
Block a user