Source:NetHack 3.1.0/trap.h

From NetHackWiki
Revision as of 07:42, 4 March 2008 by Kernigh bot (talk | contribs) (NetHack 3.1.0/trap.h moved to Source:NetHack 3.1.0/trap.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 trap.h from the source code of NetHack 3.1.0. To link to a particular line, write [[NetHack 3.1.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.1	92/09/28	*/
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    /* note: no longer manipulated by 'makedefs' */
6.    
7.    #ifndef TRAP_H
8.    #define TRAP_H
9.    
10.   struct trap {
11.   	struct trap *ntrap;
12.   	xchar tx,ty;
13.   	Bitfield(ttyp,5);
14.   	Bitfield(tseen,1);
15.   	Bitfield(once,1);
16.   	d_level dst;	/* destination for portals */
17.   };
18.   
19.   extern struct trap *ftrap;
20.   #define newtrap()	(struct trap *) alloc(sizeof(struct trap))
21.   #define dealloc_trap(trap) free((genericptr_t) (trap))
22.   
23.   /* unconditional traps */
24.   #define NO_TRAP		0
25.   #define ARROW_TRAP	1
26.   #define DART_TRAP	2
27.   #define ROCKTRAP	3
28.   #define SQKY_BOARD	4
29.   #define BEAR_TRAP	5
30.   #define LANDMINE	6
31.   #define SLP_GAS_TRAP	7
32.   #define RUST_TRAP	8
33.   #define FIRE_TRAP	9
34.   #define PIT		10
35.   #define SPIKED_PIT	11
36.   #define TRAPDOOR	12
37.   #define TELEP_TRAP	13
38.   #define LEVEL_TELEP	14
39.   #define MAGIC_PORTAL    15
40.   #define WEB		16
41.   #define STATUE_TRAP	17
42.   #define MAGIC_TRAP	18
43.   #define ANTI_MAGIC	19
44.   
45.   /* conditional feature traps */
46.   #ifdef POLYSELF
47.   #define POLY_TRAP	20
48.   #define TRAPNUM	21
49.   #else
50.   #define TRAPNUM	20
51.   #endif
52.   
53.   #endif /* TRAP_H */