feat: Implement core game managers for power-ups, UI, goals, and player actions, and establish initial game scene and player.
This commit is contained in:
@@ -21,22 +21,17 @@ func consume_action_points(points: int):
|
||||
var main = player.get_tree().get_root().get_node_or_null("Main")
|
||||
if not main:
|
||||
return
|
||||
|
||||
# Don't consume points for bots in non-turn-based mode
|
||||
if player.is_bot == true and not TurnManager.turn_based_mode:
|
||||
|
||||
# Non-turn-based mode: unlimited action points for real-time fast-paced gameplay
|
||||
if not TurnManager.turn_based_mode:
|
||||
after_action_completed()
|
||||
return
|
||||
|
||||
# Turn-based mode: consume action points normally
|
||||
player.action_points -= points
|
||||
|
||||
if player.action_points <= 0:
|
||||
if TurnManager.turn_based_mode:
|
||||
main.request_next_turn()
|
||||
else:
|
||||
player.action_points = 2
|
||||
player.has_performed_action = false
|
||||
player.has_moved_this_turn = false
|
||||
player.rpc("display_message", "Action Points Reset!")
|
||||
main.request_next_turn()
|
||||
|
||||
after_action_completed()
|
||||
|
||||
@@ -55,12 +50,6 @@ func after_action_completed():
|
||||
if multiplayer.get_unique_id() == player.get_multiplayer_authority():
|
||||
var main = player.get_tree().get_root().get_node_or_null("Main")
|
||||
if main:
|
||||
# Add this condition for bots
|
||||
if not TurnManager.turn_based_mode and (player.action_points <= 0 or player.is_bot):
|
||||
player.action_points = 20 # For bots in non-turn-based mode, this will keep refreshing
|
||||
player.has_performed_action = false
|
||||
player.has_moved_this_turn = false
|
||||
|
||||
main.ui_manager.update_button_states()
|
||||
main.ui_manager.update_playerboard_ui()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user