fix: resolve 22 remaining issues - type exports, dead code, state mutations, orphaned components
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s

This commit is contained in:
2026-05-18 21:03:43 +02:00
parent a9918e83a6
commit c3a5f333da
31 changed files with 108 additions and 1519 deletions
-4
View File
@@ -51,8 +51,6 @@ export function processCombatTick(
const afterCost = deductSpellCost(spellDef.cost, rawMana, elements);
rawMana = afterCost.rawMana;
elements = afterCost.elements;
totalManaGathered += spellDef.cost.amount;
// Calculate base damage
const floorElement = getFloorElement(currentFloor);
const damage = calcDamage(
@@ -107,8 +105,6 @@ export function processCombatTick(
const eAfterCost = deductSpellCost(eSpellDef.cost, rawMana, elements);
rawMana = eAfterCost.rawMana;
elements = eAfterCost.elements;
totalManaGathered += eSpellDef.cost.amount;
// Calculate damage
const eFloorElement = getFloorElement(currentFloor);
const eDamage = calcDamage(
+1 -1
View File
@@ -274,7 +274,7 @@ export const useCombatStore = create<CombatState>()(
currentFloor: state.currentFloor,
maxFloorReached: state.maxFloorReached,
spells: state.spells,
activeSpell: state.activeAction,
activeSpell: state.activeSpell,
}),
}
)
+5 -4
View File
@@ -80,9 +80,10 @@ export const useDisciplineStore = create<DisciplineStore>()(
let rawMana = mana.rawMana;
const elements = { ...mana.elements };
let newXP = s.totalXP;
const newDisciplines = { ...s.disciplines };
for (const id of s.activeIds) {
const disc = s.disciplines[id];
const disc = newDisciplines[id];
if (!disc) continue;
if (disc.paused) continue;
@@ -94,7 +95,7 @@ export const useDisciplineStore = create<DisciplineStore>()(
const available = def.manaType === 'raw' ? rawMana : element?.current;
if (!available || available < drain) {
disc.paused = true;
newDisciplines[id] = { ...disc, paused: true };
continue;
}
@@ -104,7 +105,7 @@ export const useDisciplineStore = create<DisciplineStore>()(
elements[def.manaType].current -= drain;
}
disc.xp += 1;
newDisciplines[id] = { ...disc, xp: disc.xp + 1 };
newXP += 1;
}
@@ -114,7 +115,7 @@ export const useDisciplineStore = create<DisciplineStore>()(
);
set({
disciplines: s.disciplines,
disciplines: newDisciplines,
totalXP: newXP,
concurrentLimit: Math.max(s.concurrentLimit, newLimit),
});
+1 -1
View File
@@ -18,7 +18,7 @@ export const createResetGame = (set: (state: any) => void, initialState: any) =>
const startFloor = 1;
useUIStore.getState().resetUI();
useUIStore.getState().reset();
usePrestigeStore.getState().resetPrestige();
useManaStore.getState().resetMana({}, {}, {}, {});
useCombatStore.getState().resetCombat(startFloor);
-1
View File
@@ -206,7 +206,6 @@ export const useGameStore = create<GameCoordinatorStore>()(
// Combat - delegate to combatStore
if (combatState.currentAction === 'climb') {
const combatResult = useCombatStore.getState().processCombatTick(
{},
rawMana,
elements,
maxMana,
+7 -17
View File
@@ -13,7 +13,7 @@ export interface UIState {
paused: boolean;
gameOver: boolean;
victory: boolean;
// Actions
addLog: (message: string) => void;
clearLogs: () => void;
@@ -21,7 +21,6 @@ export interface UIState {
setPaused: (paused: boolean) => void;
setGameOver: (gameOver: boolean, victory?: boolean) => void;
reset: () => void;
resetUI: () => void;
}
const MAX_LOGS = 50;
@@ -31,29 +30,29 @@ export const useUIStore = create<UIState>((set) => ({
paused: false,
gameOver: false,
victory: false,
addLog: (message: string) => {
set((state) => ({
logs: [message, ...state.logs.slice(0, MAX_LOGS - 1)],
}));
},
clearLogs: () => {
set({ logs: [] });
},
togglePause: () => {
set((state) => ({ paused: !state.paused }));
},
setPaused: (paused: boolean) => {
set({ paused });
},
setGameOver: (gameOver: boolean, victory: boolean = false) => {
set({ gameOver, victory });
},
reset: () => {
set({
logs: ['✨ The loop begins. You start with Mana Bolt. Gather your strength, mage.'],
@@ -62,13 +61,4 @@ export const useUIStore = create<UIState>((set) => ({
victory: false,
});
},
resetUI: () => {
set({
logs: ['✨ The loop begins. You start with Mana Bolt. Gather your strength, mage.'],
paused: false,
gameOver: false,
victory: false,
});
},
}));