Skip to content

Commit

Permalink
Update roll efficiency calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
lantua committed Dec 4, 2023
1 parent 17e3a3d commit 4c12af7
Showing 1 changed file with 8 additions and 13 deletions.
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

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

0 comments on commit 4c12af7

Please sign in to comment.