diff options
Diffstat (limited to 'src/Items/ItemPoisonousPotato.h')
-rw-r--r-- | src/Items/ItemPoisonousPotato.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Items/ItemPoisonousPotato.h b/src/Items/ItemPoisonousPotato.h new file mode 100644 index 000000000..8d2dd93e7 --- /dev/null +++ b/src/Items/ItemPoisonousPotato.h @@ -0,0 +1,36 @@ + +#pragma once + +#include "ItemFood.h" + + + + + +class cItemPoisonousPotatoHandler : + public cItemFoodHandler +{ + typedef cItemFoodHandler super; + +public: + cItemPoisonousPotatoHandler() + : super(E_ITEM_POISONOUS_POTATO, FoodInfo(2, 1.2)) + { + } + + virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override + { + if (!super::EatItem(a_Player, a_Item)) + { + return false; + } + + if (GetRandomProvider().RandBool(0.6)) + { + a_Player->AddEntityEffect(cEntityEffect::effPoison, 100, 0); + } + + return true; + } + +}; |