diff --git a/docs/circular-deps.txt b/docs/circular-deps.txt index f03482c..8f53dd8 100644 --- a/docs/circular-deps.txt +++ b/docs/circular-deps.txt @@ -1,5 +1,5 @@ # Circular Dependencies -Generated: 2026-06-08T10:43:31.572Z +Generated: 2026-06-08T10:56:12.135Z Found: 1 circular chain(s) — these MUST be fixed before modifying involved files. 1. 1) stores/golem-combat-actions.ts > stores/golem-combat-helpers.ts diff --git a/docs/dependency-graph.json b/docs/dependency-graph.json index f781906..5e1e4aa 100644 --- a/docs/dependency-graph.json +++ b/docs/dependency-graph.json @@ -1,6 +1,6 @@ { "_meta": { - "generated": "2026-06-08T10:43:29.519Z", + "generated": "2026-06-08T10:56:10.139Z", "description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.", "usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry." }, diff --git a/src/lib/game/stores/pipelines/equipment-crafting.ts b/src/lib/game/stores/pipelines/equipment-crafting.ts index 6a11e29..deb7adc 100644 --- a/src/lib/game/stores/pipelines/equipment-crafting.ts +++ b/src/lib/game/stores/pipelines/equipment-crafting.ts @@ -74,13 +74,13 @@ export function cancelEquipmentCrafting(get: GetFn, set: SetFn): void { const refunded = refundFabricatorMana(recipe, manaRefund, rawMana, elements); useManaStore.setState({ rawMana: refunded.rawMana, elements: refunded.elements }); - // Refund materials — use reduced amounts (what player actually paid) + // Refund materials — flat 50% per spec §6.3 const reduction = getCraftingCostReduction(); const currentMaterials = get().lootInventory.materials; const refundedMaterials = { ...currentMaterials }; for (const [matId, rawAmount] of Object.entries(recipe.materials)) { const reducedAmount = applyCostReduction(rawAmount, reduction); - const refundAmount = Math.floor(reducedAmount * remainingFraction); + const refundAmount = Math.floor(reducedAmount * 0.5); if (refundAmount > 0) { refundedMaterials[matId] = (refundedMaterials[matId] || 0) + refundAmount; } @@ -98,16 +98,13 @@ export function cancelEquipmentCrafting(get: GetFn, set: SetFn): void { progress.progress, progress.required, ); - // Refund materials proportionally to remaining progress + // Refund materials — flat 50% per spec §6.3 const recipe = CraftingEquipment.getRecipe(progress.blueprintId); if (recipe) { - const remainingFraction = progress.required > 0 - ? Math.max(0, (progress.required - progress.progress) / progress.required) - : 1; const currentMaterials = get().lootInventory.materials; const refundedMaterials = { ...currentMaterials }; for (const [matId, amount] of Object.entries(recipe.materials)) { - const refundAmount = Math.floor(amount * remainingFraction); + const refundAmount = Math.floor(amount * 0.5); if (refundAmount > 0) { refundedMaterials[matId] = (refundedMaterials[matId] || 0) + refundAmount; }