The rowing boat: seagrass at the tide line and resin from pines; rope, pitch, and a boat at the workbench (driftwood, rope, pitch, nails); tied up at a berth of its own at the end of the pier, one each, saved; Set sail needs the ship's compass and the Highlands aren't charted yet; online too
This commit is contained in:
25
scripts/world/mooring_post.gd
Normal file
25
scripts/world/mooring_post.gd
Normal file
@@ -0,0 +1,25 @@
|
||||
extends StaticBody3D
|
||||
## The mooring post at the end of the pier (moorings.gd): E ties up the
|
||||
## rowing boat in your bag. Online, your game asks the server.
|
||||
|
||||
var moorings: Node3D
|
||||
|
||||
## Whose boat: the player's id (a server's character, or, at home, yours).
|
||||
static func id_of(player: Node) -> String:
|
||||
var pid: Variant = player.get("player_id")
|
||||
if pid != null and not String(pid).is_empty():
|
||||
return String(pid)
|
||||
return String(Net.get_identity().player_id)
|
||||
|
||||
func interact_prompt(player: Node) -> String:
|
||||
if moorings.has_boat(id_of(player)):
|
||||
return "Mooring post (your boat's tied up here)"
|
||||
if player.inventory.count(moorings.BOAT_ITEM) > 0:
|
||||
return "Mooring post [E] Tie up your boat"
|
||||
return "Mooring post (build a rowing boat at a workbench, and tie it up here)"
|
||||
|
||||
func interact(player: Node) -> void:
|
||||
if moorings.world.is_online():
|
||||
PlayerNet.ask("moor", [])
|
||||
return
|
||||
moorings.moor(player, id_of(player))
|
||||
Reference in New Issue
Block a user