Activate full fish catalog
This commit is contained in:
parent
5ed4cccf76
commit
bb75121dcd
321 changed files with 1611 additions and 706 deletions
|
|
@ -49,20 +49,20 @@ func _run() -> void:
|
|||
assert(not hotbar.visible)
|
||||
|
||||
var entry_buttons: Dictionary = logbook.get("_entry_buttons")
|
||||
assert(entry_buttons.size() == 26)
|
||||
assert(entry_buttons.size() == 108)
|
||||
await _capture_if_requested("-unknown")
|
||||
logbook.call(
|
||||
"_select_category", WaterType.Type.FRESH_WATER
|
||||
)
|
||||
await create_timer(0.25).timeout
|
||||
assert((logbook.get("_entry_buttons") as Dictionary).size() == 26)
|
||||
assert((logbook.get("_entry_buttons") as Dictionary).size() == 108)
|
||||
await _capture_if_requested("-fresh")
|
||||
logbook.call("_select_category", WaterType.Type.SALT_WATER)
|
||||
await create_timer(0.25).timeout
|
||||
assert((logbook.get("_entry_buttons") as Dictionary).size() == 34)
|
||||
assert((logbook.get("_entry_buttons") as Dictionary).size() == 202)
|
||||
logbook.call("_select_category", WaterType.Type.FRESH_WATER)
|
||||
await create_timer(0.25).timeout
|
||||
assert((logbook.get("_entry_buttons") as Dictionary).size() == 26)
|
||||
assert((logbook.get("_entry_buttons") as Dictionary).size() == 108)
|
||||
player.collection_log.mark_discovered(&"bluegill")
|
||||
await process_frame
|
||||
logbook.call("_select_entry", &"bluegill", &"bluegill")
|
||||
|
|
@ -110,11 +110,24 @@ func _validate_save_round_trip(
|
|||
assert(catalog != null)
|
||||
assert(catalog.candidates.size() == 316)
|
||||
var active_species := LogbookCatalog.ordered_species(catalog.candidates)
|
||||
assert(active_species.size() == 63)
|
||||
# This test intentionally round-trips one catch for every active species.
|
||||
# Give the fixture enough combined capacity, then bypass per-catch carried
|
||||
# inventory admission while constructing it. The inventory layout still
|
||||
# reconciles and persists the resulting placements.
|
||||
assert(active_species.size() == 313)
|
||||
# Keep this runtime save fixture within maximum player capacity while the
|
||||
# focused catalog validation exercises every active species individually.
|
||||
var round_trip_species: Array[FishData] = []
|
||||
for fish: FishData in active_species:
|
||||
if round_trip_species.size() >= 59:
|
||||
break
|
||||
round_trip_species.append(fish)
|
||||
for fish_id: StringName in [
|
||||
&"catfish_blue",
|
||||
&"catfish_channel",
|
||||
&"catfish_flathead",
|
||||
&"catfish_white",
|
||||
]:
|
||||
var catfish: FishData = catalog.get_fish_by_id(fish_id)
|
||||
if catfish not in round_trip_species:
|
||||
round_trip_species.append(catfish)
|
||||
assert(round_trip_species.size() == 63)
|
||||
player.inventory_layout.restore_backpack_level(
|
||||
PlayerInventoryLayout.MAX_BACKPACK_LEVEL
|
||||
)
|
||||
|
|
@ -126,7 +139,7 @@ func _validate_save_round_trip(
|
|||
assert(player.cooler_capacity.get_level() == PlayerCoolerCapacity.MAX_LEVEL)
|
||||
player.inventory.set_inventory_layout(null)
|
||||
for index: int in 4:
|
||||
_add_test_catch(player, active_species[index])
|
||||
_add_test_catch(player, round_trip_species[index])
|
||||
assert(save_manager.save_now())
|
||||
var no_catches: Array[FishCatch] = []
|
||||
var no_discoveries: Array[StringName] = []
|
||||
|
|
@ -135,18 +148,21 @@ func _validate_save_round_trip(
|
|||
assert(save_manager.load_player_data())
|
||||
assert(player.inventory.get_all_catches().size() == 4)
|
||||
for index: int in 4:
|
||||
var original_fish: FishData = active_species[index]
|
||||
var original_fish: FishData = round_trip_species[index]
|
||||
assert(player.inventory.get_count(original_fish.id) == 1)
|
||||
assert(player.collection_log.has_discovered(original_fish.id))
|
||||
|
||||
for index: int in range(4, active_species.size()):
|
||||
_add_test_catch(player, active_species[index])
|
||||
for index: int in range(4, round_trip_species.size()):
|
||||
_add_test_catch(player, round_trip_species[index])
|
||||
assert(save_manager.save_now())
|
||||
assert(player.inventory.replace_all_catches(no_catches, 1))
|
||||
assert(player.collection_log.replace_discovered_ids(no_discoveries))
|
||||
assert(save_manager.load_player_data())
|
||||
assert(player.inventory.get_all_catches().size() == 63)
|
||||
for fish: FishData in active_species:
|
||||
assert(
|
||||
player.inventory.get_all_catches().size()
|
||||
== round_trip_species.size()
|
||||
)
|
||||
for fish: FishData in round_trip_species:
|
||||
assert(player.inventory.get_count(fish.id) == 1)
|
||||
assert(player.collection_log.has_discovered(fish.id))
|
||||
for fish_id: StringName in [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue