1
0
cuberite-2a/src/Items/ItemRawChicken.h

38 lines
495 B
C
Raw Normal View History

#pragma once
#include "ItemFood.h"
2020-04-13 12:38:06 -04:00
class cItemRawChickenHandler:
public cItemFoodHandler
{
2020-04-13 12:38:06 -04:00
using Super = cItemFoodHandler;
public:
2020-04-13 12:38:06 -04:00
cItemRawChickenHandler():
Super(E_ITEM_RAW_CHICKEN, FoodInfo(2, 1.2))
{
}
virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
{
2020-04-13 12:38:06 -04:00
if (!Super::EatItem(a_Player, a_Item))
{
return false;
}
if (GetRandomProvider().RandBool(0.3))
{
a_Player->AddEntityEffect(cEntityEffect::effHunger, 600, 0);
}
return true;
}
};