protected void OnPlayGame() { RaceDesignScreen rds = new RaceDesignScreen(base.ScreenManager.GraphicsDevice, this); base.ScreenManager.AddScreen(rds); }
//private float Zrotate; public CreatingNewGameScreen(Empire empire, string size, float StarNumModifier, string EmpireToRemoveName, int numOpponents, RaceDesignScreen.GameMode gamemode, int GameScale, UniverseData.GameDifficulty difficulty, MainMenuScreen mmscreen) { { GlobalStats.RemnantArmageddon = false; GlobalStats.RemnantKills = 0; this.mmscreen = mmscreen; foreach (KeyValuePair<string, Ship_Game.Artifact> Artifact in Ship_Game.ResourceManager.ArtifactsDict) { Artifact.Value.Discovered = false; } RandomEventManager.ActiveEvent = null; this.difficulty = difficulty; this.scale = (float)GameScale; if (this.scale == 5) this.scale = 8; if (this.scale == 6) this.scale = 16; this.mode = gamemode; this.numOpponents = numOpponents; this.EmpireToRemoveName = EmpireToRemoveName; EmpireManager.EmpireList.Clear(); XmlSerializer serializer2 = new XmlSerializer(typeof(DiplomaticTraits)); //Added by McShooterz: mod folder support this.dtraits = (DiplomaticTraits)serializer2.Deserialize((new FileInfo(File.Exists(string.Concat(Ship_Game.ResourceManager.WhichModPath, "/Diplomacy/DiplomaticTraits.xml")) ? string.Concat(Ship_Game.ResourceManager.WhichModPath, "/Diplomacy/DiplomaticTraits.xml") : "Content/Diplomacy/DiplomaticTraits.xml")).OpenRead()); Ship_Game.ResourceManager.LoadEncounters(); this.playerEmpire = empire; empire.Initialize(); empire.data.CurrentAutoColony = empire.data.DefaultColonyShip; empire.data.CurrentAutoFreighter = empire.data.DefaultSmallTransport; empire.data.CurrentAutoScout = empire.data.StartingScout; empire.data.CurrentConstructor = empire.data.DefaultConstructor; this.data = new UniverseData() { FTLSpeedModifier = GlobalStats.FTLInSystemModifier, EnemyFTLSpeedModifier = GlobalStats.EnemyFTLInSystemModifier, GravityWells = GlobalStats.PlanetaryGravityWells, FTLinNeutralSystem = GlobalStats.WarpInSystem }; string str = size; string str1 = str; if (str != null) { if (str1 == "Tiny") { //if (mode == RaceDesignScreen.GameMode.Warlords) //{ // this.numSystems = (int)(12 * StarNumModifier); //} //else this.numSystems = (int)(16f * StarNumModifier); this.data.Size = new Vector2(3500000f, 3500000f); } else if (str1 == "Small") { //if (mode == RaceDesignScreen.GameMode.Warlords) //{ // this.numSystems = (int)(12 * StarNumModifier); //} //else this.numSystems = (int)(30f * StarNumModifier); this.data.Size = new Vector2(7300000f, 7300000f); } else if (str1 == "Medium") { //if (mode == RaceDesignScreen.GameMode.Warlords) //{ // this.numSystems = (int)(12 * StarNumModifier); //} //else this.numSystems = (int)(50f * StarNumModifier); this.data.Size = new Vector2(9350000f, 9350000f); Empire.ProjectorRadius = (this.data.Size.X / 70); } else if (str1 == "Large") { //if (mode == RaceDesignScreen.GameMode.Warlords) //{ // this.numSystems = (int)(12 * StarNumModifier); //} //else this.numSystems = (int)(50f * StarNumModifier); Empire.ProjectorRadius = (this.data.Size.X / 70); } else if (str1 == "Huge") { //if (mode == RaceDesignScreen.GameMode.Warlords) //{ // this.numSystems = (int)(12 * StarNumModifier); //} //else this.numSystems = (int)(50f * StarNumModifier); this.data.Size = new Vector2(18000000f, 18000000f); Empire.ProjectorRadius = (this.data.Size.X / 70); } else if (str1 == "Epic") { //if (mode == RaceDesignScreen.GameMode.Warlords) //{ // this.numSystems = (int)(12 * StarNumModifier); //} //else this.numSystems = (int)(50f * StarNumModifier); this.data.Size = new Vector2(54000000, 54000000); Empire.ProjectorRadius = (this.data.Size.X / 70); //this.data.Size = new Vector2(36000000, 36000000); //this.scale = 2; //this.numSystems = (int)(125f * StarNumModifier); //this.data.Size = new Vector2(3.6E+07f, 3.6E+07f); } else if (str1 == "TrulyEpic") { //if (mode == RaceDesignScreen.GameMode.Warlords) //{ // this.numSystems = (int)(12 * StarNumModifier); //} //else this.numSystems = (int)(50f * StarNumModifier); //this.numSystems = (int)(100f * StarNumModifier); this.data.Size = new Vector2(54000000, 54000000); //this.data.Size = new Vector2(7.2E+07f, 7.2E+07f); //this.scale = 4; Empire.ProjectorRadius = (this.data.Size.X / 70); } //if (this.numSystems <= this.numOpponents+2) //{ // this.numSystems = this.numOpponents + 2; //} } UniverseData universeDatum = this.data; universeDatum.Size = universeDatum.Size * this.scale; this.data.EmpireList.Add(empire); EmpireManager.EmpireList.Add(empire); this.GalacticCenter = new Vector2(this.data.Size.X / 2f, this.data.Size.Y / 2f); StatTracker.SnapshotsDict.Clear(); } }