Phase 4: Mana Flow effects
This commit is contained in:
+28
-3
@@ -720,6 +720,7 @@ function makeInitial(overrides: Partial<GameState> = {}): GameState {
|
||||
|
||||
log: ['✨ The loop begins. You start with a Basic Staff (Mana Bolt) and civilian clothes. Gather your strength, mage.'],
|
||||
loopInsight: 0,
|
||||
flowSurgeEndTime: 0, // Hour timestamp for FLOW_SURGE effect (0 = inactive)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -857,10 +858,24 @@ export const useGameStore = create<GameStore>()(
|
||||
}
|
||||
|
||||
// Calculate effective regen with incursion and meditation
|
||||
const effectiveRegen = baseRegen * (1 - incursionStrength) * meditationMultiplier;
|
||||
let effectiveRegen = baseRegen * (1 - incursionStrength) * meditationMultiplier;
|
||||
|
||||
// Mana regeneration
|
||||
let rawMana = Math.min(state.rawMana + effectiveRegen * HOURS_PER_TICK, maxMana);
|
||||
// FLOW_SURGE: +100% regen for 1 hour after clicking
|
||||
let flowSurgeEndTime = state.flowSurgeEndTime;
|
||||
if (flowSurgeEndTime > 0) {
|
||||
if (state.hour <= flowSurgeEndTime) {
|
||||
// FLOW_SURGE is active - double the regen
|
||||
effectiveRegen *= 2;
|
||||
} else {
|
||||
// FLOW_SURGE has expired
|
||||
flowSurgeEndTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Mana regeneration with MANA_OVERFLOW support
|
||||
const overflowMultiplier = hasSpecial(effects, SPECIAL_EFFECTS.MANA_OVERFLOW) ? 1.2 : 1.0;
|
||||
const maxManaWithOverflow = maxMana * overflowMultiplier;
|
||||
let rawMana = Math.min(state.rawMana + effectiveRegen * HOURS_PER_TICK, maxManaWithOverflow);
|
||||
let totalManaGathered = state.totalManaGathered;
|
||||
|
||||
// Attunement mana conversion - convert raw mana to attunement's primary mana type
|
||||
@@ -1405,6 +1420,7 @@ export const useGameStore = create<GameStore>()(
|
||||
log,
|
||||
castProgress,
|
||||
golemancy,
|
||||
flowSurgeEndTime,
|
||||
...craftingUpdates,
|
||||
});
|
||||
},
|
||||
@@ -1421,9 +1437,18 @@ export const useGameStore = create<GameStore>()(
|
||||
cm = Math.floor(cm * overflowBonus);
|
||||
|
||||
const max = computeMaxMana(state, effects);
|
||||
|
||||
// FLOW_SURGE: Clicks restore 2x regen for 1 hour
|
||||
let flowSurgeEndTime = state.flowSurgeEndTime;
|
||||
if (hasSpecial(effects, SPECIAL_EFFECTS.FLOW_SURGE) && flowSurgeEndTime === 0) {
|
||||
// Activate FLOW_SURGE for 1 hour
|
||||
flowSurgeEndTime = state.hour + 1;
|
||||
}
|
||||
|
||||
set({
|
||||
rawMana: Math.min(state.rawMana + cm, max),
|
||||
totalManaGathered: state.totalManaGathered + cm,
|
||||
flowSurgeEndTime,
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user