Add networked crab gathering prototype
This commit is contained in:
parent
f55663c105
commit
a62cce6404
56 changed files with 2692 additions and 56 deletions
|
|
@ -24,6 +24,17 @@ enum Rarity {
|
|||
LEGENDARY,
|
||||
}
|
||||
|
||||
enum CollectionMethod {
|
||||
FISHING,
|
||||
NET,
|
||||
DIGGING,
|
||||
}
|
||||
|
||||
enum LogbookSection {
|
||||
AUTOMATIC,
|
||||
SHELLFISH,
|
||||
}
|
||||
|
||||
@export var id: StringName
|
||||
@export var display_name: String
|
||||
@export_category("Developer Catalog")
|
||||
|
|
@ -32,6 +43,9 @@ enum Rarity {
|
|||
@export_range(1, 999999, 1) var catalog_number: int = 1
|
||||
@export var collection_group: StringName
|
||||
@export_multiline var logbook_fact: String
|
||||
@export var collection_method: CollectionMethod = CollectionMethod.FISHING
|
||||
@export var logbook_section: LogbookSection = LogbookSection.AUTOMATIC
|
||||
@export var habitat_label: String = ""
|
||||
@export_category("Fishing")
|
||||
@export_flags("Fresh Water", "Salt Water")
|
||||
var allowed_water_types: int = WaterType.ALL_FISHABLE_MASK
|
||||
|
|
@ -53,9 +67,12 @@ var allowed_water_types: int = WaterType.ALL_FISHABLE_MASK
|
|||
|
||||
|
||||
func is_selectable() -> bool:
|
||||
return active and is_valid_catalog_entry()
|
||||
|
||||
|
||||
func is_valid_catalog_entry() -> bool:
|
||||
return (
|
||||
active
|
||||
and not id.is_empty()
|
||||
not id.is_empty()
|
||||
and base_catch_weight > 0.0
|
||||
and catch_profile != null
|
||||
and weight_min_lb > 0.0
|
||||
|
|
@ -69,6 +86,16 @@ func is_selectable() -> bool:
|
|||
)
|
||||
|
||||
|
||||
func is_fishable() -> bool:
|
||||
return is_selectable() and collection_method == CollectionMethod.FISHING
|
||||
|
||||
|
||||
func get_habitat_label() -> String:
|
||||
if not habitat_label.strip_edges().is_empty():
|
||||
return habitat_label.strip_edges().to_lower()
|
||||
return WaterType.label(get_primary_water_type()).to_lower()
|
||||
|
||||
|
||||
func is_allowed_in_water(type: WaterType.Type) -> bool:
|
||||
return (allowed_water_types & WaterType.mask_for(type)) != 0
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ func select_fish(
|
|||
var weights: Array[float] = []
|
||||
var total_weight: float = 0.0
|
||||
for fish: FishDataType in pool.candidates:
|
||||
if fish == null or not fish.is_selectable():
|
||||
if fish == null or not fish.is_fishable():
|
||||
continue
|
||||
if not fish.is_allowed_in_water(context.water_type):
|
||||
continue
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -16,6 +16,9 @@ active = false
|
|||
catalog_number = 3902
|
||||
collection_group = &"Marine crabs"
|
||||
logbook_fact = "blue crabs swim with flattened rear legs shaped like paddles. bright blue claws and an olive shell conceal a quick, defensive temperament."
|
||||
collection_method = 1
|
||||
logbook_section = 1
|
||||
habitat_label = "shallow coastal water"
|
||||
allowed_water_types = 2
|
||||
rarity = 0
|
||||
base_catch_weight = 1.15
|
||||
|
|
|
|||
BIN
fish/species/crab_brown/crab_brown.png
Normal file
BIN
fish/species/crab_brown/crab_brown.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
40
fish/species/crab_brown/crab_brown.png.import
Normal file
40
fish/species/crab_brown/crab_brown.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dmn3rafvxtnb1"
|
||||
path="res://.godot/imported/crab_brown.png-4241f8408bf426d406e45f4cce16bbc8.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://fish/species/crab_brown/crab_brown.png"
|
||||
dest_files=["res://.godot/imported/crab_brown.png-4241f8408bf426d406e45f4cce16bbc8.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
27
fish/species/crab_brown/crab_brown.tres
Normal file
27
fish/species/crab_brown/crab_brown.tres
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
[gd_resource type="Resource" script_class="FishData" load_steps=4 format=3]
|
||||
|
||||
[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="Texture2D" path="res://fish/species/crab_brown/crab_brown.png" id="3_texture"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_fish_data")
|
||||
id = &"crab_brown"
|
||||
display_name = "brown crab"
|
||||
active = true
|
||||
catalog_number = 3906
|
||||
collection_group = &"Marine crabs"
|
||||
logbook_fact = "brown crabs hide among rocks and sand along sheltered coasts. broad claws help them feed on shellfish and other small shore animals."
|
||||
collection_method = 1
|
||||
logbook_section = 1
|
||||
habitat_label = "dry beach sand"
|
||||
allowed_water_types = 2
|
||||
rarity = 0
|
||||
base_catch_weight = 1.0
|
||||
catch_profile = ExtResource("2_profile")
|
||||
weight_min_lb = 0.5
|
||||
weight_max_lb = 3.0
|
||||
sell_value_min = 5
|
||||
sell_value_max = 15
|
||||
sell_value_curve = 1.0
|
||||
display_texture = ExtResource("3_texture")
|
||||
|
|
@ -17,6 +17,9 @@ active = false
|
|||
catalog_number = 3903
|
||||
collection_group = &"Marine crabs"
|
||||
logbook_fact = "dungeness crabs bury beneath sand with only their eyes and antennae exposed. broad toothed shells protect them along cool pacific coasts."
|
||||
collection_method = 1
|
||||
logbook_section = 1
|
||||
habitat_label = "shallow coastal sand"
|
||||
allowed_water_types = 2
|
||||
rarity = 1
|
||||
base_catch_weight = 0.65
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ active = false
|
|||
catalog_number = 3901
|
||||
collection_group = &"Marine crabs"
|
||||
logbook_fact = "atlantic ghost crabs dash across beaches on long pale legs and retreat into deep burrows. raised eyes scan nearly every direction."
|
||||
collection_method = 1
|
||||
logbook_section = 1
|
||||
habitat_label = "dry beach sand"
|
||||
allowed_water_types = 2
|
||||
rarity = 2
|
||||
base_catch_weight = 0.28
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue