feat: add structured economic events
This commit is contained in:
@@ -12,6 +12,7 @@ const DEBUG_LOGS := true
|
||||
@export var stuck_timeout := 1.5
|
||||
|
||||
@onready var nav_agent: NavigationAgent3D = $NavigationAgent3D
|
||||
@onready var carried_food_visual: MeshInstance3D = $CarriedFood
|
||||
|
||||
var has_reported_arrival := false
|
||||
var sim_id: int = -1
|
||||
@@ -41,6 +42,12 @@ func setup_from_sim(npc: SimNPC) -> void:
|
||||
npc_name = npc.npc_name
|
||||
profession = npc.profession
|
||||
name = "NPC_%s_%s" % [sim_id, npc_name]
|
||||
set_carried_food_visible(
|
||||
npc.get_inventory_amount(SimulationIds.RESOURCE_FOOD) > 0.0
|
||||
)
|
||||
|
||||
func set_carried_food_visible(is_visible: bool) -> void:
|
||||
carried_food_visual.visible = is_visible and not is_dead_visual
|
||||
|
||||
func set_target_position(pos: Vector3) -> void:
|
||||
path_request_id += 1
|
||||
@@ -167,6 +174,7 @@ func _report_navigation_failure_once() -> void:
|
||||
|
||||
func apply_dead_visual_state() -> void:
|
||||
is_dead_visual = true
|
||||
carried_food_visual.visible = false
|
||||
path_request_id += 1
|
||||
velocity = Vector3.ZERO
|
||||
current_path = PackedVector3Array()
|
||||
|
||||
Reference in New Issue
Block a user