refactor: Replace natural-regen disciplines with mana conversion speed disciplines
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m25s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m25s
- Add conversionRate + sourceManaTypes fields to DisciplineDefinition
- Rewrite elemental-regen.ts: 8 base disciplines now convert raw→element
- Rewrite elemental-regen-advanced.ts: 6 composite/exotic disciplines with proper source recipes
- Update discipline-effects.ts: produce conversion entries instead of regen bonuses
- Update gameStore.ts tick: drain source mana types, add to target element
- Update discipline-slice.ts: gate activation on source mana type access
- Update discipline-math.ts: resolve mana type IDs to 'X mana' display names
- Update DisciplinesTab.tsx: show conversion info, source requirements, and lock state
- Update DisciplineDebugSection.tsx: pass elements to activate()
- Update effects.ts: remove regen_{element} merge (no longer produced)
This commit is contained in:
@@ -89,9 +89,23 @@ export const useDisciplineStore = create<DisciplineStore>()(
|
||||
}).length;
|
||||
if (nonPaused >= s.concurrentLimit) return s;
|
||||
if (!canProceedDiscipline(def, existing, gameState)) return s;
|
||||
|
||||
// Check discipline prerequisites (requires field → discipline XP)
|
||||
const prereqCheck = checkDisciplinePrerequisites(def, s.disciplines, ALL_DISCIPLINES);
|
||||
if (!prereqCheck.canProceed) return s;
|
||||
|
||||
// For conversion disciplines: gate on having all source mana types unlocked
|
||||
if (def.sourceManaTypes && def.sourceManaTypes.length > 0) {
|
||||
const elements = gameState?.elements;
|
||||
if (elements) {
|
||||
for (const srcType of def.sourceManaTypes) {
|
||||
if (srcType === 'raw') continue; // raw is always available
|
||||
const srcElem = elements[srcType];
|
||||
if (!srcElem || !srcElem.unlocked) return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const discState = existing || { id, xp: 0, paused: false };
|
||||
// Set currentAction to 'practicing' (only overrides 'meditate')
|
||||
useCombatStore.getState().startPracticing();
|
||||
|
||||
Reference in New Issue
Block a user