SkillsTab Modifications (Bugs 9,11,12,13)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m12s

This commit is contained in:
Refactoring Agent
2026-04-27 13:26:02 +02:00
parent 749321d2cb
commit eeb1e3c784
20 changed files with 828 additions and 237 deletions
+31 -3
View File
@@ -1797,10 +1797,38 @@ export const useGameStore = create<GameStore>()(
}
}
// Check mana cost (with focused mind reduction)
// Check raw mana cost (with focused mind reduction)
const costMult = getStudyCostMultiplier(state.skills);
const cost = Math.floor(sk.base * (currentLevel + 1) * costMult);
if (state.rawMana < cost) return;
if (state.rawMana < cost) {
set({
log: [`❌ Not enough raw mana to study ${sk.name}.`, ...state.log.slice(0, 49)],
});
return;
}
// Check additional cost (e.g., element mana for Bug 9, 11)
if (sk.cost) {
if (sk.cost.type === 'element') {
const element = state.elements[sk.cost.element];
if (!element || element.current < sk.cost.amount) {
set({
log: [`❌ Need ${sk.cost.amount} ${sk.cost.element} mana to study ${sk.name}.`, ...state.log.slice(0, 49)],
});
return;
}
// Deduct element mana
set({
elements: {
...state.elements,
[sk.cost.element]: {
...state.elements[sk.cost.element],
current: state.elements[sk.cost.element].current - sk.cost.amount,
},
},
});
}
}
// Start studying
set({
@@ -2522,7 +2550,7 @@ export const useGameStore = create<GameStore>()(
const instance = state.equipmentInstances[instanceId];
if (!instance || instance.enchantments.length === 0) return;
const disenchantLevel = state.skills.disenchanting || 0;
const disenchantLevel = 0; // disenchanting skill removed (Bug 13)
const recoveryRate = 0.1 + disenchantLevel * 0.2; // 10% base + 20% per level
let totalRecovered = 0;