private static void DealDamageToPosition(IZone zone, Position location, double damage) { using (new TerrainUpdateMonitor(zone)) { zone.DamageToPlantOnArea(Area.FromRadius(location, 1), damage / 2); } }
public static void DoAoeDamage(this IZone zone, IBuilder <DamageInfo> damageBuilder) { var damageInfo = damageBuilder.Build(); var units = zone.Units.WithinRange(damageInfo.sourcePosition, damageInfo.Range); foreach (var unit in units) { var losResult = zone.IsInLineOfSight(damageInfo.attacker, unit, false); if (losResult.hit) { continue; } unit.TakeDamage(damageInfo); } using (new TerrainUpdateMonitor(zone)) { zone.DamageToPlantOnArea(damageInfo); } }