Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update roll efficiency calculation #1362

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Changes from 1 commit
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
21 changes: 8 additions & 13 deletions apps/frontend/src/app/Data/Artifacts/Artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,14 @@ export default class Artifact {
filter.size -
matchedSlotCount -
(filter.has(artifact.mainStatKey as any) ? 1 : 0)
let maxEfficiency
if (emptySlotCount && unusedFilterCount)
maxEfficiency =
currentEfficiency +
Artifact.maxSubstatRollEfficiency[rarity] * rollsRemaining
// Rolls into good empty slot
else if (matchedSlotCount)
maxEfficiency =
currentEfficiency +
Artifact.maxSubstatRollEfficiency[rarity] *
(rollsRemaining - emptySlotCount)
// Rolls into existing matched slot
else maxEfficiency = currentEfficiency // No possible roll

lantua marked this conversation as resolved.
Show resolved Hide resolved
let maxEfficiency = currentEfficiency
const maxRollEff = Artifact.maxSubstatRollEfficiency[rarity]
// Rolls into good empty slots, assuming max-level artifacts have no empty slots
maxEfficiency += maxRollEff * Math.min(emptySlotCount, unusedFilterCount)
// Rolls into an existing good slot
if (matchedSlotCount || (emptySlotCount && unusedFilterCount))
maxEfficiency += maxRollEff * (rollsRemaining - emptySlotCount)

return { currentEfficiency, maxEfficiency }
}
Expand Down