protected override void OnGameStart() { for (int i = 0; i < Spawns.Length; i++) { SpawnInfo info = Spawns [i]; while (AgentController.InstanceManagers.Count <= info.ControllerIndex) { AgentController cont = AgentController.Create(); PlayerManager.AddController(cont); for (int j = 0; j < AgentController.InstanceManagers.Count; j++) { AgentController ac = AgentController.InstanceManagers [j]; if (ac != cont) { cont.SetAllegiance(ac, AllegianceType.Enemy); ac.SetAllegiance(cont, AllegianceType.Enemy); } } } AgentController controller = AgentController.InstanceManagers [info.ControllerIndex]; for (int j = 0; j < info.Count; j++) { LSAgent agent = controller.CreateAgent(info.AgentCode, info.Position); if (AutoCommand) { Selector.Add(agent); } } } if (AutoCommand) { //Find average of spawn positions Vector2d battlePos = Vector2d.zero; for (int i = 0; i < Spawns.Length; i++) { battlePos += Spawns [i].Position; } battlePos /= Spawns.Length; Command com = new Command(Lockstep.Data.AbilityDataItem.FindInterfacer <Scan> ().ListenInputID); com.Add <Vector2d> (battlePos); PlayerManager.SendCommand(com); Selector.Clear(); } }
public static void SetFullHostile(AgentController con) { //TODO: Make this hostile to new controllers for (int j = 0; j < AgentController.InstanceManagers.Count; j++) { if (j == con.ControllerID) { continue; } AgentController ac = AgentController.InstanceManagers [j]; if (ac != con) { con.SetAllegiance(ac, AllegianceType.Enemy); ac.SetAllegiance(con, AllegianceType.Enemy); } } }