aboutsummaryrefslogtreecommitdiff
path: root/client/map
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2025-10-14 21:48:06 +0200
committertpart <tpart120@proton.me>2025-10-14 21:48:06 +0200
commitc86f98718847eac7517a411b5ef56c662d866e24 (patch)
tree17f6a4aa731f75d7e6a2af216eb35765fe1be1e8 /client/map
parente7e99e37dab1d0af0cfa8c13b08c00f85e08ba4e (diff)
downloadhurrycurry-c86f98718847eac7517a411b5ef56c662d866e24.tar
hurrycurry-c86f98718847eac7517a411b5ef56c662d866e24.tar.bz2
hurrycurry-c86f98718847eac7517a411b5ef56c662d866e24.tar.zst
Refactor; Make (seared-)steak in pan smaller
Diffstat (limited to 'client/map')
-rw-r--r--client/map/item_factory.gd3
-rw-r--r--client/map/items/pan.gd5
-rw-r--r--client/map/items/pot.gd8
3 files changed, 9 insertions, 7 deletions
diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd
index 8596b0d1..66753a17 100644
--- a/client/map/item_factory.gd
+++ b/client/map/item_factory.gd
@@ -32,11 +32,12 @@ class ItemName:
else:
contents = [c[1]] # Don't parse it, handle it in the item instead
-static func produce(raw_name: String, owned_by: Node3D) -> Item:
+static func produce(raw_name: String, owned_by: Node3D, scale := 1.) -> Item:
var name = ItemName.new(raw_name)
var item: Item = produce_inner(name, owned_by)
item.add_contents(name.contents)
item.item_name = raw_name
+ item.scale = Vector3(scale, scale, scale)
return item
static func produce_inner(item: ItemName, owned_by: Node3D) -> Item:
diff --git a/client/map/items/pan.gd b/client/map/items/pan.gd
index 497d8832..c5b16fa0 100644
--- a/client/map/items/pan.gd
+++ b/client/map/items/pan.gd
@@ -23,6 +23,11 @@ func _init(owned_by_: Node3D):
add_child(load("res://map/items/pan.tscn").instantiate())
base.add_child(steam)
+func add_contents(contents: Array[String]):
+ for i: String in contents:
+ if i == "steak" or i == "seared-steak":
+ base.add_child(ItemFactory.produce(i, self, .85))
+
func progress(position_: float, speed: float, warn: bool):
super(position_, speed, warn)
steam.emitting = true
diff --git a/client/map/items/pot.gd b/client/map/items/pot.gd
index 335fd093..c5039bd7 100644
--- a/client/map/items/pot.gd
+++ b/client/map/items/pot.gd
@@ -46,14 +46,10 @@ func add_contents(contents: Array[String]):
leek.position = Vector3(.03, .1, .25)
base.add_child(leek)
"cooked-noodles":
- var noodles := ItemFactory.produce(i, self)
- noodles.scale = Vector3(.85, .85, .85)
- base.add_child(noodles)
+ base.add_child(ItemFactory.produce(i, self, .85))
"noodles":
add_child(PotFillTransparent.new(self, Color(0.46, 0.68, 0.73, 0.392))) # water
- var noodles := ItemFactory.produce(i, self)
- noodles.scale = Vector3(.85, .85, .85)
- base.add_child(noodles)
+ base.add_child(ItemFactory.produce(i, self, .85))
"processed-mushroom":
add_child(PotFill.new(self, Color(0.596, 0.341, 0.259)))
"mushroom-soup":