diff options
author | tpart <tpart120@proton.me> | 2024-09-16 15:19:32 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-09-16 15:19:32 +0200 |
commit | f4642ba743b1758a2252434524cb41b92bf6ebb1 (patch) | |
tree | d6d2c8259abd19cdd6f94a5c2043df4c4e40490a /client | |
parent | 1e059a4c891bfd00d758932c59bcae2bd47076a7 (diff) | |
download | hurrycurry-f4642ba743b1758a2252434524cb41b92bf6ebb1.tar hurrycurry-f4642ba743b1758a2252434524cb41b92bf6ebb1.tar.bz2 hurrycurry-f4642ba743b1758a2252434524cb41b92bf6ebb1.tar.zst |
Implement pot contents in new item system
Diffstat (limited to 'client')
-rw-r--r-- | client/map/items/pot.gd | 28 | ||||
-rw-r--r-- | client/map/items/pot_fill.gd | 9 | ||||
-rw-r--r-- | client/map/items/rice_content.tscn | 1 |
3 files changed, 31 insertions, 7 deletions
diff --git a/client/map/items/pot.gd b/client/map/items/pot.gd index 9b3e0ad3..11648b7f 100644 --- a/client/map/items/pot.gd +++ b/client/map/items/pot.gd @@ -22,8 +22,32 @@ func _init(owned_by_: Node3D, contents: Array): super(owned_by_) add_child(load("res://map/items/pot.tscn").instantiate()) base.add_child(steam) - for c in contents: - base.add_child(ItemFactory.produce(c, self)) + + for i in contents: + match i: + "mochi-dough": + add_child(PotFill.new(self, Color(1.,1.,.3))) + "rice": + add_child(load("res://map/items/rice_content.tscn").instantiate()) + "rice-flour": + add_child(PotFill.new(self, Color(1.,1.,.8))) + "tomato-juice": + add_child(PotFill.new(self, Color(1.,.0,.0))) + "tomato-soup": + add_child(PotFill.new(self, Color(1.,.3,.2))) + "leek": + var leek = ItemFactory.produce(i, self) + leek.rotation_degrees = Vector3(-75.5, 0, -25) + leek.position = Vector3(.03, .1, .25) + base.add_child(leek) + "cooked-rice": + add_child(PotFill.new(self, Color(1.,1.,1.))) + "curry": + add_child(PotFill.new(self, Color(.75, .45, .1))) + "milk": + add_child(PotFill.new(self, Color8(250, 250, 250))) + _: + base.add_child(ItemFactory.produce(i, self)) func progress(position_: float, speed: float, warn: bool): super(position_, speed, warn) diff --git a/client/map/items/pot_fill.gd b/client/map/items/pot_fill.gd index f5c8ad44..2c9ef929 100644 --- a/client/map/items/pot_fill.gd +++ b/client/map/items/pot_fill.gd @@ -1,5 +1,6 @@ # Hurry Curry! - a game about cooking # Copyright 2024 nokoe +# 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 @@ -14,14 +15,12 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. # class_name PotFill -extends Pot +extends Item var fill: MeshInstance3D = load("res://map/items/pot_fill.tscn").instantiate() -func _init(owned_by_: Node3D): +func _init(owned_by_: Node3D, c: Color): super(owned_by_) - add_child(fill) - -func set_color(c: Color): var mat: BaseMaterial3D = fill.get_active_material(0) mat.albedo_color = c + base.add_child(fill) diff --git a/client/map/items/rice_content.tscn b/client/map/items/rice_content.tscn index 86b6e983..b7111399 100644 --- a/client/map/items/rice_content.tscn +++ b/client/map/items/rice_content.tscn @@ -4,6 +4,7 @@ [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ce6yj"] resource_local_to_scene = true +albedo_color = Color(1, 1, 0.8, 1) [node name="RiceContent" type="MeshInstance3D"] transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) |