48 lines
1.6 KiB
GDScript
48 lines
1.6 KiB
GDScript
extends "res://Systems/StateMachine/ChessGameState.gd"
|
|
|
|
|
|
|
|
func enter(_previous: String, _data := {}) -> void:
|
|
print("ENTERING STATE ", Constants.HAND_SETUP)
|
|
|
|
if (game.currentPlayer == game.BLACK):
|
|
finished.emit(Constants.DRAW_PHASE)
|
|
return
|
|
# game.deckManager.updateCardDurations();
|
|
finished.emit(Constants.DRAW_PHASE)
|
|
# Go through all attached cards and update their durations
|
|
# var expired_cards = []
|
|
|
|
# for piece_id in game.deckManager.attached_cards:
|
|
# var card = game.deckManager.attached_cards[piece_id]
|
|
# card.remaining_turns -= 1
|
|
# print("Card DUration ", card.remaining_turns);
|
|
|
|
# # If card duration is expired, add to removal list
|
|
# if card.remaining_turns <= 0:
|
|
# expired_cards.append(piece_id)
|
|
|
|
# # Update the piece's visual appearance to show new duration
|
|
# var piece_node = instance_from_id(piece_id)
|
|
# if is_instance_valid(piece_node):
|
|
# piece_node.update_appearance()
|
|
|
|
# # Remove all expired cards
|
|
# for piece_id in expired_cards:
|
|
# var piece_node = instance_from_id(piece_id)
|
|
# if is_instance_valid(piece_node):
|
|
# piece_node.update_appearance() # Update appearance one final time
|
|
# game.deckManager.attached_cards.erase(piece_id)
|
|
|
|
# Move to draw phase
|
|
# finished.emit(Constants.DRAW_PHASE)
|
|
|
|
# func prepareHand() -> void:
|
|
# if deckManager.hand.size() < 5:
|
|
# deckManager.drawCard()
|
|
# pass
|
|
|
|
|
|
# func drawCards() -> void:
|
|
# while deckManager.hand.size() < 5:
|
|
# deckManager.drawCard()
|