private void Reset() { if (BattleRegion == null) { return; } IEnumerable <BaseCreature> list = BattleRegion.GetEnumeratedMobiles().OfType <BaseCreature>(); foreach (BaseCreature bc in list.Where(b => b.Alive && !b.Controlled && !b.Summoned && b.GetMaster() == null)) { bc.Kill(); } foreach (KeyValuePair <int, List <BaseCreature> > kvp in MyrmidexTeam) { ColUtility.Free(kvp.Value); } foreach (KeyValuePair <int, List <BaseCreature> > kvp in TribeTeam) { ColUtility.Free(kvp.Value); } MyrmidexTeam.Clear(); TribeTeam.Clear(); }
public void CheckWaves() { ColUtility.For <int, List <BaseCreature> >(MyrmidexTeam, (i, key, value) => { if (value.Where(bc => bc != null && !bc.Deleted && bc.Alive).Count() == 0) { ColUtility.Free(MyrmidexTeam[key]); MyrmidexTeam.Remove(key); RegionMessage(i == 0 ? 1156604 : 1156605); // The Eodonians have secured new ground, the front line has moved up! //if (HasPlayers()) // Timer.DelayCall<Allegiance>(TimeSpan.FromSeconds(3), SpawnWave, Allegiance.Myrmidex); } }); ColUtility.For <int, List <BaseCreature> >(TribeTeam, (i, key, value) => { if (value.Where(bc => bc != null && !bc.Deleted && bc.Alive).Count() == 0) { ColUtility.Free(TribeTeam[key]); TribeTeam.Remove(key); RegionMessage(i == 0 ? 1156602 : 1156603); // The Myrmidex have secured new ground, the front line has moved up! //if (HasPlayers()) // Timer.DelayCall<Allegiance>(TimeSpan.FromSeconds(3), SpawnWave, Allegiance.Tribes); } }); }
public void CheckWaves() { List <int> list = MyrmidexTeam.Keys.ToList(); for (int i = 0; i < list.Count; i++) { int wave = list[i]; List <BaseCreature> bcList = MyrmidexTeam[wave]; if (bcList == null) { continue; } if (bcList.All(bc => bc == null || bc.Deleted || !bc.Alive)) { ColUtility.Free(bcList); if (MyrmidexTeam.ContainsKey(wave)) { MyrmidexTeam.Remove(wave); } RegionMessage(i == 0 ? 1156604 : 1156605); // The Eodonians have secured new ground, the front line has moved up! } } list.Clear(); list = TribeTeam.Keys.ToList(); for (int i = 0; i < list.Count; i++) { int wave = list[i]; List <BaseCreature> bcList = TribeTeam[wave]; if (bcList == null) { continue; } if (bcList.All(bc => bc == null || bc.Deleted || !bc.Alive)) { ColUtility.Free(bcList); if (TribeTeam.ContainsKey(wave)) { TribeTeam.Remove(wave); } RegionMessage(i == 0 ? 1156602 : 1156603); // The Myrmidex have secured new ground, the front line has moved up! } } ColUtility.Free(list); }
public void CheckWaves() { ColUtility.For <int, List <BaseCreature> >(MyrmidexTeam, (i, key, value) => { if (value.Where(bc => bc != null && !bc.Deleted && bc.Alive).Count() == 0) { ColUtility.Free(MyrmidexTeam[key]); MyrmidexTeam.Remove(key); RegionMessage(i == 0 ? 1156604 : 1156605); // The Eodonians have secured new ground, the front line has moved up! } }); ColUtility.For <int, List <BaseCreature> >(TribeTeam, (i, key, value) => { if (value.Where(bc => bc != null && !bc.Deleted && bc.Alive).Count() == 0) { ColUtility.Free(TribeTeam[key]); TribeTeam.Remove(key); RegionMessage(i == 0 ? 1156602 : 1156603); // The Myrmidex have secured new ground, the front line has moved up! } }); }