public void BeginInvasion() { if (!Enabled) { return; } RemoveSpawn(); CurrentWave = 1; InvasionType newType; City newCity; do { newType = (InvasionType)Utility.Random(10); }while (newType == InvasionType); do { newCity = (City)Utility.Random(9); }while (newCity == CurrentInvasion); CurrentInvasion = newCity; InvasionType = newType; SpawnZones = Defs[CurrentInvasion].SpawnRecs.ToList(); Beacon = new InvasionBeacon(this); Beacon.MoveToWorld(Defs[CurrentInvasion].BeaconLoc, Map); // Shuffle zones for (int i = 0; i < 8; i++) { var rec = SpawnZones[Utility.Random(SpawnZones.Count)]; SpawnZones.Remove(rec); SpawnZones.Insert(0, rec); } SpawnWave(); }
public BeaconItem(InvasionBeacon beacon) : base(18223) { Movable = false; Beacon = beacon; }
public void BeginInvasion() { if (!Enabled) return; RemoveSpawn(); CurrentWave = 1; InvasionType newType; City newCity; do { newType = (InvasionType)Utility.Random(10); } while(newType == this.InvasionType); do { newCity = (City)Utility.Random(9); } while (newCity == this.CurrentInvasion); this.CurrentInvasion = newCity; this.InvasionType = newType; SpawnZones = Defs[CurrentInvasion].SpawnRecs.ToList(); Beacon = new InvasionBeacon(this); Beacon.MoveToWorld(Defs[CurrentInvasion].BeaconLoc, this.Map); // Shuffle zones for(int i = 0; i < 8; i++) { var rec = SpawnZones[Utility.Random(SpawnZones.Count)]; SpawnZones.Remove(rec); SpawnZones.Insert(0, rec); } SpawnWave(); }