Add starter RV progression and fishing feedback
This commit is contained in:
parent
eed361681a
commit
d8bf59bca0
47 changed files with 2268 additions and 467 deletions
|
|
@ -1,2 +1,10 @@
|
|||
class_name DecorShopInteraction
|
||||
extends FishingShopInteraction
|
||||
|
||||
const DECOR_DIALOGUE_TEXT: String = (
|
||||
"You gonna decorate that hot box or what? I've got some new decor in, take a look."
|
||||
)
|
||||
|
||||
|
||||
func get_dialogue_text(_home_tier: int = -1) -> String:
|
||||
return DECOR_DIALOGUE_TEXT
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ extends Area3D
|
|||
|
||||
signal local_player_range_changed(in_range: bool)
|
||||
|
||||
const DIALOGUE_TEXT: String = (
|
||||
"Listen, you may suck at fishing but I've got some things that might help."
|
||||
)
|
||||
|
||||
@export_node_path("Node3D") var look_character_path: NodePath = ^"../Shopkeeper"
|
||||
|
||||
var _local_player: Player
|
||||
|
|
@ -37,6 +41,10 @@ func is_avatar_in_range(avatar: Player) -> bool:
|
|||
)
|
||||
|
||||
|
||||
func get_dialogue_text(_home_tier: int = -1) -> String:
|
||||
return DIALOGUE_TEXT
|
||||
|
||||
|
||||
func get_prompt_anchor_position() -> Vector3:
|
||||
if _look_character != null:
|
||||
return _look_character.get_head_anchor_position()
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ const PlayerStorageInteractionType = preload(
|
|||
const DecorShopInteractionType = preload(
|
||||
"res://world/decor_shop_interaction.gd"
|
||||
)
|
||||
const RVUpgradeInteractionType = preload(
|
||||
"res://world/rv_upgrade_interaction.gd"
|
||||
)
|
||||
const PrecipitationOcclusionType = preload(
|
||||
"res://world/environment/precipitation_occlusion.gd"
|
||||
)
|
||||
|
|
@ -52,6 +55,8 @@ const WATER_RECOVERY_FOOTPRINT_RADIUS := 0.6
|
|||
const WATER_RECOVERY_INSET_STEP := 0.25
|
||||
const WATER_RECOVERY_MAXIMUM_INSET := 1.5
|
||||
const WATER_RECOVERY_SEARCH_EXPANSIONS: Array[float] = [1.5, 4.0, 12.0]
|
||||
const HOME_GROUND_HEIGHT_TOLERANCE := 0.5
|
||||
const HOME_ELEVATION_HEIGHT_TOLERANCE := 0.6
|
||||
const PROP_SURFACE_SAMPLE_DIRECTIONS: Array[Vector2] = [
|
||||
Vector2(1.0, 0.0),
|
||||
Vector2(0.70710678, 0.70710678),
|
||||
|
|
@ -86,9 +91,13 @@ const PROCEDURAL_PROP_GROUPS: Array[StringName] = [
|
|||
@onready var _decor_shop: DecorShopInteractionType = (
|
||||
$Interactables/DecorShopWorld/InteractionArea
|
||||
)
|
||||
@onready var _rv_upgrade_shop: RVUpgradeInteractionType = (
|
||||
$Interactables/RVUpgradeShopWorld/InteractionArea
|
||||
)
|
||||
@onready var _shop_root: Node3D = %FishingShopWorld
|
||||
@onready var _storage_root: Node3D = %PlayerStorageBox
|
||||
@onready var _decor_shop_root: Node3D = %DecorShopWorld
|
||||
@onready var _rv_upgrade_shop_root: Node3D = %RVUpgradeShopWorld
|
||||
@onready var _decorations: Node3D = %Decorations
|
||||
@onready var _tree_anchors: GatherableAnchorSet3D = %ReachableTreeTrunks
|
||||
@onready var _diggable_beach: DiggableArea3D = %DiggableBeach
|
||||
|
|
@ -104,6 +113,7 @@ var _placed_prop_groups: Array[StringName] = []
|
|||
var _placed_group_coordinates: Dictionary[StringName, Array] = {}
|
||||
var _biome_assignments: Dictionary[Vector2i, StringName] = {}
|
||||
var _water_recovery_triangles_by_coordinate: Dictionary[Vector2i, Array] = {}
|
||||
var _home_accessible_elevations_by_coordinate: Dictionary[Vector2i, Array] = {}
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
|
@ -159,6 +169,10 @@ func get_decor_shop() -> DecorShopInteractionType:
|
|||
return _decor_shop
|
||||
|
||||
|
||||
func get_rv_upgrade_shop() -> RVUpgradeInteractionType:
|
||||
return _rv_upgrade_shop
|
||||
|
||||
|
||||
func get_saltwater_shoreline_mesh() -> MeshInstance3D:
|
||||
return _shoreline_reference
|
||||
|
||||
|
|
@ -184,6 +198,7 @@ func get_spawn_surface_triangles(
|
|||
material_names: Array[StringName],
|
||||
minimum_global_y: float,
|
||||
minimum_up_dot: float = 0.6,
|
||||
maximum_global_y: float = 100.0,
|
||||
) -> Array[PackedVector3Array]:
|
||||
var triangles: Array[PackedVector3Array] = []
|
||||
if material_names.is_empty():
|
||||
|
|
@ -204,10 +219,27 @@ func get_spawn_surface_triangles(
|
|||
mesh.surface_get_arrays(surface_index),
|
||||
minimum_global_y,
|
||||
minimum_up_dot,
|
||||
maximum_global_y,
|
||||
)
|
||||
return triangles
|
||||
|
||||
|
||||
func is_home_exterior_position_accessible(position: Vector3) -> bool:
|
||||
var local_position := _generator.to_local(position)
|
||||
if local_position.y <= HOME_GROUND_HEIGHT_TOLERANCE:
|
||||
return true
|
||||
var coordinate := _generator.coordinate_for_local_position(local_position)
|
||||
for value: Variant in _home_accessible_elevations_by_coordinate.get(
|
||||
coordinate,
|
||||
[],
|
||||
):
|
||||
if absf(local_position.y - float(value)) <= (
|
||||
HOME_ELEVATION_HEIGHT_TOLERANCE
|
||||
):
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func get_water_recovery_position(
|
||||
entry_position: Vector3,
|
||||
fallback_position: Vector3,
|
||||
|
|
@ -242,6 +274,7 @@ func get_water_recovery_position(
|
|||
func _on_generation_completed(summary: Dictionary) -> void:
|
||||
_diggable_beach.invalidate_surface_cache()
|
||||
var records: Array[Dictionary] = _generator.placement_records()
|
||||
_cache_home_accessible_elevations(records)
|
||||
_assign_biomes(records, summary)
|
||||
var spawn_position := Vector3.ZERO
|
||||
_clear_children(_decorations)
|
||||
|
|
@ -388,6 +421,97 @@ func _on_generation_completed(summary: Dictionary) -> void:
|
|||
world_generated.emit(_current_seed, summary)
|
||||
|
||||
|
||||
func _cache_home_accessible_elevations(
|
||||
records: Array[Dictionary],
|
||||
) -> void:
|
||||
_home_accessible_elevations_by_coordinate.clear()
|
||||
var records_by_coordinate: Dictionary[Vector2i, Dictionary] = {}
|
||||
var elevation_tiers: Dictionary[int, bool] = {}
|
||||
for record: Dictionary in records:
|
||||
var coordinate: Vector2i = record.get(
|
||||
"coordinate",
|
||||
Vector2i(-1, -1),
|
||||
)
|
||||
records_by_coordinate[coordinate] = record
|
||||
for tier: int in _elevation_tiers_for_tags(
|
||||
record.get("tags", PackedStringArray())
|
||||
):
|
||||
elevation_tiers[tier] = true
|
||||
var visited: Dictionary[String, bool] = {}
|
||||
for tier: int in elevation_tiers:
|
||||
var elevation_tag := "elevation_%d" % tier
|
||||
for coordinate: Vector2i in records_by_coordinate:
|
||||
var visit_key := _home_elevation_visit_key(coordinate, tier)
|
||||
if visited.has(visit_key):
|
||||
continue
|
||||
var record: Dictionary = records_by_coordinate[coordinate]
|
||||
var tags: PackedStringArray = record.get(
|
||||
"tags",
|
||||
PackedStringArray(),
|
||||
)
|
||||
if elevation_tag not in tags:
|
||||
continue
|
||||
var component: Array[Vector2i] = []
|
||||
var pending: Array[Vector2i] = [coordinate]
|
||||
var has_ramp := false
|
||||
while not pending.is_empty():
|
||||
var current: Vector2i = pending.pop_back()
|
||||
var current_key := _home_elevation_visit_key(current, tier)
|
||||
if visited.has(current_key):
|
||||
continue
|
||||
var current_record: Dictionary = records_by_coordinate.get(
|
||||
current,
|
||||
{},
|
||||
)
|
||||
var current_tags: PackedStringArray = current_record.get(
|
||||
"tags",
|
||||
PackedStringArray(),
|
||||
)
|
||||
if elevation_tag not in current_tags:
|
||||
continue
|
||||
visited[current_key] = true
|
||||
component.append(current)
|
||||
has_ramp = has_ramp or "ramp" in current_tags
|
||||
for offset: Vector2i in [
|
||||
Vector2i.LEFT,
|
||||
Vector2i.RIGHT,
|
||||
Vector2i.UP,
|
||||
Vector2i.DOWN,
|
||||
]:
|
||||
pending.append(current + offset)
|
||||
if not has_ramp:
|
||||
continue
|
||||
var surface_height := (
|
||||
float(tier - 1) * _generator.elevated_cliff_level_height
|
||||
)
|
||||
for component_coordinate: Vector2i in component:
|
||||
var heights: Array = (
|
||||
_home_accessible_elevations_by_coordinate.get(
|
||||
component_coordinate,
|
||||
[],
|
||||
)
|
||||
)
|
||||
heights.append(surface_height)
|
||||
_home_accessible_elevations_by_coordinate[
|
||||
component_coordinate
|
||||
] = heights
|
||||
|
||||
|
||||
func _elevation_tiers_for_tags(tags: PackedStringArray) -> Array[int]:
|
||||
var tiers: Array[int] = []
|
||||
for tag_value: String in tags:
|
||||
if not tag_value.begins_with("elevation_"):
|
||||
continue
|
||||
var suffix := tag_value.trim_prefix("elevation_")
|
||||
if suffix.is_valid_int():
|
||||
tiers.append(suffix.to_int())
|
||||
return tiers
|
||||
|
||||
|
||||
func _home_elevation_visit_key(coordinate: Vector2i, tier: int) -> String:
|
||||
return "%d:%d:%d" % [tier, coordinate.x, coordinate.y]
|
||||
|
||||
|
||||
func _mark_precipitation_occluders() -> void:
|
||||
for prop: Node in _decorations.get_children():
|
||||
var prop_group := prop.get_meta(&"terrain_prop_group", &"") as StringName
|
||||
|
|
@ -441,6 +565,8 @@ func _place_spawn_amenities(center: Vector3) -> void:
|
|||
_storage_root.rotation.y = PI * 0.5
|
||||
_decor_shop_root.position = center + Vector3(-2.4, 0.0, 1.2)
|
||||
_decor_shop_root.rotation.y = PI * 0.5
|
||||
_rv_upgrade_shop_root.position = center + Vector3(-2.35, 0.0, -1.35)
|
||||
_rv_upgrade_shop_root.rotation.y = PI
|
||||
|
||||
|
||||
func _configure_static_water() -> void:
|
||||
|
|
@ -1304,6 +1430,7 @@ func _terrain_surface_triangles_by_coordinate(
|
|||
mesh_instance.mesh.surface_get_arrays(surface_index),
|
||||
-INF,
|
||||
0.35,
|
||||
100.0,
|
||||
)
|
||||
if triangles.is_empty():
|
||||
continue
|
||||
|
|
@ -1651,6 +1778,7 @@ func _append_surface_triangles(
|
|||
arrays: Array,
|
||||
minimum_global_y: float,
|
||||
minimum_up_dot: float,
|
||||
maximum_global_y: float,
|
||||
) -> void:
|
||||
if arrays.size() <= Mesh.ARRAY_INDEX:
|
||||
return
|
||||
|
|
@ -1660,10 +1788,28 @@ func _append_surface_triangles(
|
|||
return
|
||||
if indices.is_empty():
|
||||
for index: int in range(0, vertices.size() - 2, 3):
|
||||
_append_triangle(result, mesh_instance, vertices[index], vertices[index + 1], vertices[index + 2], minimum_global_y, minimum_up_dot)
|
||||
_append_triangle(
|
||||
result,
|
||||
mesh_instance,
|
||||
vertices[index],
|
||||
vertices[index + 1],
|
||||
vertices[index + 2],
|
||||
minimum_global_y,
|
||||
minimum_up_dot,
|
||||
maximum_global_y,
|
||||
)
|
||||
return
|
||||
for index: int in range(0, indices.size() - 2, 3):
|
||||
_append_triangle(result, mesh_instance, vertices[indices[index]], vertices[indices[index + 1]], vertices[indices[index + 2]], minimum_global_y, minimum_up_dot)
|
||||
_append_triangle(
|
||||
result,
|
||||
mesh_instance,
|
||||
vertices[indices[index]],
|
||||
vertices[indices[index + 1]],
|
||||
vertices[indices[index + 2]],
|
||||
minimum_global_y,
|
||||
minimum_up_dot,
|
||||
maximum_global_y,
|
||||
)
|
||||
|
||||
|
||||
func _append_triangle(
|
||||
|
|
@ -1674,11 +1820,15 @@ func _append_triangle(
|
|||
local_c: Vector3,
|
||||
minimum_global_y: float,
|
||||
minimum_up_dot: float,
|
||||
maximum_global_y: float,
|
||||
) -> void:
|
||||
var a := mesh_instance.to_global(local_a)
|
||||
var b := mesh_instance.to_global(local_b)
|
||||
var c := mesh_instance.to_global(local_c)
|
||||
if minf(a.y, minf(b.y, c.y)) <= minimum_global_y:
|
||||
if (
|
||||
maxf(a.y, maxf(b.y, c.y)) <= minimum_global_y
|
||||
or minf(a.y, minf(b.y, c.y)) >= maximum_global_y
|
||||
):
|
||||
return
|
||||
var cross := (b - a).cross(c - a)
|
||||
if cross.length_squared() <= 0.0000001:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=15 format=3]
|
||||
[gd_scene load_steps=16 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://world/generation/generated_world_region.gd" id="1_region"]
|
||||
[ext_resource type="Script" path="res://world/generation/terrain_chunk_generator.gd" id="2_generator"]
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
[ext_resource type="Resource" path="res://world/generation/props/terrain_prop_catalog.tres" id="12_prop_catalog"]
|
||||
[ext_resource type="Resource" path="res://world/generation/biomes/terrain_biome_catalog.tres" id="13_biome_catalog"]
|
||||
[ext_resource type="PackedScene" path="res://world/interactables/decor_shop_world.tscn" id="14_decor_shop"]
|
||||
[ext_resource type="PackedScene" path="res://world/interactables/rv_upgrade_shop_world.tscn" id="15_rv_upgrade"]
|
||||
|
||||
[node name="GeneratedWorldRegion" type="Node3D"]
|
||||
script = ExtResource("1_region")
|
||||
|
|
@ -102,6 +103,9 @@ unique_name_in_owner = true
|
|||
[node name="DecorShopWorld" parent="Interactables" instance=ExtResource("14_decor_shop")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="RVUpgradeShopWorld" parent="Interactables" instance=ExtResource("15_rv_upgrade")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="Decorations" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
|
|
|
|||
|
|
@ -4414,6 +4414,19 @@ func chunk_position(coordinate: Vector2i) -> Vector3:
|
|||
)
|
||||
|
||||
|
||||
func coordinate_for_local_position(position: Vector3) -> Vector2i:
|
||||
if catalog == null or catalog.chunk_size <= 0.0:
|
||||
return Vector2i(-1, -1)
|
||||
var half_grid := Vector2(
|
||||
float(grid_size.x - 1) * 0.5,
|
||||
float(grid_size.y - 1) * 0.5,
|
||||
)
|
||||
return Vector2i(
|
||||
roundi(position.x / catalog.chunk_size + half_grid.x),
|
||||
roundi(position.z / catalog.chunk_size + half_grid.y),
|
||||
)
|
||||
|
||||
|
||||
func get_generated_chunks_root() -> Node3D:
|
||||
return _generated_chunks
|
||||
|
||||
|
|
|
|||
|
|
@ -6,19 +6,19 @@
|
|||
|
||||
[sub_resource type="SphereShape3D" id="InteractionShape"]
|
||||
resource_local_to_scene = true
|
||||
radius = 3.0
|
||||
radius = 2.1
|
||||
|
||||
[node name="DecorShopWorld" type="Node3D"]
|
||||
|
||||
[node name="Shopkeeper" parent="." instance=ExtResource("2_character")]
|
||||
script = ExtResource("3_display")
|
||||
species_id = "round"
|
||||
fur_color_id = "orange"
|
||||
ears_id = "pointy_short"
|
||||
tail_id = "cat"
|
||||
eyes_id = "simple_shine"
|
||||
nose_id = "dog_round"
|
||||
mouth_id = "three"
|
||||
fur_color_id = "brown"
|
||||
ears_id = "bear"
|
||||
tail_id = "bear"
|
||||
eyes_id = "tired"
|
||||
nose_id = "triangle_pink"
|
||||
mouth_id = "simple_smile"
|
||||
head_look_enabled = true
|
||||
|
||||
[node name="AnimationPlayer" parent="Shopkeeper"]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
[sub_resource type="SphereShape3D" id="InteractionShape"]
|
||||
resource_local_to_scene = true
|
||||
radius = 3.0
|
||||
radius = 2.1
|
||||
|
||||
[node name="FishingShopWorld" type="Node3D"]
|
||||
|
||||
|
|
|
|||
36
world/interactables/rv_upgrade_shop_world.tscn
Normal file
36
world/interactables/rv_upgrade_shop_world.tscn
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
[gd_scene load_steps=5 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://world/rv_upgrade_interaction.gd" id="1_shop"]
|
||||
[ext_resource type="PackedScene" path="res://art/exported/characters/base/straywild_base_character.glb" id="2_character"]
|
||||
[ext_resource type="Script" path="res://world/world_character_display.gd" id="3_display"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="InteractionShape"]
|
||||
resource_local_to_scene = true
|
||||
radius = 2.1
|
||||
|
||||
[node name="RVUpgradeShopWorld" type="Node3D"]
|
||||
|
||||
[node name="Shopkeeper" parent="." instance=ExtResource("2_character")]
|
||||
script = ExtResource("3_display")
|
||||
species_id = "pointy"
|
||||
fur_color_id = "teal"
|
||||
ears_id = "pointy_long"
|
||||
tail_id = "fox"
|
||||
eyes_id = "interested"
|
||||
nose_id = "triangle_small"
|
||||
mouth_id = "cheeky_smile"
|
||||
head_look_enabled = true
|
||||
|
||||
[node name="AnimationPlayer" parent="Shopkeeper"]
|
||||
autoplay = "idle"
|
||||
|
||||
[node name="InteractionArea" type="Area3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector3(0, 1, -0.3)
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_shop")
|
||||
|
||||
[node name="InteractionShape" type="CollisionShape3D" parent="InteractionArea"]
|
||||
shape = SubResource("InteractionShape")
|
||||
vertical_icon_alignment = 1
|
||||
|
|
@ -11,6 +11,9 @@ const PlayerStorageInteractionType = preload(
|
|||
const DecorShopInteractionType = preload(
|
||||
"res://world/decor_shop_interaction.gd"
|
||||
)
|
||||
const RVUpgradeInteractionType = preload(
|
||||
"res://world/rv_upgrade_interaction.gd"
|
||||
)
|
||||
const FOLIAGE_WIND_SHADER: Shader = preload(
|
||||
"res://world/materials/foliage_wind.gdshader"
|
||||
)
|
||||
|
|
@ -56,6 +59,10 @@ var player_storage_path: NodePath = (
|
|||
var decor_shop_path: NodePath = (
|
||||
^"Interactables/DecorShopWorld/InteractionArea"
|
||||
)
|
||||
@export_node_path("Area3D")
|
||||
var rv_upgrade_shop_path: NodePath = (
|
||||
^"Interactables/RVUpgradeShopWorld/InteractionArea"
|
||||
)
|
||||
@export_group("Terrain Collision")
|
||||
# The imported GLB is the collision authority. Rebuild once per region load so
|
||||
# newly authored terrain and props cannot retain a stale saved fallback shape.
|
||||
|
|
@ -95,6 +102,10 @@ func get_decor_shop() -> DecorShopInteractionType:
|
|||
return get_node_or_null(decor_shop_path) as DecorShopInteractionType
|
||||
|
||||
|
||||
func get_rv_upgrade_shop() -> RVUpgradeInteractionType:
|
||||
return get_node_or_null(rv_upgrade_shop_path) as RVUpgradeInteractionType
|
||||
|
||||
|
||||
func get_saltwater_shoreline_mesh() -> MeshInstance3D:
|
||||
return get_node_or_null(^"ShorelineRibbons/Ocean") as MeshInstance3D
|
||||
|
||||
|
|
@ -150,6 +161,7 @@ func get_spawn_surface_triangles(
|
|||
material_names: Array[StringName],
|
||||
minimum_global_y: float,
|
||||
minimum_up_dot: float = 0.6,
|
||||
maximum_global_y: float = 100.0,
|
||||
) -> Array[PackedVector3Array]:
|
||||
var triangles: Array[PackedVector3Array] = []
|
||||
if material_names.is_empty():
|
||||
|
|
@ -188,6 +200,7 @@ func get_spawn_surface_triangles(
|
|||
vertices[vertex_index + 2],
|
||||
minimum_global_y,
|
||||
minimum_up_dot,
|
||||
maximum_global_y,
|
||||
)
|
||||
else:
|
||||
for index_offset: int in range(0, indices.size() - 2, 3):
|
||||
|
|
@ -199,6 +212,7 @@ func get_spawn_surface_triangles(
|
|||
vertices[indices[index_offset + 2]],
|
||||
minimum_global_y,
|
||||
minimum_up_dot,
|
||||
maximum_global_y,
|
||||
)
|
||||
return triangles
|
||||
|
||||
|
|
@ -211,14 +225,14 @@ func _append_spawn_triangle(
|
|||
local_c: Vector3,
|
||||
minimum_global_y: float,
|
||||
minimum_up_dot: float,
|
||||
maximum_global_y: float,
|
||||
) -> void:
|
||||
var a: Vector3 = mesh_instance.to_global(local_a)
|
||||
var b: Vector3 = mesh_instance.to_global(local_b)
|
||||
var c: Vector3 = mesh_instance.to_global(local_c)
|
||||
if (
|
||||
a.y <= minimum_global_y
|
||||
or b.y <= minimum_global_y
|
||||
or c.y <= minimum_global_y
|
||||
maxf(a.y, maxf(b.y, c.y)) <= minimum_global_y
|
||||
or minf(a.y, minf(b.y, c.y)) >= maximum_global_y
|
||||
):
|
||||
return
|
||||
var cross: Vector3 = (b - a).cross(c - a)
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -22,6 +22,10 @@ func get_decor_shop() -> DecorShopInteraction:
|
|||
return null
|
||||
|
||||
|
||||
func get_rv_upgrade_shop() -> RVUpgradeInteraction:
|
||||
return null
|
||||
|
||||
|
||||
func get_player_storage() -> PlayerStorageInteraction:
|
||||
return null
|
||||
|
||||
|
|
@ -42,10 +46,24 @@ func get_spawn_surface_triangles(
|
|||
_material_names: Array[StringName],
|
||||
_minimum_global_y: float,
|
||||
_minimum_up_dot: float = 0.6,
|
||||
_maximum_global_y: float = 100.0,
|
||||
) -> Array[PackedVector3Array]:
|
||||
return []
|
||||
|
||||
|
||||
func get_saltwater_surface_height() -> float:
|
||||
for water_region: FishableWaterRegion in get_fishable_water_regions():
|
||||
if water_region.water_type == WaterType.Type.SALT_WATER:
|
||||
return water_region.get_surface_height()
|
||||
return NAN
|
||||
|
||||
|
||||
## Authored regions are assumed to expose only deliberately reachable home
|
||||
## sites. Procedural regions override this to reject isolated elevations.
|
||||
func is_home_exterior_position_accessible(_position: Vector3) -> bool:
|
||||
return true
|
||||
|
||||
|
||||
func get_fishable_water_regions() -> Array[FishableWaterRegion]:
|
||||
var regions: Array[FishableWaterRegion] = []
|
||||
var root: Node = get_node_or_null(fishable_water_root)
|
||||
|
|
|
|||
15
world/rv_upgrade_interaction.gd
Normal file
15
world/rv_upgrade_interaction.gd
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
class_name RVUpgradeInteraction
|
||||
extends FishingShopInteraction
|
||||
|
||||
const TENT_DIALOGUE_TEXT: String = (
|
||||
"That tent is looking awful cramped. Can I talk you into an upgrade?"
|
||||
)
|
||||
const RV_DIALOGUE_TEXT: String = "How's the new RV treating you?"
|
||||
|
||||
|
||||
func get_dialogue_text(home_tier: int = -1) -> String:
|
||||
return (
|
||||
RV_DIALOGUE_TEXT
|
||||
if home_tier >= PlayerHomeState.STARTER_RV_TIER
|
||||
else TENT_DIALOGUE_TEXT
|
||||
)
|
||||
1
world/rv_upgrade_interaction.gd.uid
Normal file
1
world/rv_upgrade_interaction.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c0h08goorv2of
|
||||
|
|
@ -10,6 +10,9 @@ const PlayerStorageInteractionType = preload(
|
|||
const DecorShopInteractionType = preload(
|
||||
"res://world/decor_shop_interaction.gd"
|
||||
)
|
||||
const RVUpgradeInteractionType = preload(
|
||||
"res://world/rv_upgrade_interaction.gd"
|
||||
)
|
||||
const WorldLayoutType = preload("res://world/world_layout.gd")
|
||||
const GENERATED_REGION_SCENE: PackedScene = preload(
|
||||
"res://world/generation/generated_world_region.tscn"
|
||||
|
|
@ -75,6 +78,10 @@ func get_decor_shop() -> DecorShopInteractionType:
|
|||
return _active_region.get_decor_shop()
|
||||
|
||||
|
||||
func get_rv_upgrade_shop() -> RVUpgradeInteractionType:
|
||||
return _active_region.get_rv_upgrade_shop()
|
||||
|
||||
|
||||
func get_player_spawn_transform() -> Transform3D:
|
||||
return _active_region.get_player_spawn_transform()
|
||||
|
||||
|
|
@ -170,10 +177,29 @@ func get_saltwater_shoreline_mesh() -> MeshInstance3D:
|
|||
func get_spawn_surface_triangles(
|
||||
material_names: Array[StringName],
|
||||
minimum_global_y: float,
|
||||
minimum_up_dot: float = 0.6,
|
||||
maximum_global_y: float = 100.0,
|
||||
) -> Array[PackedVector3Array]:
|
||||
return _active_region.get_spawn_surface_triangles(
|
||||
material_names,
|
||||
minimum_global_y,
|
||||
minimum_up_dot,
|
||||
maximum_global_y,
|
||||
)
|
||||
|
||||
|
||||
func get_saltwater_surface_height() -> float:
|
||||
return (
|
||||
_active_region.get_saltwater_surface_height()
|
||||
if _active_region != null
|
||||
else NAN
|
||||
)
|
||||
|
||||
|
||||
func is_home_exterior_position_accessible(position: Vector3) -> bool:
|
||||
return (
|
||||
_active_region != null
|
||||
and _active_region.is_home_exterior_position_accessible(position)
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue