public static void Tick() { if (SoldiersAroundPlayer() == 0 && IsInCity(Game.Player.Character.Position)) { for (int i = 0; i < 5; i++) { Patrol patrol = new Patrol(); patrol.Spawn(3, Game.Player.Character.Position); } } }
private void onTick(object sender, EventArgs e) { foreach (Patrol patrol in GlobalInfo.addedPatrols) { patrol.ManageDeadSoldiers(); } if (relocateIdleGroupsTickRounds == 0) { int counter = 0; for (int i = 0; i < GlobalInfo.addedPatrols.Count; i++) { Patrol patrol = GlobalInfo.addedPatrols[counter]; if (patrol.ManageIdleSoldiers()) { counter--; } counter++; } relocateIdleGroupsTickRounds = 5000; } else { relocateIdleGroupsTickRounds--; } if (spawnPatrolsTickRounds == 0) { SpawnPatrols.Tick(); spawnPatrolsTickRounds = 1000; } else { spawnPatrolsTickRounds--; } }