Files

23 lines
753 B
GDScript

extends "res://scripts/building/piece.gd"
## Fur rug: a bearskin on the floor. In a sheltered room it makes you Cozy
## (survival.gd): a little warmer, and Rested twice as fast. Flat, so you
## walk over it (it's only on the interactables layer, for X to take it up).
const COZY_RADIUS := 4.0
func _make_collision(mi: MeshInstance3D) -> void:
var aabb := mi.mesh.get_aabb()
var cs := CollisionShape3D.new()
var box := BoxShape3D.new()
box.size = Vector3(aabb.size.x, 0.06, aabb.size.z)
cs.shape = box
cs.position = Vector3(aabb.get_center().x, 0.03, aabb.get_center().z)
add_child(cs)
collision_layer = 2
func _build() -> void:
add_to_group("rug")
func interact_prompt(_player: Node) -> String:
return "Fur rug (cozy in a sheltered room)"