added more tomes
This commit is contained in:
@@ -533,6 +533,7 @@ func _convert_to_bomb_projectile(by_player, force: Vector2):
|
||||
|
||||
# Spawn bomb projectile at current position
|
||||
var bomb = attack_bomb_scene.instantiate()
|
||||
bomb.name = "ThrownBomb_" + name
|
||||
get_parent().add_child(bomb)
|
||||
bomb.global_position = current_pos # Use current position, not target
|
||||
|
||||
@@ -857,6 +858,19 @@ func _open_chest(by_player: Node = null):
|
||||
# Sync chest open visual with item_data so clients can show the floating text
|
||||
var item_data = chest_item.save() if chest_item else {}
|
||||
game_world._rpc_to_ready_peers("_sync_chest_open_by_name", [chest_name, "item", player_peer_id, item_data])
|
||||
# Sync inventory+equipment to joiner (server added item; joiner's client must apply)
|
||||
if multiplayer.is_server():
|
||||
var owner_id = by_player.get_multiplayer_authority()
|
||||
if owner_id != 1 and owner_id != multiplayer.get_unique_id():
|
||||
var inv_data: Array = []
|
||||
for inv_item in by_player.character_stats.inventory:
|
||||
inv_data.append(inv_item.save() if inv_item else null)
|
||||
var equip_data: Dictionary = {}
|
||||
for slot_name in by_player.character_stats.equipment.keys():
|
||||
var eq = by_player.character_stats.equipment[slot_name]
|
||||
equip_data[slot_name] = eq.save() if eq else null
|
||||
if by_player.has_method("_apply_inventory_and_equipment_from_server"):
|
||||
by_player._apply_inventory_and_equipment_from_server.rpc_id(owner_id, inv_data, equip_data)
|
||||
else:
|
||||
push_error("Chest: ERROR - No valid player to give item to!")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user