feat: add upgrade tower (non gui)
This commit is contained in:
@@ -109,7 +109,9 @@ const std::map<std::pair<TowerType, TowerLevel>, TowerStats> TowerConstants = {
|
||||
};
|
||||
|
||||
const TowerStats* getTowerStats(TowerType type, TowerLevel level) {
|
||||
return &TowerConstants.at({ type, level });
|
||||
auto it = TowerConstants.find({type, level});
|
||||
if(it == TowerConstants.end()) return nullptr;
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
|
||||
@@ -238,7 +240,7 @@ void MageTower::tick(std::uint64_t delta, World* world) {
|
||||
bool wasTowerActive = false;
|
||||
for (MobPtr mob : world->getMobList()) {
|
||||
if (isMobInRange(mob)) {
|
||||
mob->addEffect(EffectType::Fire, getLevel().getLevel() * 5, this);
|
||||
mob->addEffect(EffectType::Fire, getLevel().getLevel() * 3, this);
|
||||
wasTowerActive = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user