diff options
author | Samuel Barney <samjbarney@gmail.com> | 2014-08-20 16:42:58 +0200 |
---|---|---|
committer | Samuel Barney <samjbarney@gmail.com> | 2014-08-20 16:42:58 +0200 |
commit | 54cb27f8197f6e8c441644ea0182feda6ae78a09 (patch) | |
tree | 33a63ee8db20c142d2cccd4b8ace3d4ff65fa88e /src/Items/ItemFishingRod.h | |
parent | Added new component files. Updated the CMakeLists files (diff) | |
parent | Merge pull request #1335 from mc-server/CodeFixes (diff) | |
download | cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar.gz cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar.bz2 cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar.lz cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar.xz cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar.zst cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.zip |
Diffstat (limited to 'src/Items/ItemFishingRod.h')
-rw-r--r-- | src/Items/ItemFishingRod.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h index 3b1ad1717..6350a38ba 100644 --- a/src/Items/ItemFishingRod.h +++ b/src/Items/ItemFishingRod.h @@ -17,13 +17,15 @@ -///////////////////////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////////////////// // cFloaterCallback class cFloaterCallback : public cEntityCallback { public: - cFloaterCallback(void) : + cFloaterCallback(void) : m_CanPickup(false), m_AttachedMobID(-1) { @@ -49,14 +51,19 @@ protected: Vector3d m_Pos; } ; -//////////////////////////////////////////////////////////////////////////// -// cSweepEntityCallback + + + + +//////////////////////////////////////////////////////////////////////////////// +// cSweepEntityCallback: + class cSweepEntityCallback : public cEntityCallback { public: cSweepEntityCallback(Vector3d a_PlayerPos) : - m_PlayerPos(a_PlayerPos) + m_PlayerPos(a_PlayerPos) { } @@ -73,6 +80,8 @@ protected: + + class cItemFishingRodHandler : public cItemHandler { @@ -106,19 +115,19 @@ public: { cItems Drops; int ItemCategory = a_World->GetTickRandomNumber(99); - if (ItemCategory <= 4) // Treasures 5% + if (ItemCategory <= 4) // Treasures 5% { int Treasure = a_World->GetTickRandomNumber(5); switch (Treasure) { case 0: { - Drops.Add(cItem(E_ITEM_BOW)); // TODO: Enchantments + Drops.Add(cItem(E_ITEM_BOW)); // TODO: Enchantments break; } case 1: { - Drops.Add(cItem(E_ITEM_BOOK)); // TODO: Enchanted book + Drops.Add(cItem(E_ITEM_BOOK)); // TODO: Enchanted book break; } case 2: @@ -201,7 +210,7 @@ public: if (FishType <= 1) // Clownfish has a 2% chance of spawning { Drops.Add(cItem(E_ITEM_RAW_FISH, 1, E_META_RAW_FISH_CLOWNFISH)); - } + } else if (FishType <= 12) // Pufferfish has a 13% chance of spawning { Drops.Add(cItem(E_ITEM_RAW_FISH, 1, E_META_RAW_FISH_CLOWNFISH)); @@ -237,3 +246,7 @@ public: return true; } } ; + + + + |