SkillsTab Modifications (Bugs 9,11,12,13)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m12s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m12s
This commit is contained in:
+31
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user