public void AbsorbEmpire(Empire target) { foreach (Planet planet in target.GetPlanets()) { this.OwnedPlanets.Add(planet); planet.Owner = (Empire)null; planet.Owner = this; if (!planet.system.OwnerList.Contains(this)) { planet.system.OwnerList.Add(this); planet.system.OwnerList.Remove(target); } } foreach (KeyValuePair<Guid, SolarSystem> keyValuePair in Empire.universeScreen.SolarSystemDict) { foreach (Planet planet in keyValuePair.Value.PlanetList) { foreach (Troop troop in planet.TroopsHere) { if (troop.GetOwner() == target) troop.SetOwner(this); } } } target.GetPlanets().Clear(); foreach (Ship ship in (List<Ship>)target.GetShips()) { this.OwnedShips.Add(ship); ship.loyalty = this; ship.fleet = (Fleet)null; ship.GetAI().State = AIState.AwaitingOrders; ship.GetAI().OrderQueue.Clear(); } target.GetShips().Clear(); foreach (KeyValuePair<string, TechEntry> keyValuePair in target.GetTDict()) { if (keyValuePair.Value.Unlocked && !this.TechnologyDict[keyValuePair.Key].Unlocked) this.UnlockTech(keyValuePair.Key); } foreach (KeyValuePair<string, bool> keyValuePair in target.GetHDict()) { if (keyValuePair.Value) this.UnlockedHullsDict[keyValuePair.Key] = true; } foreach (KeyValuePair<string, bool> keyValuePair in target.GetTrDict()) { if (keyValuePair.Value) this.UnlockedTroopDict[keyValuePair.Key] = true; } foreach (Artifact artifact in target.data.OwnedArtifacts) { this.data.OwnedArtifacts.Add(artifact); this.AddArtifact(artifact); } target.data.OwnedArtifacts.Clear(); if ((double)target.Money > 0.0) { this.Money += target.Money; target.Money = 0.0f; } target.SetAsMerged(); this.ResetBorders(); this.UpdateShipsWeCanBuild(); if (this != EmpireManager.GetEmpireByName(Ship.universeScreen.PlayerLoyalty)) { this.data.difficulty = Difficulty.Brutal; lock (GlobalStats.TaskLocker) { foreach (MilitaryTask item_7 in (List<MilitaryTask>)this.GSAI.TaskList) item_7.EndTask(); this.GSAI.TaskList.ApplyPendingRemovals(); } this.GSAI.DefensiveCoordinator.DefensiveForcePool.Clear(); this.GSAI.DefensiveCoordinator.DefenseDict.Clear(); this.ForcePool.Clear(); //foreach (Ship s in (List<Ship>)this.OwnedShips) //.OrderByDescending(experience=> experience.experience).ThenBy(strength=> strength.BaseStrength)) for (int i = 0; i < this.OwnedShips.Count; i++) { Ship s = ((List<Ship>)this.OwnedShips)[i]; //added by gremlin Do not include 0 strength ships in defensive force pool s.GetAI().OrderQueue.Clear(); s.GetAI().State = AIState.AwaitingOrders; this.ForcePoolAdd(s); } if (this.data.Traits.Cybernetic != 0) { foreach (Planet planet in this.OwnedPlanets) { List<Building> list = new List<Building>(); foreach (Building building in planet.BuildingList) { if ((double)building.PlusFlatFoodAmount > 0.0 || (double)building.PlusFoodPerColonist > 0.0 || (double)building.PlusTerraformPoints > 0.0) list.Add(building); } foreach (Building b in list) planet.ScrapBuilding(b); } } } foreach (Agent agent in (List<Agent>)target.data.AgentList) { this.data.AgentList.Add(agent); agent.Mission = AgentMission.Defending; agent.TargetEmpire = (string)null; } target.data.AgentList.Clear(); target.data.AbsorbedBy = this.data.Traits.Name; this.CalculateScore(); }