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:
Pasi Kallinen
2022-07-19 15:14:40 +03:00
parent 0bca93be87
commit d713c1826b
11 changed files with 58 additions and 38 deletions

View File

@@ -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
*/