private void CreateChapter() { Date basicTrainingEndDate = new Date(GameSettings.Date.Millenium, GameSettings.Date.Year - 3, 52); Date trainingStartDate = new Date(GameSettings.Date.Millenium, GameSettings.Date.Year - 4, 1); var soldierTemplate = GameSettings.Galaxy.PlayerFaction.SoldierTemplates[0]; var soldiers = SoldierFactory.Instance.GenerateNewSoldiers(1000, soldierTemplate.Species, GameSettings.Galaxy.SkillTemplateList) .Select(s => new PlayerSoldier(s, $"{TempNameGenerator.GetName()} {TempNameGenerator.GetName()}")) .ToList(); string foo = ""; SoldierTrainingCalculator trainingHelper = new SoldierTrainingCalculator(GameSettings.Galaxy.BaseSkillMap.Values); foreach (PlayerSoldier soldier in soldiers) { soldier.AddEntryToHistory(trainingStartDate + ": accepted into training"); if (soldier.PsychicPower > 0) { soldier.AddEntryToHistory(trainingStartDate + ": psychic ability detected, acolyte training initiated"); // add psychic specific training here } trainingHelper.EvaluateSoldier(soldier, basicTrainingEndDate); soldier.ProgenoidImplantDate = new Date(GameSettings.Date.Millenium, GameSettings.Date.Year - 2, RNG.GetIntBelowMax(1, 53)); foo += $"{(int)soldier.MeleeRating}, {(int)soldier.RangedRating}, {(int)soldier.LeadershipRating}, {(int)soldier.AncientRating}, {(int)soldier.MedicalRating}, {(int)soldier.TechRating}, {(int)soldier.PietyRating}\n"; } System.IO.File.WriteAllText($"{Application.streamingAssetsPath}/ratings.csv", foo); GameSettings.Chapter = NewChapterBuilder.CreateChapter(soldiers, GameSettings.Galaxy.PlayerFaction, GameSettings.Date.ToString()); List <string> foundingHistoryEntries = new List <string> { $"{GameSettings.Chapter.OrderOfBattle.Name} officially forms with its first 1,000 battle brothers." }; GameSettings.Chapter.AddToBattleHistory(GameSettings.Date, "Chapter Founding", foundingHistoryEntries); // post-MOS evaluations foreach (PlayerSoldier soldier in soldiers) { trainingHelper.EvaluateSoldier(soldier, GameSettings.Date); } GameSettings.Galaxy.PlayerFaction.Units.Add(GameSettings.Chapter.OrderOfBattle); // TODO: replace this with a random assignment of starting planet // and then have the galaxy map screen default to zooming in // on the Marine starting planet var emptyPlanets = GameSettings.Galaxy.Planets.Where(p => p.ControllingFaction.IsDefaultFaction); int max = emptyPlanets.Count(); int chapterPlanetIndex = RNG.GetIntBelowMax(0, max); Planet chapterPlanet = emptyPlanets.ElementAt(chapterPlanetIndex); chapterPlanet.ControllingFaction = GameSettings.Galaxy.PlayerFaction; }
// Start is called before the first frame update void Start() { _trainingHelper = new SoldierTrainingCalculator(GameSettings.Galaxy.BaseSkillMap.Values); }
private void Start() { _trainingHelper = new SoldierTrainingCalculator(GameSettings.Galaxy.BaseSkillMap.Values); PopulateScoutSquadMap(); EvaluateScouts(); }