feat: add paired goat care
This commit is contained in:
@@ -81,10 +81,10 @@ func get_animal_candidates(action_id: StringName) -> Array[Dictionary]:
|
||||
return candidates
|
||||
|
||||
|
||||
func get_animal_routine_sites(species_id: StringName) -> Array[Dictionary]:
|
||||
func get_animal_routine_sites(species_id: StringName, animal_id: StringName) -> Array[Dictionary]:
|
||||
var candidates: Array[Dictionary] = []
|
||||
for site in AnimalRoutineSite.get_all():
|
||||
if not site.supports_species(species_id):
|
||||
if not site.supports_animal(animal_id, species_id):
|
||||
continue
|
||||
(
|
||||
candidates
|
||||
|
||||
@@ -7,6 +7,7 @@ static var _all: Array[AnimalRoutineSite] = []
|
||||
@export var site_id: StringName
|
||||
@export var display_name := "Animal site"
|
||||
@export var species_id: StringName = SimulationIds.SPECIES_GOAT
|
||||
@export var resident_animal_id: StringName
|
||||
@export var debug_label_enabled := false
|
||||
|
||||
|
||||
@@ -48,6 +49,13 @@ func supports_species(candidate_species_id: StringName) -> bool:
|
||||
return candidate_species_id == species_id
|
||||
|
||||
|
||||
func supports_animal(candidate_animal_id: StringName, candidate_species_id: StringName) -> bool:
|
||||
return (
|
||||
supports_species(candidate_species_id)
|
||||
and (resident_animal_id.is_empty() or resident_animal_id == candidate_animal_id)
|
||||
)
|
||||
|
||||
|
||||
func get_routine_position() -> Vector3:
|
||||
return global_position
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ script = ExtResource("1_site")
|
||||
site_id = &"dunja_shelter"
|
||||
display_name = "Warm shelter"
|
||||
species_id = &"goat"
|
||||
resident_animal_id = &"goat_dunja"
|
||||
|
||||
[node name="DebugLabel" type="Label3D" parent="ShelterSite"]
|
||||
position = Vector3(0, 2.45, 0)
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
[gd_scene load_steps=13 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://world/animals/animal_routine_site.gd" id="1_site"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="Material_timber"]
|
||||
albedo_color = Color(0.39, 0.22, 0.11, 1)
|
||||
roughness = 0.96
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="Material_roof"]
|
||||
albedo_color = Color(0.48, 0.3, 0.2, 1)
|
||||
roughness = 0.98
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="Material_bowl"]
|
||||
albedo_color = Color(0.58, 0.31, 0.19, 1)
|
||||
roughness = 0.82
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="Material_straw"]
|
||||
albedo_color = Color(0.72, 0.54, 0.27, 1)
|
||||
roughness = 0.98
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="Material_glow"]
|
||||
shading_mode = 0
|
||||
albedo_color = Color(1, 0.65, 0.28, 0.9)
|
||||
emission_enabled = true
|
||||
emission = Color(1, 0.38, 0.1, 1)
|
||||
emission_energy_multiplier = 0.42
|
||||
|
||||
[sub_resource type="BoxMesh" id="Mesh_post"]
|
||||
material = SubResource("Material_timber")
|
||||
size = Vector3(0.18, 2.05, 0.18)
|
||||
|
||||
[sub_resource type="BoxMesh" id="Mesh_beam"]
|
||||
material = SubResource("Material_timber")
|
||||
size = Vector3(2.75, 0.16, 0.18)
|
||||
|
||||
[sub_resource type="BoxMesh" id="Mesh_roof"]
|
||||
material = SubResource("Material_roof")
|
||||
size = Vector3(1.65, 0.13, 2.55)
|
||||
|
||||
[sub_resource type="CylinderMesh" id="Mesh_bowl"]
|
||||
material = SubResource("Material_bowl")
|
||||
top_radius = 0.34
|
||||
bottom_radius = 0.27
|
||||
height = 0.13
|
||||
radial_segments = 12
|
||||
|
||||
[sub_resource type="BoxMesh" id="Mesh_straw"]
|
||||
material = SubResource("Material_straw")
|
||||
size = Vector3(1.65, 0.09, 1.15)
|
||||
|
||||
[sub_resource type="SphereMesh" id="Mesh_glow"]
|
||||
material = SubResource("Material_glow")
|
||||
radius = 0.08
|
||||
height = 0.13
|
||||
radial_segments = 8
|
||||
rings = 4
|
||||
|
||||
[node name="ZoraShelter" type="Node3D"]
|
||||
|
||||
[node name="Shelter" type="Node3D" parent="."]
|
||||
|
||||
[node name="PostFrontLeft" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(-1.18, 1.02, 2.2)
|
||||
mesh = SubResource("Mesh_post")
|
||||
|
||||
[node name="PostFrontRight" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(1.18, 1.02, 2.2)
|
||||
mesh = SubResource("Mesh_post")
|
||||
|
||||
[node name="PostBackLeft" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(-1.18, 1.02, 0.25)
|
||||
mesh = SubResource("Mesh_post")
|
||||
|
||||
[node name="PostBackRight" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(1.18, 1.02, 0.25)
|
||||
mesh = SubResource("Mesh_post")
|
||||
|
||||
[node name="FrontBeam" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(0, 2.02, 2.2)
|
||||
mesh = SubResource("Mesh_beam")
|
||||
|
||||
[node name="BackBeam" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(0, 2.02, 0.25)
|
||||
mesh = SubResource("Mesh_beam")
|
||||
|
||||
[node name="RoofLeft" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(-0.72, 2.31, 1.22)
|
||||
rotation_degrees = Vector3(0, 0, -19)
|
||||
mesh = SubResource("Mesh_roof")
|
||||
|
||||
[node name="RoofRight" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(0.72, 2.31, 1.22)
|
||||
rotation_degrees = Vector3(0, 0, 19)
|
||||
mesh = SubResource("Mesh_roof")
|
||||
|
||||
[node name="StrawBed" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(0, 0.05, 1.15)
|
||||
mesh = SubResource("Mesh_straw")
|
||||
|
||||
[node name="FeedBowl" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(-0.72, 0.08, 2.52)
|
||||
mesh = SubResource("Mesh_bowl")
|
||||
|
||||
[node name="Lantern" type="MeshInstance3D" parent="Shelter"]
|
||||
position = Vector3(0, 1.87, 2.1)
|
||||
mesh = SubResource("Mesh_glow")
|
||||
|
||||
[node name="ShelterSite" type="Marker3D" parent="."]
|
||||
position = Vector3(0, 0, 1.5)
|
||||
script = ExtResource("1_site")
|
||||
site_id = &"zora_shelter"
|
||||
display_name = "Zora's shelter"
|
||||
species_id = &"goat"
|
||||
resident_animal_id = &"goat_zora"
|
||||
|
||||
[node name="DebugLabel" type="Label3D" parent="ShelterSite"]
|
||||
position = Vector3(0, 2.45, 0)
|
||||
billboard = 1
|
||||
no_depth_test = true
|
||||
font_size = 20
|
||||
outline_size = 5
|
||||
modulate = Color(1, 0.72, 0.5, 1)
|
||||
pixel_size = 0.006
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=61 format=3]
|
||||
[gd_scene load_steps=62 format=3]
|
||||
|
||||
[ext_resource type="Terrain3DAssets" path="res://terrain/jajce/assets.tres" id="1_assets"]
|
||||
[ext_resource type="PackedScene" path="res://world/resource_nodes/ResourceNode.tscn" id="2_resource"]
|
||||
@@ -29,6 +29,7 @@
|
||||
[ext_resource type="PackedScene" path="res://world/jajce/ForestEdgeResourceCluster.tscn" id="27_forest_cluster"]
|
||||
[ext_resource type="PackedScene" path="res://world/animals/goat/cozy_goat.tscn" id="28_goat"]
|
||||
[ext_resource type="PackedScene" path="res://world/animals/goat/dunja_habitat.tscn" id="29_habitat"]
|
||||
[ext_resource type="PackedScene" path="res://world/animals/goat/zora_shelter.tscn" id="30_zora_shelter"]
|
||||
|
||||
[sub_resource type="Terrain3DMaterial" id="Terrain3DMaterial_jajce"]
|
||||
_shader_parameters = {
|
||||
@@ -466,11 +467,24 @@ phase = 4.4
|
||||
position = Vector3(0, 0, -15.5)
|
||||
rotation_degrees = Vector3(0, 150, 0)
|
||||
|
||||
[node name="Zora" parent="WorldObjects/Animals" instance=ExtResource("28_goat")]
|
||||
position = Vector3(-8, 0, -15.5)
|
||||
rotation_degrees = Vector3(0, 210, 0)
|
||||
scale = Vector3(0.92, 0.92, 0.92)
|
||||
animal_id = &"goat_zora"
|
||||
display_name = "Zora"
|
||||
initial_hunger = 42.0
|
||||
initial_routine_site_id = &"zora_shelter"
|
||||
initial_next_routine_tick = 12
|
||||
|
||||
[node name="AnimalHabitats" type="Node3D" parent="WorldObjects"]
|
||||
|
||||
[node name="DunjaHabitat" parent="WorldObjects/AnimalHabitats" instance=ExtResource("29_habitat")]
|
||||
position = Vector3(0, 0, -17)
|
||||
|
||||
[node name="ZoraShelter" parent="WorldObjects/AnimalHabitats" instance=ExtResource("30_zora_shelter")]
|
||||
position = Vector3(-8, 0, -17)
|
||||
|
||||
[node name="ResourceNodes" type="Node3D" parent="WorldObjects"]
|
||||
|
||||
[node name="BerryBush_01" parent="WorldObjects/ResourceNodes" instance=ExtResource("2_resource")]
|
||||
|
||||
Reference in New Issue
Block a user