forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtalker_character.h
228 lines (205 loc) · 9.62 KB
/
talker_character.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
#pragma once
#ifndef CATA_SRC_TALKER_CHARACTER_H
#define CATA_SRC_TALKER_CHARACTER_H
#include <functional>
#include <iosfwd>
#include <list>
#include <vector>
#include "character.h"
#include "coordinates.h"
#include "npc.h"
#include "talker.h"
#include "type_id.h"
class character_id;
class faction;
class item;
class time_duration;
class vehicle;
struct tripoint;
/*
* Talker wrapper class for const Character access.
* Should never be invoked directly. Only talker_avatar and talker_npc are really valid.
*/
class talker_character_const: public talker
{
public:
explicit talker_character_const( const Character *new_me ): me_chr_const( new_me ) {
}
~talker_character_const() override = default;
// identity and location
std::string disp_name() const override;
character_id getID() const override;
bool is_male() const override;
std::vector<std::string> get_grammatical_genders() const override;
int posx() const override;
int posy() const override;
int posz() const override;
tripoint pos() const override;
tripoint_abs_ms global_pos() const override;
tripoint_abs_omt global_omt_location() const override;
int get_cur_hp( const bodypart_id &bp ) const override;
// stats, skills, traits, bionics, and magic
int str_cur() const override;
int dex_cur() const override;
int int_cur() const override;
int per_cur() const override;
int pain_cur() const override;
int get_str_max() const override;
int get_dex_max() const override;
int get_int_max() const override;
int get_per_max() const override;
int get_str_bonus() const override;
int get_dex_bonus() const override;
int get_int_bonus() const override;
int get_per_bonus() const override;
units::energy power_cur() const override;
units::energy power_max() const override;
int mana_cur() const override;
int mana_max() const override;
bool has_trait( const trait_id &trait_to_check ) const override;
bool has_flag( const json_character_flag &trait_flag_to_check ) const override;
bool crossed_threshold() const override;
int num_bionics() const override;
bool has_max_power() const override;
bool has_bionic( const bionic_id &bionics_id ) const override;
bool knows_spell( const spell_id &sp ) const override;
int get_skill_level( const skill_id &skill ) const override;
bool knows_proficiency( const proficiency_id &proficiency ) const override;
// effects and values
bool has_effect( const efftype_id &effect_id, const bodypart_id &bp ) const override;
effect get_effect( const efftype_id &effect_id, const bodypart_id &bp ) const override;
bool is_deaf() const override;
bool is_mute() const override;
std::string get_value( const std::string &var_name ) const override;
// inventory, buying, and selling
bool is_wearing( const itype_id &item_id ) const override;
int charges_of( const itype_id &item_id ) const override;
bool has_charges( const itype_id &item_id, int count ) const override;
bool has_charges( const itype_id &item_id, int count, bool in_tools ) const override;
bool has_amount( const itype_id &item_id, int count ) const override;
int get_amount( const itype_id &item_id ) const override;
int cash() const override;
std::vector<const item *> const_items_with( const std::function<bool( const item & )> &filter )
const override;
bool unarmed_attack() const override;
bool can_stash_weapon() const override;
bool has_stolen_item( const talker &guy ) const override;
// factions and alliances
faction *get_faction() const override;
// other descriptors
std::string short_description() const override;
bool has_activity() const override;
bool is_mounted() const override;
int get_activity_level() const override;
int get_fatigue() const override;
int get_hunger() const override;
int get_thirst() const override;
int get_instant_thirst() const override;
int get_stored_kcal() const override;
bool is_in_control_of( const vehicle &veh ) const override;
bool worn_with_flag( const flag_id &flag, const bodypart_id &bp ) const override;
bool wielded_with_flag( const flag_id &flag ) const override;
bool has_item_with_flag( const flag_id &flag ) const override;
bool can_see() const override;
int morale_cur() const override;
int focus_cur() const override;
int get_rad() const override;
int get_stim() const override;
int get_addiction_intensity( const addiction_id &add_id ) const override;
int get_addiction_turns( const addiction_id &add_id ) const override;
int get_pkill() const override;
int get_stamina() const override;
int get_sleep_deprivation() const override;
int get_kill_xp() const override;
int get_age() const override;
int get_height() const override;
int get_bmi_permil() const override;
const move_mode_id &get_move_mode() const override;
int get_fine_detail_vision_mod() const override;
int get_health() const override;
int get_body_temp() const override;
int get_body_temp_delta() const override;
protected:
talker_character_const() = default;
const Character *me_chr_const;
};
/*
* Talker wrapper class for mutable Character access.
* Should never be invoked directly. Only talker_avatar and talker_npc are really valid.
*/
class talker_character: public talker_character_const
{
public:
explicit talker_character( Character *new_me );
~talker_character() override = default;
// underlying element accessor functions
Character *get_character() override {
return me_chr;
}
const Character *get_character() const override {
return me_chr_const;
}
Creature *get_creature() override {
return me_chr;
}
const Creature *get_creature() const override {
return me_chr_const;
}
void set_pos( tripoint new_pos ) override;
// stats, skills, traits, bionics, and magic
void set_str_max( int value ) override;
void set_dex_max( int value ) override;
void set_int_max( int value ) override;
void set_per_max( int value ) override;
void set_str_bonus( int value ) override;
void set_dex_bonus( int value ) override;
void set_int_bonus( int value ) override;
void set_per_bonus( int value ) override;
void set_power_cur( units::energy value ) override;
void set_mana_cur( int value ) override;
void mutate( const int &highest_cat_chance, const bool &use_vitamins ) override;
void mutate_category( const mutation_category_id &mut_cat, const bool &use_vitamins ) override;
void set_mutation( const trait_id &new_trait ) override;
void unset_mutation( const trait_id &old_trait ) override;
void set_skill_level( const skill_id &skill, int value ) override;
void add_effect( const efftype_id &new_effect, const time_duration &dur,
std::string bp, bool permanent, bool force, int intensity ) override;
void remove_effect( const efftype_id &old_effect ) override;
void set_value( const std::string &var_name, const std::string &value ) override;
void remove_value( const std::string &var_name ) override;
// inventory, buying, and selling
std::vector<item *> items_with( const std::function<bool( const item & )> &filter ) const override;
std::list<item> use_charges( const itype_id &item_name, int count ) override;
std::list<item> use_charges( const itype_id &item_name, int count, bool in_tools ) override;
std::list<item> use_amount( const itype_id &item_name, int count ) override;
void i_add( const item &new_item ) override;
void remove_items_with( const std::function<bool( const item & )> &filter ) override;
void set_stored_kcal( int value ) override;
void set_thirst( int value ) override;
// speaking
void shout( const std::string &speech = "", bool order = false ) override;
void set_fatigue( int amount ) override;
void mod_pain( int amount ) override;
void mod_daily_health( int, int ) override;
void add_morale( const morale_type &new_morale, int bonus, int max_bonus, time_duration duration,
time_duration decay_started, bool capped ) override;
void remove_morale( const morale_type &old_morale ) override;
void set_addiction_turns( const addiction_id &add_id, int amount ) override;
void mod_focus( int ) override;
void set_rad( int ) override;
void set_stim( int ) override;
void set_pkill( int ) override;
void set_stamina( int ) override;
void set_sleep_deprivation( int ) override;
void set_kill_xp( int ) override;
void set_age( int ) override;
void set_height( int ) override;
void add_bionic( const bionic_id &new_bionic ) override;
void remove_bionic( const bionic_id &old_bionic ) override;
std::vector<skill_id> skills_teacheable() const override;
std::string skill_seminar_text( const skill_id &s ) const override;
protected:
talker_character() = default;
Character *me_chr;
};
#endif // CATA_SRC_TALKER_CHARACTER_H