fix(candy-survival): disable Space and G, rebind Q to Knock and F to Ghost mode
This commit is contained in:
@@ -55,7 +55,7 @@ func _process(delta):
|
|||||||
|
|
||||||
|
|
||||||
# 3. Action inputs (momentary)
|
# 3. Action inputs (momentary)
|
||||||
if Input.is_action_just_pressed("action_grab"):
|
if Input.is_action_just_pressed("action_grab") and LobbyManager.game_mode != "Candy Survival":
|
||||||
player.grab_item(player.current_position)
|
player.grab_item(player.current_position)
|
||||||
|
|
||||||
if move_vec != Vector2i.ZERO:
|
if move_vec != Vector2i.ZERO:
|
||||||
@@ -93,14 +93,29 @@ func handle_unhandled_input(event):
|
|||||||
if not SettingsManager:
|
if not SettingsManager:
|
||||||
return
|
return
|
||||||
|
|
||||||
# 1. Unified check for POWER-UP Activation
|
# 1. Unified check for POWER-UP / Ghost Activation
|
||||||
if event.is_action_pressed("use_powerup"):
|
if event.is_action_pressed("use_powerup"):
|
||||||
|
if LobbyManager.game_mode == "Candy Survival":
|
||||||
|
var gm = player.get_node_or_null("/root/Main/CandySurvivalManager")
|
||||||
|
if gm and gm.active:
|
||||||
|
var pid = player.get("peer_id") if "peer_id" in player else player.name.to_int()
|
||||||
|
if multiplayer.is_server():
|
||||||
|
gm.try_activate_ghost(pid)
|
||||||
|
else:
|
||||||
|
gm.rpc_id(1, "try_activate_ghost", pid)
|
||||||
|
else:
|
||||||
player.activate_held_powerup()
|
player.activate_held_powerup()
|
||||||
get_viewport().set_input_as_handled()
|
get_viewport().set_input_as_handled()
|
||||||
return
|
return
|
||||||
|
|
||||||
# 2. Action Buttons (Remappable via InputMap)
|
# 2. Action Buttons (Remappable via InputMap / KEY_Q override for Candy Survival)
|
||||||
if event.is_action_pressed("action_knock_tekton"):
|
var is_knock = false
|
||||||
|
if LobbyManager.game_mode == "Candy Survival":
|
||||||
|
is_knock = (event is InputEventKey and event.pressed and not event.echo and event.keycode == KEY_Q)
|
||||||
|
else:
|
||||||
|
is_knock = event.is_action_pressed("action_knock_tekton")
|
||||||
|
|
||||||
|
if is_knock:
|
||||||
if LobbyManager.game_mode == "Candy Survival":
|
if LobbyManager.game_mode == "Candy Survival":
|
||||||
var gm = player.get_node_or_null("/root/Main/CandySurvivalManager")
|
var gm = player.get_node_or_null("/root/Main/CandySurvivalManager")
|
||||||
if gm and gm.active:
|
if gm and gm.active:
|
||||||
@@ -129,26 +144,11 @@ func handle_unhandled_input(event):
|
|||||||
|
|
||||||
elif event.is_action_pressed("action_grab"):
|
elif event.is_action_pressed("action_grab"):
|
||||||
if LobbyManager.game_mode == "Candy Survival":
|
if LobbyManager.game_mode == "Candy Survival":
|
||||||
var gm = player.get_node_or_null("/root/Main/CandySurvivalManager")
|
|
||||||
if gm and gm.active:
|
|
||||||
var pid = player.get("peer_id") if "peer_id" in player else player.name.to_int()
|
|
||||||
if multiplayer.is_server():
|
|
||||||
gm.try_deliver(pid)
|
|
||||||
else:
|
|
||||||
gm.rpc_id(1, "try_deliver", pid)
|
|
||||||
get_viewport().set_input_as_handled()
|
get_viewport().set_input_as_handled()
|
||||||
return
|
return
|
||||||
|
|
||||||
elif event.is_action_pressed("action_grab_tekton"):
|
elif event.is_action_pressed("action_grab_tekton"):
|
||||||
if LobbyManager.game_mode == "Candy Survival":
|
if LobbyManager.game_mode == "Candy Survival":
|
||||||
var gm = player.get_node_or_null("/root/Main/CandySurvivalManager")
|
|
||||||
if gm and gm.active:
|
|
||||||
var pid = player.get("peer_id") if "peer_id" in player else player.name.to_int()
|
|
||||||
# In Candy Survival, action_grab_tekton activates Ghost mode
|
|
||||||
if multiplayer.is_server():
|
|
||||||
gm.try_activate_ghost(pid)
|
|
||||||
else:
|
|
||||||
gm.rpc_id(1, "try_activate_ghost", pid)
|
|
||||||
get_viewport().set_input_as_handled()
|
get_viewport().set_input_as_handled()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user