Source:NetHack 3.0.0/youprop.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to youprop.h from the source code of NetHack 3.0.0. To link to a particular line, write [[NetHack 3.0.0/youprop.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: @(#)youprop.h	3.0	89/06/24
2.    /* NetHack may be freely redistributed.  See license for details. */
3.    /* Copyright (c) 1989 Mike Threepoint */
4.    
5.    #ifndef YOUPROP_H
6.    #define YOUPROP_H
7.    
8.    #ifndef PROP_H
9.    #include "prop.h"
10.   #endif
11.   #ifndef PERMONST_H
12.   #include "permonst.h"
13.   #endif
14.   #ifndef MONDATA_H
15.   #include "mondata.h"
16.   #endif
17.   #ifndef PM_H
18.   #include "pm.h"
19.   #endif
20.   
21.   #ifndef NAMED_ITEMS
22.   # define defends(attk,uwep)	0
23.   #endif
24.   
25.   /* two pseudo-properties */
26.   #define Blindfolded	(ublindf)
27.   #define Punished	(uball)
28.   
29.   /* perhaps these #define's should also be generated by makedefs */
30.   #define HFire_resistance	u.uprops[FIRE_RES].p_flgs
31.   #ifdef POLYSELF
32.   #define Fire_resistance	((HFire_resistance) || resists_fire(uasmon) || defends(AD_FIRE,uwep))
33.   #else
34.   #define Fire_resistance	((HFire_resistance) || defends(AD_FIRE,uwep))
35.   #endif
36.   
37.   #define HSleep_resistance	u.uprops[SLEEP_RES].p_flgs
38.   #ifdef POLYSELF
39.   #define Sleep_resistance	((HSleep_resistance) || resists_sleep(uasmon))
40.   #else
41.   #define Sleep_resistance	HSleep_resistance
42.   #endif
43.   
44.   #define HCold_resistance	u.uprops[COLD_RES].p_flgs
45.   #ifdef POLYSELF
46.   #define Cold_resistance	((HCold_resistance) || resists_cold(uasmon) || defends(AD_COLD,uwep))
47.   #else
48.   #define Cold_resistance	((HCold_resistance) || defends(AD_COLD,uwep))
49.   #endif
50.   
51.   #define HDisint_resistance	u.uprops[DISINT_RES].p_flgs
52.   #ifdef POLYSELF
53.   #define Disint_resistance	((HDisint_resistance) || resists_disint(uasmon))
54.   #else
55.   #define Disint_resistance	HDisint_resistance
56.   #endif
57.   
58.   #define HShock_resistance	u.uprops[SHOCK_RES].p_flgs
59.   #ifdef POLYSELF
60.   #define Shock_resistance	((HShock_resistance) || resists_elec(uasmon) || defends(AD_ELEC,uwep))
61.   #else
62.   #define Shock_resistance	((HShock_resistance) || defends(AD_ELEC,uwep))
63.   #endif
64.   
65.   #define HPoison_resistance	u.uprops[POISON_RES].p_flgs
66.   #ifdef POLYSELF
67.   #define Poison_resistance	((HPoison_resistance) || resists_poison(uasmon))
68.   #else
69.   #define Poison_resistance	(HPoison_resistance)
70.   #endif
71.   
72.   #define Adornment		u.uprops[ADORNED].p_flgs
73.   
74.   #define HRegeneration		u.uprops[REGENERATION].p_flgs
75.   #ifdef POLYSELF
76.   #define Regeneration		((HRegeneration) || regenerates(uasmon))
77.   #else
78.   #define Regeneration		(HRegeneration)
79.   #endif
80.   
81.   #define Searching		u.uprops[SEARCHING].p_flgs
82.   
83.   #define HSee_invisible		u.uprops[SEE_INVIS].p_flgs
84.   #ifdef POLYSELF
85.   #define See_invisible		((HSee_invisible) || perceives(uasmon))
86.   #else
87.   #define See_invisible		(HSee_invisible)
88.   #endif
89.   
90.   #define HInvis			u.uprops[INVIS].p_flgs
91.   #ifdef POLYSELF
92.   #define Invis			((HInvis) || u.usym == S_STALKER)
93.   #else
94.   #define Invis			(HInvis)
95.   #endif
96.   #define Invisible		(Invis && !See_invisible)
97.   
98.   #define HTeleportation		u.uprops[TELEPORT].p_flgs
99.   #ifdef POLYSELF
100.  #define Teleportation		((HTeleportation) || can_teleport(uasmon))
101.  #else
102.  #define Teleportation		(HTeleportation)
103.  #endif
104.  
105.  #define HTeleport_control	u.uprops[TELEPORT_CONTROL].p_flgs
106.  #ifdef POLYSELF
107.  #define Teleport_control	((HTeleport_control) || control_teleport(uasmon))
108.  #else
109.  #define Teleport_control	(HTeleport_control)
110.  #endif
111.  
112.  #define Polymorph		u.uprops[POLYMORPH].p_flgs
113.  #define Polymorph_control	u.uprops[POLYMORPH_CONTROL].p_flgs
114.  
115.  #define HLevitation		u.uprops[LEVITATION].p_flgs
116.  #ifdef POLYSELF
117.  #define Levitation		((HLevitation) || is_floater(uasmon))
118.  #else
119.  #define Levitation		(HLevitation)
120.  #endif
121.  
122.  #define Stealth 		u.uprops[STEALTH].p_flgs
123.  #define Aggravate_monster	u.uprops[AGGRAVATE_MONSTER].p_flgs
124.  #define Conflict		u.uprops[CONFLICT].p_flgs
125.  #define Protection		u.uprops[PROTECTION].p_flgs
126.  #define Protection_from_shape_changers	u.uprops[PROT_FROM_SHAPE_CHANGERS].p_flgs
127.  #define Warning 		u.uprops[WARNING].p_flgs
128.  
129.  #define HTelepat		u.uprops[TELEPAT].p_flgs
130.  #ifdef POLYSELF
131.  #define Telepat 		((HTelepat) || (u.umonnum == PM_FLOATING_EYE))
132.  #else
133.  #define Telepat 		(HTelepat)
134.  #endif
135.  
136.  #define Fast			u.uprops[FAST].p_flgs
137.  
138.  #define HStun			u.uprops[STUN].p_flgs
139.  #ifdef POLYSELF
140.  #define Stunned 	((HStun) || u.usym == S_BAT || u.usym == S_STALKER)
141.  #else
142.  #define Stunned 		(HStun)
143.  #endif
144.  
145.  #define HConfusion		u.uprops[CONFUSION].p_flgs
146.  #define Confusion		(HConfusion)
147.  
148.  #define Sick			u.uprops[SICK].p_flgs
149.  #define Blinded 		u.uprops[BLINDED].p_flgs
150.  #define Blind			(Blinded || Blindfolded)
151.  #define Sleeping		u.uprops[SLEEPING].p_flgs
152.  #define Wounded_legs		u.uprops[WOUNDED_LEGS].p_flgs
153.  #define Stoned			u.uprops[STONED].p_flgs
154.  #define Strangled		u.uprops[STRANGLED].p_flgs
155.  #define Hallucination		u.uprops[HALLUC].p_flgs
156.  #define Fumbling		u.uprops[FUMBLING].p_flgs
157.  #define Jumping 		u.uprops[JUMPING].p_flgs
158.  #define Wwalking		u.uprops[WWALKING].p_flgs
159.  #define Hunger			u.uprops[HUNGER].p_flgs
160.  #define Glib			u.uprops[GLIB].p_flgs
161.  #define Reflecting		u.uprops[REFLECTING].p_flgs
162.  #define Lifesaved		u.uprops[LIFESAVED].p_flgs
163.  #define Antimagic		u.uprops[ANTIMAGIC].p_flgs
164.  #define Displaced		u.uprops[DISPLACED].p_flgs
165.  #define Clairvoyant		u.uprops[CLAIRVOYANT].p_flgs
166.  
167.  #endif /* YOUPROP_H /**/