forked from Whales/Cataclysm2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskill.h
79 lines (63 loc) · 1.54 KB
/
skill.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
#ifndef _SKILL_H_
#define _SKILL_H_
#include <string>
enum Skill_type
{
SKILL_NULL = 0,
// Melee stuff
SKILL_MELEE,
SKILL_UNARMED,
SKILL_BASH,
SKILL_CUT,
SKILL_PIERCE,
SKILL_DODGE,
// Ranged stuff
SKILL_THROWING,
SKILL_LAUNCHERS,
SKILL_HANDGUNS,
SKILL_SHOTGUNS,
SKILL_SMGS,
SKILL_RIFLES,
SKILL_BOWS,
// Crafting & Construction
SKILL_COOKING,
SKILL_MECHANICS,
SKILL_ELECTRONICS,
SKILL_CONSTRUCTION,
// Interpersonal
SKILL_SPEECH,
SKILL_BARTER,
// Other stuff
SKILL_FIRST_AID,
SKILL_BOTANY,
SKILL_SURVIVAL,
SKILL_DRIVING,
SKILL_MAX
};
Skill_type lookup_skill_type(std::string name);
// The internal data name, used in data files
std::string skill_type_name(Skill_type type);
// The name as we display it to the user
std::string skill_type_user_name(Skill_type type);
bool is_skill_mental(Skill_type type);
struct Skill_set
{
Skill_set();
~Skill_set();
Skill_set& operator=(const Skill_set& rhs);
int get_level(Skill_type type) const;
void set_level(Skill_type type, int lev);
void increase_level(Skill_type type, int amount = 1);
int get_max_level(Skill_type type) const;
void set_max_level(Skill_type type, int lev);
void increase_max_level(Skill_type type, int amount = 1);
void unlock_skill(Skill_type type); // No max level anymore!
int improve_cost(Skill_type type);
bool is_unlocked(Skill_type type) const;
bool maxed_out(Skill_type type) const; // true if level >= max_level
private:
int level[SKILL_MAX];
int max_level[SKILL_MAX];
bool unlocked[SKILL_MAX];
};
#endif