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
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue