forked from Whales/Cataclysm2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem.h
85 lines (68 loc) · 1.84 KB
/
item.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
#ifndef _ITEM_H_
#define _ITEM_H_
#include "item_type.h"
#include "enum.h"
#include <string>
#include <vector>
class Stats;
class Entity;
struct Ranged_attack;
class Item
{
public:
Item(Item_type* T = NULL);
Item(const Item &rhs);
~Item();
Item& operator=(const Item &rhs);
Item_type* type;
Item_class get_item_class();
Item_action default_action();
bool is_real();
bool can_reload();
int time_to_reload();
int time_to_fire();
// Info fetching
int get_uid();
glyph top_glyph();
std::string get_data_name();
std::string get_name();
std::string get_name_indefinite();
std::string get_name_definite();
std::string get_name_full(); // Includes charges, mode, etc.
std::string get_description();
std::string get_description_full(); // Includes type-specific values
int get_weight();
int get_volume();
int get_volume_capacity();
int get_volume_capacity_used();
bool has_flag(Item_flag itf);
bool covers(Body_part part);
int get_damage(Damage_type dtype);
int get_to_hit();
int get_base_attack_speed();
int get_base_attack_speed(Stats stats);
int get_max_charges();
bool combines();
bool combine_by_charges();
Ranged_attack get_thrown_attack();
Ranged_attack get_fired_attack();
// Changing
bool combine_with(const Item& rhs);
//Item in_its_container();
bool place_in_its_container();
bool add_contents(Item it);
bool reload(Entity* owner, int ammo_uid);
bool damage(int dam); // Returns true if the item is destroyed
bool absorb_damage(Damage_type damtype, int dam); // Returns true if destroyed
// Interfaces
Item_action show_info(Entity* user = NULL);
Item_type* ammo; // Currently-loaded ammo type.
std::vector<Item> contents; // Contents, attached mods, etc.
int count;
int charges;
int hp;
private:
int uid;
};
std::string list_items(std::vector<Item> *items);
#endif