Source:NetHack 3.4.0/trap.h

From NetHackWiki
(Redirected from NetHack 3.4.0/trap.h)
Jump to navigation Jump to search

Below is the full text to trap.h from the source code of NetHack 3.4.0. To link to a particular line, write [[NetHack 3.4.0/trap.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: @(#)trap.h	3.4	2000/08/30	*/
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    /* note for 3.1.0 and later: no longer manipulated by 'makedefs' */
6.    
7.    #ifndef TRAP_H
8.    #define TRAP_H
9.    
10.   union vlaunchinfo {
11.   	short v_launch_otyp;	/* type of object to be triggered */
12.   	coord v_launch2;	/* secondary launch point (for boulders) */
13.   };
14.   
15.   struct trap {
16.   	struct trap *ntrap;
17.   	xchar tx,ty;
18.   	d_level dst;	/* destination for portals */
19.   	coord launch;
20.   	Bitfield(ttyp,5);
21.   	Bitfield(tseen,1);
22.   	Bitfield(once,1);
23.   	Bitfield(madeby_u,1); /* So monsters may take offence when you trap
24.   				 them.	Recognizing who made the trap isn't
25.   				 completely unreasonable, everybody has
26.   				 their own style.  This flag is also needed
27.   				 when you untrap a monster.  It would be too
28.   				 easy to make a monster peaceful if you could
29.   				 set a trap for it and then untrap it. */
30.   	union vlaunchinfo vl;
31.   #define launch_otyp	vl.v_launch_otyp
32.   #define launch2		vl.v_launch2
33.   };
34.   
35.   extern struct trap *ftrap;
36.   #define newtrap()	(struct trap *) alloc(sizeof(struct trap))
37.   #define dealloc_trap(trap) free((genericptr_t) (trap))
38.   
39.   /* reasons for statue animation */
40.   #define ANIMATE_NORMAL	0
41.   #define ANIMATE_SHATTER 1
42.   #define ANIMATE_SPELL	2
43.   
44.   /* reasons for animate_statue's failure */
45.   #define AS_OK		 0	/* didn't fail */
46.   #define AS_NO_MON	 1	/* makemon failed */
47.   #define AS_MON_IS_UNIQUE 2	/* statue monster is unique */
48.   
49.   /* Note: if adding/removing a trap, adjust trap_engravings[] in mklev.c */
50.   
51.   /* unconditional traps */
52.   #define NO_TRAP		0
53.   #define ARROW_TRAP	1
54.   #define DART_TRAP	2
55.   #define ROCKTRAP	3
56.   #define SQKY_BOARD	4
57.   #define BEAR_TRAP	5
58.   #define LANDMINE	6
59.   #define ROLLING_BOULDER_TRAP	7
60.   #define SLP_GAS_TRAP	8
61.   #define RUST_TRAP	9
62.   #define FIRE_TRAP	10
63.   #define PIT		11
64.   #define SPIKED_PIT	12
65.   #define HOLE		13
66.   #define TRAPDOOR	14
67.   #define TELEP_TRAP	15
68.   #define LEVEL_TELEP	16
69.   #define MAGIC_PORTAL	17
70.   #define WEB		18
71.   #define STATUE_TRAP	19
72.   #define MAGIC_TRAP	20
73.   #define ANTI_MAGIC	21
74.   #define POLY_TRAP	22
75.   #define TRAPNUM 23
76.   
77.   #endif /* TRAP_H */