public void GetTargetsInAreaOfEffect(ProjectionManager pm, Unit caster) { Targets = new List <Unit>(); foreach (Cell cell in pm.AreaOfEffect) { pm.ColorCell(cell.X, cell.Z, Color.magenta); if (cell.IsTaken) { if (!HitSelf && cell.IsTaken == caster) { continue; } if (!HitAllies && cell.IsTaken.Team == caster.Team) { continue; } if (!HitEnemies && cell.IsTaken.Team != caster.Team) { continue; } Targets.Add(cell.IsTaken); } } pm.EnableProjections(pm.Selection, true); }