Dungeon Browser
This commit is contained in:
@@ -13,6 +13,7 @@ signal player_died
|
||||
signal loot_chest_spawned(chest_data: Dictionary)
|
||||
signal loot_chest_state_received(chest_data: Dictionary)
|
||||
signal death_loot_lost(data: Dictionary)
|
||||
signal dungeon_list_received(data: Dictionary)
|
||||
|
||||
# Use constants instead of enum to avoid type issues
|
||||
const STATE_AUTH = 0
|
||||
@@ -133,6 +134,8 @@ func _on_message_received(opcode: int, data: Dictionary):
|
||||
_handle_loot_chest_state(data)
|
||||
OpCodes.PLAYER_DEATH_LOOT_LOST:
|
||||
_handle_death_loot_lost(data)
|
||||
OpCodes.DUNGEON_LIST_RESPONSE:
|
||||
_handle_dungeon_list(data)
|
||||
_:
|
||||
print("[GameState] Unhandled opcode: ", opcode)
|
||||
|
||||
@@ -467,3 +470,18 @@ 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})
|
||||
|
||||
# Dungeon list handler
|
||||
func _handle_dungeon_list(data: Dictionary):
|
||||
print("[GameState] Received dungeon list")
|
||||
dungeon_list_received.emit(data)
|
||||
|
||||
# Dungeon browser actions
|
||||
func request_dungeon_list():
|
||||
Network.send_message(OpCodes.DUNGEON_LIST_REQUEST, {})
|
||||
|
||||
func create_dungeon(tier: int):
|
||||
Network.send_message(OpCodes.DUNGEON_CREATE, {"Tier": tier})
|
||||
|
||||
func join_dungeon(dungeon_id: String):
|
||||
Network.send_message(OpCodes.DUNGEON_JOIN, {"DungeonId": dungeon_id})
|
||||
|
||||
@@ -41,6 +41,12 @@ const DUNGEON_STATE = 302
|
||||
const DUNGEON_LEAVE = 303
|
||||
const DUNGEON_CLEARED = 304
|
||||
|
||||
# Dungeon Browser
|
||||
const DUNGEON_LIST_REQUEST = 310
|
||||
const DUNGEON_LIST_RESPONSE = 311
|
||||
const DUNGEON_CREATE = 312
|
||||
const DUNGEON_JOIN = 313
|
||||
|
||||
# Input
|
||||
const INPUT_MOVE = 400
|
||||
const INPUT_ATTACK = 401
|
||||
|
||||
Reference in New Issue
Block a user