summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Behaviors/BehaviorItemReplacer.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-25 13:53:20 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-25 13:53:20 +0200
commit42d3c615fe6b30111cb741b85cde9441d9d5a39b (patch)
tree9ab2905dacf583dd81243cc532fd9716ad1939ca /src/Mobs/Behaviors/BehaviorItemReplacer.h
parentCoward mobs run twice as fast (diff)
downloadcuberite-42d3c615fe6b30111cb741b85cde9441d9d5a39b.tar
cuberite-42d3c615fe6b30111cb741b85cde9441d9d5a39b.tar.gz
cuberite-42d3c615fe6b30111cb741b85cde9441d9d5a39b.tar.bz2
cuberite-42d3c615fe6b30111cb741b85cde9441d9d5a39b.tar.lz
cuberite-42d3c615fe6b30111cb741b85cde9441d9d5a39b.tar.xz
cuberite-42d3c615fe6b30111cb741b85cde9441d9d5a39b.tar.zst
cuberite-42d3c615fe6b30111cb741b85cde9441d9d5a39b.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Behaviors/BehaviorItemReplacer.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Mobs/Behaviors/BehaviorItemReplacer.h b/src/Mobs/Behaviors/BehaviorItemReplacer.h
new file mode 100644
index 000000000..e35729f0e
--- /dev/null
+++ b/src/Mobs/Behaviors/BehaviorItemReplacer.h
@@ -0,0 +1,26 @@
+#pragma once
+
+
+class cBehaviorItemReplacer;
+
+#include "Behavior.h"
+
+/** When right clicked while holding a_OriginalItem, a mob having this behavior replaces the original item
+with a_NewItem. This is used for milking cows.
+*/
+class cBehaviorItemReplacer : public cBehavior
+{
+
+public:
+ cBehaviorItemReplacer(short a_OriginalItem, short a_NewItem);
+ void AttachToMonster(cMonster & a_Parent);
+ void OnRightClicked(cPlayer & a_Player) override;
+private:
+ // Our parent
+ cMonster * m_Parent;
+ short m_OriginalItem; // Replace this item with NewItem
+ short m_NewItem;
+};
+
+
+