NHDT->ANH, nethack->anethack, nhdat->anhdat
[aNetHack.git] / include / trap.h
blobaa2ecfa654e111cedc64b5e77777787871418eaf
1 /* aNetHack 0.0.1 trap.h $ANH-Date: 1432512776 2015/05/25 00:12:56 $ $ANH-Branch: master $:$ANH-Revision: 1.12 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* aNetHack may be freely redistributed. See license for details. */
5 /* note for 3.1.0 and later: no longer manipulated by 'makedefs' */
7 #ifndef TRAP_H
8 #define TRAP_H
10 union vlaunchinfo {
11 short v_launch_otyp; /* type of object to be triggered */
12 coord v_launch2; /* secondary launch point (for boulders) */
13 uchar v_conjoined; /* conjoined pit locations */
14 short v_tnote; /* boards: 12 notes */
17 struct trap {
18 struct trap *ntrap;
19 xchar tx, ty;
20 d_level dst; /* destination for portals */
21 coord launch;
22 Bitfield(ttyp, 5);
23 Bitfield(tseen, 1);
24 Bitfield(once, 1);
25 Bitfield(madeby_u, 1); /* So monsters may take offence when you trap
26 them. Recognizing who made the trap isn't
27 completely unreasonable, everybody has
28 their own style. This flag is also needed
29 when you untrap a monster. It would be too
30 easy to make a monster peaceful if you could
31 set a trap for it and then untrap it. */
32 union vlaunchinfo vl;
33 #define launch_otyp vl.v_launch_otyp
34 #define launch2 vl.v_launch2
35 #define conjoined vl.v_conjoined
36 #define tnote vl.v_tnote
39 extern struct trap *ftrap;
40 #define newtrap() (struct trap *) alloc(sizeof(struct trap))
41 #define dealloc_trap(trap) free((genericptr_t)(trap))
43 /* reasons for statue animation */
44 #define ANIMATE_NORMAL 0
45 #define ANIMATE_SHATTER 1
46 #define ANIMATE_SPELL 2
48 /* reasons for animate_statue's failure */
49 #define AS_OK 0 /* didn't fail */
50 #define AS_NO_MON 1 /* makemon failed */
51 #define AS_MON_IS_UNIQUE 2 /* statue monster is unique */
53 /* Note: if adding/removing a trap, adjust trap_engravings[] in mklev.c */
55 /* unconditional traps */
56 enum trap_types {
57 NO_TRAP = 0,
58 ARROW_TRAP,
59 DART_TRAP,
60 ROCKTRAP,
61 SQKY_BOARD,
62 BEAR_TRAP,
63 LANDMINE,
64 ROLLING_BOULDER_TRAP,
65 SLP_GAS_TRAP,
66 RUST_TRAP,
67 FIRE_TRAP,
68 PIT,
69 SPIKED_PIT,
70 HOLE,
71 TRAPDOOR,
72 TELEP_TRAP,
73 LEVEL_TELEP,
74 MAGIC_PORTAL,
75 WEB,
76 STATUE_TRAP,
77 MAGIC_TRAP,
78 ANTI_MAGIC,
79 POLY_TRAP,
80 VIBRATING_SQUARE,
82 TRAPNUM
85 #endif /* TRAP_H */