feat: replace activity markers with typed sites
This commit is contained in:
+11
-4
@@ -8,8 +8,8 @@ extends CharacterBody3D
|
||||
@export var simulation_manager: Node
|
||||
|
||||
@export var pantry_storage: StorageNode
|
||||
@export var guard_zone: Marker3D
|
||||
@export var study_zone: Marker3D
|
||||
@export var guard_site: ActivitySite
|
||||
@export var study_site: ActivitySite
|
||||
|
||||
@export var stomach_capacity_for_food := 5
|
||||
@export var interaction_range := 3.0
|
||||
@@ -59,10 +59,10 @@ func try_interact() -> void:
|
||||
if try_harvest_resource_node():
|
||||
return
|
||||
|
||||
if is_near(guard_zone):
|
||||
if is_near_activity_site(guard_site):
|
||||
simulation_manager.add_safety(3.0)
|
||||
print("Player helped guard the village.")
|
||||
elif is_near(study_zone):
|
||||
elif is_near_activity_site(study_site):
|
||||
simulation_manager.add_knowledge(2.0)
|
||||
print("Player shared knowledge.")
|
||||
elif is_near_storage(pantry_storage):
|
||||
@@ -112,3 +112,10 @@ func is_near_storage(storage_node: StorageNode) -> bool:
|
||||
return false
|
||||
|
||||
return global_position.distance_to(storage_node.get_interaction_position()) <= interaction_range
|
||||
|
||||
|
||||
func is_near_activity_site(activity_site: ActivitySite) -> bool:
|
||||
if activity_site == null:
|
||||
return false
|
||||
|
||||
return global_position.distance_to(activity_site.get_interaction_position()) <= interaction_range
|
||||
|
||||
Reference in New Issue
Block a user