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

@@ -30,6 +30,7 @@ const PIECES := {
"forge": preload("res://scripts/building/forge.gd"),
"hearth": preload("res://scripts/building/hearth.gd"),
"rug": preload("res://scripts/building/rug.gd"),
"jar": preload("res://scripts/building/jar.gd"),
"stonecutter": preload("res://scripts/building/stonecutter.gd"),
}
const BuildPiece = preload("res://scripts/building/build_piece.gd")
@@ -268,7 +269,7 @@ func spawn_bed() -> Node3D:
if not has_bed_spawn:
return null
for p in _pieces.get_children():
if p.item_id == "bed" and not p.is_queued_for_deletion() and p.global_position.distance_to(bed_spawn) < 0.3:
if p.is_in_group("bed") and not p.is_queued_for_deletion() and p.global_position.distance_to(bed_spawn) < 0.3:
return p
return null
@@ -299,7 +300,11 @@ func sleep_block_reason(bed: Node3D) -> String:
var h: float = day_night.hours()
if h > 5.5 and h < 19.5:
return "You can only sleep at night (after 19:30)"
if not build.sheltered_at(bed.global_position):
if bed.has_method("open_air") and bed.open_air():
# A bedroll: anywhere, as long as it isn't raining or snowing on you.
if not build.sheltered_at(bed.global_position) and weather.precip > 0.3:
return "Not out here in this weather: find shelter, or wait for it to clear"
elif not build.sheltered_at(bed.global_position):
return "Your bed needs a roof and walls around it"
if wolves != null:
for w in wolves.alive():
@@ -724,7 +729,7 @@ func add_dropped_entry(e: Dictionary) -> Node3D:
func remove_pieces_net(gone: Array, collapsed_nids: Array) -> void:
var any_build := false
for p in gone:
if p.item_id == "bed" and spawn_bed() == p:
if p.is_in_group("bed") and spawn_bed() == p:
has_bed_spawn = false
if p.is_in_group("build"):
any_build = true
@@ -1031,7 +1036,7 @@ signal launched(id: String, origin: Vector3, vel: Vector3, shooter: Node3D)
## support collapses, and its item goes back to `refund_to` if there's room.
## Returns how many pieces collapsed.
func remove_piece(piece: Node3D, refund_to: Node3D = null) -> int:
if piece.item_id == "bed" and spawn_bed() == piece:
if piece.is_in_group("bed") and spawn_bed() == piece:
has_bed_spawn = false
Actions.notify.emit("Spawn point cleared")
var was_build := piece.is_in_group("build")