[gd_scene load_steps=51 format=2]

[ext_resource path="res://assets/enemy/froshler.png" type="Texture" id=1]
[ext_resource path="res://src/Actors/Friendlies/WhatAreFrog.gd" type="Script" id=2]
[ext_resource path="res://src/StateMachines/WhatAreFrogStateMachine.gd" type="Script" id=3]
[ext_resource path="res://assets/meta/new_dynamicfont.tres" type="DynamicFont" id=4]
[ext_resource path="res://assets/meta/digits.png" type="Texture" id=5]
[ext_resource path="res://assets/enemy/leash-hook.png" type="Texture" id=6]
[ext_resource path="res://src/Utilities/SceneAudio.tscn" type="PackedScene" id=7]

[sub_resource type="Animation" id=5]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 0 ]
}

[sub_resource type="Animation" id=4]
resource_name = "idleHappy"
length = 1.62
loop = true
step = 0.01
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.54 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 0, 1 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 1, 1 ) ]
}

[sub_resource type="Animation" id=6]
resource_name = "idleHappyLeft"
length = 1.62
loop = true
step = 0.01
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.54 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 0, 1 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ Vector2( -1, 1 ) ]
}

[sub_resource type="Animation" id=12]
resource_name = "idleMean"
length = 1.62
loop = true
step = 0.01
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0.01, 0.54 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 2, 3 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ Vector2( 1, 1 ) ]
}

[sub_resource type="Animation" id=13]
resource_name = "idleMeanLeft"
length = 1.62
loop = true
step = 0.01
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.54 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ 2, 3 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ Vector2( -1, 1 ) ]
}

[sub_resource type="Animation" id=14]
resource_name = "liftOff"
length = 0.042
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 4 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ Vector2( 1, 1 ) ]
}

[sub_resource type="Animation" id=15]
resource_name = "liftOffLeft"
length = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 4 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ Vector2( -1, 1 ) ]
}

[sub_resource type="Animation" id=16]
resource_name = "midJumping"
length = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 6 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ Vector2( 1, 1 ) ]
}

[sub_resource type="Animation" id=17]
resource_name = "midJumpingLeft"
length = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 6 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ Vector2( -1, 1 ) ]
}

[sub_resource type="Animation" id=50]
resource_name = "sleeping"
length = 1.62
loop = true
step = 0.01
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 3 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ Vector2( 1, 1 ) ]
}

[sub_resource type="Animation" id=51]
resource_name = "sleepingLeft"
length = 1.62
loop = true
step = 0.01
tracks/0/type = "value"
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 3 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ Vector2( -1, 1 ) ]
}

[sub_resource type="AnimationNodeAnimation" id=42]
animation = "idleHappyLeft"

[sub_resource type="AnimationNodeAnimation" id=43]
animation = "idleHappy"

[sub_resource type="AnimationNodeBlendSpace1D" id=9]
blend_point_0/node = SubResource( 42 )
blend_point_0/pos = -1.0
blend_point_1/node = SubResource( 43 )
blend_point_1/pos = 1.0
min_space = -2.0
max_space = 2.0
snap = 1.0

[sub_resource type="AnimationNodeAnimation" id=44]
animation = "idleMeanLeft"

[sub_resource type="AnimationNodeAnimation" id=45]
animation = "idleMean"

[sub_resource type="AnimationNodeBlendSpace1D" id=20]
blend_point_0/node = SubResource( 44 )
blend_point_0/pos = -1.0
blend_point_1/node = SubResource( 45 )
blend_point_1/pos = 1.0
min_space = -2.0
max_space = 2.0
snap = 1.0

[sub_resource type="AnimationNodeAnimation" id=46]
animation = "huntingLeft"

[sub_resource type="AnimationNodeAnimation" id=47]
animation = "hunting"

[sub_resource type="AnimationNodeBlendSpace1D" id=23]
blend_point_0/node = SubResource( 46 )
blend_point_0/pos = -1.0
blend_point_1/node = SubResource( 47 )
blend_point_1/pos = 1.0
min_space = -1.18
max_space = 1.15

[sub_resource type="AnimationNodeAnimation" id=48]
animation = "midJumpingLeft"

[sub_resource type="AnimationNodeAnimation" id=49]
animation = "midJumping"

[sub_resource type="AnimationNodeBlendSpace1D" id=26]
blend_point_0/node = SubResource( 48 )
blend_point_0/pos = -1.0
blend_point_1/node = SubResource( 49 )
blend_point_1/pos = 1.0

[sub_resource type="AnimationNodeAnimation" id=52]
animation = "sleepingLeft"

[sub_resource type="AnimationNodeAnimation" id=53]
animation = "sleeping"

[sub_resource type="AnimationNodeBlendSpace1D" id=54]
blend_point_0/node = SubResource( 52 )
blend_point_0/pos = -1.0
blend_point_1/node = SubResource( 53 )
blend_point_1/pos = 1.0

[sub_resource type="AnimationNodeStateMachineTransition" id=27]

[sub_resource type="AnimationNodeStateMachineTransition" id=28]
switch_mode = 2
auto_advance = true

[sub_resource type="AnimationNodeStateMachineTransition" id=29]

[sub_resource type="AnimationNodeStateMachineTransition" id=30]

[sub_resource type="AnimationNodeStateMachineTransition" id=31]
switch_mode = 2
auto_advance = true

[sub_resource type="AnimationNodeStateMachineTransition" id=32]

[sub_resource type="AnimationNodeStateMachineTransition" id=55]

[sub_resource type="AnimationNodeStateMachineTransition" id=56]

[sub_resource type="AnimationNodeStateMachineTransition" id=57]

[sub_resource type="AnimationNodeStateMachineTransition" id=58]

[sub_resource type="AnimationNodeStateMachine" id=10]
states/idleHappy/node = SubResource( 9 )
states/idleHappy/position = Vector2( -58.7619, 98.0433 )
states/idleMean/node = SubResource( 20 )
states/idleMean/position = Vector2( 451.952, 98.0432 )
states/liftOff/node = SubResource( 23 )
states/liftOff/position = Vector2( 184.223, -12 )
states/midJumping/node = SubResource( 26 )
states/midJumping/position = Vector2( 184.091, -141 )
states/sleeping/node = SubResource( 54 )
states/sleeping/position = Vector2( 177.848, 205.619 )
transitions = [ "idleHappy", "liftOff", SubResource( 27 ), "liftOff", "midJumping", SubResource( 28 ), "idleMean", "liftOff", SubResource( 29 ), "midJumping", "liftOff", SubResource( 30 ), "liftOff", "idleMean", SubResource( 31 ), "liftOff", "idleHappy", SubResource( 32 ), "idleHappy", "sleeping", SubResource( 55 ), "idleMean", "sleeping", SubResource( 56 ), "sleeping", "idleHappy", SubResource( 57 ), "sleeping", "idleMean", SubResource( 58 ) ]
start_node = "idleHappy"
graph_offset = Vector2( -377, -42 )

[sub_resource type="AnimationNodeStateMachinePlayback" id=11]

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

[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 12, 0.75 )

[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 18.2143, 13.5955 )

[sub_resource type="RectangleShape2D" id=59]
extents = Vector2( 12, 15 )

[sub_resource type="RectangleShape2D" id=60]
extents = Vector2( 12, 0.53125 )

[node name="WhatAreFrog" type="KinematicBody2D" groups=["frog"]]
collision_layer = 2
collision_mask = 184
collision/safe_margin = 0.002
script = ExtResource( 2 )

[node name="Statemachine" type="Node2D" parent="."]
script = ExtResource( 3 )

[node name="SceneAudio" parent="." instance=ExtResource( 7 )]

[node name="StateLabel" type="Label" parent="."]
visible = false
show_behind_parent = true
margin_left = -36.0
margin_top = -30.0
margin_right = 37.0
margin_bottom = -16.0
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_outline_modulate = Color( 0, 0, 0, 1 )
custom_fonts/font = ExtResource( 4 )
text = "Ihre Werbung"
align = 1
valign = 1

[node name="Digit" type="Sprite" parent="."]
visible = false
position = Vector2( 0, -3 )
z_index = 1
texture = ExtResource( 5 )
hframes = 10

[node name="LeashAnchor" type="Sprite" parent="."]
visible = false
position = Vector2( 0, 2 )
rotation = 3.92699
z_index = 2
texture = ExtResource( 6 )

[node name="FrogSprite" type="Sprite" parent="."]
unique_name_in_owner = true
position = Vector2( 0, -7 )
texture = ExtResource( 1 )
hframes = 2
vframes = 4

[node name="AnimationPlayer" type="AnimationPlayer" parent="FrogSprite"]
anims/RESET = SubResource( 5 )
anims/idleHappy = SubResource( 4 )
anims/idleHappyLeft = SubResource( 6 )
anims/idleMean = SubResource( 12 )
anims/idleMeanLeft = SubResource( 13 )
anims/liftOff = SubResource( 14 )
anims/liftOffLeft = SubResource( 15 )
anims/midJumping = SubResource( 16 )
anims/midJumpingLeft = SubResource( 17 )
anims/sleeping = SubResource( 50 )
anims/sleepingLeft = SubResource( 51 )

[node name="AnimationTree" type="AnimationTree" parent="FrogSprite"]
tree_root = SubResource( 10 )
anim_player = NodePath("../AnimationPlayer")
active = true
root_motion_track = NodePath(".:frame")
parameters/playback = SubResource( 11 )
parameters/idleHappy/blend_position = 1.0
parameters/idleMean/blend_position = 1.2434
parameters/liftOff/blend_position = 1.0
parameters/midJumping/blend_position = 1.0
parameters/sleeping/blend_position = -0.00214911

[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."]
position = Vector2( 954, 0 )
scale = Vector2( 10.84, 0.899 )
rect = Rect2( -89, -10, 2, 20 )
process_parent = true
physics_process_parent = true

[node name="FeelerRayCast" type="RayCast2D" parent="."]
enabled = true
cast_to = Vector2( 0, -1 )
collision_mask = 281
collide_with_areas = true

[node name="Orientation" type="RayCast2D" parent="."]
cast_to = Vector2( -1, 0 )
collision_mask = 0
collide_with_bodies = false

[node name="Left_Wallcast" type="RayCast2D" parent="."]
position = Vector2( -10, 6 )
enabled = true
cast_to = Vector2( -5, 0 )
collision_mask = 41
collide_with_areas = true

[node name="Right_Wallcast" type="RayCast2D" parent="."]
position = Vector2( 10, 6 )
enabled = true
cast_to = Vector2( 5, 0 )
collision_mask = 41
collide_with_areas = true

[node name="VisionRayCast" type="RayCast2D" parent="."]
enabled = true
cast_to = Vector2( 0, -1 )
collision_mask = 297
collide_with_areas = true

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

[node name="cshape" type="Node2D" parent="."]
scale = Vector2( 0.1, 0.1 )

[node name="pjoint" type="PinJoint2D" parent="cshape"]
scale = Vector2( 0.3, 0.3 )
bias = 0.108
softness = 0.1

[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]]
modulate = Color( 0, 0.0392157, 1, 1 )
position = Vector2( 0, -10 )
collision_layer = 2
input_pickable = false
monitorable = false

[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"]
position = Vector2( 0, 0.25 )
shape = SubResource( 2 )

[node name="GroundDetector" type="Area2D" parent="."]
unique_name_in_owner = true
modulate = Color( 0, 0.0392157, 1, 1 )
position = Vector2( 0, 9 )
collision_layer = 0
input_pickable = false
monitorable = false

[node name="CollisionShape2D" type="CollisionShape2D" parent="GroundDetector"]
position = Vector2( 0, 2 )
shape = SubResource( 2 )

[node name="EnemySkin" type="Area2D" parent="."]
process_priority = -1
visible = false
scale = Vector2( 0.7, 0.7 )
collision_layer = 2
collision_mask = 106

[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"]
position = Vector2( 0, -0.738329 )
shape = SubResource( 3 )

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

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

[node name="JumpCollisionBody" type="KinematicBody2D" parent="."]
collision_layer = 0
collision_mask = 8

[node name="CollisionShape2D" type="CollisionShape2D" parent="JumpCollisionBody"]
position = Vector2( 0, -6 )
shape = SubResource( 59 )

[node name="RideCollisionBody" type="KinematicBody2D" parent="."]
position = Vector2( 0, -7 )
collision_layer = 2

[node name="CollisionShape2D" type="CollisionShape2D" parent="RideCollisionBody"]
shape = SubResource( 60 )

[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"]
[connection signal="body_exited" from="StompDetector" to="." method="_on_StompDetector_body_exited"]
[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"]
[connection signal="body_entered" from="EnemySkin" to="." method="_on_EnemySkin_body_entered"]
[connection signal="timeout" from="HurtTimer" to="." method="_on_HurtTimer_timeout"]
