Fix skill study mana deduction in skillStore.ts
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m38s

- Added useManaStore import to skillStore.ts
- Added mana deduction logic in startStudyingSkill action
- Mana is now properly deducted when starting to study a skill (unless already paid)
This commit is contained in:
2026-05-08 11:01:01 +02:00
parent 58aa74486e
commit 0fadbfef4a
8 changed files with 22 additions and 187 deletions
+5
View File
@@ -7,6 +7,7 @@ import { SKILLS_DEF, getStudySpeedMultiplier, getStudyCostMultiplier } from '../
import type { StudyTarget, SkillUpgradeChoice } from '../types';
import { SKILL_EVOLUTION_PATHS, getBaseSkillId } from '../skill-evolution';
import { useCombatStore } from './combatStore';
import { useManaStore } from './manaStore';
export interface SkillState {
// Skills
@@ -134,6 +135,10 @@ export const useSkillStore = create<SkillState>()(
useCombatStore.getState().setAction('study');
if (!isAlreadyPaid && cost > 0) {
useManaStore.getState().spendRawMana(cost);
}
return { started: true, cost: isAlreadyPaid ? 0 : cost };
},