Fix Power Up Inventory

feat: Add player input handling for movement, actions, and skill targeting, and implement special tile effect management.
This commit is contained in:
Yogi Wiguna
2026-02-04 14:53:03 +08:00
parent 77b8542896
commit 4b39a4cfcb
3 changed files with 59 additions and 20 deletions
+18 -16
View File
@@ -81,10 +81,11 @@ func execute_targeted_effect(effect: int, target_pos: Vector2i):
# Animation / Shake
if player.is_multiplayer_authority():
player.rpc("trigger_screen_shake", "light")
# Also reset action loop?
var main = player.get_tree().get_root().get_node_or_null("Main")
if main and main.ui_manager:
main.ui_manager.current_action_state = main.ui_manager.ActionState.NONE
# Also reset action loop? (ONLY for human players)
if not (player.is_bot or player.is_in_group("Bots")):
var main = player.get_tree().get_root().get_node_or_null("Main")
if main and main.ui_manager:
main.ui_manager.current_action_state = main.ui_manager.ActionState.NONE
# Random shape patterns for 3x3 area (relative offsets from center)
@@ -221,18 +222,19 @@ func activate_effect(effect: int, target_player: Node3D = null):
SpecialEffect.FASTER_SPEED:
_execute_faster_speed()
SpecialEffect.AREA_FREEZE, SpecialEffect.BLOCK_FLOOR:
# Enter Targeting Mode instead of executing immediately
var main = player.get_tree().get_root().get_node_or_null("Main")
if main and main.ui_manager:
main.ui_manager.current_action_state = main.ui_manager.ActionState.TARGETING
main.ui_manager.pending_skill_id = effect
NotificationManager.send_message(player, "Select a target area...", NotificationManager.MessageType.NORMAL)
# Do NOT set cooldown yet. Cooldown sets on execution.
# Revert the cooldown set above (hacky but handles the split flow)
powerup_cooldowns[effect] = 0.0
emit_signal("cooldown_updated", effect, 0.0, 0.0)
print("[SpecialTiles] Entered Targeting Mode for %s" % SpecialEffect.keys()[effect])
return # Exit, wait for input
# Enter Targeting Mode instead of executing immediately (ONLY for human players)
if not (player.is_bot or player.is_in_group("Bots")):
var main = player.get_tree().get_root().get_node_or_null("Main")
if main and main.ui_manager:
main.ui_manager.current_action_state = main.ui_manager.ActionState.TARGETING
main.ui_manager.pending_skill_id = effect
NotificationManager.send_message(player, "Select a target area...", NotificationManager.MessageType.NORMAL)
# Do NOT set cooldown yet. Cooldown sets on execution.
# Revert the cooldown set above (hacky but handles the split flow)
powerup_cooldowns[effect] = 0.0
emit_signal("cooldown_updated", effect, 0.0, 0.0)
print("[SpecialTiles] Entered Targeting Mode for %s" % SpecialEffect.keys()[effect])
return # Exit, wait for input
SpecialEffect.INVISIBLE_MODE:
_execute_invisible_mode(player)