fix: align loot feedback with pickup outcomes

This commit is contained in:
goose
2026-10-09 11:25:11 -04:00
parent 8816c31301
commit 78f4744c3f
8 changed files with 88 additions and 13 deletions
+3 -1
View File
@@ -83,7 +83,8 @@ func test_hud_describes_pickup_and_loot_take_outcomes_in_french() -> void:
var events: Array[GameEvent] = [
GameEvent.new(1, 0, &"item_picked_up", {"item_id": &"consumable_bandage", "quantity": 2}, "Picked up consumable_bandage x2.", &"player"),
GameEvent.new(2, 0, &"pickup_refused", {"item_id": &"consumable_bandage", "quantity": 2, "reason": "inventory_full"}, "Inventory is full.", &"player"),
GameEvent.new(3, 0, &"loot_taken", {"items": [{"item_id": &"consumable_bandage", "quantity": 1}], "gold": 4, "ammunition": 3, "refused_items": [{"item_id": &"weapon_hunting_knife", "quantity": 1, "reason": "inventory_full"}]}, "Loot taken.", &"player"),
GameEvent.new(3, 0, &"pickup_refused", {"reason": "no_ground_item"}, "Nothing to pick up.", &"player"),
GameEvent.new(4, 0, &"loot_taken", {"items": [{"item_id": &"consumable_bandage", "quantity": 1}], "gold": 4, "ammunition": 3, "refused_items": [{"item_id": &"weapon_hunting_knife", "quantity": 1, "reason": "inventory_full"}]}, "Loot taken.", &"player"),
]
hud.refresh(state, events, game.get_run_state())
@@ -91,6 +92,7 @@ func test_hud_describes_pickup_and_loot_take_outcomes_in_french() -> void:
var journal_text := hud.event_log.get_parsed_text()
assert_string_contains(journal_text, "Ramassé : Bandage x2.")
assert_string_contains(journal_text, "Inventaire plein")
assert_string_contains(journal_text, "Rien à ramasser.")
assert_string_contains(journal_text, "Butin récupéré : Bandage x1, 4 or, 3 munitions récupérées")
assert_string_contains(journal_text, "Couteau de chasse x1 non ramassé (inventaire plein)")
for technical_id: String in ["consumable_bandage", "weapon_hunting_knife"]: