Phase 4: Mana Well effects (1st 7)

This commit is contained in:
Refactoring Agent
2026-04-24 16:17:50 +02:00
parent 6e3b867e7d
commit 132a4e6a72
3 changed files with 46 additions and 7 deletions
+6 -1
View File
@@ -5,7 +5,7 @@ import type { StateCreator } from 'zustand';
import type { GameState, ElementState, SpellCost } from '../types';
import { ELEMENTS, MANA_PER_ELEMENT, BASE_UNLOCKED_ELEMENTS } from '../constants';
import { computeMaxMana, computeElementMax, computeClickMana, canAffordSpellCost, getMeditationBonus } from './computed';
import { computeEffects } from '../upgrade-effects';
import { computeEffects, hasSpecial, SPECIAL_EFFECTS } from '../upgrade-effects';
export interface ManaSlice {
// State
@@ -67,6 +67,11 @@ export const createManaSlice = (
const effects = computeEffects(state.skillUpgrades || {}, state.skillTiers || {});
const max = computeMaxMana(state, effects);
// Mana Conversion: Convert 5% of max mana to click bonus
if (hasSpecial(effects, SPECIAL_EFFECTS.MANA_CONVERSION)) {
cm += Math.floor(max * 0.05);
}
// Mana Echo: 10% chance to gain double mana from clicks
const hasManaEcho = effects.specials?.has('MANA_ECHO') ?? false;
if (hasManaEcho && Math.random() < 0.1) {