Skip to content

Commit 94a339a

Browse files
committed
Fix builds; artifact image order; stat count on tooltips
1 parent 063147f commit 94a339a

12 files changed

+21
-10
lines changed
-5.69 KB
Loading
5.69 KB
Loading
-3.27 KB
Loading
3.27 KB
Loading
-11.9 KB
Loading
11.9 KB
Loading
979 Bytes
Loading
-979 Bytes
Loading

src/components/account-data/ArtifactDataHoverCard.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,26 @@ import {
1212
HoverCardTrigger,
1313
} from "@/components/ui/hover-card";
1414
import { useLanguage } from "@/contexts/LanguageContext";
15-
import { artifactsById, maxSubstatRolls } from "@/data/constants";
15+
import {
16+
AVERAGE_ROLL_MULTIPLIER,
17+
artifactsById,
18+
maxSubstatRolls,
19+
} from "@/data/constants";
1620
import type { ArtifactData, Rarity, Slot, SubStat } from "@/data/types";
1721
import { useMediaQuery } from "@/hooks/useMediaQuery";
1822
import { cn, getRarityColor } from "@/lib/utils";
1923
import { ArrowRight, CircleHelp } from "lucide-react";
2024
import { type ReactNode, useEffect, useRef, useState } from "react";
2125

2226
// -----------------------------------------------------------------------------
23-
// Utility: Calculate roll count for a substat
27+
// Utility: Calculate roll count for a substat (average roll = 0.85 × max roll)
2428
// -----------------------------------------------------------------------------
2529
function getRollCount(statKey: SubStat, value: number, rarity: Rarity): number {
2630
const maxRolls = maxSubstatRolls[rarity as 4 | 5];
2731
const maxValue = maxRolls?.[statKey];
2832
if (!maxValue) return 0;
29-
return value / maxValue;
33+
const avgRollValue = AVERAGE_ROLL_MULTIPLIER * maxValue;
34+
return value / avgRollValue;
3035
}
3136

3237
// -----------------------------------------------------------------------------

src/data/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ export const maxSubstatRolls = {
143143
},
144144
} as const;
145145

146+
/** Multiplier for average substat roll vs max roll (~0.85). Use for roll count: value / (AVERAGE_ROLL_MULTIPLIER * maxRoll). */
147+
export const AVERAGE_ROLL_MULTIPLIER = 0.85;
148+
146149
const createRecord = <Item, Key extends PropertyKey>(
147150
items: readonly Item[],
148151
getKey: (item: Item) => Key

0 commit comments

Comments
 (0)