feat: mob castle damage

This commit is contained in:
2021-12-11 20:06:52 +01:00
parent c4a2b08416
commit fd9b448fa4
3 changed files with 11 additions and 1 deletions

View File

@@ -286,6 +286,13 @@ void World::OnExplosion(utils::shape::Circle explosion, float centerDamage, Towe
}
}
void World::OnMobCastleDamage(Mob* damager, TeamCastle* enemyCastle, float damage) {
enemyCastle->damage(damage);
if (enemyCastle->getLife() <= 0) {
// TODO: a team has won
}
}
void World::OnMobDamage(Mob* target, float damage, Tower* source) {
target->damage(damage, source);
if (target->isDead()) {