Fix all tables consumed the same customer.
This commit is contained in:
+25
-22
@@ -13,31 +13,31 @@
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_1fmci"]
|
||||
animation = &"Grip"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_73fu8"]
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_itrmp"]
|
||||
animation = &"Grip"
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_ouruy"]
|
||||
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_nrfrd"]
|
||||
filter_enabled = true
|
||||
filters = ["Armature/Skeleton3D:Little_Distal_L", "Armature/Skeleton3D:Little_Intermediate_L", "Armature/Skeleton3D:Little_Metacarpal_L", "Armature/Skeleton3D:Little_Proximal_L", "Armature/Skeleton3D:Middle_Distal_L", "Armature/Skeleton3D:Middle_Intermediate_L", "Armature/Skeleton3D:Middle_Metacarpal_L", "Armature/Skeleton3D:Middle_Proximal_L", "Armature/Skeleton3D:Ring_Distal_L", "Armature/Skeleton3D:Ring_Intermediate_L", "Armature/Skeleton3D:Ring_Metacarpal_L", "Armature/Skeleton3D:Ring_Proximal_L", "Armature/Skeleton3D:Thumb_Distal_L", "Armature/Skeleton3D:Thumb_Metacarpal_L", "Armature/Skeleton3D:Thumb_Proximal_L", "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L"]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_i0gvw"]
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_73fu8"]
|
||||
animation = &"Grip 5"
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_5mmou"]
|
||||
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_ouruy"]
|
||||
filter_enabled = true
|
||||
filters = ["Armature/Skeleton3D:Index_Distal_L", "Armature/Skeleton3D:Index_Intermediate_L", "Armature/Skeleton3D:Index_Metacarpal_L", "Armature/Skeleton3D:Index_Proximal_L", "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L"]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_yfij0"]
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_i0gvw"]
|
||||
graph_offset = Vector2(-536, 11)
|
||||
nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_1fmci")
|
||||
nodes/ClosedHand1/position = Vector2(-600, 300)
|
||||
nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_73fu8")
|
||||
nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_itrmp")
|
||||
nodes/ClosedHand2/position = Vector2(-360, 300)
|
||||
nodes/Grip/node = SubResource("AnimationNodeBlend2_ouruy")
|
||||
nodes/Grip/node = SubResource("AnimationNodeBlend2_nrfrd")
|
||||
nodes/Grip/position = Vector2(0, 20)
|
||||
nodes/OpenHand/node = SubResource("AnimationNodeAnimation_i0gvw")
|
||||
nodes/OpenHand/node = SubResource("AnimationNodeAnimation_73fu8")
|
||||
nodes/OpenHand/position = Vector2(-600, 100)
|
||||
nodes/Trigger/node = SubResource("AnimationNodeBlend2_5mmou")
|
||||
nodes/Trigger/node = SubResource("AnimationNodeBlend2_ouruy")
|
||||
nodes/Trigger/position = Vector2(-360, 20)
|
||||
node_connections = [&"output", 0, &"Grip", &"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1"]
|
||||
|
||||
@@ -45,33 +45,34 @@ node_connections = [&"output", 0, &"Grip", &"Grip", 0, &"Trigger", &"Grip", 1, &
|
||||
transparency = 1
|
||||
albedo_color = Color(1, 1, 1, 0.5882353)
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_itrmp"]
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5mmou"]
|
||||
animation = &"Grip"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nrfrd"]
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_yfij0"]
|
||||
animation = &"Grip"
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_73fu8"]
|
||||
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_2ebvs"]
|
||||
filter_enabled = true
|
||||
filters = ["Armature/Skeleton3D:Little_Distal_R", "Armature/Skeleton3D:Little_Intermediate_R", "Armature/Skeleton3D:Little_Metacarpal_R", "Armature/Skeleton3D:Little_Proximal_R", "Armature/Skeleton3D:Middle_Distal_R", "Armature/Skeleton3D:Middle_Intermediate_R", "Armature/Skeleton3D:Middle_Metacarpal_R", "Armature/Skeleton3D:Middle_Proximal_R", "Armature/Skeleton3D:Ring_Distal_R", "Armature/Skeleton3D:Ring_Intermediate_R", "Armature/Skeleton3D:Ring_Metacarpal_R", "Armature/Skeleton3D:Ring_Proximal_R", "Armature/Skeleton3D:Thumb_Distal_R", "Armature/Skeleton3D:Thumb_Metacarpal_R", "Armature/Skeleton3D:Thumb_Proximal_R", "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R"]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ouruy"]
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_l8v2a"]
|
||||
animation = &"Grip 5"
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_i0gvw"]
|
||||
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_qpjda"]
|
||||
filter_enabled = true
|
||||
filters = ["Armature/Skeleton3D:Index_Distal_R", "Armature/Skeleton3D:Index_Intermediate_R", "Armature/Skeleton3D:Index_Metacarpal_R", "Armature/Skeleton3D:Index_Proximal_R", "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R"]
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_5mmou"]
|
||||
nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_itrmp")
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_37hbl"]
|
||||
graph_offset = Vector2(-552.664, 107.301)
|
||||
nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_5mmou")
|
||||
nodes/ClosedHand1/position = Vector2(-600, 300)
|
||||
nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_nrfrd")
|
||||
nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_yfij0")
|
||||
nodes/ClosedHand2/position = Vector2(-360, 300)
|
||||
nodes/Grip/node = SubResource("AnimationNodeBlend2_73fu8")
|
||||
nodes/Grip/node = SubResource("AnimationNodeBlend2_2ebvs")
|
||||
nodes/Grip/position = Vector2(0, 40)
|
||||
nodes/OpenHand/node = SubResource("AnimationNodeAnimation_ouruy")
|
||||
nodes/OpenHand/node = SubResource("AnimationNodeAnimation_l8v2a")
|
||||
nodes/OpenHand/position = Vector2(-600, 100)
|
||||
nodes/Trigger/node = SubResource("AnimationNodeBlend2_i0gvw")
|
||||
nodes/Trigger/node = SubResource("AnimationNodeBlend2_qpjda")
|
||||
nodes/Trigger/position = Vector2(-360, 40)
|
||||
node_connections = [&"output", 0, &"Grip", &"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1"]
|
||||
|
||||
@@ -119,13 +120,14 @@ bone_idx = 9
|
||||
[node name="Poke" parent="XRControllerLeftHand/LeftHand/Hand_low_L/Armature/Skeleton3D/BoneAttachment3D" unique_id=259928841 instance=ExtResource("7_1fmci")]
|
||||
|
||||
[node name="AnimationTree" parent="XRControllerLeftHand/LeftHand" index="1"]
|
||||
tree_root = SubResource("AnimationNodeBlendTree_yfij0")
|
||||
tree_root = SubResource("AnimationNodeBlendTree_i0gvw")
|
||||
|
||||
[node name="MovementDirect" parent="XRControllerLeftHand" unique_id=1865515938 instance=ExtResource("2_q1xvu")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.009340696, -0.0074635968, 0.024033919)
|
||||
strafe = true
|
||||
|
||||
[node name="FunctionPickup" parent="XRControllerLeftHand" unique_id=2133415351 instance=ExtResource("3_rd8py")]
|
||||
grab_collision_mask = 327748
|
||||
|
||||
[node name="FunctionPointer" parent="XRControllerLeftHand" unique_id=315304316 instance=ExtResource("6_ptr")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.02, 0.05, -0.1)
|
||||
@@ -179,7 +181,7 @@ bone_idx = 9
|
||||
[node name="Poke" parent="XRControllerRightHand/RightHand/Hand_low_R/Armature/Skeleton3D/BoneAttachment3D" unique_id=303927399 instance=ExtResource("7_1fmci")]
|
||||
|
||||
[node name="AnimationTree" parent="XRControllerRightHand/RightHand" index="1"]
|
||||
tree_root = SubResource("AnimationNodeBlendTree_5mmou")
|
||||
tree_root = SubResource("AnimationNodeBlendTree_37hbl")
|
||||
|
||||
[node name="MovementTurn" parent="XRControllerRightHand" unique_id=154529119 instance=ExtResource("4_rd8py")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0074635968, 0.024033919)
|
||||
@@ -187,6 +189,7 @@ turn_mode = 2
|
||||
smooth_turn_speed = 3.5
|
||||
|
||||
[node name="FunctionPickup" parent="XRControllerRightHand" unique_id=1876210450 instance=ExtResource("3_rd8py")]
|
||||
grab_collision_mask = 327748
|
||||
|
||||
[node name="FunctionPointer" parent="XRControllerRightHand" unique_id=2017919314 instance=ExtResource("6_ptr")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.02, 0.05, -0.1)
|
||||
|
||||
@@ -25,7 +25,6 @@ func despawn_unheld_pickables():
|
||||
NetworkManager.despawn_item(pickable)
|
||||
continue
|
||||
if not held_by.is_in_group("persistent_inventory"):
|
||||
held_by.get_parent().print_tree_pretty()
|
||||
print("BuildModeController despawn_unheld_pickables held_by: %s, pickable: %s " % [held_by, pickable])
|
||||
NetworkManager.despawn_item(pickable)
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ func finish_current_day() -> void:
|
||||
func _process(delta: float) -> void:
|
||||
if GameManager.game_state != GameManager.GameState.RUNNING:
|
||||
return
|
||||
|
||||
day_time_remaining -= delta
|
||||
var customers_at_this_time = GameManager.customers_per_day * get_day_progression()
|
||||
#print("DayController: customers_at_this_time: ", customers_at_this_time)
|
||||
|
||||
+24
-10
@@ -1,3 +1,4 @@
|
||||
class_name QueueController
|
||||
extends Node3D
|
||||
|
||||
@export var queue_patience: float = 120
|
||||
@@ -7,26 +8,42 @@ extends Node3D
|
||||
|
||||
|
||||
var _customers: Array[float] = [] # Temp. Array of their patience
|
||||
|
||||
var _tables: Array[Node3D] = []
|
||||
|
||||
func _ready() -> void:
|
||||
progress_bar_3d.override_fill_color(Color.YELLOW)
|
||||
progress_bar_3d.exponential = true
|
||||
Signals.request_customer_spawn.connect(_on_request_customer_spawn)
|
||||
Signals.consumed_customer.connect(on_consumed_customer)
|
||||
Signals.game_state_changed.connect(_on_game_state_changed)
|
||||
|
||||
|
||||
func _on_game_state_changed(new_state: GameManager.GameState) -> void:
|
||||
if new_state == GameManager.GameState.RUNNING:
|
||||
_rebuild_table_list()
|
||||
|
||||
func _on_request_customer_spawn() -> void:
|
||||
spawn_customer()
|
||||
|
||||
|
||||
func on_consumed_customer() -> void:
|
||||
_customers.pop_front()
|
||||
|
||||
|
||||
func spawn_customer() -> void:
|
||||
_customers.append(queue_patience)
|
||||
|
||||
|
||||
func _rebuild_table_list() -> void:
|
||||
_tables.clear()
|
||||
_tables.append_array(get_tree().get_nodes_in_group("table"))
|
||||
print("QueueController _rebuild_table_list complete: ", _tables)
|
||||
|
||||
|
||||
func _try_to_assign_customers() -> void:
|
||||
for customer in _customers:
|
||||
for table: Table in _tables:
|
||||
var result: bool = table.try_consume_customer()
|
||||
if result == true:
|
||||
_customers.pop_front()
|
||||
break
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
# Process customers patience
|
||||
for i in range(0, _customers.size()):
|
||||
@@ -34,10 +51,7 @@ func _process(delta: float) -> void:
|
||||
if _customers[i] <= 0:
|
||||
GameManager.game_over()
|
||||
|
||||
# Try to assign customers to tables
|
||||
for customer in _customers:
|
||||
get_tree().call_group("table", "try_consume_customer")
|
||||
|
||||
_try_to_assign_customers()
|
||||
|
||||
# Update visuals
|
||||
if not _customers.is_empty():
|
||||
|
||||
@@ -104,6 +104,12 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.6, 0, 0)
|
||||
[node name="Table" parent="." unique_id=1863572470 instance=ExtResource("11_gaw43")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8, 0, 1.8)
|
||||
|
||||
[node name="Table2" parent="." unique_id=987495548 instance=ExtResource("11_gaw43")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8, 0, 2.4)
|
||||
|
||||
[node name="Table3" parent="." unique_id=113648557 instance=ExtResource("11_gaw43")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.8, 0, 3)
|
||||
|
||||
[node name="GameOverPanel" parent="." unique_id=522901881 instance=ExtResource("12_n58f2")]
|
||||
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 2.7718225, 2.8122003, 1.8000003)
|
||||
scene = ExtResource("13_hooyg")
|
||||
|
||||
@@ -74,6 +74,7 @@ mass = 0.004
|
||||
gravity_scale = 0.5
|
||||
linear_damp = 100.0
|
||||
script = ExtResource("2_tbkb3")
|
||||
picked_up_layer = 64
|
||||
release_mode = 1
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="MoveHandle" unique_id=1692047616]
|
||||
|
||||
+3
-2
@@ -96,11 +96,12 @@ func clearAllFood() -> void:
|
||||
|
||||
|
||||
# Group called from Queue when trying to assign customers to tables
|
||||
func try_consume_customer():
|
||||
func try_consume_customer() -> bool:
|
||||
if _state == TableState.EMPTY:
|
||||
print("Table try_consume_customer, consumed a customer")
|
||||
_state_end(TableState.EMPTY)
|
||||
Signals.consumed_customer.emit()
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
||||
@@ -141,6 +141,7 @@ size = Vector3(0.05, 0.6713196, 0.05)
|
||||
|
||||
[node name="Label3D" type="Label3D" parent="Table" unique_id=662960977]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8263302, 0)
|
||||
pixel_size = 0.003
|
||||
billboard = 2
|
||||
text = "table state"
|
||||
vertical_alignment = 0
|
||||
@@ -148,6 +149,7 @@ line_spacing = -15.0
|
||||
|
||||
[node name="Label3DTime" type="Label3D" parent="Table" unique_id=1534849507]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.0147986, 0)
|
||||
visible = false
|
||||
pixel_size = 0.003
|
||||
billboard = 2
|
||||
text = "20.1s"
|
||||
|
||||
+2
-2
@@ -59,9 +59,10 @@ offset_left = 20.0
|
||||
offset_top = 80.0
|
||||
offset_right = -20.0
|
||||
offset_bottom = -20.0
|
||||
current_tab = 0
|
||||
current_tab = 1
|
||||
|
||||
[node name="Stations" type="GridContainer" parent="TabContainer" unique_id=189446761]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
columns = 6
|
||||
metadata/_tab_index = 0
|
||||
@@ -102,7 +103,6 @@ station_name = "Plates"
|
||||
cost = 80
|
||||
|
||||
[node name="Food" type="GridContainer" parent="TabContainer" unique_id=422899445]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
columns = 6
|
||||
metadata/_tab_index = 1
|
||||
|
||||
@@ -75,4 +75,11 @@ Shared INventory
|
||||
|
||||
|
||||
## Weird ideas
|
||||
- carry 4 plates. A snapzone on forearm that only accept plate, and drops it if tilted too much. Real waiter feel.
|
||||
- carry 4 plates. A snapzone on forearm that only accept plate, and drops it if tilted too much. Real waiter feel.
|
||||
|
||||
|
||||
## Research
|
||||
- Reasearch is its own currency.
|
||||
- You unlock items in shop with reseach points. Then you can buy them. You "buy" the same tile twice.
|
||||
|
||||
|
||||
|
||||
@@ -5,4 +5,3 @@ signal restart_game
|
||||
signal game_state_changed(new_state: GameManager.GameState)
|
||||
signal station_bought(instance: Node3D)
|
||||
signal request_customer_spawn()
|
||||
signal consumed_customer() # When a table consumes a customer from the queue
|
||||
|
||||
@@ -85,6 +85,7 @@ set_game_over={
|
||||
3d_physics/layer_3="Pickable Objects"
|
||||
3d_physics/layer_4="Wall Walking"
|
||||
3d_physics/layer_5="Grappling Target"
|
||||
3d_physics/layer_7="Movement Handle"
|
||||
3d_physics/layer_17="Held Objects"
|
||||
3d_physics/layer_18="Player Hands"
|
||||
3d_physics/layer_19="Grab Handles"
|
||||
|
||||
Reference in New Issue
Block a user