forked from CleverRaven/Cataclysm-DDA
/
trapdef.cpp
159 lines (127 loc) · 4.64 KB
/
trapdef.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#include "game.h"
void game::init_traps()
{
int id = -1;
#define TRAP(name, sym, color, visibility, avoidance, difficulty, action, ...) \
id++;\
traps.push_back(new trap(id, sym, color, name, visibility, avoidance,\
difficulty, action, __VA_ARGS__));
TRAP("none", '?', c_white, 20, 0, 0, &trapfunc::none, &trapfuncm::none,
NULL);
// Name Symbol Color Vis Avd Diff
TRAP("bubblewrap", '_', c_ltcyan, 0, 8, 0,
&trapfunc::bubble, &trapfuncm::bubble,
itm_bubblewrap, NULL);
// Name Symbol Colour Vis Avd Diff
TRAP("cot", '#', c_green, 0, 0, 0,
&trapfunc::none, &trapfuncm::cot,
itm_cot, NULL);
// Name Symbol Colour Vis Avd Diff
TRAP("brazier", '#', c_red, 0, 0, 0,
&trapfunc::none, &trapfuncm::none,
itm_brazier, NULL);
// Name Symbol Colour Vis Avd Diff
TRAP("roll mat", '#', c_blue, 0, 0, 0,
&trapfunc::none, &trapfuncm::none,
itm_rollmat, NULL);
// Name Symbol Color Vis Avd Diff
TRAP("bear trap", '^', c_blue, 2, 7, 3,
&trapfunc::beartrap, &trapfuncm::beartrap,
itm_beartrap, NULL);
// Name Symbol Color Vis Avd Diff
TRAP("buried bear trap", '^', c_blue, 9, 8, 4,
&trapfunc::beartrap, &trapfuncm::beartrap,
itm_beartrap, NULL);
// Name Symbol Color Vis Avd Diff
TRAP("rabbit snare", '\\', c_brown, 5, 10, 2,
&trapfunc::snare, &trapfuncm::snare,
itm_stick, itm_string_36, NULL);
TRAP("spiked board", '_', c_ltgray, 1, 6, 0,
&trapfunc::board, &trapfuncm::board,
itm_board_trap, NULL);
TRAP("tripwire", '^', c_ltred, 6, 4, 3,
&trapfunc::tripwire, &trapfuncm::tripwire,
itm_string_36, NULL);
TRAP("crossbow trap", '^', c_green, 5, 4, 5,
&trapfunc::crossbow, &trapfuncm::crossbow,
itm_string_36, itm_crossbow, NULL);
TRAP("shotgun trap", '^', c_red, 4, 5, 6,// 2 shots
&trapfunc::shotgun, &trapfuncm::shotgun,
itm_string_36, itm_shotgun_sawn, NULL);
TRAP("shotgun trap", '^', c_red, 4, 5, 6,// 1 shot
&trapfunc::shotgun, &trapfuncm::shotgun,
itm_string_36, itm_shotgun_sawn, NULL);
TRAP("spinning blade engine", '_', c_ltred, 0, 0, 2,
&trapfunc::none, &trapfuncm::none,
itm_motor, itm_machete, itm_machete, NULL);
TRAP("spinning blade", '\\', c_cyan, 0, 4, 99,
&trapfunc::blade, &trapfuncm::blade,
NULL);
// Name Symbol Color Vis Avd Diff
TRAP("land mine", '_', c_red, 10, 14, 10,
&trapfunc::landmine, &trapfuncm::landmine,
itm_landmine, NULL);
// Name Symbol Color Vis Avd Diff
TRAP("teleport pad", '_', c_magenta, 0, 15, 20,
&trapfunc::telepad, &trapfuncm::telepad,
itm_null, NULL);
// Name Symbol Color Vis Avd Diff
TRAP("goo pit", '_', c_dkgray, 0, 15, 15,
&trapfunc::goo, &trapfuncm::goo,
itm_null, NULL);
// Name Symbol Color Vis Avd Diff
TRAP("dissector", '7', c_cyan, 2, 20, 99,
&trapfunc::dissector, &trapfuncm::dissector,
itm_null, NULL);
// Name Symbol Color Vis Avd Diff
TRAP("sinkhole", '_', c_brown, 10, 14, 99,
&trapfunc::sinkhole, &trapfuncm::sinkhole,
itm_null, NULL);
TRAP("pit", '0', c_brown, 0, 8, 99,
&trapfunc::pit, &trapfuncm::pit,
itm_null, NULL);
TRAP("spiked pit", '0', c_blue, 0, 8, 99,
&trapfunc::pit_spikes, &trapfuncm::pit_spikes,
itm_null, NULL);
TRAP("lava", '~', c_red, 0, 99, 99,
&trapfunc::lava, &trapfuncm::lava,
itm_null, NULL);
// The '%' symbol makes the portal cycle through ~*0&
// Name Symbol Color Vis Avd Diff
TRAP("shimmering portal", '%', c_magenta, 0, 30, 99,
&trapfunc::portal, &trapfuncm::portal,
itm_null, NULL);
TRAP("ledge", ' ', c_black, 0, 99, 99,
&trapfunc::ledge, &trapfuncm::ledge,
itm_null, NULL);
TRAP("boobytrap", '^', c_ltcyan, 5, 4, 7,
&trapfunc::boobytrap, &trapfuncm::boobytrap,
itm_null, NULL);
TRAP("raised tile", '^', c_ltgray, 9, 20, 99,
&trapfunc::temple_flood,&trapfuncm::none,
itm_null, NULL);
// Toggles through states of RGB walls
TRAP("", '^', c_white, 99, 99, 99,
&trapfunc::temple_toggle, &trapfuncm::none,
itm_null, NULL);
// Glow attack
TRAP("", '^', c_white, 99, 99, 99,
&trapfunc::glow, &trapfuncm::glow,
itm_null, NULL);
// Hum attack
TRAP("", '^', c_white, 99, 99, 99,
&trapfunc::hum, &trapfuncm::hum,
itm_null, NULL);
// Shadow spawn
TRAP("", '^', c_white, 99, 99, 99,
&trapfunc::shadow, &trapfuncm::none,
itm_null, NULL);
// Drain attack
TRAP("", '^', c_white, 99, 99, 99,
&trapfunc::drain, &trapfuncm::drain,
itm_null, NULL);
// Snake spawn / hisssss
TRAP("", '^', c_white, 99, 99, 99,
&trapfunc::snake, &trapfuncm::snake,
itm_null, NULL);
}