feat: add per-element mana regen disciplines for all 14 mana types
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m26s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m26s
- Create data/disciplines/elemental-regen.ts (base + utility elements)
- Create data/disciplines/elemental-regen-advanced.ts (composite + exotic)
- Wire into ALL_DISCIPLINES via index.ts and discipline-slice.ts
- Add perElementRegenBonus to ComputedEffects type
- Merge regen_{element} discipline bonuses in computeAllEffects()
- Apply per-element regen to element mana each tick in gameStore
- Add 'Elemental Regen' and 'Advanced Regen' tabs to DisciplinesTab UI
This commit is contained in:
@@ -11,6 +11,8 @@ import {
|
||||
getUnlockedPerks,
|
||||
} from '../utils/discipline-math';
|
||||
import { baseDisciplines } from '../data/disciplines/base';
|
||||
import { elementalRegenDisciplines } from '../data/disciplines/elemental-regen';
|
||||
import { elementalRegenAdvancedDisciplines } from '../data/disciplines/elemental-regen-advanced';
|
||||
import { enchanterDisciplines } from '../data/disciplines/enchanter';
|
||||
import { enchanterUtilityDisciplines } from '../data/disciplines/enchanter-utility';
|
||||
import { enchanterSpellDisciplines } from '../data/disciplines/enchanter-spells';
|
||||
@@ -21,6 +23,8 @@ import { MAX_CONCURRENT_DISCIPLINES } from '../types/disciplines';
|
||||
|
||||
const ALL_DISCIPLINES = [
|
||||
...baseDisciplines,
|
||||
...elementalRegenDisciplines,
|
||||
...elementalRegenAdvancedDisciplines,
|
||||
...enchanterDisciplines,
|
||||
...enchanterUtilityDisciplines,
|
||||
...enchanterSpellDisciplines,
|
||||
|
||||
@@ -267,6 +267,22 @@ export const useGameStore = create<GameCoordinatorStore>()(
|
||||
rawMana = disciplineResult.rawMana;
|
||||
elements = disciplineResult.elements;
|
||||
|
||||
// Apply per-element regen from discipline effects (regen_{element})
|
||||
for (const [key, value] of Object.entries(disciplineEffects.bonuses)) {
|
||||
if (key.startsWith('regen_') && key !== 'regenBonus') {
|
||||
const element = key.replace('regen_', '');
|
||||
if (elements[element]) {
|
||||
elements[element] = {
|
||||
...elements[element],
|
||||
current: Math.min(
|
||||
elements[element].max,
|
||||
elements[element].current + value * HOURS_PER_TICK,
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Unlock enchantment effects from newly unlocked discipline perks
|
||||
if (disciplineResult.unlockedEffects.length > 0) {
|
||||
useCraftingStore.getState().unlockEffects(disciplineResult.unlockedEffects);
|
||||
|
||||
Reference in New Issue
Block a user