Skip to content

Commit daad3bb

Browse files
committed
chore: balancing defense
1 parent fc33998 commit daad3bb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/commands/battle.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ async function simulateBattleStep(
282282
attacker.speed += 1;
283283
defender.speed = Math.max(1, defender.speed - 1);
284284
damage = Math.floor(attacker.attack * 1.3);
285-
narration = `👻 **${attacker.name}** strikes directly at **${defender.name}**'s soul, stealing their energy! (+1 SPD, -1 SPD to enemy)`;
285+
narration = `👻 **${attacker.name}** strikes directly at **${defender.name}**'s soul, stealing their energy while breaking through defenses! (+1 SPD, -1 SPD to enemy)`;
286286
break;
287287
case "Phoenix Rising":
288288
if (attacker.hp < attacker.maxHp * 0.3) {
@@ -296,7 +296,7 @@ async function simulateBattleStep(
296296
break;
297297
case "Relic of Exo":
298298
damage = Math.floor(attacker.attack * 1.4);
299-
narration = `🏺 **${attacker.name}** unleashes the power of the Relic of Exo, bypassing all defenses!`;
299+
narration = `🏺 **${attacker.name}** unleashes the power of the Relic of Exo, partially bypassing defenses!`;
300300
break;
301301
case "Ego's Blessing":
302302
attacker.attack += 2;
@@ -363,7 +363,7 @@ async function simulateBattleStep(
363363

364364
const defenseRoll = Math.random();
365365
const canBlock =
366-
abilityUsed !== "Airstrike" && abilityUsed !== "Relic of Exo";
366+
abilityUsed !== "Airstrike" && abilityUsed !== "Great Will";
367367

368368
if (defenseRoll < 0.15) {
369369
damage = 0;
@@ -403,6 +403,15 @@ async function simulateBattleStep(
403403
}
404404

405405
if (damage > 0) {
406+
if (useAbility) {
407+
if (abilityUsed === "Relic of Exo" || abilityUsed === "Soul Strike") {
408+
const effectiveDefense = Math.floor(defender.defense * 0.7);
409+
damage = Math.max(1, damage - effectiveDefense);
410+
} else {
411+
damage = Math.max(1, damage - Math.floor(defender.defense / 2));
412+
}
413+
}
414+
406415
defender.hp = Math.max(0, defender.hp - damage);
407416
if (!narration.includes("HP")) {
408417
narration += ` **(${damage} dmg)**`;

0 commit comments

Comments
 (0)