feat: add typed pantry storage site
This commit is contained in:
@@ -4,7 +4,7 @@ extends Node
|
||||
@export var guard_marker: Marker3D
|
||||
@export var study_marker: Marker3D
|
||||
@export var rest_marker: Marker3D
|
||||
@export var pantry_marker: Marker3D
|
||||
@export var pantry_storage: StorageNode
|
||||
|
||||
|
||||
func get_resource_candidates(action_id: StringName) -> Array[Dictionary]:
|
||||
@@ -28,19 +28,18 @@ func get_activity_target(action_id: StringName) -> Dictionary:
|
||||
SimulationIds.ACTION_REST:
|
||||
marker = rest_marker
|
||||
SimulationIds.ACTION_EAT:
|
||||
marker = pantry_marker
|
||||
return _get_storage_target(pantry_storage)
|
||||
SimulationIds.ACTION_DEPOSIT_FOOD, SimulationIds.ACTION_WITHDRAW_FOOD:
|
||||
marker = pantry_marker
|
||||
return _get_storage_target(pantry_storage)
|
||||
if marker == null:
|
||||
return {}
|
||||
var target_id := ""
|
||||
if (
|
||||
action_id
|
||||
in [
|
||||
SimulationIds.ACTION_EAT,
|
||||
SimulationIds.ACTION_DEPOSIT_FOOD,
|
||||
SimulationIds.ACTION_WITHDRAW_FOOD
|
||||
]
|
||||
):
|
||||
target_id = String(SimulationIds.STORAGE_VILLAGE_PANTRY)
|
||||
return {"target_id": target_id, "position": marker.global_position}
|
||||
return {"target_id": "", "position": marker.global_position}
|
||||
|
||||
|
||||
func _get_storage_target(storage_node: StorageNode) -> Dictionary:
|
||||
if storage_node == null:
|
||||
return {}
|
||||
return {
|
||||
"target_id": String(storage_node.storage_id),
|
||||
"position": storage_node.get_interaction_position()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user