summaryrefslogblamecommitdiffstats
path: root/src/Items/ItemSoup.h
blob: 974a410a834cfc553e6dd4c5ed97873fdf803b42 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                     
                             

                               
                                       

       
 
                                                                        
                                             



         
                                                                               















                                                                                     

#pragma once

#include "ItemFood.h"
#include "../World.h"





class cItemSoupHandler final:
	public cItemFoodHandler
{
	using Super = cItemFoodHandler;

public:

	constexpr cItemSoupHandler(int a_ItemType, FoodInfo a_FoodInfo):
		Super(a_ItemType, a_FoodInfo)
	{

	}

	virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) const override
	{
		// Skip over food handler, which does removal for us.
		if (!cItemHandler::EatItem(a_Player, a_Item))
		{
			return false;
		}

		if (!a_Player->IsGameModeCreative())
		{
			a_Player->ReplaceOneEquippedItemTossRest(cItem(E_ITEM_BOWL));
		}

		return true;
	}

};