aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authornokoe <nokoe@mailbox.org>2025-10-06 22:38:42 +0200
committernokoe <nokoe@mailbox.org>2025-10-06 22:38:42 +0200
commit094417b7d289ff477670ffed6023dfdb55d73d00 (patch)
tree648c1232f1fc36148966e570c5317bfcd7dc9d82 /client
parentfc4de182fa5c9afca17069f09f362109c0a957a2 (diff)
downloadhurrycurry-094417b7d289ff477670ffed6023dfdb55d73d00.tar
hurrycurry-094417b7d289ff477670ffed6023dfdb55d73d00.tar.bz2
hurrycurry-094417b7d289ff477670ffed6023dfdb55d73d00.tar.zst
add height property to item, replace static function
Diffstat (limited to 'client')
-rw-r--r--client/map/item_factory.gd10
-rw-r--r--client/map/items/food_processor.gd4
-rw-r--r--client/map/items/generic_item.gd3
-rw-r--r--client/map/items/item.gd4
-rw-r--r--client/map/items/plate.gd6
-rw-r--r--client/map/items/sliced_cheese.gd24
-rw-r--r--client/map/items/sliced_cheese.gd.uid1
-rw-r--r--client/map/items/sliced_leek/sliced_leek.gd24
-rw-r--r--client/map/items/sliced_leek/sliced_leek.gd.uid1
-rw-r--r--client/map/items/sliced_lettuce.gd24
-rw-r--r--client/map/items/sliced_lettuce.gd.uid1
-rw-r--r--client/map/items/sliced_tomato.gd24
-rw-r--r--client/map/items/sliced_tomato.gd.uid1
-rw-r--r--client/rolled_dough.gd4
14 files changed, 13 insertions, 118 deletions
diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd
index 66b43cb2..200de874 100644
--- a/client/map/item_factory.gd
+++ b/client/map/item_factory.gd
@@ -39,7 +39,6 @@ static func produce_inner(item: ItemName, owned_by: Node3D) -> Item:
"bun": return Bun.new(owned_by)
"cheese": return Cheese.new(owned_by)
"cooked-noodles": return GenericItem.new(owned_by, preload("res://map/items/cooked_noodles.tscn"))
- "sliced-cheese": return SlicedCheese.new(owned_by)
"dirt": return GenericItem.new(owned_by, preload("res://map/items/dirt.tscn"))
"sliced-bun": return GenericItem.new(owned_by, preload("res://map/items/sliced_bun.tscn"))
"sliced-bun-top": return GenericItem.new(owned_by, preload("res://map/items/sliced_bun_top.tscn"))
@@ -51,7 +50,6 @@ static func produce_inner(item: ItemName, owned_by: Node3D) -> Item:
"flour": return GenericItem.new(owned_by, preload("res://map/items/flour.tscn"))
"leek": return GenericItem.new(owned_by, preload("res://map/items/leek.tscn"))
"mushroom": return GenericItem.new(owned_by, preload("res://map/items/mushroom.tscn"))
- "sliced-leek": return SlicedLeek.new(owned_by)
"noodles": return GenericItem.new(owned_by, preload("res://map/items/noodles.tscn"))
"rolled-dough": return GenericItem.new(owned_by, preload("res://map/items/rolled_dough.tscn"))
"strawberry-mochi": return Mochi.new(owned_by, Color(.98, .70, .75))
@@ -63,10 +61,12 @@ static func produce_inner(item: ItemName, owned_by: Node3D) -> Item:
"rice": return GenericItem.new(owned_by, preload("res://map/items/rice.tscn"))
"sliced-fish": return GenericItem.new(owned_by, preload("res://map/items/sliced_fish.tscn"))
"strawberry": return Strawberry.new(owned_by)
- "tomato": return Tomato.new(owned_by) # TODO: move into choppable class / move code into cutting_board
- "sliced-tomato": return SlicedTomato.new(owned_by)
"lettuce": return GenericItem.new(owned_by, preload("res://map/items/lettuce.tscn"))
- "sliced-lettuce": return SlicedLettuce.new(owned_by)
+ "tomato": return Tomato.new(owned_by) # TODO: move into choppable class / move code into cutting_board
+ "sliced-leek": return GenericItem.new(owned_by, preload("res://map/items/sliced_leek/sliced_leek.tscn"), 0.05)
+ "sliced-lettuce": return GenericItem.new(owned_by, preload("res://map/items/sliced_lettuce.tscn"), 0.05)
+ "sliced-cheese": return GenericItem.new(owned_by, preload("res://map/items/sliced_cheese.tscn"), 0.05)
+ "sliced-tomato": return GenericItem.new(owned_by, preload("res://map/items/sliced_tomato.tscn"), 0.05)
"potato": return Potato.new(owned_by)
"sliced-potato": return GenericItem.new(owned_by, preload("res://map/items/sliced_potato.tscn"))
"dirty-plate":
diff --git a/client/map/items/food_processor.gd b/client/map/items/food_processor.gd
index f3ae0b9e..0a78904f 100644
--- a/client/map/items/food_processor.gd
+++ b/client/map/items/food_processor.gd
@@ -21,6 +21,7 @@ var processing: CPUParticles3D = load("res://map/items/processing.tscn").instant
func _init(owned_by_: Node3D):
super(owned_by_)
+ height = 0.8
add_child(load("res://map/items/food_processor.tscn").instantiate())
add_child(processing)
@@ -81,6 +82,3 @@ func finish():
static func base_position() -> Vector3:
return Vector3(0., 0.4, 0.)
-
-static func height() -> float:
- return .3
diff --git a/client/map/items/generic_item.gd b/client/map/items/generic_item.gd
index fd119feb..5f101646 100644
--- a/client/map/items/generic_item.gd
+++ b/client/map/items/generic_item.gd
@@ -16,6 +16,7 @@
class_name GenericItem
extends Item
-func _init(owned_by_: Node3D, scene: PackedScene):
+func _init(owned_by_: Node3D, scene: PackedScene, height_: float = height):
super(owned_by_)
+ height = height_
base.add_child(scene.instantiate())
diff --git a/client/map/items/item.gd b/client/map/items/item.gd
index 44482c9b..39c7afc1 100644
--- a/client/map/items/item.gd
+++ b/client/map/items/item.gd
@@ -24,6 +24,7 @@ var owned_by: Node3D
var base: Node3D = Node3D.new()
var rotation_target: float = 0.
var position_target: Vector3 = Vector3(0., 0., 0.)
+var height: float = 0.1
var progress_instance: Progress3D = preload("res://map/progress/progress.tscn").instantiate()
var take_sound: PlayRandom = preload("res://audio/play_random.tscn").instantiate()
@@ -145,6 +146,3 @@ func put():
static func base_position() -> Vector3:
return Vector3(0., 0., 0.)
-
-static func height() -> float:
- return .1
diff --git a/client/map/items/plate.gd b/client/map/items/plate.gd
index b4ae8baf..e5b86df2 100644
--- a/client/map/items/plate.gd
+++ b/client/map/items/plate.gd
@@ -18,6 +18,7 @@ extends Item
func _init(owned_by_: Node3D):
super(owned_by_)
+ height = .05
add_child(load("res://map/items/plate.tscn").instantiate())
func add_contents(contents: Array[String]):
@@ -69,7 +70,7 @@ func add_contents(contents: Array[String]):
base.add_child(item)
item.position.y = height_sum
@warning_ignore("static_called_on_instance")
- height_sum += item.height()
+ height_sum += item.height
func setup_sounds():
take_sound.setup([preload("res://map/items/sounds/plate_take.ogg")])
@@ -77,6 +78,3 @@ func setup_sounds():
static func base_position() -> Vector3:
return Vector3(0., .025, 0.)
-
-static func height() -> float:
- return .05
diff --git a/client/map/items/sliced_cheese.gd b/client/map/items/sliced_cheese.gd
deleted file mode 100644
index dc64aa66..00000000
--- a/client/map/items/sliced_cheese.gd
+++ /dev/null
@@ -1,24 +0,0 @@
-# Hurry Curry! - a game about cooking
-# Copyright (C) 2025 Hurry Curry! contributors
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, version 3 of the License only.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-#
-class_name SlicedCheese
-extends Item
-
-func _init(owned_by_: Node3D):
- super(owned_by_)
- base.add_child(load("res://map/items/sliced_cheese.tscn").instantiate())
-
-static func height() -> float:
- return .05
diff --git a/client/map/items/sliced_cheese.gd.uid b/client/map/items/sliced_cheese.gd.uid
deleted file mode 100644
index e41c56aa..00000000
--- a/client/map/items/sliced_cheese.gd.uid
+++ /dev/null
@@ -1 +0,0 @@
-uid://boa66jn85qghw
diff --git a/client/map/items/sliced_leek/sliced_leek.gd b/client/map/items/sliced_leek/sliced_leek.gd
deleted file mode 100644
index a53ed6ff..00000000
--- a/client/map/items/sliced_leek/sliced_leek.gd
+++ /dev/null
@@ -1,24 +0,0 @@
-# Hurry Curry! - a game about cooking
-# Copyright (C) 2025 Hurry Curry! contributors
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, version 3 of the License only.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-#
-class_name SlicedLeek
-extends Item
-
-func _init(owned_by_: Node3D):
- super(owned_by_)
- base.add_child(load("res://map/items/sliced_leek/sliced_leek.tscn").instantiate())
-
-static func height() -> float:
- return .05
diff --git a/client/map/items/sliced_leek/sliced_leek.gd.uid b/client/map/items/sliced_leek/sliced_leek.gd.uid
deleted file mode 100644
index 3e2a5eb2..00000000
--- a/client/map/items/sliced_leek/sliced_leek.gd.uid
+++ /dev/null
@@ -1 +0,0 @@
-uid://d7siimt0uu8h
diff --git a/client/map/items/sliced_lettuce.gd b/client/map/items/sliced_lettuce.gd
deleted file mode 100644
index 871038be..00000000
--- a/client/map/items/sliced_lettuce.gd
+++ /dev/null
@@ -1,24 +0,0 @@
-# Hurry Curry! - a game about cooking
-# Copyright (C) 2025 Hurry Curry! contributors
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, version 3 of the License only.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-#
-class_name SlicedLettuce
-extends Item
-
-func _init(owned_by_: Node3D):
- super(owned_by_)
- base.add_child(load("res://map/items/sliced_lettuce.tscn").instantiate())
-
-static func height() -> float:
- return .05
diff --git a/client/map/items/sliced_lettuce.gd.uid b/client/map/items/sliced_lettuce.gd.uid
deleted file mode 100644
index 1b53d6d9..00000000
--- a/client/map/items/sliced_lettuce.gd.uid
+++ /dev/null
@@ -1 +0,0 @@
-uid://dncjhvkj3bqc2
diff --git a/client/map/items/sliced_tomato.gd b/client/map/items/sliced_tomato.gd
deleted file mode 100644
index 6630b336..00000000
--- a/client/map/items/sliced_tomato.gd
+++ /dev/null
@@ -1,24 +0,0 @@
-# Hurry Curry! - a game about cooking
-# Copyright (C) 2025 Hurry Curry! contributors
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, version 3 of the License only.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-#
-class_name SlicedTomato
-extends Item
-
-func _init(owned_by_: Node3D):
- super(owned_by_)
- base.add_child(load("res://map/items/sliced_tomato.tscn").instantiate())
-
-static func height() -> float:
- return .05
diff --git a/client/map/items/sliced_tomato.gd.uid b/client/map/items/sliced_tomato.gd.uid
deleted file mode 100644
index 2c7bdabc..00000000
--- a/client/map/items/sliced_tomato.gd.uid
+++ /dev/null
@@ -1 +0,0 @@
-uid://b60e2pltc4lpc
diff --git a/client/rolled_dough.gd b/client/rolled_dough.gd
index 0581fc8c..cd59d907 100644
--- a/client/rolled_dough.gd
+++ b/client/rolled_dough.gd
@@ -17,8 +17,8 @@ class_name RolledDough
extends Item
-func _init(owned_by_: Node3D, contents: Array):
- super(owned_by_, contents)
+func _init(owned_by_: Node3D):
+ super(owned_by_)
add_child(load("res://map/items/rolled_dough.tscn").instantiate())
func add_contents(contents: Array[String]):