summaryrefslogtreecommitdiffstats
path: root/source/Mobs
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2013-11-26 10:48:46 +0100
committerMattes D <github@xoft.cz>2013-11-26 10:48:46 +0100
commit6041fa1e62cc490c4595e6cd267eb96ac5b6e041 (patch)
tree00e3c895d8e0143275ba6d1a9a1ff0361714b53e /source/Mobs
parentFixed cFile compilation on Linux. (diff)
parentAdded ExpOrb.cpp and ExpOrb.h to MCServer.vcproj. (diff)
downloadcuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar
cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar.gz
cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar.bz2
cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar.lz
cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar.xz
cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar.zst
cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.zip
Diffstat (limited to 'source/Mobs')
-rw-r--r--source/Mobs/Monster.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp
index 8a5717e27..091623c8a 100644
--- a/source/Mobs/Monster.cpp
+++ b/source/Mobs/Monster.cpp
@@ -7,6 +7,7 @@
#include "../ClientHandle.h"
#include "../World.h"
#include "../Entities/Player.h"
+#include "../Entities/ExpOrb.h"
#include "../Defines.h"
#include "../MonsterConfig.h"
#include "../MersenneTwister.h"
@@ -258,6 +259,60 @@ void cMonster::KilledBy(cEntity * a_Killer)
{
m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f);
}
+ int Reward;
+ switch (m_MobType)
+ {
+ // Animals
+ case cMonster::mtChicken:
+ case cMonster::mtCow:
+ case cMonster::mtHorse:
+ case cMonster::mtPig:
+ case cMonster::mtSheep:
+ case cMonster::mtSquid:
+ case cMonster::mtMooshroom:
+ case cMonster::mtOcelot:
+ case cMonster::mtWolf:
+ {
+ Reward = m_World->GetTickRandomNumber(2) + 1;
+ }
+
+ // Monsters
+ case cMonster::mtCaveSpider:
+ case cMonster::mtCreeper:
+ case cMonster::mtEnderman:
+ case cMonster::mtGhast:
+ case cMonster::mtSilverfish:
+ case cMonster::mtSkeleton:
+ case cMonster::mtSpider:
+ case cMonster::mtWitch:
+ case cMonster::mtZombie:
+ case cMonster::mtZombiePigman:
+ case cMonster::mtSlime:
+ case cMonster::mtMagmaCube:
+ {
+ Reward = 6 + (m_World->GetTickRandomNumber(2));
+ }
+ case cMonster::mtBlaze:
+ {
+ Reward = 10;
+ }
+
+ // Bosses
+ case cMonster::mtEnderDragon:
+ {
+ Reward = 12000;
+ }
+ case cMonster::mtWither:
+ {
+ Reward = 50;
+ }
+
+ default:
+ {
+ Reward = 0;
+ }
+ }
+ m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Reward);
m_DestroyTimer = 0;
}