update feature & bugfix

This commit is contained in:
2026-01-23 22:26:44 +08:00
parent 89a3beb2b2
commit d262bb8dc0
12 changed files with 198 additions and 87 deletions
+11
View File
@@ -58,11 +58,22 @@ func _add_bar():
# Type 1 = POWERUP message for special styling
player.rpc("display_message", "Power-up bar filled!", 1)
print("[PowerUp] Player %s gained 1 bar! Total: %d/%d points" % [player.name, current_points, MAX_POINTS])
if player.is_multiplayer_authority():
player.get_node("PowerUpManager").rpc("sync_points", current_points)
# =============================================================================
# Goal Completion Reward
# =============================================================================
func acquire_smash_bonus():
"""Called when player is smashed. Grants 1 bar up to a max of 2 bars."""
if get_bars() < 2:
_add_bar()
print("[PowerUp] Player %s gained smash bonus bar! Total: %d/%d" % [player.name, current_points, MAX_POINTS])
else:
print("[PowerUp] Player %s smash bonus capped (already has >= 2 bars)" % player.name)
func add_goal_completion_reward():
"""Called when player completes a goal pattern. Awards 1 bar."""
_add_bar()