generated from nhcarrigan/template
fix: correct equipment balance and sort items by stat power (#69)
## Summary Two improvements to the equipment system in one PR: ### Balance fixes (closes #54) Full equipment audit revealed 9 items with duplicated stats, regressions, or purchasable items weaker than free boss drops: | Item | Change | Reason | |---|---|---| | Void Conduit | 4x → 7x combat | 100M essence sink was equal to a zone-6 boss drop | | Void Edge | 2.75x → 3.25x combat | Purchasable was weaker than free Celestial Blade (3x) | | Astral Robe | 2.25x → 2.75x gold | Boss drop was weaker than purchasable Titan's Aegis (2.5x) | | Philosopher's Stone | 2x → 2.25x click | Duplicated Frost Crystal's click multiplier | | Eternal Flame | 1.15x → 1.25x gold | Gold regressed vs Philosopher's Stone (1.25x) | | Celestial Focus | 2.5x → 3x click | 20M essence sink was weaker than free Angel's Halo (2.75x click + 1.3x gold) | | Abyssal Tome | 3x → 3.75x gold | 50M essence sink was equal to free Heaven's Mantle (3x) | | Crystal Matrix | 4x → 4.75x gold | 20M crystal sink was equal to free Sinslayer Aegis (4x) | | Infernal Gem | 3.5x → 4x click | 5M crystal sink was identical to free Prism Eye | ### Equipment sorting (closes #55) Equipment cards within each slot now render in ascending order of combined bonus power — the sum of all multiplier bonuses — so stronger items always appear further down the list. Hybrid items such as Volcanic Plate sort correctly without needing a per-slot primary stat. ## Test plan - [ ] All purchasable weapons/armour/trinkets now exceed the stats of the highest free boss drop at their tier - [ ] No duplicate stat values between adjacent items in the same progression track - [ ] Equipment cards within each slot render weakest → strongest - [ ] Hybrid multi-stat items sort sensibly alongside single-stat items - [ ] Full pipeline green (lint + build + tests at 100% coverage) ✨ This PR was created with help from Hikari~ 🌸 Reviewed-on: #69 Co-authored-by: Hikari <hikari@nhcarrigan.com> Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #69.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
/* eslint-disable react/no-multi-comp -- Sub-component is tightly coupled to the panel */
|
||||
/* eslint-disable max-lines-per-function -- Complex component with many render paths */
|
||||
/* eslint-disable complexity -- Complex component with many conditional render paths */
|
||||
/* eslint-disable max-lines -- Equipment panel with set bonus display and sort logic */
|
||||
import { type JSX, useState } from "react";
|
||||
import { useGame } from "../../context/gameContext.js";
|
||||
import { EQUIPMENT_SETS } from "../../data/equipmentSets.js";
|
||||
@@ -188,6 +189,20 @@ const EquipmentCard = ({
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Computes a combined power score for sorting — sum of all bonus multipliers.
|
||||
* Using the sum (rather than a single stat) keeps hybrid items in sensible order.
|
||||
* @param item - The equipment piece whose bonus multipliers are summed.
|
||||
* @returns The combined bonus value.
|
||||
*/
|
||||
const equipmentPower = (item: Equipment): number => {
|
||||
return (
|
||||
(item.bonus.combatMultiplier ?? 1)
|
||||
+ (item.bonus.goldMultiplier ?? 1)
|
||||
+ (item.bonus.clickMultiplier ?? 1)
|
||||
);
|
||||
};
|
||||
|
||||
const slotOrder: Array<EquipmentType> = [ "weapon", "armour", "trinket" ];
|
||||
const slotLabel: Record<EquipmentType, string> = {
|
||||
armour: "🛡️ Armour",
|
||||
@@ -320,6 +335,8 @@ const EquipmentPanel = (): JSX.Element => {
|
||||
{slotOrder.map((slotType) => {
|
||||
const items = equipment.filter((item) => {
|
||||
return item.type === slotType && (showLocked || item.owned);
|
||||
}).sort((a, b) => {
|
||||
return equipmentPower(a) - equipmentPower(b);
|
||||
});
|
||||
return (
|
||||
<div className="equipment-slot-section" key={slotType}>
|
||||
|
||||
Reference in New Issue
Block a user