protected override TurnActionInfo <Coordinate2D, Metric2D, int> OnTurn(SubMap <Coordinate2D, Metric2D, int> submap) { List <Fighter> lst = new List <Fighter>(); //foreach(Cell<Coordinate2D, Metric2D, int> c in submap.Cells) foreach (Fighter f in submap.Objects) { if (f == this) { continue; } if (back.CanSee(Location.X, Location.Y, f.Location.X, f.Location.Y, SightLength, Angle, SightAngle)) { lst.Add(f); } } //FighterControllerData move = controller.MakeTurn(this, lst, back.Eth[Team]); FighterControllerData move = controller.MakeTurn(this, lst, ether.Get <string[]>(Team.ToString())); TurnActionInfo <Coordinate2D, Metric2D, int> inf = new TurnActionInfo <Coordinate2D, Metric2D, int>(); if (Dead) { DeadCountDown--; if (DeadCountDown == 0) { Dead = false; inf.hasMoved = true; inf.moveTo = submap.ToLocal(new Coordinate2D(BirthLocation.X, BirthLocation.Y)); } } else { if (move.shot) { if (Mana >= ShotCost) { Mana -= ShotCost; for (int dx = -Radius; dx <= Radius; dx++) { for (int dy = -Radius; dy <= Radius; dy++) { if (back.Inside(move.shotPoint.X + dx, move.shotPoint.Y + dy)) { Cell <Coordinate2D, Metric2D, int> cl = submap.GetCell( submap.ToLocal(new Coordinate2D(move.shotPoint.X + dx, move.shotPoint.Y + dy))); foreach (Fighter f in cl) { f.HP -= move.damage; } } } } } } if (back.CanGo(Location.X, Location.Y, move.newLocation.X, move.newLocation.Y, Speed)) { inf.hasMoved = true; inf.moveTo = submap.ToLocal(new Coordinate2D(move.newLocation.X, move.newLocation.Y)); } else { inf.hasMoved = false; } Angle = move.newAngle; LastEth = move.msg; } return(inf); }