Update WSS host; rename Omen to Source.
This commit is contained in:
parent
bbeed407bb
commit
f5c0cb862b
@ -40,7 +40,7 @@ GAME.Board = class {
|
||||
{ piece:GAME.Const.PieceId.Dragon, hex:new MATH.Vec2(4, 2) },
|
||||
{ piece:GAME.Const.PieceId.Behemoth, hex:new MATH.Vec2(4, 1) },
|
||||
|
||||
{ piece:GAME.Const.PieceId.Omen, hex:new MATH.Vec2(4, 0) },
|
||||
{ piece:GAME.Const.PieceId.Source, hex:new MATH.Vec2(4, 0) },
|
||||
];
|
||||
|
||||
// Add Dawn pieces
|
||||
@ -471,7 +471,7 @@ GAME.Game = class {
|
||||
let check_direct = (this.state.check & 0x040) != 0;
|
||||
let check_count = this.state.check & 0x3F;
|
||||
if(piece.player == (this.turn & 1) && this.state.check != 0) {
|
||||
if(piece.piece != GAME.Const.PieceId.Omen) {
|
||||
if(piece.piece != GAME.Const.PieceId.Source) {
|
||||
if(tile_data.checking != 0) {
|
||||
if(target_id !== null) {
|
||||
if(check_count > 1) {
|
||||
@ -487,7 +487,7 @@ GAME.Game = class {
|
||||
}
|
||||
|
||||
// King may not move onto threatened tile.
|
||||
if(piece.piece == GAME.Const.PieceId.Omen && tile_data.threaten[+(!piece.player)] > 0) {
|
||||
if(piece.piece == GAME.Const.PieceId.Source && tile_data.threaten[+(!piece.player)] > 0) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
@ -512,7 +512,7 @@ GAME.Game = class {
|
||||
// Target piece is opposing.
|
||||
else {
|
||||
// Check if target piece is opposing king.
|
||||
if(target.piece == GAME.Const.PieceId.Omen) {
|
||||
if(target.piece == GAME.Const.PieceId.Source) {
|
||||
if(valid) {
|
||||
if(dist == 1) { check = GAME.Const.Check.Direct; }
|
||||
else { check = GAME.Const.Check.Stride; }
|
||||
@ -543,7 +543,7 @@ GAME.Game = class {
|
||||
|
||||
// Handle blocking restrictions.
|
||||
if(block_directions != 0) {
|
||||
if(piece.piece == GAME.Const.PieceId.Omen) {
|
||||
if(piece.piece == GAME.Const.PieceId.Source) {
|
||||
result = result && ((dir_mask & block_directions) == 0 || tile_occupied);
|
||||
} else {
|
||||
result = result && ((dir_mask & block_directions) != 0 || swap);
|
||||
@ -570,7 +570,7 @@ GAME.Game = class {
|
||||
|
||||
// King cannot swap onto tile that is threatened.
|
||||
// This case should also cover blocking.
|
||||
if(target.piece == GAME.Const.PieceId.Omen
|
||||
if(target.piece == GAME.Const.PieceId.Source
|
||||
&& (this.board.tiles[tile].threaten[+(!target.player)] > 0 || piece.blocking != 0)) {
|
||||
return false;
|
||||
}
|
||||
@ -781,7 +781,7 @@ GAME.Const = {
|
||||
Castle: 4,
|
||||
Dragon: 5,
|
||||
Behemoth: 6,
|
||||
Omen: 7,
|
||||
Source: 7,
|
||||
},
|
||||
|
||||
Count: {
|
||||
@ -929,7 +929,7 @@ GAME.Const = {
|
||||
.add(17)
|
||||
),
|
||||
new GAME.GamePiece(
|
||||
"Omen",
|
||||
"Source",
|
||||
new GAME.PieceMovement()
|
||||
.add(0)
|
||||
.add(1)
|
||||
|
@ -434,7 +434,7 @@ const INTERFACE = {
|
||||
}
|
||||
if(GAME_DATA.turn > 0 && play.source < 2 && (play.to == i || (play.source == 0 && play.from == i))) {
|
||||
ctx.fillStyle = INTERFACE.Color.HintPlay;
|
||||
} else if(GAME_DATA.state.check != 0 && piece !== null && piece.piece == GAME.Const.PieceId.Omen && piece.player == (GAME_DATA.turn & 1)) {
|
||||
} else if(GAME_DATA.state.check != 0 && piece !== null && piece.piece == GAME.Const.PieceId.Source && piece.player == (GAME_DATA.turn & 1)) {
|
||||
ctx.fillStyle = INTERFACE.Color.HintCheck;
|
||||
}
|
||||
switch(hover_state) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
function RECONNECT() {
|
||||
if(SOCKET === null) {
|
||||
console.log("Websocket connecting..");
|
||||
SOCKET = new WebSocket("wss://omen.kirisame.com:38612");
|
||||
SOCKET = new WebSocket("wss://" + location.host);
|
||||
SOCKET.binaryType = "arraybuffer";
|
||||
SOCKET.addEventListener("error", () => {
|
||||
SOCKET = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user