From b4aa19f329b06e42eb2591fc488b70dc0df41940 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Fri, 5 Jan 2018 11:28:06 +0000 Subject: Item durability loss now depends on the item used. (#4123) Armour durability also no longer changes when it is used to break blocks or attack mobs. Fixes #4119 --- src/Items/ItemAxe.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/Items/ItemAxe.h') diff --git a/src/Items/ItemAxe.h b/src/Items/ItemAxe.h index 1f9c44f1e..aeba22cf4 100644 --- a/src/Items/ItemAxe.h +++ b/src/Items/ItemAxe.h @@ -18,7 +18,20 @@ public: } - virtual float GetBlockBreakingStrength(BLOCKTYPE a_Block) + + virtual short GetDurabilityLossByAction(eDurabilityLostAction a_Action) override + { + switch (a_Action) + { + case dlaAttackEntity: return 2; + case dlaBreakBlock: return 1; + case dlaBreakBlockInstant: return 0; + } + } + + + + virtual float GetBlockBreakingStrength(BLOCKTYPE a_Block) override { if (!IsBlockMaterialWood(a_Block) && !IsBlockMaterialPlants(a_Block) && !IsBlockMaterialVine(a_Block)) { @@ -40,7 +53,3 @@ public: } } ; - - - - -- cgit v1.2.3