feat: overhaul mana conversion system to unified regen-deduction model
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m2s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m2s
- New files: element-distance.ts, conversion-costs.ts, conversion-rates.ts - All conversion types (discipline, attunement, pact) use unified formula - Conversion costs scale exponentially by element tier (10^(d+1) raw, 10*(d+1) per component) - Costs deducted from regen, not from mana pool - Auto-pause on insufficient regen with UI warning - Meditation boosts conversion rates (reduced by distance) - Attunement levels provide +50% multiplicative bonus per level - Guardian pacts provide +0.15/hr base rate + invoker level bonus - Removed convertMana, processConvertAction, craftComposite from manaStore - Stats tab shows per-element conversion breakdown with formulas - ManaDisplay shows per-element net regen rates - All 916 tests pass, all files under 400 lines
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import type { AttunementState } from '../types';
|
||||
import type { ComputedEffects } from '../effects/upgrade-effects.types';
|
||||
import { HOURS_PER_TICK } from '../constants';
|
||||
import { getTotalAttunementRegen, getTotalAttunementConversionDrain } from '../data/attunements';
|
||||
import { getTotalAttunementRegen } from '../data/attunements';
|
||||
|
||||
export interface DisciplineBonuses {
|
||||
bonuses: Record<string, number>;
|
||||
@@ -84,10 +84,7 @@ export function computeEffectiveRegenForDisplay(
|
||||
discipline?: DisciplineBonuses,
|
||||
): { rawRegen: number; conversionDrain: number; effectiveRegen: number } {
|
||||
const rawRegen = computeRegen(state, effects, discipline);
|
||||
const conversionDrain = getTotalAttunementConversionDrain(state.attunements || {});
|
||||
const effectiveRegen = Math.max(0, rawRegen - conversionDrain);
|
||||
|
||||
return { rawRegen, conversionDrain, effectiveRegen };
|
||||
return { rawRegen, conversionDrain: 0, effectiveRegen: rawRegen };
|
||||
}
|
||||
|
||||
// ─── Effective Regen (dynamic) ────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user