feat: add safe rooms and repeatable Bobka rations
This commit is contained in:
@@ -2,6 +2,7 @@ class_name ConditionEngine
|
||||
extends RefCounted
|
||||
|
||||
const StatusEffectType = preload("res://scripts/domain/combat/status_effect.gd")
|
||||
const SafeRoomServiceType = preload("res://scripts/domain/world/safe_room_service.gd")
|
||||
|
||||
var diagnostics := PackedStringArray()
|
||||
|
||||
@@ -116,6 +117,14 @@ func apply_effect(effect: Dictionary, context: Dictionary) -> Dictionary:
|
||||
if not moderation_fn.is_valid():
|
||||
return {"applied": false, "type": kind, "reason": &"missing_moderation_context"}
|
||||
return moderation_fn.call(StringName(effect.get("reason", "propos_interdits")))
|
||||
&"give_item":
|
||||
var run: RunState = context.get("run_state")
|
||||
var npc_id: StringName = StringName(context.get("npc_id", ""))
|
||||
var npc_content_id: StringName = StringName(context.get("npc_content_id", ""))
|
||||
if run == null or npc_id.is_empty() or npc_content_id != SafeRoomServiceType.BOBKA_CONTENT_ID or StringName(effect.get("item", "")) != SafeRoomServiceType.RATION_ITEM_ID:
|
||||
return {"applied": false, "type": kind, "reason": &"unsupported_item_grant"}
|
||||
var ration_events := SafeRoomServiceType.give_bobka_ration(run, npc_id)
|
||||
return {"applied": not ration_events.is_empty(), "type": kind, "events": ration_events}
|
||||
&"join_party":
|
||||
var party: PartyState = context.get("party")
|
||||
var recruit: ActorState = context.get("recruit")
|
||||
@@ -124,7 +133,7 @@ func apply_effect(effect: Dictionary, context: Dictionary) -> Dictionary:
|
||||
return {"applied": false, "type": kind, "reason": &"missing_party_context"}
|
||||
var result := party.recruit(recruit, player.cell, map, context.get("blocked_cells", {}))
|
||||
return {"applied": bool(result.get("accepted", false)), "type": kind, "result": result}
|
||||
&"message", &"give_item", &"remove_item", &"learn_spell", &"learn_random_spell", &"complete_objective", &"endanger_tourist", &"augment_companion", &"tourist_selfie":
|
||||
&"message", &"remove_item", &"learn_spell", &"learn_random_spell", &"complete_objective", &"endanger_tourist", &"augment_companion", &"tourist_selfie":
|
||||
# Later content slices own the corresponding inventory, quest, NPC, and spell mutations.
|
||||
pass
|
||||
_:
|
||||
|
||||
Reference in New Issue
Block a user