26 #include <json/json.h>
32 std::unordered_map<int, float>
times;
38 bool getTime(
int rating,
float *time)
const
40 std::unordered_map<int, float>::const_iterator i =
times.find(rating);
41 if (i ==
times.end()) {
49 void toJson(Json::Value &
object)
const;
50 void fromJson(
const Json::Value &json);
54 typedef std::unordered_map<std::string, struct ToolGroupCap>
ToolGCMap;
66 float full_punch_interval_ = 1.4f,
67 int max_drop_level_ = 1,
70 int punch_attack_uses_ = 0
79 void serialize(std::ostream &os, u16 version)
const;
94 DigParams(
bool a_diggable =
false,
float a_time = 0.0f, u16 a_wear = 0,
95 const std::string &a_main_group =
""):
138 float time_from_last_punch
std::unordered_map< std::string, int > ItemGroupList
Definition: itemgroup.h:25
u16 wear
Definition: tool.h:91
bool diggable
Definition: tool.h:87
DigParams(bool a_diggable=false, float a_time=0.0f, u16 a_wear=0, const std::string &a_main_group="")
Definition: tool.h:94
std::string main_group
Definition: tool.h:92
float time
Definition: tool.h:89
u16 wear
Definition: tool.h:109
HitParams(s16 hp_=0, u16 wear_=0)
Definition: tool.h:111
s16 hp
Definition: tool.h:108
Definition: inventory.h:34
bool did_punch
Definition: tool.h:125
int wear
Definition: tool.h:127
PunchDamageResult()=default
int damage
Definition: tool.h:126