Loot changes
This commit is contained in:
@@ -12,6 +12,7 @@ signal loot_received(items: Array)
|
||||
signal player_died
|
||||
signal loot_chest_spawned(chest_data: Dictionary)
|
||||
signal loot_chest_state_received(chest_data: Dictionary)
|
||||
signal mob_loot_state_received(mob_data: Dictionary)
|
||||
signal death_loot_lost(data: Dictionary)
|
||||
signal dungeon_list_received(data: Dictionary)
|
||||
signal crafting_skills_updated(skills: Dictionary)
|
||||
@@ -163,6 +164,8 @@ func _on_message_received(opcode: int, data: Dictionary):
|
||||
_handle_loot_chest_spawned(data)
|
||||
OpCodes.LOOT_CHEST_STATE:
|
||||
_handle_loot_chest_state(data)
|
||||
OpCodes.MOB_LOOT_STATE:
|
||||
_handle_mob_loot_state(data)
|
||||
OpCodes.PLAYER_DEATH_LOOT_LOST:
|
||||
_handle_death_loot_lost(data)
|
||||
OpCodes.DUNGEON_LIST_RESPONSE:
|
||||
@@ -543,6 +546,9 @@ func send_unequip_item(slot: String):
|
||||
func send_use_item(slot_index: int):
|
||||
Network.send_message(OpCodes.USE_ITEM, {"SlotIndex": slot_index})
|
||||
|
||||
func send_stack_items(source_slot: int, target_slot: int):
|
||||
Network.send_message(OpCodes.STACK_ITEMS, {"SourceSlot": source_slot, "TargetSlot": target_slot})
|
||||
|
||||
func send_chat(message: String):
|
||||
Network.send_message(OpCodes.CHAT_SEND, {"Message": message})
|
||||
|
||||
@@ -605,6 +611,11 @@ func _handle_loot_chest_state(data: Dictionary):
|
||||
print("[GameState] Loot chest state received")
|
||||
loot_chest_state_received.emit(data)
|
||||
|
||||
func _handle_mob_loot_state(data: Dictionary):
|
||||
print("[GameState] Mob loot state received for mob: ", data.get("mobName", "Unknown"))
|
||||
# Signal will be connected by mob loot UI
|
||||
mob_loot_state_received.emit(data)
|
||||
|
||||
func _handle_death_loot_lost(data: Dictionary):
|
||||
print("[GameState] Death loot lost: ", data)
|
||||
death_loot_lost.emit(data)
|
||||
@@ -626,6 +637,19 @@ func take_all_loot_chest(chest_id: int):
|
||||
func close_loot_chest(chest_id: int):
|
||||
Network.send_message(OpCodes.LOOT_CHEST_CLOSE, {"ChestId": chest_id})
|
||||
|
||||
# Mob loot actions
|
||||
func request_mob_loot(mob_id: int):
|
||||
Network.send_message(OpCodes.MOB_LOOT_REQUEST, {"mobId": mob_id})
|
||||
|
||||
func take_mob_loot_item(mob_id: int, item_index: int):
|
||||
Network.send_message(OpCodes.MOB_LOOT_TAKE_ITEM, {
|
||||
"mobId": mob_id,
|
||||
"itemIndex": item_index
|
||||
})
|
||||
|
||||
func take_all_mob_loot(mob_id: int):
|
||||
Network.send_message(OpCodes.MOB_LOOT_TAKE_ALL, {"mobId": mob_id})
|
||||
|
||||
# Dungeon list handler
|
||||
func _handle_dungeon_list(data: Dictionary):
|
||||
print("[GameState] Received dungeon list")
|
||||
|
||||
Reference in New Issue
Block a user