feat: add typed pantry storage site
This commit is contained in:
+9
-2
@@ -7,7 +7,7 @@ extends CharacterBody3D
|
||||
|
||||
@export var simulation_manager: Node
|
||||
|
||||
@export var pantry_marker: Marker3D
|
||||
@export var pantry_storage: StorageNode
|
||||
@export var guard_zone: Marker3D
|
||||
@export var study_zone: Marker3D
|
||||
|
||||
@@ -65,7 +65,7 @@ func try_interact() -> void:
|
||||
elif is_near(study_zone):
|
||||
simulation_manager.add_knowledge(2.0)
|
||||
print("Player shared knowledge.")
|
||||
elif is_near(pantry_marker):
|
||||
elif is_near_storage(pantry_storage):
|
||||
simulation_manager.eat_food(stomach_capacity_for_food)
|
||||
print("Player ate food from the village supply.")
|
||||
|
||||
@@ -105,3 +105,10 @@ func is_near(zone: Marker3D) -> bool:
|
||||
return false
|
||||
|
||||
return global_position.distance_to(zone.global_position) <= interaction_range
|
||||
|
||||
|
||||
func is_near_storage(storage_node: StorageNode) -> bool:
|
||||
if storage_node == null:
|
||||
return false
|
||||
|
||||
return global_position.distance_to(storage_node.get_interaction_position()) <= interaction_range
|
||||
|
||||
Reference in New Issue
Block a user