Uses for every material (clay jar, bedroll, pelt rug, fang necklace, bear cloak, pemmican, bait), Q to drop, K/M bag rows on 1-8, help pages; protocol 14

This commit is contained in:
Paul Bailey
2026-11-06 11:49:42 +00:00
parent 5778d61763
commit 4b2e687188
29 changed files with 1457 additions and 40 deletions

View File

@@ -32,7 +32,7 @@ signal clock(day: int, time: float) ## the server's time of day
const Identity = preload("res://scripts/net/identity.gd")
const ServerConfig = preload("res://scripts/net/server_config.gd")
const PROTOCOL := 13 ## 3: shared world; 4: the server decides; 5: wildlife; 6: rules and chat (M2.6); 7: the alpha, broken doors; 8: the bear; 9: crows and foxes; 10: the barrow (P3); 11: food spoilage, lightning (P4); 12: the standing stones and the Old Stag (P5); 13: sounds sent to players nearby (sfx.gd)
const PROTOCOL := 14 ## 3: shared world; 4: the server decides; 5: wildlife; 6: rules and chat (M2.6); 7: the alpha, broken doors; 8: the bear; 9: crows and foxes; 10: the barrow (P3); 11: food spoilage, lightning (P4); 12: the standing stones and the Old Stag (P5); 13: sounds sent to players nearby (sfx.gd); 14: dropping items, any bag row in hand, new items (jar, bedroll, necklace, bear cloak, rug, pemmican)
const DEFAULT_PORT := 24242
const HANDSHAKE_TIMEOUT := 10.0
const JOIN_TIMEOUT := 20.0 ## includes the server building its terrain on first join

View File

@@ -341,7 +341,7 @@ func _run(p: Node3D, what: String, a: Array) -> void:
WorldNet.piece_state(f)
"bed":
var b := WorldNet.piece(_i(a, 0))
if b != null and b.item_id == "bed" and _allowed(Rules.use_problem(p.player_id, b)):
if b != null and b.is_in_group("bed") and _allowed(Rules.use_problem(p.player_id, b)):
Actions.use_bed(p, b)
"inv_click":
# Slot `a[1]` of your own inventory (a[0] = 0) or a chest's.
@@ -365,6 +365,10 @@ func _run(p: Node3D, what: String, a: Array) -> void:
var slot := _i(a, 1)
if slot >= 0 and slot < from.size():
Actions.transfer(p, from, slot, to, c)
"drop":
var ds := _i(a, 0)
if ds >= 0 and ds < p.inventory.size():
Actions.drop(p, ds, _i(a, 1))
"close":
# The inventory screen closed: what's on the cursor goes back in
# your bag, or at your feet if it's full.

View File

@@ -63,7 +63,7 @@ func held_item_id() -> String:
return s.id if s != null else ""
func select(i: int) -> void:
selected = wrapi(i, 0, HOTBAR)
selected = wrapi(i, 0, inventory.size()) # (any bag slot: player.gd's rows)
selected_changed.emit()
func held_heat() -> float:
@@ -85,7 +85,7 @@ func bed_piece(world: Node3D) -> Node3D:
if not has_bed_spawn:
return null
for p in world.all_pieces():
if p.item_id == "bed" and claims_bed(p):
if p.is_in_group("bed") and claims_bed(p):
return p
return null