doing something dumb

This commit is contained in:
dingo
2026-01-17 20:42:02 -05:00
parent 583644fde6
commit 32fb57fa75
3 changed files with 137 additions and 105 deletions
+7 -3
View File
@@ -27,8 +27,10 @@ const STATE_AUTH = 0
const STATE_HUB = 1
const STATE_PLAYING = 2
const STATE_DEAD = 3
const STATE_PORTALUSED = 4
const STATE_DUNGEONCLEARED = 5
const STATE_NAMES = ["AUTH", "HUB", "PLAYING", "DEAD"]
const STATE_NAMES = ["AUTH", "HUB", "PLAYING", "DEAD", "PORTALUSED","DUNGEONCLEARED"]
var current_state: int = STATE_AUTH
var account_id: int = 0
@@ -207,7 +209,8 @@ func _handle_hub_state(data: Dictionary):
"max_stamina": int(c.get("maxStamina", c.get("MaxStamina", 55))),
"gold": int(c.get("gold", c.get("Gold", 0)))
}
set_state(STATE_HUB)
if current_state != STATE_PLAYING and current_state != STATE_DEAD:
set_state(STATE_HUB)
character_updated.emit()
func _handle_dungeon_enter(data: Dictionary):
@@ -341,6 +344,7 @@ func _handle_dungeon_state(data: Dictionary):
if phase == "cleared":
print("[GameState] Dungeon cleared! Waiting for hub state...")
# Server should send HUB_STATE next, but show a message
set_state(STATE_DUNGEONCLEARED)
dungeon_cleared.emit()
return
@@ -551,7 +555,7 @@ func _handle_portal_used(_data: Dictionary):
"tiles": [],
"phase": "active"
}
set_state(STATE_PORTALUSED)
escaped.emit()
# Server will send HUB_STATE next which will call set_state(STATE_HUB)