public void AddOrUpdateUpgrade(BuildingUpgrade upgrade) { if (BuildingUpgrades == null) { BuildingUpgrades = new List <BuildingUpgrade>(); } else { var existentUpgrade = BuildingUpgrades.Find(b => b.Level == upgrade.Level); if (existentUpgrade != null) { BuildingUpgrades.Remove(existentUpgrade); } } BuildingUpgrades.Add(upgrade); }
public void PopulateStartingEstateData() { SetEstateInfo(true, "Raid", 0, 1, 1000, 10, 10, 10, 10); RosterHeroes = new List <SaveHeroData> { new SaveHeroData(1, "Reynald", "crusader", 0, 0, 10, 1, 1, "", "", "warrior_of_light", "kleptomaniac", "god_fearing"), new SaveHeroData(2, "Dismas", "highwayman", 0, 0, 10, 1, 1, "", "", "hard_noggin", "known_cheat", "quick_reflexes"), }; StageCoachHeroes = new List <SaveHeroData>(); InstancedPurchases.Clear(); foreach (SaveHeroData heroData in RosterHeroes) { var newHeroPurchases = new Dictionary <string, UpgradePurchases>(); InstancedPurchases.Add(heroData.RosterId, newHeroPurchases); newHeroPurchases.Add(heroData.HeroClass + ".weapon", new UpgradePurchases(heroData.HeroClass + ".weapon", new string[0])); newHeroPurchases.Add(heroData.HeroClass + ".armour", new UpgradePurchases(heroData.HeroClass + ".armour", new string[0])); foreach (CombatSkill skill in DarkestDungeonManager.Data.HeroClasses[heroData.HeroClass].CombatSkills) { newHeroPurchases.Add(heroData.HeroClass + "." + skill.Id, new UpgradePurchases(heroData.HeroClass + "." + skill.Id, new string[0])); } foreach (CampingSkill skill in DarkestDungeonManager.Data.HeroClasses[heroData.HeroClass].CampingSkills) { newHeroPurchases.Add(skill.Id, new UpgradePurchases(skill.Id, new string[0])); } } InstancedPurchases[1]["crusader.smite"].PurchasedUpgrades.Add("0"); InstancedPurchases[1]["crusader.zealous_accusation"].PurchasedUpgrades.Add("0"); InstancedPurchases[1]["crusader.stunning_blow"].PurchasedUpgrades.Add("0"); InstancedPurchases[1]["crusader.bulwark_of_faith"].PurchasedUpgrades.Add("0"); RosterHeroes[0].SelectedCombatSkillIndexes.AddRange(new[] { 0, 1, 2, 3 }); InstancedPurchases[1]["encourage"].PurchasedUpgrades.Add("0"); InstancedPurchases[1]["stand_tall"].PurchasedUpgrades.Add("0"); InstancedPurchases[1]["zealous_speech"].PurchasedUpgrades.Add("0"); RosterHeroes[0].SelectedCampingSkillIndexes.AddRange(new[] { 0, 4, 5 }); InstancedPurchases[2]["highwayman.opened_vein"].PurchasedUpgrades.Add("0"); InstancedPurchases[2]["highwayman.pistol_shot"].PurchasedUpgrades.Add("0"); InstancedPurchases[2]["highwayman.grape_shot_blast"].PurchasedUpgrades.Add("0"); InstancedPurchases[2]["highwayman.take_aim"].PurchasedUpgrades.Add("0"); RosterHeroes[1].SelectedCombatSkillIndexes.AddRange(new[] { 6, 1, 3, 4 }); InstancedPurchases[2]["first_aid"].PurchasedUpgrades.Add("0"); InstancedPurchases[2]["clean_guns"].PurchasedUpgrades.Add("0"); InstancedPurchases[2]["bandits_sense"].PurchasedUpgrades.Add("0"); RosterHeroes[1].SelectedCampingSkillIndexes.AddRange(new[] { 1, 5, 6 }); ActivityLog = new List <WeekActivityLog>(); CompletedPlot = new List <string>(); GeneratedQuests = new List <Quest>(); DeathRecords = new List <DeathRecord>(); InventoryTrinkets.Clear(); WagonTrinkets.Clear(); DungeonProgress.Clear(); DungeonProgress.Add("crypts", new DungeonProgress("crypts", 0, 0, true, false)); DungeonProgress.Add("warrens", new DungeonProgress("warrens", 0, 0, true, false)); DungeonProgress.Add("weald", new DungeonProgress("weald", 0, 0, true, false)); DungeonProgress.Add("cove", new DungeonProgress("cove", 0, 0, true, false)); DungeonProgress.Add("darkestdungeon", new DungeonProgress("darkestdungeon", 1, 0, true, false)); DungeonProgress.Add("town", new DungeonProgress("town", 1, 0, true, true)); BuildingUpgrades.Clear(); BuildingUpgrades.Add("abbey.meditation", new UpgradePurchases("abbey.meditation", new string[0])); BuildingUpgrades.Add("abbey.prayer", new UpgradePurchases("abbey.prayer", new string[0])); BuildingUpgrades.Add("abbey.flagellation", new UpgradePurchases("abbey.flagellation", new string[0])); BuildingUpgrades.Add("tavern.bar", new UpgradePurchases("tavern.bar", new string[0])); BuildingUpgrades.Add("tavern.gambling", new UpgradePurchases("tavern.gambling", new string[0])); BuildingUpgrades.Add("tavern.brothel", new UpgradePurchases("tavern.brothel", new string[0])); BuildingUpgrades.Add("sanitarium.cost", new UpgradePurchases("sanitarium.cost", new string[0])); BuildingUpgrades.Add("sanitarium.disease_quirk_cost", new UpgradePurchases("sanitarium.disease_quirk_cost", new string[0])); BuildingUpgrades.Add("sanitarium.slots", new UpgradePurchases("sanitarium.slots", new string[0])); BuildingUpgrades.Add("blacksmith.weapon", new UpgradePurchases("blacksmith.weapon", new string[0])); BuildingUpgrades.Add("blacksmith.armour", new UpgradePurchases("blacksmith.armour", new string[0])); BuildingUpgrades.Add("blacksmith.cost", new UpgradePurchases("blacksmith.cost", new string[0])); BuildingUpgrades.Add("guild.skill_levels", new UpgradePurchases("guild.skill_levels", new string[0])); BuildingUpgrades.Add("guild.cost", new UpgradePurchases("guild.cost", new string[0])); BuildingUpgrades.Add("camping_trainer.cost", new UpgradePurchases("camping_trainer.cost", new string[0])); BuildingUpgrades.Add("nomad_wagon.numitems", new UpgradePurchases("nomad_wagon.numitems", new string[0])); BuildingUpgrades.Add("nomad_wagon.cost", new UpgradePurchases("nomad_wagon.cost", new string[0])); BuildingUpgrades.Add("stage_coach.numrecruits", new UpgradePurchases("stage_coach.numrecruits", new string[0])); BuildingUpgrades.Add("stage_coach.rostersize", new UpgradePurchases("stage_coach.rostersize", new string[0])); BuildingUpgrades.Add("stage_coach.upgraded_recruits", new UpgradePurchases("stage_coach.upgraded_recruits", new string[0])); SetAbbeySlots(3, 3); SetTavernSlots(3, 3); SetSanitariumSlots(2, 3); InRaid = true; QuestCompleted = false; }