Source:NetHack 3.0.0/mondata.h

From NetHackWiki
Revision as of 05:00, 4 March 2008 by Kernigh bot (talk | contribs) (NetHack 3.0.0/mondata.h moved to Source:NetHack 3.0.0/mondata.h: Robot: moved page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Below is the full text to mondata.h from the source code of NetHack 3.0.0. To link to a particular line, write [[NetHack 3.0.0/mondata.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1.    /*	SCCS Id: @(#)mondata.h	3.0	89/03/06
2.    /* NetHack may be freely redistributed.  See license for details. */
3.    /* Copyright (c) 1989 Mike Threepoint */
4.    
5.    #ifndef MONDATA_H
6.    #define MONDATA_H
7.    
8.    # ifndef STUPID_CPP	/* otherwise these macros are functions in mondata.c */
9.    
10.   #define bigmonst(ptr)		(((ptr)->mflags1 & M1_BIG) != 0L)
11.   #define verysmall(ptr)		(((ptr)->mflags1 & M1_VSMALL) != 0L)
12.   #define is_flyer(ptr)		(((ptr)->mflags1 & M1_FLY) != 0L)
13.   #define is_floater(ptr) 	((ptr)->mlet == S_EYE)
14.   #define is_swimmer(ptr) 	(((ptr)->mflags1 & M1_SWIM) != 0L)
15.   #define passes_walls(ptr)	(((ptr)->mflags1 & M1_WALLWALK) != 0L)
16.   #define noncorporeal(ptr)	((ptr)->mlet == S_GHOST)
17.   #define is_animal(ptr)		(((ptr)->mflags1 & M1_ANIMAL) != 0L)
18.   #define humanoid(ptr)		(((ptr)->mflags1 & M1_HUMANOID) != 0L)
19.   #define is_undead(ptr)		(((ptr)->mflags1 & M1_UNDEAD) != 0L)
20.   #define is_were(ptr)		(((ptr)->mflags1 & M1_WERE) != 0L)
21.   #define haseyes(ptr)		(((ptr)->mflags1 & M1_NOEYES) == 0L)
22.   #define nohands(ptr)		(((ptr)->mflags1 & M1_NOHANDS) != 0L)
23.   #define lays_eggs(ptr)		(((ptr)->mflags1 & M1_EGGS) != 0L)
24.   #define poisonous(ptr)		(((ptr)->mflags1 & M1_POIS) != 0L)
25.   #define resists_poison(ptr)	(((ptr)->mflags1 & (M1_POIS | M1_POIS_RES)) != 0L)
26.   #define resists_fire(ptr)	(((ptr)->mflags1 & M1_FIRE_RES) != 0L)
27.   #define resists_cold(ptr)	(((ptr)->mflags1 & M1_COLD_RES) != 0L)
28.   #define resists_acid(ptr)	dmgtype(ptr, AD_ACID)
29.   #define resists_elec(ptr)	(((ptr)->mflags1 & M1_ELEC_RES) != 0L)
30.   #define resists_sleep(ptr)	(((ptr)->mflags1 & (M1_SLEE_RES | M1_UNDEAD)) != 0L)
31.   #define resists_disint(ptr)	((ptr) == &mons[PM_BLACK_DRAGON] || (ptr) == &mons[PM_BABY_BLACK_DRAGON])
32.   #define regenerates(ptr)	(((ptr)->mflags1 & M1_REGEN) != 0L)
33.   #define perceives(ptr)		(((ptr)->mflags1 & M1_SEE_INVIS) != 0L)
34.   #define can_teleport(ptr)	(((ptr)->mflags1 & M1_TPORT) != 0L)
35.   #define control_teleport(ptr)	(((ptr)->mflags1 & M1_TPORT_CONTROL) != 0L)
36.   #define is_armed(ptr)		attacktype(ptr, AT_WEAP)
37.   #define likes_gold(ptr) 	(((ptr)->mflags1 & M1_GREEDY) != 0L)
38.   #define likes_gems(ptr) 	(((ptr)->mflags1 & M1_JEWELS) != 0L)
39.   #define likes_objs(ptr) 	(((ptr)->mflags1 & M1_COLLECT) != 0L || \
40.   					is_armed(ptr))
41.   #define likes_magic(ptr)	(((ptr)->mflags1 & M1_MAGIC) != 0L)
42.   #define hides_under(ptr)	(((ptr)->mflags2 & M2_CONCEAL) != 0L)
43.   #define is_hider(ptr)		(((ptr)->mflags2 & M2_HIDE) != 0L)
44.   #ifdef POLYSELF
45.   #define polyok(ptr)		(((ptr)->mflags1 & M1_NOPOLY) == 0L)
46.   #endif /* POLYSELF */
47.   #define tunnels(ptr)		(((ptr)->mflags2 & M2_TUNNEL) != 0L)
48.   #define needspick(ptr)		(((ptr)->mflags2 & M2_NEEDPICK) != 0L)
49.   #define is_elf(ptr)		(((ptr)->mflags2 & M2_ELF) != 0L)
50.   #define is_dwarf(ptr)		(((ptr)->mflags2 & M2_DWARF) != 0L)
51.   #define is_giant(ptr)		(((ptr)->mflags2 & M2_GIANT) != 0L)
52.   #ifdef GOLEMS
53.   #define is_golem(ptr)		((ptr)->mlet == S_GOLEM)
54.   #endif /* GOLEMS */
55.   #define is_orc(ptr)		(((ptr)->mflags2 & M2_ORC) != 0L)
56.   #define is_human(ptr)		(((ptr)->mflags2 & M2_HUMAN) != 0L)
57.   #define is_demon(ptr)		(((ptr)->mflags2 & M2_DEMON) != 0L)
58.   #define is_mercenary(ptr)	(((ptr)->mflags2 & M2_MERC) != 0L)
59.   #define throws_rocks(ptr)	(((ptr)->mflags2 & M2_ROCKTHROW) != 0L)
60.   #define is_wanderer(ptr)	(((ptr)->mflags2 & M2_WANDER) != 0L)
61.   #define is_lord(ptr)		(((ptr)->mflags1 & M1_LORD) != 0L)
62.   #define is_prince(ptr)		(((ptr)->mflags1 & M1_PRINCE) != 0L)
63.   #ifdef HARD
64.   #define is_ndemon(ptr)		(is_demon(ptr) && \
65.   			 (((ptr)->mflags1 & (M1_LORD | M1_PRINCE)) == 0L))
66.   #else /* HARD */
67.   #define is_ndemon(ptr)		(ptr == &mons[PM_DEMON])
68.   #endif /* HARD */
69.   #define is_dlord(ptr)		(is_demon(ptr) && is_lord(ptr))
70.   #define is_dprince(ptr)		(is_demon(ptr) && is_prince(ptr))
71.   #define type_is_pname(ptr)	(((ptr)->mflags2 & M2_PNAME) != 0L)
72.   #define always_hostile(ptr)	(((ptr)->mflags2 & M2_HOSTILE) != 0L)
73.   #define always_peaceful(ptr)	(((ptr)->mflags2 & M2_PEACEFUL) != 0L)
74.   #define strongmonst(ptr)	(((ptr)->mflags2 & M2_STRONG) != 0L)
75.   #define extra_nasty(ptr)	(((ptr)->mflags2 & M2_NASTY) != 0L)
76.   #ifdef POLYSELF
77.   #define can_breathe(ptr)	attacktype(ptr, AT_BREA)
78.   #define cantwield(ptr)		(nohands(ptr) || verysmall(ptr))
79.   #define cantweararm(ptr)	(breakarm(ptr) || sliparm(ptr))
80.   #define nolimbs(ptr)		(((ptr)->mflags2 & M2_NOLIMBS) != 0L)
81.   #endif /* POLYSELF */
82.   #define carnivorous(ptr)	(((ptr)->mflags2 & M2_CARNIVORE) != 0L)
83.   #define herbivorous(ptr)	(((ptr)->mflags2 & M2_HERBIVORE) != 0L)
84.   #define thick_skinned(ptr)	(((ptr)->mflags2 & M2_THICK_HIDE) != 0L)
85.   #define amorphous(ptr)		(((ptr)->mflags2 & M2_AMORPHOUS) != 0L)
86.   
87.   # endif /* STUPID_CPP */
88.   
89.   #endif /* MONDATA_H */