Compare commits
4 commits
feature/su
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a29ae1cf0d | |||
| eb5dae5b3b | |||
| 7ab4a875b7 | |||
| 2cb41beef2 |
23 changed files with 338 additions and 202 deletions
28
bob.tscn
Normal file
28
bob.tscn
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://c2cgr4eqpyahm"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://3oqyqft8w72m" path="res://selectable.tscn" id="1_uk0nh"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_fq5io"]
|
||||
offsets = PackedFloat32Array(0.272085)
|
||||
colors = PackedColorArray(0.202521, 0.371426, 0.429081, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_ty4ro"]
|
||||
gradient = SubResource("Gradient_fq5io")
|
||||
width = 100
|
||||
height = 200
|
||||
fill_from = Vector2(0.5, 0)
|
||||
fill_to = Vector2(0.5, 1)
|
||||
|
||||
[node name="Bob" type="Sprite2D"]
|
||||
texture = SubResource("GradientTexture2D_ty4ro")
|
||||
|
||||
[node name="Selectable" parent="." instance=ExtResource("1_uk0nh")]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Selectable"]
|
||||
polygon = PackedVector2Array(-50, 100, -50, -100, 50, -100, 50, 100)
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
offset_top = 2.0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 25.0
|
||||
text = "Bob"
|
||||
|
|
@ -2,7 +2,7 @@ class_name DialogBob
|
|||
extends Node2D
|
||||
|
||||
|
||||
signal dialog_finished
|
||||
signal dialog_finished(choice_selected: String)
|
||||
|
||||
const SPEED_SLOW = 10.0
|
||||
const SPEED_NORMAL = 15.0
|
||||
|
|
@ -41,8 +41,14 @@ func _unhandled_input(event):
|
|||
var tween: Tween
|
||||
func next_line():
|
||||
if not text_box_label.visible: return
|
||||
if tween:
|
||||
if tween.is_running():
|
||||
tween.pause()
|
||||
tween.custom_step(20)
|
||||
return
|
||||
tween.kill()
|
||||
if current_line >= dialog_text.size():
|
||||
dialog_finished.emit()
|
||||
dialog_finished.emit("")
|
||||
text_box_label.hide()
|
||||
return
|
||||
if current_line == 0:
|
||||
|
|
@ -58,8 +64,7 @@ func next_line():
|
|||
text_box_label.visible_characters = next["speaker"].length() + 2
|
||||
var remaining_characters = text_box_label.text.length() - text_box_label.visible_characters
|
||||
var tween_duration = remaining_characters / (next["speed"] if next.has("speed") else SPEED_NORMAL)
|
||||
if tween:
|
||||
tween.kill()
|
||||
|
||||
tween = create_tween()
|
||||
tween.tween_property(text_box_label, "visible_characters", text_box_label.text.length(), tween_duration)
|
||||
current_line += 1
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ class_name DialogMap
|
|||
extends Node2D
|
||||
|
||||
|
||||
signal dialog_finished
|
||||
signal dialog_finished(choice_selected: String)
|
||||
|
||||
const SPEED_SLOW = 10.0
|
||||
const SPEED_NORMAL = 15.0
|
||||
|
|
@ -12,16 +12,29 @@ const SPEED_FAST = 20.0
|
|||
|
||||
|
||||
var text_box_label: RichTextLabel
|
||||
var choice_1_button: Button
|
||||
var choice_2_button: Button
|
||||
var dialog_text: Array[Dictionary]
|
||||
var current_line = 0
|
||||
var is_choice_needed = false
|
||||
|
||||
func _ready():
|
||||
_setup_text()
|
||||
|
||||
text_box_label.visible = true
|
||||
text_box_label.text = ""
|
||||
choice_1_button.visible = false
|
||||
choice_2_button.visible = false
|
||||
next_line()
|
||||
|
||||
func _close_dialog(choice_selected: String = ""):
|
||||
dialog_finished.emit(choice_selected)
|
||||
text_box_label.text = ""
|
||||
text_box_label.hide()
|
||||
choice_1_button.hide()
|
||||
choice_2_button.hide()
|
||||
is_choice_needed = false
|
||||
|
||||
func _setup_text():
|
||||
match map_point_number:
|
||||
0:
|
||||
|
|
@ -31,7 +44,8 @@ func _setup_text():
|
|||
{speaker = "Necra", text = "After some time on the path I see a strange tree in full blossom."},
|
||||
{speaker = "Necra", text = "Strange, everything else seems dead and decaying."},
|
||||
{speaker = "Necra", text = "But this tree with it's blood red foliage defies the rest."},
|
||||
{speaker = "Necra", text = "I notice a body sitting on the ground, laying against the massive stem amongs the tentacle like roots."},
|
||||
{speaker = "Necra", text = "I notice a body sitting on the ground, laying against the massive stem amongs the tentacle like roots."},
|
||||
{speaker = "Necra", text = "What should I do?", choices = ["Approach body", "Go back"]},
|
||||
]
|
||||
1:
|
||||
dialog_text = [
|
||||
|
|
@ -58,25 +72,42 @@ func _setup_text():
|
|||
{speaker = "Necra", text = "A headless body lies in the middle."},
|
||||
]
|
||||
|
||||
var tween: Tween
|
||||
func _unhandled_input(event):
|
||||
if event is InputEventKey:
|
||||
if event.key_label == KEY_SPACE and event.is_released():
|
||||
if event is InputEventKey and event.key_label == KEY_SPACE and event.is_released():
|
||||
if tween:
|
||||
if tween.is_running():
|
||||
tween.pause()
|
||||
tween.custom_step(20)
|
||||
return
|
||||
tween.kill()
|
||||
if not is_choice_needed:
|
||||
next_line()
|
||||
|
||||
var tween: Tween
|
||||
func next_line():
|
||||
if not text_box_label.visible: return
|
||||
if current_line >= dialog_text.size():
|
||||
dialog_finished.emit()
|
||||
text_box_label.hide()
|
||||
_close_dialog()
|
||||
return
|
||||
var next = dialog_text[current_line]
|
||||
text_box_label.text = "%s: %s" % [next["speaker"], next["text"]]
|
||||
text_box_label.visible_characters = next["speaker"].length() + 2
|
||||
var remaining_characters = text_box_label.text.length() - text_box_label.visible_characters
|
||||
var tween_duration = remaining_characters / (next["speed"] if next.has("speed") else SPEED_NORMAL)
|
||||
if tween:
|
||||
tween.kill()
|
||||
tween = create_tween()
|
||||
tween.tween_property(text_box_label, "visible_characters", text_box_label.text.length(), tween_duration)
|
||||
if "choices" in next:
|
||||
is_choice_needed = true
|
||||
tween.tween_callback(_show_choices.bind(next["choices"]))
|
||||
current_line += 1
|
||||
|
||||
func _show_choices(choices: Array):
|
||||
choice_1_button.text = choices[0]
|
||||
choice_1_button.visible = true
|
||||
choice_1_button.pressed.connect(_close_dialog.bind(choices[0]))
|
||||
|
||||
choice_2_button.text = choices[1]
|
||||
choice_2_button.visible = true
|
||||
choice_2_button.pressed.connect(_close_dialog.bind(choices[1]))
|
||||
|
||||
is_choice_needed = true
|
||||
|
|
|
|||
18
dropoff_area.gd
Normal file
18
dropoff_area.gd
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class_name DropoffArea
|
||||
extends Area2D
|
||||
|
||||
|
||||
|
||||
|
||||
func _on_area_entered(area):
|
||||
if area is not PickupArea: return
|
||||
(area as PickupArea).dropped.connect(_on_pickup_area_dropped.bind(area))
|
||||
|
||||
|
||||
func _on_area_exited(area):
|
||||
if area is not PickupArea: return
|
||||
(area as PickupArea).dropped.disconnect(_on_pickup_area_dropped)
|
||||
|
||||
|
||||
func _on_pickup_area_dropped(pickup_area: PickupArea):
|
||||
pickup_area.parent.reparent(get_parent())
|
||||
1
dropoff_area.gd.uid
Normal file
1
dropoff_area.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bpotohrm5j8tm
|
||||
11
dropoff_area.tscn
Normal file
11
dropoff_area.tscn
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://cnq1uvadx0rwf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bpotohrm5j8tm" path="res://dropoff_area.gd" id="1_uu3dj"]
|
||||
|
||||
[node name="DropoffArea" type="Area2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_uu3dj")
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||
[connection signal="area_exited" from="." to="." method="_on_area_exited"]
|
||||
48
main.gd
48
main.gd
|
|
@ -2,50 +2,44 @@ extends Node2D
|
|||
|
||||
const DARK_CUT_SCENE = preload("res://operation/prototype_dark_cut.tscn")
|
||||
const DIALOG_BOB_SCENE = preload("res://dialog/dialog_bob.tscn")
|
||||
const RITUAL_BOOK_SCENE = preload("res://ritual/prototype_ritual_book.tscn")
|
||||
const MAP_SCENE = preload("res://map/prototype_map.tscn")
|
||||
|
||||
|
||||
@onready var room: Node2D = $Room
|
||||
@onready var shelves: Node2D = $Shelves
|
||||
|
||||
var shown_map_points: Array[int] = [0]
|
||||
var is_dialog_shown = false
|
||||
var map_precondition: String:
|
||||
set(new_value):
|
||||
if map_precondition == "dark_cut_completed" and not new_value:
|
||||
(get_node("PrototypeMap") as PrototypeMap).show_map_point([1])
|
||||
map_precondition = new_value
|
||||
|
||||
func _ready():
|
||||
_on_bob_clicked()
|
||||
|
||||
func _on_bob_clicked():
|
||||
var dialog_bob = DIALOG_BOB_SCENE.instantiate()
|
||||
_disable_node2d(room)
|
||||
_disable_node2d(shelves)
|
||||
dialog_bob.dialog_finished.connect(func():
|
||||
dialog_bob.dialog_finished.connect(func(choice):
|
||||
_enable_node2d(room)
|
||||
_enable_node2d(shelves)
|
||||
)
|
||||
_show_dialog(dialog_bob)
|
||||
|
||||
func _on_ritual_book_clicked():
|
||||
var ritual_book = RITUAL_BOOK_SCENE.instantiate()
|
||||
ritual_book.incantation_completed.connect(_on_ritual_book_incantation_completed.bind(ritual_book))
|
||||
add_child.call_deferred(ritual_book)
|
||||
|
||||
func _on_ritual_place_clicked():
|
||||
func _show_dark_cut():
|
||||
_disable_node2d(room)
|
||||
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)
|
||||
move_child.call_deferred($Suitcase, -1)
|
||||
|
||||
func _on_map_selectable_clicked():
|
||||
_disable_node2d(room)
|
||||
var map: PrototypeMap = MAP_SCENE.instantiate()
|
||||
map.shown_points = shown_map_points
|
||||
map.dialog_triggered.connect(_on_map_dialog_triggered)
|
||||
map.dialog_triggered.connect(_on_map_dialog_triggered.bind(map))
|
||||
map.shown_points_changed.connect(func(value): shown_map_points = value)
|
||||
map.map_closed.connect(_on_map_closed.bind(map))
|
||||
add_child.call_deferred(map)
|
||||
|
||||
|
||||
func _disable_node2d(node: Node2D):
|
||||
node.hide()
|
||||
node.set_deferred("process", false)
|
||||
|
|
@ -56,33 +50,43 @@ func _enable_node2d(node: Node2D):
|
|||
|
||||
func _show_room():
|
||||
_enable_node2d(room)
|
||||
_enable_node2d(shelves)
|
||||
|
||||
func _show_dialog(dialog):
|
||||
if is_dialog_shown: return
|
||||
|
||||
is_dialog_shown = true
|
||||
_disable_node2d(room)
|
||||
dialog.dialog_finished.connect(_on_dialog_finished.bind(dialog))
|
||||
dialog.text_box_label = %TextBoxLabel
|
||||
if "choice_1_button" in dialog:
|
||||
dialog.choice_1_button = %Choice1
|
||||
if "choice_2_button" in dialog:
|
||||
dialog.choice_2_button = %Choice2
|
||||
add_child.call_deferred(dialog)
|
||||
|
||||
func _on_dark_cut_succeeded(dark_cut: DarkCut):
|
||||
dark_cut.queue_free()
|
||||
map_precondition = ""
|
||||
_show_room()
|
||||
|
||||
func _on_dark_cut_failed(dark_cut: DarkCut):
|
||||
dark_cut.queue_free()
|
||||
_show_room()
|
||||
|
||||
func _on_ritual_book_incantation_completed(ritual_book: PrototypeRitualBook):
|
||||
ritual_book.queue_free()
|
||||
|
||||
func _on_dialog_finished(dialog: Node):
|
||||
func _on_dialog_finished(choice_selected: String, dialog: Node):
|
||||
is_dialog_shown = false
|
||||
dialog.queue_free()
|
||||
_enable_node2d(room)
|
||||
if choice_selected == "Approach body":
|
||||
_show_dark_cut()
|
||||
|
||||
func _on_map_dialog_triggered(dialog_map: DialogMap):
|
||||
func _on_map_dialog_triggered(dialog_map: DialogMap, map_points_to_show: Array[int], precondition: String, map: PrototypeMap):
|
||||
_show_dialog(dialog_map)
|
||||
if not precondition:
|
||||
map.show_map_point(map_points_to_show)
|
||||
else:
|
||||
map_precondition = precondition
|
||||
|
||||
|
||||
func _on_map_closed(map: PrototypeMap):
|
||||
map.queue_free()
|
||||
|
|
|
|||
156
main.tscn
156
main.tscn
|
|
@ -1,9 +1,9 @@
|
|||
[gd_scene load_steps=36 format=3 uid="uid://w3ntt1yh1nq7"]
|
||||
[gd_scene load_steps=32 format=3 uid="uid://w3ntt1yh1nq7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://lnmooufxbuym" path="res://main.gd" id="1_dp5o4"]
|
||||
[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="PackedScene" uid="uid://cnq1uvadx0rwf" path="res://dropoff_area.tscn" id="4_ycdy4"]
|
||||
[ext_resource type="PackedScene" uid="uid://bgp8l04mw4ddh" path="res://suitcase.tscn" id="12_dg77c"]
|
||||
[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"]
|
||||
|
|
@ -11,7 +11,6 @@
|
|||
[ext_resource type="Texture2D" uid="uid://cg3dg7iqif56d" path="res://operation/test_scalpel.png" id="20_4lmeg"]
|
||||
[ext_resource type="Script" uid="uid://cqnproj5khm5a" path="res://operation/test_scalpel.gd" id="21_0cp0l"]
|
||||
[ext_resource type="Shape2D" uid="uid://bo77ihhtxfueg" path="res://operation/scalpel_pickup_area_collision_shape.tres" id="22_d2t1y"]
|
||||
[ext_resource type="Script" uid="uid://drfykuqe2phdt" path="res://operation/bat_dropoff.gd" id="23_gngh3"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_qkope"]
|
||||
offsets = PackedFloat32Array(0.0372881)
|
||||
|
|
@ -29,17 +28,6 @@ colors = PackedColorArray(0.281175, 0.300745, 0.258554, 1)
|
|||
gradient = SubResource("Gradient_wb6aq")
|
||||
width = 1152
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_fq5io"]
|
||||
offsets = PackedFloat32Array(0.272085)
|
||||
colors = PackedColorArray(0.202521, 0.371426, 0.429081, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_ty4ro"]
|
||||
gradient = SubResource("Gradient_fq5io")
|
||||
width = 100
|
||||
height = 200
|
||||
fill_from = Vector2(0.5, 0)
|
||||
fill_to = Vector2(0.5, 1)
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_ncwe7"]
|
||||
offsets = PackedFloat32Array(0.282686)
|
||||
colors = PackedColorArray(0.368627, 0, 0, 1)
|
||||
|
|
@ -77,9 +65,6 @@ radius = 8.24621
|
|||
[sub_resource type="CircleShape2D" id="CircleShape2D_qmwrh"]
|
||||
radius = 5.65684
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0odxb"]
|
||||
size = Vector2(110, 65)
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_vivmo"]
|
||||
offsets = PackedFloat32Array(0.353357, 0.929329, 1)
|
||||
colors = PackedColorArray(0, 0, 0, 1, 0.498233, 0.498233, 0.498233, 1, 1, 1, 1, 1)
|
||||
|
|
@ -124,9 +109,9 @@ anchor_left = 0.5
|
|||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -259.0
|
||||
offset_top = -33.0
|
||||
offset_right = 259.0
|
||||
offset_left = -353.0
|
||||
offset_top = -68.0
|
||||
offset_right = 353.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
theme_override_constants/margin_left = 5
|
||||
|
|
@ -134,10 +119,29 @@ theme_override_constants/margin_top = 5
|
|||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="TextBoxLabel" type="RichTextLabel" parent="UI/TextBox"]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="UI/TextBox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TextBoxLabel" type="RichTextLabel" parent="UI/TextBox/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Test"
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="UI/TextBox/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Choice1" type="Button" parent="UI/TextBox/VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Choice 1"
|
||||
|
||||
[node name="Choice2" type="Button" parent="UI/TextBox/VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Choice 2"
|
||||
|
||||
[node name="FeedbackCanvasModulate" type="CanvasModulate" parent="." groups=["effects"]]
|
||||
unique_name_in_owner = true
|
||||
|
|
@ -155,21 +159,6 @@ position = Vector2(578, -71)
|
|||
scale = Vector2(1.001, 652)
|
||||
texture = SubResource("GradientTexture1D_ij864")
|
||||
|
||||
[node name="Bob" type="Sprite2D" parent="Room"]
|
||||
position = Vector2(242, 258)
|
||||
texture = SubResource("GradientTexture2D_ty4ro")
|
||||
|
||||
[node name="Selectable" parent="Room/Bob" instance=ExtResource("3_g5hfc")]
|
||||
|
||||
[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/Bob"]
|
||||
offset_top = 2.0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 25.0
|
||||
text = "Bob"
|
||||
|
||||
[node name="RitualPlace" type="Sprite2D" parent="Room"]
|
||||
position = Vector2(469, 390)
|
||||
texture = SubResource("GradientTexture2D_ftstk")
|
||||
|
|
@ -186,25 +175,22 @@ offset_right = 49.0
|
|||
offset_bottom = 67.0
|
||||
text = "Ritual place"
|
||||
|
||||
[node name="Shelves" type="Node2D" parent="."]
|
||||
[node name="Shelves" type="Node2D" parent="Room"]
|
||||
top_level = true
|
||||
position = Vector2(1004, 324.5)
|
||||
|
||||
[node name="ShelvesBackground" type="Sprite2D" parent="Shelves"]
|
||||
[node name="ShelvesBackground" type="Sprite2D" parent="Room/Shelves"]
|
||||
scale = Vector2(300, 655)
|
||||
texture = SubResource("GradientTexture1D_soglf")
|
||||
|
||||
[node name="UtilsDropoff" type="Node2D" parent="Shelves"]
|
||||
unique_name_in_owner = true
|
||||
[node name="UtilsDropoff" type="Node2D" parent="Room/Shelves"]
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="Shelves/UtilsDropoff"]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
[node name="DropoffArea" parent="Room/Shelves/UtilsDropoff" instance=ExtResource("4_ycdy4")]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Shelves/UtilsDropoff/Area2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Room/Shelves/UtilsDropoff/DropoffArea"]
|
||||
shape = SubResource("RectangleShape2D_1u8w0")
|
||||
|
||||
[node name="Pliers" type="Sprite2D" parent="Shelves" groups=["grabber"]]
|
||||
[node name="Pliers" type="Sprite2D" parent="Room/Shelves" groups=["grabber"]]
|
||||
z_index = 10
|
||||
position = Vector2(0, -206.5)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
|
|
@ -212,30 +198,30 @@ texture = ExtResource("17_b1qrp")
|
|||
offset = Vector2(76, -78)
|
||||
script = ExtResource("18_come4")
|
||||
|
||||
[node name="PickupArea" parent="Shelves/Pliers" instance=ExtResource("19_h8e4i")]
|
||||
[node name="PickupArea" parent="Room/Shelves/Pliers" instance=ExtResource("19_h8e4i")]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Shelves/Pliers/PickupArea"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Room/Shelves/Pliers/PickupArea"]
|
||||
position = Vector2(76, -60)
|
||||
rotation = 1.00484
|
||||
shape = SubResource("CapsuleShape2D_1a0oe")
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Shelves/Pliers/PickupArea"]
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Room/Shelves/Pliers/PickupArea"]
|
||||
position = Vector2(46, -80)
|
||||
rotation = 0.363771
|
||||
shape = SubResource("CapsuleShape2D_f4g1u")
|
||||
|
||||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="Shelves/Pliers/PickupArea"]
|
||||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="Room/Shelves/Pliers/PickupArea"]
|
||||
shape = SubResource("CircleShape2D_efxa6")
|
||||
|
||||
[node name="GrabArea" type="Area2D" parent="Shelves/Pliers"]
|
||||
[node name="GrabArea" type="Area2D" parent="Room/Shelves/Pliers"]
|
||||
collision_layer = 8
|
||||
collision_mask = 8
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Shelves/Pliers/GrabArea"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Room/Shelves/Pliers/GrabArea"]
|
||||
shape = SubResource("CircleShape2D_8w656")
|
||||
debug_color = Color(0.879882, 0.304191, 0.394852, 0.42)
|
||||
|
||||
[node name="Scalpel" type="Sprite2D" parent="Shelves" groups=["cutter"]]
|
||||
[node name="Scalpel" type="Sprite2D" parent="Room/Shelves" groups=["cutter"]]
|
||||
z_index = 10
|
||||
position = Vector2(-72.9391, -140.263)
|
||||
rotation = -2.00713
|
||||
|
|
@ -244,53 +230,37 @@ texture = ExtResource("20_4lmeg")
|
|||
offset = Vector2(-8.44019, 66.5461)
|
||||
script = ExtResource("21_0cp0l")
|
||||
|
||||
[node name="PickupArea" parent="Shelves/Scalpel" instance=ExtResource("19_h8e4i")]
|
||||
[node name="PickupArea" parent="Room/Shelves/Scalpel" instance=ExtResource("19_h8e4i")]
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Shelves/Scalpel/PickupArea"]
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Room/Shelves/Scalpel/PickupArea"]
|
||||
position = Vector2(-7.59496, 64.7336)
|
||||
shape = ExtResource("22_d2t1y")
|
||||
|
||||
[node name="CutArea" type="Area2D" parent="Shelves/Scalpel"]
|
||||
[node name="CutArea" type="Area2D" parent="Room/Shelves/Scalpel"]
|
||||
collision_layer = 5
|
||||
collision_mask = 5
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Shelves/Scalpel/CutArea"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Room/Shelves/Scalpel/CutArea"]
|
||||
position = Vector2(0.481193, 0.0901661)
|
||||
shape = SubResource("CircleShape2D_qmwrh")
|
||||
debug_color = Color(0.879882, 0.304191, 0.394852, 0.42)
|
||||
|
||||
[node name="CutHurtTimer" type="Timer" parent="Shelves/Scalpel"]
|
||||
[node name="CutHurtTimer" type="Timer" parent="Room/Shelves/Scalpel"]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="BatDropoff" type="Node2D" parent="Shelves" groups=["bat_dropoff"]]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("23_gngh3")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Shelves/BatDropoff"]
|
||||
rotation = 1.5708
|
||||
scale = Vector2(0.208791, 0.204598)
|
||||
texture = ExtResource("5_lswn8")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="Shelves/BatDropoff"]
|
||||
collision_layer = 8
|
||||
collision_mask = 8
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Shelves/BatDropoff/Area2D"]
|
||||
scale = Vector2(0.983051, 1)
|
||||
shape = SubResource("RectangleShape2D_0odxb")
|
||||
|
||||
[node name="RitualBook" type="Node2D" parent="Shelves"]
|
||||
[node name="RitualBook" type="Node2D" parent="Room/Shelves"]
|
||||
z_index = 10
|
||||
position = Vector2(-92, 240.5)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Shelves/RitualBook"]
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Room/Shelves/RitualBook"]
|
||||
texture = SubResource("GradientTexture2D_2cqfq")
|
||||
|
||||
[node name="Selectable" parent="Shelves/RitualBook/Sprite2D" instance=ExtResource("3_g5hfc")]
|
||||
[node name="PickupArea" parent="Room/Shelves/RitualBook" instance=ExtResource("19_h8e4i")]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Shelves/RitualBook/Sprite2D/Selectable"]
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Room/Shelves/RitualBook/PickupArea"]
|
||||
polygon = PackedVector2Array(-16, -64, -16, 64, 16, 64, 16, -64)
|
||||
|
||||
[node name="Label" type="Label" parent="Shelves/RitualBook"]
|
||||
[node name="Label" type="Label" parent="Room/Shelves/RitualBook"]
|
||||
offset_left = -17.0
|
||||
offset_top = 40.5
|
||||
offset_right = 68.0
|
||||
|
|
@ -298,24 +268,24 @@ offset_bottom = 63.5
|
|||
rotation = -1.5708
|
||||
text = "Rituals 101"
|
||||
|
||||
[node name="Map" type="Node2D" parent="Shelves"]
|
||||
[node name="Map" type="Node2D" parent="Room/Shelves"]
|
||||
position = Vector2(43, 200.5)
|
||||
|
||||
[node name="Sprite2D2" type="Sprite2D" parent="Shelves/Map"]
|
||||
[node name="Sprite2D2" type="Sprite2D" parent="Room/Shelves/Map"]
|
||||
position = Vector2(2, 2.5)
|
||||
skew = 0.115192
|
||||
texture = SubResource("GradientTexture2D_w48qg")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Shelves/Map"]
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Room/Shelves/Map"]
|
||||
skew = 0.115192
|
||||
texture = SubResource("GradientTexture2D_dg77c")
|
||||
|
||||
[node name="Selectable" parent="Shelves/Map/Sprite2D" instance=ExtResource("3_g5hfc")]
|
||||
[node name="Selectable" parent="Room/Shelves/Map/Sprite2D" instance=ExtResource("3_g5hfc")]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Shelves/Map/Sprite2D/Selectable"]
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Room/Shelves/Map/Sprite2D/Selectable"]
|
||||
polygon = PackedVector2Array(-16, -32, -16, 32, 16, 32, 16, -32)
|
||||
|
||||
[node name="Label" type="Label" parent="Shelves/Map"]
|
||||
[node name="Label" type="Label" parent="Room/Shelves/Map"]
|
||||
offset_left = -13.0
|
||||
offset_top = 17.5
|
||||
offset_right = 27.0
|
||||
|
|
@ -324,12 +294,10 @@ rotation = -1.49051
|
|||
text = "Map"
|
||||
|
||||
[node name="Suitcase" parent="." instance=ExtResource("12_dg77c")]
|
||||
position = Vector2(177, 487)
|
||||
|
||||
[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="input_event" from="Shelves/Pliers/GrabArea" to="Shelves/Pliers" method="_on_grab_area_input_event"]
|
||||
[connection signal="area_entered" from="Shelves/Scalpel/CutArea" to="Shelves/Scalpel" method="_on_cut_area_area_entered"]
|
||||
[connection signal="area_exited" from="Shelves/Scalpel/CutArea" to="Shelves/Scalpel" method="_on_cut_area_area_exited"]
|
||||
[connection signal="timeout" from="Shelves/Scalpel/CutHurtTimer" to="Shelves/Scalpel" method="_on_cut_hurt_timer_timeout"]
|
||||
[connection signal="clicked" from="Shelves/RitualBook/Sprite2D/Selectable" to="." method="_on_ritual_book_clicked"]
|
||||
[connection signal="clicked" from="Shelves/Map/Sprite2D/Selectable" to="." method="_on_map_selectable_clicked"]
|
||||
[connection signal="input_event" from="Room/Shelves/Pliers/GrabArea" to="Room/Shelves/Pliers" method="_on_grab_area_input_event"]
|
||||
[connection signal="area_entered" from="Room/Shelves/Scalpel/CutArea" to="Room/Shelves/Scalpel" method="_on_cut_area_area_entered"]
|
||||
[connection signal="area_exited" from="Room/Shelves/Scalpel/CutArea" to="Room/Shelves/Scalpel" method="_on_cut_area_area_exited"]
|
||||
[connection signal="timeout" from="Room/Shelves/Scalpel/CutHurtTimer" to="Room/Shelves/Scalpel" method="_on_cut_hurt_timer_timeout"]
|
||||
[connection signal="clicked" from="Room/Shelves/Map/Sprite2D/Selectable" to="." method="_on_map_selectable_clicked"]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
class_name PrototypeMap
|
||||
extends Node2D
|
||||
|
||||
signal dialog_triggered(dialog_map: DialogMap)
|
||||
signal dialog_triggered(dialog_map: DialogMap, map_points_to_show: Array[int], precondition: String)
|
||||
signal shown_points_changed(new_shown_points: Array[int])
|
||||
signal map_closed
|
||||
|
||||
|
|
@ -11,28 +11,20 @@ var shown_points: Array[int]:
|
|||
set(new_value):
|
||||
shown_points = new_value
|
||||
shown_points_changed.emit(shown_points)
|
||||
var next_points_to_unlock: Array[int] = []
|
||||
|
||||
func _ready():
|
||||
if 0 in shown_points:
|
||||
$MapPoint.is_shown_on_map = true
|
||||
if 1 in shown_points:
|
||||
$MapPoint2.is_shown_on_map = true
|
||||
if 2 in shown_points:
|
||||
$MapPoint3.is_shown_on_map = true
|
||||
if 3 in shown_points:
|
||||
$MapPoint4.is_shown_on_map = true
|
||||
for point in shown_points:
|
||||
_get_map_point(point).is_shown_on_map = true
|
||||
|
||||
|
||||
func _on_map_point_clicked():
|
||||
if not $MapPoint2.is_shown_on_map:
|
||||
_trigger_dialog(0)
|
||||
shown_points.append(1)
|
||||
_trigger_dialog(0, [1], "dark_cut_completed")
|
||||
|
||||
func _on_map_point_2_clicked():
|
||||
if not $MapPoint3.is_shown_on_map:
|
||||
_trigger_dialog(1)
|
||||
shown_points.append(2)
|
||||
shown_points.append(3)
|
||||
_trigger_dialog(1, [2,3])
|
||||
|
||||
func _on_map_point_3_clicked():
|
||||
_trigger_dialog(2)
|
||||
|
|
@ -40,20 +32,22 @@ func _on_map_point_3_clicked():
|
|||
func _on_map_point_4_clicked():
|
||||
_trigger_dialog(3)
|
||||
|
||||
func _trigger_dialog(map_point_number: int):
|
||||
func _trigger_dialog(map_point_number: int, map_points_to_show: Array[int] = [], precondition: String = ""):
|
||||
var dialog_map: DialogMap = DIALOG_MAP.instantiate()
|
||||
dialog_map.map_point_number = map_point_number
|
||||
dialog_map.dialog_finished.connect(_show_map_point.bind(map_point_number))
|
||||
dialog_triggered.emit(dialog_map)
|
||||
dialog_triggered.emit(dialog_map, map_points_to_show, precondition)
|
||||
|
||||
func _show_map_point(map_point_number):
|
||||
print("Hi", map_point_number)
|
||||
match map_point_number:
|
||||
0:
|
||||
$MapPoint2.is_shown_on_map = true
|
||||
1:
|
||||
$MapPoint3.is_shown_on_map = true
|
||||
$MapPoint4.is_shown_on_map = true
|
||||
func show_map_point(map_points_to_show: Array[int]):
|
||||
if map_points_to_show.is_empty(): return
|
||||
|
||||
for point in map_points_to_show:
|
||||
_get_map_point(point).is_shown_on_map = true
|
||||
|
||||
shown_points.append_array(map_points_to_show)
|
||||
|
||||
func _get_map_point(map_point_number: int) -> MapPoint:
|
||||
return get_node("MapPoint%s"% (map_point_number+1)) as MapPoint
|
||||
|
||||
|
||||
func _on_close_map_button_pressed():
|
||||
map_closed.emit()
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ script = ExtResource("1_mj08v")
|
|||
position = Vector2(395, 292)
|
||||
texture = SubResource("GradientTexture2D_fjiih")
|
||||
|
||||
[node name="MapPoint" parent="." node_paths=PackedStringArray("connected_map_points") instance=ExtResource("2_mj08v")]
|
||||
[node name="MapPoint1" parent="." node_paths=PackedStringArray("connected_map_points") instance=ExtResource("2_mj08v")]
|
||||
position = Vector2(199, 332)
|
||||
connected_map_points = [NodePath("../MapPoint2")]
|
||||
is_shown_on_map = true
|
||||
|
|
@ -46,7 +46,7 @@ offset_right = 707.0
|
|||
offset_bottom = 118.0
|
||||
text = "Close Map"
|
||||
|
||||
[connection signal="clicked" from="MapPoint" to="." method="_on_map_point_clicked"]
|
||||
[connection signal="clicked" from="MapPoint1" to="." method="_on_map_point_clicked"]
|
||||
[connection signal="clicked" from="MapPoint2" to="." method="_on_map_point_2_clicked"]
|
||||
[connection signal="clicked" from="MapPoint3" to="." method="_on_map_point_3_clicked"]
|
||||
[connection signal="clicked" from="MapPoint4" to="." method="_on_map_point_4_clicked"]
|
||||
|
|
|
|||
|
|
@ -32,5 +32,15 @@ func grab_bat():
|
|||
position = Vector2.ZERO
|
||||
top_level = true
|
||||
|
||||
func drop_bat():
|
||||
func abort_grabbing():
|
||||
is_grabbed = false
|
||||
grab_area.set_deferred("monitoring", true)
|
||||
grab_area.set_deferred("monitorable", true)
|
||||
path_follow.progress_ratio = 0.0
|
||||
position = Vector2.ZERO
|
||||
top_level = false
|
||||
|
||||
func drop_bat(new_parent: Node2D):
|
||||
is_dropped = true
|
||||
top_level = false
|
||||
reparent.call_deferred(new_parent, false)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ signal step_failed
|
|||
|
||||
|
||||
var feedback_canvas_modulate: FeedbackCanvasModulate
|
||||
var bat_dropoff: BatDropoff
|
||||
var bat_dropoff: Node2D
|
||||
var patience_bar: ProgressBar
|
||||
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ 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
|
||||
bat_dropoff = get_tree().get_first_node_in_group("bat_dropoff")
|
||||
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)
|
||||
|
|
@ -33,6 +33,10 @@ func _on_pliers_used(top_area: Area2D):
|
|||
else:
|
||||
_hurt()
|
||||
|
||||
func _exit_tree():
|
||||
if grabbing_target.is_grabbed:
|
||||
grabbing_target.abort_grabbing()
|
||||
pliers.enable_dropoff()
|
||||
|
||||
func _target_grabbed():
|
||||
pliers.disable_dropoff()
|
||||
|
|
@ -40,7 +44,7 @@ func _target_grabbed():
|
|||
|
||||
func _target_dropped():
|
||||
pliers.enable_dropoff()
|
||||
grabbing_target.drop_bat()
|
||||
grabbing_target.drop_bat(bat_dropoff)
|
||||
step_succeeded.emit()
|
||||
|
||||
func _hurt():
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ func _ready():
|
|||
elif child is GrabStep:
|
||||
child.step_succeeded.connect(_on_grab_step_succeeded.bind(child))
|
||||
_disable_node2d(child)
|
||||
elif child is RitualStep:
|
||||
child.step_succeeded.connect(_on_ritual_step_succeeded.bind(child))
|
||||
_disable_node2d(child)
|
||||
|
||||
active_step = steps[0]
|
||||
if active_step is GrabStep:
|
||||
|
|
@ -45,6 +48,11 @@ func _on_cut_sequence_failed(cut_sequence: CutSequence):
|
|||
pass
|
||||
|
||||
func _on_grab_step_succeeded(grab_step: GrabStep):
|
||||
var next_index = steps.find(grab_step) + 1
|
||||
active_step = steps[next_index]
|
||||
_enable_node2d(active_step)
|
||||
|
||||
func _on_ritual_step_succeeded(ritual_step: RitualStep):
|
||||
succeeded.emit()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,10 +9,8 @@ func _on_patience_bar_value_changed(value):
|
|||
if value <= 0:
|
||||
failed.emit()
|
||||
|
||||
|
||||
func _on_operation_succeeded():
|
||||
succeeded.emit()
|
||||
|
||||
|
||||
func _on_abort_button_pressed():
|
||||
failed.emit()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=18 format=3 uid="uid://be0rqt7sk1da0"]
|
||||
[gd_scene load_steps=20 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"]
|
||||
|
|
@ -12,6 +12,8 @@
|
|||
[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://cgom2jfkjmwv8" path="res://operation/ritual_step.gd" id="14_uv6f2"]
|
||||
[ext_resource type="PackedScene" uid="uid://qkwh186nbcya" path="res://ritual/prototype_ritual_book.tscn" id="15_37tl7"]
|
||||
[ext_resource type="Script" uid="uid://diku6p1um3ko6" path="res://operation/grab_step.gd" id="18_d00rj"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pgu75"]
|
||||
|
|
@ -81,12 +83,12 @@ scale = Vector2(1.001, 648)
|
|||
texture = SubResource("GradientTexture1D_f6e8o")
|
||||
|
||||
[node name="TestTable" type="Sprite2D" parent="."]
|
||||
position = Vector2(613, 358)
|
||||
position = Vector2(840, 356)
|
||||
texture = ExtResource("1_7i8d4")
|
||||
|
||||
[node name="TestBody1" type="Sprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(620, 399)
|
||||
position = Vector2(847, 397)
|
||||
texture = ExtResource("2_atjyl")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="TestBody1"]
|
||||
|
|
@ -97,6 +99,7 @@ collision_mask = 4
|
|||
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="Operation" type="Node2D" parent="."]
|
||||
position = Vector2(227, -2)
|
||||
script = ExtResource("7_mteqj")
|
||||
|
||||
[node name="CutSequence" type="Node2D" parent="Operation"]
|
||||
|
|
@ -249,6 +252,14 @@ 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)
|
||||
|
||||
[node name="RitualStep" type="Node2D" parent="Operation"]
|
||||
position = Vector2(-366, -5)
|
||||
script = ExtResource("14_uv6f2")
|
||||
|
||||
[node name="PrototypeRitualBook" parent="Operation/RitualStep" instance=ExtResource("15_37tl7")]
|
||||
position = Vector2(179, 150)
|
||||
|
||||
[connection signal="value_changed" from="DarkCutUI/HBoxContainer/PatienceBar" to="." method="_on_patience_bar_value_changed"]
|
||||
[connection signal="pressed" from="DarkCutUI/AbortButton" to="." method="_on_abort_button_pressed"]
|
||||
[connection signal="succeeded" from="Operation" to="." method="_on_operation_succeeded"]
|
||||
[connection signal="incantation_completed" from="Operation/RitualStep/PrototypeRitualBook" to="Operation/RitualStep" method="_on_ritual_book_incantation_completed"]
|
||||
|
|
|
|||
11
operation/ritual_step.gd
Normal file
11
operation/ritual_step.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class_name RitualStep
|
||||
extends Node2D
|
||||
|
||||
signal step_succeeded
|
||||
|
||||
|
||||
@export var is_skipped: bool = false
|
||||
|
||||
|
||||
func _on_ritual_book_incantation_completed():
|
||||
step_succeeded.emit()
|
||||
1
operation/ritual_step.gd.uid
Normal file
1
operation/ritual_step.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cgom2jfkjmwv8
|
||||
|
|
@ -5,9 +5,6 @@ signal picked_up()
|
|||
signal dropped()
|
||||
|
||||
|
||||
@onready var dropoff_area: Area2D = %UtilsDropoff.get_node("Area2D")
|
||||
|
||||
|
||||
var is_picked_up = false
|
||||
var is_dropable = false
|
||||
var is_dropping_enabled = true
|
||||
|
|
@ -32,12 +29,12 @@ func _exit_tree():
|
|||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
|
||||
func _on_dropoff_area_entered(area):
|
||||
if area == dropoff_area:
|
||||
is_dropable = true
|
||||
if area is not DropoffArea: return
|
||||
is_dropable = true
|
||||
|
||||
func _on_dropoff_area_exited(area):
|
||||
if area == dropoff_area:
|
||||
is_dropable = false
|
||||
if area is not DropoffArea: return
|
||||
is_dropable = false
|
||||
|
||||
func _pickup():
|
||||
is_picked_up = true
|
||||
|
|
|
|||
|
|
@ -25,3 +25,8 @@ func _draw():
|
|||
draw_set_transform(t.origin - (Vector2.UP * 5).rotated(t.get_rotation()), t.get_rotation())
|
||||
draw_char(get_theme_default_font(), Vector2.ZERO, c, 16, Color.WHITE if offset >= colored_offset else Color.RED)
|
||||
offset += 10
|
||||
|
||||
|
||||
func _on_visibility_changed():
|
||||
print("Test")
|
||||
queue_redraw()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,11 @@ class_name PrototypeRitualBook
|
|||
extends Node2D
|
||||
|
||||
signal incantation_completed
|
||||
signal book_closed
|
||||
|
||||
func _on_incantation_completed():
|
||||
incantation_completed.emit()
|
||||
|
||||
|
||||
func _on_button_pressed():
|
||||
book_closed.emit()
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://qkwh186nbcya"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://qkwh186nbcya"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dak6uc4v3us7w" path="res://ritual/incantation.gd" id="1_v6csu"]
|
||||
[ext_resource type="Script" uid="uid://dsiaa53vt3y6e" path="res://ritual/prototype_ritual_book.gd" id="1_yc2mw"]
|
||||
[ext_resource type="Script" uid="uid://cpscp5a5nxfop" path="res://ritual/incantation_text.gd" id="2_5ntyk"]
|
||||
[ext_resource type="Script" uid="uid://cpyqpaggaiqb4" path="res://block_input_area.gd" id="2_m7f1b"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_2cqfq"]
|
||||
offsets = PackedFloat32Array(0.80212, 0.978799, 1)
|
||||
|
|
@ -16,9 +15,9 @@ height = 400
|
|||
|
||||
[sub_resource type="Curve2D" id="Curve2D_5ntyk"]
|
||||
_data = {
|
||||
"points": PackedVector2Array(0, 0, 0, 0, 202, 149, -40.482, 1.54217, 40.482, -1.54217, 248, 178, -17.3494, 5.01206, 17.3494, -5.01206, 309, 150, -10.7952, -15.0362, 10.7952, 15.0362, 380, 180, 0, 0, 0, 0, 380, 180, 32.7712, -32.7712, -32.7712, 32.7712, 379, 257, 30.385, 3.70613, -30.385, -3.70613, 305, 219, 0, 0, -49.7351, 23.1326, 255, 252, 27.3736, -12.3374, -27.3736, 12.3374, 198, 230, -28.5302, -24.6748, 28.5302, 24.6748, 202, 319, 0, 0, 0, 0, 377, 318)
|
||||
"points": PackedVector2Array(-21.0368, -45.0789, 21.0368, 45.0789, 28, 28, 0, 0, 0, 0, 84, 57, -30.0526, 3.00526, 30.0526, -3.00526, 127, 41, -37.5657, -19.5342, 37.5657, 19.5342, 213, 45, 11.2697, -20.2855, -11.2697, 20.2855, 240, 98, 42.8249, -12.7724, -42.8249, 12.7724, 172, 150, 27.7986, -26.296, -27.7986, 26.296, 40, 160, -15.7776, -22.5394, 15.7776, 22.5394, 42, 220, -27.0473, -14.275, 27.0473, 14.275, 113, 280, 0, 0, 0, 0, 230, 288)
|
||||
}
|
||||
point_count = 11
|
||||
point_count = 10
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_v6csu"]
|
||||
radius = 13.8924
|
||||
|
|
@ -27,33 +26,27 @@ radius = 13.8924
|
|||
script = ExtResource("1_yc2mw")
|
||||
|
||||
[node name="Left" type="Sprite2D" parent="."]
|
||||
position = Vector2(306, 311)
|
||||
position = Vector2(151, 201)
|
||||
texture = SubResource("GradientTexture2D_yaehf")
|
||||
|
||||
[node name="Right" type="Sprite2D" parent="."]
|
||||
position = Vector2(606, 311)
|
||||
position = Vector2(451, 201)
|
||||
rotation = 3.14159
|
||||
texture = SubResource("GradientTexture2D_yaehf")
|
||||
|
||||
[node name="BlockInputArea" type="Area2D" parent="."]
|
||||
script = ExtResource("2_m7f1b")
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BlockInputArea"]
|
||||
position = Vector2(306, 311)
|
||||
polygon = PackedVector2Array(-150, -200, -150, 200, 150, 200, 150, -200)
|
||||
|
||||
[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="BlockInputArea"]
|
||||
position = Vector2(606, 311)
|
||||
rotation = 3.14159
|
||||
polygon = PackedVector2Array(-150, -200, -150, 200, 150, 200, 150, -200)
|
||||
[node name="CloseButton" type="Button" parent="."]
|
||||
offset_left = 543.0
|
||||
offset_top = 7.0
|
||||
offset_right = 593.0
|
||||
offset_bottom = 38.0
|
||||
text = "Close"
|
||||
|
||||
[node name="Incantation" type="Path2D" parent="."]
|
||||
position = Vector2(-1, 1)
|
||||
curve = SubResource("Curve2D_5ntyk")
|
||||
script = ExtResource("1_v6csu")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="Incantation"]
|
||||
position = Vector2(202, 149)
|
||||
position = Vector2(29, 28)
|
||||
rotation = 0.562498
|
||||
collision_layer = 512
|
||||
collision_mask = 512
|
||||
|
|
@ -64,9 +57,12 @@ shape = SubResource("CircleShape2D_v6csu")
|
|||
[node name="IncantationText" type="Control" parent="Incantation"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 23.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("2_5ntyk")
|
||||
text = "Hallo dies ist ein langer TExt, er könnte auch eine Ritual sein. Wir werden sehen"
|
||||
text = "Hallo dies ist ein langer TExt, er könnte auch eine Ritual sein. Wir werden xxx"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[connection signal="pressed" from="CloseButton" to="." method="_on_button_pressed"]
|
||||
[connection signal="completed" from="Incantation" to="." method="_on_incantation_completed"]
|
||||
[connection signal="visibility_changed" from="Incantation/IncantationText" to="Incantation/IncantationText" method="_on_visibility_changed"]
|
||||
|
|
|
|||
19
suitcase.gd
19
suitcase.gd
|
|
@ -7,23 +7,34 @@ extends Node2D
|
|||
is_open = new_value
|
||||
_update_suitcase()
|
||||
|
||||
@onready var dropoff_area: DropoffArea = $SuitcaseOpen/DropoffArea
|
||||
|
||||
func _ready():
|
||||
if Engine.is_editor_hint(): return
|
||||
_update_suitcase()
|
||||
|
||||
func _update_suitcase():
|
||||
if not is_node_ready(): return
|
||||
|
||||
if is_open:
|
||||
$SuitcaseOpen.show()
|
||||
$SuitcaseClosed.hide()
|
||||
else:
|
||||
$SuitcaseOpen.hide()
|
||||
$SuitcaseClosed.show()
|
||||
$SuitcaseOpen/Area2D.input_pickable = is_open
|
||||
$SuitcaseOpen/DropoffArea.input_pickable = is_open
|
||||
$SuitcaseOpen/CloseOnClickArea.input_pickable = is_open
|
||||
$SuitcaseClosed/OpenOnClickArea.input_pickable = not is_open
|
||||
if Engine.is_editor_hint():
|
||||
$SuitcaseOpen.queue_redraw()
|
||||
$SuitcaseClosed.queue_redraw()
|
||||
|
||||
|
||||
func _on_area_2d_input_event(viewport, event, shape_idx):
|
||||
|
||||
pass # Replace with function body.
|
||||
func _on_close_on_click_area_input_event(viewport, event, shape_idx):
|
||||
if event is InputEventMouseButton and event.is_pressed():
|
||||
is_open = false
|
||||
|
||||
|
||||
func _on_open_on_click_area_input_event(viewport, event, shape_idx):
|
||||
if event is InputEventMouseButton and event.is_pressed():
|
||||
is_open = true
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
[ext_resource type="Script" uid="uid://nrefd2i0qqrf" path="res://suitcase.gd" id="1_kguwf"]
|
||||
[ext_resource type="Texture2D" uid="uid://cterukanhrwfv" path="res://suitcase_closed.png" id="1_q74i1"]
|
||||
[ext_resource type="Texture2D" uid="uid://yrcdv8en42cl" path="res://suitcase_open.png" id="2_kguwf"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3of67m4ic212" path="res://pickup_area.tscn" id="4_kmisx"]
|
||||
[ext_resource type="PackedScene" uid="uid://cnq1uvadx0rwf" path="res://dropoff_area.tscn" id="4_kmisx"]
|
||||
|
||||
[node name="Suitcase" type="Node2D"]
|
||||
[node name="Suitcase" type="Node2D" groups=["bat_dropoff"]]
|
||||
script = ExtResource("1_kguwf")
|
||||
is_open = true
|
||||
|
||||
|
|
@ -13,10 +13,29 @@ is_open = true
|
|||
visible = false
|
||||
texture = ExtResource("1_q74i1")
|
||||
|
||||
[node name="OpenOnClickArea" type="Area2D" parent="SuitcaseClosed"]
|
||||
collision_layer = 256
|
||||
collision_mask = 256
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="SuitcaseClosed/OpenOnClickArea"]
|
||||
polygon = PackedVector2Array(-10.4, -54.5, -77.5, -57.6, -77.5, -56.3, -82.8, -55.5, -127.7, -55.5, -129.7, -51.5, -131.1, -51.5, -152.1, 38.5, -153.3, 38.5, -158.3, 86.5, -159.5, 86.5, -159.5, 98.9, -152.5, 114.8, -152.5, 118.4, -134.5, 133.4, -134.5, 135.1, -124.7, 137.5, -121.2, 137.5, -116.5, 141.4, -116.5, 143, -103.5, 146.9, -103.5, 148.3, -63.6, 152.5, -51.5, 152.5, -46.5, 159.1, -46.5, 160.9, -21.6, 169.5, 28.2, 169.5, 50.5, 155.6, 50.5, 154.4, 73.6, 153.5, 93.7, 153.5, 110.6, 149.5, 115, 149.5, 124, 144.5, 126.1, 144.5, 157.1, 122.5, 158.6, 122.5, 167.6, 107.5, 169.1, 107.5, 172.2, 92.5, 173.5, 92.5, 173.5, 64.4, 165.5, 6.5, 165.5, 1.10001, 142.5, -52.9, 142.5, -55.5, 38.5, -54.5)
|
||||
|
||||
[node name="SuitcaseOpen" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_kguwf")
|
||||
|
||||
[node name="PickupArea" parent="SuitcaseOpen" instance=ExtResource("4_kmisx")]
|
||||
[node name="DropoffArea" parent="SuitcaseOpen" instance=ExtResource("4_kmisx")]
|
||||
collision_layer = 10
|
||||
collision_mask = 10
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="SuitcaseOpen/PickupArea"]
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="SuitcaseOpen/DropoffArea"]
|
||||
polygon = PackedVector2Array(-93, -5, 20, -7, 107, -11, 116, 0, 118, 16, 139, 86, 138, 115, 125, 122, 99, 126, 92, 129, 51, 131, -68, 132, -78, 130, -102, 130, -121, 116, -121, 91, -105, 47)
|
||||
|
||||
[node name="CloseOnClickArea" type="Area2D" parent="SuitcaseOpen"]
|
||||
collision_layer = 256
|
||||
collision_mask = 256
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="SuitcaseOpen/CloseOnClickArea"]
|
||||
polygon = PackedVector2Array(81.7, -169.5, -66.2, -169.5, -124.6, -165.5, -140.8, -165.5, -165.8, -157.5, -169.3, -157.5, -174.3, -152.5, -174.5, -95.5, -163.5, -80.9, -163.5, -78.6, -147.5, -63.6, -147.5, -61.5, -129.1, -48.5, -118.1, -31.3, 139.5, -32.9, 148.4, -43.5, 149.6, -43.5, 174.5, -85.4, 174.5, -162.6, 169.5, -164, 169.5, -165.4)
|
||||
|
||||
[connection signal="input_event" from="SuitcaseClosed/OpenOnClickArea" to="." method="_on_open_on_click_area_input_event"]
|
||||
[connection signal="input_event" from="SuitcaseOpen/CloseOnClickArea" to="." method="_on_close_on_click_area_input_event"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue