Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f01e20700 | |||
| 4242325c8a | |||
| 48c9845624 | |||
| 3d616bf4a5 |
@@ -91,6 +91,10 @@ func _add_item(item: Node3D) -> void:
|
||||
plate_controller.contained_ids = updated
|
||||
|
||||
NetworkManager.despawn_item(item)
|
||||
# In case the container is on a table that needs to register this addition,
|
||||
# ask all table in scene to absorb any new items.
|
||||
print("Container group call absorb_items()")
|
||||
get_tree().call_group("table", "absorb_items")
|
||||
|
||||
|
||||
func erase_item(item: FoodItem) -> void:
|
||||
|
||||
@@ -13,6 +13,8 @@ extends Node
|
||||
## the cosmetic result via the setter below.
|
||||
@export var contained_ids: Array[String] = []: set = _set_contained_ids
|
||||
|
||||
func get_food_items() -> Array[FoodItem]:
|
||||
return container.contained_items
|
||||
|
||||
func _ready() -> void:
|
||||
if not dirty_node:
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@ enum GameState {
|
||||
}
|
||||
static var game_state: GameState = GameState.RUNNING
|
||||
|
||||
|
||||
|
||||
static func _restart():
|
||||
print("restart Game")
|
||||
game_state = GameState.RUNNING
|
||||
@@ -27,15 +27,15 @@ static func get_random_meal() -> String:
|
||||
|
||||
|
||||
static func get_random_side() -> String:
|
||||
print("GameManager: get_random_side() ")
|
||||
if sides_in_play.size() == 0:
|
||||
push_error("GameManager: get_random_side() called but sides_in_play is empty")
|
||||
return ""
|
||||
var rand_index = randi() % sides_in_play.size()
|
||||
print("GameManager: get_random_side() returning ", sides_in_play[rand_index])
|
||||
print("GameManager: get_random_side() list=%s returning %s" % [sides_in_play, sides_in_play[rand_index]])
|
||||
return sides_in_play[rand_index]
|
||||
|
||||
|
||||
|
||||
static func game_over():
|
||||
print("Game Over")
|
||||
game_state = GameState.GAME_OVER
|
||||
|
||||
@@ -57,7 +57,7 @@ func _on_body_entered(body: Node3D) -> void:
|
||||
print("CombinableItem _on_body_entered: other is our own pickable")
|
||||
return
|
||||
|
||||
var other := _find_food_item(body)
|
||||
var other := Helper.find_food_item(body)
|
||||
if not other:
|
||||
print("CombinableItem _on_body_entered: other is not a foodItem")
|
||||
return
|
||||
@@ -71,7 +71,7 @@ func _on_body_entered(body: Node3D) -> void:
|
||||
|
||||
# Instantiate the result of combination and free the two ingredient items
|
||||
func _combine(other_body: Node3D, result: PackedScene) -> void:
|
||||
print("CombinableItem _combine: combining %s + %s into %s" % [_food_item.id, _find_food_item(other_body).id, result.resource_path])
|
||||
print("CombinableItem _combine: combining %s + %s into %s" % [_food_item.id, Helper.find_food_item(other_body).id, result.resource_path])
|
||||
|
||||
# Get Snapzone
|
||||
var snap_zone := _pickable.get_picked_up_by()
|
||||
@@ -91,13 +91,3 @@ func _combine(other_body: Node3D, result: PackedScene) -> void:
|
||||
|
||||
# Snap the result into the now-empty zone.
|
||||
snap_zone.pick_up_object(result_instance)
|
||||
|
||||
|
||||
# Find a FoodItem among the direct children of [param node].
|
||||
func _find_food_item(node: Node) -> FoodItem:
|
||||
if not node:
|
||||
return null
|
||||
for child in node.get_children():
|
||||
if child is FoodItem:
|
||||
return child
|
||||
return null
|
||||
|
||||
@@ -7,3 +7,4 @@ enum Type { MEAL, SIDE, INGREDIENT, NONE }
|
||||
@export var id: String
|
||||
@export var type: Type = Type.NONE
|
||||
@export var sell_value = 1
|
||||
var is_absorbed = false # Used by tables to keep track of whether the item has been registered as delivered already
|
||||
+360
-2
@@ -4,12 +4,23 @@
|
||||
[ext_resource type="PackedScene" uid="uid://j5s5wus7tuhb" path="res://XROrigin.tscn" id="2_o1b3t"]
|
||||
[ext_resource type="Material" uid="uid://cmia50cfqxxo4" path="res://textures/dev_material_3d.tres" id="3_irf4n"]
|
||||
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="7_n8fyw"]
|
||||
[ext_resource type="PackedScene" uid="uid://q37nqadkibbp" path="res://scenes/door.tscn" id="10_l51r2"]
|
||||
[ext_resource type="PackedScene" uid="uid://b3m2ag8g5rj4r" path="res://items/hamburger.tscn" id="11_c8vo7"]
|
||||
[ext_resource type="PackedScene" uid="uid://da6yrsnxvsrif" path="res://scenes/wall.tscn" id="11_slo47"]
|
||||
[ext_resource type="PackedScene" uid="uid://bp3v1jl8pctro" path="res://Containers/plate.tscn" id="12_1f3bw"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbg7dwsbxxh1t" path="res://scenes/cube_side_dispense.tscn" id="12_57ppd"]
|
||||
[ext_resource type="PackedScene" uid="uid://dlw5geheupgpt" path="res://stations/hatch.tscn" id="12_dpf3b"]
|
||||
[ext_resource type="PackedScene" uid="uid://e4i6o5oriecx" path="res://items/PickupCube.tscn" id="13_1f3bw"]
|
||||
[ext_resource type="PackedScene" uid="uid://caf0xanmxbshy" path="res://stations/table.tscn" id="13_yjosk"]
|
||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob.tscn" id="14_2ndvi"]
|
||||
[ext_resource type="PackedScene" uid="uid://clujaf3u776a3" path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" id="14_di04w"]
|
||||
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="15_di04w"]
|
||||
[ext_resource type="PackedScene" uid="uid://xtcei2uvd5li" path="res://UI/game_over_panel.tscn" id="15_eoxxy"]
|
||||
[ext_resource type="PackedScene" uid="uid://bu6jt26pq2y0k" path="res://content/static_resturants/resturant.tscn" id="15_ubjeu"]
|
||||
[ext_resource type="PackedScene" uid="uid://ck5tuftqmyiue" path="res://stations/plate_dispenser.tscn" id="15_qxyk8"]
|
||||
[ext_resource type="Script" uid="uid://cwijoksyou1ey" path="res://scenes/GameOvercontroler.gd" id="16_n8fyw"]
|
||||
[ext_resource type="PackedScene" uid="uid://dvrk268s7gkxh" path="res://stations/sink.tscn" id="16_u5c1m"]
|
||||
[ext_resource type="PackedScene" uid="uid://cwnwo4i28upap" path="res://stations/raw_burger_dispenser.tscn" id="17_y7baw"]
|
||||
[ext_resource type="PackedScene" uid="uid://c6rift56ql3f8" path="res://stations/BurgerBunsDispenser.tscn" id="18_wvcs1"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_bvwq1"]
|
||||
background_mode = 2
|
||||
@@ -33,6 +44,24 @@ size = Vector3(20, 0.1, 20)
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_24d3s"]
|
||||
size = Vector3(20, 10, 0.1)
|
||||
|
||||
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_vlqg6"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_24d3s"]
|
||||
albedo_color = Color(0.35, 0.12250001, 0.12250001, 1)
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_vlqg6"]
|
||||
material = SubResource("StandardMaterial3D_24d3s")
|
||||
size = Vector2(6, 10)
|
||||
center_offset = Vector3(3, 0, 0)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_yqrpd"]
|
||||
albedo_color = Color(0.35, 0.35, 0.35, 1)
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_kk3mq"]
|
||||
material = SubResource("StandardMaterial3D_yqrpd")
|
||||
size = Vector2(6, 10)
|
||||
center_offset = Vector3(-3, 0, 0)
|
||||
|
||||
[node name="Main" type="Node3D" unique_id=1312265607]
|
||||
script = ExtResource("1_57ppd")
|
||||
|
||||
@@ -111,5 +140,334 @@ script = ExtResource("16_n8fyw")
|
||||
[node name="CubeSideDispenser2" parent="." unique_id=200950572 instance=ExtResource("12_57ppd")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.8484511, 0, 2.9119425)
|
||||
|
||||
[node name="Resturant" parent="." unique_id=1083608050 instance=ExtResource("15_ubjeu")]
|
||||
[node name="Resturant" type="Node3D" parent="." unique_id=1083608050]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.6212463e-05, -0.010500789, 0.0014204979)
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="Resturant" unique_id=1814285538]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Resturant/StaticBody3D" unique_id=1661443874]
|
||||
shape = SubResource("WorldBoundaryShape3D_vlqg6")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Resturant" unique_id=888732490]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0, 0.01, 0)
|
||||
mesh = SubResource("PlaneMesh_vlqg6")
|
||||
|
||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Resturant" unique_id=836421800]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0, 0.01, 0)
|
||||
mesh = SubResource("PlaneMesh_kk3mq")
|
||||
|
||||
[node name="Door" parent="Resturant" unique_id=964400290 instance=ExtResource("10_l51r2")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4, 0, 0)
|
||||
|
||||
[node name="Walls" type="Node3D" parent="Resturant" unique_id=1804204696]
|
||||
|
||||
[node name="Wall" parent="Resturant/Walls" unique_id=434181749 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.6000001, 0, 0)
|
||||
|
||||
[node name="Wall2" parent="Resturant/Walls" unique_id=1183111925 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.2, 0, 0)
|
||||
|
||||
[node name="Wall3" parent="Resturant/Walls" unique_id=1561473949 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.8, 0, 0)
|
||||
|
||||
[node name="Wall4" parent="Resturant/Walls" unique_id=1593528497 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.60000014, 0, 0)
|
||||
|
||||
[node name="Wall5" parent="Resturant/Walls" unique_id=2071060763 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.3841858e-07, 0, 0)
|
||||
|
||||
[node name="Wall6" parent="Resturant/Walls" unique_id=1607012472 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5999999, 0, 0)
|
||||
|
||||
[node name="Wall7" parent="Resturant/Walls" unique_id=990512055 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.8, 0, 0)
|
||||
|
||||
[node name="Wall8" parent="Resturant/Walls" unique_id=751907897 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.200001, 0, 0)
|
||||
|
||||
[node name="Wall9" parent="Resturant/Walls" unique_id=358743133 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.6000004, 0, 0)
|
||||
|
||||
[node name="Wall10" parent="Resturant/Walls" unique_id=1374842161 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.2000002, 0, 0)
|
||||
|
||||
[node name="Wall11" parent="Resturant/Walls" unique_id=1408132826 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8000002, 0, 0)
|
||||
|
||||
[node name="Wall12" parent="Resturant/Walls" unique_id=1937209307 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.60000014, 0, -6)
|
||||
|
||||
[node name="Wall13" parent="Resturant/Walls" unique_id=1714975985 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.3841858e-07, 0, -6)
|
||||
|
||||
[node name="Wall14" parent="Resturant/Walls" unique_id=1732121903 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5999999, 0, -6)
|
||||
|
||||
[node name="Wall15" parent="Resturant/Walls" unique_id=1311494308 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.2000002, 0, -6)
|
||||
|
||||
[node name="Wall16" parent="Resturant/Walls" unique_id=364484178 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8000002, 0, -6)
|
||||
|
||||
[node name="Wall17" parent="Resturant/Walls" unique_id=485501605 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.3999999, 0, -6)
|
||||
|
||||
[node name="Wall18" parent="Resturant/Walls" unique_id=378206350 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.9999998, 0, -6)
|
||||
|
||||
[node name="Wall19" parent="Resturant/Walls" unique_id=294380188 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.6, 0, -6)
|
||||
|
||||
[node name="Wall20" parent="Resturant/Walls" unique_id=1122365254 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.7999998, 0, -6)
|
||||
|
||||
[node name="Wall21" parent="Resturant/Walls" unique_id=111446334 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1999998, 0, -6)
|
||||
|
||||
[node name="Wall22" parent="Resturant/Walls" unique_id=999769595 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.6000001, 0, -6)
|
||||
|
||||
[node name="Wall23" parent="Resturant/Walls" unique_id=1832835858 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.0000002, 0, -6)
|
||||
|
||||
[node name="Wall24" parent="Resturant/Walls" unique_id=927052367 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4, 0, -6)
|
||||
|
||||
[node name="Wall25" parent="Resturant/Walls" unique_id=1163278593 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.2000003, 0, -6)
|
||||
|
||||
[node name="Wall26" parent="Resturant/Walls" unique_id=1074868471 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.8, 0, -6)
|
||||
|
||||
[node name="Wall27" parent="Resturant/Walls" unique_id=510219954 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.2, 0, -6)
|
||||
|
||||
[node name="Wall28" parent="Resturant/Walls" unique_id=1615161517 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.8, 0, -6)
|
||||
|
||||
[node name="Wall29" parent="Resturant/Walls" unique_id=11605666 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.60000014, 0, 6)
|
||||
|
||||
[node name="Wall30" parent="Resturant/Walls" unique_id=2032513926 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.3841858e-07, 0, 6)
|
||||
|
||||
[node name="Wall31" parent="Resturant/Walls" unique_id=1308803807 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5999999, 0, 6)
|
||||
|
||||
[node name="Wall32" parent="Resturant/Walls" unique_id=493869823 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.2000002, 0, 6)
|
||||
|
||||
[node name="Wall33" parent="Resturant/Walls" unique_id=699535234 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8000002, 0, 6)
|
||||
|
||||
[node name="Wall34" parent="Resturant/Walls" unique_id=238973326 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.3999999, 0, 6)
|
||||
|
||||
[node name="Wall35" parent="Resturant/Walls" unique_id=836717647 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.9999998, 0, 6)
|
||||
|
||||
[node name="Wall36" parent="Resturant/Walls" unique_id=446988148 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.6, 0, 6)
|
||||
|
||||
[node name="Wall37" parent="Resturant/Walls" unique_id=49950412 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.7999998, 0, 6)
|
||||
|
||||
[node name="Wall38" parent="Resturant/Walls" unique_id=607255208 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1999998, 0, 6)
|
||||
|
||||
[node name="Wall39" parent="Resturant/Walls" unique_id=1089866573 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.6000001, 0, 6)
|
||||
|
||||
[node name="Wall40" parent="Resturant/Walls" unique_id=2078240231 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.0000002, 0, 6)
|
||||
|
||||
[node name="Wall41" parent="Resturant/Walls" unique_id=592669722 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4, 0, 6)
|
||||
|
||||
[node name="Wall42" parent="Resturant/Walls" unique_id=1393176200 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.2000003, 0, 6)
|
||||
|
||||
[node name="Wall43" parent="Resturant/Walls" unique_id=1885346301 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.8, 0, 6)
|
||||
|
||||
[node name="Wall44" parent="Resturant/Walls" unique_id=2021916640 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.2, 0, 6)
|
||||
|
||||
[node name="Wall45" parent="Resturant/Walls" unique_id=1289086279 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.8, 0, 6)
|
||||
|
||||
[node name="Wall46" parent="Resturant/Walls" unique_id=396503450 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8, 0, 1.2000003)
|
||||
|
||||
[node name="Wall47" parent="Resturant/Walls" unique_id=300373285 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8, 0, 0.6000004)
|
||||
|
||||
[node name="Wall49" parent="Resturant/Walls" unique_id=1072273787 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8, 0, 1.8000002)
|
||||
|
||||
[node name="Wall50" parent="Resturant/Walls" unique_id=896022741 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8, 0, 2.4000006)
|
||||
|
||||
[node name="Wall51" parent="Resturant/Walls" unique_id=2089599721 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8000007, 0, -1.7999992)
|
||||
|
||||
[node name="Wall52" parent="Resturant/Walls" unique_id=965479737 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8000007, 0, -2.3999996)
|
||||
|
||||
[node name="Wall53" parent="Resturant/Walls" unique_id=43762332 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8000007, 0, -3)
|
||||
|
||||
[node name="Wall54" parent="Resturant/Walls" unique_id=921007094 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8000007, 0, -1.1999998)
|
||||
|
||||
[node name="Wall55" parent="Resturant/Walls" unique_id=2144411980 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8, 0, -0.5999994)
|
||||
|
||||
[node name="Wall56" parent="Resturant/Walls" unique_id=370330637 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8, 0, 4.2000003)
|
||||
|
||||
[node name="Wall57" parent="Resturant/Walls" unique_id=537562206 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8, 0, 3.6000004)
|
||||
|
||||
[node name="Wall58" parent="Resturant/Walls" unique_id=1918288432 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8, 0, 3.0000002)
|
||||
|
||||
[node name="Wall59" parent="Resturant/Walls" unique_id=944759951 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8, 0, 4.8000007)
|
||||
|
||||
[node name="Wall60" parent="Resturant/Walls" unique_id=1128237563 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8, 0, 5.4000006)
|
||||
|
||||
[node name="Wall61" parent="Resturant/Walls" unique_id=1755969864 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8000007, 0, -3.5999994)
|
||||
|
||||
[node name="Wall62" parent="Resturant/Walls" unique_id=949006312 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8000007, 0, -4.2)
|
||||
|
||||
[node name="Wall63" parent="Resturant/Walls" unique_id=1826688195 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8000007, 0, -4.799999)
|
||||
|
||||
[node name="Wall64" parent="Resturant/Walls" unique_id=116523059 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -4.8000007, 0, -5.3999996)
|
||||
|
||||
[node name="Wall65" parent="Resturant/Walls" unique_id=711153775 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.8, 0, 1.2000003)
|
||||
|
||||
[node name="Wall66" parent="Resturant/Walls" unique_id=741047 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.8, 0, 0.6000004)
|
||||
|
||||
[node name="Wall67" parent="Resturant/Walls" unique_id=664067327 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.8, 0, 1.8000002)
|
||||
|
||||
[node name="Wall68" parent="Resturant/Walls" unique_id=1294537251 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.8, 0, 2.4000006)
|
||||
|
||||
[node name="Wall69" parent="Resturant/Walls" unique_id=1152383 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.7999997, 0, -1.7999992)
|
||||
|
||||
[node name="Wall70" parent="Resturant/Walls" unique_id=1710172322 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.7999997, 0, -2.3999996)
|
||||
|
||||
[node name="Wall71" parent="Resturant/Walls" unique_id=597518110 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.7999997, 0, -3)
|
||||
|
||||
[node name="Wall72" parent="Resturant/Walls" unique_id=1028573693 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.7999997, 0, -1.1999998)
|
||||
|
||||
[node name="Wall73" parent="Resturant/Walls" unique_id=1232042046 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.8, 0, -0.5999994)
|
||||
|
||||
[node name="Wall74" parent="Resturant/Walls" unique_id=1159091046 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.8, 0, 4.2000003)
|
||||
|
||||
[node name="Wall75" parent="Resturant/Walls" unique_id=904470924 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.8, 0, 3.6000004)
|
||||
|
||||
[node name="Wall76" parent="Resturant/Walls" unique_id=1709758099 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.8, 0, 3.0000002)
|
||||
|
||||
[node name="Wall77" parent="Resturant/Walls" unique_id=1252446997 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.8, 0, 4.8000007)
|
||||
|
||||
[node name="Wall78" parent="Resturant/Walls" unique_id=1207579491 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.8, 0, 5.4000006)
|
||||
|
||||
[node name="Wall79" parent="Resturant/Walls" unique_id=1798073342 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.7999997, 0, -3.5999994)
|
||||
|
||||
[node name="Wall80" parent="Resturant/Walls" unique_id=36005990 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.7999997, 0, -4.2)
|
||||
|
||||
[node name="Wall81" parent="Resturant/Walls" unique_id=79516947 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.7999997, 0, -4.799999)
|
||||
|
||||
[node name="Wall82" parent="Resturant/Walls" unique_id=1363235805 instance=ExtResource("11_slo47")]
|
||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4.7999997, 0, -5.3999996)
|
||||
|
||||
[node name="Hatches" type="Node3D" parent="Resturant" unique_id=1561045769]
|
||||
|
||||
[node name="ServingCounter" parent="Resturant/Hatches" unique_id=1341321603 instance=ExtResource("12_dpf3b")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2, 0, 0)
|
||||
|
||||
[node name="ServingCounter2" parent="Resturant/Hatches" unique_id=1325232371 instance=ExtResource("12_dpf3b")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.8000001, 0, 0)
|
||||
|
||||
[node name="ServingCounter3" parent="Resturant/Hatches" unique_id=539914523 instance=ExtResource("12_dpf3b")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2, 0, 0)
|
||||
|
||||
[node name="ServingCounter4" parent="Resturant/Hatches" unique_id=2078770951 instance=ExtResource("12_dpf3b")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.4, 0, 0)
|
||||
|
||||
[node name="ServingCounter5" parent="Resturant/Hatches" unique_id=2019049083 instance=ExtResource("12_dpf3b")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0)
|
||||
|
||||
[node name="Table2" parent="Resturant" unique_id=1457688277 instance=ExtResource("13_yjosk")]
|
||||
transform = Transform3D(1, 0, -1.7484555e-07, 0, 1, 0, 1.7484555e-07, 0, 1, 0.5999999, 0.48000002, -3)
|
||||
|
||||
[node name="Hob" parent="Resturant" unique_id=172418174 instance=ExtResource("14_2ndvi")]
|
||||
transform = Transform3D(1.3113416e-07, 0, -1, 0, 1, 0, 1, 0, 1.3113416e-07, 4.2000003, 0.54, 1.7999992)
|
||||
|
||||
[node name="Hob2" parent="Resturant" unique_id=980569400 instance=ExtResource("14_2ndvi")]
|
||||
transform = Transform3D(1.3113416e-07, 0, -1, 0, 1, 0, 1, 0, 1.3113416e-07, 4.200001, 0.54, 1.1999999)
|
||||
|
||||
[node name="Counter" parent="Resturant" unique_id=1487893288 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 4.200001, 0.54, 2.3999996)
|
||||
|
||||
[node name="Counter2" parent="Resturant" unique_id=5128912 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 4.200001, 0.54, 3)
|
||||
|
||||
[node name="Counter3" parent="Resturant" unique_id=1298458612 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 4.2000003, 0.54, 0.5999999)
|
||||
|
||||
[node name="Counter4" parent="Resturant" unique_id=1764980142 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(1.3113416e-07, 0, 1, 0, 1, 0, -1, 0, 1.3113416e-07, 4.7683716e-07, 0.54, 2.3999996)
|
||||
|
||||
[node name="Counter5" parent="Resturant" unique_id=1015820252 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(1.3113416e-07, 0, 1, 0, 1, 0, -1, 0, 1.3113416e-07, 4.7683716e-07, 0.54, 3)
|
||||
|
||||
[node name="PlateDispenser" parent="Resturant" unique_id=710538846 instance=ExtResource("15_qxyk8")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.6)
|
||||
|
||||
[node name="Sink" parent="Resturant" unique_id=2055277359 instance=ExtResource("16_u5c1m")]
|
||||
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0.6, 0.48000002, -0.6)
|
||||
|
||||
[node name="Counter6" parent="Resturant" unique_id=2141915043 instance=ExtResource("15_di04w")]
|
||||
transform = Transform3D(-1, 0, 8.742277e-08, 0, 1, 0, -8.742277e-08, 0, -1, 4.7683716e-07, 0.54, -0.6000006)
|
||||
|
||||
[node name="RawBurgerDispenser" parent="Resturant" unique_id=235630131 instance=ExtResource("17_y7baw")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.2)
|
||||
|
||||
[node name="BurgerBunsDispenser" parent="Resturant" unique_id=1720683779 instance=ExtResource("18_wvcs1")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.8000001)
|
||||
|
||||
[node name="Table3" parent="Resturant" unique_id=1863572470 instance=ExtResource("13_yjosk")]
|
||||
transform = Transform3D(-1, 0, 2.6226832e-07, 0, 1, 0, -2.6226832e-07, 0, -1, 3, 0.48000002, -3)
|
||||
|
||||
[node name="Hamburger" parent="." unique_id=1675596942 instance=ExtResource("11_c8vo7")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8000001, -0.6)
|
||||
|
||||
[node name="Plate" parent="." unique_id=190487773 instance=ExtResource("12_1f3bw")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.3800001, -0.6)
|
||||
|
||||
[node name="PickableObject" parent="." unique_id=1084951838 instance=ExtResource("13_1f3bw")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6, 1.2, -0.6)
|
||||
|
||||
@@ -94,8 +94,8 @@ func _populate_world_if_owner() -> void:
|
||||
layout.queue_free()
|
||||
return
|
||||
|
||||
_init_recipes()
|
||||
_populated = true
|
||||
GameManager.meals_in_play = ["hamburger"]
|
||||
var stations := layout.get_stations()
|
||||
var items := layout.get_items()
|
||||
layout.queue_free()
|
||||
@@ -108,6 +108,11 @@ func _populate_world_if_owner() -> void:
|
||||
NetworkManager.log_line("World populated")
|
||||
|
||||
|
||||
func _init_recipes():
|
||||
GameManager.meals_in_play = ["hamburger"]
|
||||
GameManager.sides_in_play = ["cube"]
|
||||
|
||||
|
||||
# Free the authored template nodes. Done immediately rather than with
|
||||
# queue_free() so the names are released before the replicated copies are
|
||||
# spawned under the same ones.
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ func _on_object_picked_up(_item) -> void:
|
||||
# The setters above already refresh the display and start the flames.
|
||||
|
||||
|
||||
func _on_object_dropped() -> void:
|
||||
func _on_object_dropped(_item) -> void:
|
||||
print("Hob: object drop ")
|
||||
time_cooked = 0
|
||||
cooking_result = ""
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ func _on_object_picked_up(_item) -> void:
|
||||
is_washing = plate.is_dirty
|
||||
|
||||
|
||||
func _on_object_dropped() -> void:
|
||||
func _on_object_dropped(_item) -> void:
|
||||
print("Sink: object drop ")
|
||||
_reset_sink()
|
||||
|
||||
|
||||
+152
-60
@@ -4,9 +4,9 @@ extends StaticBody3D
|
||||
const GAME_MANAGER = preload("res://GameManager.gd")
|
||||
|
||||
@export var thinking_duration: float = 3.0
|
||||
@export var ordering_duration: float = 40.0
|
||||
@export var primary_duration: float = 40.0
|
||||
@export var friend_duration: float = 10.0
|
||||
@export var ordering_duration: float = 50.0
|
||||
@export var primary_duration: float = 70.0
|
||||
@export var friend_duration: float = 12.0
|
||||
@export var eating_duration: float = 5.0
|
||||
@export var money_sound: AudioStream
|
||||
|
||||
@@ -43,7 +43,58 @@ enum TableState {
|
||||
var _state: TableState = TableState.EMPTY
|
||||
var _state_time: float = 0.0
|
||||
var _state_duration: float = 0.0 # set in _set_state_time
|
||||
var _original_orders: Array[String] = []
|
||||
var _unsatisfied_orders: Array[String] = []
|
||||
var _players_count: int = 0
|
||||
|
||||
|
||||
func place_order() -> void:
|
||||
print("Table place_order()")
|
||||
var new_orders: Array[String] = _unsatisfied_orders.duplicate()
|
||||
for _i in range(0, randi_range(1, 2)):
|
||||
new_orders.append(GAME_MANAGER.get_random_meal())
|
||||
for _i in range(0, randi_range(0, 1)):
|
||||
new_orders.append(GAME_MANAGER.get_random_side())
|
||||
_unsatisfied_orders = new_orders
|
||||
_original_orders = _unsatisfied_orders.duplicate()
|
||||
|
||||
|
||||
func absorb_items():
|
||||
print("Table: absorb_items()")
|
||||
for snap_zone_node in snap_zones:
|
||||
var held_object = snap_zone_node.picked_up_object
|
||||
if not held_object:
|
||||
continue
|
||||
|
||||
_absorb_item_if_correct(held_object)
|
||||
|
||||
|
||||
func satisfyAllOrders() -> void:
|
||||
print("Table: satisfyAllOrders()")
|
||||
_unsatisfied_orders.clear()
|
||||
_original_orders.clear()
|
||||
clearAllFood()
|
||||
_setState(TableState.EMPTY)
|
||||
|
||||
|
||||
func clearAllFood() -> void:
|
||||
print("Table: clearAllFood()")
|
||||
for zone in snap_zones:
|
||||
var held_object = zone.picked_up_object
|
||||
if not held_object:
|
||||
continue
|
||||
|
||||
var plate: PlateController = _get_plate_controller_from_item(held_object)
|
||||
var food_item: FoodItem = Helper.find_food_item(held_object)
|
||||
if plate:
|
||||
plate.container.clear()
|
||||
plate.is_dirty = true
|
||||
|
||||
# Side or other food item directly on table
|
||||
elif food_item and food_item.type == FoodItem.Type.SIDE:
|
||||
zone.drop_object()
|
||||
NetworkManager.despawn_item(held_object)
|
||||
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -74,7 +125,6 @@ func _ready() -> void:
|
||||
for snap_zone_node in snap_zones:
|
||||
snap_zone_node.has_picked_up.connect(_on_object_picked_up)
|
||||
snap_zone_node.has_dropped.connect(_on_object_dropped)
|
||||
player_detect_area_3d.body_entered.connect(_on_player_detected)
|
||||
set_process(true)
|
||||
_setState(TableState.EMPTY)
|
||||
|
||||
@@ -86,80 +136,118 @@ func _on_object_picked_up(_item) -> void:
|
||||
_absorb_item_if_correct(_item)
|
||||
|
||||
|
||||
func _on_object_dropped() -> void:
|
||||
print("Table: object dropped ")
|
||||
func _on_object_dropped(_item) -> void:
|
||||
print("Table: object dropped, item: ", _item)
|
||||
# If then player picks up a food_item (side) the table has already registerd, unregister
|
||||
var food_item: FoodItem = Helper.find_food_item(_item)
|
||||
if food_item and food_item.type == FoodItem.Type.SIDE:
|
||||
var original_count = _original_orders.count(food_item.id)
|
||||
var unsatisfied_count = _unsatisfied_orders.count(food_item.id)
|
||||
if original_count > unsatisfied_count:
|
||||
_unsatisfied_orders.append(food_item.id)
|
||||
|
||||
|
||||
# TODO: Use a on_stay signal or similar
|
||||
func _on_player_detected(player):
|
||||
print("Table _on_player_detected(), ", player)
|
||||
# original : burger cube, cube
|
||||
# unsatisfied : burger cube
|
||||
# table :
|
||||
|
||||
# There is no on_stay signal, we have to track player with bool
|
||||
func _on_player_enter(_body):
|
||||
_players_count += 1
|
||||
print("Table _on_player_enter() pleryers_count: ", _players_count)
|
||||
|
||||
|
||||
func _on_player_exit(_body):
|
||||
_players_count -= 1
|
||||
print("Table _on_player_exit() pleryers_count: ", _players_count)
|
||||
|
||||
|
||||
func _place_order_if_player():
|
||||
if _state != TableState.ORDERING:
|
||||
return
|
||||
|
||||
place_order()
|
||||
_setState(TableState.WAITING_PRIMARY)
|
||||
if _players_count > 0:
|
||||
place_order()
|
||||
_setState(TableState.WAITING_PRIMARY)
|
||||
|
||||
|
||||
func _get_plate_from_item(_item: Node) -> PlateController:
|
||||
return _item.get_children().filter(func(c): return c is PlateController).front() as PlateController
|
||||
# func _get_plate_controller_from_item(_item: Node) -> PlateController:
|
||||
# return _item.get_children().filter(func(c): return c is PlateController).front() as PlateController
|
||||
|
||||
|
||||
func _get_plate_controller_from_item(_item: Node) -> PlateController:
|
||||
if not _item:
|
||||
print("_item is null")
|
||||
return null
|
||||
|
||||
for child in _item.get_children():
|
||||
if child is PlateController:
|
||||
print("found child")
|
||||
return child
|
||||
|
||||
print("no match")
|
||||
return null
|
||||
|
||||
|
||||
# TODO: Handle a case where a side is added to a plate after it's served.
|
||||
func _absorb_item_if_correct(_item: Node) -> void:
|
||||
print("Table _absorb_item_if_correct, item: ", _item)
|
||||
if not _item:
|
||||
return
|
||||
|
||||
# Get plate controller in childer of _item (hopefully a plate XRpickable)
|
||||
var plate_controller = _get_plate_from_item(_item)
|
||||
if not plate_controller:
|
||||
print("Table: held object is not a Plate")
|
||||
if not (_state == TableState.WAITING_PRIMARY or _state == TableState.WAITING_FRIEND):
|
||||
return
|
||||
#print("Table: held a Plate!")
|
||||
|
||||
# Absorm items from the plate we want
|
||||
for food_item in plate_controller.container.contained_items:
|
||||
#print("Table: held a plate with FoodItem: ", food_item.id)
|
||||
if food_item.id in _unsatisfied_orders:
|
||||
print("Table: held a plate with FoodItem that is in unsatisfied orders, removing it")
|
||||
_unsatisfied_orders.erase(food_item.id)
|
||||
(plate_controller.get_parent() as XRToolsPickable).get_picked_up_by().enabled = false # Lock meal that is deliverd
|
||||
print("Table _unsatisfied_orders: ", _unsatisfied_orders)
|
||||
if _unsatisfied_orders.size() > 0 and _state != TableState.EATING:
|
||||
_setState(TableState.WAITING_FRIEND)
|
||||
# Plate: Get plate controller in child of _item (hopefully a plate XRpickable)
|
||||
var plate_controller = _get_plate_controller_from_item(_item)
|
||||
print("Table _absorb_item_if_correct plate_controller ref: ", plate_controller)
|
||||
_item.print_tree_pretty()
|
||||
|
||||
if plate_controller:
|
||||
# Absorm items from the plate we want
|
||||
for food_item: FoodItem in plate_controller.container.contained_items: # TOOD: handle registering the meal again when a side is added to the plate
|
||||
if food_item.id in _unsatisfied_orders and not food_item.is_absorbed:
|
||||
print("Table: _absorb_item_if_correct held a plate with FoodItem that is in unsatisfied orders, removing it")
|
||||
(plate_controller.get_parent() as XRToolsPickable).get_picked_up_by().enabled = false # Lock meal that is deliverd
|
||||
_unsatisfied_orders.erase(food_item.id)
|
||||
food_item.is_absorbed = true
|
||||
_update_state_from_orders()
|
||||
return
|
||||
|
||||
# Side pickable item, no container
|
||||
var food_item: FoodItem = Helper.find_food_item(_item)
|
||||
if food_item and food_item.type == FoodItem.Type.SIDE:
|
||||
print("Table: _absorb_item_if_correct held a side that is in unsatisfied orders, removing it")
|
||||
# Do not lock snap zone here. Problem if table want many meals, but to many sides have filled up slots, so can't place plates.
|
||||
_unsatisfied_orders.erase(food_item.id)
|
||||
_update_state_from_orders()
|
||||
return
|
||||
|
||||
# Table has everything it wants. Start eating
|
||||
elif _unsatisfied_orders.is_empty() and _state != TableState.EATING:
|
||||
GAME_MANAGER.money += food_item.sell_value
|
||||
audio_player.stream = money_sound
|
||||
audio_player.play()
|
||||
_setState(TableState.EATING)
|
||||
print("Table: absorb_item_if_correct() held object is not a Plate or Side")
|
||||
|
||||
|
||||
func place_order() -> void:
|
||||
print("Table: place_order()")
|
||||
var new_orders = _unsatisfied_orders.duplicate()
|
||||
new_orders.append(GAME_MANAGER.get_random_meal())
|
||||
new_orders.append(GAME_MANAGER.get_random_meal())
|
||||
_unsatisfied_orders = new_orders
|
||||
func _update_state_from_orders():
|
||||
print("Table _update_state_from_orders: unsatisfied_orders: ", _unsatisfied_orders)
|
||||
if _unsatisfied_orders.size() > 0 and _state != TableState.EATING:
|
||||
_setState(TableState.WAITING_FRIEND)
|
||||
|
||||
# Table has everything it wants. Start eating
|
||||
elif _unsatisfied_orders.is_empty() and _state != TableState.EATING:
|
||||
_setState(TableState.EATING)
|
||||
|
||||
|
||||
func satisfyAllOrders() -> void:
|
||||
print("Table: satisfyAllOrders()")
|
||||
_unsatisfied_orders.clear()
|
||||
clearAllPlates()
|
||||
_setState(TableState.EMPTY)
|
||||
|
||||
|
||||
func clearAllPlates() -> void:
|
||||
print("Table: clearAllPlates()")
|
||||
func _collect_money_from_food():
|
||||
for snap_zone_node in snap_zones:
|
||||
var held_object = snap_zone_node.picked_up_object
|
||||
if not held_object:
|
||||
continue
|
||||
|
||||
var plate = _get_plate_from_item(held_object)
|
||||
var plate: PlateController = _get_plate_controller_from_item(held_object)
|
||||
var food_item: FoodItem = Helper.find_food_item(held_object)
|
||||
if plate:
|
||||
plate.container.clear()
|
||||
plate.is_dirty = true
|
||||
for fi: FoodItem in plate.get_food_items():
|
||||
GAME_MANAGER.money += fi.sell_value
|
||||
elif food_item:
|
||||
GAME_MANAGER.money += food_item.sell_value
|
||||
|
||||
print("Table _collect_money_from_food(), money: ", GAME_MANAGER.money)
|
||||
|
||||
|
||||
func _set_snap_zones_enabled(value: bool) -> void:
|
||||
@@ -174,8 +262,8 @@ func _setState(newState: TableState) -> void:
|
||||
|
||||
match newState:
|
||||
TableState.EMPTY:
|
||||
_state_time = 5.0
|
||||
_state_duration = 5.0
|
||||
_state_time = randf_range(3, 7)
|
||||
_state_duration = _state_time
|
||||
customers.visible = false
|
||||
_state = newState
|
||||
TableState.THINKING:
|
||||
@@ -200,11 +288,13 @@ func _setState(newState: TableState) -> void:
|
||||
TableState.EATING:
|
||||
_state_time = eating_duration
|
||||
_state_duration = eating_duration
|
||||
_collect_money_from_food()
|
||||
_set_snap_zones_enabled(false)
|
||||
audio_player.stream = money_sound
|
||||
audio_player.play()
|
||||
_state = newState
|
||||
|
||||
|
||||
|
||||
# When state timer is finished, do this stuff before moving to next state
|
||||
func _state_end(oldState: TableState):
|
||||
print("Table State END : ", TableState.keys()[oldState])
|
||||
@@ -217,7 +307,7 @@ func _state_end(oldState: TableState):
|
||||
_setState(TableState.ORDERING)
|
||||
|
||||
TableState.EATING:
|
||||
clearAllPlates()
|
||||
clearAllFood()
|
||||
_set_snap_zones_enabled(true)
|
||||
_setState(TableState.EMPTY)
|
||||
|
||||
@@ -240,7 +330,7 @@ func _refresh_display() -> void:
|
||||
match _state:
|
||||
TableState.EMPTY:
|
||||
progress_bar.set_bar_visible(false)
|
||||
label_3d.text = "empty"
|
||||
label_3d.text = ""
|
||||
TableState.THINKING:
|
||||
progress_bar.set_bar_visible(false)
|
||||
label_3d.text = lbl_thinking
|
||||
@@ -266,6 +356,8 @@ func _refresh_display() -> void:
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
_refresh_display()
|
||||
_place_order_if_player()
|
||||
|
||||
# Wait for state to finish
|
||||
if _state_time > 0.0:
|
||||
_state_time = max(0.0, _state_time - delta)
|
||||
|
||||
+5
-2
@@ -29,7 +29,7 @@ properties/2/replication_mode = 1
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
||||
size = Vector3(2.1, 0.5, 2.1)
|
||||
|
||||
[node name="Table" type="StaticBody3D" unique_id=1863572470 groups=["station"]]
|
||||
[node name="Table" type="StaticBody3D" unique_id=1863572470 groups=["station", "table"]]
|
||||
script = ExtResource("1_2vcpj")
|
||||
money_sound = ExtResource("2_jslhm")
|
||||
|
||||
@@ -187,7 +187,7 @@ vertical_alignment = 0
|
||||
line_spacing = -15.0
|
||||
|
||||
[node name="Label3DTime" type="Label3D" parent="." unique_id=1534849507]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4532461, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.513246, 0)
|
||||
pixel_size = 0.003
|
||||
billboard = 2
|
||||
text = "20.1s"
|
||||
@@ -207,3 +207,6 @@ collision_mask = 524288
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerDetectArea3D" unique_id=1538221021]
|
||||
shape = SubResource("BoxShape3D_vlqg6")
|
||||
|
||||
[connection signal="body_entered" from="PlayerDetectArea3D" to="." method="_on_player_enter"]
|
||||
[connection signal="body_exited" from="PlayerDetectArea3D" to="." method="_on_player_exit"]
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
|
||||
|
||||
|
||||
- Move recipes into a Yaml file that is read, and handles symetry through a Static manager class?
|
||||
A `FoodItem` has an ID.
|
||||
Example:
|
||||
```yaml
|
||||
combining: # The combinging of two items, entries always have a list of exactly two items
|
||||
cooked_burger:
|
||||
- cooked_burger
|
||||
- burger_buns
|
||||
dough:
|
||||
- flour
|
||||
- water
|
||||
|
||||
cooking:
|
||||
cooked_burger:
|
||||
ingredient: raw_burger
|
||||
time: 3
|
||||
charcoal:
|
||||
ingredient: cooked_burger
|
||||
time: 4
|
||||
charcoal:
|
||||
ingredient: toast
|
||||
time: 2
|
||||
|
||||
augmenting: # Process of adding an item onto another without changing it's type, but toggling attributes.
|
||||
cooked_burger:
|
||||
has_tomato: sliced_tomato
|
||||
has_cheese: cheese
|
||||
salad:
|
||||
has_tomato: sliced_tomato
|
||||
has_olives: olives
|
||||
|
||||
chopping:
|
||||
salad:
|
||||
ingredient: lettuce
|
||||
work: 50 # Wave arms faster makes work go faster
|
||||
|
||||
rolling:
|
||||
pie_base:
|
||||
ingredient: dough
|
||||
work: 80
|
||||
```
|
||||
```py
|
||||
on_area_enter(other):
|
||||
var result = RecipeManager.getCombination(my_id, other_id)
|
||||
if result:
|
||||
convertInto(result)
|
||||
```
|
||||
|
||||
- Counters are stations like hobs that convert items by chopping, rolling ect depending on `RecipeManager`,
|
||||
and only converts items after hand gestures are done enough?
|
||||
|
||||
- Plates are lists of `FoodItems`?
|
||||
Plate[`Hamburger`] accepts `Chips` => Plate[`Hamburger`, `Chips`]
|
||||
Plate[`Hamburger`, `Chips`] accepts `Cheese` => Plate[`Hamburger(Cheese=true)`, `Chips`]
|
||||
The logic for combining has to be expanded for plates.
|
||||
- Plates have a property `is_dirty` they get after a customer clears the plate, and is disabled after being processed in `Sink`
|
||||
@@ -17,6 +17,7 @@ transparent_bg = true
|
||||
size = Vector2i(320, 80)
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="Sprite3D/SubViewport" unique_id=727723524]
|
||||
custom_minimum_size = Vector2(0, 400)
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
@@ -30,3 +31,4 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
show_percentage = false
|
||||
|
||||
@@ -7,7 +7,7 @@ extends Area3D
|
||||
signal has_picked_up(what)
|
||||
|
||||
## Signal emitted when the snap-zone drops something
|
||||
signal has_dropped
|
||||
signal has_dropped(what)
|
||||
|
||||
# Signal emitted when the highlight state changes
|
||||
signal highlight_updated(pickable, enable)
|
||||
@@ -164,9 +164,9 @@ func drop_object() -> void:
|
||||
return
|
||||
|
||||
# let go of this object
|
||||
has_dropped.emit(picked_up_object)
|
||||
picked_up_object.let_go(self, Vector3.ZERO, Vector3.ZERO)
|
||||
picked_up_object = null
|
||||
has_dropped.emit()
|
||||
highlight_updated.emit(self, enabled)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
class_name Helper
|
||||
|
||||
# Find a FoodItem among the direct children of [param node].
|
||||
static func find_food_item(node: Node) -> FoodItem:
|
||||
if not node:
|
||||
return null
|
||||
for child in node.get_children():
|
||||
if child is FoodItem:
|
||||
return child
|
||||
return null
|
||||
@@ -0,0 +1 @@
|
||||
uid://cx1wi21lhnimb
|
||||
@@ -4,3 +4,18 @@ function_pickup.gd:
|
||||
Add nil check in func _pick_up_object(target: Node3D)
|
||||
440: if target and target.has_method("pick_up"):
|
||||
target.pick_up(self)
|
||||
|
||||
|
||||
Add (what) to singal dropped in snap_zone
|
||||
signal has_dropped(what)
|
||||
# Pickup Method: Drop the currently picked up object
|
||||
...
|
||||
func drop_object() -> void:
|
||||
if not is_instance_valid(picked_up_object):
|
||||
return
|
||||
|
||||
# let go of this object
|
||||
has_dropped.emit(picked_up_object)
|
||||
picked_up_object.let_go(self, Vector3.ZERO, Vector3.ZERO)
|
||||
picked_up_object = null
|
||||
highlight_updated.emit(self, enabled)
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
extends Node3D
|
||||
|
||||
const RECIPE_MANAGER = preload("res://RecipeManager.gd")
|
||||
const GAME_MANAGER = preload("res://GameManager.gd")
|
||||
|
||||
var xr_interface :XRInterface
|
||||
|
||||
func _ready():
|
||||
RECIPE_MANAGER.print_all_recipes()
|
||||
|
||||
GAME_MANAGER.meals_in_play = ["hamburger"]
|
||||
GAME_MANAGER.sides_in_play = ["cube"]
|
||||
|
||||
xr_interface = XRServer.find_interface("OpenXR")
|
||||
if xr_interface and xr_interface.is_initialized():
|
||||
print("OpenXR started :)")
|
||||
DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_DISABLED)
|
||||
get_viewport().use_xr = true
|
||||
else:
|
||||
print("OpenXR failed to start. Check your headset...")
|
||||
@@ -1 +0,0 @@
|
||||
uid://b4ldkd3ngs0vp
|
||||
@@ -1,96 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://clw8ai6kngqxb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b4ldkd3ngs0vp" path="res://main.gd" id="1_0xm2m"]
|
||||
[ext_resource type="PackedScene" uid="uid://j5s5wus7tuhb" path="res://XROrigin.tscn" id="2_h2yge"]
|
||||
[ext_resource type="Material" uid="uid://cmia50cfqxxo4" path="res://textures/dev_material_3d.tres" id="3_272bh"]
|
||||
[ext_resource type="PackedScene" uid="uid://e4i6o5oriecx" path="res://items/PickupCube.tscn" id="3_h2yge"]
|
||||
[ext_resource type="PackedScene" uid="uid://j7caslh27nor" path="res://stations/Hob.tscn" id="3_lquwl"]
|
||||
[ext_resource type="PackedScene" uid="uid://efaec6ymgabo" path="res://stations/Counter.tscn" id="4_7mycd"]
|
||||
[ext_resource type="Sky" uid="uid://c1abtpwhdm2d5" path="res://textures/sky/NightSkyHDRI009_16K.tres" id="6_7mycd"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpot5qie20vf6" path="res://items/burger.tscn" id="8_5vw27"]
|
||||
[ext_resource type="PackedScene" uid="uid://bp3v1jl8pctro" path="res://Containers/plate.tscn" id="9_kek77"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vlqg6"]
|
||||
size = Vector3(5, 0.1, 5)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_24d3s"]
|
||||
material = ExtResource("3_272bh")
|
||||
size = Vector3(5, 0.1, 5)
|
||||
|
||||
[sub_resource type="Environment" id="Environment_bvwq1"]
|
||||
background_mode = 2
|
||||
sky = ExtResource("6_7mycd")
|
||||
reflected_light_source = 2
|
||||
tonemap_mode = 3
|
||||
ssr_enabled = true
|
||||
ssao_enabled = true
|
||||
ssil_enabled = true
|
||||
sdfgi_enabled = true
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_kek77"]
|
||||
size = Vector3(5.1, 10, 0.1)
|
||||
|
||||
[node name="Main" type="Node3D" unique_id=1312265607]
|
||||
script = ExtResource("1_0xm2m")
|
||||
|
||||
[node name="XROrigin3D" parent="." unique_id=2055526621 instance=ExtResource("2_h2yge")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8820953, 0)
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1376644384]
|
||||
transform = Transform3D(-0.8660254, -0.43301278, 0.24999999, 0.3022632, -0.05510214, 0.9516306, -0.39829266, 0.8997021, 0.17860365, 0, 0, 0)
|
||||
|
||||
[node name="Floor" type="StaticBody3D" parent="." unique_id=122279514]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Floor" unique_id=958841648]
|
||||
shape = SubResource("BoxShape3D_vlqg6")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floor/CollisionShape3D" unique_id=1939997056]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00018164515, 0.0006352663, -0.002532661)
|
||||
mesh = SubResource("BoxMesh_24d3s")
|
||||
|
||||
[node name="Hob" parent="." unique_id=1687971542 instance=ExtResource("3_lquwl")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.29336345, 0.8981018, -1.484)
|
||||
|
||||
[node name="Counter" parent="." unique_id=1487893288 instance=ExtResource("4_7mycd")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.73186195, 0.8981018, -1.484)
|
||||
|
||||
[node name="PickableObject" parent="." unique_id=1675596942 instance=ExtResource("3_h2yge")]
|
||||
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, -0.70505303, 1.5761534, -1.0317149)
|
||||
|
||||
[node name="PickableObject2" parent="." unique_id=713087634 instance=ExtResource("3_h2yge")]
|
||||
transform = Transform3D(1, 0, -2.2351742e-08, -2.9802322e-08, 1.0000001, 0, -2.6077032e-08, 1.4901161e-08, 1, 0.28315204, 1.5607953, -1.0657519)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1177077250]
|
||||
environment = SubResource("Environment_bvwq1")
|
||||
|
||||
[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=812168256]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2856425, 1.4939771, -1.4959787)
|
||||
visible = false
|
||||
light_color = Color(1, 0.38431373, 0, 1)
|
||||
light_energy = 1.784
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="burger" parent="." unique_id=1554047278 instance=ExtResource("8_5vw27")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.482068, -1.2252241)
|
||||
|
||||
[node name="Plate" parent="." unique_id=190487773 instance=ExtResource("9_kek77")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.22971058, 1.699144, -1.8499806)
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=82945083]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" unique_id=1909896160]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.688614, 2.5070028)
|
||||
shape = SubResource("BoxShape3D_kek77")
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="StaticBody3D" unique_id=39538720]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.688614, -2.5446289)
|
||||
shape = SubResource("BoxShape3D_kek77")
|
||||
|
||||
[node name="CollisionShape3D3" type="CollisionShape3D" parent="StaticBody3D" unique_id=1984048740]
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, -2.525816, 4.688614, -0.018813243)
|
||||
shape = SubResource("BoxShape3D_kek77")
|
||||
|
||||
[node name="CollisionShape3D4" type="CollisionShape3D" parent="StaticBody3D" unique_id=1484088721]
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 2.525816, 4.688614, -0.018813023)
|
||||
shape = SubResource("BoxShape3D_kek77")
|
||||
@@ -46,6 +46,7 @@ import/blender/enabled=false
|
||||
|
||||
platalbe_item="Meals, sides, augments for meals"
|
||||
station="Hobs, Counters ..."
|
||||
table="all nodes with table script"
|
||||
|
||||
[input]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user