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.
|
// Check all tiles if not blocking.
|
||||||
if(block_directions == 0) {
|
if(block_directions == 0) {
|
||||||
for(let i = 0; i < GAME_DATA.board.tiles.length; ++i) {
|
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));
|
tiles.push(new GAME.MovementTile(i, true, false, 0, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -620,7 +620,7 @@ GAME.Game = class {
|
|||||||
|
|
||||||
if(target_id !== null) { break; }
|
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));
|
tiles.push(new GAME.MovementTile(tile_id, true, false, 0, 0));
|
||||||
}
|
}
|
||||||
} else { break; }
|
} else { break; }
|
||||||
@ -745,16 +745,20 @@ GAME.Game = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check off-sides.
|
// Check off-sides.
|
||||||
|
if(params.extent !== false) {
|
||||||
if(piece.player == 0) {
|
if(piece.player == 0) {
|
||||||
position_valid = position_valid && (hex.y <= this.board.columns[hex.x].extent[+(!piece.player)]);
|
position_valid = position_valid && (hex.y <= this.board.columns[hex.x].extent[+(!piece.player)]);
|
||||||
} else {
|
} else {
|
||||||
position_valid = position_valid && (hex.y >= this.board.columns[hex.x].extent[+(!piece.player)]);
|
position_valid = position_valid && (hex.y >= this.board.columns[hex.x].extent[+(!piece.player)]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check militia stacking.
|
// Check militia stacking.
|
||||||
|
if(params.stack !== false) {
|
||||||
if(piece.piece == GAME.Const.PieceId.Militia && this.board.columns[hex.x].militia[piece.player]) {
|
if(piece.piece == GAME.Const.PieceId.Militia && this.board.columns[hex.x].militia[piece.player]) {
|
||||||
position_valid = false;
|
position_valid = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if position puts king in check.
|
// Check if position puts king in check.
|
||||||
let checking = false;
|
let checking = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user