summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mobs')
-rw-r--r--src/Mobs/CMakeLists.txt1
-rw-r--r--src/Mobs/Monster.cpp11
-rw-r--r--src/Mobs/Sheep.cpp7
3 files changed, 12 insertions, 7 deletions
diff --git a/src/Mobs/CMakeLists.txt b/src/Mobs/CMakeLists.txt
index 572dab593..e0a55a17b 100644
--- a/src/Mobs/CMakeLists.txt
+++ b/src/Mobs/CMakeLists.txt
@@ -69,4 +69,5 @@ SET (HDRS
if(NOT MSVC)
add_library(Mobs ${SRCS} ${HDRS})
+ target_link_libraries(Mobs Components)
endif()
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 1af44271b..029930266 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -1,3 +1,4 @@
+
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Monster.h"
#include "IncludeAllMonsters.h"
@@ -73,7 +74,8 @@ cMonster::cMonster(const AString & a_ConfigName, eType a_MobType, const AString
m_DropChanceBoots = 0.0f;
}
-void cMonster::Tick(float a_Dt, cChunk & a_Chunk) {
+void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
+{
super::Tick(a_Dt, a_Chunk);
if (m_Health <= 0)
@@ -106,7 +108,6 @@ void cMonster::SpawnOn(cClientHandle & a_Client)
-
void cMonster::AddRandomDropItem(cItems & a_Drops, unsigned int a_Min, unsigned int a_Max, short a_Item, short a_ItemHealth)
{
MTRand r1;
@@ -132,9 +133,6 @@ void cMonster::AddRandomUncommonDropItem(cItems & a_Drops, float a_Chance, short
}
-
-
-
void cMonster::AddRandomRareDropItem(cItems & a_Drops, cItems & a_Items, short a_LootingLevel)
{
MTRand r1;
@@ -176,8 +174,6 @@ void cMonster::AddRandomArmorDropItem(cItems & a_Drops, short a_LootingLevel)
-
-
void cMonster::AddRandomWeaponDropItem(cItems & a_Drops, short a_LootingLevel)
{
MTRand r1;
@@ -191,6 +187,7 @@ void cMonster::AddRandomWeaponDropItem(cItems & a_Drops, short a_LootingLevel)
+
cMonster::eFamily cMonster::FamilyFromType(eType a_Type)
{
// Passive-agressive mobs are counted in mob spawning code as passive
diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp
index e370a7639..a3a873b37 100644
--- a/src/Mobs/Sheep.cpp
+++ b/src/Mobs/Sheep.cpp
@@ -39,6 +39,13 @@ void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
a_Drops.push_back(cItem(E_BLOCK_WOOL, 1, m_WoolColor));
}
+
+ int LootingLevel = 0;
+ if (a_Killer != NULL)
+ {
+ LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
+ }
+ AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_MUTTON : E_ITEM_RAW_MUTTON);
}