From 6215008db707dbe2ecf4b4e29254a305baa57ddc Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sun, 1 Mar 2026 21:16:49 +0100 Subject: [PATCH] Added loot to boxes --- 3D/Scenes/Props/Box_3D_Blue.tscn | 21 +++++++++++++++------ 3D/Scenes/Props/Box_3D_Blue_Tall.tscn | 22 ++++++++++++++++------ 3D/Scenes/Props/Box_3D_Green.tscn | 21 +++++++++++++++------ 3D/Scenes/Props/Box_3D_Wood_Tall.tscn | 22 ++++++++++++++++------ 3D/Scenes/Props/Box_3D_Yellow.tscn | 21 +++++++++++++++------ Scenes/Items/GenericItem3D.tscn | 8 ++++---- 6 files changed, 81 insertions(+), 34 deletions(-) diff --git a/3D/Scenes/Props/Box_3D_Blue.tscn b/3D/Scenes/Props/Box_3D_Blue.tscn index c37d8b77..44fc31a2 100644 --- a/3D/Scenes/Props/Box_3D_Blue.tscn +++ b/3D/Scenes/Props/Box_3D_Blue.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=9 format=3 uid="uid://br01ww57uaky5"] +[gd_scene format=3 uid="uid://br01ww57uaky5"] [ext_resource type="Script" uid="uid://ccxnvbthsvka3" path="res://Scripts/Actors/Destructible3D.cs" id="1_hsg1w"] [ext_resource type="PackedScene" uid="uid://hxn4awevjyui" path="res://3D/BlockbenchModels/Box/Box_Blue.gltf" id="1_ropdl"] [ext_resource type="Resource" uid="uid://bes254wblt1lm" path="res://Resources/Bullets/3D/Explosion_Harmless_Small_3D.tres" id="2_cn5xh"] [ext_resource type="Script" uid="uid://ddsqqfx1usc3j" path="res://Scripts/Resources/DamageResistance.cs" id="3_kh78t"] +[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="4_0ax2p"] [ext_resource type="Script" uid="uid://hkmutmmjqh1e" path="res://Scripts/Actors/3D/PropGravityModule3D.cs" id="5_0ktp8"] +[ext_resource type="Resource" uid="uid://dy53gia1tmkah" path="res://Resources/Items/Points_Pickup.tres" id="5_x0dtf"] [sub_resource type="Resource" id="Resource_0ktp8"] script = ExtResource("3_kh78t") @@ -12,13 +14,19 @@ DamageType = 4 Attribute = 2 metadata/_custom_type_script = "uid://ddsqqfx1usc3j" +[sub_resource type="Resource" id="Resource_cxtju"] +script = ExtResource("4_0ax2p") +Item = ExtResource("5_x0dtf") +Chance = 70.0 +metadata/_custom_type_script = "uid://cq65aed620ijo" + [sub_resource type="BoxShape3D" id="BoxShape3D_hsg1w"] size = Vector3(0.763428, 0.469452, 0.77832) [sub_resource type="BoxShape3D" id="BoxShape3D_0ktp8"] size = Vector3(0.60668945, 0.09439087, 0.595726) -[node name="BoxBlue" type="StaticBody3D" groups=["Destroyable"]] +[node name="BoxBlue" type="StaticBody3D" unique_id=219270740 groups=["Destroyable"]] collision_layer = 16 collision_mask = 0 axis_lock_linear_x = true @@ -30,20 +38,21 @@ script = ExtResource("1_hsg1w") Health = 8.0 ExplosionData = ExtResource("2_cn5xh") DamageResistances = Array[ExtResource("3_kh78t")]([SubResource("Resource_0ktp8")]) +LootDrops = Array[ExtResource("4_0ax2p")]([SubResource("Resource_cxtju")]) -[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=190194845] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00549316, 0.0253752, -0.000488281) shape = SubResource("BoxShape3D_hsg1w") -[node name="blockbench_export" parent="." instance=ExtResource("1_ropdl")] +[node name="blockbench_export" parent="." unique_id=1902191780 instance=ExtResource("1_ropdl")] -[node name="Node" type="Area3D" parent="."] +[node name="Node" type="Area3D" parent="." unique_id=1802370452] collision_layer = 0 collision_mask = 17 script = ExtResource("5_0ktp8") FallingSpeed = -2.0 -[node name="CollisionShape3D" type="CollisionShape3D" parent="Node"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Node" unique_id=1966731753] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.024291992, -0.19599915, 0.013088226) shape = SubResource("BoxShape3D_0ktp8") diff --git a/3D/Scenes/Props/Box_3D_Blue_Tall.tscn b/3D/Scenes/Props/Box_3D_Blue_Tall.tscn index 00588baa..d40696e5 100644 --- a/3D/Scenes/Props/Box_3D_Blue_Tall.tscn +++ b/3D/Scenes/Props/Box_3D_Blue_Tall.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=9 format=3 uid="uid://cf7jo7q71ucli"] +[gd_scene format=3 uid="uid://cf7jo7q71ucli"] [ext_resource type="Script" uid="uid://ccxnvbthsvka3" path="res://Scripts/Actors/Destructible3D.cs" id="1_iyotb"] [ext_resource type="Resource" uid="uid://bes254wblt1lm" path="res://Resources/Bullets/3D/Explosion_Harmless_Small_3D.tres" id="2_f87s5"] [ext_resource type="Script" uid="uid://ddsqqfx1usc3j" path="res://Scripts/Resources/DamageResistance.cs" id="3_yhe02"] [ext_resource type="PackedScene" uid="uid://ry8fwoju3alh" path="res://3D/BlockbenchModels/Box/BoxTallBlue/Box_Tall_Blue.gltf" id="4_iyotb"] +[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="4_yhe02"] +[ext_resource type="Resource" uid="uid://dy53gia1tmkah" path="res://Resources/Items/Points_Pickup.tres" id="5_hbe6d"] [ext_resource type="Script" uid="uid://hkmutmmjqh1e" path="res://Scripts/Actors/3D/PropGravityModule3D.cs" id="5_jnstp"] [sub_resource type="Resource" id="Resource_0ktp8"] @@ -12,13 +14,20 @@ DamageType = 4 Attribute = 2 metadata/_custom_type_script = "uid://ddsqqfx1usc3j" +[sub_resource type="Resource" id="Resource_jnstp"] +script = ExtResource("4_yhe02") +Item = ExtResource("5_hbe6d") +Chance = 70.0 +Count = 3 +metadata/_custom_type_script = "uid://cq65aed620ijo" + [sub_resource type="BoxShape3D" id="BoxShape3D_hsg1w"] size = Vector3(1.0160522, 1.1501389, 1.0269775) [sub_resource type="BoxShape3D" id="BoxShape3D_0ktp8"] size = Vector3(1.0121155, 0.09439087, 1.1526518) -[node name="BoxBlueTall" type="StaticBody3D" groups=["Destroyable"]] +[node name="BoxBlueTall" type="StaticBody3D" unique_id=1413272851 groups=["Destroyable"]] collision_layer = 16 collision_mask = 0 axis_lock_linear_x = true @@ -30,20 +39,21 @@ script = ExtResource("1_iyotb") Health = 8.0 ExplosionData = ExtResource("2_f87s5") DamageResistances = Array[ExtResource("3_yhe02")]([SubResource("Resource_0ktp8")]) +LootDrops = Array[ExtResource("4_yhe02")]([SubResource("Resource_jnstp")]) -[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=161802429] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.003509529, 0.0031622052, 0.0022582859) shape = SubResource("BoxShape3D_hsg1w") -[node name="blockbench_export2" parent="." instance=ExtResource("4_iyotb")] +[node name="blockbench_export2" parent="." unique_id=802361790 instance=ExtResource("4_iyotb")] -[node name="Node" type="Area3D" parent="."] +[node name="Node" type="Area3D" parent="." unique_id=1345720677] collision_layer = 0 collision_mask = 17 script = ExtResource("5_jnstp") FallingSpeed = -2.0 -[node name="CollisionShape3D" type="CollisionShape3D" parent="Node"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Node" unique_id=1092912262] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.01399231, -0.5570252, 0.0049414635) shape = SubResource("BoxShape3D_0ktp8") diff --git a/3D/Scenes/Props/Box_3D_Green.tscn b/3D/Scenes/Props/Box_3D_Green.tscn index 44745ab8..e9340cd0 100644 --- a/3D/Scenes/Props/Box_3D_Green.tscn +++ b/3D/Scenes/Props/Box_3D_Green.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=9 format=3 uid="uid://c8wwioforxms3"] +[gd_scene format=3 uid="uid://c8wwioforxms3"] [ext_resource type="PackedScene" uid="uid://c5k6rsawax3gf" path="res://3D/BlockbenchModels/Box/Box_Green.gltf" id="1_03sp0"] [ext_resource type="Script" uid="uid://ccxnvbthsvka3" path="res://Scripts/Actors/Destructible3D.cs" id="1_e6kl3"] [ext_resource type="Resource" uid="uid://bes254wblt1lm" path="res://Resources/Bullets/3D/Explosion_Harmless_Small_3D.tres" id="2_bguu7"] [ext_resource type="Script" uid="uid://ddsqqfx1usc3j" path="res://Scripts/Resources/DamageResistance.cs" id="3_fntiw"] +[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="4_6tetb"] [ext_resource type="Script" uid="uid://hkmutmmjqh1e" path="res://Scripts/Actors/3D/PropGravityModule3D.cs" id="5_jb4do"] +[ext_resource type="Resource" uid="uid://dy53gia1tmkah" path="res://Resources/Items/Points_Pickup.tres" id="5_s7i0r"] [sub_resource type="Resource" id="Resource_fntiw"] script = ExtResource("3_fntiw") @@ -12,33 +14,40 @@ DamageType = 4 Attribute = 2 metadata/_custom_type_script = "uid://ddsqqfx1usc3j" +[sub_resource type="Resource" id="Resource_4l2cb"] +script = ExtResource("4_6tetb") +Item = ExtResource("5_s7i0r") +Chance = 70.0 +metadata/_custom_type_script = "uid://cq65aed620ijo" + [sub_resource type="BoxShape3D" id="BoxShape3D_hsg1w"] size = Vector3(0.763428, 0.469452, 0.77832) [sub_resource type="BoxShape3D" id="BoxShape3D_6tetb"] size = Vector3(0.60668945, 0.09439087, 0.595726) -[node name="BoxBlue" type="StaticBody3D" groups=["Destroyable"]] +[node name="BoxBlue" type="StaticBody3D" unique_id=909576797 groups=["Destroyable"]] collision_layer = 16 collision_mask = 0 script = ExtResource("1_e6kl3") Health = 8.0 ExplosionData = ExtResource("2_bguu7") DamageResistances = Array[ExtResource("3_fntiw")]([SubResource("Resource_fntiw")]) +LootDrops = Array[ExtResource("4_6tetb")]([SubResource("Resource_4l2cb")]) -[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=948062286] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00549316, 0.0253752, -0.000488281) shape = SubResource("BoxShape3D_hsg1w") -[node name="blockbench_export" parent="." instance=ExtResource("1_03sp0")] +[node name="blockbench_export" parent="." unique_id=1533213572 instance=ExtResource("1_03sp0")] -[node name="Gravity" type="Area3D" parent="."] +[node name="Gravity" type="Area3D" parent="." unique_id=1508369913] collision_layer = 0 collision_mask = 17 script = ExtResource("5_jb4do") FallingSpeed = -2.0 -[node name="CollisionShape3D" type="CollisionShape3D" parent="Gravity"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Gravity" unique_id=1939247061] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.024291992, -0.19599915, 0.013088226) shape = SubResource("BoxShape3D_6tetb") diff --git a/3D/Scenes/Props/Box_3D_Wood_Tall.tscn b/3D/Scenes/Props/Box_3D_Wood_Tall.tscn index a2b2195c..734aa563 100644 --- a/3D/Scenes/Props/Box_3D_Wood_Tall.tscn +++ b/3D/Scenes/Props/Box_3D_Wood_Tall.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=9 format=3 uid="uid://bcoq4lutgg70g"] +[gd_scene format=3 uid="uid://bcoq4lutgg70g"] [ext_resource type="Script" uid="uid://ccxnvbthsvka3" path="res://Scripts/Actors/Destructible3D.cs" id="1_wc4m3"] [ext_resource type="Resource" uid="uid://bes254wblt1lm" path="res://Resources/Bullets/3D/Explosion_Harmless_Small_3D.tres" id="2_x35ai"] [ext_resource type="Script" uid="uid://ddsqqfx1usc3j" path="res://Scripts/Resources/DamageResistance.cs" id="3_5ubxx"] +[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="4_5ubxx"] [ext_resource type="Script" uid="uid://hkmutmmjqh1e" path="res://Scripts/Actors/3D/PropGravityModule3D.cs" id="5_ukcbt"] +[ext_resource type="Resource" uid="uid://dy53gia1tmkah" path="res://Resources/Items/Points_Pickup.tres" id="5_vwer7"] [ext_resource type="PackedScene" uid="uid://c2xp2n3rv4euj" path="res://3D/BlockbenchModels/Box_Wood_Big/Box_Wood_Big.gltf" id="5_wc4m3"] [sub_resource type="Resource" id="Resource_0ktp8"] @@ -12,13 +14,20 @@ DamageType = 4 Attribute = 2 metadata/_custom_type_script = "uid://ddsqqfx1usc3j" +[sub_resource type="Resource" id="Resource_ukcbt"] +script = ExtResource("4_5ubxx") +Item = ExtResource("5_vwer7") +Chance = 70.0 +Count = 3 +metadata/_custom_type_script = "uid://cq65aed620ijo" + [sub_resource type="BoxShape3D" id="BoxShape3D_hsg1w"] size = Vector3(1.0160522, 1.0134869, 1.0269775) [sub_resource type="BoxShape3D" id="BoxShape3D_0ktp8"] size = Vector3(1.0121155, 0.09439087, 1.1526518) -[node name="BoxWoodTall" type="StaticBody3D" groups=["Destroyable"]] +[node name="BoxWoodTall" type="StaticBody3D" unique_id=2001896947 groups=["Destroyable"]] collision_layer = 16 collision_mask = 0 axis_lock_linear_x = true @@ -30,22 +39,23 @@ script = ExtResource("1_wc4m3") Health = 8.0 ExplosionData = ExtResource("2_x35ai") DamageResistances = Array[ExtResource("3_5ubxx")]([SubResource("Resource_0ktp8")]) +LootDrops = Array[ExtResource("4_5ubxx")]([SubResource("Resource_ukcbt")]) -[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=136435975] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.003509529, -0.00034826994, 0.0022582859) shape = SubResource("BoxShape3D_hsg1w") -[node name="Node" type="Area3D" parent="."] +[node name="Node" type="Area3D" parent="." unique_id=1640864510] collision_layer = 0 collision_mask = 17 script = ExtResource("5_ukcbt") FallingSpeed = -2.0 -[node name="CollisionShape3D" type="CollisionShape3D" parent="Node"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Node" unique_id=522918839] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.01399231, -0.5570252, 0.0049414635) shape = SubResource("BoxShape3D_0ktp8") -[node name="blockbench_export" parent="." instance=ExtResource("5_wc4m3")] +[node name="blockbench_export" parent="." unique_id=935240156 instance=ExtResource("5_wc4m3")] [connection signal="body_entered" from="Node" to="Node" method="OnBodyEntered"] [connection signal="body_exited" from="Node" to="Node" method="OnBodyExited"] diff --git a/3D/Scenes/Props/Box_3D_Yellow.tscn b/3D/Scenes/Props/Box_3D_Yellow.tscn index 41590299..cce89567 100644 --- a/3D/Scenes/Props/Box_3D_Yellow.tscn +++ b/3D/Scenes/Props/Box_3D_Yellow.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=9 format=3 uid="uid://c6cdl3y3i3axl"] +[gd_scene format=3 uid="uid://c6cdl3y3i3axl"] [ext_resource type="PackedScene" uid="uid://cpwolnoq46foq" path="res://3D/BlockbenchModels/Box/Box_Yellow.gltf" id="1_0rxnx"] [ext_resource type="Script" uid="uid://ccxnvbthsvka3" path="res://Scripts/Actors/Destructible3D.cs" id="1_l0sp5"] [ext_resource type="Resource" uid="uid://bes254wblt1lm" path="res://Resources/Bullets/3D/Explosion_Harmless_Small_3D.tres" id="2_1if0l"] [ext_resource type="Script" uid="uid://ddsqqfx1usc3j" path="res://Scripts/Resources/DamageResistance.cs" id="3_6qeec"] +[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="4_ntpiq"] +[ext_resource type="Resource" uid="uid://dy53gia1tmkah" path="res://Resources/Items/Points_Pickup.tres" id="5_1l74t"] [ext_resource type="Script" uid="uid://hkmutmmjqh1e" path="res://Scripts/Actors/3D/PropGravityModule3D.cs" id="5_njaax"] [sub_resource type="Resource" id="Resource_6qeec"] @@ -12,33 +14,40 @@ DamageType = 4 Attribute = 2 metadata/_custom_type_script = "uid://ddsqqfx1usc3j" +[sub_resource type="Resource" id="Resource_pd2fu"] +script = ExtResource("4_ntpiq") +Item = ExtResource("5_1l74t") +Chance = 70.0 +metadata/_custom_type_script = "uid://cq65aed620ijo" + [sub_resource type="BoxShape3D" id="BoxShape3D_hsg1w"] size = Vector3(0.763428, 0.469452, 0.77832) [sub_resource type="BoxShape3D" id="BoxShape3D_ntpiq"] size = Vector3(0.60668945, 0.09439087, 0.595726) -[node name="BoxBlue" type="StaticBody3D" groups=["Destroyable"]] +[node name="BoxBlue" type="StaticBody3D" unique_id=1504989307 groups=["Destroyable"]] collision_layer = 16 collision_mask = 0 script = ExtResource("1_l0sp5") Health = 8.0 ExplosionData = ExtResource("2_1if0l") DamageResistances = Array[ExtResource("3_6qeec")]([SubResource("Resource_6qeec")]) +LootDrops = Array[ExtResource("4_ntpiq")]([SubResource("Resource_pd2fu")]) -[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=892078803] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00549316, 0.0253752, -0.000488281) shape = SubResource("BoxShape3D_hsg1w") -[node name="blockbench_export" parent="." instance=ExtResource("1_0rxnx")] +[node name="blockbench_export" parent="." unique_id=1422815413 instance=ExtResource("1_0rxnx")] -[node name="Node" type="Area3D" parent="."] +[node name="Node" type="Area3D" parent="." unique_id=1892498840] collision_layer = 0 collision_mask = 17 script = ExtResource("5_njaax") FallingSpeed = -2.0 -[node name="CollisionShape3D" type="CollisionShape3D" parent="Node"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="Node" unique_id=1359298702] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.024291992, -0.19599915, 0.013088226) shape = SubResource("BoxShape3D_ntpiq") diff --git a/Scenes/Items/GenericItem3D.tscn b/Scenes/Items/GenericItem3D.tscn index 9cb90708..b38612b1 100644 --- a/Scenes/Items/GenericItem3D.tscn +++ b/Scenes/Items/GenericItem3D.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=4 format=3 uid="uid://cnot7sft7lpf3"] +[gd_scene format=3 uid="uid://cnot7sft7lpf3"] [ext_resource type="Script" uid="uid://cc60s31w2sive" path="res://Scripts/Interactables/ItemPickup3D.cs" id="1_rqfak"] [ext_resource type="Texture2D" uid="uid://b61po207ggn63" path="res://Sprites/Items/Yin_Ammo.png" id="2_rqfak"] @@ -6,16 +6,16 @@ [sub_resource type="CylinderShape3D" id="CylinderShape3D_f43iq"] height = 0.538086 -[node name="Item" type="Area3D" groups=["Interactable"]] +[node name="Item" type="Area3D" unique_id=35154889 groups=["Interactable"]] collision_layer = 32 collision_mask = 0 script = ExtResource("1_rqfak") -[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=265561726] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0649414, 0) shape = SubResource("CylinderShape3D_f43iq") -[node name="Sprite3D" type="Sprite3D" parent="."] +[node name="Sprite3D" type="Sprite3D" parent="." unique_id=638449246] transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0) pixel_size = 0.05 texture_filter = 0