feat: update
This commit is contained in:
@@ -167,6 +167,9 @@ func _process(delta: float) -> void:
|
||||
if not is_active:
|
||||
return
|
||||
|
||||
if not multiplayer.has_multiplayer_peer() or multiplayer.multiplayer_peer == null:
|
||||
return
|
||||
|
||||
elapsed_time += delta
|
||||
|
||||
# Phase escalation
|
||||
|
||||
@@ -103,7 +103,7 @@ func handle_unhandled_input(event):
|
||||
if event.is_action_pressed("action_knock_tekton"):
|
||||
if player.powerup_manager:
|
||||
player.powerup_manager.use_special_effect()
|
||||
if player.is_attack_mode and player.has_method("enter_attack_mode"):
|
||||
if player.get("is_attack_mode") and player.has_method("enter_attack_mode"):
|
||||
player.enter_attack_mode()
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ func can_use_special() -> bool:
|
||||
|
||||
func enable_attack_mode():
|
||||
"""Enable Attack Mode without consuming boost."""
|
||||
player.is_attack_mode = true
|
||||
player.set("is_attack_mode", true)
|
||||
NotificationManager.send_message(player, NotificationManager.MESSAGES.ATTACK_MODE_READY, NotificationManager.MessageType.POWERUP)
|
||||
print("[PowerUp] Attack Mode Enabled (Free).")
|
||||
|
||||
@@ -177,7 +177,7 @@ func consume_boost(amount: float):
|
||||
current_boost -= amount
|
||||
if current_boost <= 0:
|
||||
current_boost = 0.0
|
||||
player.is_attack_mode = false # Out of fuel
|
||||
player.set("is_attack_mode", false) # Out of fuel
|
||||
emit_signal("boost_reset") # UI update for empty
|
||||
print("[PowerUp] Boost depleted. Attack Mode OFF.")
|
||||
|
||||
|
||||
@@ -317,16 +317,11 @@ func is_controller_button_used(button_index: int) -> String:
|
||||
return ""
|
||||
|
||||
func get_control_keycode(action_name: String) -> int:
|
||||
# Map friendly names to their internal settings.controls keys
|
||||
var mapped_name = action_name
|
||||
if action_name == "tekton_grab":
|
||||
mapped_name = "action_grab_tekton"
|
||||
elif action_name == "attack_mode":
|
||||
mapped_name = "action_knock_tekton"
|
||||
elif action_name == "grab":
|
||||
mapped_name = "action_grab"
|
||||
|
||||
return settings.controls.get(mapped_name, -1)
|
||||
# settings.controls stores keys by the same name callers pass in
|
||||
# (e.g. "tekton_grab", "attack_mode", "grab"). The InputMap action name
|
||||
# (e.g. "action_grab_tekton") is a separate concept handled by
|
||||
# apply_control_settings(). Do NOT remap here.
|
||||
return settings.controls.get(action_name, -1)
|
||||
|
||||
func get_control_text(action_name: String) -> String:
|
||||
var code = get_control_keycode(action_name)
|
||||
|
||||
@@ -4,7 +4,7 @@ extends Node
|
||||
# Handles spawning and placement of Static Tektons in restricted zones.
|
||||
|
||||
const STAND_SCENE_PATH = "res://scenes/static_tekton_stand.tscn"
|
||||
const TEKTON_SCENE_PATH = "res://scenes/tekton.tscn"
|
||||
const TEKTON_SCENE_PATH = "res://scenes/static_tekton.tscn"
|
||||
const STATIC_CONTROLLER_SCRIPT = "res://scripts/static_tekton_controller.gd"
|
||||
const PERIMETER_BUFFER = 1 # 1-tile safe zone on all sides (matches main.gd)
|
||||
|
||||
|
||||
@@ -90,6 +90,9 @@ func _process(delta):
|
||||
if not is_active:
|
||||
return
|
||||
|
||||
if not multiplayer.has_multiplayer_peer() or multiplayer.multiplayer_peer == null:
|
||||
return
|
||||
|
||||
# Decrement timer locally for all peers (smoother HUD than waiting for RPC)
|
||||
phase_timer -= delta
|
||||
|
||||
|
||||
Reference in New Issue
Block a user