From afbea7fcf5f66b08d7ef0ed4e617678b8c20bda0 Mon Sep 17 00:00:00 2001 From: tpart Date: Mon, 19 Aug 2024 21:37:59 +0200 Subject: Add mochi model & Implement strawberry mochi --- client/map/item_factory.gd | 4 ++-- client/map/items/icecream.tscn | 1 - client/map/items/icecream_items.gd | 21 --------------------- client/map/items/mochi.gd | 27 +++++++++++++++++++++++++++ client/map/items/mochi.res | Bin 0 -> 2674 bytes client/map/items/mochi.tscn | 11 +++++++++++ client/map/items/mochi_items.gd | 21 +++++++++++++++++++++ 7 files changed, 61 insertions(+), 24 deletions(-) delete mode 100644 client/map/items/icecream_items.gd create mode 100644 client/map/items/mochi.gd create mode 100644 client/map/items/mochi.res create mode 100644 client/map/items/mochi.tscn create mode 100644 client/map/items/mochi_items.gd (limited to 'client') diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd index 014c80b4..7abcfdc2 100644 --- a/client/map/item_factory.gd +++ b/client/map/item_factory.gd @@ -27,6 +27,7 @@ static func produce(name: String, owned_by: Node3D) -> Item: "fish": return Fish.new(owned_by) "flour": return Flour.new(owned_by) "leek": return Leek.new(owned_by) + "strawberry-mochi": return MochiItems.StrawberryM.new(owned_by) "nigiri": return Nigiri.new(owned_by) "raw-steak": return RawSteak.new(owned_by) "rice": return Rice.new(owned_by) @@ -83,11 +84,10 @@ static func produce(name: String, owned_by: Node3D) -> Item: "bread-slice-sliced-tomato-steak-plate": return PlateItems.BreadSliceSlicedTomatoSteakP.new(owned_by) "bread-slice-steak-plate": return PlateItems.BreadSliceSteakP.new(owned_by) "curry-plate": return PlateItems.CurryP.new(owned_by) - "strawberry-icecream-plate": return PlateItems.StrawberryIcecreamP.new(owned_by) - "dirty-plate": return PlateItems.DirtyP.new(owned_by) "nigiri-plate": return PlateItems.NigiriP.new(owned_by) "steak-plate": return PlateItems.SteakP.new(owned_by) + "strawberry-icecream-plate": return PlateItems.StrawberryIcecreamP.new(owned_by) "tomato-soup-plate": return PlateItems.TomatoSoupP.new(owned_by) var t: return GenericItem.new(owned_by, t) diff --git a/client/map/items/icecream.tscn b/client/map/items/icecream.tscn index 71d5440a..b5dd322a 100644 --- a/client/map/items/icecream.tscn +++ b/client/map/items/icecream.tscn @@ -65,7 +65,6 @@ shadow_mesh = SubResource("ArrayMesh_fh0mf") resource_local_to_scene = true resource_name = "Ice" cull_mode = 2 -albedo_color = Color(0.706654, 0.706654, 0.706654, 0) roughness = 0.690035 [node name="IceCream" type="MeshInstance3D"] diff --git a/client/map/items/icecream_items.gd b/client/map/items/icecream_items.gd deleted file mode 100644 index 5fb019f2..00000000 --- a/client/map/items/icecream_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 . -# -class_name IcecreamItems - -class StrawberryI extends IcecreamPlate: - func _init(owned_by_: Node3D): - super(owned_by_) - set_color(Color(1., .3, .2)) diff --git a/client/map/items/mochi.gd b/client/map/items/mochi.gd new file mode 100644 index 00000000..77e0ca41 --- /dev/null +++ b/client/map/items/mochi.gd @@ -0,0 +1,27 @@ +# 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 . +# +class_name Mochi +extends Item + +var model: MeshInstance3D = load("res://map/items/mochi.tscn").instantiate() + +func _init(owned_by_: Node3D): + super(owned_by_) + add_child(model) + +func set_color(c: Color): + var mat: BaseMaterial3D = model.get_active_material(0) + mat.albedo_color = c diff --git a/client/map/items/mochi.res b/client/map/items/mochi.res new file mode 100644 index 00000000..d9a4a97b Binary files /dev/null and b/client/map/items/mochi.res differ diff --git a/client/map/items/mochi.tscn b/client/map/items/mochi.tscn new file mode 100644 index 00000000..aaf20af6 --- /dev/null +++ b/client/map/items/mochi.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=3 format=3 uid="uid://2warur3hlxao"] + +[ext_resource type="ArrayMesh" uid="uid://c3s71kxt7nhfb" path="res://map/items/mochi.res" id="1_ygb5f"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_c143l"] + +[node name="Mochi" type="MeshInstance3D"] +transform = Transform3D(0.15, 0, 0, 0, 0.104, 0, 0, 0, 0.15, 0, 0.075, 0) +mesh = ExtResource("1_ygb5f") +skeleton = NodePath("") +surface_material_override/0 = SubResource("StandardMaterial3D_c143l") diff --git a/client/map/items/mochi_items.gd b/client/map/items/mochi_items.gd new file mode 100644 index 00000000..2759f228 --- /dev/null +++ b/client/map/items/mochi_items.gd @@ -0,0 +1,21 @@ +# 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 . +# +class_name MochiItems + +class StrawberryM extends Mochi: + func _init(owned_by_: Node3D): + super(owned_by_) + set_color(Color(.98, .70, .75)) -- cgit v1.2.3-70-g09d2