feat: expand seasonal creature collection
This commit is contained in:
parent
925bbb79e5
commit
95c6b8b053
415 changed files with 1688 additions and 389 deletions
|
|
@ -2,6 +2,7 @@ class_name GatherableCatalog
|
|||
extends Resource
|
||||
|
||||
const GatherableDataType = preload("res://gathering/gatherable_data.gd")
|
||||
const CalendarSeasonType = preload("res://world/calendar_season.gd")
|
||||
|
||||
@export var entries: Array[GatherableDataType] = []
|
||||
|
||||
|
|
@ -15,9 +16,11 @@ func get_entry(type_id: StringName) -> GatherableDataType:
|
|||
return null
|
||||
|
||||
|
||||
func get_available_entries() -> Array[GatherableDataType]:
|
||||
func get_available_entries(
|
||||
season: int = CalendarSeasonType.UNKNOWN,
|
||||
) -> Array[GatherableDataType]:
|
||||
var available: Array[GatherableDataType] = []
|
||||
for entry: GatherableDataType in entries:
|
||||
if entry != null and entry.is_available():
|
||||
if entry != null and entry.is_available(season):
|
||||
available.append(entry)
|
||||
return available
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ extends Resource
|
|||
|
||||
const FishDataType = preload("res://fish/fish_data.gd")
|
||||
const FishQualityType = preload("res://fish/fish_quality.gd")
|
||||
const CalendarSeasonType = preload("res://world/calendar_season.gd")
|
||||
|
||||
enum PresentationMode {
|
||||
VISIBLE_CREATURE,
|
||||
|
|
@ -130,8 +131,13 @@ func get_respawn_delay(reason: StringName, rng: RandomNumberGenerator) -> float:
|
|||
return rng.randf_range(minimum_seconds, maximum_seconds)
|
||||
|
||||
|
||||
func is_available() -> bool:
|
||||
return catch_data != null and catch_data.active and is_valid()
|
||||
func is_available(season: int = CalendarSeasonType.UNKNOWN) -> bool:
|
||||
return (
|
||||
catch_data != null
|
||||
and catch_data.active
|
||||
and catch_data.is_available_in_season(season)
|
||||
and is_valid()
|
||||
)
|
||||
|
||||
|
||||
func _quality_multiplier(values: Array[float], quality: int) -> float:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue