summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemSword.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-07-23 16:32:09 +0200
committerHowaner <franzi.moos@googlemail.com>2014-07-23 16:32:09 +0200
commit396739cc0faf01a099acbe669c5a9def98d3aaae (patch)
tree91cff4c6ac486b2158edefce878174fe95e2fb3d /src/Items/ItemSword.h
parentCheckBasicStyle: Added a lua shebang. (diff)
downloadcuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar.gz
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar.bz2
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar.lz
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar.xz
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.tar.zst
cuberite-396739cc0faf01a099acbe669c5a9def98d3aaae.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemSword.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h
index 44feb2d83..8fd70bd7b 100644
--- a/src/Items/ItemSword.h
+++ b/src/Items/ItemSword.h
@@ -12,18 +12,20 @@
class cItemSwordHandler :
public cItemHandler
{
+ typedef cItemHandler super;
public:
cItemSwordHandler(int a_ItemType)
: cItemHandler(a_ItemType)
{
-
}
-
+
+
virtual bool CanHarvestBlock(BLOCKTYPE a_BlockType) override
{
return (a_BlockType == E_BLOCK_COBWEB);
}
+
virtual bool CanRepairWithRawMaterial(short a_ItemType) override
{
switch (m_ItemType)
@@ -36,6 +38,17 @@ public:
}
return false;
}
+
+
+ virtual short GetDurabilityLostWithThatAction(eDurabilityLostAction a_Action) override
+ {
+ switch (a_Action)
+ {
+ case dlaAttackEntity: return 1;
+ case dlaBreakBlock: return 2;
+ }
+ return 0;
+ }
} ;