Phase 4: Combat special effects
This commit is contained in:
@@ -84,6 +84,8 @@ export const createCombatSlice = (
|
||||
let pendingPactOffer = state.pendingPactOffer;
|
||||
const log = [...state.log];
|
||||
const skills = state.skills;
|
||||
let comboHitCount = state.comboHitCount || 0;
|
||||
let floorHitCount = state.floorHitCount || 0;
|
||||
|
||||
const floorElement = getFloorElement(currentFloor);
|
||||
|
||||
@@ -98,15 +100,33 @@ export const createCombatSlice = (
|
||||
let dmg = calcDamage(state, spellId, floorElement);
|
||||
dmg = dmg * effects.baseDamageMultiplier + effects.baseDamageBonus;
|
||||
|
||||
// Increment hit counters
|
||||
comboHitCount += 1;
|
||||
floorHitCount += 1;
|
||||
|
||||
// First Strike: +15% damage on first attack each floor
|
||||
if (hasSpecial(effects, SPECIAL_EFFECTS.FIRST_STRIKE) && floorHitCount === 1) {
|
||||
dmg *= 1.15;
|
||||
log.unshift('⚡ First Strike! +15% damage!');
|
||||
}
|
||||
|
||||
// Combo Master: Every 5th attack deals 3x damage
|
||||
if (hasSpecial(effects, SPECIAL_EFFECTS.COMBO_MASTER) && comboHitCount % 5 === 0) {
|
||||
dmg *= 3;
|
||||
log.unshift('🌀 Combo Master! Triple damage!');
|
||||
}
|
||||
|
||||
// Executioner: +100% damage to enemies below 25% HP
|
||||
if (hasSpecial(effects, SPECIAL_EFFECTS.EXECUTIONER) && floorHP / floorMaxHP < 0.25) {
|
||||
dmg *= 2;
|
||||
log.unshift('💀 Executioner! Double damage!');
|
||||
}
|
||||
|
||||
// Berserker: +50% damage when below 50% mana
|
||||
const maxMana = 100; // Would need proper max mana calculation
|
||||
if (hasSpecial(effects, SPECIAL_EFFECTS.BERSERKER) && rawMana < maxMana * 0.5) {
|
||||
dmg *= 1.5;
|
||||
log.unshift('🔥 Berserker! +50% damage!');
|
||||
}
|
||||
|
||||
// Spell echo - chance to cast again
|
||||
@@ -122,6 +142,14 @@ export const createCombatSlice = (
|
||||
|
||||
if (floorHP <= 0) {
|
||||
const wasGuardian = GUARDIANS[currentFloor];
|
||||
|
||||
// Adrenaline Rush: Defeating enemy restores 5% mana
|
||||
if (hasSpecial(effects, SPECIAL_EFFECTS.ADRENALINE_RUSH)) {
|
||||
const manaRestore = Math.floor(maxMana * 0.05);
|
||||
rawMana = Math.min(rawMana + manaRestore, maxMana);
|
||||
log.unshift(`💚 Adrenaline Rush! Restored ${manaRestore} mana!`);
|
||||
}
|
||||
|
||||
if (wasGuardian && !signedPacts.includes(currentFloor)) {
|
||||
pendingPactOffer = currentFloor;
|
||||
log.unshift(`⚔️ ${wasGuardian.name} defeated! They offer a pact...`);
|
||||
@@ -137,6 +165,7 @@ export const createCombatSlice = (
|
||||
floorHP = floorMaxHP;
|
||||
maxFloorReached = Math.max(maxFloorReached, currentFloor);
|
||||
castProgress = 0;
|
||||
floorHitCount = 0; // Reset floor hit counter for new floor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,6 +181,8 @@ export const createCombatSlice = (
|
||||
pendingPactOffer,
|
||||
castProgress,
|
||||
log,
|
||||
comboHitCount,
|
||||
floorHitCount,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user