diff --git a/SimcProfileParser.Tests/DataSync/RawDataExtractionServiceTests.cs b/SimcProfileParser.Tests/DataSync/RawDataExtractionServiceTests.cs index 302f8da..aa26104 100644 --- a/SimcProfileParser.Tests/DataSync/RawDataExtractionServiceTests.cs +++ b/SimcProfileParser.Tests/DataSync/RawDataExtractionServiceTests.cs @@ -399,35 +399,6 @@ public void RDE_Generates_RppmData() ClassicAssert.AreEqual(-0.5000, firstResult.Coefficient, "Coefficient"); } - [Test] - public void RDE_Generates_ConduitRankData() - { - // Arrange - RawDataExtractionService rawDataExtractionService = - new RawDataExtractionService(null); - - var incomingRawData = new Dictionary() - { - { "CovenantData.raw", "__conduit_rank_data { {\r\n" + - "{ 41, 0, 337078, 10.000000 },\r\n" + - "{ 41, 1, 337078, 11.000000 },\r\n" + - "};"} - }; - - // Act - var result = rawDataExtractionService.GenerateConduitRankData(incomingRawData); - var firstResult = result.FirstOrDefault(); - - // Assert - ClassicAssert.IsNotNull(result); - ClassicAssert.AreEqual(2, result.Count); - ClassicAssert.IsNotNull(firstResult); - ClassicAssert.AreEqual(337078, firstResult.SpellId, "Spell Id"); - ClassicAssert.AreEqual(41, firstResult.ConduitId, "Conduit Id"); - ClassicAssert.AreEqual(10.000000, firstResult.Value, "Value"); - ClassicAssert.AreEqual(0, firstResult.Rank, "Rank"); - } - [Test] public void RDE_Generates_ItemEffectData() { diff --git a/SimcProfileParser.Tests/Model/Profile/SimcParsedProfileTests.cs b/SimcProfileParser.Tests/Model/Profile/SimcParsedProfileTests.cs index 14e3415..366d00f 100644 --- a/SimcProfileParser.Tests/Model/Profile/SimcParsedProfileTests.cs +++ b/SimcProfileParser.Tests/Model/Profile/SimcParsedProfileTests.cs @@ -14,8 +14,6 @@ public void SimcParsedProfile_Collections_Not_Null() var spp = new SimcParsedProfile(); // Assert - ClassicAssert.IsNotNull(spp.Soulbinds); - ClassicAssert.IsNotNull(spp.Conduits); ClassicAssert.IsNotNull(spp.Professions); ClassicAssert.IsNotNull(spp.Items); } diff --git a/SimcProfileParser.Tests/SimcGenerationServiceIntegrationTests.cs b/SimcProfileParser.Tests/SimcGenerationServiceIntegrationTests.cs index 3e3f602..42b21a8 100644 --- a/SimcProfileParser.Tests/SimcGenerationServiceIntegrationTests.cs +++ b/SimcProfileParser.Tests/SimcGenerationServiceIntegrationTests.cs @@ -52,11 +52,6 @@ public async Task SGS_Creates_Profile() ClassicAssert.NotZero(profile.ParsedProfile.Level); ClassicAssert.NotZero(profile.GeneratedItems.Count); ClassicAssert.IsTrue(profile.GeneratedItems[0].Equipped); - ClassicAssert.NotZero(profile.ParsedProfile.Conduits.Count); - ClassicAssert.NotZero(profile.ParsedProfile.Conduits[0].SpellId); - ClassicAssert.NotZero(profile.ParsedProfile.Soulbinds.Count); - ClassicAssert.NotZero(profile.ParsedProfile.Soulbinds[0].SocketedConduits.Count); - ClassicAssert.NotZero(profile.ParsedProfile.Soulbinds[0].SocketedConduits[0].SpellId); ClassicAssert.IsNotNull(profile.Talents); ClassicAssert.AreEqual(0, profile.Talents.Count); //Assert.AreEqual(103775, profile.Talents[0].TraitEntryId); diff --git a/SimcProfileParser.Tests/SimcParserService_ParseProfileTests.cs b/SimcProfileParser.Tests/SimcParserService_ParseProfileTests.cs index ff4d09d..ae95549 100644 --- a/SimcProfileParser.Tests/SimcParserService_ParseProfileTests.cs +++ b/SimcProfileParser.Tests/SimcParserService_ParseProfileTests.cs @@ -187,49 +187,6 @@ public void SPS_Parses_Renown() ClassicAssert.AreEqual(renown, ParsedProfile.Renown); } - [Test] - public void SPS_Parses_Covenant() - { - // Arrange - var covenant = "night_fae"; - - // Act - - // Assert - ClassicAssert.IsNotNull(ParsedProfile); - ClassicAssert.IsNotNull(ParsedProfile.Covenant); - ClassicAssert.AreEqual(covenant, ParsedProfile.Covenant); - } - - [Test] - public void SPS_Parses_Conduits() - { - // Arrange - // 116:1/78:1/82:1/84:1/101:1/69:1/73:1/67:1/66:1 - var allConduits = new List() - { - new SimcParsedConduit() { ConduitId = 116, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 78, Rank = 7 }, - new SimcParsedConduit() { ConduitId = 82, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 84, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 101, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 69, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 73, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 67, Rank = 10 }, - new SimcParsedConduit() { ConduitId = 66, Rank = 1 }, - }; - - // Act - var expectedConduits = JsonConvert.SerializeObject(allConduits); - var actualConduits = JsonConvert.SerializeObject(ParsedProfile.Conduits); - - // Assert - ClassicAssert.IsNotNull(ParsedProfile); - ClassicAssert.IsNotNull(ParsedProfile.Conduits); - ClassicAssert.NotZero(ParsedProfile.Conduits.Count); - ClassicAssert.AreEqual(expectedConduits, actualConduits); - } - [Test] public void SPS_Parses_Talents() { @@ -264,71 +221,6 @@ public void SPS_Parses_Class() ClassicAssert.AreEqual(classId, ParsedProfile.ClassId); } - [Test] - public void SPS_Parses_Soulbinds() - { - // Arrange - // # soulbind=niya:1,342270/82:1/73:1/320662/69:1/84:1/320668/322721 - // soulbind = dreamweaver:2,319191 / 82:1 / 66:1 / 319213 / 69:1 / 84:1 / 319216 / 319217 - // # soulbind=korayn:6, - var allSoulbinds = new List() - { - new SimcParsedSoulbind() - { - Name = "niya", - SoulbindId = 1, - IsActive = false, - SocketedConduits = new List() - { - new SimcParsedConduit() { ConduitId = 82, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 73, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 69, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 84, Rank = 1 } - }, - SoulbindSpells = new List() - { - 342270, 320662, 320668, 322721 - } - }, - new SimcParsedSoulbind() - { - Name = "dreamweaver", - SoulbindId = 2, - IsActive = true, - SocketedConduits = new List() - { - new SimcParsedConduit() { ConduitId = 82, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 66, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 69, Rank = 1 }, - new SimcParsedConduit() { ConduitId = 84, Rank = 1 } - }, - SoulbindSpells = new List() - { - 319191, 319213, 319216, 319217 - } - }, - new SimcParsedSoulbind() - { - Name = "korayn", - SoulbindId = 6, - IsActive = false, - SocketedConduits = new List(), - SoulbindSpells = new List() - } - }; - - // Act - var expectedSoulbinds = JsonConvert.SerializeObject(allSoulbinds); - var actualSoulbinds = JsonConvert.SerializeObject(ParsedProfile.Soulbinds); - - // Assert - ClassicAssert.IsNotNull(ParsedProfile); - ClassicAssert.IsNotNull(ParsedProfile.Soulbinds); - ClassicAssert.NotZero(ParsedProfile.Soulbinds.Count); - ClassicAssert.AreEqual(expectedSoulbinds, actualSoulbinds); - } - - [Test] public void SPS_Parses_Professions() { diff --git a/SimcProfileParser.Tests/SimcSpellCreationServiceTests.cs b/SimcProfileParser.Tests/SimcSpellCreationServiceTests.cs index 91230bf..9769e67 100644 --- a/SimcProfileParser.Tests/SimcSpellCreationServiceTests.cs +++ b/SimcProfileParser.Tests/SimcSpellCreationServiceTests.cs @@ -258,26 +258,6 @@ public async Task SSC_Creates_Player_Spell_WithPower() ClassicAssert.AreEqual(137031, spell.PowerCosts.Skip(1).First().Key); } - [Test] - public async Task SSC_Creates_Player_Spell_WithConduitRanks() - { - // Arrange - var playerLevel = 80u; - var spellId = 340609u; - - // Act - var spell = await _spellCreationService.GeneratePlayerSpellAsync(playerLevel, spellId); - var firstConduitRank = spell.ConduitRanks.FirstOrDefault(); - - // Assert - ClassicAssert.IsNotNull(spell); - ClassicAssert.IsNotNull(spell.ConduitRanks); - ClassicAssert.AreEqual(270, spell.ConduitId); - ClassicAssert.IsNotNull(firstConduitRank); - ClassicAssert.AreEqual(15, firstConduitRank.Value); - ClassicAssert.AreEqual(0, firstConduitRank.Key); - } - [Test] public async Task SSC_Creates_Item_Spell_RppmSpecModifiers() { diff --git a/SimcProfileParser/DataSync/CacheService.cs b/SimcProfileParser/DataSync/CacheService.cs index cb306b3..40111a2 100644 --- a/SimcProfileParser/DataSync/CacheService.cs +++ b/SimcProfileParser/DataSync/CacheService.cs @@ -167,16 +167,6 @@ public CacheService(IRawDataExtractionService rawDataExtractionService, } }); - ((ICacheService)this).RegisterFileConfiguration(new CacheFileConfiguration() - { - LocalParsedFile = "CovenantData.json", - ParsedFileType = SimcParsedFileType.CovenantData, - RawFiles = new Dictionary() - { - { "CovenantData.raw", "covenant_data" } - } - }); - ((ICacheService)this).RegisterFileConfiguration(new CacheFileConfiguration() { LocalParsedFile = "ItemEffectData.json", diff --git a/SimcProfileParser/DataSync/RawDataExtractionService.cs b/SimcProfileParser/DataSync/RawDataExtractionService.cs index 7beb467..0c2bbe9 100644 --- a/SimcProfileParser/DataSync/RawDataExtractionService.cs +++ b/SimcProfileParser/DataSync/RawDataExtractionService.cs @@ -40,7 +40,6 @@ public object GenerateData(SimcParsedFileType fileType, Dictionary GenerateSpellScalingMultipliers(incomingRawData), SimcParsedFileType.CurvePoints => GenerateCurveData(incomingRawData), SimcParsedFileType.RppmData => GenerateRppmData(incomingRawData), - SimcParsedFileType.CovenantData => GenerateConduitRankData(incomingRawData), SimcParsedFileType.ItemEffectData => GenerateItemEffectData(incomingRawData), SimcParsedFileType.GameDataVersion => GenerateGameDataVersion(incomingRawData), SimcParsedFileType.TraitData => GenerateTraitData(incomingRawData), @@ -1115,60 +1114,6 @@ internal List GenerateRppmData(Dictionary inco return rppmData; } - internal List GenerateConduitRankData(Dictionary incomingRawData) - { - var rawData = incomingRawData.Where(d => d.Key == "CovenantData.raw").FirstOrDefault().Value; - - // Split the raw data to only be the parts we want. - string key = "_conduit_rank_data {"; - - int start = rawData.IndexOf(key) + key.Length; - int end = rawData.IndexOf("};", start); - - var dataChunk = rawData[start..end]; - - var lines = dataChunk.Split( - new[] { "\r\n", "\r", "\n" }, - StringSplitOptions.None - ); - - var conduitRankEntries = new List(); - - foreach (var line in lines) - { - // Split the data up - var data = line.Split(','); - - // Only process valid lines - if (data.Count() != 5) - continue; - - var conduitRank = new SimcRawSpellConduitRankEntry(); - - // Clean the data up - for (var i = 0; i < data.Length; i++) - { - data[i] = data[i].Replace("}", "").Replace("{", "").Trim(); - } - - // 0 is curve Id - conduitRank.ConduitId = Convert.ToUInt32(data[0]); - - // 1 is rank - conduitRank.Rank = Convert.ToUInt32(data[1]); - - // 2 is spell id - conduitRank.SpellId = Convert.ToUInt32(data[2]); - - // 3 is spell id - conduitRank.Value = ToDoubleClean(data[3]); - - conduitRankEntries.Add(conduitRank); - } - - return conduitRankEntries; - } - internal string GenerateGameDataVersion(Dictionary incomingRawData) { var rawData = incomingRawData.Where(d => d.Key == "GameDataVersion.raw").FirstOrDefault().Value; diff --git a/SimcProfileParser/Interfaces/ISimcSpellCreationService.cs b/SimcProfileParser/Interfaces/ISimcSpellCreationService.cs index 4e7d7a4..4433a1f 100644 --- a/SimcProfileParser/Interfaces/ISimcSpellCreationService.cs +++ b/SimcProfileParser/Interfaces/ISimcSpellCreationService.cs @@ -9,6 +9,5 @@ public interface ISimcSpellCreationService Task GenerateItemSpellAsync(SimcSpellOptions spellOptions); Task GeneratePlayerSpellAsync(uint playerLevel, uint spellId); Task GeneratePlayerSpellAsync(SimcSpellOptions spellOptions); - Task GetSpellIdFromConduitIdAsync(uint conduitId); } } diff --git a/SimcProfileParser/Interfaces/ISimcUtilityService.cs b/SimcProfileParser/Interfaces/ISimcUtilityService.cs index 1ecd7c0..05f993b 100644 --- a/SimcProfileParser/Interfaces/ISimcUtilityService.cs +++ b/SimcProfileParser/Interfaces/ISimcUtilityService.cs @@ -26,8 +26,6 @@ interface ISimcUtilityService Task> GetSpellRppmModifiersAsync(uint spellId); Task GetSpellScalingMultiplierAsync(int scaleIndex, int playerLevel); Task GetStaminaMultiplierAsync(int itemLevel, CombatRatingMultiplayerType staminaRatingType); - Task> GetSpellConduitRanksAsync(uint spellId); - Task GetSpellConduitSpellIdAsync(uint conduitId); Task GetItemEffectAsync(uint itemEffectId); Task GetTraitDataAsync(int traitEntryId); Task> GetTraitsByClassSpecAsync(int classId, int specId); diff --git a/SimcProfileParser/Model/DataSync/SimcFileTypeEnum.cs b/SimcProfileParser/Model/DataSync/SimcFileTypeEnum.cs index 246ea0a..0dca316 100644 --- a/SimcProfileParser/Model/DataSync/SimcFileTypeEnum.cs +++ b/SimcProfileParser/Model/DataSync/SimcFileTypeEnum.cs @@ -14,7 +14,6 @@ public enum SimcParsedFileType SpellScaleMultipliers, CurvePoints, RppmData, - CovenantData, ItemEffectData, GameDataVersion, TraitData diff --git a/SimcProfileParser/Model/Generated/SimcSpell.cs b/SimcProfileParser/Model/Generated/SimcSpell.cs index 71f98c2..cf8d6aa 100644 --- a/SimcProfileParser/Model/Generated/SimcSpell.cs +++ b/SimcProfileParser/Model/Generated/SimcSpell.cs @@ -40,22 +40,12 @@ public class SimcSpell /// Just getting percent mana is fine for our purposes now. /// public Dictionary PowerCosts { get; internal set; } - - /// - /// Set if this spell is a conduit - /// - public uint ConduitId { get; set; } - /// - /// Contains each of the ranks stored as N-1 (0-indexed). Entry [0] is Rank 1. - /// - public Dictionary ConduitRanks { get; set; } public List RppmModifiers { get; internal set; } public SimcSpell() { Effects = new List(); RppmModifiers = new List(); - ConduitRanks = new Dictionary(); PowerCosts = new Dictionary(); } } diff --git a/SimcProfileParser/Model/Profile/SimcParsedConduit.cs b/SimcProfileParser/Model/Profile/SimcParsedConduit.cs deleted file mode 100644 index 27c625f..0000000 --- a/SimcProfileParser/Model/Profile/SimcParsedConduit.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace SimcProfileParser.Model.Profile -{ - public class SimcParsedConduit - { - public int ConduitId { get; internal set; } - public uint SpellId { get; internal set; } - public int Rank { get; internal set; } - public override string ToString() - { - return $"{ConduitId}:{Rank}"; - } - } -} diff --git a/SimcProfileParser/Model/Profile/SimcParsedProfile.cs b/SimcProfileParser/Model/Profile/SimcParsedProfile.cs index 46bb892..7b2a368 100644 --- a/SimcProfileParser/Model/Profile/SimcParsedProfile.cs +++ b/SimcProfileParser/Model/Profile/SimcParsedProfile.cs @@ -26,13 +26,6 @@ public class SimcParsedProfile public string Race { get; internal set; } public int RaceId { get; internal set; } public string Role { get; internal set; } - - public string Covenant { get; internal set; } - public IReadOnlyList Soulbinds { get; internal set; } - /// - /// Available conduits - /// - public IReadOnlyList Conduits { get; internal set; } /// /// Covenant Renown level /// @@ -57,9 +50,6 @@ public SimcParsedProfile() Professions = new List(); Talents = new List(); - Soulbinds = new List(); - Conduits = new List(); - ProfileLines = new List(); } } diff --git a/SimcProfileParser/Model/Profile/SimcParsedSoulbind.cs b/SimcProfileParser/Model/Profile/SimcParsedSoulbind.cs deleted file mode 100644 index d98904f..0000000 --- a/SimcProfileParser/Model/Profile/SimcParsedSoulbind.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; - -namespace SimcProfileParser.Model.Profile -{ - public class SimcParsedSoulbind - { - public string Name { get; internal set; } - public int SoulbindId { get; internal set; } - public IReadOnlyList SoulbindSpells { get; internal set; } - public IReadOnlyList SocketedConduits { get; internal set; } - public bool IsActive { get; internal set; } - - public SimcParsedSoulbind() - { - - SoulbindSpells = new List(); - SocketedConduits = new List(); - } - } -} diff --git a/SimcProfileParser/SimcGenerationService.cs b/SimcProfileParser/SimcGenerationService.cs index 37f9343..7e922ce 100644 --- a/SimcProfileParser/SimcGenerationService.cs +++ b/SimcProfileParser/SimcGenerationService.cs @@ -110,23 +110,6 @@ public async Task GenerateProfileAsync(List profileString) newItem.Equipped = item.Equipped; } - // Populate the spell Ids of any conduits set - foreach (var conduit in newProfile.ParsedProfile.Conduits) - { - conduit.SpellId = await _simcSpellCreationService - .GetSpellIdFromConduitIdAsync((uint)conduit.ConduitId); - } - - // and populate the spell Ids of any conduits set) - foreach (var soulbind in newProfile.ParsedProfile.Soulbinds) - { - foreach (var conduit in soulbind.SocketedConduits) - { - conduit.SpellId = await _simcSpellCreationService - .GetSpellIdFromConduitIdAsync((uint)conduit.ConduitId); - } - } - // Populate the details for each talent foreach(var talent in newProfile.ParsedProfile.Talents) { diff --git a/SimcProfileParser/SimcParserService.cs b/SimcProfileParser/SimcParserService.cs index e914628..2ddd110 100644 --- a/SimcProfileParser/SimcParserService.cs +++ b/SimcProfileParser/SimcParserService.cs @@ -160,21 +160,6 @@ public SimcParsedProfile ParseProfileAsync(List profileLines) profile.Spec = line.Value.Trim(); break; - case "covenant": - _logger?.LogDebug("Trying to parse covenant ({line.Identifier}) with value: {line.Value}", line.Identifier, line.Value); - profile.Covenant = line.Value.Trim(); - break; - - case "soulbind": - _logger?.LogDebug("Trying to parse soulbind ({line.Identifier}) with value: {line.Value}", line.Identifier, line.Value); - TryApplySoulbind(profile, line); - break; - - case "conduits_available": - _logger?.LogDebug("Trying to parse conduits_available ({line.Identifier}) with value: {line.Value}", line.Identifier, line.Value); - TryApplyConduitData(profile, line.Value); - break; - case "renown": _logger?.LogDebug("Trying to parse renown ({line.Identifier}) with value: {line.Value}", line.Identifier, line.Value); @@ -441,53 +426,6 @@ private void TryApplyLevel(SimcParsedProfile result, string valueString) result.Level = level; } - private void TryApplyConduitData(SimcParsedProfile profile, string valueString) - { - if (profile.Conduits.Count > 0) - { - _logger?.LogWarning("Overriding existing conduits. " + - "There should only be one conduits_available provided per profile."); - } - - // Valid conduit string - // conduits_available=116:1/78:1/82:1/84:1/101:1/69:1/73:1/67:1/66:1 - if (valueString.Contains(":")) - { - var results = new List(); - - var conduitParts = valueString.Split('/'); - - foreach (var part in conduitParts) - { - var kvp = part.Split(':'); - - if (kvp.Length != 2 || - !int.TryParse(kvp[0], out int conduitId) || - !int.TryParse(kvp[1], out int conduitRank)) - { - _logger?.LogWarning("Invalid conduit found in part ({part}): {valueString}", part, valueString); - continue; - } - - _logger?.LogDebug("Adding new conduit ({conduitId}) at rank: {conduitRank}", conduitId, conduitRank); - - var conduit = new SimcParsedConduit() - { - ConduitId = conduitId, - Rank = conduitRank - }; - - results.Add(conduit); - } - - profile.Conduits = new ReadOnlyCollection(results); - } - else - { - _logger?.LogDebug("No valid conduits found in string: {valueString}", valueString); - } - } - private void TryApplyTalents(SimcParsedProfile profile, string valueString) { if (valueString.Length > 0) @@ -518,99 +456,7 @@ private void TryApplyTalents(SimcParsedProfile profile, string valueString) else _logger?.LogDebug("No valid talents found in string: {valueString}", valueString); } - - private void TryApplySoulbind(SimcParsedProfile profile, SimcParsedLine line) - { - // Valid soublind string - // # soulbind=niya,342270/82:1/73:1/320662/69:1/84:1/320668/322721 - if (line.Value.Contains(",")) - { - var result = new SimcParsedSoulbind(); - - // Get the soulbind name - var soulbindName = line.Value.Split(',').FirstOrDefault(); - if (soulbindName.Length > 0) - { - if (soulbindName.Contains(':')) - { - var soulbindNameParts = soulbindName.Split(':'); - result.Name = soulbindNameParts[0]; - result.SoulbindId = Convert.ToInt32(soulbindNameParts[1]); - } - else - result.Name = soulbindName; - } - else - { - _logger?.LogWarning("Unable to parse soulbind name on line: {line.RawLine}", line.RawLine); - } - - // Set if it's active - result.IsActive = !(line.RawLine[0] == '#'); - - // Now split all the pairs and grab the soulbind spells and socketed conduits - var soulbindParts = line.Value.Split(',').LastOrDefault().Split('/'); - - var soulbindSpells = new List(); - var socketedConduits = new List(); - - foreach (var part in soulbindParts) - { - if (part.Contains(':')) - { - // It's a socketed conduit - var kvp = part.Split(':'); - - if (kvp.Length != 2 || - !int.TryParse(kvp[0], out int conduitId) || - !int.TryParse(kvp[1], out int conduitRank)) - { - _logger?.LogWarning("Invalid socketed conduit found in part ({part}): {line.CleanLine}", part, line.CleanLine); - continue; - } - - _logger?.LogDebug("Adding new socketed conduit ({conduitId}) at rank: {conduitRank}", conduitId, conduitRank); - - var conduit = new SimcParsedConduit() - { - ConduitId = conduitId, - Rank = conduitRank - }; - - socketedConduits.Add(conduit); - } - else - { - // It's a soulbind spell - if (int.TryParse(part, out int soulbindSpellId)) - { - _logger?.LogDebug("Adding soulbind ({soulbindSpellId}) from: {line.CleanLine}", soulbindSpellId, line.CleanLine); - soulbindSpells.Add(soulbindSpellId); - } - else - { - _logger?.LogWarning("Unable to parse soulbind spell or conduit from part ({part}) in: {line.CleanLine}", part, line.CleanLine); - } - } - } - - // Add the soulbind spells and socketed conduits - result.SocketedConduits = socketedConduits; - result.SoulbindSpells = soulbindSpells; - - // Add the soulbind to the current ones. - var soulbinds = new List(profile.Soulbinds) - { - result - }; - profile.Soulbinds = soulbinds; - } - else - { - _logger?.LogDebug("No valid soulbinds found in string: {line.CleanLine}", line.CleanLine); - } - } - + private void TryApplyProfessions(SimcParsedProfile profile, SimcParsedLine line) { var professions = new List(); diff --git a/SimcProfileParser/SimcProfileParser.csproj b/SimcProfileParser/SimcProfileParser.csproj index d7cf2ac..78c1dde 100644 --- a/SimcProfileParser/SimcProfileParser.csproj +++ b/SimcProfileParser/SimcProfileParser.csproj @@ -3,9 +3,9 @@ net9.0 true - 2.2.0 - 2.2.0 - 2.2.0 + 3.0.0 + 3.0.0 + 3.0.0 Mechanical Priest Mechanical Priest GPL-3.0-only @@ -32,8 +32,8 @@ - - - + + + diff --git a/SimcProfileParser/SimcSpellCreationService.cs b/SimcProfileParser/SimcSpellCreationService.cs index 7ab58d7..47561b0 100644 --- a/SimcProfileParser/SimcSpellCreationService.cs +++ b/SimcProfileParser/SimcSpellCreationService.cs @@ -142,17 +142,6 @@ public async Task GeneratePlayerSpellAsync(uint playerLevel, uint spe }); } - // Add the conduit info - var conduitRanks = await _simcUtilityService.GetSpellConduitRanksAsync(spellData.Id); - - foreach (var rank in conduitRanks) - { - if (itemSpell.ConduitId == 0) - itemSpell.ConduitId = rank.ConduitId; - - itemSpell.ConduitRanks.Add(rank.Rank, rank.Value); - } - return itemSpell; } @@ -171,13 +160,6 @@ public async Task GeneratePlayerSpellAsync(SimcSpellOptions spellOpti return spell; } - public async Task GetSpellIdFromConduitIdAsync(uint conduitId) - { - var result = await _simcUtilityService.GetSpellConduitSpellIdAsync(conduitId); - - return result; - } - internal async Task BuildItemSpellAsync(uint spellId, int itemLevel, ItemQuality itemQuality, InventoryType inventoryType, List parentSpellIds = null) { diff --git a/SimcProfileParser/SimcUtilityService.cs b/SimcProfileParser/SimcUtilityService.cs index 24c3878..6da0573 100644 --- a/SimcProfileParser/SimcUtilityService.cs +++ b/SimcProfileParser/SimcUtilityService.cs @@ -339,17 +339,21 @@ public async Task GetScaledModValueAsync(SimcItem item, ItemModType modType return (int)Math.Round(rawValue); } - - if (currentStatValue == 0 || newItemLevel == 0 || item.ItemLevel == 0) - { - _logger?.LogError($"Items and mods that don't scale are not yet implemented. modType: {modType}, slotType: {slotType}, statAllocation: {statAllocation}, itemBudget: {itemBudget}"); - return 0; - } else { - var approximateCoefficient = ApproximateScaleCoefficient(item.ItemLevel, newItemLevel); - return (int)Math.Floor(currentStatValue * approximateCoefficient); - } + if (currentStatValue == 0 || newItemLevel == 0 || item.ItemLevel == 0) + { + _logger?.LogError($"Items and mods that don't scale are not yet implemented. modType: {modType}, slotType: {slotType}, statAllocation: {statAllocation}, itemBudget: {itemBudget}"); + return 0; + } + else + { + var approximateCoefficient = ApproximateScaleCoefficient(item.ItemLevel, newItemLevel); + return (int)Math.Floor(currentStatValue * approximateCoefficient); + } + } + + // TODO: Some new items have a zero value for stats like stamina. //throw new NotImplementedException("Items and mods that don't scale are not yet implemented"); @@ -459,24 +463,6 @@ public async Task> GetSpellRppmModifiersAsync(uint spellI return result; } - public async Task> GetSpellConduitRanksAsync(uint spellId) - { - var conduitRanks = await _cacheService.GetParsedFileContentsAsync>(SimcParsedFileType.CovenantData); - - var result = conduitRanks.Where(m => m.SpellId == spellId).ToList(); - - return result; - } - - public async Task GetSpellConduitSpellIdAsync(uint conduitId) - { - var conduitRanks = await _cacheService.GetParsedFileContentsAsync>(SimcParsedFileType.CovenantData); - - var result = conduitRanks.Where(c => c.ConduitId == conduitId).ToList().FirstOrDefault(); - - return result.SpellId; - } - public async Task GetItemEffectAsync(uint itemEffectId) { var itemEffects = await _cacheService.GetParsedFileContentsAsync>(SimcParsedFileType.ItemEffectData);