summaryrefslogtreecommitdiffstats
path: root/src/Mobs/CaveSpider.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-30 16:13:31 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-30 16:13:31 +0200
commit48dff0f03c5df964a411e310f8905aaa3c84ac27 (patch)
treefe76a724ce321fabd6cb261a41799b741ca0a394 /src/Mobs/CaveSpider.cpp
parentremoved agressiveMonster (diff)
downloadcuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar.gz
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar.bz2
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar.lz
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar.xz
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.tar.zst
cuberite-48dff0f03c5df964a411e310f8905aaa3c84ac27.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/CaveSpider.cpp61
1 files changed, 31 insertions, 30 deletions
diff --git a/src/Mobs/CaveSpider.cpp b/src/Mobs/CaveSpider.cpp
index 8d8e15d85..0e33282c0 100644
--- a/src/Mobs/CaveSpider.cpp
+++ b/src/Mobs/CaveSpider.cpp
@@ -8,8 +8,9 @@
cCaveSpider::cCaveSpider(void) :
- super("CaveSpider", mtCaveSpider, "entity.spider.hurt", "entity.spider.death", 0.7, 0.5)
+ super("CaveSpider", mtCaveSpider, "entity.spider.hurt", "entity.spider.death", 0.7, 0.5)
{
+ m_EMPersonality = AGGRESSIVE;
}
@@ -18,14 +19,14 @@ cCaveSpider::cCaveSpider(void) :
void cCaveSpider::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
- super::Tick(a_Dt, a_Chunk);
- if (!IsTicking())
- {
- // The base class tick destroyed us
- return;
- }
-
- m_EMPersonality = (GetWorld()->GetTimeOfDay() < (12000 + 1000)) ? PASSIVE : AGGRESSIVE;
+ super::Tick(a_Dt, a_Chunk);
+ if (!IsTicking())
+ {
+ // The base class tick destroyed us
+ return;
+ }
+
+ m_EMPersonality = (GetWorld()->GetTimeOfDay() < (12000 + 1000)) ? PASSIVE : AGGRESSIVE;
}
@@ -34,17 +35,17 @@ void cCaveSpider::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
/*
bool cCaveSpider::Attack(std::chrono::milliseconds a_Dt)
{
- if (!super::Attack(a_Dt))
- {
- return false;
- }
-
- if (GetTarget()->IsPawn())
- {
- // TODO: Easy = no poison, Medium = 7 seconds, Hard = 15 seconds
- static_cast<cPawn *>(GetTarget())->AddEntityEffect(cEntityEffect::effPoison, 7 * 20, 0);
- }
- return true;
+ if (!super::Attack(a_Dt))
+ {
+ return false;
+ }
+
+ if (GetTarget()->IsPawn())
+ {
+ // TODO: Easy = no poison, Medium = 7 seconds, Hard = 15 seconds
+ static_cast<cPawn *>(GetTarget())->AddEntityEffect(cEntityEffect::effPoison, 7 * 20, 0);
+ }
+ return true;
}*/
@@ -53,16 +54,16 @@ bool cCaveSpider::Attack(std::chrono::milliseconds a_Dt)
void cCaveSpider::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- unsigned int LootingLevel = 0;
- if (a_Killer != nullptr)
- {
- LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
- }
- AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STRING);
- if ((a_Killer != nullptr) && (a_Killer->IsPlayer() || a_Killer->IsA("cWolf")))
- {
- AddRandomUncommonDropItem(a_Drops, 33.0f, E_ITEM_SPIDER_EYE);
- }
+ unsigned int LootingLevel = 0;
+ if (a_Killer != nullptr)
+ {
+ LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
+ }
+ AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STRING);
+ if ((a_Killer != nullptr) && (a_Killer->IsPlayer() || a_Killer->IsA("cWolf")))
+ {
+ AddRandomUncommonDropItem(a_Drops, 33.0f, E_ITEM_SPIDER_EYE);
+ }
}