From f473f13585e1bc901bfeb05cd5a9bb35489595da Mon Sep 17 00:00:00 2001 From: "lapayo94@gmail.com" Date: Tue, 17 Jul 2012 12:02:03 +0000 Subject: Simple health regeneration system Prepared for food git-svn-id: http://mc-server.googlecode.com/svn/trunk@679 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/items/Item.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'source/items/Item.h') diff --git a/source/items/Item.h b/source/items/Item.h index 96f957fcf..0a38ce3c0 100644 --- a/source/items/Item.h +++ b/source/items/Item.h @@ -13,8 +13,23 @@ public: virtual bool OnDiggingBlock(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir); virtual void OnBlockDestroyed(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z); virtual void OnFoodEaten(cWorld *a_World, cPlayer *a_Player, cItem *a_Item); - virtual int GetMaxStackSize(); - virtual int GetMaxDamage(); + + struct FoodInfo + { + FoodInfo(short a_FoodLevel, float a_Saturation, char a_PoisionChance = 0) + { + FoodLevel = a_FoodLevel; + Saturation = a_Saturation; + PoisionChance = a_PoisionChance; + } + short FoodLevel; + float Saturation; + char PoisionChance; //0 - 100 + }; + + virtual FoodInfo GetFoodInfo(); + + virtual bool EatItem(cPlayer *a_Player, cItem *a_Item); virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir); -- cgit v1.2.3