[gd_scene load_steps=14 format=2]

[ext_resource path="res://Actors/Objects/Door/Door.gd" type="Script" id=1]
[ext_resource path="res://Graphics/tgstation/opening-sheet.png" type="Texture" id=2]
[ext_resource path="res://Actors/Components/ActivationRange.gd" type="Script" id=3]
[ext_resource path="res://Actors/Components/PowerManager.gd" type="Script" id=4]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 16, 16 )

[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 2 )
region = Rect2( 0, 64, 32, 32 )

[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 2 )
region = Rect2( 32, 32, 32, 32 )

[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 2 )
region = Rect2( 0, 32, 32, 32 )

[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 2 )
region = Rect2( 32, 0, 32, 32 )

[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 2 )
region = Rect2( 0, 0, 32, 32 )

[sub_resource type="SpriteFrames" id=7]
animations = [ {
"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ) ],
"loop": false,
"name": "close",
"speed": 20.0
}, {
"frames": [ SubResource( 6 ), SubResource( 5 ), SubResource( 4 ), SubResource( 3 ), SubResource( 2 ) ],
"loop": false,
"name": "open",
"speed": 20.0
} ]

[sub_resource type="CircleShape2D" id=8]
radius = 42.0

[sub_resource type="CircleShape2D" id=9]
radius = 18.0

[node name="Door" type="StaticBody2D"]
input_pickable = true
collision_layer = 19
script = ExtResource( 1 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 16, 16 )
shape = SubResource( 1 )

[node name="Sprite" type="AnimatedSprite" parent="."]
frames = SubResource( 7 )
animation = "close"
frame = 4
playing = true
centered = false

[node name="Timer" type="Timer" parent="."]
wait_time = 5.0
one_shot = true

[node name="ActivationRange" type="Area2D" parent="."]
input_pickable = false
script = ExtResource( 3 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="ActivationRange"]
visible = false
position = Vector2( 16, 16 )
shape = SubResource( 8 )

[node name="CloseRange" type="Area2D" parent="."]
input_pickable = false
script = ExtResource( 3 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="CloseRange"]
position = Vector2( 16, 16 )
shape = SubResource( 9 )

[node name="PowerManager" type="Node" parent="."]
script = ExtResource( 4 )
power_usage = 2.0

[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
max_distance = 512.0
attenuation = 3.0
[connection signal="animation_finished" from="Sprite" to="." method="_animation_finished"]
[connection signal="timeout" from="Timer" to="." method="_close_timer_triggered"]
[connection signal="player_entered" from="CloseRange" to="." method="_open_sensor_triggered"]
