blob: dba313ec59af27a1064a898f67442893c867f361 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#pragma once
#include "ItemHandler.h"
class cItemMushroomSoupHandler :
public cItemHandler
{
typedef cItemHandler super;
public:
cItemMushroomSoupHandler(int a_ItemType)
: super(a_ItemType)
{
}
virtual bool IsFood(void) override
{
return true;
}
virtual FoodInfo GetFoodInfo(void) override
{
return FoodInfo(6, 7.2);
}
virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
{
if (!super::EatItem(a_Player, a_Item))
{
return false;
}
// Return a bowl to the inventory
if (!a_Player->IsGameModeCreative())
{
a_Player->GetInventory().AddItem(cItem(E_ITEM_BOWL), true, true);
}
return true;
}
};
|