Fix skill study mana deduction in skillStore.ts
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m38s
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:
@@ -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 };
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user