-
-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathspecial_trait.h
81 lines (66 loc) · 1.67 KB
/
special_trait.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
#pragma once
#include "util.h"
#include "body_part.h"
#include "color.h"
#include "item_type.h"
#include "pretty_archive.h"
#include "lasting_effect.h"
#include "creature_predicate.h"
#include "special_attr.h"
#include "companion_info.h"
#include "workshop_type.h"
#include "lasting_or_buff.h"
struct ExtraTraining {
AttrType SERIAL(type);
int SERIAL(increase);
SERIALIZE_ALL(type, increase)
};
struct ExtraBodyPart {
BodyPart SERIAL(part);
int SERIAL(count);
SERIALIZE_ALL(part, count)
};
struct ExtraIntrinsicAttack {
BodyPart SERIAL(part);
ItemType SERIAL(item);
SERIALIZE_ALL(part, item)
};
struct AttrBonus {
AttrType SERIAL(attr);
int SERIAL(increase);
SERIALIZE_ALL(attr, increase)
};
class SpecialTrait;
struct OneOfTraits {
vector<SpecialTrait> SERIAL(traits);
SERIALIZE_ALL(traits)
};
struct Lasting {
LastingOrBuff SERIAL(effect);
optional<TimeInterval> SERIAL(time);
SERIALIZE_ALL(NAMED(effect), NAMED(time))
};
#define VARIANT_TYPES_LIST\
X(ExtraTraining, 0)\
X(Lasting, 1)\
X(AttrBonus, 2)\
X(SpecialAttr, 3)\
X(OneOfTraits, 4)\
X(ExtraBodyPart, 5)\
X(ExtraIntrinsicAttack, 6)\
X(CompanionInfo, 7)
#define VARIANT_NAME SpecialTrait
#include "gen_variant.h"
#include "gen_variant_serialize.h"
inline
#include "gen_variant_serialize_pretty.h"
#undef VARIANT_TYPES_LIST
#undef VARIANT_NAME
extern void applySpecialTrait(GlobalTime, SpecialTrait, Creature*, const ContentFactory*);
extern SpecialTrait transformBeforeApplying(SpecialTrait);
struct SpecialTraitInfo {
double SERIAL(prob);
vector<SpecialTrait> SERIAL(traits);
optional<Color> SERIAL(colorVariant);
SERIALIZE_ALL(NAMED(prob), NAMED(traits), NAMED(colorVariant))
};