feat: complete playtest parity improvements
This commit is contained in:
@@ -25,6 +25,26 @@ func test_catalog_table_resolution_is_deterministic_and_preserves_gold_items_and
|
||||
assert_true(item.has("quantity"))
|
||||
assert_gt(int(item.quantity), 0)
|
||||
|
||||
func test_multi_roll_reward_never_selects_the_same_item_id_twice() -> void:
|
||||
var table := {
|
||||
"rolls": 4,
|
||||
"entries": [
|
||||
{"item": "weapon_hunting_knife", "weight": 100},
|
||||
{"item": "consumable_bandage", "weight": 1, "min_qty": 2, "max_qty": 2},
|
||||
],
|
||||
}
|
||||
|
||||
var reward := LootResolverType.resolve(table, "NO-DUPLICATES", "chest")
|
||||
var ids: Array = (reward.items as Array).map(func(item: Dictionary) -> StringName: return StringName(item.item_id))
|
||||
var unique_ids := {}
|
||||
for item_id in ids:
|
||||
unique_ids[item_id] = true
|
||||
|
||||
assert_eq(ids.size(), unique_ids.size())
|
||||
assert_lte(ids.size(), 2)
|
||||
for item: Dictionary in reward.items:
|
||||
assert_eq(int(item.quantity), 2 if item.item_id == &"consumable_bandage" else 1, "Repeated rolls must not inflate quantity beyond the authored range.")
|
||||
|
||||
func test_world_chest_keeps_table_trap_lock_and_opened_state_and_stores_its_single_reward() -> void:
|
||||
var chest: WorldChest = WorldChestType.new({
|
||||
"loot_table_id": "floor1_reward",
|
||||
|
||||
Reference in New Issue
Block a user