summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemGoldenApple.h
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2018-01-06 01:39:23 +0100
committerpeterbell10 <peterbell10@live.co.uk>2018-01-06 01:39:23 +0100
commit2529a898351c4b7c6372570ba53a7e25678980a9 (patch)
treef87099d4a2374bb67fad1aa35ed472eb0af05ddf /src/Items/ItemGoldenApple.h
parentImproved fishing rewards (#4120) (diff)
downloadcuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar.gz
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar.bz2
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar.lz
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar.xz
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar.zst
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemGoldenApple.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/Items/ItemGoldenApple.h b/src/Items/ItemGoldenApple.h
index 00f5ac1c0..2303e0e7a 100644
--- a/src/Items/ItemGoldenApple.h
+++ b/src/Items/ItemGoldenApple.h
@@ -21,23 +21,21 @@ public:
virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
{
- if (!super::EatItem(a_Player, a_Item))
- {
- return false;
- }
-
- // Add the effects:
- a_Player->AddEntityEffect(cEntityEffect::effAbsorption, 2400, 0);
- a_Player->AddEntityEffect(cEntityEffect::effRegeneration, 100, 1);
+ super::EatItem(a_Player, a_Item);
- // When the apple is a 'notch apple', give extra effects:
+ // Enchanted golden apples have stronger effects:
if (a_Item->m_ItemDamage >= E_META_GOLDEN_APPLE_ENCHANTED)
{
- a_Player->AddEntityEffect(cEntityEffect::effRegeneration, 600, 4);
+ a_Player->AddEntityEffect(cEntityEffect::effAbsorption, 2400, 3);
+ a_Player->AddEntityEffect(cEntityEffect::effRegeneration, 400, 1);
a_Player->AddEntityEffect(cEntityEffect::effResistance, 6000, 0);
a_Player->AddEntityEffect(cEntityEffect::effFireResistance, 6000, 0);
+ return true;
}
+ a_Player->AddEntityEffect(cEntityEffect::effAbsorption, 2400, 0);
+ a_Player->AddEntityEffect(cEntityEffect::effRegeneration, 100, 1);
+
return true;
}