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()
|
||||
|
||||
Reference in New Issue
Block a user