Integrate Nakama managers and enhance powerup system
Added Nakama and related manager scripts to autoload in project.godot and updated input mappings. Improved powerup_manager.gd with new methods and aliases for compatibility and gameplay rewards. Refactored ui_manager.gd to better initialize UI elements and removed unused code. Added playerboard_is_empty to player.gd for board state checks. Minor formatting changes in Nakama C# utility files for consistency.
This commit is contained in:
@@ -13,6 +13,16 @@ var goal_manager: Node
|
||||
# Boost State
|
||||
var current_boost: float = 0.0
|
||||
|
||||
# Alias for compatibility with BotStrategicPlanner
|
||||
var current_points: float:
|
||||
get:
|
||||
return current_boost
|
||||
set(value):
|
||||
current_boost = value
|
||||
|
||||
# Also alias MAX_POINTS
|
||||
const MAX_POINTS = MAX_BOOST
|
||||
|
||||
signal points_changed(current: int, max_points: int) # Reused for UI (int casting)
|
||||
signal bar_filled()
|
||||
signal boost_reset()
|
||||
@@ -93,3 +103,27 @@ func get_max_points() -> int:
|
||||
func get_fill_percentage() -> float:
|
||||
return current_boost / MAX_BOOST
|
||||
|
||||
func can_use_special() -> bool:
|
||||
return current_boost >= MAX_BOOST
|
||||
|
||||
func use_special_effect() -> bool:
|
||||
if not can_use_special():
|
||||
return false
|
||||
|
||||
# Consume boost
|
||||
reset_boost()
|
||||
return true
|
||||
|
||||
func acquire_smash_bonus():
|
||||
current_boost += 25.0 # Add 25% boost
|
||||
current_boost = min(current_boost, MAX_BOOST)
|
||||
emit_signal("points_changed", int(current_boost), int(MAX_BOOST))
|
||||
if current_boost >= MAX_BOOST:
|
||||
_on_boost_full()
|
||||
|
||||
func add_goal_completion_reward():
|
||||
current_boost += 50.0 # Reward for completing goal
|
||||
current_boost = min(current_boost, MAX_BOOST)
|
||||
emit_signal("points_changed", int(current_boost), int(MAX_BOOST))
|
||||
if current_boost >= MAX_BOOST:
|
||||
_on_boost_full()
|
||||
|
||||
@@ -16,7 +16,9 @@ var move_button
|
||||
var grab_button
|
||||
var put_button
|
||||
var randomize_button
|
||||
var victory_ui_scene = preload("res://scenes/ui/victory_ui.tscn")
|
||||
var arrange_button
|
||||
# var victory_ui_scene = preload("res://scenes/ui/victory_ui.tscn")
|
||||
var victory_ui_scene = null
|
||||
var powerup_inventory_ui_script = preload("res://scripts/ui/powerup_inventory_ui.gd")
|
||||
|
||||
var main_menu_instance
|
||||
@@ -43,7 +45,13 @@ func initialize(player_node):
|
||||
powerup_inventory_ui = player_node.get_node_or_null("PowerUpInventoryUI")
|
||||
|
||||
# Get node references from main scene
|
||||
randomize_button = player_node.get_node("ActionMenu/ActionButtonContainer/RandomizeButton") # renamed main_node to player_node which is Main
|
||||
action_menu = player_node.get_node("ActionMenu")
|
||||
|
||||
var button_container = player_node.get_node("ActionMenu/ActionButtonContainer")
|
||||
move_button = button_container.get_node("MoveButton")
|
||||
grab_button = button_container.get_node("GrabButton")
|
||||
put_button = button_container.get_node("PutButton")
|
||||
randomize_button = button_container.get_node("RandomizeButton") # renamed main_node to player_node which is Main
|
||||
arrange_button = player_node.get_node("ActionMenu/ActionButtonContainer/ArrangeButton")
|
||||
playerboard_ui = player_node.get_node("PlayerboardUI")
|
||||
|
||||
@@ -212,11 +220,7 @@ func update_button_states():
|
||||
put_button.disabled = false
|
||||
arrange_button.disabled = false
|
||||
|
||||
func set_local_player(player):
|
||||
local_player_character = player
|
||||
|
||||
# Connect to powerup signals with deferred call (manager needs time to initialize)
|
||||
_connect_powerup_manager_deferred(player)
|
||||
|
||||
|
||||
func _connect_powerup_manager_deferred(player):
|
||||
"""Wait for PowerUpManager to be initialized before connecting."""
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
uid://86ikh0wuqk7v
|
||||
Reference in New Issue
Block a user