feat: guardian defensive stats — shield, barrier, health regen + stat label renames
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m21s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m21s
This commit is contained in:
@@ -10,6 +10,7 @@ import { generateFloorState } from '../utils/room-utils';
|
||||
import { generateSpireFloorState } from '../utils/spire-utils';
|
||||
import { addActivityLogEntry } from '../utils/activity-log';
|
||||
import { processCombatTick, makeInitialSpells } from './combat-actions';
|
||||
import { getGuardianForFloor } from '../data/guardian-encounters';
|
||||
import type { CombatStore } from './combat-state.types';
|
||||
|
||||
export const useCombatStore = create<CombatStore>()(
|
||||
@@ -46,6 +47,12 @@ export const useCombatStore = create<CombatStore>()(
|
||||
comboHitCount: 0,
|
||||
floorHitCount: 0,
|
||||
|
||||
// Guardian defensive state
|
||||
guardianShield: 0,
|
||||
guardianShieldMax: 0,
|
||||
guardianBarrier: 0,
|
||||
guardianBarrierMax: 0,
|
||||
|
||||
// Spells
|
||||
spells: {
|
||||
manaBolt: { learned: true, level: 1, studyProgress: 0 },
|
||||
@@ -253,6 +260,22 @@ export const useCombatStore = create<CombatStore>()(
|
||||
set((state) => ({ totalCraftsCompleted: state.totalCraftsCompleted + 1 }));
|
||||
},
|
||||
|
||||
resetGuardianDefensiveState: () => {
|
||||
set({ guardianShield: 0, guardianShieldMax: 0, guardianBarrier: 0, guardianBarrierMax: 0 });
|
||||
},
|
||||
|
||||
initGuardianDefensiveState: () => {
|
||||
const state = get();
|
||||
const guardian = getGuardianForFloor(state.currentFloor);
|
||||
if (!guardian) return;
|
||||
set({
|
||||
guardianShield: guardian.shield ?? 0,
|
||||
guardianShieldMax: guardian.shield ?? 0,
|
||||
guardianBarrier: guardian.barrier ?? 0,
|
||||
guardianBarrierMax: guardian.barrier ?? 0,
|
||||
});
|
||||
},
|
||||
|
||||
processCombatTick: (
|
||||
rawMana: number,
|
||||
elements: Record<string, { current: number; max: number; unlocked: boolean }>,
|
||||
@@ -316,6 +339,10 @@ export const useCombatStore = create<CombatStore>()(
|
||||
totalSpellsCast: state.totalSpellsCast,
|
||||
totalDamageDealt: state.totalDamageDealt,
|
||||
totalCraftsCompleted: state.totalCraftsCompleted,
|
||||
guardianShield: state.guardianShield,
|
||||
guardianShieldMax: state.guardianShieldMax,
|
||||
guardianBarrier: state.guardianBarrier,
|
||||
guardianBarrierMax: state.guardianBarrierMax,
|
||||
}),
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user