private void RequiredItemsShouldBe(RequiredItemMaterials req, int qp, int grailCount, int fourStarEmber, int fourStarEmberClassBonus, int fiveStarEmber, int fiveStarEmberClassBonus) { req.Qp.Should().Be(qp); req.GrailCount.Should().Be(grailCount); req.FourStarEmber.Should().Be(fourStarEmber); req.FourStarEmberClassBonus.Should().Be(fourStarEmberClassBonus); req.FiveStarEmber.Should().Be(fiveStarEmber); req.FiveStarEmberClassBonus.Should().Be(fiveStarEmberClassBonus); }
private void MaterialOutput(RequiredItemMaterials req, Dictionary <string, int> materials) { _output.WriteLine($"QP: {req.Qp:n0}"); _output.WriteLine($"Grail count: {req.GrailCount}\n"); _output.WriteLine($"4* Ember: {req.FourStarEmber:n0}"); _output.WriteLine($"4* Ember (Class Bonus): {req.FourStarEmberClassBonus:n0}"); _output.WriteLine($"5* Ember: {req.FiveStarEmber:n0}"); _output.WriteLine($"5* Ember (Class Bonus): {req.FiveStarEmberClassBonus:n0}\n"); foreach (KeyValuePair <string, int> material in materials.OrderBy(m => m.Key)) { _output.WriteLine($"Name: {material.Key}"); _output.WriteLine($"Amount: {material.Value}\n"); } }
public async Task WaverLored100() { _wireMockFixture.CheckIfMockServerInUse(); _wireMockUtility.AddStubs(_wireMockFixture); using (var scope = _container.BeginLifetimeScope()) { ScopedClasses resolvedClasses = AutofacUtility.ResolveScope(scope); ConstantExportJson constantExportJson = await FrequentlyUsed.GetConstantExportJsonAsync(resolvedClasses.AtlasAcademyClient); int servantId = 501900; ServantBasicJson servantBasicJson = constantExportJson.ListServantBasicJson.Find(s => s.Id == servantId); /* Load servants as if they're already in a save file */ ChaldeaServant currentServant = new ChaldeaServant { ServantBasicInfo = servantBasicJson, FouAttack = 1000, FouHealth = 1000, IsSupportServant = false, NpLevel = 1, ServantLevel = 1, SkillLevels = new int[] { 1, 1, 1 } }; ChaldeaServant goalServant = new ChaldeaServant { ServantBasicInfo = servantBasicJson, FouAttack = 1000, FouHealth = 1000, IsSupportServant = false, NpLevel = 1, ServantLevel = 100, SkillLevels = new int[] { 10, 10, 10 } }; RequiredItemMaterials req = resolvedClasses.MaterialCalculation.HowMuchIsNeeded( currentServant, goalServant, constantExportJson.GrailCostNiceJson, await resolvedClasses.AtlasAcademyClient.GetServantInfo(servantId.ToString())); Dictionary <string, int> materials = resolvedClasses.MaterialCalculation.GroupItemParents(req.Items); MaterialOutput(req, materials); using (new AssertionScope()) { RequiredItemsShouldBe(req, 222600000, 5, 753, 627, 251, 209); materials.Should().Contain("Caster Monument", 17); materials.Should().Contain("Caster Piece", 17); materials.Should().Contain("Crystallized Lore", 3); materials.Should().Contain("Eternal Gear", 15); materials.Should().Contain("Forbidden Page", 55); materials.Should().Contain("Gem of Caster", 51); materials.Should().Contain("Heart of the Foreign God", 33); materials.Should().Contain("Magic Gem of Caster", 51); materials.Should().Contain("Phoenix Feather", 70); materials.Should().Contain("Secret Gem of Caster", 51); materials.Should().Contain("Void's Dust", 105); } } }
public async Task ArashOneLore100() { _wireMockFixture.CheckIfMockServerInUse(); _wireMockUtility.AddStubs(_wireMockFixture); using (var scope = _container.BeginLifetimeScope()) { ScopedClasses resolvedClasses = AutofacUtility.ResolveScope(scope); ConstantExportJson constantExportJson = await FrequentlyUsed.GetConstantExportJsonAsync(resolvedClasses.AtlasAcademyClient); int servantId = 201300; ServantBasicJson servantBasicJson = constantExportJson.ListServantBasicJson.Find(s => s.Id == servantId); /* Load servants as if they're already in a save file */ ChaldeaServant currentServant = new ChaldeaServant { ServantBasicInfo = servantBasicJson, FouAttack = 1000, FouHealth = 1000, IsSupportServant = false, NpLevel = 1, ServantLevel = 1, SkillLevels = new int[] { 1, 1, 1 } }; ChaldeaServant goalServant = new ChaldeaServant { ServantBasicInfo = servantBasicJson, FouAttack = 1000, FouHealth = 1000, IsSupportServant = false, NpLevel = 1, ServantLevel = 100, SkillLevels = new int[] { 1, 1, 10 } }; RequiredItemMaterials req = resolvedClasses.MaterialCalculation.HowMuchIsNeeded( currentServant, goalServant, constantExportJson.GrailCostNiceJson, await resolvedClasses.AtlasAcademyClient.GetServantInfo(servantId.ToString())); Dictionary <string, int> materials = resolvedClasses.MaterialCalculation.GroupItemParents(req.Items); MaterialOutput(req, materials); using (new AssertionScope()) { RequiredItemsShouldBe(req, 32950000, 10, 753, 627, 251, 209); materials.Should().Contain("Archer Monument", 6); materials.Should().Contain("Archer Piece", 6); materials.Should().Contain("Crystallized Lore", 1); materials.Should().Contain("Gem of Archer", 6); materials.Should().Contain("Homunculus Baby", 8); materials.Should().Contain("Magic Gem of Archer", 6); materials.Should().Contain("Octuplet Crystals", 6); materials.Should().Contain("Proof of Hero", 25); materials.Should().Contain("Secret Gem of Archer", 6); materials.Should().Contain("Seed of Yggdrasil", 9); materials.Should().Contain("Void's Dust", 24); } } }
public async Task UshiwakamaruRiderSkilled100() { _wireMockFixture.CheckIfMockServerInUse(); _wireMockUtility.AddStubs(_wireMockFixture); using (var scope = _container.BeginLifetimeScope()) { ScopedClasses resolvedClasses = AutofacUtility.ResolveScope(scope); ConstantExportJson constantExportJson = await FrequentlyUsed.GetConstantExportJsonAsync(resolvedClasses.AtlasAcademyClient); int servantId = 401400; ServantBasicJson servantBasicJson = constantExportJson.ListServantBasicJson.Find(s => s.Id == servantId); /* Load servants as if they're already in a save file */ ChaldeaServant currentServant = new ChaldeaServant { ServantBasicInfo = servantBasicJson, FouAttack = 1000, FouHealth = 1000, IsSupportServant = false, NpLevel = 1, ServantLevel = 1, SkillLevels = new int[] { 1, 1, 1 } }; ChaldeaServant goalServant = new ChaldeaServant { ServantBasicInfo = servantBasicJson, FouAttack = 1000, FouHealth = 1000, IsSupportServant = false, NpLevel = 1, ServantLevel = 100, SkillLevels = new int[] { 9, 9, 9 } }; RequiredItemMaterials req = resolvedClasses.MaterialCalculation.HowMuchIsNeeded( currentServant, goalServant, constantExportJson.GrailCostNiceJson, await resolvedClasses.AtlasAcademyClient.GetServantInfo(servantId.ToString())); Dictionary <string, int> materials = resolvedClasses.MaterialCalculation.GroupItemParents(req.Items); MaterialOutput(req, materials); using (new AssertionScope()) { RequiredItemsShouldBe(req, 72130000, 9, 753, 627, 251, 209); materials.Should().Contain("Eternal Gear", 48); materials.Should().Contain("Gem of Rider", 36); materials.Should().Contain("Ghost Lantern", 11); materials.Should().Contain("Magic Gem of Rider", 36); materials.Should().Contain("Meteor Horseshoe", 40); materials.Should().Contain("Octuplet Crystals", 56); materials.Should().Contain("Proof of Hero", 105); materials.Should().Contain("Rider Monument", 12); materials.Should().Contain("Rider Piece", 12); materials.Should().Contain("Secret Gem of Rider", 36); } } }
public RequiredItemMaterials HowMuchIsNeeded(ChaldeaServant currentServant, ChaldeaServant goalServant, GrailCostNiceJson grailCostNiceJson, ServantNiceJson currentServantNiceJson) { // Validate the two servant objects are the same servant if (currentServant.ServantBasicInfo != goalServant.ServantBasicInfo) { return(null); } // Set up _requiredItemMaterials = new RequiredItemMaterials(); // Allows nice JSON info to be saved prior, if provided if (currentServantNiceJson != null && currentServantNiceJson.Id == currentServant.ServantBasicInfo.Id) { _currentServantNiceJson = currentServantNiceJson; } else { return(_requiredItemMaterials); } /* Calculate ascension materials, QP, and/or grails */ if (currentServant.ServantLevel < goalServant.ServantLevel) { AscensionLevel[] allAscensionLevels = AscensionLevels(currentServant.ServantBasicInfo.Rarity); // Find the required ascension levels with removing ascensions above the goal List <AscensionLevel> requiredAscensionLevels = allAscensionLevels .Where(i => currentServant.ServantLevel < i.LevelCap) .ToList(); requiredAscensionLevels.RemoveAll(c => goalServant.ServantLevel < c.LevelCap); // Ascension materials if (requiredAscensionLevels.Count > 0) { foreach (AscensionLevel ascensionLevel in requiredAscensionLevels) { ItemMaterials ascensionItemMaterials = AscensionItemMaterials(ascensionLevel); if (ascensionItemMaterials == null) { continue; } _requiredItemMaterials.Qp += ascensionItemMaterials.Qp; AddItemMaterials(ascensionItemMaterials.Items); } } // Grails if (goalServant.ServantLevel > allAscensionLevels[^ 1].LevelCap) { IEnumerable <GrailInfo> grailInfoList = GetGrailRarityInfo(goalServant.ServantBasicInfo.Rarity, grailCostNiceJson) .Where(g => g.AddLevelMax + currentServant.ServantLevel <= goalServant.ServantLevel); foreach (GrailInfo grailInfo in grailInfoList) { _requiredItemMaterials.Qp += grailInfo.Qp; _requiredItemMaterials.GrailCount++; } } // Overall ember count CalculateEmbersNeeded(currentServant, goalServant, _currentServantNiceJson.ExpGrowth); } /* Calculate skill materials and QP */ for (int i = 0; i < 3; i++) { int currentSkillLevel = currentServant.SkillLevels[i]; int goalSkillLevel = goalServant.SkillLevels[i]; if (currentSkillLevel < goalSkillLevel) { for (int j = currentSkillLevel; j < goalSkillLevel; j++) { switch (j) { case 1: AddItemMaterials(_currentServantNiceJson.SkillMaterials.FirstSkill.Items); _requiredItemMaterials.Qp += _currentServantNiceJson.SkillMaterials.FirstSkill.Qp; break; case 2: AddItemMaterials(_currentServantNiceJson.SkillMaterials.SecondSkill.Items); _requiredItemMaterials.Qp += _currentServantNiceJson.SkillMaterials.SecondSkill.Qp; break; case 3: AddItemMaterials(_currentServantNiceJson.SkillMaterials.ThirdSkill.Items); _requiredItemMaterials.Qp += _currentServantNiceJson.SkillMaterials.ThirdSkill.Qp; break; case 4: AddItemMaterials(_currentServantNiceJson.SkillMaterials.FourthSkill.Items); _requiredItemMaterials.Qp += _currentServantNiceJson.SkillMaterials.FourthSkill.Qp; break; case 5: AddItemMaterials(_currentServantNiceJson.SkillMaterials.FifthSkill.Items); _requiredItemMaterials.Qp += _currentServantNiceJson.SkillMaterials.FifthSkill.Qp; break; case 6: AddItemMaterials(_currentServantNiceJson.SkillMaterials.SixthSkill.Items); _requiredItemMaterials.Qp += _currentServantNiceJson.SkillMaterials.SixthSkill.Qp; break; case 7: AddItemMaterials(_currentServantNiceJson.SkillMaterials.SeventhSkill.Items); _requiredItemMaterials.Qp += _currentServantNiceJson.SkillMaterials.SeventhSkill.Qp; break; case 8: AddItemMaterials(_currentServantNiceJson.SkillMaterials.EighthSkill.Items); _requiredItemMaterials.Qp += _currentServantNiceJson.SkillMaterials.EighthSkill.Qp; break; case 9: AddItemMaterials(_currentServantNiceJson.SkillMaterials.NinthSkill.Items); _requiredItemMaterials.Qp += _currentServantNiceJson.SkillMaterials.NinthSkill.Qp; break; } } } } return(_requiredItemMaterials); }