diff --git a/src/game/Towers.cpp b/src/game/Towers.cpp index 66f2393..a8ce995 100644 --- a/src/game/Towers.cpp +++ b/src/game/Towers.cpp @@ -86,8 +86,8 @@ const std::map, TowerStats> TowerConstants = { {{TowerType::Poison, {3, TowerPath::Top}}, {6, 0, 13}}, {{TowerType::Poison, {4, TowerPath::Top}}, {5, 0, 15}}, - {{TowerType::Poison, {3, TowerPath::Bottom}}, {5, 0, 13}}, - {{TowerType::Poison, {4, TowerPath::Bottom}}, {6, 0, 15}}, + {{TowerType::Poison, {3, TowerPath::Bottom}}, {5, 10, 13}}, + {{TowerType::Poison, {4, TowerPath::Bottom}}, {6, 20, 15}}, //----------------------------------------------------------------- @@ -248,7 +248,40 @@ void MageTower::tick(std::uint64_t delta, World* world) { } void PoisonTower::tick(std::uint64_t delta, World* world) { + if (m_Timer.update(delta)) { + for (MobPtr mob : world->getMobList()) { + if (isMobInRange(mob)) { + if(getLevel().getPath() == TowerPath::Bottom){ + mob->damage(getStats()->getDamage(), this); + }else{ + float durationSec; + switch(getLevel().getLevel()){ + case 1: + durationSec = 5; + break; + case 2: + durationSec = 15; + break; + + case 3: + durationSec = 30; + break; + + case 4: + durationSec = 1e10; // about 3 million hours. It should be enough + break; + + default: + durationSec = 0; // how did we get there ? + break; + } + mob->addEffect(EffectType::Poison, durationSec, this); + } + m_Timer.applyCooldown(); + } + } + } } void QuakeTower::tick(std::uint64_t delta, World* world) {