[gd_scene load_steps=16 format=3 uid="uid://d2664rpg4losx"]

[ext_resource type="PackedScene" uid="uid://bi5mxt5s4aq1a" path="res://assets/npc/grunk_beast/grunk_beast.gltf" id="1_hoss2"]
[ext_resource type="Script" uid="uid://dkll8s6kwb41r" path="res://src/world/grunk_beast/procedural_grunk_beast/start_ik.gd" id="2_qic24"]
[ext_resource type="Script" uid="uid://dgy2ubsj1fotp" path="res://src/world/grunk_beast/procedural_grunk_beast/procedural_grunk_beast.gd" id="2_qqnhb"]
[ext_resource type="Shader" uid="uid://ckxc0ngd37rtk" path="res://src/shaders/gunk.gdshader" id="4_0gxpq"]
[ext_resource type="Script" uid="uid://7is3sa00qejh" path="res://src/world/grunk_beast/procedural_grunk_beast/ik_target.gd" id="4_3gbao"]
[ext_resource type="Script" uid="uid://bpyovjodpxjpb" path="res://src/world/grunk_beast/procedural_grunk_beast/step_ray.gd" id="4_faau1"]
[ext_resource type="Script" uid="uid://c1gitpy7s78ev" path="res://src/world/grunk_beast/procedural_grunk_beast/target_container.gd" id="5_wffas"]
[ext_resource type="Texture2D" uid="uid://cm1jrvx7ftx4c" path="res://assets/black.png" id="5_xuag8"]
[ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="6_mbqcc"]

[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_2roq2"]
width = 256
height = 256
depth = 32
seamless = true
seamless_blend_skirt = 0.5
noise = ExtResource("6_mbqcc")

[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_fk1xc"]
width = 256
height = 256
depth = 32
seamless = true
seamless_blend_skirt = 0.5
noise = ExtResource("6_mbqcc")

[sub_resource type="FastNoiseLite" id="FastNoiseLite_7fplw"]
frequency = 0.0703

[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_omayi"]
width = 32
height = 32
depth = 128
noise = SubResource("FastNoiseLite_7fplw")

[sub_resource type="ShaderMaterial" id="ShaderMaterial_vvw1q"]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("4_0gxpq")
shader_parameter/color_1 = Color(0, 0.03, 0.1, 1)
shader_parameter/color_2 = Color(0, 0.1, 0.3, 1)
shader_parameter/emission_color = Color(0.25, 0.88, 1, 1)
shader_parameter/pixellation = 128.0
shader_parameter/time_pixellation = 30.0
shader_parameter/roughness = 0.15
shader_parameter/specular_contribution = 0.8
shader_parameter/emission_strength = 0.02
shader_parameter/uv_scale = Vector2(2, 2)
shader_parameter/time_scale = 0.2
shader_parameter/edge_bleed = 0.25
shader_parameter/gunk_mask = ExtResource("5_xuag8")
shader_parameter/gunk_noise = SubResource("NoiseTexture3D_2roq2")
shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_fk1xc")
shader_parameter/jitter_magnitude = 0.3
shader_parameter/jitter_time_scale = 0.6
shader_parameter/jitter_noise = SubResource("NoiseTexture3D_omayi")
shader_parameter/vertex_inflation = 0.0
shader_parameter/inflation_pixellation = 10.0

[sub_resource type="ShaderMaterial" id="ShaderMaterial_ml8dd"]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("4_0gxpq")
shader_parameter/color_1 = Color(0, 0.03, 0.1, 1)
shader_parameter/color_2 = Color(0, 0.1, 0.3, 1)
shader_parameter/emission_color = Color(0.25, 0.88, 1, 1)
shader_parameter/pixellation = 128.0
shader_parameter/time_pixellation = 30.0
shader_parameter/roughness = 0.15
shader_parameter/specular_contribution = 0.8
shader_parameter/emission_strength = 0.02
shader_parameter/uv_scale = Vector2(2, 2)
shader_parameter/time_scale = 0.2
shader_parameter/edge_bleed = 0.25
shader_parameter/gunk_mask = ExtResource("5_xuag8")
shader_parameter/gunk_noise = SubResource("NoiseTexture3D_2roq2")
shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_fk1xc")
shader_parameter/jitter_magnitude = 0.1
shader_parameter/jitter_time_scale = 0.6
shader_parameter/jitter_noise = SubResource("NoiseTexture3D_omayi")
shader_parameter/vertex_inflation = 0.0
shader_parameter/inflation_pixellation = 10.0

[node name="GrunkBeast" instance=ExtResource("1_hoss2")]
script = ExtResource("2_qqnhb")

[node name="Armature" parent="." index="0"]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0)

[node name="Skeleton3D" parent="Armature" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)

[node name="Body" parent="Armature/Skeleton3D" index="0"]
surface_material_override/0 = SubResource("ShaderMaterial_vvw1q")

[node name="Leg" parent="Armature/Skeleton3D" index="1"]
surface_material_override/0 = SubResource("ShaderMaterial_ml8dd")

[node name="FrontLeftLeg" type="SkeletonIK3D" parent="Armature/Skeleton3D" index="2"]
root_bone = &"Leg1.F.L"
tip_bone = &"IK_Leg.F.L"
use_magnet = true
magnet = Vector3(0, 10, 0)
target_node = NodePath("../../TargetFL")
script = ExtResource("2_qic24")

[node name="FrontRightLeg" type="SkeletonIK3D" parent="Armature/Skeleton3D" index="3"]
root_bone = &"Leg1.F.R"
tip_bone = &"IK_Leg.F.R"
use_magnet = true
magnet = Vector3(0, 10, 0)
target_node = NodePath("../../TargetFR")
script = ExtResource("2_qic24")

[node name="BackLeftLeg" type="SkeletonIK3D" parent="Armature/Skeleton3D" index="4"]
root_bone = &"Leg1.B.L"
tip_bone = &"IK_Leg.B.L"
use_magnet = true
magnet = Vector3(0, 10, 0)
target_node = NodePath("../../TargetBL")
script = ExtResource("2_qic24")

[node name="BackRightLeg" type="SkeletonIK3D" parent="Armature/Skeleton3D" index="5"]
root_bone = &"Leg1.B.R"
tip_bone = &"IK_Leg.B.R"
use_magnet = true
magnet = Vector3(0, 10, 0)
target_node = NodePath("../../TargetBR")
script = ExtResource("2_qic24")

[node name="TargetFL" type="Marker3D" parent="Armature" index="1" node_paths=PackedStringArray("step_target", "neighbor", "diagonal")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 1.5)
top_level = true
script = ExtResource("4_3gbao")
step_target = NodePath("../../StepTargets/RayFL/StepFL")
neighbor = NodePath("../TargetFR")
diagonal = NodePath("../TargetBR")

[node name="TargetFR" type="Marker3D" parent="Armature" index="2" node_paths=PackedStringArray("step_target", "neighbor", "diagonal")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5, 0, 1.5)
top_level = true
script = ExtResource("4_3gbao")
step_target = NodePath("../../StepTargets/RayFR/StepFR")
neighbor = NodePath("../TargetFL")
diagonal = NodePath("../TargetBL")

[node name="TargetBL" type="Marker3D" parent="Armature" index="3" node_paths=PackedStringArray("step_target", "neighbor", "diagonal")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, -2)
top_level = true
script = ExtResource("4_3gbao")
step_target = NodePath("../../StepTargets/RayBL/StepBL")
neighbor = NodePath("../TargetBR")
diagonal = NodePath("../TargetFR")

[node name="TargetBR" type="Marker3D" parent="Armature" index="4" node_paths=PackedStringArray("step_target", "neighbor", "diagonal")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, -2)
top_level = true
script = ExtResource("4_3gbao")
step_target = NodePath("../../StepTargets/RayBR/StepBR")
neighbor = NodePath("../TargetBL")
diagonal = NodePath("../TargetFL")

[node name="StepTargets" type="Node3D" parent="." index="1"]
script = ExtResource("5_wffas")

[node name="RayFL" type="RayCast3D" parent="StepTargets" index="0"]
transform = Transform3D(0.996195, -0.0871557, 0, 0.0868241, 0.992404, 0.0871557, -0.00759612, -0.0868241, 0.996195, 1.5, 3.5, 1.5)
target_position = Vector3(0, -10, 0)
script = ExtResource("4_faau1")

[node name="StepFL" type="Marker3D" parent="StepTargets/RayFL" index="0"]
transform = Transform3D(0.996195, 0.0868241, -0.00759612, -0.0871557, 0.992404, -0.0868241, 9.31323e-10, 0.0871557, 0.996195, -0.303884, -3.47341, -0.305045)

[node name="RayFR" type="RayCast3D" parent="StepTargets" index="1"]
transform = Transform3D(0.996195, 0.0871557, 0, -0.0868241, 0.992404, 0.0871557, 0.00759612, -0.0868241, 0.996195, -1.5, 3.5, 1.5)
target_position = Vector3(0, -10, 0)
script = ExtResource("4_faau1")

[node name="StepFR" type="Marker3D" parent="StepTargets/RayFR" index="0"]
transform = Transform3D(0.996195, -0.0868241, 0.00759612, 0.0871557, 0.992404, -0.0868241, -9.31323e-10, 0.0871557, 0.996195, 0.303884, -3.47341, -0.305045)

[node name="RayBL" type="RayCast3D" parent="StepTargets" index="2"]
transform = Transform3D(0.996195, -0.0871557, 0, 0.0868241, 0.992404, -0.0871557, 0.00759612, 0.0868241, 0.996195, 2, 3.5, -2)
target_position = Vector3(0, -10, 0)
script = ExtResource("4_faau1")

[node name="StepBL" type="Marker3D" parent="StepTargets/RayBL" index="0"]
transform = Transform3D(0.996195, 0.0868241, 0.00759612, -0.0871557, 0.992404, 0.0868241, -9.31323e-10, -0.0871557, 0.996195, -0.303884, -3.47341, 0.305045)

[node name="RayBR" type="RayCast3D" parent="StepTargets" index="3"]
transform = Transform3D(0.996195, 0.0871557, 0, -0.0868241, 0.992404, -0.0871557, -0.00759612, 0.0868241, 0.996195, -2, 3.5, -2)
target_position = Vector3(0, -10, 0)
script = ExtResource("4_faau1")

[node name="StepBR" type="Marker3D" parent="StepTargets/RayBR" index="0"]
transform = Transform3D(0.996195, -0.0868241, -0.00759612, 0.0871557, 0.992404, 0.0868241, 1.39698e-09, -0.0871557, 0.996195, 0.303884, -3.47341, 0.305045)
