Fix up projectiles

This commit is contained in:
2026-02-24 12:28:01 -08:00
parent 846c8a4c59
commit 9d18bbb349
23 changed files with 261 additions and 210 deletions

View File

@@ -48,7 +48,6 @@ public class ItemDatabase
var weights = itemsToSelectFrom.Select(x => x.SpawnRate).ToArray();
var selectedItem = itemsToSelectFrom.ToArray()[rng.RandWeighted(weights)];
return selectedItem;
}

View File

@@ -1,15 +1,8 @@
[gd_scene load_steps=64 format=3 uid="uid://ddcw0xw7pxk8r"]
[gd_scene load_steps=62 format=3 uid="uid://ddcw0xw7pxk8r"]
[ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_xt24t"]
[ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_yf47k"]
[ext_resource type="Script" uid="uid://cytefxt38q6r7" path="res://src/system/PlayerProjectile.cs" id="1_titwo"]
[ext_resource type="Texture2D" uid="uid://ddmjhevb5ksl" path="res://src/vfx/Items Etc/geomantic_reactor_AIR.png" id="3_c0ubq"]
[sub_resource type="Resource" id="Resource_kcnxw"]
script = ExtResource("2_yf47k")
Damage = 10
ElementType = 1
metadata/_custom_type_script = "uid://ctshiyffvt4y5"
[sub_resource type="AtlasTexture" id="AtlasTexture_wsimg"]
atlas = ExtResource("3_c0ubq")
region = Rect2(0, 0, 512, 512)
@@ -519,8 +512,7 @@ _data = {
[sub_resource type="SphereShape3D" id="SphereShape3D_xt24t"]
[node name="AirReactor" type="Node3D"]
script = ExtResource("1_xt24t")
AttackData = SubResource("Resource_kcnxw")
script = ExtResource("1_titwo")
[node name="Bullet" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.1, 0)

View File

@@ -1,15 +1,8 @@
[gd_scene load_steps=68 format=3 uid="uid://bredkcfalakdp"]
[gd_scene load_steps=66 format=3 uid="uid://bredkcfalakdp"]
[ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_pk6yq"]
[ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_d874y"]
[ext_resource type="Script" uid="uid://cytefxt38q6r7" path="res://src/system/PlayerProjectile.cs" id="1_fhwm2"]
[ext_resource type="Texture2D" uid="uid://pirfu8nw05gk" path="res://src/vfx/Items Etc/geomantic reactor - fire.png" id="3_6hnq4"]
[sub_resource type="Resource" id="Resource_14f5p"]
script = ExtResource("2_d874y")
Damage = 10
ElementType = 4
metadata/_custom_type_script = "uid://ctshiyffvt4y5"
[sub_resource type="AtlasTexture" id="AtlasTexture_na8n6"]
atlas = ExtResource("3_6hnq4")
region = Rect2(0, 0, 512, 512)
@@ -550,8 +543,7 @@ _data = {
[sub_resource type="SphereShape3D" id="SphereShape3D_pk6yq"]
[node name="FireReactor" type="Node3D"]
script = ExtResource("1_pk6yq")
AttackData = SubResource("Resource_14f5p")
script = ExtResource("1_fhwm2")
[node name="Bullet" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.1, 0)

View File

@@ -1,13 +1,6 @@
[gd_scene load_steps=8 format=3 uid="uid://c4kc2vybdy5t"]
[gd_scene load_steps=6 format=3 uid="uid://c4kc2vybdy5t"]
[ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_7ykt2"]
[ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_3v8me"]
[sub_resource type="Resource" id="Resource_14f5p"]
script = ExtResource("2_3v8me")
Damage = 99
ElementType = 0
metadata/_custom_type_script = "uid://ctshiyffvt4y5"
[ext_resource type="Script" uid="uid://cytefxt38q6r7" path="res://src/system/PlayerProjectile.cs" id="1_bp1ct"]
[sub_resource type="Animation" id="Animation_xrn7e"]
resource_name = "fire"
@@ -49,8 +42,7 @@ _data = {
[sub_resource type="SphereShape3D" id="SphereShape3D_kct8n"]
[node name="Persuader" type="Node3D"]
script = ExtResource("1_7ykt2")
AttackData = SubResource("Resource_14f5p")
script = ExtResource("1_bp1ct")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true

View File

@@ -1,15 +1,8 @@
[gd_scene load_steps=79 format=3 uid="uid://dluot8v3m0drs"]
[gd_scene load_steps=77 format=3 uid="uid://dluot8v3m0drs"]
[ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_n88a7"]
[ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_er0le"]
[ext_resource type="Script" uid="uid://cytefxt38q6r7" path="res://src/system/PlayerProjectile.cs" id="1_yb0m4"]
[ext_resource type="Texture2D" uid="uid://dykncj5nomejo" path="res://src/vfx/Items Etc/GEOMANTIC_REACTOR_WATER.png" id="3_csu6k"]
[sub_resource type="Resource" id="Resource_k6pkx"]
script = ExtResource("2_er0le")
Damage = 10
ElementType = 3
metadata/_custom_type_script = "uid://ctshiyffvt4y5"
[sub_resource type="AtlasTexture" id="AtlasTexture_1yaxx"]
atlas = ExtResource("3_csu6k")
region = Rect2(0, 0, 512, 512)
@@ -624,8 +617,7 @@ _data = {
[sub_resource type="SphereShape3D" id="SphereShape3D_n88a7"]
[node name="WaterReactor" type="Node3D"]
script = ExtResource("1_n88a7")
AttackData = SubResource("Resource_k6pkx")
script = ExtResource("1_yb0m4")
[node name="Bullet" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.1, 0)

View File

@@ -16,6 +16,11 @@ public partial class Weapon : Node3D, IWeapon
public SoundEffect SoundEffect => Stats.SoundEffect;
public Weapon()
{
Init();
}
public override void _Ready()
{
Init();