summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemRottenFlesh.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Items/ItemRottenFlesh.h')
-rw-r--r--src/Items/ItemRottenFlesh.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Items/ItemRottenFlesh.h b/src/Items/ItemRottenFlesh.h
new file mode 100644
index 000000000..a4b34e8bc
--- /dev/null
+++ b/src/Items/ItemRottenFlesh.h
@@ -0,0 +1,36 @@
+
+#pragma once
+
+#include "ItemFood.h"
+
+
+
+
+
+class cItemRottenFleshHandler :
+ public cItemFoodHandler
+{
+ typedef cItemFoodHandler super;
+
+public:
+ cItemRottenFleshHandler()
+ : super(E_ITEM_ROTTEN_FLESH, FoodInfo(4, 0.8))
+ {
+ }
+
+ virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
+ {
+ if (!super::EatItem(a_Player, a_Item))
+ {
+ return false;
+ }
+
+ if (GetRandomProvider().RandBool(0.8))
+ {
+ a_Player->AddEntityEffect(cEntityEffect::effHunger, 600, 0);
+ }
+
+ return true;
+ }
+
+};