aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-09-16 16:11:04 +0200
committertpart <tpart120@proton.me>2024-09-16 16:11:04 +0200
commitbd4794cacdd93734ffea4861cf0c26dc07806c7a (patch)
tree20cec4b80ca7779b924856645b4c7ed4ddcb4589 /client
parentf016f49175522801f1ebfcc0de632232eca823ca (diff)
downloadhurrycurry-bd4794cacdd93734ffea4861cf0c26dc07806c7a.tar
hurrycurry-bd4794cacdd93734ffea4861cf0c26dc07806c7a.tar.bz2
hurrycurry-bd4794cacdd93734ffea4861cf0c26dc07806c7a.tar.zst
Refactor mochi code with new system
Diffstat (limited to 'client')
-rw-r--r--client/map/item_factory.gd2
-rw-r--r--client/map/items/mochi.gd8
-rw-r--r--client/map/items/mochi_items.gd21
3 files changed, 4 insertions, 27 deletions
diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd
index 3a97af6e..b91a0da0 100644
--- a/client/map/item_factory.gd
+++ b/client/map/item_factory.gd
@@ -38,7 +38,7 @@ static func produce(full_name: String, owned_by: Node3D) -> Item:
"flour": return Flour.new(owned_by)
"leek": return Leek.new(owned_by)
"strawberry-icecream": return Icecream.new(owned_by, Color(.98, .55, .71))
- "strawberry-mochi": return MochiItems.StrawberryM.new(owned_by)
+ "strawberry-mochi": return Mochi.new(owned_by, Color(.98, .70, .75))
"nigiri": return Nigiri.new(owned_by)
"steak": return Steak.new(owned_by)
"seared-steak": return SearedSteak.new(owned_by)
diff --git a/client/map/items/mochi.gd b/client/map/items/mochi.gd
index 77e0ca41..3f873d10 100644
--- a/client/map/items/mochi.gd
+++ b/client/map/items/mochi.gd
@@ -18,10 +18,8 @@ extends Item
var model: MeshInstance3D = load("res://map/items/mochi.tscn").instantiate()
-func _init(owned_by_: Node3D):
+func _init(owned_by_: Node3D, color: Color):
super(owned_by_)
- add_child(model)
-
-func set_color(c: Color):
var mat: BaseMaterial3D = model.get_active_material(0)
- mat.albedo_color = c
+ mat.albedo_color = color
+ base.add_child(model)
diff --git a/client/map/items/mochi_items.gd b/client/map/items/mochi_items.gd
deleted file mode 100644
index 2759f228..00000000
--- a/client/map/items/mochi_items.gd
+++ /dev/null
@@ -1,21 +0,0 @@
-# Hurry Curry! - a game about cooking
-# Copyright 2024 tpart
-#
-# 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 MochiItems
-
-class StrawberryM extends Mochi:
- func _init(owned_by_: Node3D):
- super(owned_by_)
- set_color(Color(.98, .70, .75))