diff options
| -rw-r--r-- | client/map/item_factory.gd | 3 | ||||
| -rw-r--r-- | client/map/items/raw_pizza.res | bin | 0 -> 14252 bytes | |||
| -rw-r--r-- | client/map/items/raw_pizza.tscn | 10 | ||||
| -rw-r--r-- | client/map/items/rolled_dough.gd | 14 |
4 files changed, 22 insertions, 5 deletions
diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd index b1db523f..d2bcc23a 100644 --- a/client/map/item_factory.gd +++ b/client/map/item_factory.gd @@ -52,7 +52,7 @@ static func produce_inner(item: ItemName, owned_by: Node3D) -> Item: "mushroom": return GenericItem.new(owned_by, preload("res://map/items/mushroom.tscn")) "sliced-mushroom": return GenericItem.new(owned_by, preload("res://map/items/sliced_mushroom.tscn")) "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")) + "rolled-dough": return RolledDough.new(owned_by) "strawberry-mochi": return Mochi.new(owned_by, Color(.98, .70, .75)) "nigiri": return GenericItem.new(owned_by, preload("res://map/items/nigiri.tscn")) "steak": return Cuttable.new(owned_by, preload("res://map/items/steak.tscn"), Color(0.74, 0.192, 0.22)) @@ -74,7 +74,6 @@ static func produce_inner(item: ItemName, owned_by: Node3D) -> Item: var plate = Plate.new(owned_by) plate.add_contents(["dirt"]) return plate - "pot": return Pot.new(owned_by) "basket": return Basket.new(owned_by) "pan": return Pan.new(owned_by) diff --git a/client/map/items/raw_pizza.res b/client/map/items/raw_pizza.res Binary files differnew file mode 100644 index 00000000..b61427c9 --- /dev/null +++ b/client/map/items/raw_pizza.res diff --git a/client/map/items/raw_pizza.tscn b/client/map/items/raw_pizza.tscn new file mode 100644 index 00000000..0cd00992 --- /dev/null +++ b/client/map/items/raw_pizza.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://d18w3kwuaehvv"] + +[ext_resource type="ArrayMesh" uid="uid://cwstqugiw76tc" path="res://map/items/raw_pizza.res" id="1_lcgk8"] + +[node name="Pizza" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(0.3, 0, 0, 0, 0.05, 0, 0, 0, 0.3, 0, 0.05, 0) +mesh = ExtResource("1_lcgk8") +skeleton = NodePath("") diff --git a/client/map/items/rolled_dough.gd b/client/map/items/rolled_dough.gd index cd59d907..55f97ccb 100644 --- a/client/map/items/rolled_dough.gd +++ b/client/map/items/rolled_dough.gd @@ -16,10 +16,18 @@ class_name RolledDough extends Item - func _init(owned_by_: Node3D): super(owned_by_) - add_child(load("res://map/items/rolled_dough.tscn").instantiate()) func add_contents(contents: Array[String]): - super(contents) + contents.sort() + + if contents.is_empty(): + base.add_child(load("res://map/items/rolled_dough.tscn").instantiate()) + return + if contents == ["tomato-juice"]: + base.add_child(load("res://map/items/raw_pizza.tscn").instantiate()) + return + + base.add_child(load("res://map/items/rolled_dough.tscn").instantiate()) + base.add_child(UnknownItem.new(owned_by, ",".join(contents))) |