forked from woofmeow/straywild
Add gathering, unified inventory, and real-time world
This commit is contained in:
parent
173371e6fc
commit
fa57edca83
113 changed files with 6700 additions and 1307 deletions
|
|
@ -5,6 +5,9 @@ extends WorldRegion
|
|||
const FishingShopInteractionType = preload(
|
||||
"res://world/fishing_shop_interaction.gd"
|
||||
)
|
||||
const PlayerStorageInteractionType = preload(
|
||||
"res://world/player_storage_interaction.gd"
|
||||
)
|
||||
const FOLIAGE_WIND_SHADER: Shader = preload(
|
||||
"res://world/materials/foliage_wind.gdshader"
|
||||
)
|
||||
|
|
@ -39,6 +42,10 @@ var player_spawn_path: NodePath = ^"PlayerSpawn"
|
|||
var fishing_shop_path: NodePath = (
|
||||
^"Interactables/FishingShopWorld/InteractionArea"
|
||||
)
|
||||
@export_node_path("Area3D")
|
||||
var player_storage_path: NodePath = (
|
||||
^"Interactables/PlayerStorageBox/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.
|
||||
|
|
@ -67,6 +74,10 @@ func get_fishing_shop() -> FishingShopInteractionType:
|
|||
return get_node_or_null(fishing_shop_path) as FishingShopInteractionType
|
||||
|
||||
|
||||
func get_player_storage() -> PlayerStorageInteractionType:
|
||||
return get_node_or_null(player_storage_path) as PlayerStorageInteractionType
|
||||
|
||||
|
||||
func get_saltwater_shoreline_mesh() -> MeshInstance3D:
|
||||
return get_node_or_null(^"ShorelineRibbons/Ocean") as MeshInstance3D
|
||||
|
||||
|
|
@ -363,4 +374,6 @@ func _get_configuration_warnings() -> PackedStringArray:
|
|||
warnings.append("PlayerSpawn marker is missing.")
|
||||
if get_node_or_null(fishing_shop_path) == null:
|
||||
warnings.append("Fishing Shop placement is missing.")
|
||||
if get_node_or_null(player_storage_path) == null:
|
||||
warnings.append("Private player storage placement is missing.")
|
||||
return warnings
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -6,6 +6,8 @@ extends Node3D
|
|||
@export var fishable_water_root: NodePath = ^"FishingWater"
|
||||
@export var water_recovery_root: NodePath = ^"WaterRecovery"
|
||||
@export var safe_respawns_root: NodePath = ^"SafeRespawns"
|
||||
@export var diggable_area_root: NodePath = ^"DiggableAreas"
|
||||
@export var gatherable_anchor_root: NodePath = ^"GatherableAnchors"
|
||||
|
||||
|
||||
func get_fishable_water_regions() -> Array[FishableWaterRegion]:
|
||||
|
|
@ -38,6 +40,44 @@ func get_safe_respawn_points() -> Array[SafeRespawnPoint]:
|
|||
return points
|
||||
|
||||
|
||||
func get_diggable_areas() -> Array[DiggableArea3D]:
|
||||
var areas: Array[DiggableArea3D] = []
|
||||
var root: Node = get_node_or_null(diggable_area_root)
|
||||
if root == null:
|
||||
return areas
|
||||
_collect_diggable_areas(root, areas)
|
||||
return areas
|
||||
|
||||
|
||||
func get_diggable_area(area_id: StringName) -> DiggableArea3D:
|
||||
if area_id.is_empty():
|
||||
return null
|
||||
for area: DiggableArea3D in get_diggable_areas():
|
||||
if area.area_id == area_id:
|
||||
return area
|
||||
return null
|
||||
|
||||
|
||||
func get_gatherable_anchor_sets() -> Array[GatherableAnchorSet3D]:
|
||||
var anchor_sets: Array[GatherableAnchorSet3D] = []
|
||||
var root: Node = get_node_or_null(gatherable_anchor_root)
|
||||
if root == null:
|
||||
return anchor_sets
|
||||
_collect_gatherable_anchor_sets(root, anchor_sets)
|
||||
return anchor_sets
|
||||
|
||||
|
||||
func get_gatherable_anchor_set(
|
||||
anchor_set_id: StringName,
|
||||
) -> GatherableAnchorSet3D:
|
||||
if anchor_set_id.is_empty():
|
||||
return null
|
||||
for anchor_set: GatherableAnchorSet3D in get_gatherable_anchor_sets():
|
||||
if anchor_set.anchor_set_id == anchor_set_id:
|
||||
return anchor_set
|
||||
return null
|
||||
|
||||
|
||||
func _collect_fishable_water_regions(
|
||||
root: Node,
|
||||
regions: Array[FishableWaterRegion],
|
||||
|
|
@ -58,3 +98,25 @@ func _collect_water_recovery_triggers(
|
|||
if trigger != null:
|
||||
triggers.append(trigger)
|
||||
_collect_water_recovery_triggers(child, triggers)
|
||||
|
||||
|
||||
func _collect_diggable_areas(
|
||||
root: Node,
|
||||
areas: Array[DiggableArea3D],
|
||||
) -> void:
|
||||
for child: Node in root.get_children():
|
||||
var area := child as DiggableArea3D
|
||||
if area != null:
|
||||
areas.append(area)
|
||||
_collect_diggable_areas(child, areas)
|
||||
|
||||
|
||||
func _collect_gatherable_anchor_sets(
|
||||
root: Node,
|
||||
anchor_sets: Array[GatherableAnchorSet3D],
|
||||
) -> void:
|
||||
for child: Node in root.get_children():
|
||||
var anchor_set := child as GatherableAnchorSet3D
|
||||
if anchor_set != null:
|
||||
anchor_sets.append(anchor_set)
|
||||
_collect_gatherable_anchor_sets(child, anchor_sets)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue