summaryrefslogtreecommitdiffstats
path: root/source/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2013-11-25 21:03:26 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2013-11-25 21:03:26 +0100
commitdd76700d8d0491f385efee1a539462501cb41ad4 (patch)
treee8bacd6ae966bf47d51382a9ca06fce4f1ba2453 /source/Mobs/Monster.cpp
parentImplented ExpOrb class. (diff)
downloadcuberite-dd76700d8d0491f385efee1a539462501cb41ad4.tar
cuberite-dd76700d8d0491f385efee1a539462501cb41ad4.tar.gz
cuberite-dd76700d8d0491f385efee1a539462501cb41ad4.tar.bz2
cuberite-dd76700d8d0491f385efee1a539462501cb41ad4.tar.lz
cuberite-dd76700d8d0491f385efee1a539462501cb41ad4.tar.xz
cuberite-dd76700d8d0491f385efee1a539462501cb41ad4.tar.zst
cuberite-dd76700d8d0491f385efee1a539462501cb41ad4.zip
Diffstat (limited to 'source/Mobs/Monster.cpp')
-rw-r--r--source/Mobs/Monster.cpp53
1 files changed, 50 insertions, 3 deletions
diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp
index f250e1757..a74881978 100644
--- a/source/Mobs/Monster.cpp
+++ b/source/Mobs/Monster.cpp
@@ -259,9 +259,56 @@ void cMonster::KilledBy(cEntity * a_Killer)
{
m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f);
}
- // ToDo: Proper Exp per mob.
- cExpOrb * ExpOrb = new cExpOrb(GetPosX(), GetPosY(), GetPosZ(), 1);
- ExpOrb->Initialize(m_World);
+ int Exp;
+ 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:
+ {
+ Exp = 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:
+ {
+ Exp = 6 + (m_World->GetTickRandomNumber(2));
+ }
+
+ // Bosses
+ case cMonster::mtEnderDragon:
+ {
+ Exp = 12000;
+ }
+ case cMonster::mtWither:
+ {
+ Exp = 50;
+ }
+
+ default:
+ {
+ Exp = 0;
+ }
+ }
+ m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Exp);
m_DestroyTimer = 0;
}