Release v0.1.6 2026-07-12

This commit is contained in:
Warren H
2026-07-12 23:20:15 -04:00
parent 35553c18dd
commit 122f159b94
55 changed files with 2229 additions and 587 deletions
+11
View File
@@ -156,6 +156,17 @@ export function canAffordGearUpgrade(inventory: readonly MaterialStack[], costs:
return costs.every((cost) => (inventory.find((item) => item.id === cost.itemId)?.quantity ?? 0) >= cost.quantity);
}
export function canUpgradeGearSlot(
progress: GearProgress,
inventory: readonly MaterialStack[],
ownerId: GearOwnerId,
slotId: GearSlotId,
): boolean {
const currentLevel = progress[ownerId].slots[slotId].level;
return currentLevel < MAX_GEAR_LEVEL
&& canAffordGearUpgrade(inventory, gearUpgradeCosts(ownerId, slotId, currentLevel));
}
export function spendGearCosts(inventory: readonly MaterialStack[], costs: readonly GearUpgradeCost[]): MaterialStack[] {
if (!canAffordGearUpgrade(inventory, costs)) {
const missing = costs.find((cost) => (inventory.find((item) => item.id === cost.itemId)?.quantity ?? 0) < cost.quantity);