forked from cataclysmbnteam/Cataclysm-BN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enums.h
334 lines (298 loc) · 9.79 KB
/
enums.h
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
#pragma once
#ifndef CATA_SRC_ENUMS_H
#define CATA_SRC_ENUMS_H
template<typename T> struct enum_traits;
template<typename T>
constexpr inline int sgn( const T x )
{
return x < 0 ? -1 : ( x > 0 ? 1 : 0 );
}
enum class bionic_ui_sort_mode : int {
NONE = 0,
POWER = 1,
NAME = 2,
INVLET = 3,
nsort = 4,
};
template<>
struct enum_traits<bionic_ui_sort_mode> {
static constexpr bionic_ui_sort_mode last = bionic_ui_sort_mode::nsort;
};
enum class holiday : int {
none = 0,
new_year,
easter,
independence_day,
halloween,
thanksgiving,
christmas,
num_holiday
};
template<>
struct enum_traits<holiday> {
static constexpr holiday last = holiday::num_holiday;
};
enum class temperature_flag : int {
TEMP_NORMAL = 0,
TEMP_HEATER,
TEMP_FRIDGE,
TEMP_FREEZER,
TEMP_ROOT_CELLAR
};
//Used for autopickup and safemode rules
enum rule_state : int {
RULE_NONE,
RULE_WHITELISTED,
RULE_BLACKLISTED
};
enum visibility_type {
VIS_HIDDEN,
VIS_CLEAR,
VIS_LIT,
VIS_BOOMER,
VIS_DARK,
VIS_BOOMER_DARK
};
// Matching rules for comparing a string to an overmap terrain id.
enum class ot_match_type {
// The provided string must completely match the overmap terrain id, including
// linear direction suffixes for linear terrain types or rotation suffixes
// for rotated terrain types.
exact,
// The provided string must completely match the base type id of the overmap
// terrain id, which means that suffixes for rotation and linear terrain types
// are ignored.
type,
// The provided string must be a complete prefix (with additional parts delimited
// by an underscore) of the overmap terrain id. For example, "forest" will match
// "forest" or "forest_thick" but not "forestcabin".
prefix,
// The provided string must be contained within the overmap terrain id, but may
// occur at the beginning, end, or middle and does not have any rules about
// underscore delimiting.
contains,
num_ot_match_type
};
template<>
struct enum_traits<ot_match_type> {
static constexpr ot_match_type last = ot_match_type::num_ot_match_type;
};
enum class special_game_type : int {
NONE = 0,
TUTORIAL,
DEFENSE,
NUM_SPECIAL_GAME_TYPES
};
enum art_effect_passive : int {
AEP_NULL = 0,
// Good
AEP_STR_UP, // Strength + 4
AEP_DEX_UP, // Dexterity + 4
AEP_PER_UP, // Perception + 4
AEP_INT_UP, // Intelligence + 4
AEP_ALL_UP, // All stats + 2
AEP_SPEED_UP, // +20 speed
AEP_PBLUE, // Reduces radiation
AEP_SNAKES, // Summons friendly snakes when you're hit
AEP_INVISIBLE, // Makes you invisible
AEP_CLAIRVOYANCE, // See through walls
AEP_SUPER_CLAIRVOYANCE, // See through walls to a great distance
AEP_STEALTH, // Your steps are quieted
AEP_EXTINGUISH, // May extinguish nearby flames
AEP_GLOW, // Four-tile light source
AEP_PSYSHIELD, // Protection from fear paralyze attack
AEP_RESIST_ELECTRICITY, // Protection from electricity
AEP_CARRY_MORE, // Increases carrying capacity by 200
AEP_SAP_LIFE, // Killing non-zombie monsters may heal you
AEP_FUN, // Slight passive morale
// Splits good from bad
AEP_SPLIT,
// Bad
AEP_HUNGER, // Increases hunger
AEP_THIRST, // Increases thirst
AEP_SMOKE, // Emits smoke occasionally
AEP_EVIL, // Addiction to the power
AEP_SCHIZO, // Mimicks schizophrenia
AEP_RADIOACTIVE, // Increases your radiation
AEP_MUTAGENIC, // Mutates you slowly
AEP_ATTENTION, // Draws netherworld attention slowly
AEP_STR_DOWN, // Strength - 3
AEP_DEX_DOWN, // Dex - 3
AEP_PER_DOWN, // Per - 3
AEP_INT_DOWN, // Int - 3
AEP_ALL_DOWN, // All stats - 2
AEP_SPEED_DOWN, // -20 speed
AEP_FORCE_TELEPORT, // Occasionally force a teleport
AEP_MOVEMENT_NOISE, // Makes noise when you move
AEP_BAD_WEATHER, // More likely to experience bad weather
AEP_SICK, // Decreases health over time
AEP_CLAIRVOYANCE_PLUS, // See through walls to a larger distance; not bad effect, placement to preserve old saves.
NUM_AEPS
};
template<>
struct enum_traits<art_effect_passive> {
static constexpr art_effect_passive last = art_effect_passive::NUM_AEPS;
};
enum artifact_natural_property {
ARTPROP_NULL,
ARTPROP_WRIGGLING, //
ARTPROP_GLOWING, //
ARTPROP_HUMMING, //
ARTPROP_MOVING, //
ARTPROP_WHISPERING, //
ARTPROP_BREATHING, //
ARTPROP_DEAD, //
ARTPROP_ITCHY, //
ARTPROP_GLITTERING, //
ARTPROP_ELECTRIC, //
ARTPROP_SLIMY, //
ARTPROP_ENGRAVED, //
ARTPROP_CRACKLING, //
ARTPROP_WARM, //
ARTPROP_RATTLING, //
ARTPROP_SCALED,
ARTPROP_FRACTAL,
ARTPROP_MAX
};
enum phase_id : int {
PNULL, SOLID, LIQUID, GAS, PLASMA, num_phases
};
template<>
struct enum_traits<phase_id> {
static constexpr phase_id last = phase_id::num_phases;
};
// Return the class an in-world object uses to interact with the world.
// ex; if ( player.grab_type == OBJECT_VEHICLE ) { ...
// or; if ( baseactor_just_shot_at.object_type() == OBJECT_NPC ) { ...
enum object_type {
OBJECT_NONE, // Nothing, invalid.
OBJECT_ITEM, // item.h
OBJECT_ACTOR, // potential virtual base class, get_object_type() would return one of the types below
OBJECT_PLAYER, // player.h, npc.h
OBJECT_NPC, // nph.h
OBJECT_MONSTER, // monster.h
OBJECT_VEHICLE, // vehicle.h
OBJECT_TRAP, // trap.h
OBJECT_FIELD, // field.h; field_entry
OBJECT_TERRAIN, // Not a real object
OBJECT_FURNITURE, // Not a real object
NUM_OBJECTS,
};
enum liquid_source_type { LST_INFINITE_MAP = 1, LST_MAP_ITEM = 2, LST_VEHICLE = 3, LST_MONSTER = 4};
enum liquid_target_type { LTT_CONTAINER = 1, LTT_VEHICLE = 2, LTT_MAP = 3, LTT_MONSTER = 4 };
/**
* Possible layers that a piece of clothing/armor can occupy
*
* Every piece of clothing occupies one distinct layer on the body-part that
* it covers. This is used for example by @ref Character to calculate
* encumbrance values, @ref player to calculate time to wear/remove the item,
* and by @ref profession to place the characters' clothing in a sane order
* when starting the game.
*/
enum layer_level {
/* "Personal effects" layer, corresponds to PERSONAL flag */
PERSONAL_LAYER = 0,
/* "Close to skin" layer, corresponds to SKINTIGHT flag. */
UNDERWEAR_LAYER,
/* "Normal" layer, default if no flags set */
REGULAR_LAYER,
/* "Waist" layer, corresponds to WAIST flag. */
WAIST_LAYER,
/* "Outer" layer, corresponds to OUTER flag. */
OUTER_LAYER,
/* "Strapped" layer, corresponds to BELTED flag */
BELTED_LAYER,
/* "Aura" layer, corresponds to AURA flag */
AURA_LAYER,
/* Not a valid layer; used for C-style iteration through this enum */
MAX_CLOTHING_LAYER
};
inline layer_level &operator++( layer_level &l )
{
l = static_cast<layer_level>( l + 1 );
return l;
}
/** Possible reasons to interrupt an activity. */
/** New distractions need to update distraction_manager.cpp */
enum class distraction_type {
alert,
noise,
pain,
attacked,
hostile_spotted_far,
hostile_spotted_near,
talked_to,
asthma,
weather_change,
num_distraction_type,
};
template<>
struct enum_traits<distraction_type> {
static constexpr distraction_type last = distraction_type::num_distraction_type;
};
enum game_message_type : int {
m_good, /* something good happened to the player character, e.g. health boost, increasing in skill */
m_bad, /* something bad happened to the player character, e.g. damage, decreasing in skill */
m_mixed, /* something happened to the player character which is mixed (has good and bad parts),
e.g. gaining a mutation with mixed effect*/
m_warning, /* warns the player about a danger. e.g. enemy appeared, an alarm sounds, noise heard. */
m_info, /* informs the player about something, e.g. on examination, seeing an item,
about how to use a certain function, etc. */
m_neutral, /* neutral or indifferent events which aren’t informational or nothing really happened e.g.
a miss, a non-critical failure. May also effect for good or bad effects which are
just very slight to be notable. This is the default message type. */
m_debug, /* only shown when debug_mode is true */
/* custom SCT colors */
m_headshot,
m_critical,
m_grazing,
num_game_message_type
};
template<>
struct enum_traits<game_message_type> {
static constexpr game_message_type last = game_message_type::num_game_message_type;
};
enum game_message_flags {
/* No specific game message flags */
gmf_none = 0,
/* Allow the message to bypass message cooldown. */
gmf_bypass_cooldown = 1,
};
/** Structure allowing a combination of `game_message_type` and `game_message_flags`.
*/
struct game_message_params {
game_message_params( const game_message_type message_type ) : type( message_type ),
flags( gmf_none ) {}
game_message_params( const game_message_type message_type,
const game_message_flags message_flags ) : type( message_type ), flags( message_flags ) {}
/* Type of the message */
game_message_type type;
/* Flags pertaining to the message */
game_message_flags flags;
};
enum class monotonically : int {
constant,
increasing,
decreasing,
unknown,
};
constexpr bool is_increasing( monotonically m )
{
return m == monotonically::constant || m == monotonically::increasing;
}
constexpr bool is_decreasing( monotonically m )
{
return m == monotonically::constant || m == monotonically::decreasing;
}
enum MULTITILE_TYPE {
center,
corner,
edge,
t_connection,
end_piece,
unconnected,
open_,
broken,
num_multitile_types
};
#endif // CATA_SRC_ENUMS_H