feat: add witnessed knowledge and wind ambience

This commit is contained in:
Rijad Zuzo
2026-07-11 11:27:40 +02:00
parent 2ed93de6d1
commit 81409650df
72 changed files with 3001 additions and 606 deletions
+21 -4
View File
@@ -16,12 +16,21 @@ func record_economic(
source_id: StringName,
destination_id: StringName,
item_id: StringName,
amount: float
amount: float,
world_position: Vector3 = Vector3.ZERO
) -> EconomicEventRecord:
if amount <= 0.0:
return null
var event := EconomicEventRecord.create(
next_event_id, event_type, tick, actor_id, source_id, destination_id, item_id, amount
next_event_id,
event_type,
tick,
actor_id,
source_id,
destination_id,
item_id,
amount,
world_position
)
_append(event)
return event
@@ -32,10 +41,11 @@ func record_narrative(
event_type: StringName,
actor_id: int,
source_id: StringName = &"",
action_display: String = ""
action_display: String = "",
world_position: Vector3 = Vector3.ZERO
) -> EconomicEventRecord:
var event := EconomicEventRecord.create_narrative(
next_event_id, event_type, tick, actor_id, source_id, action_display
next_event_id, event_type, tick, actor_id, source_id, action_display, world_position
)
_append(event)
return event
@@ -62,6 +72,13 @@ func get_recent(max_count: int = 5) -> Array[EconomicEventRecord]:
return results
func get_by_id(event_id: int) -> EconomicEventRecord:
for event in events:
if int(event.data["event_id"]) == event_id:
return event
return null
func get_consumption_rates(
current_tick: int,
window_ticks: int = DEFAULT_RATE_WINDOW_TICKS,