feat: score resource discovery by comfort and safety

This commit is contained in:
2026-07-07 15:10:06 +02:00
parent 4c090f1635
commit 036c9d5141
12 changed files with 132 additions and 23 deletions
+5
View File
@@ -15,6 +15,9 @@ static var _all: Array[ResourceNode] = []
@export var initial_enabled: bool = true
@export var can_npcs_use: bool = true
@export var can_player_use: bool = true
@export_range(0.0, 1.0, 0.05) var safety_risk := 0.0
@export var comfort_distance := 18.0
@export var discovery_priority := 0.0
@export var hide_visual_when_depleted: bool = false
@onready var interaction_point: Marker3D = $InteractionPoint
@@ -119,6 +122,8 @@ func _update_presentation() -> void:
return
var label := $DebugLabel as Label3D
var text := "%s\n%s %.1f" % [node_id, resource_id, get_amount_remaining()]
if state != null:
text += "\nrisk:%.2f comfort:%.0f" % [state.get_safety_risk(), state.get_comfort_distance()]
if get_reserved_by() >= 0:
text += "\nheld:%d" % get_reserved_by()
if is_depleted():