diff options
Diffstat (limited to 'src/Mobs/Behaviors/BehaviorItemReplacer.h')
-rw-r--r-- | src/Mobs/Behaviors/BehaviorItemReplacer.h | 26 |
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; +}; + + + |