Remove extent requirement from alt moves.
This commit is contained in:
parent
7092bbf70c
commit
c882bbd7fd
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user