diff options
-rw-r--r-- | client/map/item_factory.gd | 8 | ||||
-rw-r--r-- | client/map/items/basket.gd | 5 | ||||
-rw-r--r-- | client/map/items/glass.gd | 5 | ||||
-rw-r--r-- | client/map/items/pan.gd | 4 | ||||
-rw-r--r-- | client/map/items/pot.gd | 7 |
5 files changed, 15 insertions, 14 deletions
diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd index 3c3cf63c..56842a47 100644 --- a/client/map/item_factory.gd +++ b/client/map/item_factory.gd @@ -74,11 +74,11 @@ static func produce_inner(item: ItemName, owned_by: Node3D) -> Item: plate.add_contents(["dirt"]) return plate - "pot": return Pot.new(owned_by, item.contents) - "basket": return Basket.new(owned_by, item.contents) - "pan": return Pan.new(owned_by, item.contents) + "pot": return Pot.new(owned_by) + "basket": return Basket.new(owned_by) + "pan": return Pan.new(owned_by) "foodprocessor": return FoodProcessor.new(owned_by) - "glass": return Glass.new(owned_by, item.contents) + "glass": return Glass.new(owned_by) "plate": return Plate.new(owned_by) "unknown-order": return GenericItem.new(owned_by, preload("res://map/items/unknown_order.tscn")) diff --git a/client/map/items/basket.gd b/client/map/items/basket.gd index 3434727e..df37b5dd 100644 --- a/client/map/items/basket.gd +++ b/client/map/items/basket.gd @@ -19,19 +19,20 @@ extends Item var steam: CPUParticles3D = load("res://map/items/steam.tscn").instantiate() var bubbles: CPUParticles3D = load("res://map/items/deep_frying.tscn").instantiate() -func _init(owned_by_: Node3D, contents: Array): +func _init(owned_by_: Node3D): super(owned_by_) add_child(load("res://map/items/basket.tscn").instantiate()) base.add_child(steam) base.add_child(bubbles) base.position.z = -.075 +func add_contents(contents: Array[String]): for i in contents: match i: "french-fries": base.add_child(load("res://map/items/french_fries_basket.tscn").instantiate()) _: - base.add_child(ItemFactory.produce(i, self)) + super([i]) func progress(position_: float, speed: float, warn: bool): super(position_, speed, warn) diff --git a/client/map/items/glass.gd b/client/map/items/glass.gd index 900a3eba..b9582a3a 100644 --- a/client/map/items/glass.gd +++ b/client/map/items/glass.gd @@ -16,10 +16,11 @@ class_name Glass extends Item -func _init(owned_by_: Node3D, contents: Array): +func _init(owned_by_: Node3D): super(owned_by_) add_child(load("res://map/items/glass.tscn").instantiate()) - + +func add_contents(contents: Array[String]): for i in contents: var item: Item match i: diff --git a/client/map/items/pan.gd b/client/map/items/pan.gd index 11f80deb..497d8832 100644 --- a/client/map/items/pan.gd +++ b/client/map/items/pan.gd @@ -18,12 +18,10 @@ extends Item var steam: CPUParticles3D = load("res://map/items/steam.tscn").instantiate() -func _init(owned_by_: Node3D, contents: Array): +func _init(owned_by_: Node3D): super(owned_by_) add_child(load("res://map/items/pan.tscn").instantiate()) base.add_child(steam) - for c in contents: - base.add_child(ItemFactory.produce(c, self)) func progress(position_: float, speed: float, warn: bool): super(position_, speed, warn) diff --git a/client/map/items/pot.gd b/client/map/items/pot.gd index 5c9623a2..77c8ebd1 100644 --- a/client/map/items/pot.gd +++ b/client/map/items/pot.gd @@ -18,11 +18,12 @@ extends Item var steam: CPUParticles3D = load("res://map/items/steam.tscn").instantiate() -func _init(owned_by_: Node3D, contents: Array): +func _init(owned_by_: Node3D): super(owned_by_) add_child(load("res://map/items/pot.tscn").instantiate()) base.add_child(steam) - + +func add_contents(contents: Array[String]): for i in contents: match i: "cheese-leek-soup": @@ -49,7 +50,7 @@ func _init(owned_by_: Node3D, contents: Array): "milk": add_child(PotFill.new(self, Color8(250, 250, 250))) _: - base.add_child(ItemFactory.produce(i, self)) + super([i]) func progress(position_: float, speed: float, warn: bool): super(position_, speed, warn) |