en_passent -> en_passant

This commit is contained in:
jake 2023-02-19 11:10:41 -05:00
parent f381c51566
commit 1a5368956f

24
Main.gd
View file

@ -223,15 +223,15 @@ enum {
move_1_up_pawn, move_1_up_pawn,
attack_1_nw, attack_1_nw,
attack_1_ne, attack_1_ne,
en_passent_nw, en_passant_nw,
en_passent_ne, en_passant_ne,
move_2_down_pawn, move_2_down_pawn,
move_1_down_pawn, move_1_down_pawn,
attack_1_sw, attack_1_sw,
attack_1_se, attack_1_se,
en_passent_sw, en_passant_sw,
en_passent_se, en_passant_se,
move_1_up, move_1_up,
move_1_down, move_1_down,
@ -262,14 +262,14 @@ func get_move_pattern(piece, coords):
"pawn": "pawn":
if piece.get_team() == team1: if piece.get_team() == team1:
if coords[1] == 6: if coords[1] == 6:
return [attack_1_nw, move_2_up_pawn, attack_1_ne, en_passent_ne, en_passent_nw] return [attack_1_nw, move_2_up_pawn, attack_1_ne, en_passant_ne, en_passant_nw]
else: else:
return [attack_1_nw, move_1_up_pawn, attack_1_ne, en_passent_ne, en_passent_nw] return [attack_1_nw, move_1_up_pawn, attack_1_ne, en_passant_ne, en_passant_nw]
else: else:
if coords[1] == 1: if coords[1] == 1:
return [attack_1_sw, move_2_down_pawn, attack_1_se, en_passent_se, en_passent_sw] return [attack_1_sw, move_2_down_pawn, attack_1_se, en_passant_se, en_passant_sw]
else: else:
return [attack_1_sw, move_1_down_pawn, attack_1_se, en_passent_se, en_passent_sw] return [attack_1_sw, move_1_down_pawn, attack_1_se, en_passant_se, en_passant_sw]
"rook": "rook":
return [move_up_inf, move_left_inf, move_right_inf, move_down_inf] return [move_up_inf, move_left_inf, move_right_inf, move_down_inf]
"knight": "knight":
@ -307,11 +307,11 @@ func can_chess_move(pattern, coords, create_tiles=true):
can_move.append_array(make_tiles(coords, [-1,1], 1, false, curr_team, {"must_attack": true}, create_tiles)) can_move.append_array(make_tiles(coords, [-1,1], 1, false, curr_team, {"must_attack": true}, create_tiles))
attack_1_se: attack_1_se:
can_move.append_array(make_tiles(coords, [1,1], 1, false, curr_team, {"must_attack": true}, create_tiles)) can_move.append_array(make_tiles(coords, [1,1], 1, false, curr_team, {"must_attack": true}, create_tiles))
en_passent_sw: en_passant_sw:
var pawn_maybe = board[coords[0]-1][coords[1]] var pawn_maybe = board[coords[0]-1][coords[1]]
if pawn_maybe and pawn_maybe.get_piece() == "pawn" and pawn_maybe == en_passant_pawn and pawn_maybe.get_team() != curr_team: if pawn_maybe and pawn_maybe.get_piece() == "pawn" and pawn_maybe == en_passant_pawn and pawn_maybe.get_team() != curr_team:
can_move.append_array(make_tiles(coords, [-1,1], 1, true, curr_team, {"en_passant_pawn": pawn_maybe}, create_tiles)) can_move.append_array(make_tiles(coords, [-1,1], 1, true, curr_team, {"en_passant_pawn": pawn_maybe}, create_tiles))
en_passent_se: en_passant_se:
if ! coords[0] + 1 > BOARD_WIDTH: if ! coords[0] + 1 > BOARD_WIDTH:
var pawn_maybe = board[coords[0]+1][coords[1]] var pawn_maybe = board[coords[0]+1][coords[1]]
if pawn_maybe and pawn_maybe.get_piece() == "pawn" and pawn_maybe == en_passant_pawn and pawn_maybe.get_team() != curr_team: if pawn_maybe and pawn_maybe.get_piece() == "pawn" and pawn_maybe == en_passant_pawn and pawn_maybe.get_team() != curr_team:
@ -335,11 +335,11 @@ func can_chess_move(pattern, coords, create_tiles=true):
can_move.append_array(make_tiles(coords, [-1,-1], 1, false, curr_team, {"must_attack": true}, create_tiles)) can_move.append_array(make_tiles(coords, [-1,-1], 1, false, curr_team, {"must_attack": true}, create_tiles))
attack_1_ne: attack_1_ne:
can_move.append_array(make_tiles(coords, [1,-1], 1, false, curr_team, {"must_attack": true}, create_tiles)) can_move.append_array(make_tiles(coords, [1,-1], 1, false, curr_team, {"must_attack": true}, create_tiles))
en_passent_nw: en_passant_nw:
var pawn_maybe = board[coords[0]-1][coords[1]] var pawn_maybe = board[coords[0]-1][coords[1]]
if pawn_maybe and pawn_maybe.get_piece() == "pawn" and pawn_maybe == en_passant_pawn and pawn_maybe.get_team() != curr_team: if pawn_maybe and pawn_maybe.get_piece() == "pawn" and pawn_maybe == en_passant_pawn and pawn_maybe.get_team() != curr_team:
can_move.append_array(make_tiles(coords, [-1,-1], 1, true, curr_team, {"en_passant_pawn": pawn_maybe}, create_tiles)) can_move.append_array(make_tiles(coords, [-1,-1], 1, true, curr_team, {"en_passant_pawn": pawn_maybe}, create_tiles))
en_passent_ne: en_passant_ne:
if ! coords[0] + 1 > BOARD_WIDTH: if ! coords[0] + 1 > BOARD_WIDTH:
var pawn_maybe = board[coords[0]+1][coords[1]] var pawn_maybe = board[coords[0]+1][coords[1]]
if pawn_maybe and pawn_maybe.get_piece() == "pawn" and pawn_maybe == en_passant_pawn and pawn_maybe.get_team() != curr_team: if pawn_maybe and pawn_maybe.get_piece() == "pawn" and pawn_maybe == en_passant_pawn and pawn_maybe.get_team() != curr_team: