This commit is contained in:
2026-02-02 00:21:32 +08:00
parent d9025128e0
commit d6c84dd30d
9 changed files with 92 additions and 28 deletions
+7 -7
View File
@@ -122,7 +122,7 @@ const AVAILABLE_CHARACTERS: Array[String] = ["Bob", "Masbro", "Gatot", "Oldpop"]
set(value):
is_my_turn = value
if is_my_turn and is_multiplayer_authority():
rpc("display_message", "It's your turn!")
NotificationManager.send_message(self, NotificationManager.MESSAGES.TURN_START, NotificationManager.MessageType.NORMAL)
@export var has_moved_this_turn = false
@@ -629,7 +629,7 @@ func apply_stagger(duration: float = 1.5):
print("Player %s staggered for %.1f seconds" % [name, duration])
if is_multiplayer_authority():
rpc("display_message", "C R U S H E D !", 4) # MessageType.WARNING
NotificationManager.send_message(self, NotificationManager.MESSAGES.CRUSHED, NotificationManager.MessageType.WARNING)
drop_random_item()
# Grant "Smashed" Bonus (1 bar, max 2)
@@ -680,7 +680,7 @@ func drop_random_item():
var cell = Vector3i(drop_pos.x, 0, drop_pos.y)
rpc("sync_grid_item", cell.x, cell.y, cell.z, item_id)
rpc("display_message", "Dropped item!", 4)
NotificationManager.send_message(self, NotificationManager.MESSAGES.DROPPED_ITEM, NotificationManager.MessageType.WARNING)
print("Player %s dropped item %d at %s" % [name, item_id, drop_pos])
@@ -706,7 +706,7 @@ func drop_all_tiles():
if dropped_count > 0:
rpc("sync_playerboard", playerboard)
rpc("trigger_screen_shake", "targeted")
rpc("display_message", "CRITICALLY HIT!", 4)
NotificationManager.send_message(self, NotificationManager.MESSAGES.CRITICALLY_HIT, NotificationManager.MessageType.WARNING)
print("Player %s dropped %d tiles due to Super Push" % [name, dropped_count])
func _find_valid_drop_position() -> Vector2i:
@@ -741,7 +741,7 @@ func attempt_target_action(target_index: int):
# So we might fail here if not wired up.
# For now, let's look for "PowerUpInventoryUI" in CanvasLayer.
var inventory_ui = main.ui_manager.get_node_or_null("PowerUpInventoryUI")
var inventory_ui = main.ui_manager.get_node_or_null("PowerUpInventoryUI")
# Or check if ui_manager tracks it.
# Note: We haven't instantiated it yet in UIManager. We will need to do that.
@@ -766,7 +766,7 @@ func attempt_target_action(target_index: int):
if target_player == self and effect != 4: # 4 = INVISIBLE (Self)
# Trying to target self with harmful effect?
rpc("display_message", "Can't target self!", 3)
NotificationManager.send_message(self, NotificationManager.MESSAGES.CANT_TARGET_SELF, NotificationManager.MessageType.WARNING)
return
# 3. Activate Effect
@@ -1141,7 +1141,7 @@ func start_turn():
has_performed_action = false
is_my_turn = true
if is_multiplayer_authority():
rpc("display_message", "It's your turn!")
# rpc("display_message", "It's your turn!") # Handled by setter
_after_action_completed()
func end_turn():