30 std::vector<std::pair<int, float>>
times;
36 std::optional<float>
getTime(
int rating)
const {
37 for (
auto &it :
times) {
38 if (it.first == rating)
44 void toJson(Json::Value &
object)
const;
45 void fromJson(
const Json::Value &json);
49typedef std::map<std::string, ToolGroupCap>
ToolGCMap;
61 float full_punch_interval_ = 1.4f,
62 int max_drop_level_ = 1,
65 int punch_attack_uses_ = 0
74 void serialize(std::ostream &os, u16 version)
const;
126 DigParams(
bool a_diggable =
false,
float a_time = 0.0f, u32 a_wear = 0,
127 const std::string &a_main_group =
""):
137 const u16 initial_wear = 0);
153 u16 initial_wear = 0);
173 float time_from_last_punch,
std::unordered_map< std::string, int > ItemGroupList
Definition itemgroup.h:10
bool diggable
Definition tool.h:119
std::string main_group
Definition tool.h:124
float time
Definition tool.h:121
DigParams(bool a_diggable=false, float a_time=0.0f, u32 a_wear=0, const std::string &a_main_group="")
Definition tool.h:126
u32 wear
Definition tool.h:123
u32 wear
Definition tool.h:143
HitParams(s32 hp_=0, u32 wear_=0)
Definition tool.h:145
s32 hp
Definition tool.h:141
Definition inventory.h:19
bool did_punch
Definition tool.h:160
int wear
Definition tool.h:162
PunchDamageResult()=default
int damage
Definition tool.h:161
video::SColor getWearBarColor(f32 durabilityPercent)
Definition tool.cpp:275
void serialize(std::ostream &os) const
Definition tool.cpp:196
void serializeJson(std::ostream &os) const
Definition tool.cpp:230
constexpr static const EnumString es_BlendMode[3]
Definition tool.h:91
std::map< f32, video::SColor > colorStops
Definition tool.h:97
WearBarParams(const video::SColor color)
Definition tool.h:105
static std::optional< WearBarParams > deserializeJson(std::istream &is)
Definition tool.cpp:243
WearBarParams(const std::map< f32, video::SColor > &colorStops, BlendMode blend)
Definition tool.h:100
BlendMode
Definition tool.h:86
@ BLEND_MODE_CONSTANT
Definition tool.h:87
@ BlendMode_END
Definition tool.h:89
@ BLEND_MODE_LINEAR
Definition tool.h:88
static WearBarParams deserialize(std::istream &is)
Definition tool.cpp:207
BlendMode blend
Definition tool.h:98