public static ScriptModules New( Random random, GameDatabase db, AssetDatabase assetdb, GameSession game, NamesPool namesPool, GameSetup gameSetup) { ScriptModules scriptModules = new ScriptModules(); scriptModules.VonNeumann = VonNeumann.InitializeEncounter(db, assetdb); scriptModules.Swarmers = Swarmers.InitializeEncounter(db, assetdb); scriptModules.Gardeners = Gardeners.InitializeEncounter(db, assetdb); scriptModules.AsteroidMonitor = AsteroidMonitor.InitializeEncounter(db, assetdb); scriptModules.MorrigiRelic = MorrigiRelic.InitializeEncounter(db, assetdb); scriptModules.Slaver = Slaver.InitializeEncounter(db, assetdb); scriptModules.Pirates = Pirates.InitializeEncounter(db, assetdb); scriptModules.Spectre = Spectre.InitializeEncounter(db, assetdb); scriptModules.GhostShip = GhostShip.InitializeEncounter(db, assetdb); scriptModules.MeteorShower = MeteorShower.InitializeEncounter(db, assetdb); scriptModules.SystemKiller = SystemKiller.InitializeEncounter(db, assetdb); scriptModules.Locust = Locust.InitializeEncounter(db, assetdb); scriptModules.Comet = Comet.InitializeEncounter(db, assetdb); if (db.HasEndOfFleshExpansion()) { scriptModules.NeutronStar = NeutronStar.InitializeEncounter(db, assetdb); scriptModules.SuperNova = SuperNova.InitializeEncounter(); } scriptModules.AddEasterEggs(random, db, assetdb, game, namesPool, gameSetup); return(scriptModules); }
public static ScriptModules Resume(GameDatabase db) { ScriptModules scriptModules = new ScriptModules(); scriptModules.VonNeumann = VonNeumann.ResumeEncounter(db); scriptModules.Swarmers = Swarmers.ResumeEncounter(db); scriptModules.Gardeners = Gardeners.ResumeEncounter(db); scriptModules.AsteroidMonitor = AsteroidMonitor.ResumeEncounter(db); scriptModules.MorrigiRelic = MorrigiRelic.ResumeEncounter(db); scriptModules.Slaver = Slaver.ResumeEncounter(db); scriptModules.Pirates = Pirates.ResumeEncounter(db); scriptModules.Spectre = Spectre.ResumeEncounter(db); scriptModules.GhostShip = GhostShip.ResumeEncounter(db); scriptModules.MeteorShower = MeteorShower.ResumeEncounter(db); scriptModules.SystemKiller = SystemKiller.ResumeEncounter(db); scriptModules.Locust = Locust.ResumeEncounter(db); scriptModules.Comet = Comet.ResumeEncounter(db); if (db.HasEndOfFleshExpansion()) { scriptModules.NeutronStar = NeutronStar.ResumeEncounter(db); scriptModules.SuperNova = SuperNova.ResumeEncounter(); } List <PlayerInfo> list = db.GetPlayerInfos().Where <PlayerInfo>((Func <PlayerInfo, bool>)(x => { if (!x.isStandardPlayer) { return(!x.includeInDiplomacy); } return(false); })).ToList <PlayerInfo>(); foreach (int playerID in db.GetStandardPlayerIDs().ToList <int>()) { foreach (PlayerInfo playerInfo in list) { DiplomacyInfo diplomacyInfo = db.GetDiplomacyInfo(playerID, playerInfo.ID); if (diplomacyInfo.State != DiplomacyState.WAR) { db.UpdateDiplomacyState(playerID, playerInfo.ID, DiplomacyState.WAR, diplomacyInfo.Relations, true); } } } return(scriptModules); }