feat: complete playtest parity improvements

This commit is contained in:
goose
2026-10-08 19:06:19 -04:00
parent cce25a1908
commit eca098b4b9
139 changed files with 3001 additions and 982 deletions
+8 -2
View File
@@ -10,15 +10,21 @@ static func resolve(table: Dictionary, seed: String, context: String = "") -> Di
var items: Array[Dictionary] = []
var gold := 0
var entries: Array = table.get("entries", [])
var selected_item_ids: Dictionary[StringName, bool] = {}
var rolls := maxi(0, int(table.get("rolls", 0)))
for _roll in range(rolls):
var entry := _choose_entry(entries, rng)
var eligible_entries := entries.filter(func(value) -> bool:
return not (value is Dictionary and value.has("item") and selected_item_ids.has(StringName(value.item)))
)
var entry := _choose_entry(eligible_entries, rng)
if entry.is_empty():
continue
if bool(entry.get("gold", false)):
gold += _range_value(entry, "min_gold", "max_gold", rng)
elif entry.has("item"):
_append_item(items, StringName(entry.item), _range_value(entry, "min_qty", "max_qty", rng, 1))
var item_id := StringName(entry.item)
selected_item_ids[item_id] = true
_append_item(items, item_id, _range_value(entry, "min_qty", "max_qty", rng, 1))
return {
"items": items,
"gold": gold,