This repository has been archived by the owner on Sep 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
explore.tscn
389 lines (324 loc) · 9.87 KB
/
explore.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
[gd_scene load_steps=14 format=2]
[ext_resource path="res://assets/bgm/_PerituneMaterial_Suspense8.ogg" type="AudioStream" id=1]
[ext_resource path="res://explore/Player.tscn" type="PackedScene" id=2]
[ext_resource path="res://explore/dungeon_001.tscn" type="PackedScene" id=3]
[ext_resource path="res://assets/ui.tres" type="Theme" id=4]
[ext_resource path="res://assets/fonts/scripta.tres" type="DynamicFont" id=5]
[ext_resource path="res://assets/fonts/m3x6.tres" type="DynamicFont" id=6]
[ext_resource path="res://assets/combat_transition.png" type="Texture" id=7]
[sub_resource type="GDScript" id=1]
resource_name = "Explore"
script/source = "extends Node
const STEPS_TO_ENCOUNTER = 15
export(AudioStreamOGGVorbis) var bgm
export(bool) var disable_combat = false
var step_counter = 0
signal combat_start
signal combat_ready
signal end_reached
func _ready():
# var dungeon = load(\"res://explore/%s.tscn\" % Player.currently_exploring).instance()
# dungeon.translation = Vector3(-1, 0, -1)
# $Viewport.add_child(dungeon)
# $Viewport.move_child($Viewport/Player, 1)
Player.connect(\"end_reached\", self, \"_on_end_reached\")
if BGM.stream != bgm:
BGM.stream = bgm
BGM.play()
var screen = Screen.duplicate()
screen.tone = Screen.tone
screen.visible = true
add_child(screen)
func _do_encounter():
return step_counter > STEPS_TO_ENCOUNTER + randi() % 15
func _on_Player_moved():
if disable_combat:
return
step_counter += 1
if _do_encounter():
emit_signal(\"combat_start\")
get_tree().paused = true
print(\"combat starting\")
func _unhandled_key_input(event):
if event.is_action_pressed(\"help_button\"):
get_tree().change_scene(\"res://menu.tscn\")
get_tree().set_input_as_handled()
func _on_Explore_combat_ready():
Encounter.ready_random()
get_tree().change_scene(\"res://Combat.tscn\")
func _on_end_reached():
get_tree().change_scene(\"res://DungeonEnd.tscn\")
"
_sections_unfolded = [ "Resource" ]
[sub_resource type="ViewportTexture" id=10]
resource_local_to_scene = true
flags = 0
viewport_path = NodePath("Viewport")
[sub_resource type="GDScript" id=4]
script/source = "extends Label
const Direction = preload(\"common/enums.gd\").Direction
func _ready():
# Called when the node is added to the scene for the first time.
# Initialization here
pass
func _on_Player_direction_changed(facing):
match facing:
Direction.NORTH:
text = \"N\"
Direction.EAST:
text = \"E\"
Direction.SOUTH:
text = \"S\"
Direction.WEST:
text = \"W\"
"
[sub_resource type="GDScript" id=5]
resource_name = "MessagePanel"
script/source = "extends Panel
const MessageType = preload(\"common/enums.gd\").MessageType
func _ready():
Player.connect(\"pickup\", self, \"display_message\", [MessageType.ITEM])
$ShowTimer.connect(\"timeout\", self, \"_timeout\")
func _timeout():
visible = false
get_tree().paused = false
func display_message(content, message_type):
match message_type:
MessageType.ITEM:
# colorize item name
var msg = \"[color=#777777]%s[/color]\" % content[1]
# combine item name with description
msg = content[0] % msg
$MarginContainer/RichTextLabel.bbcode_text = \"Found %s\" % msg
visible = true
get_tree().paused = true
$ShowTimer.start()"
_sections_unfolded = [ "Resource" ]
[sub_resource type="Animation" id=6]
resource_name = "FadeIn"
length = 1.0
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("../TextureRect:rect_position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5, 1 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 0, 0 ), Vector2( -512, 0 ) ]
}
[sub_resource type="Animation" id=7]
length = 1.0
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("../TextureRect:rect_position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( -512, 0 ), Vector2( 0, 0 ) ]
}
tracks/1/type = "method"
tracks/1/path = NodePath("../../../Explore")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.9 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ "combat_ready" ],
"method": "emit_signal"
} ]
}
[node name="Explore" type="Node"]
script = SubResource( 1 )
bgm = ExtResource( 1 )
disable_combat = false
[node name="Viewport" type="Viewport" parent="." index="0"]
arvr = false
size = Vector2( 512, 512 )
own_world = false
world = null
transparent_bg = false
msaa = 0
hdr = true
disable_3d = false
usage = 2
debug_draw = 0
render_target_v_flip = true
render_target_clear_mode = 0
render_target_update_mode = 2
audio_listener_enable_2d = false
audio_listener_enable_3d = true
physics_object_picking = false
gui_disable_input = false
gui_snap_controls_to_pixels = true
shadow_atlas_size = 0
shadow_atlas_quad_0 = 2
shadow_atlas_quad_1 = 2
shadow_atlas_quad_2 = 3
shadow_atlas_quad_3 = 4
[node name="Player" parent="Viewport" index="0" instance=ExtResource( 2 )]
editor/display_folded = true
_sections_unfolded = [ "Collision", "Transform", "Visibility" ]
[node name="Dungeon" parent="Viewport" index="1" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -1 )
_sections_unfolded = [ "Transform" ]
[node name="Control" type="Control" parent="." index="1"]
editor/display_folded = true
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
theme = ExtResource( 4 )
_sections_unfolded = [ "Anchor", "Material", "Rect" ]
[node name="Viewport" type="TextureRect" parent="Control" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
texture = SubResource( 10 )
expand = true
stretch_mode = 0
[node name="Compass" type="Label" parent="Control" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 0.0
margin_bottom = 15.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 4
custom_fonts/font = ExtResource( 5 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_color_shadow = Color( 0.392157, 0.392157, 0.392157, 1 )
custom_constants/shadow_offset_x = 0
custom_constants/shadow_offset_y = 1
text = "W"
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
script = SubResource( 4 )
_sections_unfolded = [ "Anchor" ]
[node name="MessagePanel" type="Panel" parent="Control" index="2"]
visible = false
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 41.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = SubResource( 5 )
[node name="MarginContainer" type="MarginContainer" parent="Control/MessagePanel" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_constants/margin_right = 2
custom_constants/margin_left = 2
_sections_unfolded = [ "custom_constants" ]
[node name="RichTextLabel" type="RichTextLabel" parent="Control/MessagePanel/MarginContainer" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 2.0
margin_right = 62.0
margin_bottom = 23.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_fonts/normal_font = ExtResource( 6 )
custom_constants/line_separation = -5
bbcode_enabled = true
bbcode_text = "Found fresh [color=#ff0000]underwear[/color]"
visible_characters = -1
percent_visible = 1.0
meta_underlined = true
tab_size = 4
text = "Found fresh underwear"
scroll_active = false
scroll_following = false
selection_enabled = false
override_selected_font_color = false
_sections_unfolded = [ "BBCode" ]
[node name="ShowTimer" type="Timer" parent="Control/MessagePanel" index="1"]
pause_mode = 2
process_mode = 1
wait_time = 1.5
one_shot = true
autostart = false
_sections_unfolded = [ "Pause" ]
[node name="TextureRect" type="TextureRect" parent="Control" index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = 448.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
texture = ExtResource( 7 )
expand = true
stretch_mode = 0
_sections_unfolded = [ "Rect" ]
[node name="AnimationPlayer" type="AnimationPlayer" parent="Control/TextureRect" index="0"]
pause_mode = 2
root_node = NodePath("..")
autoplay = "FadeIn"
playback_process_mode = 1
playback_default_blend_time = 0.0
playback_speed = 1.0
anims/FadeIn = SubResource( 6 )
anims/FadeOut = SubResource( 7 )
blend_times = [ ]
_sections_unfolded = [ "Pause", "Playback Options" ]
[connection signal="combat_ready" from="." to="." method="_on_Explore_combat_ready"]
[connection signal="combat_start" from="." to="Viewport/Player" method="_on_Explore_combat_start"]
[connection signal="combat_start" from="." to="Control/TextureRect/AnimationPlayer" method="play" binds= [ "FadeOut" ]]
[connection signal="direction_changed" from="Viewport/Player" to="Control/Compass" method="_on_Player_direction_changed"]
[connection signal="moved" from="Viewport/Player" to="." method="_on_Player_moved"]