feat: add witnessed knowledge and wind ambience
This commit is contained in:
@@ -144,9 +144,7 @@ func consume_npc_food(npc: SimNPC) -> bool:
|
||||
npc.starvation_ticks = 0
|
||||
npc.is_starving = npc.hunger >= 90.0
|
||||
inventory_changed.emit(
|
||||
npc,
|
||||
SimulationIds.RESOURCE_FOOD,
|
||||
npc.get_inventory_amount(SimulationIds.RESOURCE_FOOD)
|
||||
npc, SimulationIds.RESOURCE_FOOD, npc.get_inventory_amount(SimulationIds.RESOURCE_FOOD)
|
||||
)
|
||||
economic_event_requested.emit(
|
||||
SimulationIds.EVENT_ITEM_CONSUMED,
|
||||
@@ -167,12 +165,15 @@ func consume_completion_cost(npc: SimNPC, definition: ActionDefinition) -> bool:
|
||||
var storage := get_storage_for_resource(resource_id)
|
||||
var available := storage.get_amount(resource_id) if storage != null else 0.0
|
||||
if storage == null or available < required_amount:
|
||||
var reason := "%s: needs %.0f %s (%.1f available)" % [
|
||||
definition.display_name,
|
||||
required_amount,
|
||||
String(resource_id).capitalize(),
|
||||
available,
|
||||
]
|
||||
var reason := (
|
||||
"%s: needs %.0f %s (%.1f available)"
|
||||
% [
|
||||
definition.display_name,
|
||||
required_amount,
|
||||
String(resource_id).capitalize(),
|
||||
available,
|
||||
]
|
||||
)
|
||||
narrative_event_requested.emit(
|
||||
SimulationIds.EVENT_TASK_BLOCKED,
|
||||
npc.id,
|
||||
@@ -194,8 +195,10 @@ func consume_completion_cost(npc: SimNPC, definition: ActionDefinition) -> bool:
|
||||
)
|
||||
if debug_logs:
|
||||
print(
|
||||
"[VillageEconomy] %s consumed %.1f %s for %s"
|
||||
% [npc.npc_name, consumed, resource_id, definition.action_id]
|
||||
(
|
||||
"[VillageEconomy] %s consumed %.1f %s for %s"
|
||||
% [npc.npc_name, consumed, resource_id, definition.action_id]
|
||||
)
|
||||
)
|
||||
return true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user