public void Cast(Spell spell) { if(Source.Target != null) if (GameWorld.GetDistance(Source.Location, Source.Target.Location) > spell.Range) return; if (!Cooldowns[spell.GetType()].Start()) return; if (!Source.Energy.Use(spell.Cost)) return; spell.Cast(); }