Add synchronized time and weather systems
This commit is contained in:
parent
30ad9215ca
commit
58fb3d6605
37 changed files with 1900 additions and 17 deletions
10
fish/day_availability.tres
Normal file
10
fish/day_availability.tres
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[gd_resource type="Resource" load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://fish/fish_availability.gd" id="1_availability"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_availability")
|
||||
allow_day = true
|
||||
allow_night = false
|
||||
preferred_bait_tags = Array[StringName]([&"worm"])
|
||||
preferred_bait_weight_multiplier = 1.35
|
||||
|
|
@ -10,22 +10,35 @@ const FishingContextType = preload("res://fishing/fishing_context.gd")
|
|||
@export var allow_night: bool = true
|
||||
@export var require_rain: bool = false
|
||||
@export var forbid_rain: bool = false
|
||||
@export var require_fog: bool = false
|
||||
@export var forbid_fog: bool = false
|
||||
@export var required_bait_tags: Array[StringName] = []
|
||||
@export var preferred_bait_tags: Array[StringName] = []
|
||||
@export_range(0.01, 10.0, 0.01) var preferred_bait_weight_multiplier: float = 1.25
|
||||
|
||||
|
||||
func is_available(context: FishingContextType) -> bool:
|
||||
if context == null or (require_rain and forbid_rain):
|
||||
if (
|
||||
context == null
|
||||
or (require_rain and forbid_rain)
|
||||
or (require_fog and forbid_fog)
|
||||
):
|
||||
return false
|
||||
if context.is_night and not allow_night:
|
||||
if context.is_day_night_transition:
|
||||
if not allow_day and not allow_night:
|
||||
return false
|
||||
elif context.is_night and not allow_night:
|
||||
return false
|
||||
if not context.is_night and not allow_day:
|
||||
elif not context.is_night and not allow_day:
|
||||
return false
|
||||
if require_rain and not context.is_raining:
|
||||
return false
|
||||
if forbid_rain and context.is_raining:
|
||||
return false
|
||||
if require_fog and not context.is_foggy:
|
||||
return false
|
||||
if forbid_fog and context.is_foggy:
|
||||
return false
|
||||
if (
|
||||
not allowed_location_tags.is_empty()
|
||||
and not _has_any_match(allowed_location_tags, context.location_tags)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
[ext_resource type="Script" path="res://fish/fish_data.gd" id="1_fish_data"]
|
||||
[ext_resource type="Resource" path="res://fishing/common_catch_profile.tres" id="2_profile"]
|
||||
[ext_resource type="Resource" path="res://fish/default_availability.tres" id="3_availability"]
|
||||
[ext_resource type="Resource" path="res://fish/day_availability.tres" id="3_availability"]
|
||||
[ext_resource type="Texture2D" path="res://fish/species/bluegill/fish_bluegill.png" id="4_texture"]
|
||||
|
||||
[resource]
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
[sub_resource type="Resource" id="BlueCatfishAvailability"]
|
||||
script = ExtResource("3_availability_script")
|
||||
allowed_location_tags = Array[StringName]([&"starter_pond"])
|
||||
allow_day = false
|
||||
allow_night = true
|
||||
preferred_bait_tags = Array[StringName]([&"worm", &"minnow"])
|
||||
preferred_bait_weight_multiplier = 1.35
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
[sub_resource type="Resource" id="ChannelCatfishAvailability"]
|
||||
script = ExtResource("3_availability_script")
|
||||
allowed_location_tags = Array[StringName]([&"starter_pond"])
|
||||
allow_day = false
|
||||
allow_night = true
|
||||
preferred_bait_tags = Array[StringName]([&"worm"])
|
||||
preferred_bait_weight_multiplier = 1.35
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
[sub_resource type="Resource" id="FlatheadCatfishAvailability"]
|
||||
script = ExtResource("3_availability_script")
|
||||
allowed_location_tags = Array[StringName]([&"starter_pond"])
|
||||
allow_day = false
|
||||
allow_night = true
|
||||
preferred_bait_tags = Array[StringName]([&"worm", &"minnow"])
|
||||
preferred_bait_weight_multiplier = 1.35
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
[sub_resource type="Resource" id="WhiteCatfishAvailability"]
|
||||
script = ExtResource("3_availability_script")
|
||||
allowed_location_tags = Array[StringName]([&"starter_pond"])
|
||||
allow_day = false
|
||||
allow_night = true
|
||||
preferred_bait_tags = Array[StringName]([&"worm"])
|
||||
preferred_bait_weight_multiplier = 1.35
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
[ext_resource type="Script" path="res://fish/fish_data.gd" id="1_fish_data"]
|
||||
[ext_resource type="Resource" path="res://fishing/common_catch_profile.tres" id="2_profile"]
|
||||
[ext_resource type="Resource" path="res://fish/default_availability.tres" id="3_availability"]
|
||||
[ext_resource type="Resource" path="res://fish/day_availability.tres" id="3_availability"]
|
||||
[ext_resource type="Texture2D" path="res://fish/species/sunfish/fish_sunfish.png" id="4_texture"]
|
||||
|
||||
[resource]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue