Skip to content

Commit d015c18

Browse files
committed
passive wiki skill info
1 parent b7742b1 commit d015c18

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

src/pages/Skills.tsx

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ export default function Skills() {
1111
const { profile } = useProfile();
1212
const { data: skillLibrary, loading: l1 } = useGameData<any>('SkillLibrary.json');
1313
const { data: skillUpgrades, loading: l1b } = useGameData<any>('SkillUpgradeLibrary.json');
14+
const { data: passiveLibrary, loading: l1c } = useGameData<any>('SkillPassiveLibrary.json');
1415
const { data: spriteMapping, loading: l2 } = useGameData<any>('ManualSpriteMapping.json');
1516

1617
const [searchTerm, setSearchTerm] = useState('');
1718
const [filterRarity, setFilterRarity] = useState<string | null>(null);
1819
const [globalLevel, setGlobalLevel] = useState(50);
1920

20-
const loading = l1 || l1b || l2;
21+
const loading = l1 || l1b || l1c || l2;
2122
const skillsConfig = spriteMapping?.skills;
2223

2324
// Build sprite lookup
@@ -210,6 +211,40 @@ export default function Skills() {
210211
</div>
211212
</div>
212213

214+
{/* Passive Stats */}
215+
{passiveLibrary && passiveLibrary[skill.rarity] && (
216+
<div className="grid grid-cols-1 gap-1 mb-3">
217+
{(() => {
218+
const passiveData = passiveLibrary[skill.rarity];
219+
if (!passiveData?.LevelStats) return null;
220+
221+
const pLevelIdx = Math.min(Math.max(1, globalLevel) - 1, passiveData.LevelStats.length - 1);
222+
const currentStats = passiveData.LevelStats[pLevelIdx]?.Stats || [];
223+
224+
return currentStats.map((stat: any, idx: number) => {
225+
const statType = stat.StatNode?.UniqueStat?.StatType || "Unknown";
226+
const value = stat.Value || 0;
227+
// Check for Additive/Multiplicative if needed, usually additive flats here
228+
const isPercent = false;
229+
230+
// Only show positive values
231+
if (value <= 0) return null;
232+
233+
let valueColor = "text-accent-secondary";
234+
if (statType === "Health") valueColor = "text-green-400";
235+
if (statType === "Damage") valueColor = "text-red-400";
236+
237+
return (
238+
<div key={idx} className="bg-bg-input/30 px-2 py-1.5 rounded flex items-center justify-between text-[11px] border border-white/5">
239+
<span className="text-text-muted uppercase font-bold tracking-wider">{statType} (Passive)</span>
240+
<span className={cn("font-mono font-bold", valueColor)}>+{formatNumber(value)}{isPercent ? '%' : ''}</span>
241+
</div>
242+
);
243+
});
244+
})()}
245+
</div>
246+
)}
247+
213248
{/* Stats at current level */}
214249
<div className="grid grid-cols-2 gap-2 mt-auto">
215250
{dmgAtLevel > 0 && (

0 commit comments

Comments
 (0)