diff --git a/assets/Audio/Various SFX/gas-leak-SBA-300149983.mp3 b/assets/Audio/Various SFX/gas-leak-SBA-300149983.mp3 new file mode 100644 index 0000000..9fc004d Binary files /dev/null and b/assets/Audio/Various SFX/gas-leak-SBA-300149983.mp3 differ diff --git a/assets/Audio/Various SFX/gas-leak-SBA-300149983.mp3.import b/assets/Audio/Various SFX/gas-leak-SBA-300149983.mp3.import new file mode 100644 index 0000000..22f964e --- /dev/null +++ b/assets/Audio/Various SFX/gas-leak-SBA-300149983.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://8w8imybwyxxa" +path="res://.godot/imported/gas-leak-SBA-300149983.mp3-e22ffacb9fe0b9b4a9af338ac8d7ffc3.mp3str" + +[deps] + +source_file="res://assets/Audio/Various SFX/gas-leak-SBA-300149983.mp3" +dest_files=["res://.godot/imported/gas-leak-SBA-300149983.mp3-e22ffacb9fe0b9b4a9af338ac8d7ffc3.mp3str"] + +[params] + +loop=true +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/Audio/Weapons/bang-4-SBA-300001718.wav b/assets/Audio/Weapons/bang-4-SBA-300001718.wav new file mode 100644 index 0000000..4774055 Binary files /dev/null and b/assets/Audio/Weapons/bang-4-SBA-300001718.wav differ diff --git a/assets/Audio/Weapons/bang-4-SBA-300001718.wav.import b/assets/Audio/Weapons/bang-4-SBA-300001718.wav.import new file mode 100644 index 0000000..0e67187 --- /dev/null +++ b/assets/Audio/Weapons/bang-4-SBA-300001718.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://c0oqyudgma3n8" +path="res://.godot/imported/bang-4-SBA-300001718.wav-1a28ecc0461fc26b3c78190e2efb8778.sample" + +[deps] + +source_file="res://assets/Audio/Weapons/bang-4-SBA-300001718.wav" +dest_files=["res://.godot/imported/bang-4-SBA-300001718.wav-1a28ecc0461fc26b3c78190e2efb8778.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/assets/Audio/Weapons/explosion-blast-SBA-300083684.wav b/assets/Audio/Weapons/explosion-blast-SBA-300083684.wav new file mode 100644 index 0000000..1d6a7a5 Binary files /dev/null and b/assets/Audio/Weapons/explosion-blast-SBA-300083684.wav differ diff --git a/assets/Audio/Weapons/explosion-blast-SBA-300083684.wav.import b/assets/Audio/Weapons/explosion-blast-SBA-300083684.wav.import new file mode 100644 index 0000000..8f4726d --- /dev/null +++ b/assets/Audio/Weapons/explosion-blast-SBA-300083684.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://6b5gg8b0p8k8" +path="res://.godot/imported/explosion-blast-SBA-300083684.wav-26a72bb194105787dfa2cb372631e37c.sample" + +[deps] + +source_file="res://assets/Audio/Weapons/explosion-blast-SBA-300083684.wav" +dest_files=["res://.godot/imported/explosion-blast-SBA-300083684.wav-26a72bb194105787dfa2cb372631e37c.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/assets/oildrum1.tscn b/assets/oildrum1.tscn index 040ae89..23e8ea9 100644 --- a/assets/oildrum1.tscn +++ b/assets/oildrum1.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=10 format=4 uid="uid://dlhjacsike5a4"] +[gd_scene load_steps=14 format=4 uid="uid://dlhjacsike5a4"] -[ext_resource type="Script" path="res://scripts/rigidbody_generic.gd" id="1_37mik"] [ext_resource type="Texture2D" uid="uid://ch7jxw5ghkgij" path="res://assets/Models/oildrum1.albedo.png" id="1_uppfj"] +[ext_resource type="Script" path="res://scripts/oildrum.gd" id="1_yvhou"] +[ext_resource type="PackedScene" uid="uid://6p7d7txcox7i" path="res://assets/rocket_explosion.tscn" id="2_507ct"] [ext_resource type="Texture2D" uid="uid://coy85a3x5unp8" path="res://assets/Models/oildrum1.metallic.png" id="2_ip3os"] [ext_resource type="Texture2D" uid="uid://ioiy6cm2ypl7" path="res://assets/Models/oildrum1.normal.png" id="3_ouyr7"] [ext_resource type="Texture2D" uid="uid://dhm0fgqc3nx2t" path="res://assets/Models/oildrum1.rough.png" id="4_t4407"] +[ext_resource type="AudioStream" uid="uid://8w8imybwyxxa" path="res://assets/Audio/Various SFX/gas-leak-SBA-300149983.mp3" id="6_iai82"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ah05b"] resource_name = "oildrum1" @@ -58,11 +60,21 @@ shadow_mesh = SubResource("ArrayMesh_exg16") height = 1.29119 radius = 0.448775 +[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_urstu"] +streams_count = 1 +stream_0/stream = ExtResource("6_iai82") + +[sub_resource type="SphereShape3D" id="SphereShape3D_p1wn3"] +radius = 10.0 + [node name="Oildrum1" type="RigidBody3D"] -collision_layer = 32 +collision_layer = 160 collision_mask = 253 -mass = 20.0 -script = ExtResource("1_37mik") +mass = 10.0 +script = ExtResource("1_yvhou") +explosion = ExtResource("2_507ct") +blast_power = 50.0 +enemy_type = 1 [node name="oildrum" type="MeshInstance3D" parent="."] transform = Transform3D(0.445, 0, 0, 0, 0.625, 0, 0, 0, 0.445, 0, 0, 0) @@ -72,3 +84,13 @@ skeleton = NodePath("") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0089671, 0) shape = SubResource("CylinderShape3D_xutd7") + +[node name="leak_audio" type="AudioStreamPlayer3D" parent="."] +stream = SubResource("AudioStreamRandomizer_urstu") + +[node name="BlastRadius" type="Area3D" parent="."] +collision_layer = 0 +collision_mask = 109 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="BlastRadius"] +shape = SubResource("SphereShape3D_p1wn3") diff --git a/assets/rocket_explosion.tscn b/assets/rocket_explosion.tscn index 9192031..f6e703d 100644 --- a/assets/rocket_explosion.tscn +++ b/assets/rocket_explosion.tscn @@ -1,7 +1,7 @@ -[gd_scene load_steps=9 format=3 uid="uid://6p7d7txcox7i"] +[gd_scene load_steps=10 format=3 uid="uid://6p7d7txcox7i"] [ext_resource type="Script" path="res://scripts/die_particles.gd" id="1_ssw3i"] -[ext_resource type="AudioStream" uid="uid://bw7biwaysbxik" path="res://assets/Audio/explosion-1-SBA-300286280.wav" id="2_thnqf"] +[ext_resource type="AudioStream" uid="uid://6b5gg8b0p8k8" path="res://assets/Audio/Weapons/explosion-blast-SBA-300083684.wav" id="2_rbypu"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_e1gej"] albedo_color = Color(0.586219, 0.0370184, 0.140967, 1) @@ -32,6 +32,11 @@ hue_variation_curve = SubResource("CurveTexture_7652j") [sub_resource type="Skin" id="Skin_v2ayh"] +[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_e1p15"] +random_pitch = 1.2 +streams_count = 1 +stream_0/stream = ExtResource("2_rbypu") + [node name="rocketexplosion" type="Node3D" node_paths=PackedStringArray("audio_explode")] script = ExtResource("1_ssw3i") audio_explode = NodePath("Audio/Explosion") @@ -54,5 +59,5 @@ draw_skin = SubResource("Skin_v2ayh") [node name="Audio" type="Node3D" parent="."] [node name="Explosion" type="AudioStreamPlayer3D" parent="Audio"] -stream = ExtResource("2_thnqf") +stream = SubResource("AudioStreamRandomizer_e1p15") volume_db = 10.0 diff --git a/assets/vent_1_broken.tscn b/assets/vent_1_broken.tscn index 7a7b225..9d0b14f 100644 --- a/assets/vent_1_broken.tscn +++ b/assets/vent_1_broken.tscn @@ -999,366 +999,369 @@ points = PackedVector3Array(0.0843164, 0.029489, -0.00599527, 0.106798, 0.018135 [node name="Vent1_broken" type="Node3D" groups=["breakable"]] -[node name="VentPiece1" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="Rescale" type="Node3D" parent="."] +transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0, 0) + +[node name="VentPiece1" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell" type="MeshInstance3D" parent="VentPiece1"] +[node name="Vent1_cell" type="MeshInstance3D" parent="Rescale/VentPiece1"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.250446, -0.295107, 0.0527292) mesh = SubResource("ArrayMesh_8e5oi") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece1"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece1"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.250446, -0.295107, 0.0527292) shape = SubResource("ConvexPolygonShape3D_acomi") -[node name="VentPiece2" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece2" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_001" type="MeshInstance3D" parent="VentPiece2"] +[node name="Vent1_cell_001" type="MeshInstance3D" parent="Rescale/VentPiece2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.28259, -0.390764, 0.0474808) mesh = SubResource("ArrayMesh_e40co") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece2"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.28259, -0.390764, 0.0474808) shape = SubResource("ConvexPolygonShape3D_yyj5k") -[node name="VentPiece3" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece3" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_002" type="MeshInstance3D" parent="VentPiece3"] +[node name="Vent1_cell_002" type="MeshInstance3D" parent="Rescale/VentPiece3"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.482465, -0.489164, 0.0248607) mesh = SubResource("ArrayMesh_n0qhw") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece3"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece3"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.482465, -0.489164, 0.0248607) shape = SubResource("ConvexPolygonShape3D_pvrtg") -[node name="VentPiece4" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece4" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_003" type="MeshInstance3D" parent="VentPiece4"] +[node name="Vent1_cell_003" type="MeshInstance3D" parent="Rescale/VentPiece4"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.402702, 0.222901, 0.049473) mesh = SubResource("ArrayMesh_up8s1") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece4"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece4"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.402702, 0.222901, 0.049473) shape = SubResource("ConvexPolygonShape3D_nxa4c") -[node name="VentPiece5" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece5" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_004" type="MeshInstance3D" parent="VentPiece5"] +[node name="Vent1_cell_004" type="MeshInstance3D" parent="Rescale/VentPiece5"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.327093, 0.412875, 0.0446539) mesh = SubResource("ArrayMesh_65s0k") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece5"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece5"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.327093, 0.412875, 0.0446539) shape = SubResource("ConvexPolygonShape3D_ys1bc") -[node name="VentPiece6" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece6" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_005" type="MeshInstance3D" parent="VentPiece6"] +[node name="Vent1_cell_005" type="MeshInstance3D" parent="Rescale/VentPiece6"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.492458, 0.0919293, 0.0366412) mesh = SubResource("ArrayMesh_pe33s") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece6"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece6"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.492458, 0.0919293, 0.0366412) shape = SubResource("ConvexPolygonShape3D_tf1ew") -[node name="VentPiece7" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece7" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_006" type="MeshInstance3D" parent="VentPiece7"] +[node name="Vent1_cell_006" type="MeshInstance3D" parent="Rescale/VentPiece7"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.29636, -0.000667261, 0.0473448) mesh = SubResource("ArrayMesh_op5k6") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece7"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece7"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.29636, -0.000667261, 0.0473448) shape = SubResource("ConvexPolygonShape3D_88sqd") -[node name="VentPiece8" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece8" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_007" type="MeshInstance3D" parent="VentPiece8"] +[node name="Vent1_cell_007" type="MeshInstance3D" parent="Rescale/VentPiece8"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.4836, 0.505153, 0.0322926) mesh = SubResource("ArrayMesh_34lup") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece8"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece8"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.4836, 0.505153, 0.0322926) shape = SubResource("ConvexPolygonShape3D_vaua8") -[node name="VentPiece9" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece9" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_008" type="MeshInstance3D" parent="VentPiece9"] +[node name="Vent1_cell_008" type="MeshInstance3D" parent="Rescale/VentPiece9"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.403742, 0.171308, 0.050584) mesh = SubResource("ArrayMesh_0h7ln") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece9"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece9"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.403742, 0.171308, 0.050584) shape = SubResource("ConvexPolygonShape3D_2ud6r") -[node name="VentPiece10" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece10" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_009" type="MeshInstance3D" parent="VentPiece10"] +[node name="Vent1_cell_009" type="MeshInstance3D" parent="Rescale/VentPiece10"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.406524, 0.0670236, 0.045686) mesh = SubResource("ArrayMesh_k7lff") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece10"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece10"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.406524, 0.0670236, 0.045686) shape = SubResource("ConvexPolygonShape3D_uij2c") -[node name="VentPiece11" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece11" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_010" type="MeshInstance3D" parent="VentPiece11"] +[node name="Vent1_cell_010" type="MeshInstance3D" parent="Rescale/VentPiece11"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.264312, 0.269325, 0.0554593) mesh = SubResource("ArrayMesh_3apx2") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece11"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece11"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.264312, 0.269325, 0.0554593) shape = SubResource("ConvexPolygonShape3D_7e4bm") -[node name="VentPiece12" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece12" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_011" type="MeshInstance3D" parent="VentPiece12"] +[node name="Vent1_cell_011" type="MeshInstance3D" parent="Rescale/VentPiece12"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.278271, 0.487641, 0.0342662) mesh = SubResource("ArrayMesh_gp43c") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece12"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece12"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.278271, 0.487641, 0.0342662) shape = SubResource("ConvexPolygonShape3D_wweg4") -[node name="VentPiece13" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece13" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_012" type="MeshInstance3D" parent="VentPiece13"] +[node name="Vent1_cell_012" type="MeshInstance3D" parent="Rescale/VentPiece13"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.404709, -0.456046, 0.0385359) mesh = SubResource("ArrayMesh_1ax1p") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece13"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece13"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.404709, -0.456046, 0.0385359) shape = SubResource("ConvexPolygonShape3D_1o633") -[node name="VentPiece14" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece14" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_013" type="MeshInstance3D" parent="VentPiece14"] +[node name="Vent1_cell_013" type="MeshInstance3D" parent="Rescale/VentPiece14"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.285766, 0.405171, 0.0426889) mesh = SubResource("ArrayMesh_548m3") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece14"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece14"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.285766, 0.405171, 0.0426889) shape = SubResource("ConvexPolygonShape3D_ru4xk") -[node name="VentPiece15" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece15" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_014" type="MeshInstance3D" parent="VentPiece15"] +[node name="Vent1_cell_014" type="MeshInstance3D" parent="Rescale/VentPiece15"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.405603, -0.223204, 0.0504668) mesh = SubResource("ArrayMesh_8j2hu") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece15"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece15"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.405603, -0.223204, 0.0504668) shape = SubResource("ConvexPolygonShape3D_a8ljp") -[node name="VentPiece16" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece16" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_015" type="MeshInstance3D" parent="VentPiece16"] +[node name="Vent1_cell_015" type="MeshInstance3D" parent="Rescale/VentPiece16"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.4891, 0.477238, 0.0279512) mesh = SubResource("ArrayMesh_g4sx2") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece16"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece16"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.4891, 0.477238, 0.0279512) shape = SubResource("ConvexPolygonShape3D_efk1x") -[node name="VentPiece17" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece17" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_016" type="MeshInstance3D" parent="VentPiece17"] +[node name="Vent1_cell_016" type="MeshInstance3D" parent="Rescale/VentPiece17"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.267895, 0.0645377, 0.049873) mesh = SubResource("ArrayMesh_ls2d7") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece17"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece17"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.267895, 0.0645377, 0.049873) shape = SubResource("ConvexPolygonShape3D_fqydr") -[node name="VentPiece18" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece18" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_017" type="MeshInstance3D" parent="VentPiece18"] +[node name="Vent1_cell_017" type="MeshInstance3D" parent="Rescale/VentPiece18"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.256295, -0.0558184, 0.0540604) mesh = SubResource("ArrayMesh_03ecf") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece18"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece18"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.256295, -0.0558184, 0.0540604) shape = SubResource("ConvexPolygonShape3D_qmxad") -[node name="VentPiece19" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece19" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_018" type="MeshInstance3D" parent="VentPiece19"] +[node name="Vent1_cell_018" type="MeshInstance3D" parent="Rescale/VentPiece19"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.282814, -0.0955964, 0.052445) mesh = SubResource("ArrayMesh_5qs2k") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece19"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece19"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.282814, -0.0955964, 0.052445) shape = SubResource("ConvexPolygonShape3D_dqglp") -[node name="VentPiece20" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece20" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_019" type="MeshInstance3D" parent="VentPiece20"] +[node name="Vent1_cell_019" type="MeshInstance3D" parent="Rescale/VentPiece20"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.498295, 0.231357, 0.0473998) mesh = SubResource("ArrayMesh_gwbqt") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece20"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece20"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.498295, 0.231357, 0.0473998) shape = SubResource("ConvexPolygonShape3D_88mk0") -[node name="VentPiece21" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece21" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_020" type="MeshInstance3D" parent="VentPiece21"] +[node name="Vent1_cell_020" type="MeshInstance3D" parent="Rescale/VentPiece21"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.122279, -0.48778, 0.0349913) mesh = SubResource("ArrayMesh_affmn") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece21"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece21"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.122279, -0.48778, 0.0349913) shape = SubResource("ConvexPolygonShape3D_6qxtq") -[node name="VentPiece22" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece22" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_021" type="MeshInstance3D" parent="VentPiece22"] +[node name="Vent1_cell_021" type="MeshInstance3D" parent="Rescale/VentPiece22"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.307188, 0.134622, 0.080303) mesh = SubResource("ArrayMesh_kvqkq") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece22"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece22"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.307188, 0.134622, 0.080303) shape = SubResource("ConvexPolygonShape3D_u8qsw") -[node name="VentPiece23" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece23" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_022" type="MeshInstance3D" parent="VentPiece23"] +[node name="Vent1_cell_022" type="MeshInstance3D" parent="Rescale/VentPiece23"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0771792, 0.13017, 0.0452086) mesh = SubResource("ArrayMesh_x0t13") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece23"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece23"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0771792, 0.13017, 0.0452086) shape = SubResource("ConvexPolygonShape3D_rp6ml") -[node name="VentPiece24" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece24" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_023" type="MeshInstance3D" parent="VentPiece24"] +[node name="Vent1_cell_023" type="MeshInstance3D" parent="Rescale/VentPiece24"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.115632, 0.261265, 0.0709751) mesh = SubResource("ArrayMesh_qil4h") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece24"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece24"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.115632, 0.261265, 0.0709751) shape = SubResource("ConvexPolygonShape3D_cv1g0") -[node name="VentPiece25" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece25" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_024" type="MeshInstance3D" parent="VentPiece25"] +[node name="Vent1_cell_024" type="MeshInstance3D" parent="Rescale/VentPiece25"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.149313, 0.191627, 0.0587724) mesh = SubResource("ArrayMesh_ajjfs") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece25"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece25"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.149313, 0.191627, 0.0587724) shape = SubResource("ConvexPolygonShape3D_ghlag") -[node name="VentPiece26" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece26" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_025" type="MeshInstance3D" parent="VentPiece26"] +[node name="Vent1_cell_025" type="MeshInstance3D" parent="Rescale/VentPiece26"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.132508, -0.270056, 0.0474273) mesh = SubResource("ArrayMesh_pqwx1") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece26"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece26"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.132508, -0.270056, 0.0474273) shape = SubResource("ConvexPolygonShape3D_6f41k") -[node name="VentPiece27" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece27" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_026" type="MeshInstance3D" parent="VentPiece27"] +[node name="Vent1_cell_026" type="MeshInstance3D" parent="Rescale/VentPiece27"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.168348, -0.197703, 0.057887) mesh = SubResource("ArrayMesh_tt885") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece27"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece27"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.168348, -0.197703, 0.057887) shape = SubResource("ConvexPolygonShape3D_sdaja") -[node name="VentPiece28" type="RigidBody3D" parent="." groups=["spawned"]] +[node name="VentPiece28" type="RigidBody3D" parent="Rescale" groups=["spawned"]] collision_layer = 32 collision_mask = 237 -[node name="Vent1_cell_027" type="MeshInstance3D" parent="VentPiece28"] +[node name="Vent1_cell_027" type="MeshInstance3D" parent="Rescale/VentPiece28"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.17628, 0.100681, 0.0559936) mesh = SubResource("ArrayMesh_xn4kk") skeleton = NodePath("") -[node name="CollisionShape3D" type="CollisionShape3D" parent="VentPiece28"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Rescale/VentPiece28"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.17628, 0.100681, 0.0559936) shape = SubResource("ConvexPolygonShape3D_1e4k3") diff --git a/scenes/asset_checker.tscn b/scenes/asset_checker.tscn index 8bcd53f..7d827d4 100644 --- a/scenes/asset_checker.tscn +++ b/scenes/asset_checker.tscn @@ -558,6 +558,18 @@ transform = Transform3D(-0.136113, 0, 0.990693, 0, 1, 0, -0.990693, 0, -0.136113 [node name="RigidBody3D" parent="." instance=ExtResource("31_jbe2q")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.3714, 1.04444, -2.16718) +[node name="RigidBody3D2" parent="." instance=ExtResource("31_jbe2q")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12.6185, 1.04444, -2.70382) + +[node name="RigidBody3D3" parent="." instance=ExtResource("31_jbe2q")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.7497, 1.04444, -3.68158) + +[node name="RigidBody3D4" parent="." instance=ExtResource("31_jbe2q")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.6259, 1.04444, -3.68189) + +[node name="RigidBody3D5" parent="." instance=ExtResource("31_jbe2q")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12.9278, 1.04444, -4.43487) + [node name="Spikes 1" parent="." instance=ExtResource("33_u3uct")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.84169, 0.107734, 17.6221) @@ -569,3 +581,6 @@ transform = Transform3D(1, 0, 0, 0, -0.998757, 0.0498434, 0, -0.0498434, -0.9987 [node name="Vent1" parent="." instance=ExtResource("32_x8mvi")] transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 23.1191, 0.923517, 22.4057) + +[node name="Vent2" parent="." instance=ExtResource("32_x8mvi")] +transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -6.98721, 0.923517, 22.4057) diff --git a/scripts/EnemyTarget.gd b/scripts/EnemyTarget.gd index d4bc26e..9628d21 100644 --- a/scripts/EnemyTarget.gd +++ b/scripts/EnemyTarget.gd @@ -17,6 +17,7 @@ func _process(delta): func hit(bullet_damage): emit_signal("body_part_hit", damage, bullet_damage) + SignalBus.emit_signal("enemy_hit") var number_spawn = damage_number.instantiate() number_spawn.damage_amt = bullet_damage * damage diff --git a/scripts/HelperFuncs.gd b/scripts/HelperFuncs.gd index 23238a6..ad3d1e8 100644 --- a/scripts/HelperFuncs.gd +++ b/scripts/HelperFuncs.gd @@ -5,17 +5,10 @@ extends Node # Check if a colliding body is aligned within a given angle of the object # max_angle_diff --- note: set to 1 if angle won't be counted # currently only works when objects are scaled (1,1,1) -func angle_velocity_aligned(source:Node,source_angle:Vector3,body:Node,max_angle_diff:Vector3): +func angle_velocity_aligned(source:Node, source_angle:Vector3, body:Node, max_angle_diff:Vector3): var obj_direction = source.basis * source_angle - print("SOURCE BASIS ",source.basis) var player_direction = body.velocity.normalized() var diff = abs(abs(obj_direction) - abs(player_direction)) - print("------------------------------------------------------------") - print("OBJ DIRECTION: ",obj_direction) - print("PLAYER DIRECTION: ", player_direction) - print("MAX ANGLE DIFF ",max_angle_diff) - print("DIFFERENCE: ", diff) - print("------------------------------------------------------------") if diff.x <= max_angle_diff.x and diff.y <= max_angle_diff.y and diff.z <= max_angle_diff.z: return true else: diff --git a/scripts/bullet.gd b/scripts/bullet.gd index a893580..91390b5 100644 --- a/scripts/bullet.gd +++ b/scripts/bullet.gd @@ -41,10 +41,9 @@ func _physics_process(delta): mesh.visible = false ray.enabled = false - if body.is_in_group("enemy_target"): + if body.has_method("hit"): hit_indicator.play() enemy_particles.emitting = true - SignalBus.emit_signal("enemy_hit") ray.get_collider().hit(bullet_damage) #bullethole effect diff --git a/scripts/oildrum.gd b/scripts/oildrum.gd new file mode 100644 index 0000000..2bcff05 --- /dev/null +++ b/scripts/oildrum.gd @@ -0,0 +1,88 @@ +extends RigidBody3D + +@export var hp : float = 3 +@export var explosion : Resource +@export var blast_power : float = 10 +@export_enum("Enemy", "Trap") var enemy_type: int + +@onready var leak_audio: AudioStreamPlayer3D = $leak_audio +@onready var blast_radius_area: Area3D = $BlastRadius +@onready var radius_shape: CollisionShape3D = $BlastRadius/CollisionShape3D + +var leak_hp = false +var blast_amount + +const HP_LEAK_RATE = .5 + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + add_to_group("persist") + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + if leak_hp: + hp -= delta * HP_LEAK_RATE + print("HP - ",hp) + if hp <= 0: + explode() + +func save(): + var save_dict = { + "filename" : get_scene_file_path(), + "parent" : get_parent().get_path(), + "pos_x" : position.x, + "pos_y" : position.y, + "pos_z" : position.z, + "rot_x" : rotation.x, + "rot_y" : rotation.y, + "rot_z" : rotation.z, + "hp" : hp, + "leak_hp" : leak_hp, + } + return save_dict + +func hit(bullet_damage): + hp -= 1 + leak_hp = true + leak_audio.play() + +func explode(): + #get all collision objects that can be moved + var bodies_in_blast = blast_radius_area.get_overlapping_bodies() + #for each object determine vector from center of blast radius + #apply linear velocity power as the inverse % of distance towards the edge (bonus points if using curve texture) + #break breakable objects + for body in bodies_in_blast: + + #calculate blast power and direction + var blast_direction = (body.global_position - blast_radius_area.global_position).normalized() + var blast_amount = 1 - ((body.global_position - blast_radius_area.global_position).length() / radius_shape.shape.radius) + var blast_velocity = blast_direction * blast_power * blast_amount + + #apply and/or damage + if body.get_class() == "RigidBody3D": + if body.is_in_group("breakable"): + body.breaking(blast_velocity) + else: + body.linear_velocity += blast_velocity + if body.is_in_group("player"): + body.velocity += clamp(blast_velocity,Vector3(-7,-7,-7),Vector3(7,7,7)) + body.recoil.add_recoil(Vector3(1,.1,.1),10,10) + body.hit(1,self,enemy_type) + if body.has_method("hit") and !body.is_in_group("player"): + body.hit(1) + if body.is_in_group("enemy"): + body.knocked = true + body.stunned = true + print("knocked") + body.knocked_timer.start() + body.stunned_timer.start() + body.velocity += blast_velocity + + #Spawn gpu particles + var explosionspawn = explosion.instantiate() + explosionspawn.position = self.global_position + explosionspawn.transform.basis = self.global_transform.basis + get_tree().get_root().add_child(explosionspawn) + queue_free() diff --git a/scripts/rocket.gd b/scripts/rocket.gd index e9e6556..d3f626d 100644 --- a/scripts/rocket.gd +++ b/scripts/rocket.gd @@ -48,8 +48,8 @@ func explode(): var blast_velocity = blast_direction * blast_power * blast_amount #apply and/or damage - if body.is_in_group("scene_rigidbody"): - if body.is_in_group("breakable"): + if body.get_class() == "RigidBody3D": + if body.has_method("breaking"): body.breaking(blast_velocity) else: body.linear_velocity += blast_velocity