Browse Source

fix when block is reset

main
Stephanie Gredell 4 months ago
parent
commit
49fae0ffe7
  1. 4
      src/engine/battle.js
  2. 1
      src/engine/core.js

4
src/engine/battle.js

@ -191,6 +191,10 @@ export function enemyTurn(ctx) {
ctx.log(`Enemy AI malfunction! ${e.name} does nothing this turn.`); ctx.log(`Enemy AI malfunction! ${e.name} does nothing this turn.`);
e.intent = { type: "block", value: 0 }; // Safe fallback e.intent = { type: "block", value: 0 }; // Safe fallback
} }
// Reset block at the end of enemy turn (after damage has been applied)
ctx.player.block = 0;
startPlayerTurn(ctx); startPlayerTurn(ctx);
} }

1
src/engine/core.js

@ -42,7 +42,6 @@ export function draw(player, n = 5, battleCtx = null) {
export function endTurnDiscard(player) { export function endTurnDiscard(player) {
player.discard.push(...player.hand.map(c => c.id)); player.discard.push(...player.hand.map(c => c.id));
player.hand = []; player.hand = [];
player.block = 0;
player.energy = player.maxEnergy; player.energy = player.maxEnergy;
} }

Loading…
Cancel
Save