Phase 4: Mana Well effects (1st 7)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user