forked from miki151/keeperrl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
item_type.h
82 lines (70 loc) · 1.4 KB
/
item_type.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
#ifndef _ITEM_TYPE_H
#define _ITEM_TYPE_H
#include "enum_variant.h"
#include "effect_type.h"
enum class ItemId {
SPECIAL_KNIFE,
KNIFE,
SPEAR,
SWORD,
SPECIAL_SWORD,
ELVEN_SWORD,
SPECIAL_ELVEN_SWORD,
BATTLE_AXE,
SPECIAL_BATTLE_AXE,
WAR_HAMMER,
SPECIAL_WAR_HAMMER,
CLUB,
HEAVY_CLUB,
SCYTHE,
BOW,
ARROW,
LEATHER_ARMOR,
LEATHER_HELM,
TELEPATHY_HELM,
CHAIN_ARMOR,
IRON_HELM,
LEATHER_BOOTS,
IRON_BOOTS,
SPEED_BOOTS,
LEVITATION_BOOTS,
LEATHER_GLOVES,
DEXTERITY_GLOVES,
STRENGTH_GLOVES,
ROBE,
SCROLL,
FIRE_SCROLL,
POTION,
MUSHROOM,
WARNING_AMULET,
HEALING_AMULET,
DEFENSE_AMULET,
RING,
FIRST_AID_KIT,
ROCK,
IRON_ORE,
GOLD_PIECE,
WOOD_PLANK,
RANDOM_TECH_BOOK,
TECH_BOOK,
TRAP_ITEM,
BOULDER_TRAP_ITEM,
AUTOMATON_ITEM,
};
struct TrapInfo {
TrapType SERIAL(trapType);
EffectType SERIAL(effectType);
bool SERIAL(alwaysVisible);
template<class Archive>
void serialize(Archive& ar, const unsigned int version) {
ar & SVAR(trapType) & SVAR(effectType) & SVAR(alwaysVisible);
}
};
class ItemType : public EnumVariant<ItemId, TYPES(EffectType, TrapInfo, LastingEffect, TechId),
ASSIGN(EffectType, ItemId::SCROLL, ItemId::POTION, ItemId::MUSHROOM),
ASSIGN(TrapInfo, ItemId::TRAP_ITEM),
ASSIGN(LastingEffect, ItemId::RING),
ASSIGN(TechId, ItemId::TECH_BOOK)> {
using EnumVariant::EnumVariant;
};
#endif