liblcf
rpg_item.h
Go to the documentation of this file.
1 /* !!!! GENERATED FILE - DO NOT EDIT !!!!
2  * --------------------------------------
3  *
4  * This file is part of liblcf. Copyright (c) 2020 liblcf authors.
5  * https://github.com/EasyRPG/liblcf - https://easyrpg.org
6  *
7  * liblcf is Free/Libre Open Source Software, released under the MIT License.
8  * For the full copyright and license information, please view the COPYING
9  * file that was distributed with this source code.
10  */
11 
12 #ifndef LCF_RPG_ITEM_H
13 #define LCF_RPG_ITEM_H
14 
15 // Headers
16 #include <stdint.h>
17 #include <string>
18 #include <vector>
19 #include "enum_tags.h"
20 #include "rpg_itemanimation.h"
21 
25 namespace RPG {
26  class Item {
27  public:
28  enum Type {
36  Type_book = 7,
39  Type_switch = 10
40  };
41  static constexpr auto kTypeTags = makeEnumTags<Type>(
42  "normal",
43  "weapon",
44  "shield",
45  "armor",
46  "helmet",
47  "accessory",
48  "medicine",
49  "book",
50  "material",
51  "special",
52  "switch"
53  );
54  enum Trajectory {
57  };
58  static constexpr auto kTrajectoryTags = makeEnumTags<Trajectory>(
59  "straight",
60  "return"
61  );
62  enum Target {
67  };
68  static constexpr auto kTargetTags = makeEnumTags<Target>(
69  "single",
70  "center",
71  "simultaneous",
72  "sequential"
73  );
74 
75  int ID = 0;
76  std::string name;
77  std::string description;
78  int32_t type = 0;
79  int32_t price = 0;
80  int32_t uses = 1;
81  int32_t atk_points1 = 0;
82  int32_t def_points1 = 0;
83  int32_t spi_points1 = 0;
84  int32_t agi_points1 = 0;
85  bool two_handed = false;
86  int32_t sp_cost = 0;
87  int32_t hit = 90;
88  int32_t critical_hit = 0;
89  int32_t animation_id = 1;
90  bool preemptive = false;
91  bool dual_attack = false;
92  bool attack_all = false;
93  bool ignore_evasion = false;
94  bool prevent_critical = false;
95  bool raise_evasion = false;
96  bool half_sp_cost = false;
97  bool no_terrain_damage = false;
98  bool cursed = false;
99  bool entire_party = false;
100  int32_t recover_hp_rate = 0;
101  int32_t recover_hp = 0;
102  int32_t recover_sp_rate = 0;
103  int32_t recover_sp = 0;
104  bool occasion_field1 = false;
105  bool ko_only = false;
106  int32_t max_hp_points = 0;
107  int32_t max_sp_points = 0;
108  int32_t atk_points2 = 0;
109  int32_t def_points2 = 0;
110  int32_t spi_points2 = 0;
111  int32_t agi_points2 = 0;
112  int32_t using_message = 0;
113  int32_t skill_id = 1;
114  int32_t switch_id = 1;
115  bool occasion_field2 = true;
116  bool occasion_battle = false;
117  std::vector<bool> actor_set;
118  std::vector<bool> state_set;
119  std::vector<bool> attribute_set;
120  int32_t state_chance = 0;
121  bool reverse_state_effect = false;
122  int32_t weapon_animation = -1;
123  std::vector<ItemAnimation> animation_data;
124  bool use_skill = false;
125  std::vector<bool> class_set;
126  int32_t ranged_trajectory = 0;
127  int32_t ranged_target = 0;
128  };
129 
130  inline bool operator==(const Item& l, const Item& r) {
131  return l.name == r.name
132  && l.description == r.description
133  && l.type == r.type
134  && l.price == r.price
135  && l.uses == r.uses
136  && l.atk_points1 == r.atk_points1
137  && l.def_points1 == r.def_points1
138  && l.spi_points1 == r.spi_points1
139  && l.agi_points1 == r.agi_points1
140  && l.two_handed == r.two_handed
141  && l.sp_cost == r.sp_cost
142  && l.hit == r.hit
143  && l.critical_hit == r.critical_hit
144  && l.animation_id == r.animation_id
145  && l.preemptive == r.preemptive
146  && l.dual_attack == r.dual_attack
147  && l.attack_all == r.attack_all
150  && l.raise_evasion == r.raise_evasion
151  && l.half_sp_cost == r.half_sp_cost
153  && l.cursed == r.cursed
154  && l.entire_party == r.entire_party
156  && l.recover_hp == r.recover_hp
158  && l.recover_sp == r.recover_sp
160  && l.ko_only == r.ko_only
161  && l.max_hp_points == r.max_hp_points
162  && l.max_sp_points == r.max_sp_points
163  && l.atk_points2 == r.atk_points2
164  && l.def_points2 == r.def_points2
165  && l.spi_points2 == r.spi_points2
166  && l.agi_points2 == r.agi_points2
167  && l.using_message == r.using_message
168  && l.skill_id == r.skill_id
169  && l.switch_id == r.switch_id
172  && l.actor_set == r.actor_set
173  && l.state_set == r.state_set
174  && l.attribute_set == r.attribute_set
175  && l.state_chance == r.state_chance
179  && l.use_skill == r.use_skill
180  && l.class_set == r.class_set
182  && l.ranged_target == r.ranged_target;
183  }
184 
185  inline bool operator!=(const Item& l, const Item& r) {
186  return !(l == r);
187  }
188 }
189 
190 #endif
RPG::Item::Target_sequential
@ Target_sequential
Definition: rpg_item.h:66
RPG::Item::weapon_animation
int32_t weapon_animation
Definition: rpg_item.h:122
RPG::Item::ignore_evasion
bool ignore_evasion
Definition: rpg_item.h:93
RPG::operator==
bool operator==(const Actor &l, const Actor &r)
Definition: rpg_actor.h:64
RPG::Item::def_points2
int32_t def_points2
Definition: rpg_item.h:109
RPG::Item::uses
int32_t uses
Definition: rpg_item.h:80
RPG::Item::Type_armor
@ Type_armor
Definition: rpg_item.h:32
RPG::Item::description
std::string description
Definition: rpg_item.h:77
RPG::Item::spi_points2
int32_t spi_points2
Definition: rpg_item.h:110
RPG::Item::dual_attack
bool dual_attack
Definition: rpg_item.h:91
RPG::Item
Definition: rpg_item.h:26
RPG::Item::Type_material
@ Type_material
Definition: rpg_item.h:37
RPG
Definition: rpg_actor.h:26
RPG::Item::Type_weapon
@ Type_weapon
Definition: rpg_item.h:30
RPG::Item::actor_set
std::vector< bool > actor_set
Definition: rpg_item.h:117
RPG::Item::reverse_state_effect
bool reverse_state_effect
Definition: rpg_item.h:121
RPG::Item::raise_evasion
bool raise_evasion
Definition: rpg_item.h:95
RPG::Item::kTypeTags
static constexpr auto kTypeTags
Definition: rpg_item.h:41
RPG::Item::recover_sp
int32_t recover_sp
Definition: rpg_item.h:103
RPG::Item::Target_single
@ Target_single
Definition: rpg_item.h:63
RPG::Item::half_sp_cost
bool half_sp_cost
Definition: rpg_item.h:96
RPG::Item::def_points1
int32_t def_points1
Definition: rpg_item.h:82
RPG::Item::max_hp_points
int32_t max_hp_points
Definition: rpg_item.h:106
RPG::Item::type
int32_t type
Definition: rpg_item.h:78
RPG::Item::atk_points1
int32_t atk_points1
Definition: rpg_item.h:81
RPG::Item::recover_sp_rate
int32_t recover_sp_rate
Definition: rpg_item.h:102
RPG::Item::hit
int32_t hit
Definition: rpg_item.h:87
RPG::Item::Type_book
@ Type_book
Definition: rpg_item.h:36
RPG::Item::class_set
std::vector< bool > class_set
Definition: rpg_item.h:125
RPG::Item::ko_only
bool ko_only
Definition: rpg_item.h:105
RPG::Item::animation_id
int32_t animation_id
Definition: rpg_item.h:89
RPG::Item::preemptive
bool preemptive
Definition: rpg_item.h:90
RPG::Item::entire_party
bool entire_party
Definition: rpg_item.h:99
RPG::Item::use_skill
bool use_skill
Definition: rpg_item.h:124
RPG::Item::no_terrain_damage
bool no_terrain_damage
Definition: rpg_item.h:97
RPG::Item::Trajectory_return
@ Trajectory_return
Definition: rpg_item.h:56
RPG::Item::Type_helmet
@ Type_helmet
Definition: rpg_item.h:33
RPG::Item::kTargetTags
static constexpr auto kTargetTags
Definition: rpg_item.h:68
rpg_itemanimation.h
RPG::Item::attack_all
bool attack_all
Definition: rpg_item.h:92
RPG::Item::recover_hp_rate
int32_t recover_hp_rate
Definition: rpg_item.h:100
RPG::Item::Target
Target
Definition: rpg_item.h:62
RPG::Item::ID
int ID
Definition: rpg_item.h:75
RPG::Item::agi_points2
int32_t agi_points2
Definition: rpg_item.h:111
RPG::Item::Target_simultaneous
@ Target_simultaneous
Definition: rpg_item.h:65
RPG::Item::state_chance
int32_t state_chance
Definition: rpg_item.h:120
RPG::Item::using_message
int32_t using_message
Definition: rpg_item.h:112
RPG::Item::Type_accessory
@ Type_accessory
Definition: rpg_item.h:34
RPG::Item::critical_hit
int32_t critical_hit
Definition: rpg_item.h:88
RPG::Item::cursed
bool cursed
Definition: rpg_item.h:98
RPG::Item::kTrajectoryTags
static constexpr auto kTrajectoryTags
Definition: rpg_item.h:58
RPG::operator!=
bool operator!=(const Actor &l, const Actor &r)
Definition: rpg_actor.h:98
RPG::Item::name
std::string name
Definition: rpg_item.h:76
RPG::Item::spi_points1
int32_t spi_points1
Definition: rpg_item.h:83
RPG::Item::skill_id
int32_t skill_id
Definition: rpg_item.h:113
RPG::Item::atk_points2
int32_t atk_points2
Definition: rpg_item.h:108
RPG::Item::Type_shield
@ Type_shield
Definition: rpg_item.h:31
RPG::Item::occasion_battle
bool occasion_battle
Definition: rpg_item.h:116
RPG::Item::animation_data
std::vector< ItemAnimation > animation_data
Definition: rpg_item.h:123
RPG::Item::occasion_field1
bool occasion_field1
Definition: rpg_item.h:104
RPG::Item::agi_points1
int32_t agi_points1
Definition: rpg_item.h:84
RPG::Item::prevent_critical
bool prevent_critical
Definition: rpg_item.h:94
RPG::Item::occasion_field2
bool occasion_field2
Definition: rpg_item.h:115
RPG::Item::Trajectory
Trajectory
Definition: rpg_item.h:54
RPG::Item::max_sp_points
int32_t max_sp_points
Definition: rpg_item.h:107
RPG::Item::state_set
std::vector< bool > state_set
Definition: rpg_item.h:118
RPG::Item::ranged_trajectory
int32_t ranged_trajectory
Definition: rpg_item.h:126
RPG::Item::recover_hp
int32_t recover_hp
Definition: rpg_item.h:101
RPG::Item::price
int32_t price
Definition: rpg_item.h:79
RPG::Item::Type_medicine
@ Type_medicine
Definition: rpg_item.h:35
RPG::Item::Target_center
@ Target_center
Definition: rpg_item.h:64
RPG::Item::attribute_set
std::vector< bool > attribute_set
Definition: rpg_item.h:119
RPG::Item::Type_switch
@ Type_switch
Definition: rpg_item.h:39
RPG::Item::Type
Type
Definition: rpg_item.h:28
RPG::Item::Trajectory_straight
@ Trajectory_straight
Definition: rpg_item.h:55
RPG::Item::two_handed
bool two_handed
Definition: rpg_item.h:85
RPG::Item::switch_id
int32_t switch_id
Definition: rpg_item.h:114
RPG::Item::sp_cost
int32_t sp_cost
Definition: rpg_item.h:86
RPG::Item::ranged_target
int32_t ranged_target
Definition: rpg_item.h:127
enum_tags.h
RPG::Item::Type_normal
@ Type_normal
Definition: rpg_item.h:29
RPG::Item::Type_special
@ Type_special
Definition: rpg_item.h:38