Swap lance and knight ids.

This commit is contained in:
yukirij 2024-08-16 17:34:31 -07:00
parent 3d0b53349d
commit 62e553a2e8
4 changed files with 30 additions and 30 deletions

View File

@ -4,8 +4,8 @@ pub const PLAYER_DUSK :u8 = 1;
pub const PIECES_COUNT :usize = 7; pub const PIECES_COUNT :usize = 7;
pub const PIECE_NONE :u8 = PIECES_COUNT as u8 + 1; pub const PIECE_NONE :u8 = PIECES_COUNT as u8 + 1;
pub const PIECE_MILITIA :u8 = 0; pub const PIECE_MILITIA :u8 = 0;
pub const PIECE_KNIGHT :u8 = 1; pub const PIECE_LANCE :u8 = 1;
pub const PIECE_LANCE :u8 = 2; pub const PIECE_KNIGHT :u8 = 2;
pub const PIECE_TOWER :u8 = 3; pub const PIECE_TOWER :u8 = 3;
pub const PIECE_CASTLE :u8 = 4; pub const PIECE_CASTLE :u8 = 4;
pub const PIECE_DRAGON :u8 = 5; pub const PIECE_DRAGON :u8 = 5;

View File

@ -37,17 +37,6 @@ pub const PIECES :[PieceClass; PIECES_COUNT] = [
stride:0, stride:0,
}, },
}, },
PieceClass {
name: "Knight",
moves: MoveSet {
direction:bit(3) | bit(6) | bit(11) | bit(13) | bit(17),
stride:0,
},
pmoves: MoveSet{
direction:bit(3) | bit(6) | bit(7) | bit(10) | bit(11) | bit(13) | bit(14) | bit(16) | bit(17),
stride:0,
},
},
PieceClass { PieceClass {
name: "Lance", name: "Lance",
moves: MoveSet { moves: MoveSet {
@ -59,6 +48,17 @@ pub const PIECES :[PieceClass; PIECES_COUNT] = [
stride:0, stride:0,
}, },
}, },
PieceClass {
name: "Knight",
moves: MoveSet {
direction:bit(3) | bit(6) | bit(11) | bit(13) | bit(17),
stride:0,
},
pmoves: MoveSet{
direction:bit(3) | bit(6) | bit(7) | bit(10) | bit(11) | bit(13) | bit(14) | bit(16) | bit(17),
stride:0,
},
},
PieceClass { PieceClass {
name: "Tower", name: "Tower",
moves: MoveSet { moves: MoveSet {

View File

@ -560,8 +560,8 @@ GAME.Const = {
PieceId: { PieceId: {
Militia: 0, Militia: 0,
Knight: 1, Lance: 1,
Lance: 2, Knight: 2,
Tower: 3, Tower: 3,
Castle: 4, Castle: 4,
Dragon: 5, Dragon: 5,
@ -583,6 +583,20 @@ GAME.Const = {
.add(4) .add(4)
.add(5), .add(5),
), ),
new GAME.GamePiece(
"Lance",
new GAME.PieceMovement()
.add_stride(0)
.add(1)
.add(5),
new GAME.PieceMovement()
.add(0)
.add(1)
.add(2)
.add(3)
.add(4)
.add(5),
),
new GAME.GamePiece( new GAME.GamePiece(
"Knight", "Knight",
new GAME.PieceMovement() new GAME.PieceMovement()
@ -615,20 +629,6 @@ GAME.Const = {
.add(22) .add(22)
.add(23), .add(23),
), ),
new GAME.GamePiece(
"Lance",
new GAME.PieceMovement()
.add_stride(0)
.add(1)
.add(5),
new GAME.PieceMovement()
.add(0)
.add(1)
.add(2)
.add(3)
.add(4)
.add(5),
),
new GAME.GamePiece( new GAME.GamePiece(
"Tower", "Tower",
new GAME.PieceMovement() new GAME.PieceMovement()

View File

@ -10,8 +10,8 @@ GAME_ASSET.Image = {
Promote: GAME_ASSET.load_image("asset/promote.svg"), Promote: GAME_ASSET.load_image("asset/promote.svg"),
Piece: [ Piece: [
[ GAME_ASSET.load_image("asset/militia_dawn.svg"), GAME_ASSET.load_image("asset/militia_dusk.svg") ], [ GAME_ASSET.load_image("asset/militia_dawn.svg"), GAME_ASSET.load_image("asset/militia_dusk.svg") ],
[ GAME_ASSET.load_image("asset/knight_dawn.svg"), GAME_ASSET.load_image("asset/knight_dusk.svg") ],
[ GAME_ASSET.load_image("asset/lance_dawn.svg"), GAME_ASSET.load_image("asset/lance_dusk.svg") ], [ GAME_ASSET.load_image("asset/lance_dawn.svg"), GAME_ASSET.load_image("asset/lance_dusk.svg") ],
[ GAME_ASSET.load_image("asset/knight_dawn.svg"), GAME_ASSET.load_image("asset/knight_dusk.svg") ],
[ GAME_ASSET.load_image("asset/tower_dawn.svg"), GAME_ASSET.load_image("asset/tower_dusk.svg") ], [ GAME_ASSET.load_image("asset/tower_dawn.svg"), GAME_ASSET.load_image("asset/tower_dusk.svg") ],
[ GAME_ASSET.load_image("asset/castle_dawn.svg"), GAME_ASSET.load_image("asset/castle_dusk.svg") ], [ GAME_ASSET.load_image("asset/castle_dawn.svg"), GAME_ASSET.load_image("asset/castle_dusk.svg") ],
[ GAME_ASSET.load_image("asset/dragon_dawn.svg"), GAME_ASSET.load_image("asset/dragon_dusk.svg") ], [ GAME_ASSET.load_image("asset/dragon_dawn.svg"), GAME_ASSET.load_image("asset/dragon_dusk.svg") ],