apply tile effec ton capture

This commit is contained in:
2ManyProjects 2025-02-08 14:01:47 -06:00
parent d3eeca5489
commit da29b64e49
2 changed files with 9 additions and 4 deletions

View file

@ -157,7 +157,7 @@ func clearSelection() :
func updatePointsAndCapture(capturedPiece: Pawn) -> void:
func updatePointsAndCapture(capturedPiece: Pawn, animate: bool = true) -> void:
if Turn == 0:
p1Points += capturedPiece.Points
p1String.text = str(p1Points)
@ -165,6 +165,7 @@ func updatePointsAndCapture(capturedPiece: Pawn) -> void:
p2Points += capturedPiece.Points
p2String.text = str(p2Points)
if animate:
animatePieceCapture(capturedPiece)

View file

@ -221,8 +221,12 @@ func handleCapture(node: PieceContainer) -> void:
var captured_piece = node.get_piece()
if moving_piece && captured_piece:
game.updatePointsAndCapture(captured_piece)
await game.animatePieceCapture(captured_piece)
game.updatePointsAndCapture(captured_piece, false)
node.animate_movement(source_container, moving_piece);
var tile = game.tileManager.get_tile(node.name)
if tile:
tile.apply_effect(moving_piece)
game.currentlyMovingPiece = moving_piece