From 4b2d1b7dc0519fac89533ec59b7ccd83308d8bdf Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 3 Dec 2025 20:50:42 -0800 Subject: [PATCH] add calculateSkillDisplayValue helper for artifact skills --- src/lib/types/api/artifact.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lib/types/api/artifact.ts b/src/lib/types/api/artifact.ts index 2f77750b..c1c354b9 100644 --- a/src/lib/types/api/artifact.ts +++ b/src/lib/types/api/artifact.ts @@ -286,3 +286,20 @@ export function getSkillGroupForSlot(slot: number): ArtifactSkillGroup { if (slot === 3) return 'group_ii' return 'group_iii' } + +/** + * Calculate the displayed skill value at a given level + * Formula: baseValue + (growth × (level - 1)) + * + * @param baseValue - The base strength value (rolled when skill is obtained) + * @param growth - The per-level growth factor (default 0) + * @param level - The skill level (1-5) + * @returns The calculated display value that matches in-game display + */ +export function calculateSkillDisplayValue( + baseValue: number, + growth: number | undefined, + level: number +): number { + return baseValue + (growth ?? 0) * (level - 1) +}