fix: align loot feedback with pickup outcomes
This commit is contained in:
@@ -21,15 +21,17 @@ func get_last_feedback_state() -> Dictionary:
|
||||
|
||||
func begin(event: GameEvent, presentation_kind: StringName) -> void:
|
||||
var color := _color_for(presentation_kind)
|
||||
var feedback_label := label_for_event(event, presentation_kind)
|
||||
_last_feedback_state = {
|
||||
"kind": presentation_kind,
|
||||
"duration_ms": EFFECT_DURATION_MS,
|
||||
"color": color,
|
||||
"label": feedback_label,
|
||||
}
|
||||
if _test_mode:
|
||||
return
|
||||
var label := Label.new()
|
||||
label.text = _label_for(event, presentation_kind)
|
||||
label.text = feedback_label
|
||||
label.modulate = color
|
||||
label.position = Vector2(390, 80)
|
||||
label.z_index = 20
|
||||
@@ -47,9 +49,20 @@ func _color_for(presentation_kind: StringName) -> Color:
|
||||
&"quest": return QUEST_COLOR
|
||||
_: return LOOT_COLOR
|
||||
|
||||
func _label_for(event: GameEvent, presentation_kind: StringName) -> String:
|
||||
func label_for_event(event: GameEvent, presentation_kind: StringName) -> String:
|
||||
if presentation_kind == &"loot":
|
||||
match event.kind:
|
||||
&"loot_dropped": return "✦ BUTIN AU SOL"
|
||||
&"item_picked_up": return "✦ OBJET RAMASSÉ"
|
||||
&"loot_taken": return "✦ BUTIN RÉCUPÉRÉ"
|
||||
&"pickup_refused":
|
||||
var reason := StringName(event.payload.get("reason", ""))
|
||||
if reason == &"no_ground_item":
|
||||
return "! RIEN À RAMASSER"
|
||||
if reason == &"capacity" or reason == &"inventory_full":
|
||||
return "! INVENTAIRE PLEIN"
|
||||
return "! RAMASSAGE IMPOSSIBLE"
|
||||
match presentation_kind:
|
||||
&"loot": return "✦ BUTIN AU SOL"
|
||||
&"trap": return "! TRAP"
|
||||
&"quest": return "✦ QUEST UPDATED"
|
||||
_: return event.message
|
||||
|
||||
Reference in New Issue
Block a user