From cd35a9b1ac19285ef3376f23a10432d2c9bc97f5 Mon Sep 17 00:00:00 2001 From: Antonio Dell'Annunziata Date: Fri, 7 Mar 2025 06:31:12 +0100 Subject: [PATCH] Fix operation bugs --- dialog.gd | 2 +- dialog.tscn | 41 ++++ main.gd | 46 +++-- main.tscn | 312 ++---------------------------- operation/grab_step.gd | 11 +- operation/operation.gd | 4 - operation/prototype_dark_cut.gd | 10 +- operation/prototype_dark_cut.tscn | 309 ++++++++++------------------- operation/test_scalpel.gd | 23 +-- project.godot | 10 +- 10 files changed, 220 insertions(+), 548 deletions(-) create mode 100644 dialog.tscn diff --git a/dialog.gd b/dialog.gd index e0f4abf..5280f15 100644 --- a/dialog.gd +++ b/dialog.gd @@ -5,7 +5,7 @@ extends Node2D signal dialog_finished -@onready var text_box_label: RichTextLabel = %TextBoxLabel +var text_box_label: RichTextLabel const SPEED_SLOW = 5.0 const SPEED_NORMAL = 10.0 diff --git a/dialog.tscn b/dialog.tscn new file mode 100644 index 0000000..d3cfb85 --- /dev/null +++ b/dialog.tscn @@ -0,0 +1,41 @@ +[gd_scene load_steps=6 format=3 uid="uid://4yxpfr8xhlu1"] + +[ext_resource type="Script" uid="uid://cqhmuhb0je7f1" path="res://dialog.gd" id="1_7voku"] + +[sub_resource type="Gradient" id="Gradient_cuqb1"] +offsets = PackedFloat32Array(0) +colors = PackedColorArray(0, 0, 0, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_30ci2"] +gradient = SubResource("Gradient_cuqb1") +width = 1152 + +[sub_resource type="Gradient" id="Gradient_ukr0q"] +offsets = PackedFloat32Array(0.272085) +colors = PackedColorArray(0.202521, 0.371426, 0.429081, 1) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_4lgr0"] +gradient = SubResource("Gradient_ukr0q") +width = 200 +height = 400 +fill_from = Vector2(0.5, 0) +fill_to = Vector2(0.5, 1) + +[node name="Dialog" type="Node2D"] +script = ExtResource("1_7voku") + +[node name="BlackBackground" type="Sprite2D" parent="."] +position = Vector2(576, 325.25) +scale = Vector2(1.001, 652) +texture = SubResource("GradientTexture1D_30ci2") + +[node name="Undead" type="Sprite2D" parent="."] +position = Vector2(587, 291) +texture = SubResource("GradientTexture2D_4lgr0") + +[node name="Label" type="Label" parent="Undead"] +offset_left = -17.0 +offset_top = -34.0 +offset_right = 23.0 +offset_bottom = -11.0 +text = "Bob" diff --git a/main.gd b/main.gd index 270cc07..cdef6ad 100644 --- a/main.gd +++ b/main.gd @@ -1,37 +1,55 @@ extends Node2D +const DARK_CUT_SCENE = preload("res://operation/prototype_dark_cut.tscn") +const DIALOG_SCENE = preload("res://dialog.tscn") + @onready var room: Node2D = $Room -@onready var dark_cut: Node2D = $PrototypeDarkCut -@onready var dialog: Dialog = $Dialog @onready var shelves: Node2D = $Shelves -func _ready(): - _disable_node2d(room) - _disable_node2d(shelves) - _disable_node2d(dark_cut) - dialog.dialog_finished.connect(_on_dialog_finished) -func _on_dialog_finished(): - _disable_node2d(dialog) +func _ready(): + _show_dialog() + +func _on_dialog_finished(dialog: Dialog): + dialog.queue_free() _enable_node2d(room) _enable_node2d(shelves) +func _on_bob_clicked(): + _show_dialog() + +func _show_dialog(): + _disable_node2d(room) + _disable_node2d(shelves) + var dialog = DIALOG_SCENE.instantiate() + dialog.dialog_finished.connect(_on_dialog_finished.bind(dialog)) + dialog.text_box_label = %TextBoxLabel + add_child.call_deferred(dialog) func _on_ritual_place_clicked(): _disable_node2d(room) - _disable_node2d(dialog) - _enable_node2d(dark_cut) + var dark_cut = DARK_CUT_SCENE.instantiate() + dark_cut.succeeded.connect(_on_dark_cut_succeeded.bind(dark_cut)) + dark_cut.failed.connect(_on_dark_cut_failed.bind(dark_cut)) + add_child.call_deferred(dark_cut) -func _on_dark_cut_operation_succeeded(): - _disable_node2d(dark_cut) +func _on_dark_cut_succeeded(dark_cut: DarkCut): + dark_cut.queue_free() + _show_room() + +func _on_dark_cut_failed(dark_cut: DarkCut): + dark_cut.queue_free() + _show_room() + +func _show_room(): _enable_node2d(room) + _enable_node2d(shelves) func _disable_node2d(node: Node2D): node.hide() node.set_deferred("process", false) - func _enable_node2d(node: Node2D): node.show() node.set_deferred("process", true) diff --git a/main.tscn b/main.tscn index 9f1c3b8..f9a054d 100644 --- a/main.tscn +++ b/main.tscn @@ -1,22 +1,9 @@ -[gd_scene load_steps=49 format=3 uid="uid://w3ntt1yh1nq7"] +[gd_scene load_steps=28 format=3 uid="uid://w3ntt1yh1nq7"] -[ext_resource type="Script" uid="uid://cqhmuhb0je7f1" path="res://dialog.gd" id="1_0qabl"] [ext_resource type="Script" uid="uid://lnmooufxbuym" path="res://main.gd" id="1_dp5o4"] -[ext_resource type="Script" uid="uid://bge4rddktehkh" path="res://operation/prototype_dark_cut.gd" id="3_1u8w0"] [ext_resource type="PackedScene" uid="uid://3oqyqft8w72m" path="res://selectable.tscn" id="3_g5hfc"] [ext_resource type="Script" uid="uid://c3dlxuhruho8c" path="res://operation/feedback_canvas_modulate.gd" id="4_0odxb"] [ext_resource type="Texture2D" uid="uid://bicjfwpoa3pma" path="res://operation/test_table.png" id="5_lswn8"] -[ext_resource type="Texture2D" uid="uid://bp10w3bh1gn14" path="res://operation/test_body_1.png" id="6_a6jrf"] -[ext_resource type="Texture2D" uid="uid://bkjxp2r3pobmc" path="res://operation/bat_extraction_open_chest.png" id="7_xuqvo"] -[ext_resource type="Texture2D" uid="uid://ciy24ri5lusqs" path="res://operation/bat_extraction_bat.png" id="8_qsp4k"] -[ext_resource type="Script" uid="uid://cvts663aoxl7g" path="res://operation/bat_extraction_bat.gd" id="9_kq58d"] -[ext_resource type="Texture2D" uid="uid://dwjmlaw1vxgxo" path="res://operation/bat_extraction_body.png" id="10_seu75"] -[ext_resource type="Texture2D" uid="uid://n8x3g2swx0x2" path="res://operation/bat_extraction_open_chest_flaps.png" id="11_htxhm"] -[ext_resource type="Texture2D" uid="uid://ljl3y4633ted" path="res://operation/bat_extraction_bones.png" id="12_jq2sk"] -[ext_resource type="Script" uid="uid://ceyj30pfthcc3" path="res://operation/operation.gd" id="13_4k2k6"] -[ext_resource type="Script" uid="uid://bcmj8d22a0kg" path="res://operation/cut_sequence.gd" id="14_0rl1p"] -[ext_resource type="PackedScene" uid="uid://x5powiwrfash" path="res://operation/cut_sequence_point.tscn" id="15_ok6jj"] -[ext_resource type="Script" uid="uid://diku6p1um3ko6" path="res://operation/grab_step.gd" id="16_facbu"] [ext_resource type="Texture2D" uid="uid://ccy71gl4qatjy" path="res://operation/pliers.png" id="17_b1qrp"] [ext_resource type="Script" uid="uid://crkr8emyhv1fo" path="res://operation/pliers.gd" id="18_come4"] [ext_resource type="PackedScene" uid="uid://c3of67m4ic212" path="res://operation/pickup_area.tscn" id="19_h8e4i"] @@ -61,23 +48,6 @@ gradient = SubResource("Gradient_ncwe7") width = 170 height = 170 -[sub_resource type="Gradient" id="Gradient_1s7o2"] -offsets = PackedFloat32Array(0.294915) -colors = PackedColorArray(0.601223, 0.601223, 0.601223, 1) - -[sub_resource type="GradientTexture1D" id="GradientTexture1D_f6e8o"] -gradient = SubResource("Gradient_1s7o2") -width = 1152 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pgu75"] -bg_color = Color(0.417457, 0, 0.105249, 1) - -[sub_resource type="Curve2D" id="Curve2D_wv8oy"] -_data = { -"points": PackedVector2Array(0, 0, 0, 0, -44, -62, 0, 0, 0, 0, 19, -64, 0, 0, 0, 0, -46, -35, 0, 0, 0, 0, 29, -24, 0, 0, 0, 0, 28, 6, 0, 0, 0, 0, -52, 12, 0, 0, 0, 0, -66, -50, 0, 0, 0, 0, -44, -62) -} -point_count = 8 - [sub_resource type="Gradient" id="Gradient_b76e3"] offsets = PackedFloat32Array(0.0881356) colors = PackedColorArray(0.0885599, 0.0885599, 0.0885599, 1) @@ -106,25 +76,6 @@ radius = 5.65684 [sub_resource type="RectangleShape2D" id="RectangleShape2D_0odxb"] size = Vector2(110, 65) -[sub_resource type="Gradient" id="Gradient_cuqb1"] -offsets = PackedFloat32Array(0) -colors = PackedColorArray(0, 0, 0, 1) - -[sub_resource type="GradientTexture1D" id="GradientTexture1D_30ci2"] -gradient = SubResource("Gradient_cuqb1") -width = 1152 - -[sub_resource type="Gradient" id="Gradient_ukr0q"] -offsets = PackedFloat32Array(0.272085) -colors = PackedColorArray(0.202521, 0.371426, 0.429081, 1) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_4lgr0"] -gradient = SubResource("Gradient_ukr0q") -width = 200 -height = 400 -fill_from = Vector2(0.5, 0) -fill_to = Vector2(0.5, 1) - [node name="Main" type="Node2D"] script = ExtResource("1_dp5o4") @@ -159,6 +110,10 @@ unique_name_in_owner = true layout_mode = 2 text = "Test" +[node name="FeedbackCanvasModulate" type="CanvasModulate" parent="." groups=["effects"]] +unique_name_in_owner = true +script = ExtResource("4_0odxb") + [node name="Room" type="Node2D" parent="."] [node name="RoomFloor" type="Sprite2D" parent="Room"] @@ -171,16 +126,16 @@ position = Vector2(578, -71) scale = Vector2(1.001, 652) texture = SubResource("GradientTexture1D_ij864") -[node name="Undead" type="Sprite2D" parent="Room"] +[node name="Bob" type="Sprite2D" parent="Room"] position = Vector2(242, 258) texture = SubResource("GradientTexture2D_ty4ro") -[node name="Selectable" parent="Room/Undead" instance=ExtResource("3_g5hfc")] +[node name="Selectable" parent="Room/Bob" instance=ExtResource("3_g5hfc")] -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Room/Undead/Selectable"] +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Room/Bob/Selectable"] polygon = PackedVector2Array(-50, 100, -50, -100, 50, -100, 50, 100) -[node name="Label" type="Label" parent="Room/Undead"] +[node name="Label" type="Label" parent="Room/Bob"] offset_top = 2.0 offset_right = 40.0 offset_bottom = 25.0 @@ -202,227 +157,8 @@ offset_right = 49.0 offset_bottom = 67.0 text = "Ritual place" -[node name="PrototypeDarkCut" type="Node2D" parent="."] -script = ExtResource("3_1u8w0") - -[node name="Sprite2D" type="Sprite2D" parent="PrototypeDarkCut"] -position = Vector2(576, 323.25) -scale = Vector2(1.001, 648) -texture = SubResource("GradientTexture1D_f6e8o") - -[node name="UI" type="Control" parent="PrototypeDarkCut"] -unique_name_in_owner = true -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = 1.0 -offset_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -mouse_filter = 1 - -[node name="HBoxContainer" type="HBoxContainer" parent="PrototypeDarkCut/UI"] -layout_mode = 0 -offset_left = 15.0 -offset_top = 13.0 -offset_right = 281.0 -offset_bottom = 57.0 -theme_override_constants/separation = 10 - -[node name="Label" type="Label" parent="PrototypeDarkCut/UI/HBoxContainer"] -layout_mode = 2 -theme_override_colors/font_color = Color(0, 0, 0, 1) -text = "Patience:" - -[node name="PatienceBar" type="ProgressBar" parent="PrototypeDarkCut/UI/HBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 4 -theme_override_styles/fill = SubResource("StyleBoxFlat_pgu75") -value = 100.0 - -[node name="FeedbackCanvasModulate" type="CanvasModulate" parent="PrototypeDarkCut"] -unique_name_in_owner = true -script = ExtResource("4_0odxb") - -[node name="TestTable" type="Sprite2D" parent="PrototypeDarkCut"] -position = Vector2(613, 358) -texture = ExtResource("5_lswn8") - -[node name="TestBody1" type="Sprite2D" parent="PrototypeDarkCut"] -unique_name_in_owner = true -position = Vector2(620, 399) -texture = ExtResource("6_a6jrf") - -[node name="Area2D" type="Area2D" parent="PrototypeDarkCut/TestBody1"] -collision_layer = 4 -collision_mask = 4 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="PrototypeDarkCut/TestBody1/Area2D"] -polygon = PackedVector2Array(0, -250, -39.2, -250, -45.6, -246, -48.9, -246, -54.9, -239, -56.2, -239, -61.1, -230, -62.6, -230, -67.5, -210, -69, -210, -69, -181.7, -65, -168, -65, -163.3, -49, -143, -47, -128.8, -47, -124.8, -63.3, -122, -67.3, -122, -102.9, -109.8, -113.5, -116, -124.4, -116, -148.3, -106, -150, -106, -150, 49.2, -146, 67.4, -146, 71.4, -138, 93.4, -138, 99.7, -132, 106.7, -132, 109, -115.2, 109, -108.2, 102, -106.5, 102, -101.5, 86, -100, 86, -99, 35, -99, 16.8, -96.5, 26, -96, 93, -100, 140.9, -100, 163.1, -95.7, 192, -94.9, 192, -91, 246.1, -91, 250, 61, 250, 61, 236.5, 58, 230.5, 58, 217.1, 68, 38.1, 68, 64.3, 74, 82.3, 74, 85, 82, 91, 82, 92.8, 93, 93.8, 93, 95, 109.8, 95, 117.7, 88, 119.8, 88, 128.8, 9, 129.9, 9, 131.9, -42, 133.1, -42, 132, -84, 132, -90.7, 121, -103.8, 121, -105.6, 113, -107.6, 113, -109.2, 90.1, -107.1, 87, -112.5, 87, -114.9, 75, -125, 75, -127.2, 44.8, -124, 31.2, -124, 33, -144.9, 33, -151.3, 48.9, -169, 50.4, -169, 54.4, -179, 56, -179, 56, -200.6, 43, -219.7, 43, -222, 30, -232, 30, -233.2, 0, -248.3) - -[node name="BatExtraction" type="Node2D" parent="PrototypeDarkCut"] -unique_name_in_owner = true -position = Vector2(620, 399) - -[node name="BatExtractionOpenChest" type="Sprite2D" parent="PrototypeDarkCut/BatExtraction"] -texture = ExtResource("7_xuqvo") - -[node name="OpenChestHurtArea" type="Area2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChest"] -collision_layer = 8 -collision_mask = 8 -priority = 2 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(35.5, -87.4, 33, -86.3, 33, -85.1, 25.3, -80, 23.4, -80, 22.7, -76.9, 28.5, -74, 31.8, -74, 37.8, -80, 39.3, -80, 40.4, -82.5) - -[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(48.9, -81.3, 46, -80.5, 46, -79, 34, -70, 7.89999, -69, 2.5, -69, 0.5, -62, -2.2, -62, 1, -55.6, 1, -53.4, 21.8, -49, 38.7, -49, 44.7, -54, 46.5, -54, 51.5, -72, 52.2, -72, 53.3, -74) - -[node name="CollisionPolygon2D3" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(22.5, -80.4, 20, -79.3, 20, -78.3, 18, -77.2, 18, -73, 26.3, -73, 27.4, -75.5) - -[node name="CollisionPolygon2D4" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(-64.7, -78.4, -67, -77.3, -67, -75.4, -71, -66.4, -71, -57.8, -61, -52.8, -61, -51.4, -51.2, -49, -38.7, -49, -17.7, -56, -14.5, -56, -17, -67.4, -17, -70.1, -36.1, -69, -43.7, -69, -55.7, -73, -58.3, -73) - -[node name="CollisionPolygon2D5" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(-24, -53.4, -24, -50, -28, -47, -40, -45.8, -69.9, -48, -72.4, -48, -74.4, -42, -76, -42, -76, -24.6, -66.4, 0, -65.5, 0, -60, 22, -60, 25.9, -38.6, 18, -35.5, 18, -11.7, 4.5, -10.3, 5, -7.7, 5, 2.3, 13, 4.10001, 13, 17.2, 25, 19.8, 25, 23, 21.8, 23, 19.2, 16, 11.2, 16, 9.10001, 6.8, 1, 4.89999, 1, -12.1, -19, -13, -45.1, -13, -47.2) - -[node name="CollisionPolygon2D6" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(2, -48.6, 2, -46.3, 0, -45.2, 0, -36.7, 13, -30.8, 13, -29.4, 23, -27.4, 23, -25.6, 43.3, -29, 46.5, -29, 44, -40.4, 44, -43, 22.1, -43) - -[node name="CollisionPolygon2D7" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(8.2, -26.3, 6, -25.2, 6, -24.3, 4, -23.2, 4, -19.8, 13.5, -15, 16.5, -10.6, 16, -8.2, 16, -6.39999, 11, -4.39999, 11, -0.899994, 37, 16.1, 37, 17.5, 39.8, 18.3, 44.1, 12, 46, 12, 46, 0, 47.3, 0, 45, -18.2, 45, -21, 15.6, -21) - -[node name="Path2D" type="Path2D" parent="PrototypeDarkCut/BatExtraction"] -curve = SubResource("Curve2D_wv8oy") - -[node name="PathFollow2D" type="PathFollow2D" parent="PrototypeDarkCut/BatExtraction/Path2D"] -position = Vector2(-44, -62) -rotation = -0.0317354 -rotates = false - -[node name="BatExtractionBat" type="Sprite2D" parent="PrototypeDarkCut/BatExtraction/Path2D/PathFollow2D"] -texture = ExtResource("8_qsp4k") -script = ExtResource("9_kq58d") -speed = 0.1 - -[node name="BatArea" type="Area2D" parent="PrototypeDarkCut/BatExtraction/Path2D/PathFollow2D/BatExtractionBat"] -collision_layer = 8 -collision_mask = 8 -priority = 3 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/Path2D/PathFollow2D/BatExtractionBat/BatArea"] -polygon = PackedVector2Array(-9, -13, -22.4, -13, -24, -12.2, -24, -9.6, -18, 3.3, -18, 5, -8, 12.9, 5, 13, 23.7, -3, 25, -3, 25, -6.9, 18.8, -13, 13, -13, 3, -3.9, 3, -3, -1.1, -3, -9, -11.8) - -[node name="BatExtractionBody" type="Sprite2D" parent="PrototypeDarkCut/BatExtraction"] -texture = ExtResource("10_seu75") - -[node name="BatExtractionOpenChestFlaps" type="Sprite2D" parent="PrototypeDarkCut/BatExtraction"] -texture = ExtResource("11_htxhm") - -[node name="OpenChestFlapsHurtArea" type="Area2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChestFlaps"] -collision_layer = 8 -collision_mask = 8 -priority = 4 - -[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChestFlaps/OpenChestFlapsHurtArea"] -polygon = PackedVector2Array(-88, -97, -88, -95.4, -89.4, -94, -90.6, -94, -93, -89.2, -93, -87.4, -99.5, -79, -100.8, -79, -102.8, -71, -103.9, -71, -105, -63.1, -105, -43.8, -103, -39.8, -103, -33, -103.9, -28, -104.9, -28, -105.9, -11, -107.1, -11, -106, 8.10001, -106, 16.3, -100, 24.3, -100, 26.6, -98, 27.6, -98, 28.8, -85, 31.8, -85, 33, -75.7, 33, -68.7, 28, -60.5, 28, -58.5, 25, -56.4, 25, -58.4, 21, -59.1, 21, -62, 4.8, -62, 0.800003, -64.4, -4, -65, -4, -65, -7.2, -66.4, -10, -67.2, -10, -72.3, -26, -73, -26, -73, -39.8, -69.2, -55, -67.9, -55, -69, -66.1, -69, -68.6, -68.6, -69, -67, -69, -67, -71, -66.2, -71, -64, -81.9, -64, -83.4, -70, -89.4, -70, -91, -72.6, -91, -74, -92.4, -74, -93.6, -78, -95.6, -78, -97) - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionOpenChestFlaps/OpenChestFlapsHurtArea"] -polygon = PackedVector2Array(66, -103.6, 66, -101.6, 62.8, -100, 60.6, -100, 51.6, -90, 50, -90, 50, -74.2, 48.3, -70, 47, -70, 47, -67, 46.2, -67, 43.2, -51, 41.9, -51, 43, -38.9, 43, -30.6, 45.6, -28, 49, -28, 49, -27, 47.4, -27, 46.4, -25, 45.3, -25, 44.8, -23.8, 47, -21.6, 47, -19.4, 45.6, -18, 44.1, -18, 43, -2, 43, 9.79999, 41.4, 13, 40, 13, 40, 16.6, 42, 17.6, 42, 19.6, 41.6, 20, 40.3, 20, 39.1, 23.4, 38.2, 23, 36.7, 23, 32.7, 26, 31.4, 26, 30.8, 27.1, 33.5, 31, 37.4, 31, 39.8, 28.5, 40.8, 29, 44.6, 29, 45.6, 27, 52.3, 27, 55.3, 25, 57.6, 25, 58.6, 23, 60.5, 23, 65.5, 17, 66.9, 17, 68, 9.10001, 68, 6.29999, 70.5, 3, 71.7, 3, 73.7, -2, 74.7, -2, 76, -5.8, 76, -11.8, 78.6, -17, 79.7, -17, 82.8, -27, 83.8, -27, 86, -36.9, 86, -53.2, 81.6, -62, 80.8, -62, 78, -71.3, 78, -89.3, 72, -97.4, 72, -100.6) - -[node name="BatExtractionBones" type="Sprite2D" parent="PrototypeDarkCut/BatExtraction"] -texture = ExtResource("12_jq2sk") - -[node name="BonesHurtArea" type="Area2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionBones"] -collision_layer = 8 -collision_mask = 8 -priority = 4 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="PrototypeDarkCut/BatExtraction/BatExtractionBones/BonesHurtArea"] -polygon = PackedVector2Array(39, -86, 39, -84.3, 21, -75.2, -2, -75, -2, -74, -14.8, -74, -16, -76.5, -16, -79.8, -32.4, -74, -34.6, -74, -62.7, -84, -64.8, -84, -68, -80.8, -68, -78.2, -61, -71.2, -61, -69.3, -38, -65.3, -38, -63.6, -19, -67, -19, -59.5, -41, -53.5, -50.9, -54, -55.4, -54, -63.4, -59, -68.1, -59, -71.1, -54, -74.2, -54, -72, -49.6, -72, -45.8, -68, -43.8, -68, -42, -54, -42, -54, -40.9, -37.9, -42, -29.4, -42, -20, -48.7, -17.1, -44, -16, -24.9, -16, -16.2, 20, 21.8, 20, 23.2, 22.1, 24.3, 25.1, 22.3, 27.9, 27, 36.6, 27, 45, 21, 45, 16.9, 22.6, 2, 19.8, 2, 14.3, -3.5, 21, -6.8, 21, -13.1, 5.60001, -22.8, 15, -18.8, 15, -17, 23, -17, 23, -15.9, 40.1, -17, 45.5, -17, 48, -25.7, 48, -28.8, 37.1, -30, 25.3, -30, 4, -39.3, 4, -43.5, 21.8, -39, 42.4, -39, 46, -49.7, 46, -52.8, 42.8, -56, 40.2, -56, 37.2, -53, 22.1, -53, 3, -58.5, 3, -59.5, 5.7, -65.1, 30.1, -66, 36.8, -66, 49.8, -79, 51.3, -79, 52.4, -81.5, 50, -83.9, 50, -86) - -[node name="Operation" type="Node2D" parent="PrototypeDarkCut"] -script = ExtResource("13_4k2k6") - -[node name="CutSequence" type="Node2D" parent="PrototypeDarkCut/Operation"] -script = ExtResource("14_0rl1p") -is_skipped = true - -[node name="CutSequencePoint" parent="PrototypeDarkCut/Operation/CutSequence" instance=ExtResource("15_ok6jj")] -position = Vector2(558, 316) - -[node name="CutSequencePoint2" parent="PrototypeDarkCut/Operation/CutSequence" instance=ExtResource("15_ok6jj")] -position = Vector2(584, 321) - -[node name="CutSequencePoint3" parent="PrototypeDarkCut/Operation/CutSequence" instance=ExtResource("15_ok6jj")] -position = Vector2(614, 326) - -[node name="CutSequencePoint4" parent="PrototypeDarkCut/Operation/CutSequence" instance=ExtResource("15_ok6jj")] -position = Vector2(644, 318) - -[node name="CutSequencePoint5" parent="PrototypeDarkCut/Operation/CutSequence" instance=ExtResource("15_ok6jj")] -position = Vector2(668, 311) - -[node name="CutSequence2" type="Node2D" parent="PrototypeDarkCut/Operation"] -position = Vector2(-4, 69) -script = ExtResource("14_0rl1p") -is_skipped = true - -[node name="CutSequencePoint" parent="PrototypeDarkCut/Operation/CutSequence2" instance=ExtResource("15_ok6jj")] -position = Vector2(618, 257) - -[node name="CutSequencePoint2" parent="PrototypeDarkCut/Operation/CutSequence2" instance=ExtResource("15_ok6jj")] -position = Vector2(615, 285) - -[node name="CutSequencePoint3" parent="PrototypeDarkCut/Operation/CutSequence2" instance=ExtResource("15_ok6jj")] -position = Vector2(615, 310) - -[node name="CutSequencePoint4" parent="PrototypeDarkCut/Operation/CutSequence2" instance=ExtResource("15_ok6jj")] -position = Vector2(615, 334) - -[node name="CutSequence3" type="Node2D" parent="PrototypeDarkCut/Operation"] -position = Vector2(-4, 69) -script = ExtResource("14_0rl1p") -is_skipped = true - -[node name="CutSequencePoint" parent="PrototypeDarkCut/Operation/CutSequence3" instance=ExtResource("15_ok6jj")] -position = Vector2(615, 334) - -[node name="CutSequencePoint2" parent="PrototypeDarkCut/Operation/CutSequence3" instance=ExtResource("15_ok6jj")] -position = Vector2(598, 342) - -[node name="CutSequencePoint3" parent="PrototypeDarkCut/Operation/CutSequence3" instance=ExtResource("15_ok6jj")] -position = Vector2(580, 350) - -[node name="CutSequencePoint4" parent="PrototypeDarkCut/Operation/CutSequence3" instance=ExtResource("15_ok6jj")] -position = Vector2(562, 355) - -[node name="CutSequence4" type="Node2D" parent="PrototypeDarkCut/Operation"] -position = Vector2(-4, 69) -script = ExtResource("14_0rl1p") -is_skipped = true - -[node name="CutSequencePoint" parent="PrototypeDarkCut/Operation/CutSequence4" instance=ExtResource("15_ok6jj")] -position = Vector2(615, 334) - -[node name="CutSequencePoint2" parent="PrototypeDarkCut/Operation/CutSequence4" instance=ExtResource("15_ok6jj")] -position = Vector2(628, 342) - -[node name="CutSequencePoint3" parent="PrototypeDarkCut/Operation/CutSequence4" instance=ExtResource("15_ok6jj")] -position = Vector2(647, 353) - -[node name="CutSequencePoint4" parent="PrototypeDarkCut/Operation/CutSequence4" instance=ExtResource("15_ok6jj")] -position = Vector2(665, 355) - -[node name="BatGrabStep" type="Node2D" parent="PrototypeDarkCut/Operation"] -script = ExtResource("16_facbu") -grabbing_target_path = NodePath("../../BatExtraction/Path2D/PathFollow2D/BatExtractionBat") - [node name="Shelves" type="Node2D" parent="."] +top_level = true position = Vector2(1004, 324.5) [node name="ShelvesBackground" type="Sprite2D" parent="Shelves"] @@ -494,7 +230,7 @@ debug_color = Color(0.879882, 0.304191, 0.394852, 0.42) [node name="CutHurtTimer" type="Timer" parent="Shelves/TestScalpel"] unique_name_in_owner = true -[node name="BatDropoff" type="Node2D" parent="Shelves"] +[node name="BatDropoff" type="Node2D" parent="Shelves" groups=["bat_dropoff"]] unique_name_in_owner = true script = ExtResource("23_gngh3") @@ -511,28 +247,8 @@ collision_mask = 8 scale = Vector2(0.983051, 1) shape = SubResource("RectangleShape2D_0odxb") -[node name="Dialog" type="Node2D" parent="."] -script = ExtResource("1_0qabl") - -[node name="BlackBackground" type="Sprite2D" parent="Dialog"] -position = Vector2(576, 325.25) -scale = Vector2(1.001, 652) -texture = SubResource("GradientTexture1D_30ci2") - -[node name="Undead" type="Sprite2D" parent="Dialog"] -position = Vector2(587, 291) -texture = SubResource("GradientTexture2D_4lgr0") - -[node name="Label" type="Label" parent="Dialog/Undead"] -offset_left = -17.0 -offset_top = -34.0 -offset_right = 23.0 -offset_bottom = -11.0 -text = "Bob" - +[connection signal="clicked" from="Room/Bob/Selectable" to="." method="_on_bob_clicked"] [connection signal="clicked" from="Room/RitualPlace/Selectable" to="." method="_on_ritual_place_clicked"] -[connection signal="value_changed" from="PrototypeDarkCut/UI/HBoxContainer/PatienceBar" to="PrototypeDarkCut" method="_on_patience_bar_value_changed"] -[connection signal="area_entered" from="PrototypeDarkCut/TestBody1/Area2D" to="Shelves/TestScalpel" method="_on_body_area_entered"] -[connection signal="area_exited" from="PrototypeDarkCut/TestBody1/Area2D" to="Shelves/TestScalpel" method="_on_body_area_exited"] -[connection signal="succeeded" from="PrototypeDarkCut/Operation" to="." method="_on_dark_cut_operation_succeeded"] +[connection signal="area_entered" from="Shelves/TestScalpel/CutArea" to="Shelves/TestScalpel" method="_on_cut_area_area_entered"] +[connection signal="area_exited" from="Shelves/TestScalpel/CutArea" to="Shelves/TestScalpel" method="_on_cut_area_area_exited"] [connection signal="timeout" from="Shelves/TestScalpel/CutHurtTimer" to="Shelves/TestScalpel" method="_on_cut_hurt_timer_timeout"] diff --git a/operation/grab_step.gd b/operation/grab_step.gd index 69f180e..7977da8 100644 --- a/operation/grab_step.gd +++ b/operation/grab_step.gd @@ -9,7 +9,9 @@ signal step_failed @export_node_path("BatExtractionBat") var grabbing_target_path: NodePath -@onready var feedback_canvas_modulate: FeedbackCanvasModulate = %FeedbackCanvasModulate +var feedback_canvas_modulate: FeedbackCanvasModulate +var bat_dropoff: BatDropoff +var patience_bar: ProgressBar var grabbing_target: BatExtractionBat @@ -18,12 +20,15 @@ var pliers: Pliers func _ready(): grabbing_target = get_node(grabbing_target_path) as BatExtractionBat pliers = get_tree().get_first_node_in_group("grabber") as Pliers + bat_dropoff = get_tree().get_first_node_in_group("bat_dropoff") as BatDropoff + feedback_canvas_modulate = get_tree().get_first_node_in_group("effects") as FeedbackCanvasModulate + patience_bar = get_tree().get_first_node_in_group("patience_bar") as ProgressBar pliers.pliers_used.connect(_on_pliers_used) func _on_pliers_used(top_area: Area2D): if not grabbing_target.is_grabbed and top_area == grabbing_target.grab_area: _target_grabbed() - elif grabbing_target.is_grabbed and top_area == (%BatDropoff as BatDropoff).dropoff_area: + elif grabbing_target.is_grabbed and top_area == bat_dropoff.dropoff_area: _target_dropped() else: _hurt() @@ -39,4 +44,4 @@ func _target_dropped(): func _hurt(): feedback_canvas_modulate.show_hurt_feedback() - %PatienceBar.value = clampi(%PatienceBar.value - 10, 0, 100) + patience_bar.value = clampi(patience_bar.value - 10, 0, 100) diff --git a/operation/operation.gd b/operation/operation.gd index dd4e65c..1e04b13 100644 --- a/operation/operation.gd +++ b/operation/operation.gd @@ -26,9 +26,7 @@ func _ready(): active_step = steps[0] if active_step is GrabStep: _disable_node2d(%TestBody1) - _enable_node2d(%BatExtraction) else: - _disable_node2d(%BatExtraction) _enable_node2d(%TestBody1) _enable_node2d(active_step) @@ -37,7 +35,6 @@ func _on_cut_sequence_succeeded(cut_sequence: CutSequence): _disable_node2d(active_step) var next_index = steps.find(cut_sequence) + 1 if next_index == 4: - _enable_node2d(%BatExtraction) _disable_node2d(%TestBody1) active_step = steps[next_index] @@ -48,7 +45,6 @@ func _on_cut_sequence_failed(cut_sequence: CutSequence): pass func _on_grab_step_succeeded(grab_step: GrabStep): - print("Test") succeeded.emit() diff --git a/operation/prototype_dark_cut.gd b/operation/prototype_dark_cut.gd index f4fc290..0f03a30 100644 --- a/operation/prototype_dark_cut.gd +++ b/operation/prototype_dark_cut.gd @@ -1,8 +1,14 @@ +class_name DarkCut extends Node2D - +signal succeeded +signal failed func _on_patience_bar_value_changed(value): if value <= 0: - get_tree().reload_current_scene() + failed.emit() + + +func _on_operation_succeeded(): + succeeded.emit() diff --git a/operation/prototype_dark_cut.tscn b/operation/prototype_dark_cut.tscn index c21353f..fb1df2b 100644 --- a/operation/prototype_dark_cut.tscn +++ b/operation/prototype_dark_cut.tscn @@ -1,27 +1,22 @@ -[gd_scene load_steps=31 format=3 uid="uid://be0rqt7sk1da0"] +[gd_scene load_steps=18 format=3 uid="uid://be0rqt7sk1da0"] [ext_resource type="Texture2D" uid="uid://bicjfwpoa3pma" path="res://operation/test_table.png" id="1_7i8d4"] [ext_resource type="Script" uid="uid://bge4rddktehkh" path="res://operation/prototype_dark_cut.gd" id="1_vl0qk"] [ext_resource type="Texture2D" uid="uid://bp10w3bh1gn14" path="res://operation/test_body_1.png" id="2_atjyl"] -[ext_resource type="Texture2D" uid="uid://cg3dg7iqif56d" path="res://operation/test_scalpel.png" id="3_a4jra"] -[ext_resource type="Script" uid="uid://drfykuqe2phdt" path="res://operation/bat_dropoff.gd" id="4_2wsdd"] -[ext_resource type="Script" uid="uid://cqnproj5khm5a" path="res://operation/test_scalpel.gd" id="4_5ba3g"] -[ext_resource type="Texture2D" uid="uid://ccy71gl4qatjy" path="res://operation/pliers.png" id="4_aj8rk"] [ext_resource type="Texture2D" uid="uid://bkjxp2r3pobmc" path="res://operation/bat_extraction_open_chest.png" id="5_c2dn1"] -[ext_resource type="Script" uid="uid://crkr8emyhv1fo" path="res://operation/pliers.gd" id="5_ewpkr"] [ext_resource type="Texture2D" uid="uid://ciy24ri5lusqs" path="res://operation/bat_extraction_bat.png" id="6_yfdwj"] [ext_resource type="Texture2D" uid="uid://dwjmlaw1vxgxo" path="res://operation/bat_extraction_body.png" id="7_7hv63"] [ext_resource type="Script" uid="uid://ceyj30pfthcc3" path="res://operation/operation.gd" id="7_mteqj"] -[ext_resource type="PackedScene" uid="uid://c3of67m4ic212" path="res://operation/pickup_area.tscn" id="7_uhavf"] [ext_resource type="Texture2D" uid="uid://n8x3g2swx0x2" path="res://operation/bat_extraction_open_chest_flaps.png" id="8_1vja2"] -[ext_resource type="Shape2D" uid="uid://bo77ihhtxfueg" path="res://operation/scalpel_pickup_area_collision_shape.tres" id="8_mvvp0"] -[ext_resource type="Script" uid="uid://c3dlxuhruho8c" path="res://operation/feedback_canvas_modulate.gd" id="9_4ghh6"] [ext_resource type="Texture2D" uid="uid://ljl3y4633ted" path="res://operation/bat_extraction_bones.png" id="9_7uu43"] [ext_resource type="Script" uid="uid://bcmj8d22a0kg" path="res://operation/cut_sequence.gd" id="10_gcaa6"] [ext_resource type="PackedScene" uid="uid://x5powiwrfash" path="res://operation/cut_sequence_point.tscn" id="11_hcsao"] [ext_resource type="Script" uid="uid://cvts663aoxl7g" path="res://operation/bat_extraction_bat.gd" id="13_um5dt"] [ext_resource type="Script" uid="uid://diku6p1um3ko6" path="res://operation/grab_step.gd" id="18_d00rj"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pgu75"] +bg_color = Color(0.417457, 0, 0.105249, 1) + [sub_resource type="Gradient" id="Gradient_1s7o2"] offsets = PackedFloat32Array(0.294915) colors = PackedColorArray(0.601223, 0.601223, 0.601223, 1) @@ -30,26 +25,6 @@ colors = PackedColorArray(0.601223, 0.601223, 0.601223, 1) gradient = SubResource("Gradient_1s7o2") width = 1152 -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pgu75"] -bg_color = Color(0.417457, 0, 0.105249, 1) - -[sub_resource type="RectangleShape2D" id="RectangleShape2D_m114t"] -size = Vector2(325.047, 551.953) - -[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_1a0oe"] -radius = 7.10071 -height = 206.493 - -[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_f4g1u"] -radius = 7.10071 -height = 193.839 - -[sub_resource type="CircleShape2D" id="CircleShape2D_8w656"] -radius = 8.24621 - -[sub_resource type="CircleShape2D" id="CircleShape2D_qmwrh"] -radius = 5.65684 - [sub_resource type="Curve2D" id="Curve2D_wv8oy"] _data = { "points": PackedVector2Array(0, 0, 0, 0, -44, -62, 0, 0, 0, 0, 19, -64, 0, 0, 0, 0, -46, -35, 0, 0, 0, 0, 29, -24, 0, 0, 0, 0, 28, 6, 0, 0, 0, 0, -52, 12, 0, 0, 0, 0, -66, -50, 0, 0, 0, 0, -44, -62) @@ -59,13 +34,8 @@ point_count = 8 [node name="PrototypeDarkCut" type="Node2D"] script = ExtResource("1_vl0qk") -[node name="Sprite2D" type="Sprite2D" parent="."] -position = Vector2(576, 323.25) -scale = Vector2(1.001, 648) -texture = SubResource("GradientTexture1D_f6e8o") - -[node name="UI" type="Control" parent="."] -unique_name_in_owner = true +[node name="DarkCutUI" type="Control" parent="."] +top_level = true layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -76,7 +46,7 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 1 -[node name="HBoxContainer" type="HBoxContainer" parent="UI"] +[node name="HBoxContainer" type="HBoxContainer" parent="DarkCutUI"] layout_mode = 0 offset_left = 15.0 offset_top = 13.0 @@ -84,12 +54,12 @@ offset_right = 281.0 offset_bottom = 57.0 theme_override_constants/separation = 10 -[node name="Label" type="Label" parent="UI/HBoxContainer"] +[node name="Label" type="Label" parent="DarkCutUI/HBoxContainer"] layout_mode = 2 theme_override_colors/font_color = Color(0, 0, 0, 1) text = "Patience:" -[node name="PatienceBar" type="ProgressBar" parent="UI/HBoxContainer"] +[node name="PatienceBar" type="ProgressBar" parent="DarkCutUI/HBoxContainer" groups=["patience_bar"]] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 @@ -97,189 +67,26 @@ size_flags_vertical = 4 theme_override_styles/fill = SubResource("StyleBoxFlat_pgu75") value = 100.0 -[node name="FeedbackCanvasModulate" type="CanvasModulate" parent="."] -unique_name_in_owner = true -script = ExtResource("9_4ghh6") - -[node name="UtilsDropoff" type="Sprite2D" parent="."] -unique_name_in_owner = true -position = Vector2(1020.25, 43) -scale = Vector2(0.761429, 0.14494) -texture = ExtResource("1_7i8d4") - -[node name="Area2D" type="Area2D" parent="UtilsDropoff"] -collision_layer = 2 -collision_mask = 2 - -[node name="CollisionShape2D" type="CollisionShape2D" parent="UtilsDropoff/Area2D"] -shape = SubResource("RectangleShape2D_m114t") - -[node name="BatDropoff" type="Sprite2D" parent="."] -unique_name_in_owner = true -position = Vector2(895, 222) -scale = Vector2(0.317262, -0.14494) -texture = ExtResource("1_7i8d4") -script = ExtResource("4_2wsdd") - -[node name="Area2D" type="Area2D" parent="BatDropoff"] -collision_layer = 8 -collision_mask = 8 - -[node name="CollisionShape2D" type="CollisionShape2D" parent="BatDropoff/Area2D"] -shape = SubResource("RectangleShape2D_m114t") +[node name="Background" type="Sprite2D" parent="."] +position = Vector2(576, 323.25) +scale = Vector2(1.001, 648) +texture = SubResource("GradientTexture1D_f6e8o") [node name="TestTable" type="Sprite2D" parent="."] position = Vector2(613, 358) texture = ExtResource("1_7i8d4") -[node name="Pliers" type="Sprite2D" parent="." groups=["grabber"]] -z_index = 10 -position = Vector2(1026, 45) -scale = Vector2(0.5, 0.5) -texture = ExtResource("4_aj8rk") -script = ExtResource("5_ewpkr") - -[node name="PickupArea" parent="Pliers" instance=ExtResource("7_uhavf")] - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Pliers/PickupArea"] -position = Vector2(2, 18) -rotation = 1.00484 -shape = SubResource("CapsuleShape2D_1a0oe") - -[node name="CollisionShape2D2" type="CollisionShape2D" parent="Pliers/PickupArea"] -position = Vector2(-30, -2) -rotation = 0.363771 -shape = SubResource("CapsuleShape2D_f4g1u") - -[node name="GrabArea" type="Area2D" parent="Pliers"] -position = Vector2(-74, 78) -collision_layer = 8 -collision_mask = 8 - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Pliers/GrabArea"] -shape = SubResource("CircleShape2D_8w656") -debug_color = Color(0.879882, 0.304191, 0.394852, 0.42) - -[node name="TestScalpel" type="Sprite2D" parent="." groups=["cutter"]] -z_index = 10 -position = Vector2(949, 41) -rotation = -2.0542 -scale = Vector2(0.5, 0.5) -texture = ExtResource("3_a4jra") -script = ExtResource("4_5ba3g") - -[node name="PickupArea" parent="TestScalpel" instance=ExtResource("7_uhavf")] - -[node name="CollisionShape2D2" type="CollisionShape2D" parent="TestScalpel/PickupArea"] -shape = ExtResource("8_mvvp0") - -[node name="CutArea" type="Area2D" parent="TestScalpel"] -collision_layer = 5 -collision_mask = 5 - -[node name="CollisionShape2D" type="CollisionShape2D" parent="TestScalpel/CutArea"] -position = Vector2(9.33812, -65.1214) -shape = SubResource("CircleShape2D_qmwrh") -debug_color = Color(0.879882, 0.304191, 0.394852, 0.42) - -[node name="CutHurtTimer" type="Timer" parent="TestScalpel"] -unique_name_in_owner = true - [node name="TestBody1" type="Sprite2D" parent="."] unique_name_in_owner = true position = Vector2(620, 399) texture = ExtResource("2_atjyl") [node name="Area2D" type="Area2D" parent="TestBody1"] -collision_layer = 4 -collision_mask = 4 [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="TestBody1/Area2D"] polygon = PackedVector2Array(0, -250, -39.2, -250, -45.6, -246, -48.9, -246, -54.9, -239, -56.2, -239, -61.1, -230, -62.6, -230, -67.5, -210, -69, -210, -69, -181.7, -65, -168, -65, -163.3, -49, -143, -47, -128.8, -47, -124.8, -63.3, -122, -67.3, -122, -102.9, -109.8, -113.5, -116, -124.4, -116, -148.3, -106, -150, -106, -150, 49.2, -146, 67.4, -146, 71.4, -138, 93.4, -138, 99.7, -132, 106.7, -132, 109, -115.2, 109, -108.2, 102, -106.5, 102, -101.5, 86, -100, 86, -99, 35, -99, 16.8, -96.5, 26, -96, 93, -100, 140.9, -100, 163.1, -95.7, 192, -94.9, 192, -91, 246.1, -91, 250, 61, 250, 61, 236.5, 58, 230.5, 58, 217.1, 68, 38.1, 68, 64.3, 74, 82.3, 74, 85, 82, 91, 82, 92.8, 93, 93.8, 93, 95, 109.8, 95, 117.7, 88, 119.8, 88, 128.8, 9, 129.9, 9, 131.9, -42, 133.1, -42, 132, -84, 132, -90.7, 121, -103.8, 121, -105.6, 113, -107.6, 113, -109.2, 90.1, -107.1, 87, -112.5, 87, -114.9, 75, -125, 75, -127.2, 44.8, -124, 31.2, -124, 33, -144.9, 33, -151.3, 48.9, -169, 50.4, -169, 54.4, -179, 56, -179, 56, -200.6, 43, -219.7, 43, -222, 30, -232, 30, -233.2, 0, -248.3) -[node name="BatExtraction" type="Node2D" parent="."] -unique_name_in_owner = true -position = Vector2(620, 399) - -[node name="BatExtractionOpenChest" type="Sprite2D" parent="BatExtraction"] -texture = ExtResource("5_c2dn1") - -[node name="OpenChestHurtArea" type="Area2D" parent="BatExtraction/BatExtractionOpenChest"] -collision_layer = 8 -collision_mask = 8 -priority = 2 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(35.5, -87.4, 33, -86.3, 33, -85.1, 25.3, -80, 23.4, -80, 22.7, -76.9, 28.5, -74, 31.8, -74, 37.8, -80, 39.3, -80, 40.4, -82.5) - -[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(48.9, -81.3, 46, -80.5, 46, -79, 34, -70, 7.89999, -69, 2.5, -69, 0.5, -62, -2.2, -62, 1, -55.6, 1, -53.4, 21.8, -49, 38.7, -49, 44.7, -54, 46.5, -54, 51.5, -72, 52.2, -72, 53.3, -74) - -[node name="CollisionPolygon2D3" type="CollisionPolygon2D" parent="BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(22.5, -80.4, 20, -79.3, 20, -78.3, 18, -77.2, 18, -73, 26.3, -73, 27.4, -75.5) - -[node name="CollisionPolygon2D4" type="CollisionPolygon2D" parent="BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(-64.7, -78.4, -67, -77.3, -67, -75.4, -71, -66.4, -71, -57.8, -61, -52.8, -61, -51.4, -51.2, -49, -38.7, -49, -17.7, -56, -14.5, -56, -17, -67.4, -17, -70.1, -36.1, -69, -43.7, -69, -55.7, -73, -58.3, -73) - -[node name="CollisionPolygon2D5" type="CollisionPolygon2D" parent="BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(-24, -53.4, -24, -50, -28, -47, -40, -45.8, -69.9, -48, -72.4, -48, -74.4, -42, -76, -42, -76, -24.6, -66.4, 0, -65.5, 0, -60, 22, -60, 25.9, -38.6, 18, -35.5, 18, -11.7, 4.5, -10.3, 5, -7.7, 5, 2.3, 13, 4.10001, 13, 17.2, 25, 19.8, 25, 23, 21.8, 23, 19.2, 16, 11.2, 16, 9.10001, 6.8, 1, 4.89999, 1, -12.1, -19, -13, -45.1, -13, -47.2) - -[node name="CollisionPolygon2D6" type="CollisionPolygon2D" parent="BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(2, -48.6, 2, -46.3, 0, -45.2, 0, -36.7, 13, -30.8, 13, -29.4, 23, -27.4, 23, -25.6, 43.3, -29, 46.5, -29, 44, -40.4, 44, -43, 22.1, -43) - -[node name="CollisionPolygon2D7" type="CollisionPolygon2D" parent="BatExtraction/BatExtractionOpenChest/OpenChestHurtArea"] -polygon = PackedVector2Array(8.2, -26.3, 6, -25.2, 6, -24.3, 4, -23.2, 4, -19.8, 13.5, -15, 16.5, -10.6, 16, -8.2, 16, -6.39999, 11, -4.39999, 11, -0.899994, 37, 16.1, 37, 17.5, 39.8, 18.3, 44.1, 12, 46, 12, 46, 0, 47.3, 0, 45, -18.2, 45, -21, 15.6, -21) - -[node name="Path2D" type="Path2D" parent="BatExtraction"] -curve = SubResource("Curve2D_wv8oy") - -[node name="PathFollow2D" type="PathFollow2D" parent="BatExtraction/Path2D"] -position = Vector2(-44, -62) -rotation = -0.0317354 -rotates = false - -[node name="BatExtractionBat" type="Sprite2D" parent="BatExtraction/Path2D/PathFollow2D"] -texture = ExtResource("6_yfdwj") -script = ExtResource("13_um5dt") -speed = 0.1 - -[node name="BatArea" type="Area2D" parent="BatExtraction/Path2D/PathFollow2D/BatExtractionBat"] -collision_layer = 8 -collision_mask = 8 -priority = 3 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BatExtraction/Path2D/PathFollow2D/BatExtractionBat/BatArea"] -polygon = PackedVector2Array(-9, -13, -22.4, -13, -24, -12.2, -24, -9.6, -18, 3.3, -18, 5, -8, 12.9, 5, 13, 23.7, -3, 25, -3, 25, -6.9, 18.8, -13, 13, -13, 3, -3.9, 3, -3, -1.1, -3, -9, -11.8) - -[node name="BatExtractionBody" type="Sprite2D" parent="BatExtraction"] -texture = ExtResource("7_7hv63") - -[node name="BatExtractionOpenChestFlaps" type="Sprite2D" parent="BatExtraction"] -texture = ExtResource("8_1vja2") - -[node name="OpenChestFlapsHurtArea" type="Area2D" parent="BatExtraction/BatExtractionOpenChestFlaps"] -collision_layer = 8 -collision_mask = 8 -priority = 4 - -[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="BatExtraction/BatExtractionOpenChestFlaps/OpenChestFlapsHurtArea"] -polygon = PackedVector2Array(-88, -97, -88, -95.4, -89.4, -94, -90.6, -94, -93, -89.2, -93, -87.4, -99.5, -79, -100.8, -79, -102.8, -71, -103.9, -71, -105, -63.1, -105, -43.8, -103, -39.8, -103, -33, -103.9, -28, -104.9, -28, -105.9, -11, -107.1, -11, -106, 8.10001, -106, 16.3, -100, 24.3, -100, 26.6, -98, 27.6, -98, 28.8, -85, 31.8, -85, 33, -75.7, 33, -68.7, 28, -60.5, 28, -58.5, 25, -56.4, 25, -58.4, 21, -59.1, 21, -62, 4.8, -62, 0.800003, -64.4, -4, -65, -4, -65, -7.2, -66.4, -10, -67.2, -10, -72.3, -26, -73, -26, -73, -39.8, -69.2, -55, -67.9, -55, -69, -66.1, -69, -68.6, -68.6, -69, -67, -69, -67, -71, -66.2, -71, -64, -81.9, -64, -83.4, -70, -89.4, -70, -91, -72.6, -91, -74, -92.4, -74, -93.6, -78, -95.6, -78, -97) - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BatExtraction/BatExtractionOpenChestFlaps/OpenChestFlapsHurtArea"] -polygon = PackedVector2Array(66, -103.6, 66, -101.6, 62.8, -100, 60.6, -100, 51.6, -90, 50, -90, 50, -74.2, 48.3, -70, 47, -70, 47, -67, 46.2, -67, 43.2, -51, 41.9, -51, 43, -38.9, 43, -30.6, 45.6, -28, 49, -28, 49, -27, 47.4, -27, 46.4, -25, 45.3, -25, 44.8, -23.8, 47, -21.6, 47, -19.4, 45.6, -18, 44.1, -18, 43, -2, 43, 9.79999, 41.4, 13, 40, 13, 40, 16.6, 42, 17.6, 42, 19.6, 41.6, 20, 40.3, 20, 39.1, 23.4, 38.2, 23, 36.7, 23, 32.7, 26, 31.4, 26, 30.8, 27.1, 33.5, 31, 37.4, 31, 39.8, 28.5, 40.8, 29, 44.6, 29, 45.6, 27, 52.3, 27, 55.3, 25, 57.6, 25, 58.6, 23, 60.5, 23, 65.5, 17, 66.9, 17, 68, 9.10001, 68, 6.29999, 70.5, 3, 71.7, 3, 73.7, -2, 74.7, -2, 76, -5.8, 76, -11.8, 78.6, -17, 79.7, -17, 82.8, -27, 83.8, -27, 86, -36.9, 86, -53.2, 81.6, -62, 80.8, -62, 78, -71.3, 78, -89.3, 72, -97.4, 72, -100.6) - -[node name="BatExtractionBones" type="Sprite2D" parent="BatExtraction"] -texture = ExtResource("9_7uu43") - -[node name="BonesHurtArea" type="Area2D" parent="BatExtraction/BatExtractionBones"] -collision_layer = 8 -collision_mask = 8 -priority = 4 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BatExtraction/BatExtractionBones/BonesHurtArea"] -polygon = PackedVector2Array(39, -86, 39, -84.3, 21, -75.2, -2, -75, -2, -74, -14.8, -74, -16, -76.5, -16, -79.8, -32.4, -74, -34.6, -74, -62.7, -84, -64.8, -84, -68, -80.8, -68, -78.2, -61, -71.2, -61, -69.3, -38, -65.3, -38, -63.6, -19, -67, -19, -59.5, -41, -53.5, -50.9, -54, -55.4, -54, -63.4, -59, -68.1, -59, -71.1, -54, -74.2, -54, -72, -49.6, -72, -45.8, -68, -43.8, -68, -42, -54, -42, -54, -40.9, -37.9, -42, -29.4, -42, -20, -48.7, -17.1, -44, -16, -24.9, -16, -16.2, 20, 21.8, 20, 23.2, 22.1, 24.3, 25.1, 22.3, 27.9, 27, 36.6, 27, 45, 21, 45, 16.9, 22.6, 2, 19.8, 2, 14.3, -3.5, 21, -6.8, 21, -13.1, 5.60001, -22.8, 15, -18.8, 15, -17, 23, -17, 23, -15.9, 40.1, -17, 45.5, -17, 48, -25.7, 48, -28.8, 37.1, -30, 25.3, -30, 4, -39.3, 4, -43.5, 21.8, -39, 42.4, -39, 46, -49.7, 46, -52.8, 42.8, -56, 40.2, -56, 37.2, -53, 22.1, -53, 3, -58.5, 3, -59.5, 5.7, -65.1, 30.1, -66, 36.8, -66, 49.8, -79, 51.3, -79, 52.4, -81.5, 50, -83.9, 50, -86) - -[node name="Operation" type="Node" parent="."] +[node name="Operation" type="Node2D" parent="."] script = ExtResource("7_mteqj") [node name="CutSequence" type="Node2D" parent="Operation"] @@ -349,10 +156,88 @@ position = Vector2(647, 353) position = Vector2(665, 355) [node name="BatGrabStep" type="Node2D" parent="Operation"] +unique_name_in_owner = true +position = Vector2(620, 399) script = ExtResource("18_d00rj") -grabbing_target_path = NodePath("../../BatExtraction/Path2D/PathFollow2D/BatExtractionBat") +grabbing_target_path = NodePath("Path2D/PathFollow2D/BatExtractionBat") -[connection signal="value_changed" from="UI/HBoxContainer/PatienceBar" to="." method="_on_patience_bar_value_changed"] -[connection signal="timeout" from="TestScalpel/CutHurtTimer" to="TestScalpel" method="_on_cut_hurt_timer_timeout"] -[connection signal="area_entered" from="TestBody1/Area2D" to="TestScalpel" method="_on_body_area_entered"] -[connection signal="area_exited" from="TestBody1/Area2D" to="TestScalpel" method="_on_body_area_exited"] +[node name="BatExtractionOpenChest" type="Sprite2D" parent="Operation/BatGrabStep"] +texture = ExtResource("5_c2dn1") + +[node name="OpenChestHurtArea" type="Area2D" parent="Operation/BatGrabStep/BatExtractionOpenChest"] +collision_layer = 8 +collision_mask = 8 +priority = 2 + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Operation/BatGrabStep/BatExtractionOpenChest/OpenChestHurtArea"] +polygon = PackedVector2Array(35.5, -87.4, 33, -86.3, 33, -85.1, 25.3, -80, 23.4, -80, 22.7, -76.9, 28.5, -74, 31.8, -74, 37.8, -80, 39.3, -80, 40.4, -82.5) + +[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Operation/BatGrabStep/BatExtractionOpenChest/OpenChestHurtArea"] +polygon = PackedVector2Array(48.9, -81.3, 46, -80.5, 46, -79, 34, -70, 7.89999, -69, 2.5, -69, 0.5, -62, -2.2, -62, 1, -55.6, 1, -53.4, 21.8, -49, 38.7, -49, 44.7, -54, 46.5, -54, 51.5, -72, 52.2, -72, 53.3, -74) + +[node name="CollisionPolygon2D3" type="CollisionPolygon2D" parent="Operation/BatGrabStep/BatExtractionOpenChest/OpenChestHurtArea"] +polygon = PackedVector2Array(22.5, -80.4, 20, -79.3, 20, -78.3, 18, -77.2, 18, -73, 26.3, -73, 27.4, -75.5) + +[node name="CollisionPolygon2D4" type="CollisionPolygon2D" parent="Operation/BatGrabStep/BatExtractionOpenChest/OpenChestHurtArea"] +polygon = PackedVector2Array(-64.7, -78.4, -67, -77.3, -67, -75.4, -71, -66.4, -71, -57.8, -61, -52.8, -61, -51.4, -51.2, -49, -38.7, -49, -17.7, -56, -14.5, -56, -17, -67.4, -17, -70.1, -36.1, -69, -43.7, -69, -55.7, -73, -58.3, -73) + +[node name="CollisionPolygon2D5" type="CollisionPolygon2D" parent="Operation/BatGrabStep/BatExtractionOpenChest/OpenChestHurtArea"] +polygon = PackedVector2Array(-24, -53.4, -24, -50, -28, -47, -40, -45.8, -69.9, -48, -72.4, -48, -74.4, -42, -76, -42, -76, -24.6, -66.4, 0, -65.5, 0, -60, 22, -60, 25.9, -38.6, 18, -35.5, 18, -11.7, 4.5, -10.3, 5, -7.7, 5, 2.3, 13, 4.10001, 13, 17.2, 25, 19.8, 25, 23, 21.8, 23, 19.2, 16, 11.2, 16, 9.10001, 6.8, 1, 4.89999, 1, -12.1, -19, -13, -45.1, -13, -47.2) + +[node name="CollisionPolygon2D6" type="CollisionPolygon2D" parent="Operation/BatGrabStep/BatExtractionOpenChest/OpenChestHurtArea"] +polygon = PackedVector2Array(2, -48.6, 2, -46.3, 0, -45.2, 0, -36.7, 13, -30.8, 13, -29.4, 23, -27.4, 23, -25.6, 43.3, -29, 46.5, -29, 44, -40.4, 44, -43, 22.1, -43) + +[node name="CollisionPolygon2D7" type="CollisionPolygon2D" parent="Operation/BatGrabStep/BatExtractionOpenChest/OpenChestHurtArea"] +polygon = PackedVector2Array(8.2, -26.3, 6, -25.2, 6, -24.3, 4, -23.2, 4, -19.8, 13.5, -15, 16.5, -10.6, 16, -8.2, 16, -6.39999, 11, -4.39999, 11, -0.899994, 37, 16.1, 37, 17.5, 39.8, 18.3, 44.1, 12, 46, 12, 46, 0, 47.3, 0, 45, -18.2, 45, -21, 15.6, -21) + +[node name="Path2D" type="Path2D" parent="Operation/BatGrabStep"] +curve = SubResource("Curve2D_wv8oy") + +[node name="PathFollow2D" type="PathFollow2D" parent="Operation/BatGrabStep/Path2D"] +position = Vector2(-44, -62) +rotation = -0.0317354 +rotates = false + +[node name="BatExtractionBat" type="Sprite2D" parent="Operation/BatGrabStep/Path2D/PathFollow2D"] +texture = ExtResource("6_yfdwj") +script = ExtResource("13_um5dt") +speed = 0.1 + +[node name="BatArea" type="Area2D" parent="Operation/BatGrabStep/Path2D/PathFollow2D/BatExtractionBat"] +collision_layer = 8 +collision_mask = 8 +priority = 3 + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Operation/BatGrabStep/Path2D/PathFollow2D/BatExtractionBat/BatArea"] +polygon = PackedVector2Array(-9, -13, -22.4, -13, -24, -12.2, -24, -9.6, -18, 3.3, -18, 5, -8, 12.9, 5, 13, 23.7, -3, 25, -3, 25, -6.9, 18.8, -13, 13, -13, 3, -3.9, 3, -3, -1.1, -3, -9, -11.8) + +[node name="BatExtractionBody" type="Sprite2D" parent="Operation/BatGrabStep"] +texture = ExtResource("7_7hv63") + +[node name="BatExtractionOpenChestFlaps" type="Sprite2D" parent="Operation/BatGrabStep"] +texture = ExtResource("8_1vja2") + +[node name="OpenChestFlapsHurtArea" type="Area2D" parent="Operation/BatGrabStep/BatExtractionOpenChestFlaps"] +collision_layer = 8 +collision_mask = 8 +priority = 4 + +[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="Operation/BatGrabStep/BatExtractionOpenChestFlaps/OpenChestFlapsHurtArea"] +polygon = PackedVector2Array(-88, -97, -88, -95.4, -89.4, -94, -90.6, -94, -93, -89.2, -93, -87.4, -99.5, -79, -100.8, -79, -102.8, -71, -103.9, -71, -105, -63.1, -105, -43.8, -103, -39.8, -103, -33, -103.9, -28, -104.9, -28, -105.9, -11, -107.1, -11, -106, 8.10001, -106, 16.3, -100, 24.3, -100, 26.6, -98, 27.6, -98, 28.8, -85, 31.8, -85, 33, -75.7, 33, -68.7, 28, -60.5, 28, -58.5, 25, -56.4, 25, -58.4, 21, -59.1, 21, -62, 4.8, -62, 0.800003, -64.4, -4, -65, -4, -65, -7.2, -66.4, -10, -67.2, -10, -72.3, -26, -73, -26, -73, -39.8, -69.2, -55, -67.9, -55, -69, -66.1, -69, -68.6, -68.6, -69, -67, -69, -67, -71, -66.2, -71, -64, -81.9, -64, -83.4, -70, -89.4, -70, -91, -72.6, -91, -74, -92.4, -74, -93.6, -78, -95.6, -78, -97) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Operation/BatGrabStep/BatExtractionOpenChestFlaps/OpenChestFlapsHurtArea"] +polygon = PackedVector2Array(66, -103.6, 66, -101.6, 62.8, -100, 60.6, -100, 51.6, -90, 50, -90, 50, -74.2, 48.3, -70, 47, -70, 47, -67, 46.2, -67, 43.2, -51, 41.9, -51, 43, -38.9, 43, -30.6, 45.6, -28, 49, -28, 49, -27, 47.4, -27, 46.4, -25, 45.3, -25, 44.8, -23.8, 47, -21.6, 47, -19.4, 45.6, -18, 44.1, -18, 43, -2, 43, 9.79999, 41.4, 13, 40, 13, 40, 16.6, 42, 17.6, 42, 19.6, 41.6, 20, 40.3, 20, 39.1, 23.4, 38.2, 23, 36.7, 23, 32.7, 26, 31.4, 26, 30.8, 27.1, 33.5, 31, 37.4, 31, 39.8, 28.5, 40.8, 29, 44.6, 29, 45.6, 27, 52.3, 27, 55.3, 25, 57.6, 25, 58.6, 23, 60.5, 23, 65.5, 17, 66.9, 17, 68, 9.10001, 68, 6.29999, 70.5, 3, 71.7, 3, 73.7, -2, 74.7, -2, 76, -5.8, 76, -11.8, 78.6, -17, 79.7, -17, 82.8, -27, 83.8, -27, 86, -36.9, 86, -53.2, 81.6, -62, 80.8, -62, 78, -71.3, 78, -89.3, 72, -97.4, 72, -100.6) + +[node name="BatExtractionBones" type="Sprite2D" parent="Operation/BatGrabStep"] +texture = ExtResource("9_7uu43") + +[node name="BonesHurtArea" type="Area2D" parent="Operation/BatGrabStep/BatExtractionBones"] +collision_layer = 8 +collision_mask = 8 +priority = 4 + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Operation/BatGrabStep/BatExtractionBones/BonesHurtArea"] +polygon = PackedVector2Array(39, -86, 39, -84.3, 21, -75.2, -2, -75, -2, -74, -14.8, -74, -16, -76.5, -16, -79.8, -32.4, -74, -34.6, -74, -62.7, -84, -64.8, -84, -68, -80.8, -68, -78.2, -61, -71.2, -61, -69.3, -38, -65.3, -38, -63.6, -19, -67, -19, -59.5, -41, -53.5, -50.9, -54, -55.4, -54, -63.4, -59, -68.1, -59, -71.1, -54, -74.2, -54, -72, -49.6, -72, -45.8, -68, -43.8, -68, -42, -54, -42, -54, -40.9, -37.9, -42, -29.4, -42, -20, -48.7, -17.1, -44, -16, -24.9, -16, -16.2, 20, 21.8, 20, 23.2, 22.1, 24.3, 25.1, 22.3, 27.9, 27, 36.6, 27, 45, 21, 45, 16.9, 22.6, 2, 19.8, 2, 14.3, -3.5, 21, -6.8, 21, -13.1, 5.60001, -22.8, 15, -18.8, 15, -17, 23, -17, 23, -15.9, 40.1, -17, 45.5, -17, 48, -25.7, 48, -28.8, 37.1, -30, 25.3, -30, 4, -39.3, 4, -43.5, 21.8, -39, 42.4, -39, 46, -49.7, 46, -52.8, 42.8, -56, 40.2, -56, 37.2, -53, 22.1, -53, 3, -58.5, 3, -59.5, 5.7, -65.1, 30.1, -66, 36.8, -66, 49.8, -79, 51.3, -79, 52.4, -81.5, 50, -83.9, 50, -86) + +[connection signal="value_changed" from="DarkCutUI/HBoxContainer/PatienceBar" to="." method="_on_patience_bar_value_changed"] +[connection signal="succeeded" from="Operation" to="." method="_on_operation_succeeded"] diff --git a/operation/test_scalpel.gd b/operation/test_scalpel.gd index a8fb2d3..a87a10f 100644 --- a/operation/test_scalpel.gd +++ b/operation/test_scalpel.gd @@ -4,8 +4,11 @@ extends Sprite2D signal cut_started signal cut_ended +const SCALPEL_ROTATION_CUTTING = -90.0 + var is_cutting_possible = false var is_cutting = false +var _scalpel_degrees_default: float @onready var pickup_area: PickupArea = $PickupArea @onready var cut_area: Area2D = $CutArea @@ -19,20 +22,14 @@ func _input(event: InputEvent): elif event.is_released() and is_cutting: stop_cutting() - -func _on_body_area_entered(area): - if area != cut_area: return +func _on_cut_area_area_entered(area): is_cutting_possible = true +func _on_cut_area_area_exited(area): + is_cutting_possible = cut_area.has_overlapping_areas() + if not is_cutting_possible: + stop_cutting() -func _on_body_area_exited(area): - if area != cut_area: return - is_cutting_possible = false - stop_cutting() - - -var _scalpel_degrees_default: float -const SCALPEL_ROTATION_CUTTING = -90.0 func start_cutting(): if is_cutting: return print("Start cut") @@ -51,9 +48,9 @@ func stop_cutting(): is_cutting = false cut_ended.emit() - func _on_cut_hurt_timer_timeout(): # TODO: Check if should hurt + var patience_bar = get_tree().get_first_node_in_group("patience_bar") as ProgressBar feedback_canvas_modulate.show_hurt_feedback() - %PatienceBar.value = clampi(%PatienceBar.value - 5, 0, 100) + patience_bar.value = clampi(patience_bar.value - 5, 0, 100) print("Splatter") diff --git a/project.godot b/project.godot index 3f61618..2185474 100644 --- a/project.godot +++ b/project.godot @@ -19,9 +19,17 @@ config/icon="res://operation/icon.svg" window/stretch/mode="viewport" +[global_group] + +bat_dropoff="" +effects="" +cutter="" +grabber="" +patience_bar="" + [layer_names] -2d_physics/layer_1="Operation" +2d_physics/layer_1="Scalpel" 2d_physics/layer_2="Pickup" 2d_physics/layer_3="Body" 2d_physics/layer_4="Pliers"