Skip to content
This repository was archived by the owner on Sep 25, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MaxPowerLevel/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public async Task<IActionResult> Dashboard(BungieMembershipType type, long id)
Items = maxGear[item.Key].Values,
PowerLevel = _maxPower.ComputePower(maxGear[item.Key].Values),
Progressions = profile.CharacterProgressions.Data[item.Key].Progressions,
Milestones = profile.CharacterProgressions.Data[item.Key].Milestones,
Engrams = engrams[item.Key]
});
var recommendations = await _recommendations.GetRecommendations(recomendationInfo);
Expand Down
1 change: 1 addition & 0 deletions MaxPowerLevel/Controllers/CharacterController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public async Task<IActionResult> Details(int type, long id, long characterId)
Items = maxGear.Values,
PowerLevel = maxPower,
Progressions = characterProgressions.Progressions.Data.Progressions,
Milestones = characterProgressions.Progressions.Data.Milestones,
Engrams = engrams
});

Expand Down
6 changes: 3 additions & 3 deletions MaxPowerLevel/MaxPowerLevel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<UserSecretsId>ed64c0be-3d6b-4283-b887-4dcb9de6293a</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Humanizer" Version="2.8.26"/>
<PackageReference Include="Fractions" Version="4.0.1"/>
<PackageReference Include="Destiny2" Version="1.10.0"/>
<PackageReference Include="Humanizer" Version="2.8.26" />
<PackageReference Include="Fractions" Version="6.0.0" />
<PackageReference Include="Destiny2" Version="1.12.0" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions MaxPowerLevel/Models/CharacterRecomendationInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public decimal PowerLevel
}
public int IntPowerLevel { get; private set; }
public IDictionary<uint, DestinyProgression> Progressions { get; set; }
public IDictionary<uint, DestinyMilestone> Milestones { get; set; }
public IEnumerable<Item> Engrams { get; set; }
}
}
5 changes: 4 additions & 1 deletion MaxPowerLevel/Models/PinnacleActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ public class PinnacleActivity
{
public string Name { get; }

public uint MilestoneHash { get; }

public ItemSlot.SlotHashes[][] Encounters { get; }

public PinnacleActivity(string name, ItemSlot.SlotHashes[][] encounters)
public PinnacleActivity(string name, uint milestonHash, ItemSlot.SlotHashes[][] encounters)
{
Name = name;
MilestoneHash = milestonHash;
Encounters = encounters;
}

Expand Down
20 changes: 16 additions & 4 deletions MaxPowerLevel/Services/AbstractRecommendations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private IEnumerable<Recommendation> GetRecommendations(CharacterRecomendationInf
recommendations.Add(recommendation);
}

recommendations.AddRange(CreatePinnacleRecommendations(info.IntPowerLevel, info.Items));
recommendations.AddRange(CreatePinnacleRecommendations(info.IntPowerLevel, info.Items, info.Milestones));
return recommendations;
}

Expand Down Expand Up @@ -258,14 +258,26 @@ private static string GetDisplayString(string description, IEnumerable<(ItemSlot
protected abstract IEnumerable<PinnacleActivity> CreatePinnacleActivities();
protected virtual IEnumerable<PinnacleActivity> CreateWeakPinnacleActivities() => Enumerable.Empty<PinnacleActivity>();

protected virtual IEnumerable<Recommendation> CreatePinnacleRecommendations(int powerLevel, IEnumerable<Item> items)
protected virtual IEnumerable<PinnacleActivity> GetAvailablePinnacleActivities(IDictionary<uint, DestinyMilestone> milestones)
{
return CreatePinnacleActivities()
.Where(p => p.MilestoneHash == uint.MinValue || milestones.ContainsKey(p.MilestoneHash));
}

protected virtual IEnumerable<PinnacleActivity> GetAvailableWeakPinnacleActivities(IDictionary<uint, DestinyMilestone> milestones)
{
return CreateWeakPinnacleActivities()
.Where(p => p.MilestoneHash == uint.MinValue || milestones.ContainsKey(p.MilestoneHash));
}

protected virtual IEnumerable<Recommendation> CreatePinnacleRecommendations(int powerLevel, IEnumerable<Item> items, IDictionary<uint, DestinyMilestone> activities)
{
var powerLevels = items.ToDictionary(item => item.Slot.Hash, item => (decimal)item.PowerLevel);

var strongPinnacles = new Recommendation("Pinnacle Engrams",
SortPinnacleActivites(CreatePinnacleActivities(), powerLevels));
SortPinnacleActivites(GetAvailablePinnacleActivities(activities), powerLevels));
var weakPinnacles = new Recommendation("Pinnacle Engrams (Weak)",
SortPinnacleActivites(CreateWeakPinnacleActivities(), powerLevels));
SortPinnacleActivites(GetAvailableWeakPinnacleActivities(activities), powerLevels));

var levelsToGo = HardCap - powerLevel;
if (levelsToGo <= 2)
Expand Down
12 changes: 6 additions & 6 deletions MaxPowerLevel/Services/PinnacleActivities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ static class PinnacleActivities
};

public static readonly PinnacleActivity Strikes =
new PinnacleActivity("Weekly Vanguard Strikes", new[] { AllSlots });
new PinnacleActivity("Weekly Vanguard Strikes", 1437935813, new[] { AllSlots });
public static readonly PinnacleActivity Crucible =
new PinnacleActivity("Crucible Playlist Challenge", new[] { AllSlots });
new PinnacleActivity("Crucible Playlist Challenge", 3312774044, new[] { AllSlots });
public static readonly PinnacleActivity Gambit =
new PinnacleActivity("Gambit", new[] { AllSlots });
new PinnacleActivity("Gambit", 3448738070, new[] { AllSlots });
public static readonly PinnacleActivity Clan =
new PinnacleActivity("Clan Rewards", new[] { AllSlots });
new PinnacleActivity("Clan Rewards", 3603098564, new[] { AllSlots });
public static readonly PinnacleActivity NightfallScore =
new PinnacleActivity("Nightfall: The Ordeal Weekly Score", new[] { PinnacleActivities.AllSlots });
new PinnacleActivity("Nightfall: The Ordeal Weekly Score", 2029743966, new[] { PinnacleActivities.AllSlots });

public static readonly PinnacleActivity Prophecy = new PinnacleActivity("Prophecy", new[]
public static readonly PinnacleActivity Prophecy = new PinnacleActivity("Prophecy", 825965416, new[]
{
new[]
{
Expand Down
4 changes: 2 additions & 2 deletions MaxPowerLevel/Services/YearFour/Season12Recommendations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ protected override IEnumerable<PinnacleActivity> CreatePinnacleActivities()
var year4Pinnacles = base.CreatePinnacleActivities();
return year4Pinnacles.Concat(new[]
{
new PinnacleActivity("Weekly Wrathborn Hunts", new[] { PinnacleActivities.AllSlots }),
new PinnacleActivity("Coup Dê Grace", new[] { PinnacleActivities.AllSlots }),
new PinnacleActivity("Weekly Wrathborn Hunts", 2406589846, new[] { PinnacleActivities.AllSlots }),
new PinnacleActivity("Coup Dê Grace", uint.MinValue, new[] { PinnacleActivities.AllSlots }), //can't find the hash for coup
});
}
}
Expand Down
12 changes: 12 additions & 0 deletions MaxPowerLevel/Services/YearFour/Season13Recommendations.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Destiny2;
using MaxPowerLevel.Models;
using System.Collections.Generic;
using System.Linq;

namespace MaxPowerLevel.Services.YearFour
{
Expand All @@ -16,5 +19,14 @@ public Season13Recommendations(IManifest manifest, SeasonPass seasonPass)
protected override int HardCap => 1310;

protected override uint SeasonHash => 2809059426;

protected override IEnumerable<PinnacleActivity> CreatePinnacleActivities()
{
var year4Pinnacles = base.CreatePinnacleActivities();
return year4Pinnacles.Concat(new[]
{
new PinnacleActivity("Presage", uint.MinValue, new[] { PinnacleActivities.AllSlots })
});
}
}
}
9 changes: 5 additions & 4 deletions MaxPowerLevel/Services/YearFour/Year4Recommendations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected override IEnumerable<PinnacleActivity> CreatePinnacleActivities()
return new[]
{
PinnacleActivities.NightfallScore,
new PinnacleActivity("Deep Stone Crypt", new[]
new PinnacleActivity("Deep Stone Crypt", 541780856, new[]
{
new[]
{
Expand Down Expand Up @@ -49,10 +49,11 @@ protected override IEnumerable<PinnacleActivity> CreatePinnacleActivities()
ItemSlot.SlotHashes.Power // Sword and HMG
},
}),
new PinnacleActivity("Weekly Exo Challenge", new[] { PinnacleActivities.AllSlots }),
new PinnacleActivity("Weekly Empire Hunts", new[] { PinnacleActivities.AllSlots }),
new PinnacleActivity("Weekly Exo Challenge", 1713200903, new[] { PinnacleActivities.AllSlots }),
new PinnacleActivity("Weekly Empire Hunts", 291895718, new[] { PinnacleActivities.AllSlots }),
PinnacleActivities.Prophecy,
new PinnacleActivity("Harbringer", new[] { PinnacleActivities.AllSlots })
new PinnacleActivity("Harbinger",1086730368, new[] { PinnacleActivities.AllSlots }),

};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected override IEnumerable<PinnacleActivity> CreatePinnacleActivities()
.Concat(new[]
{
PinnacleActivities.Prophecy,
new PinnacleActivity(DarkTimes, new[] { PinnacleActivities.AllSlots })
new PinnacleActivity(DarkTimes, uint.MinValue, new[] { PinnacleActivities.AllSlots }) //can't find the hash
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion MaxPowerLevel/Services/YearThree/Season9Recommendations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected override IEnumerable<PinnacleActivity> CreatePinnacleActivities()
return base.CreatePinnacleActivities()
.Concat(new[]
{
new PinnacleActivity(SundialLegend, new[]
new PinnacleActivity(SundialLegend, uint.MinValue, new[] //can't find the hash for sundial
{
new[]
{
Expand Down
6 changes: 3 additions & 3 deletions MaxPowerLevel/Services/YearThree/Year3Recommendations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected override IEnumerable<PinnacleActivity> CreatePinnacleActivities()
return new[]
{
// Pit of Heresy can drop armor
new PinnacleActivity(PitOfHeresy, new[]
new PinnacleActivity(PitOfHeresy, uint.MinValue, new[] //can't find the hash for PoH
{
new[]
{
Expand All @@ -35,11 +35,11 @@ protected override IEnumerable<PinnacleActivity> CreatePinnacleActivities()
}
}),
// Nightmare Hunt: Master can drop anything
new PinnacleActivity(MasterNightmareHunt, new[] { PinnacleActivities.AllSlots }),
new PinnacleActivity(MasterNightmareHunt, 291895718, new[] { PinnacleActivities.AllSlots }),
// Nightfall: The Ordeal Weekly Score can drop anything
PinnacleActivities.NightfallScore,
// Garden of Salvation
new PinnacleActivity(GardenOfSalvation, new[]
new PinnacleActivity(GardenOfSalvation, 2712317338, new[]
{
// Encounter 1 drops Bow (Kinetic), Fusion Rifle (Energy), Boots
new[]
Expand Down