The Cove's wreck: driftwood and salt on the beach, the captain's sea chest (a treasure map, nails, salt; once each), each player's own X on the map; online too
This commit is contained in:
@@ -363,6 +363,11 @@ func _run(p: Node3D, what: String, a: Array) -> void:
|
||||
"tunnel_prop":
|
||||
if w.tunnel != null:
|
||||
w.tunnel.set_prop(p, _i(a, 0))
|
||||
"wreck_chest":
|
||||
# The wreck's sea chest: each player's share, once.
|
||||
if w.wreck != null and p.global_position.distance_to(w.wreck.chest.global_position) < 4.0:
|
||||
if w.wreck.open_for(p, String(p.player_id)):
|
||||
WorldNet.wreck_state(w.wreck.to_data())
|
||||
"tunnel_go":
|
||||
# Down into the cliff tunnel, or back out at the top: a teleport
|
||||
# the server makes (the tunnel's under the island), from nearby.
|
||||
|
||||
@@ -377,6 +377,18 @@ func tunnel_state(d: Dictionary) -> void:
|
||||
if Lands.hub:
|
||||
Lands.push_tunnel(int(d.get("dug", 0)))
|
||||
|
||||
## Who's had their share of the wreck's sea chest changed: everyone here
|
||||
## sees whether it's empty for them.
|
||||
func wreck_state(d: Dictionary) -> void:
|
||||
_all("_s2c_wreck", [d])
|
||||
mark_changed()
|
||||
|
||||
@rpc("authority", "call_remote", "reliable")
|
||||
func _s2c_wreck(d: Dictionary) -> void:
|
||||
if not is_client() or world.wreck == null:
|
||||
return
|
||||
world.wreck.load_data(d)
|
||||
|
||||
@rpc("authority", "call_remote", "reliable")
|
||||
func _s2c_tunnel(d: Dictionary) -> void:
|
||||
if not is_client() or world.tunnel == null:
|
||||
|
||||
Reference in New Issue
Block a user