aboutsummaryrefslogtreecommitdiff
path: root/client/map/items/item.gd
diff options
context:
space:
mode:
authornokoe <nokoe@mailbox.org>2025-10-06 20:12:13 +0200
committernokoe <nokoe@mailbox.org>2025-10-06 20:13:30 +0200
commitfc4de182fa5c9afca17069f09f362109c0a957a2 (patch)
tree9e8c35475dfc1c9e26e9ac8d235983d4026a4888 /client/map/items/item.gd
parenta251cf726551935b59072ffc01b87876968715c2 (diff)
downloadhurrycurry-fc4de182fa5c9afca17069f09f362109c0a957a2.tar
hurrycurry-fc4de182fa5c9afca17069f09f362109c0a957a2.tar.bz2
hurrycurry-fc4de182fa5c9afca17069f09f362109c0a957a2.tar.zst
allow every item to have contents
Diffstat (limited to 'client/map/items/item.gd')
-rw-r--r--client/map/items/item.gd6
1 files changed, 6 insertions, 0 deletions
diff --git a/client/map/items/item.gd b/client/map/items/item.gd
index 5a43af2d..44482c9b 100644
--- a/client/map/items/item.gd
+++ b/client/map/items/item.gd
@@ -57,6 +57,12 @@ func _init(owned_by_: Node3D):
add_child(base)
owned_by = owned_by_
+func add_contents(contents: Array[String]):
+ for i in contents:
+ match i:
+ _:
+ base.add_child(ItemFactory.produce(i, self))
+
func animate_spawn():
creation_timer = 0.0
scale = Vector3.ONE * 0.001 # setting to zero breaks assertions somewhere in the engine