feat: add witnessed knowledge and wind ambience
This commit is contained in:
@@ -42,6 +42,28 @@ func _run() -> void:
|
||||
"Village should receive exactly the bush's remaining food"
|
||||
)
|
||||
_check(bush_state.get_reserved_by() == -1, "Depletion should release the NPC reservation")
|
||||
var player_extraction: EconomicEventRecord
|
||||
var player_depletion: EconomicEventRecord
|
||||
for event in simulation_manager.economic_events:
|
||||
if int(event.data["actor_id"]) != -1 or StringName(event.data["source_id"]) != bush.node_id:
|
||||
continue
|
||||
if StringName(event.data["event_type"]) == SimulationIds.EVENT_RESOURCE_EXTRACTED:
|
||||
player_extraction = event
|
||||
elif StringName(event.data["event_type"]) == SimulationIds.EVENT_RESOURCE_DEPLETED:
|
||||
player_depletion = event
|
||||
var bush_event_position := bush.interaction_point.global_position
|
||||
_check(player_extraction != null, "Player extraction should create a structured event")
|
||||
_check(player_depletion != null, "Player depletion should create a structured event")
|
||||
if player_extraction != null:
|
||||
_check(
|
||||
player_extraction.get_world_position().is_equal_approx(bush_event_position),
|
||||
"Player extraction should preserve the resource interaction position"
|
||||
)
|
||||
if player_depletion != null:
|
||||
_check(
|
||||
player_depletion.get_world_position().is_equal_approx(bush_event_position),
|
||||
"Player depletion should preserve the resource interaction position"
|
||||
)
|
||||
|
||||
player.global_position = tree.interaction_point.global_position
|
||||
var wood_before: float = simulation_manager.village.wood
|
||||
@@ -57,18 +79,20 @@ func _run() -> void:
|
||||
"Village should receive exactly the extracted wood"
|
||||
)
|
||||
|
||||
var pantry := main_scene.get_node("JajceWorld/WorldObjects/StorageSites/VillagePantry") as StorageNode
|
||||
var pantry_state: StorageStateRecord = simulation_manager.get_pantry()
|
||||
pantry_state.deposit(
|
||||
SimulationIds.RESOURCE_FOOD, pantry_state.get_available_capacity() - 0.5
|
||||
var pantry := (
|
||||
main_scene.get_node("JajceWorld/WorldObjects/StorageSites/VillagePantry") as StorageNode
|
||||
)
|
||||
var pantry_state: StorageStateRecord = simulation_manager.get_pantry()
|
||||
pantry_state.deposit(SimulationIds.RESOURCE_FOOD, pantry_state.get_available_capacity() - 0.5)
|
||||
simulation_manager.economy.sync_resource(SimulationIds.RESOURCE_FOOD)
|
||||
bush_state.set_amount_remaining(1.0)
|
||||
player.global_position = bush.interaction_point.global_position
|
||||
player.try_interact()
|
||||
_check(
|
||||
is_equal_approx(bush_state.get_amount_remaining(), 0.5)
|
||||
and is_equal_approx(pantry_state.get_available_capacity(), 0.0),
|
||||
(
|
||||
is_equal_approx(bush_state.get_amount_remaining(), 0.5)
|
||||
and is_equal_approx(pantry_state.get_available_capacity(), 0.0)
|
||||
),
|
||||
"Player harvesting should leave overflow at its source when storage fills"
|
||||
)
|
||||
|
||||
@@ -81,7 +105,9 @@ func _run() -> void:
|
||||
pantry_state.get_amount(SimulationIds.RESOURCE_FOOD) < pantry_food_before,
|
||||
"Player should eat from the typed pantry StorageNode"
|
||||
)
|
||||
var guard_site := main_scene.get_node("JajceWorld/WorldObjects/ActivitySites/GuardPost") as ActivitySite
|
||||
var guard_site := (
|
||||
main_scene.get_node("JajceWorld/WorldObjects/ActivitySites/GuardPost") as ActivitySite
|
||||
)
|
||||
player.global_position = guard_site.get_interaction_position()
|
||||
var safety_before: float = simulation_manager.village.safety
|
||||
player.try_interact()
|
||||
|
||||
Reference in New Issue
Block a user