aboutsummaryrefslogtreecommitdiff
path: root/client/map/items
diff options
context:
space:
mode:
Diffstat (limited to 'client/map/items')
-rw-r--r--client/map/items/bread.gd8
-rw-r--r--client/map/items/food_processor.gd17
-rw-r--r--client/map/items/item.gd13
-rw-r--r--client/map/items/pot.gd8
-rw-r--r--client/map/items/pot_items.gd4
-rw-r--r--client/map/items/strawberry.gd8
-rw-r--r--client/map/items/tomato.gd8
7 files changed, 36 insertions, 30 deletions
diff --git a/client/map/items/bread.gd b/client/map/items/bread.gd
index b5143c53..a3c109e1 100644
--- a/client/map/items/bread.gd
+++ b/client/map/items/bread.gd
@@ -25,10 +25,10 @@ func _init(owned_by_: Node3D):
steam.color = Color(.6, .6, .6, .4)
base.add_child(steam)
-func progress(p: float, warn: bool):
- super(p, warn)
+func progress(position_: float, speed: float, warn: bool):
+ super(position_, speed, warn)
steam.emitting = warn
-func finish(warn: bool):
- super(warn)
+func finish():
+ super()
steam.emitting = false
diff --git a/client/map/items/food_processor.gd b/client/map/items/food_processor.gd
index 66d78168..81886ae7 100644
--- a/client/map/items/food_processor.gd
+++ b/client/map/items/food_processor.gd
@@ -16,6 +16,7 @@
class_name FoodProcessor
extends Item
+var time := 0.
var processing: CPUParticles3D = load("res://map/items/processing.tscn").instantiate()
func _init(owned_by_: Node3D):
@@ -23,11 +24,15 @@ func _init(owned_by_: Node3D):
add_child(load("res://map/items/food_processor.tscn").instantiate())
add_child(processing)
-func progress(p: float, warn: bool):
- super(p, warn)
+func _process(delta: float):
+ super(delta)
+ time += delta
+ processing.rotation.y += time * TAU
+ base.rotation.y += time * TAU
+
+func progress(position_: float, speed: float, warn: bool):
+ super(position_, speed, warn)
processing.emitting = true
- processing.rotation.y += p * TAU
- base.rotation.y += p * TAU
if sound_id == null:
sound_id = Sound.item_progress(
self,
@@ -36,8 +41,8 @@ func progress(p: float, warn: bool):
-10.
)
-func finish(warn: bool):
- super(warn)
+func finish():
+ super()
if sound_id != null:
processing.emitting = false
Sound.item_finished(sound_id)
diff --git a/client/map/items/item.gd b/client/map/items/item.gd
index 2d046700..11914eef 100644
--- a/client/map/items/item.gd
+++ b/client/map/items/item.gd
@@ -50,14 +50,15 @@ func _process(delta):
if p: rotation.y = G.interpolate_angle(rotation.y, owned_by.global_rotation.y, delta * ispeed)
else: rotation.y = G.interpolate_angle_closest_quarter(rotation.y, owned_by.global_rotation.y, delta * ispeed)
-func progress(p: float, warn: bool):
+func progress(position_: float, speed: float, warn: bool):
progress_instance.visible = true
- progress_instance.set_progress(p, warn)
- # this shoukd be removed when the server is fixed
- if p >= 1.:
- finish(warn)
+ progress_instance.update(position_, speed, warn)
+
+ # TODO: Fix finish
+ # if p >= 1.:
+ # finish(warn)
-func finish(_warn: bool):
+func finish():
progress_instance.visible = false
func setup_sounds():
diff --git a/client/map/items/pot.gd b/client/map/items/pot.gd
index dd5a6c6f..2bed6a5c 100644
--- a/client/map/items/pot.gd
+++ b/client/map/items/pot.gd
@@ -23,16 +23,16 @@ func _init(owned_by_: Node3D):
add_child(load("res://map/items/pot.tscn").instantiate())
base.add_child(steam)
-func progress(p: float, warn: bool):
- super(p, warn)
+func progress(position_: float, speed: float, warn: bool):
+ super(position_, speed, warn)
steam.emitting = true
if warn:
steam.color = Color(.2, .2, .2)
else:
steam.color = Color(1.,1.,1.)
-func finish(warn: bool):
- super(warn)
+func finish():
+ super()
steam.emitting = false
func setup_sounds():
diff --git a/client/map/items/pot_items.gd b/client/map/items/pot_items.gd
index fae2ccaa..25fd74d3 100644
--- a/client/map/items/pot_items.gd
+++ b/client/map/items/pot_items.gd
@@ -51,8 +51,8 @@ class RawSteakP extends Pot:
super(owned_by_)
base.add_child(preload("res://map/items/raw_steak.tscn").instantiate())
- func progress(p: float, warn: bool):
- super(p, warn)
+ func progress(position_: float, speed: float, warn: bool):
+ super(position_, speed, warn)
if sound_id == null:
sound_id = Sound.item_progress(self, preload("res://map/items/sounds/frying.ogg"), null)
diff --git a/client/map/items/strawberry.gd b/client/map/items/strawberry.gd
index ef9abb64..f2a1165a 100644
--- a/client/map/items/strawberry.gd
+++ b/client/map/items/strawberry.gd
@@ -24,10 +24,10 @@ func _init(owned_by_: Node3D):
base.add_child(cut)
cut.color = Color(1., 0., 0.)
-func progress(p: float, warn: bool):
- super(p, warn)
+func progress(position_: float, speed: float, warn: bool):
+ super(position_, speed, warn)
cut.emitting = true
-func finish(warn: bool):
- super(warn)
+func finish():
+ super()
cut.emitting = false
diff --git a/client/map/items/tomato.gd b/client/map/items/tomato.gd
index 97cd668c..082b2b19 100644
--- a/client/map/items/tomato.gd
+++ b/client/map/items/tomato.gd
@@ -24,10 +24,10 @@ func _init(owned_by_: Node3D):
base.add_child(cut)
cut.color = Color(1., 0., 0.)
-func progress(p: float, warn: bool):
- super(p, warn)
+func progress(position_: float, speed: float, warn: bool):
+ super(position_, speed, warn)
cut.emitting = true
-func finish(warn: bool):
- super(warn)
+func finish():
+ super()
cut.emitting = false