[gd_scene load_steps=22 format=3 uid="uid://svkvxdk8fsyj"]

[ext_resource type="Script" uid="uid://bvplls3ae0oqr" path="res://Scripts/Classes/Entities/Objects/OnOffFanRed.gd" id="1_lggcr"]
[ext_resource type="Texture2D" uid="uid://dkwk6x3je28oi" path="res://Assets/Sprites/Blocks/Fan.png" id="2_lggcr"]
[ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_shbxw"]
[ext_resource type="Texture2D" uid="uid://dy3p03djelkb3" path="res://Assets/Sprites/Particles/Leaves.png" id="4_3g67n"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="5_254o8"]
[ext_resource type="JSON" path="res://Assets/Sprites/Blocks/Fan.json" id="5_lkjwe"]
[ext_resource type="JSON" path="res://Assets/Sprites/Particles/WindParticles.json" id="6_vnvew"]
[ext_resource type="Script" uid="uid://ctfbuoxtnnl0q" path="res://Scripts/Classes/Components/EditorPropertyExposer.gd" id="7_cdvdi"]
[ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="8_yp1rr"]

[sub_resource type="AtlasTexture" id="AtlasTexture_lkjwe"]
atlas = ExtResource("2_lggcr")
region = Rect2(0, 0, 16, 48)

[sub_resource type="AtlasTexture" id="AtlasTexture_shbxw"]
atlas = ExtResource("2_lggcr")
region = Rect2(16, 0, 16, 48)

[sub_resource type="AtlasTexture" id="AtlasTexture_3g67n"]
atlas = ExtResource("2_lggcr")
region = Rect2(32, 0, 16, 48)

[sub_resource type="AtlasTexture" id="AtlasTexture_254o8"]
atlas = ExtResource("2_lggcr")
region = Rect2(48, 0, 16, 48)

[sub_resource type="SpriteFrames" id="SpriteFrames_vnvew"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_lkjwe")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_shbxw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3g67n")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_254o8")
}],
"loop": true,
"name": &"On",
"speed": 30.0
}]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_wvrj8"]
size = Vector2(16, 48)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_4qr7a"]
size = Vector2(256, 36)

[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_wo6ri"]
particles_animation = true
particles_anim_h_frames = 2
particles_anim_v_frames = 1
particles_anim_loop = false

[sub_resource type="Curve" id="Curve_56hbg"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.894444, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3

[sub_resource type="CurveTexture" id="CurveTexture_8c2la"]
curve = SubResource("Curve_56hbg")

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_ixtv2"]
particle_flag_disable_z = true
emission_shape_scale = Vector3(1, 15, 1)
emission_shape = 3
emission_box_extents = Vector3(1, 1, 1)
spread = 0.0
initial_velocity_min = 100.0
initial_velocity_max = 500.0
angular_velocity_min = -720.0
angular_velocity_max = 720.0
gravity = Vector3(0, 0, 0)
alpha_curve = SubResource("CurveTexture_8c2la")
anim_offset_max = 1.0

[sub_resource type="GDScript" id="GDScript_gfuw1"]
script/source = "extends Node

@export var sprite: AnimatedSprite2D = null

func _process(_delta: float) -> void:
	$\"..\".global_rotation_degrees = [0, 180, -90, 90][owner.direction]
	sprite.global_rotation_degrees = [0, 0, 90, 90][owner.direction]
	sprite.flip_h = owner.direction == 1 or owner.direction == 2
"

[node name="Fan" type="AnimatableBody2D"]
collision_layer = 6
collision_mask = 0
sync_to_physics = false
script = ExtResource("1_lggcr")
active = true

[node name="RotationJoint" type="Node2D" parent="."]

[node name="Sprite" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_vnvew")
animation = &"On"
autoplay = "On"
frame_progress = 0.9855531
script = ExtResource("3_shbxw")
do_offset = false
metadata/_custom_type_script = "uid://caq1qiwmy0mox"

[node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
script = ExtResource("5_254o8")
node_to_affect = NodePath("..")
property_name = "sprite_frames"
resource_json = ExtResource("5_lkjwe")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik"

[node name="Collision" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_wvrj8")

[node name="Hitbox" type="Area2D" parent="."]

[node name="Shape" type="CollisionShape2D" parent="Hitbox"]
position = Vector2(128, 0)
shape = SubResource("RectangleShape2D_4qr7a")

[node name="Particles" type="GPUParticles2D" parent="."]
unique_name_in_owner = true
material = SubResource("CanvasItemMaterial_wo6ri")
emitting = false
texture = ExtResource("4_3g67n")
lifetime = 0.5
process_material = SubResource("ParticleProcessMaterial_ixtv2")

[node name="ResourceSetterNew" type="Node" parent="Particles" node_paths=PackedStringArray("node_to_affect")]
script = ExtResource("5_254o8")
node_to_affect = NodePath("..")
property_name = "texture"
mode = 1
resource_json = ExtResource("6_vnvew")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik"

[node name="Node" type="Node" parent="." node_paths=PackedStringArray("sprite")]
process_mode = 3
script = SubResource("GDScript_gfuw1")
sprite = NodePath("../Sprite")

[node name="EditorPropertyExposer" type="Node" parent="."]
script = ExtResource("7_cdvdi")
properties = Array[String](["direction", "strength"])
metadata/_custom_type_script = "uid://ctfbuoxtnnl0q"

[node name="TrackJoint" type="Node" parent="."]
script = ExtResource("8_yp1rr")
offset = Vector2(0, 0)
disable_physics = false
metadata/_custom_type_script = "uid://d4a7yp6e55u8t"

[node name="RemoteTransform2D" type="RemoteTransform2D" parent="."]
remote_path = NodePath("../Sprite")
update_rotation = false
update_scale = false
