more various tweaks to held items and chests in order to make carrying chests fun
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
extends RigidBody3D
|
||||
class_name Chest
|
||||
|
||||
@export var weapon_drops : Array[Resource]
|
||||
@export var health : float = 30
|
||||
|
||||
var open = false
|
||||
var drop_weapon
|
||||
@@ -19,7 +21,8 @@ func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func hit(dam):
|
||||
if !open:
|
||||
health -= dam
|
||||
if !open and health <= 0:
|
||||
anim_player.play("open")
|
||||
open = true
|
||||
|
||||
@@ -31,4 +34,4 @@ func spawn_drop():
|
||||
get_tree().current_scene.add_child(drop_weapon)
|
||||
|
||||
func interact():
|
||||
hit(0)
|
||||
hit(1)
|
||||
|
||||
Reference in New Issue
Block a user