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:
@@ -2,8 +2,15 @@ extends "res://scripts/building/piece.gd"
|
||||
## Bed: E sets your spawn point here. Once it's yours, E at night sleeps until
|
||||
## morning, if the bed is under a roof with walls around it.
|
||||
|
||||
func _build() -> void:
|
||||
add_to_group("bed") # (a bed or a bedroll: either is a spawn point)
|
||||
|
||||
func display_name() -> String:
|
||||
return "Bed"
|
||||
return String(def.get("name", "Bed"))
|
||||
|
||||
## A bedroll: you can sleep in the open (world.sleep_block_reason).
|
||||
func open_air() -> bool:
|
||||
return bool(def.get("place", {}).get("open_air", false))
|
||||
|
||||
func is_spawn() -> bool:
|
||||
var w := get_parent().get_parent()
|
||||
@@ -11,8 +18,8 @@ func is_spawn() -> bool:
|
||||
|
||||
func interact_prompt(_player: Node) -> String:
|
||||
if not is_spawn():
|
||||
return "Bed [E] Set spawn point"
|
||||
return "Bed (your spawn point) [E] Sleep"
|
||||
return "%s [E] Set spawn point" % display_name()
|
||||
return "%s (your spawn point) [E] Sleep" % display_name()
|
||||
|
||||
func interact(player: Node) -> void:
|
||||
Actions.use_bed(player, self)
|
||||
|
||||
29
scripts/building/jar.gd
Normal file
29
scripts/building/jar.gd
Normal file
@@ -0,0 +1,29 @@
|
||||
extends "res://scripts/building/piece.gd"
|
||||
## Clay jar: 6 slots of storage, opened with E like a chest, and food kept in
|
||||
## it lasts three times as long (Inventory.keep_mult).
|
||||
|
||||
const SLOTS := 6
|
||||
const KEEP := 3.0
|
||||
var inventory := Inventory.new(SLOTS)
|
||||
|
||||
func _build() -> void:
|
||||
inventory.keep_mult = KEEP
|
||||
|
||||
func display_name() -> String:
|
||||
return "Clay Jar"
|
||||
|
||||
func dismantle_block_reason() -> String:
|
||||
for s in inventory.slots:
|
||||
if s != null:
|
||||
return "Empty the jar first"
|
||||
return ""
|
||||
|
||||
func interact_prompt(_player: Node) -> String:
|
||||
var used := 0
|
||||
for s in inventory.slots:
|
||||
if s != null:
|
||||
used += 1
|
||||
return "Clay jar (%d/%d, food keeps 3x as long) [E] Open" % [used, SLOTS]
|
||||
|
||||
func interact(player: Node) -> void:
|
||||
player.open_inventory(self)
|
||||
Reference in New Issue
Block a user