forked from cataclysmbnteam/Cataclysm-BN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pldata.h
80 lines (66 loc) · 1.56 KB
/
pldata.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
#pragma once
#ifndef CATA_SRC_PLDATA_H
#define CATA_SRC_PLDATA_H
#include "calendar.h"
class JsonIn;
class JsonOut;
template <typename E> struct enum_traits;
enum class character_type : int {
CUSTOM,
RANDOM,
TEMPLATE,
NOW,
FULL_RANDOM,
};
enum class add_type : int {
NONE,
CAFFEINE, ALCOHOL, SLEEP, PKILLER, SPEED, CIG,
COKE, CRACK, MUTAGEN, DIAZEPAM,
MARLOSS_R, MARLOSS_B, MARLOSS_Y,
NUM_ADD_TYPES // last
};
template<>
struct enum_traits<add_type> {
static constexpr add_type last = add_type::NUM_ADD_TYPES;
};
enum hp_part : int {
hp_head = 0,
hp_torso,
hp_arm_l,
hp_arm_r,
hp_leg_l,
hp_leg_r,
num_hp_parts
};
template<>
struct enum_traits<hp_part> {
static constexpr hp_part last = num_hp_parts;
};
class addiction
{
public:
add_type type = add_type::NONE;
int intensity = 0;
time_duration sated = 1_hours;
addiction() = default;
addiction( add_type const t, const int i = 1 ) : type {t}, intensity {i} { }
void serialize( JsonOut &json ) const;
void deserialize( JsonIn &jsin );
};
struct social_modifiers {
int lie = 0;
int persuade = 0;
int intimidate = 0;
social_modifiers &operator+=( const social_modifiers &other ) {
this->lie += other.lie;
this->persuade += other.persuade;
this->intimidate += other.intimidate;
return *this;
}
};
inline social_modifiers operator+( social_modifiers lhs, const social_modifiers &rhs )
{
lhs += rhs;
return lhs;
}
#endif // CATA_SRC_PLDATA_H