feat: port item instances and inventory

This commit is contained in:
goose
2026-10-03 13:16:00 -04:00
parent 391e95f6f4
commit f9e68e6110
16 changed files with 417 additions and 7 deletions
+6 -4
View File
@@ -20,16 +20,18 @@ func test_input_pipeline_routes_e_interaction_and_movement_through_action_router
assert_eq(state.player.cell, start_cell + Vector2i.DOWN)
assert_eq(game.get_run_state().recent_events(2)[0].kind, &"moved")
func test_input_pipeline_routes_unavailable_input_to_the_journal_and_hud() -> void:
func test_input_pipeline_routes_inventory_input_to_the_live_panel_and_journal() -> void:
var panel := game.get_node("HUD/InventoryPanel") as PanelContainer
var event_log := game.get_node("HUD/EventLog") as RichTextLabel
await _dispatch_key(KEY_I)
var event := game.get_run_state().recent_events(1)[0]
assert_eq(event.kind, &"action_unavailable")
assert_eq(event.payload, {"action": &"inventory"})
assert_eq(event.kind, &"inventory_opened")
assert_eq(event.payload, {"item_count": 0})
assert_eq(event.turn, 1)
assert_string_contains(event_log.get_parsed_text(), "inventory")
assert_true(panel.visible)
assert_string_contains(event_log.get_parsed_text(), "Inventory opened")
func _dispatch_key(keycode: Key) -> void:
Input.parse_input_event(_key_event(keycode, true))