3 Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "irrlichttypes.h"
27 #include "itemgroup.h"
31 std::map<int, float> times;
40 bool getTime(int rating, float *time) const
42 std::map<int, float>::const_iterator i = times.find(rating);
53 // CLANG SUCKS DONKEY BALLS
54 typedef std::map<std::string, struct ToolGroupCap> ToolGCMap;
56 struct ToolCapabilities
58 float full_punch_interval;
60 // CLANG SUCKS DONKEY BALLS
64 float full_punch_interval_=1.4,
65 int max_drop_level_=1,
66 // CLANG SUCKS DONKEY BALLS
67 ToolGCMap groupcaps_=ToolGCMap()
69 full_punch_interval(full_punch_interval_),
70 max_drop_level(max_drop_level_),
74 void serialize(std::ostream &os) const;
75 void deSerialize(std::istream &is);
81 // Digging time in seconds
85 std::string main_group;
87 DigParams(bool a_diggable=false, float a_time=0, u16 a_wear=0,
88 std::string a_main_group=""):
92 main_group(a_main_group)
96 DigParams getDigParams(const ItemGroupList &groups,
97 const ToolCapabilities *tp, float time_from_last_punch);
99 DigParams getDigParams(const ItemGroupList &groups,
100 const ToolCapabilities *tp);
106 std::string main_group;
108 HitParams(s16 hp_=0, s16 wear_=0, std::string main_group_=""):
111 main_group(main_group_)
115 HitParams getHitParams(const ItemGroupList &groups,
116 const ToolCapabilities *tp, float time_from_last_punch);
118 HitParams getHitParams(const ItemGroupList &groups,
119 const ToolCapabilities *tp);
121 struct PunchDamageResult
126 std::string main_group;
137 PunchDamageResult getPunchDamage(
138 const ItemGroupList &armor_groups,
139 const ToolCapabilities *toolcap,
140 const ItemStack *punchitem,
141 float time_from_last_punch