diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-22 12:42:39 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-22 19:55:30 +0200 |
commit | eedb71469a8d9cb94a43210e206f35e3d2bf5776 (patch) | |
tree | e99f123932e79bbb1298f122a7abf38afa2df40d /src/Mobs | |
parent | d (diff) | |
download | cuberite-eedb71469a8d9cb94a43210e206f35e3d2bf5776.tar cuberite-eedb71469a8d9cb94a43210e206f35e3d2bf5776.tar.gz cuberite-eedb71469a8d9cb94a43210e206f35e3d2bf5776.tar.bz2 cuberite-eedb71469a8d9cb94a43210e206f35e3d2bf5776.tar.lz cuberite-eedb71469a8d9cb94a43210e206f35e3d2bf5776.tar.xz cuberite-eedb71469a8d9cb94a43210e206f35e3d2bf5776.tar.zst cuberite-eedb71469a8d9cb94a43210e206f35e3d2bf5776.zip |
Diffstat (limited to 'src/Mobs')
-rw-r--r-- | src/Mobs/Blaze.cpp | 3 | ||||
-rw-r--r-- | src/Mobs/CaveSpider.cpp | 64 | ||||
-rw-r--r-- | src/Mobs/CaveSpider.h | 13 |
3 files changed, 40 insertions, 40 deletions
diff --git a/src/Mobs/Blaze.cpp b/src/Mobs/Blaze.cpp index 29bff561a..7ada21369 100644 --- a/src/Mobs/Blaze.cpp +++ b/src/Mobs/Blaze.cpp @@ -32,6 +32,7 @@ void cBlaze::GetDrops(cItems & a_Drops, cEntity * a_Killer) // mobTODO +/* bool cBlaze::Attack(std::chrono::milliseconds a_Dt) { if ((GetTarget() != nullptr) && (m_AttackCoolDownTicksLeft == 0)) @@ -53,4 +54,4 @@ bool cBlaze::Attack(std::chrono::milliseconds a_Dt) return true; } return false; -} +}*/ diff --git a/src/Mobs/CaveSpider.cpp b/src/Mobs/CaveSpider.cpp index c6aa8af61..8d8e15d85 100644 --- a/src/Mobs/CaveSpider.cpp +++ b/src/Mobs/CaveSpider.cpp @@ -8,7 +8,7 @@ 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) { } @@ -18,34 +18,34 @@ 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; } - +/* 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 +53,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); + } } diff --git a/src/Mobs/CaveSpider.h b/src/Mobs/CaveSpider.h index cf4b8e17c..71ee0b244 100644 --- a/src/Mobs/CaveSpider.h +++ b/src/Mobs/CaveSpider.h @@ -7,18 +7,17 @@ class cCaveSpider : - public cAggressiveMonster + public cAggressiveMonster { - typedef cAggressiveMonster super; + typedef cAggressiveMonster super; public: - cCaveSpider(void); + cCaveSpider(void); - CLASS_PROTODEF(cCaveSpider) + CLASS_PROTODEF(cCaveSpider) - virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; - virtual bool Attack(std::chrono::milliseconds a_Dt) override; - virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; + virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; } ; |