fix: remove discipline pool-drain model, add conversion stats UI per mana-conversion-spec
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m17s

DISC-2: Removed old pool-drain model from discipline-slice.ts processTick()
- Disciplines no longer drain rawMana or element pools
- canProceedDiscipline() no longer checks mana sufficiency
- Removed auto-pause on insufficient mana from processTick()
- Removed drain display and auto-paused message from DisciplineCard.tsx
- Removed auto-paused log from gameStore.ts tick()

DISC-4: Audited crafting pipeline — no composite crafting logic remains
- craftComposite already removed from manaStore.ts (comment only)
- No other composite crafting references found

DISC-5: Added collapsible formula reference to Conversion Stats section
- Shows unified formula, multipliers, cost formulas, and constraints

DISC-6: Added per-element net regen summary line
- Shows 'Net Fire Regen: +0.50/hr − 0.15/hr = +0.35/hr' per element

DISC-7: Created dedicated 'Conversion Stats' section in Stats tab
- Renamed from 'Conversion Breakdown' to dedicated section header

DISC-8: Added detailed per-element regen breakdown to ManaDisplay
- Each element card now expandable to show produced rate and downstream drains
- New ElementRegenBreakdown type and elementRegenBreakdown prop

Tests: Updated 4 test files to reflect new no-drain behavior
- All 1090 tests pass
This commit is contained in:
2026-06-09 11:18:41 +02:00
parent c89d8fd2d8
commit 3ad919a047
13 changed files with 230 additions and 93 deletions
+8 -11
View File
@@ -60,30 +60,27 @@ export function canActivateDiscipline(
}
/**
* Check if discipline can proceed (has sufficient mana for drain)
* Check if discipline can proceed.
* Under the new unified conversion model, disciplines do not drain mana from pools.
* This check now only verifies that prerequisites are structurally met.
*/
export function canProceedDiscipline(
discipline: DisciplineDefinition,
disciplineState: DisciplineState | undefined,
gameState?: { elements?: Record<string, any>; rawMana?: number }
): boolean {
// New disciplines can always be activated (prerequisites checked separately)
if (!disciplineState) return true;
// If no game state provided, allow activation (optimistic)
if (!gameState) return true;
const drain = calculateManaDrain(
discipline.drainBase,
disciplineState.xp,
discipline.difficultyFactor
);
if (discipline.manaType === 'raw') {
return (gameState.rawMana || 0) >= drain;
}
// For disciplines with source mana types, verify they exist in game state
// (actual unlock check happens in activate() separately)
if (discipline.manaType === 'raw') return true;
const element = gameState.elements?.[discipline.manaType];
return element && element.current >= drain;
return !!element;
}
// ─── Known mana type names for display ────────────────────────────────────────