Activate full fish catalog
This commit is contained in:
parent
5ed4cccf76
commit
bb75121dcd
321 changed files with 1611 additions and 706 deletions
|
|
@ -37,6 +37,18 @@ const PelicanBuyer = preload("res://economy/buyers/pelicans.tres")
|
|||
const StarterRegionScene = preload(
|
||||
"res://world/regions/starter_island_region.tscn"
|
||||
)
|
||||
const SharedFishPlaceholder: Texture2D = preload(
|
||||
"res://art/exported/creatures/fish_placeholder.png"
|
||||
)
|
||||
|
||||
const ACTIVE_CATALOG_COUNT: int = 313
|
||||
const INACTIVE_CATALOG_COUNT: int = 3
|
||||
const FISHING_SPECIES_COUNT: int = 310
|
||||
const GENERATED_POND_COUNT: int = 33
|
||||
const GENERATED_LAKE_COUNT: int = 20
|
||||
const GENERATED_RIVER_COUNT: int = 53
|
||||
const STARTER_POND_COUNT: int = 106
|
||||
const OCEAN_COUNT: int = 204
|
||||
|
||||
const ORIGINAL_IDS: Array[StringName] = [
|
||||
&"bluegill", &"bass", &"carp", &"sunfish",
|
||||
|
|
@ -82,23 +94,6 @@ const NEW_FRESH_WATER_IDS: Array[StringName] = [
|
|||
&"bowfin", &"sturgeon_lake", &"gar_longnose", &"paddlefish",
|
||||
&"sturgeon_shovelnose", &"gar_spotted", &"lungfish_west_african",
|
||||
]
|
||||
const GENERATED_POND_IDS: Array[StringName] = [
|
||||
&"bowfin", &"gar_spotted", &"lungfish_west_african",
|
||||
&"catfish_channel", &"catfish_white", &"carp",
|
||||
&"goldfish_bubbleeye", &"goldfish", &"bluegill",
|
||||
]
|
||||
const GENERATED_LAKE_IDS: Array[StringName] = [
|
||||
&"sturgeon_lake", &"trout_golden", &"chub_lake", &"saugeye",
|
||||
&"walleye", &"goby_round",
|
||||
]
|
||||
const GENERATED_RIVER_IDS: Array[StringName] = [
|
||||
&"gar_longnose", &"paddlefish", &"sturgeon_shovelnose",
|
||||
&"trout_cutthroat", &"trout_rainbow", &"catfish_blue",
|
||||
&"catfish_flathead", &"chub_european", &"chub_flame", &"sauger",
|
||||
&"trout_steelhead",
|
||||
]
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
call_deferred("_run")
|
||||
|
||||
|
|
@ -115,21 +110,35 @@ func _run() -> void:
|
|||
|
||||
|
||||
func _validate_generated_habitat_pools() -> void:
|
||||
var expected_by_pool: Dictionary = {
|
||||
GeneratedPondPool: GENERATED_POND_IDS,
|
||||
GeneratedLakePool: GENERATED_LAKE_IDS,
|
||||
GeneratedRiverPool: GENERATED_RIVER_IDS,
|
||||
var expected_counts: Dictionary = {
|
||||
GeneratedPondPool: GENERATED_POND_COUNT,
|
||||
GeneratedLakePool: GENERATED_LAKE_COUNT,
|
||||
GeneratedRiverPool: GENERATED_RIVER_COUNT,
|
||||
}
|
||||
for pool: FishPoolType in expected_by_pool:
|
||||
var expected_ids: Array[StringName] = expected_by_pool[pool]
|
||||
assert(pool.candidates.size() == expected_ids.size())
|
||||
for fish_id: StringName in expected_ids:
|
||||
var fish: FishDataType = Catalog.get_fish_by_id(fish_id)
|
||||
var freshwater_ids: Dictionary[StringName, bool] = {}
|
||||
for pool: FishPoolType in expected_counts:
|
||||
assert(pool.candidates.size() == int(expected_counts[pool]))
|
||||
for fish: FishDataType in pool.candidates:
|
||||
assert(fish != null and fish.is_fishable())
|
||||
assert(pool.get_fish_by_id(fish_id) == fish)
|
||||
assert(not freshwater_ids.has(fish.id))
|
||||
freshwater_ids[fish.id] = true
|
||||
assert(fish.is_allowed_in_water(WaterType.Type.FRESH_WATER))
|
||||
assert(GeneratedPondPool.get_fish_by_id(&"pomfret_white") == null)
|
||||
assert(GeneratedPondPool.get_fish_by_id(&"mackerel_atlantic") == null)
|
||||
assert(freshwater_ids.size() == STARTER_POND_COUNT)
|
||||
assert(PondPool.candidates.size() == STARTER_POND_COUNT)
|
||||
for fish: FishDataType in PondPool.candidates:
|
||||
assert(freshwater_ids.has(fish.id))
|
||||
assert(OceanPool.candidates.size() == OCEAN_COUNT)
|
||||
var ocean_ids: Dictionary[StringName, bool] = {}
|
||||
for fish: FishDataType in OceanPool.candidates:
|
||||
assert(fish != null and fish.is_fishable())
|
||||
assert(not ocean_ids.has(fish.id))
|
||||
ocean_ids[fish.id] = true
|
||||
assert(fish.is_allowed_in_water(WaterType.Type.SALT_WATER))
|
||||
for fish: FishDataType in Catalog.candidates:
|
||||
if not fish.is_fishable():
|
||||
continue
|
||||
assert(freshwater_ids.has(fish.id) != ocean_ids.has(fish.id))
|
||||
assert(freshwater_ids.size() + ocean_ids.size() == FISHING_SPECIES_COUNT)
|
||||
assert(GeneratedPondPool.get_fish_by_id(&"gar_longnose") == null)
|
||||
assert(GeneratedRiverPool.get_fish_by_id(&"gar_longnose") != null)
|
||||
assert(GeneratedRiverPool.get_fish_by_id(&"goby_round") == null)
|
||||
|
|
@ -143,7 +152,7 @@ func _validate_weight_based_display_scale() -> void:
|
|||
continue
|
||||
assert(fish.is_selectable())
|
||||
assert(fish.weight_min_lb > 0.0)
|
||||
assert(fish.weight_max_lb <= 1000.0)
|
||||
assert(fish.weight_max_lb <= 500000.0)
|
||||
var minimum_scale: float = fish.get_display_scale_for_weight(
|
||||
fish.weight_min_lb
|
||||
)
|
||||
|
|
@ -172,10 +181,11 @@ func _validate_weight_based_display_scale() -> void:
|
|||
|
||||
func _validate_catalog_and_pools() -> void:
|
||||
assert(Catalog.candidates.size() == 316)
|
||||
assert(PondPool.candidates.size() == 26)
|
||||
assert(OceanPool.candidates.size() == 34)
|
||||
assert(PondPool.candidates.size() == STARTER_POND_COUNT)
|
||||
assert(OceanPool.candidates.size() == OCEAN_COUNT)
|
||||
var active_count: int = 0
|
||||
var inactive_count: int = 0
|
||||
var fishing_count: int = 0
|
||||
var catalog_numbers: Dictionary[int, bool] = {}
|
||||
for fish: FishDataType in Catalog.candidates:
|
||||
assert(fish != null and not fish.id.is_empty())
|
||||
|
|
@ -194,8 +204,13 @@ func _validate_catalog_and_pools() -> void:
|
|||
inactive_count += 1
|
||||
assert(not fish.is_selectable())
|
||||
assert(fish.display_texture == null)
|
||||
assert(active_count == 63)
|
||||
assert(inactive_count == 253)
|
||||
if fish.collection_method == FishDataType.CollectionMethod.FISHING:
|
||||
fishing_count += 1
|
||||
assert(fish.active)
|
||||
assert(fish.display_texture == SharedFishPlaceholder)
|
||||
assert(active_count == ACTIVE_CATALOG_COUNT)
|
||||
assert(inactive_count == INACTIVE_CATALOG_COUNT)
|
||||
assert(fishing_count == FISHING_SPECIES_COUNT)
|
||||
var chum: FishDataType = Catalog.get_fish_by_id(&"salmon_chum")
|
||||
assert(chum != null)
|
||||
assert(chum.get_season_text() == "fall")
|
||||
|
|
@ -233,12 +248,12 @@ func _validate_catalog_and_pools() -> void:
|
|||
) == chum
|
||||
)
|
||||
seasonal_collection.free()
|
||||
var inactive_fish: FishDataType = Catalog.get_fish_by_id(&"mudskipper_atlantic")
|
||||
var inactive_fish: FishDataType = Catalog.get_fish_by_id(&"crab_blue")
|
||||
assert(inactive_fish != null and not inactive_fish.active)
|
||||
var inactive_pool := FishPoolType.new()
|
||||
inactive_pool.candidates = [inactive_fish]
|
||||
var inactive_context := FishingContextType.new()
|
||||
inactive_context.water_type = WaterType.Type.FRESH_WATER
|
||||
inactive_context.water_type = WaterType.Type.SALT_WATER
|
||||
var inactive_collection := CollectionLogType.new()
|
||||
var inactive_selector := FishSelectorType.new()
|
||||
inactive_selector.use_deterministic_test_seed = true
|
||||
|
|
@ -424,11 +439,15 @@ func _validate_authoritative_water_filter() -> void:
|
|||
ocean_region.location_tags = [&"coast", &"ocean"]
|
||||
var stale_salt_pool_region := FishableWaterRegion.new()
|
||||
stale_salt_pool_region.water_type = WaterType.Type.FRESH_WATER
|
||||
stale_salt_pool_region.fish_pool = OceanPool
|
||||
var salt_only_pool := FishPoolType.new()
|
||||
salt_only_pool.candidates = [Catalog.get_fish_by_id(&"bass")]
|
||||
stale_salt_pool_region.fish_pool = salt_only_pool
|
||||
stale_salt_pool_region.location_tags = [&"starter_pond"]
|
||||
var stale_fresh_pool_region := FishableWaterRegion.new()
|
||||
stale_fresh_pool_region.water_type = WaterType.Type.SALT_WATER
|
||||
stale_fresh_pool_region.fish_pool = PondPool
|
||||
var fresh_only_pool := FishPoolType.new()
|
||||
fresh_only_pool.candidates = [Catalog.get_fish_by_id(&"bluegill")]
|
||||
stale_fresh_pool_region.fish_pool = fresh_only_pool
|
||||
stale_fresh_pool_region.location_tags = [&"coast", &"ocean"]
|
||||
var evidence := {"discovered_fish_ids": []}
|
||||
assert(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue