Skip to content

Commit

Permalink
Fixed boots implicit affix for Maxroll imports.
Browse files Browse the repository at this point in the history
Fixed Maxroll builds with more than 3 explicit affixes.
  • Loading branch information
josdemmers committed Feb 4, 2025
1 parent 09fd093 commit c13e29d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
30 changes: 28 additions & 2 deletions D4Companion.Services/BuildsManagerMaxroll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,29 @@ public void CreatePresetFromMaxrollBuild(MaxrollBuild maxrollBuild, string profi
affixNames.Add("Resistance_Jewelry_All");
break;
case "Boots":
affixNames.Add("INHERENT_Evade_Attack_Reset");
// Note: Do not use a hardcoded affix for boots. Boots have different implicit affixes.
//affixNames.Add("INHERENT_Evade_Attack_Reset");
//affixNames.Add("INHERENT_Evade_Charges");
//affixNames.Add("INHERENT_Evade_MovementSpeed");
foreach (var implicitAffix in maxrollBuild.Data.Items[item.Value].Implicits)
{
int affixSno = implicitAffix.Nid;

AffixInfo? affixInfo = _affixManager.GetAffixInfoMaxrollByIdSno(affixSno.ToString());
if (affixInfo != null)
{
if (!affixPreset.ItemAffixes.Any(a => a.Id.Equals(affixInfo.IdName) && a.Type.Equals(itemType)))
{
affixPreset.ItemAffixes.Add(new ItemAffix
{
Id = affixInfo.IdName,
Type = itemType,
Color = _settingsManager.Settings.DefaultColorImplicit,
IsImplicit = true
});
}
}
}
break;
case "Chest":
break;
Expand Down Expand Up @@ -385,8 +407,12 @@ public void CreatePresetFromMaxrollBuild(MaxrollBuild maxrollBuild, string profi
}

// Add all explicit affixes for current item.Value
foreach (var explicitAffix in maxrollBuild.Data.Items[item.Value].Explicits)
for (int i = 0; i < maxrollBuild.Data.Items[item.Value].Explicits.Count; i++)
{
// For legendary items only add the first three affixes.
if (uniqueInfo == null && i > 2) break;

var explicitAffix = maxrollBuild.Data.Items[item.Value].Explicits[i];
int affixSno = explicitAffix.Nid;
AffixInfo? affixInfo = _affixManager.GetAffixInfoMaxrollByIdSno(affixSno.ToString());

Expand Down
4 changes: 2 additions & 2 deletions D4Companion/common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<FileVersion>4.2.3.0</FileVersion>
<Version>4.2.3.0</Version>
<FileVersion>4.2.4.0</FileVersion>
<Version>4.2.4.0</Version>
<Copyright>Copyright © 2025</Copyright>
<TargetFramework>net6.0-windows</TargetFramework>
</PropertyGroup>
Expand Down

0 comments on commit c13e29d

Please sign in to comment.