[gd_scene load_steps=17 format=3 uid="uid://bpvbnlhpth4w7"]

[ext_resource type="Script" path="res://src/ingame/bomb.gd" id="1_27lur"]
[ext_resource type="PackedScene" uid="uid://dxb5f3il2h1ur" path="res://src/ingame/quad_viewmodel.tscn" id="2_fy6j6"]
[ext_resource type="AudioStream" uid="uid://dy3ngeohp1uqf" path="res://assets/sfx/land.wav" id="3_1vo65"]
[ext_resource type="AudioStream" uid="uid://dkxv7wbq8s1gs" path="res://assets/sfx/coinsplash.ogg" id="4_fyu6c"]
[ext_resource type="Texture2D" uid="uid://dgo2frvws2o6f" path="res://assets/coin.png" id="5_om8wy"]

[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_0ebrr"]
properties/0/path = NodePath(".:position")
properties/0/spawn = true
properties/0/replication_mode = 1
properties/1/path = NodePath(".:is_dead")
properties/1/spawn = true
properties/1/replication_mode = 2
properties/2/path = NodePath(".:rotation")
properties/2/spawn = true
properties/2/replication_mode = 1
properties/3/path = NodePath(".:item_bundle")
properties/3/spawn = true
properties/3/replication_mode = 2
properties/4/path = NodePath("Model:visible")
properties/4/spawn = true
properties/4/replication_mode = 2
properties/5/path = NodePath("SellParticles:emitting")
properties/5/spawn = true
properties/5/replication_mode = 2
properties/6/path = NodePath("DropSound:playing")
properties/6/spawn = true
properties/6/replication_mode = 2
properties/7/path = NodePath("SellSound:playing")
properties/7/spawn = true
properties/7/replication_mode = 2

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_v7dnr"]
albedo_color = Color(0, 1, 1, 1)
roughness = 0.2

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_rjbgm"]
direction = Vector3(0, 1, 0)
initial_velocity_min = 5.0
initial_velocity_max = 5.0
gravity = Vector3(0, -8, 0)
collision_mode = 2

[sub_resource type="SphereMesh" id="SphereMesh_bhdh4"]
radius = 0.1
height = 0.2

[sub_resource type="SphereShape3D" id="SphereShape3D_6c830"]
radius = 0.2

[sub_resource type="SphereShape3D" id="SphereShape3D_y6453"]
radius = 1.5

[sub_resource type="Gradient" id="Gradient_qoklw"]
offsets = PackedFloat32Array(0.0454545, 0.836364, 0.981818)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_fdtmr"]
gradient = SubResource("Gradient_qoklw")

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_yncjw"]
lifetime_randomness = 0.2
inherit_velocity_ratio = 0.1
direction = Vector3(0, 1, 0)
spread = 180.0
initial_velocity_max = 3.0
gravity = Vector3(0, 0, 0)
linear_accel_min = -6.9
linear_accel_max = -3.45
color_ramp = SubResource("GradientTexture1D_fdtmr")

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ooyci"]
transparency = 1
shading_mode = 0
vertex_color_use_as_albedo = true
albedo_texture = ExtResource("5_om8wy")

[sub_resource type="QuadMesh" id="QuadMesh_4d5bh"]
material = SubResource("StandardMaterial3D_ooyci")
size = Vector2(0.25, 0.25)

[node name="ItemBomb" type="Node3D" node_paths=PackedStringArray("_splash_small_sound", "_sell_sound", "_model", "_sell_particles", "_picking_area", "body")]
script = ExtResource("1_27lur")
_splash_small_sound = NodePath("DropSound")
_sell_sound = NodePath("SellSound")
_model = NodePath("Model")
_sell_particles = NodePath("SellParticles")
_picking_area = NodePath("PickingArea")
body = NodePath("RigidBody3D")
billboard = true

[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_0ebrr")

[node name="Model" parent="." instance=ExtResource("2_fy6j6")]

[node name="SplashParticles" type="GPUParticles3D" parent="."]
visible = false
material_override = SubResource("StandardMaterial3D_v7dnr")
emitting = false
amount = 32
lifetime = 2.0
one_shot = true
explosiveness = 1.0
randomness = 1.0
process_material = SubResource("ParticleProcessMaterial_rjbgm")
draw_pass_1 = SubResource("SphereMesh_bhdh4")

[node name="RigidBody3D" type="RigidBody3D" parent="."]
top_level = true
collision_layer = 4
collision_mask = 3
contact_monitor = true
max_contacts_reported = 1
linear_damp_mode = 1
linear_damp = 0.3

[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
shape = SubResource("SphereShape3D_6c830")

[node name="SplashArea" type="Area3D" parent="RigidBody3D"]
collision_layer = 0
collision_mask = 8
monitorable = false

[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D/SplashArea"]
shape = SubResource("SphereShape3D_y6453")

[node name="PickingArea" type="Area3D" parent="."]
collision_layer = 16
collision_mask = 0
monitoring = false

[node name="CollisionShape3D" type="CollisionShape3D" parent="PickingArea"]
shape = SubResource("SphereShape3D_6c830")

[node name="DropSound" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource("3_1vo65")
volume_db = 10.0
bus = &"SoundEffects"

[node name="SellSound" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource("4_fyu6c")
volume_db = 2.0
bus = &"SoundEffects"

[node name="SellParticles" type="GPUParticles3D" parent="."]
emitting = false
amount = 32
lifetime = 2.0
one_shot = true
speed_scale = 0.5
explosiveness = 1.0
randomness = 0.4
process_material = SubResource("ParticleProcessMaterial_yncjw")
draw_pass_1 = SubResource("QuadMesh_4d5bh")

[connection signal="body_entered" from="RigidBody3D" to="." method="_on_body_entered"]
[connection signal="area_entered" from="RigidBody3D/SplashArea" to="." method="_on_splash_area_entered"]
[connection signal="area_exited" from="RigidBody3D/SplashArea" to="." method="_on_splash_area_exited"]
