From c882bbd7fd4aa70f0e507efcbdf649bedeab8e87 Mon Sep 17 00:00:00 2001 From: yukirij Date: Thu, 3 Oct 2024 12:32:01 -0700 Subject: [PATCH] Remove extent requirement from alt moves. --- www/js/game.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/www/js/game.js b/www/js/game.js index 8b30524..95a2668 100644 --- a/www/js/game.js +++ b/www/js/game.js @@ -595,7 +595,7 @@ GAME.Game = class { // Check all tiles if not blocking. if(block_directions == 0) { for(let i = 0; i < GAME_DATA.board.tiles.length; ++i) { - if(this.placable_tile(piece, i, {check:false})) { + if(this.placable_tile(piece, i, {check:false, extent:false})) { tiles.push(new GAME.MovementTile(i, true, false, 0, 0)); } } @@ -620,7 +620,7 @@ GAME.Game = class { if(target_id !== null) { break; } - if(this.placable_tile(piece, tile_id, {check:false})) { + if(this.placable_tile(piece, tile_id, {check:false, extent:false})) { tiles.push(new GAME.MovementTile(tile_id, true, false, 0, 0)); } } else { break; } @@ -745,15 +745,19 @@ GAME.Game = class { } // Check off-sides. - if(piece.player == 0) { - position_valid = position_valid && (hex.y <= this.board.columns[hex.x].extent[+(!piece.player)]); - } else { - position_valid = position_valid && (hex.y >= this.board.columns[hex.x].extent[+(!piece.player)]); + if(params.extent !== false) { + if(piece.player == 0) { + position_valid = position_valid && (hex.y <= this.board.columns[hex.x].extent[+(!piece.player)]); + } else { + position_valid = position_valid && (hex.y >= this.board.columns[hex.x].extent[+(!piece.player)]); + } } // Check militia stacking. - if(piece.piece == GAME.Const.PieceId.Militia && this.board.columns[hex.x].militia[piece.player]) { - position_valid = false; + if(params.stack !== false) { + if(piece.piece == GAME.Const.PieceId.Militia && this.board.columns[hex.x].militia[piece.player]) { + position_valid = false; + } } // Check if position puts king in check.