summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Mooshroom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mobs/Mooshroom.cpp')
-rw-r--r--src/Mobs/Mooshroom.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/Mobs/Mooshroom.cpp b/src/Mobs/Mooshroom.cpp
index 17995ce91..4787c6096 100644
--- a/src/Mobs/Mooshroom.cpp
+++ b/src/Mobs/Mooshroom.cpp
@@ -2,11 +2,12 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Mooshroom.h"
+#include "../Entities/Player.h"
+
-// TODO: Milk Cow
@@ -30,3 +31,38 @@ void cMooshroom::GetDrops(cItems & a_Drops, cEntity * a_Killer)
+
+
+void cMooshroom::OnRightClicked(cPlayer & a_Player)
+{
+ if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_BUCKET))
+ {
+ if (!a_Player.IsGameModeCreative())
+ {
+ a_Player.GetInventory().RemoveOneEquippedItem();
+ a_Player.GetInventory().AddItem(E_ITEM_MILK);
+ }
+ }
+
+ if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_BOWL))
+ {
+ if (!a_Player.IsGameModeCreative())
+ {
+ a_Player.GetInventory().RemoveOneEquippedItem();
+ a_Player.GetInventory().AddItem(E_ITEM_MUSHROOM_SOUP);
+ }
+ }
+
+ if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_SHEARS)
+ {
+ if (!a_Player.IsGameModeCreative())
+ {
+ a_Player.UseEquippedItem();
+ }
+
+ cItems Drops;
+ Drops.push_back(cItem(E_BLOCK_RED_MUSHROOM, 5, 0));
+ m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
+ }
+}
+