Add camp talk supply claims
This commit is contained in:
@@ -274,11 +274,33 @@ func _normalized_camp_conversations(source) -> Array:
|
||||
"label": label,
|
||||
"speaker": str(entry.get("speaker", "")).strip_edges(),
|
||||
"summary": str(entry.get("summary", "")).strip_edges(),
|
||||
"lines": lines
|
||||
"lines": lines,
|
||||
"effects": _normalized_camp_conversation_effects(entry.get("effects", []))
|
||||
})
|
||||
return result
|
||||
|
||||
|
||||
func _normalized_camp_conversation_effects(source) -> Array:
|
||||
var result := []
|
||||
if typeof(source) != TYPE_ARRAY:
|
||||
return result
|
||||
for effect in source:
|
||||
if typeof(effect) != TYPE_DICTIONARY:
|
||||
continue
|
||||
var effect_type := str(effect.get("type", "")).strip_edges()
|
||||
if effect_type == "grant_item":
|
||||
var item_id := str(effect.get("item_id", effect.get("id", ""))).strip_edges()
|
||||
if item_id.is_empty():
|
||||
continue
|
||||
result.append({
|
||||
"type": "grant_item",
|
||||
"item_id": item_id,
|
||||
"count": maxi(1, int(effect.get("count", 1))),
|
||||
"text": str(effect.get("text", "")).strip_edges()
|
||||
})
|
||||
return result
|
||||
|
||||
|
||||
func _is_condition_shape_valid(condition) -> bool:
|
||||
return typeof(condition) == TYPE_DICTIONARY or typeof(condition) == TYPE_ARRAY
|
||||
|
||||
|
||||
Reference in New Issue
Block a user