fix(candy-survival): connect Ghost charges to SpecialTilesManager powerup inventory, spawn Ghost tiles in arena, and support powerup button activations
This commit is contained in:
@@ -153,6 +153,17 @@ func add_powerup_from_item(item_id: int):
|
||||
var effect = get_effect_from_item(item_id)
|
||||
if effect == -1: return
|
||||
|
||||
if LobbyManager.game_mode == "Candy Survival":
|
||||
if effect == SpecialEffect.INVISIBLE_MODE:
|
||||
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.add_ghost_charge(pid)
|
||||
else:
|
||||
gm.rpc_id(1, "add_ghost_charge", pid)
|
||||
return
|
||||
|
||||
# VFX: show pickup burst on all peers (mirrors skill VFX pattern)
|
||||
if player.is_multiplayer_authority() and player.has_method("can_rpc") and player.can_rpc():
|
||||
player.rpc("play_skill_vfx", "take_powerup")
|
||||
@@ -230,6 +241,17 @@ func activate_effect(effect: int, target_player: Node3D = null):
|
||||
NotificationManager.send_message(player, "Skill in Cooldown! (%.1fs)" % global_cooldown_timer, NotificationManager.MessageType.WARNING)
|
||||
return
|
||||
|
||||
if LobbyManager.game_mode == "Candy Survival":
|
||||
if effect == SpecialEffect.INVISIBLE_MODE:
|
||||
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)
|
||||
return
|
||||
|
||||
# Check Attack Mode Restriction
|
||||
if player.get("is_attack_mode") and effect == SpecialEffect.INVISIBLE_MODE:
|
||||
NotificationManager.send_message(player, "Cannot enter Ghost mode while in Attack Mode!", NotificationManager.MessageType.WARNING)
|
||||
|
||||
Reference in New Issue
Block a user