refactor: remove skill system leftovers, migrate click mana to discipline perk
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m30s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m30s
- Simplified getMeditationBonus() to continuous ramp formula - Added click-mana capped perk to Mana Circulation discipline - Removed manaWell/manaFlow/manaSpring skill reads and prestige upgrades - Removed all skill fields from GameState and GameActionType - Updated all call sites and tests (916 tests passing) Closes #174
This commit is contained in:
@@ -96,7 +96,7 @@ export function processCombatTick(
|
||||
// Calculate base damage
|
||||
const floorElement = getFloorElement(currentFloor);
|
||||
const damage = calcDamage(
|
||||
{ skills: {}, signedPacts },
|
||||
{ signedPacts },
|
||||
spellId,
|
||||
floorElement,
|
||||
disciplineEffects,
|
||||
@@ -151,7 +151,7 @@ export function processCombatTick(
|
||||
// Calculate damage
|
||||
const eFloorElement = getFloorElement(currentFloor);
|
||||
const eDamage = calcDamage(
|
||||
{ skills: {}, signedPacts },
|
||||
{ signedPacts },
|
||||
eSpell.spellId,
|
||||
eFloorElement,
|
||||
disciplineEffects,
|
||||
|
||||
@@ -30,7 +30,7 @@ export const createResetGame = (set: (state: Partial<GameCoordinatorState>) => v
|
||||
|
||||
useUIStore.getState().reset();
|
||||
usePrestigeStore.getState().resetPrestige();
|
||||
useManaStore.getState().resetMana({}, {}, {}, {});
|
||||
useManaStore.getState().resetMana({});
|
||||
useCombatStore.getState().resetCombat(startFloor);
|
||||
|
||||
set({
|
||||
@@ -43,19 +43,11 @@ export const createGatherMana = () => () => {
|
||||
const prestigeState = usePrestigeStore.getState();
|
||||
const disciplineEffects = computeDisciplineEffects();
|
||||
|
||||
// Compute click mana with discipline bonuses (mana-channeling → clickManaMultiplier)
|
||||
const cm = computeClickMana(
|
||||
{},
|
||||
disciplineEffects,
|
||||
);
|
||||
// Compute click mana with discipline bonuses
|
||||
const cm = computeClickMana(disciplineEffects);
|
||||
|
||||
const max = computeMaxMana(
|
||||
{
|
||||
skills: {},
|
||||
prestigeUpgrades: prestigeState.prestigeUpgrades,
|
||||
skillUpgrades: {},
|
||||
skillTiers: {}
|
||||
},
|
||||
{ prestigeUpgrades: prestigeState.prestigeUpgrades },
|
||||
undefined,
|
||||
disciplineEffects,
|
||||
);
|
||||
|
||||
@@ -33,8 +33,6 @@ export function useUnifiedEffects() {
|
||||
|
||||
return {
|
||||
...getUnifiedEffects({
|
||||
skillUpgrades: {},
|
||||
skillTiers: {},
|
||||
equippedInstances,
|
||||
equipmentInstances,
|
||||
}),
|
||||
@@ -55,27 +53,25 @@ export function useManaStats() {
|
||||
const disciplineEffects = computeDisciplineEffects();
|
||||
|
||||
const upgradeEffects = getUnifiedEffects({
|
||||
skillUpgrades: {},
|
||||
skillTiers: {},
|
||||
equippedInstances,
|
||||
equipmentInstances,
|
||||
});
|
||||
|
||||
const maxMana = computeMaxMana(
|
||||
{ skills: {}, prestigeUpgrades, skillUpgrades: {}, skillTiers: {} },
|
||||
{ prestigeUpgrades },
|
||||
upgradeEffects,
|
||||
disciplineEffects,
|
||||
);
|
||||
|
||||
const baseRegen = computeRegen(
|
||||
{ skills: {}, prestigeUpgrades, skillUpgrades: {}, skillTiers: {}, attunements: {} },
|
||||
{ prestigeUpgrades, attunements: {} },
|
||||
upgradeEffects,
|
||||
disciplineEffects,
|
||||
);
|
||||
|
||||
const clickMana = computeClickMana({}, disciplineEffects);
|
||||
const clickMana = computeClickMana(disciplineEffects);
|
||||
|
||||
const meditationMultiplier = getMeditationBonus(meditateTicks, {}, upgradeEffects.meditationEfficiency, disciplineEffects.meditationCapBonus);
|
||||
const meditationMultiplier = getMeditationBonus(meditateTicks, upgradeEffects.meditationEfficiency, disciplineEffects.meditationCapBonus);
|
||||
const incursionStrength = getIncursionStrength(day, hour);
|
||||
const effectiveRegenWithSpecials = baseRegen * (1 - incursionStrength);
|
||||
|
||||
@@ -113,8 +109,6 @@ export function useCombatStats() {
|
||||
const equipmentInstances = useCraftingStore((s) => s.equipmentInstances);
|
||||
|
||||
const upgradeEffects = getUnifiedEffects({
|
||||
skillUpgrades: {},
|
||||
skillTiers: {},
|
||||
equippedInstances,
|
||||
equipmentInstances,
|
||||
});
|
||||
|
||||
@@ -19,7 +19,6 @@ export const createStartNewLoop = (set: (state: Partial<GameCoordinatorState>) =
|
||||
totalManaGathered: manaState.totalManaGathered,
|
||||
signedPacts: prestigeState.signedPacts,
|
||||
prestigeUpgrades: prestigeState.prestigeUpgrades,
|
||||
skills: {},
|
||||
}, disciplineEffects);
|
||||
|
||||
const total = prestigeState.insight + insightGained;
|
||||
@@ -41,7 +40,7 @@ export const createStartNewLoop = (set: (state: Partial<GameCoordinatorState>) =
|
||||
);
|
||||
usePrestigeStore.getState().incrementLoopCount();
|
||||
|
||||
useManaStore.getState().resetMana(pu, {}, {}, {});
|
||||
useManaStore.getState().resetMana(pu);
|
||||
|
||||
// Reset combat with starting floor and any spells from prestige upgrades
|
||||
const startSpells = makeInitialSpells();
|
||||
|
||||
@@ -105,12 +105,12 @@ export const useGameStore = create<GameCoordinatorStore>()(
|
||||
const effects = { specials: allSpecials } as ComputedEffects;
|
||||
|
||||
const maxMana = computeMaxMana(
|
||||
{ skills: {}, prestigeUpgrades: ctx.prestige.prestigeUpgrades, skillUpgrades: {}, skillTiers: {} },
|
||||
{ prestigeUpgrades: ctx.prestige.prestigeUpgrades },
|
||||
undefined,
|
||||
disciplineEffects,
|
||||
);
|
||||
const baseRegen = computeRegen(
|
||||
{ skills: {}, prestigeUpgrades: ctx.prestige.prestigeUpgrades, skillUpgrades: {}, skillTiers: {}, attunements: {} },
|
||||
{ prestigeUpgrades: ctx.prestige.prestigeUpgrades, attunements: {} },
|
||||
undefined,
|
||||
disciplineEffects,
|
||||
) * (1 + (disciplineEffects.multipliers.regenMultiplier || 0));
|
||||
@@ -129,7 +129,6 @@ export const useGameStore = create<GameCoordinatorStore>()(
|
||||
totalManaGathered: ctx.mana.totalManaGathered,
|
||||
signedPacts: ctx.prestige.signedPacts,
|
||||
prestigeUpgrades: ctx.prestige.prestigeUpgrades,
|
||||
skills: {} as Record<string, number>,
|
||||
};
|
||||
|
||||
// Check for loop end
|
||||
@@ -163,7 +162,7 @@ export const useGameStore = create<GameCoordinatorStore>()(
|
||||
|
||||
if (ctx.combat.currentAction === 'meditate') {
|
||||
meditateTicks++;
|
||||
meditationMultiplier = getMeditationBonus(meditateTicks, {}, 1, disciplineEffects.meditationCapBonus);
|
||||
meditationMultiplier = getMeditationBonus(meditateTicks, 1, disciplineEffects.meditationCapBonus);
|
||||
} else {
|
||||
meditateTicks = 0;
|
||||
}
|
||||
|
||||
@@ -45,9 +45,6 @@ export interface ManaActions {
|
||||
// Reset
|
||||
resetMana: (
|
||||
prestigeUpgrades: Record<string, number>,
|
||||
skills?: Record<string, number>,
|
||||
skillUpgrades?: Record<string, string[]>,
|
||||
skillTiers?: Record<string, number>
|
||||
) => void;
|
||||
}
|
||||
|
||||
@@ -193,9 +190,6 @@ export const useManaStore = create<ManaStore>()(
|
||||
|
||||
resetMana: (
|
||||
prestigeUpgrades: Record<string, number>,
|
||||
_skills: Record<string, number> = {},
|
||||
_skillUpgrades: Record<string, string[]> = {},
|
||||
_skillTiers: Record<string, number> = {}
|
||||
) => {
|
||||
const elementMax = 10 + (prestigeUpgrades.elemMax || 0) * 5;
|
||||
const startingMana = 10 + (prestigeUpgrades.manaStart || 0) * 10;
|
||||
|
||||
Reference in New Issue
Block a user