more various tweaks to held items and chests in order to make carrying chests fun

This commit is contained in:
derek
2025-03-04 17:02:52 -06:00
parent e84aea9ef7
commit 5d989470a6
20 changed files with 111 additions and 106 deletions

View File

@@ -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)