summaryrefslogblamecommitdiffstats
path: root/src/Items/ItemMilk.h
blob: 515c80493088eaf669c933bdf5799e5fed5bca03 (plain) (tree)
1
2
3
4
5
6
7


            



 








                                   
 
                                                             
         
                                     

                            
 

                                                                         
                               
                                               



                                                                         
                                                                               
                 


                            

#pragma once





class cItemMilkHandler:
	public cItemHandler
{
	typedef cItemHandler super;
public:
	cItemMilkHandler():
		super(E_ITEM_MILK)
	{
	}

	virtual bool IsDrinkable(short a_ItemDamage) override
	{
		UNUSED(a_ItemDamage);
		return true;
	}

	virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
	{
		UNUSED(a_Item);
		a_Player->ClearEntityEffects();

		if (!a_Player->IsGameModeCreative())
		{
			a_Player->GetInventory().RemoveOneEquippedItem();
			a_Player->GetInventory().AddItem(cItem(E_ITEM_BUCKET));
		}
		return true;
	}
};