Merge branch 'hallutraps' of https://github.com/copperwater/NetHack into copperwater-hallutraps-3.7

This commit is contained in:
nhmall
2019-10-02 13:02:22 -04:00
13 changed files with 85 additions and 53 deletions

View File

@@ -149,25 +149,21 @@
/*
* random_monster()
* random_object()
* random_trap()
*
* Respectively return a random monster, object, or trap number.
* Respectively return a random monster or object.
*/
#define random_monster(rng) rng(NUMMONS)
#define random_object(rng) (rng(NUM_OBJECTS - 1) + 1)
#define random_trap(rng) (rng(TRAPNUM - 1) + 1)
/*
* what_obj()
* what_mon()
* what_trap()
*
* If hallucinating, choose a random object/monster, otherwise, use the one
* given. Use the given rng to handle hallucination.
*/
#define what_obj(obj, rng) (Hallucination ? random_object(rng) : obj)
#define what_mon(mon, rng) (Hallucination ? random_monster(rng) : mon)
#define what_trap(trp, rng) (Hallucination ? random_trap(rng) : trp)
/*
* newsym_rn2
@@ -338,8 +334,8 @@
#define explosion_to_glyph(expltype, idx) \
((((expltype) * MAXEXPCHARS) + ((idx) - S_explode1)) + GLYPH_EXPLODE_OFF)
#define trap_to_glyph(trap, rng) \
cmap_to_glyph(trap_to_defsym(what_trap((trap)->ttyp, rng)))
#define trap_to_glyph(trap) \
cmap_to_glyph(trap_to_defsym((trap)->ttyp))
/* Not affected by hallucination. Gives a generic body for CORPSE */
/* MRKR: ...and the generic statue */

View File

@@ -2563,6 +2563,7 @@ E boolean FDECL(uteetering_at_seen_pit, (struct trap *));
E boolean NDECL(lava_effects);
E void NDECL(sink_into_lava);
E void NDECL(sokoban_guilt);
E const char * FDECL(trapname, (int, BOOLEAN_P));
/* ### u_init.c ### */