From 5294cd1d5cad37ecff3ed6c269cdff43d0fb97ab Mon Sep 17 00:00:00 2001 From: teisuru <31881306+teisuru@users.noreply.github.com> Date: Tue, 2 Apr 2024 10:41:49 +0200 Subject: L12 ravine bugfix --- rules.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index eff10dd..483d877 100644 --- a/rules.js +++ b/rules.js @@ -8968,7 +8968,10 @@ states.reposition_center = { // === BATTLE: STRIKE === function filled(pos) { - return game.battle.array[pos] !== NOBODY + if (game.battle.array[pos] !== NOBODY && !ravine_check(game.battle.ravine, pos)) { + return true + } + return false } const battle_strike_positions = [ D1, D2, D3, A1, A2, A3 ] @@ -9058,6 +9061,12 @@ function has_strike(pos) { // === BATTLE: ENGAGEMENTS +function ravine_check(lord,pos) { + if (game.battle.array[pos] === lord) + return true + return false +} + function determine_engagements() { let center = [ A2, D2 ] let engagements = [ @@ -9669,6 +9678,7 @@ function goto_end_battle_round() { // === BATTLE: NEW ROUND === function end_battle_round() { + game.battle.ravine = NOBODY let attacker_loser = null set_active_attacker() if (has_no_unrouted_forces()) { -- cgit v1.2.3