diff options
author | PilzAdam <pilzadam@minetest.net> | 2013-03-28 21:40:44 +0100 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-03-29 20:14:09 +0100 |
commit | 7d9329ecfe84733cdefa34eab25ee3d124c94c59 (patch) | |
tree | c31fa17924b27fc57e30e5c3fe619d96b75f14d4 /src/tool.h | |
parent | 3640c8c051bc6b72f4af52752b2d48ced274f539 (diff) | |
download | minetest-7d9329ecfe84733cdefa34eab25ee3d124c94c59.tar.gz minetest-7d9329ecfe84733cdefa34eab25ee3d124c94c59.tar.bz2 minetest-7d9329ecfe84733cdefa34eab25ee3d124c94c59.zip |
New damage system, add damageGroups to ToolCapabilities, bump protocol version
Diffstat (limited to 'src/tool.h')
-rw-r--r-- | src/tool.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/tool.h b/src/tool.h index e812a9e36..509561a16 100644 --- a/src/tool.h +++ b/src/tool.h @@ -52,6 +52,7 @@ struct ToolGroupCap // CLANG SUCKS DONKEY BALLS typedef std::map<std::string, struct ToolGroupCap> ToolGCMap; +typedef std::map<std::string, s16> DamageGroup; struct ToolCapabilities { @@ -59,19 +60,22 @@ struct ToolCapabilities int max_drop_level; // CLANG SUCKS DONKEY BALLS ToolGCMap groupcaps; + DamageGroup damageGroups; ToolCapabilities( float full_punch_interval_=1.4, int max_drop_level_=1, // CLANG SUCKS DONKEY BALLS - ToolGCMap groupcaps_=ToolGCMap() + ToolGCMap groupcaps_=ToolGCMap(), + DamageGroup damageGroups_=DamageGroup() ): full_punch_interval(full_punch_interval_), max_drop_level(max_drop_level_), - groupcaps(groupcaps_) + groupcaps(groupcaps_), + damageGroups(damageGroups_) {} - void serialize(std::ostream &os) const; + void serialize(std::ostream &os, u16 version) const; void deSerialize(std::istream &is); }; @@ -103,19 +107,17 @@ struct HitParams { s16 hp; s16 wear; - std::string main_group; - HitParams(s16 hp_=0, s16 wear_=0, std::string main_group_=""): + HitParams(s16 hp_=0, s16 wear_=0): hp(hp_), - wear(wear_), - main_group(main_group_) + wear(wear_) {} }; -HitParams getHitParams(const ItemGroupList &groups, +HitParams getHitParams(const ItemGroupList &armor_groups, const ToolCapabilities *tp, float time_from_last_punch); -HitParams getHitParams(const ItemGroupList &groups, +HitParams getHitParams(const ItemGroupList &armor_groups, const ToolCapabilities *tp); struct PunchDamageResult @@ -123,7 +125,6 @@ struct PunchDamageResult bool did_punch; int damage; int wear; - std::string main_group; PunchDamageResult(): did_punch(false), |