From 71b4c4949087860ab9962d6545a0ad2eb9c0ee5a Mon Sep 17 00:00:00 2001 From: archshift Date: Wed, 11 Jun 2014 16:21:47 -0700 Subject: Cave spider now poisons its victim, added IsPawn function to Entity --- src/Mobs/CaveSpider.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/Mobs/CaveSpider.cpp') diff --git a/src/Mobs/CaveSpider.cpp b/src/Mobs/CaveSpider.cpp index 1157b81f9..fe0f2ac73 100644 --- a/src/Mobs/CaveSpider.cpp +++ b/src/Mobs/CaveSpider.cpp @@ -27,6 +27,21 @@ void cCaveSpider::Tick(float a_Dt, cChunk & a_Chunk) +void cCaveSpider::Attack(float a_Dt) +{ + super::Attack(a_Dt); + + if (m_Target->IsPawn()) + { + // TODO: Easy = no poison, Medium = 7 seconds, Hard = 15 seconds + ((cPawn *) m_Target)->AddEntityEffect(cEntityEffect::effPoison, cEntityEffect(140, 0, this)); + } +} + + + + + void cCaveSpider::GetDrops(cItems & a_Drops, cEntity * a_Killer) { int LootingLevel = 0; -- cgit v1.2.3