goodbye collisions

This commit is contained in:
2023-09-07 20:03:22 -07:00
parent 4b840bbe7f
commit 833ad3209e
37 changed files with 410 additions and 299 deletions

View File

@@ -1,4 +1,5 @@
using Godot;
using System.Linq;
public partial class Character : CharacterBody3D
{
@@ -67,23 +68,28 @@ public partial class Character : CharacterBody3D
private async void Fire()
{
var projectile = _fireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
var projectile = _fireProjectile.Instantiate<Node3D>();
projectile.Position = Position;
GetParent().AddChild(projectile);
var projectiles = projectile.GetChildren().OfType<Projectile>();
foreach (var proj in projectiles)
{
if (proj.HasRotation)
proj.Rotation = GetNode<Node3D>("Pivot").Rotation;
}
CanShoot = false;
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");
await ToSignal(GetTree().CreateTimer(projectiles.First().Cooldown), "timeout");
CanShoot = true;
}
private async void AltFire()
{
var projectile = _altFireProjectile.Instantiate<Projectile>();
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
var projectile = _altFireProjectile.Instantiate<Node3D>();
projectile.Position = Position;
GetParent().AddChild(projectile);
var projectiles = projectile.GetChildren().OfType<Projectile>();
CanShoot = false;
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");
await ToSignal(GetTree().CreateTimer(projectiles.First().Cooldown), "timeout");
CanShoot = true;
}

View File

@@ -1,6 +1,4 @@
using Godot;
using Godot.Collections;
using System.Linq;
public partial class Projectile : Node3D
{
@@ -13,9 +11,14 @@ public partial class Projectile : Node3D
[Export]
public AudioStream _soundEffect;
public Character ParentCharacter;
[Export]
public AudioStream _onHitSfx;
private Array<Path3D> _paths;
[Export]
public RigidBody3D _hitBox;
[Export]
public bool HasRotation = false;
public override void _Ready()
{
@@ -23,18 +26,28 @@ public partial class Projectile : Node3D
var sfxPlayer = GetTree().Root.GetNode<AudioStreamPlayer>("Main/SFXPlayer");
sfxPlayer.Stream = _soundEffect;
sfxPlayer.Play();
_paths = new Array<Path3D>(GetChildren().OfType<Path3D>());
}
public override void _PhysicsProcess(double delta)
{
foreach (var paths in _paths)
{
var pathFollow = paths.GetChildren().OfType<PathFollow3D>().Single();
pathFollow.Progress += Speed * (float)delta;
if (pathFollow.ProgressRatio > 0.9f)
QueueFree();
}
var pathFollow = GetNode<PathFollow3D>("PathFollow3D");
pathFollow.Progress += Speed * (float)delta;
if (pathFollow.ProgressRatio > 0.9f)
QueueFree();
}
public void OnProjectileHit(Node node)
{
SetProcess(false);
if (node.GetParent() is BasicEnemy basicEnemy && basicEnemy.HasMethod(BasicEnemy.MethodName.OnEnemyHit))
basicEnemy.Call(BasicEnemy.MethodName.OnEnemyHit, node);
else
GD.Print("Hit something other than enemy: " + node.GetParent().Name);
_hitBox.QueueFree();
var sfxPlayer = GetTree().Root.GetNode<AudioStreamPlayer>("Main/SFXPlayer");
if (!sfxPlayer.Playing)
sfxPlayer.Play();
}
public float Speed { get; private set; }

View File

@@ -1,70 +1,85 @@
[gd_scene load_steps=6 format=3 uid="uid://5ce7ky4o0q2e"]
[gd_scene load_steps=8 format=3 uid="uid://5ce7ky4o0q2e"]
[ext_resource type="Texture2D" uid="uid://dha44dnvwhajo" path="res://Textures/Projectiles/Projectile_Capricorn.png" id="1_bvyt4"]
[ext_resource type="Script" path="res://Player/Base/Projectile.cs" id="1_ovnwu"]
[ext_resource type="AudioStream" uid="uid://bykwwct1not4e" path="res://Audio/SFX/capricorn laeser.wav" id="2_lofnw"]
[ext_resource type="AudioStream" uid="uid://cat08h84wm5gm" path="res://Audio/SFX/ominous.wav" id="3_h1ve3"]
[sub_resource type="Curve3D" id="Curve3D_bnc6v"]
[sub_resource type="Curve3D" id="Curve3D_bch55"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0.008, 1, -5),
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, -0.00347188, 1, 0.533723, 0, 0, 0, 0, 0, 0, 0.008, 1, -5),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[sub_resource type="CylinderShape3D" id="CylinderShape3D_bnunv"]
height = 7.40727
[sub_resource type="CylinderShape3D" id="CylinderShape3D_hebl4"]
height = 44.0041
radius = 0.419241
[node name="CapricornLaser" type="Node3D"]
[sub_resource type="Curve3D" id="Curve3D_ciqkc"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, -0.00347188, 1, 0.533723, 0, 0, 0, 0, 0, 0, 0.008, 1, -5),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[node name="CapricornAlt" type="Node3D"]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0)
[node name="Left Shot" type="Path3D" parent="."]
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0.105376, 0.772365, 1.51984)
top_level = true
curve = SubResource("Curve3D_bch55")
script = ExtResource("1_ovnwu")
Cooldown = 1.0
_projectileSpeed = 3.0
_projectileSpeed = 5.0
_soundEffect = ExtResource("2_lofnw")
_onHitSfx = ExtResource("3_h1ve3")
[node name="Forward Shot" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.25)
top_level = true
curve = SubResource("Curve3D_bnc6v")
[node name="PathFollow3D" type="PathFollow3D" parent="Forward Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 1, 0)
[node name="PathFollow3D" type="PathFollow3D" parent="Left Shot"]
transform = Transform3D(0.999997, 0, -0.00207308, 0, 1, 0, 0.00207308, 0, 0.999997, -0.00347188, 1, 0.533723)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Forward Shot/PathFollow3D"]
transform = Transform3D(-1, 0, -0.000800046, 0, 1, 0, 0.000800046, 0, -1, 0.000400023, -1, 0.5)
collision_layer = 34
collision_mask = 34
[node name="Hitbox" type="RigidBody3D" parent="Left Shot/PathFollow3D"]
transform = Transform3D(1, 0, -1.86265e-09, 0, 1, 0, 1.86265e-09, 0, 1, -0.00244793, 0.0059973, 0.293898)
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1
contact_monitor = true
can_sleep = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="Forward Shot/PathFollow3D/Hitbox"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Left Shot/PathFollow3D/Hitbox"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
shape = SubResource("CylinderShape3D_bnunv")
shape = SubResource("CylinderShape3D_hebl4")
[node name="Sprite3D2" type="Sprite3D" parent="Forward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.33, 0, 0.5)
[node name="Sprite3D2" type="Sprite3D" parent="Left Shot/PathFollow3D/Hitbox/CollisionShape3D"]
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -0.663415, 0, 0.752893)
centered = false
axis = 1
texture = ExtResource("1_bvyt4")
[node name="Backward Shot" type="Path3D" parent="."]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0.25)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.098024, 0.772365, -2.01984)
top_level = true
curve = SubResource("Curve3D_bnc6v")
curve = SubResource("Curve3D_ciqkc")
script = ExtResource("1_ovnwu")
Cooldown = 1.0
_projectileSpeed = 5.0
_soundEffect = ExtResource("2_lofnw")
_onHitSfx = ExtResource("3_h1ve3")
[node name="PathFollow3D" type="PathFollow3D" parent="Backward Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 1, 0)
transform = Transform3D(0.999997, 0, -0.00207308, 0, 1, 0, 0.00207308, 0, 0.999997, -0.00347188, 1, 0.533723)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Backward Shot/PathFollow3D"]
transform = Transform3D(-1, 0, -0.000800046, 0, 1, 0, 0.000800046, 0, -1, 0.000400023, -1, 0.5)
collision_layer = 34
collision_mask = 34
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.000400023, 0.00831366, 0.5)
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1
@@ -73,10 +88,13 @@ can_sleep = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="Backward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
shape = SubResource("CylinderShape3D_bnunv")
shape = SubResource("CylinderShape3D_hebl4")
[node name="Sprite3D2" type="Sprite3D" parent="Backward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.33, 0, 0.5)
centered = false
axis = 1
texture = ExtResource("1_bvyt4")
[connection signal="body_entered" from="Left Shot/PathFollow3D/Hitbox" to="Left Shot" method="OnProjectileHit" flags=18]
[connection signal="body_entered" from="Backward Shot/PathFollow3D/Hitbox" to="Left Shot" method="OnProjectileHit" flags=18]

View File

@@ -1,71 +1,87 @@
[gd_scene load_steps=6 format=3 uid="uid://cdsc35cj566q1"]
[gd_scene load_steps=8 format=3 uid="uid://cdsc35cj566q1"]
[ext_resource type="Script" path="res://Player/Base/Projectile.cs" id="1_tbx8y"]
[ext_resource type="Texture2D" uid="uid://dha44dnvwhajo" path="res://Textures/Projectiles/Projectile_Capricorn.png" id="2_8osg4"]
[ext_resource type="AudioStream" uid="uid://bykwwct1not4e" path="res://Audio/SFX/capricorn laeser.wav" id="2_jeoco"]
[ext_resource type="AudioStream" uid="uid://cat08h84wm5gm" path="res://Audio/SFX/ominous.wav" id="3_r2jj5"]
[sub_resource type="Curve3D" id="Curve3D_goxuk"]
[sub_resource type="Curve3D" id="Curve3D_usgyk"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0.008, 1, -5),
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, -0.00347188, 1, 0.533723, 0, 0, 0, 0, 0, 0, 0.008, 1, -5),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[sub_resource type="CylinderShape3D" id="CylinderShape3D_hebl4"]
height = 7.40727
height = 44.0041
radius = 0.419241
[sub_resource type="Curve3D" id="Curve3D_p2eme"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, -0.00347188, 1, 0.533723, 0, 0, 0, 0, 0, 0, 0.008, 1, -5),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[node name="CapricornLaser" type="Node3D"]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0)
[node name="Left Shot" type="Path3D" parent="." node_paths=PackedStringArray("_hitBox")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -1.66814, 0.772365, -0.25)
top_level = true
curve = SubResource("Curve3D_usgyk")
script = ExtResource("1_tbx8y")
Cooldown = 1.0
_projectileSpeed = 3.0
_projectileSpeed = 5.0
_soundEffect = ExtResource("2_jeoco")
_onHitSfx = ExtResource("3_r2jj5")
_hitBox = NodePath("PathFollow3D/Hitbox")
[node name="Forward Shot" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.25)
top_level = true
curve = SubResource("Curve3D_goxuk")
[node name="PathFollow3D" type="PathFollow3D" parent="Forward Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 1, 0)
[node name="PathFollow3D" type="PathFollow3D" parent="Left Shot"]
transform = Transform3D(0.999997, 0, -0.00207308, 0, 1, 0, 0.00207308, 0, 0.999997, -0.00347188, 1, 0.533723)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Forward Shot/PathFollow3D"]
transform = Transform3D(-1, 0, -0.000800046, 0, 1, 0, 0.000800046, 0, -1, 0.000400023, -1, 0.5)
collision_layer = 34
collision_mask = 34
[node name="Hitbox" type="RigidBody3D" parent="Left Shot/PathFollow3D"]
transform = Transform3D(1, 0, -1.86265e-09, 0, 1, 0, 1.86265e-09, 0, 1, -0.00244793, 0.0059973, 0.293898)
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1
contact_monitor = true
can_sleep = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="Forward Shot/PathFollow3D/Hitbox"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Left Shot/PathFollow3D/Hitbox"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
shape = SubResource("CylinderShape3D_hebl4")
[node name="Sprite3D2" type="Sprite3D" parent="Forward Shot/PathFollow3D/Hitbox"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.33, 0, 0.5)
[node name="Sprite3D2" type="Sprite3D" parent="Left Shot/PathFollow3D/Hitbox/CollisionShape3D"]
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -0.663415, 0, 0.752893)
centered = false
axis = 1
texture = ExtResource("2_8osg4")
[node name="Backward Shot" type="Path3D" parent="."]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0.25)
[node name="Backward Shot" type="Path3D" parent="." node_paths=PackedStringArray("_hitBox")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 1.87154, 0.772365, -0.25)
top_level = true
curve = SubResource("Curve3D_goxuk")
curve = SubResource("Curve3D_p2eme")
script = ExtResource("1_tbx8y")
Cooldown = 1.0
_projectileSpeed = 5.0
_soundEffect = ExtResource("2_jeoco")
_onHitSfx = ExtResource("3_r2jj5")
_hitBox = NodePath("../Left Shot/PathFollow3D/Hitbox")
[node name="PathFollow3D" type="PathFollow3D" parent="Backward Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 1, 0)
transform = Transform3D(0.999997, 0, -0.00207308, 0, 1, 0, 0.00207308, 0, 0.999997, -0.00347188, 1, 0.533723)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Backward Shot/PathFollow3D"]
transform = Transform3D(-1, 0, -0.000800046, 0, 1, 0, 0.000800046, 0, -1, 0.000400023, -1, 0.5)
collision_layer = 34
collision_mask = 34
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.000400023, 0.00831366, 0.5)
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1
@@ -81,3 +97,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.33, 0, 0.5)
centered = false
axis = 1
texture = ExtResource("2_8osg4")
[connection signal="body_entered" from="Left Shot/PathFollow3D/Hitbox" to="Left Shot" method="OnProjectileHit"]
[connection signal="body_entered" from="Backward Shot/PathFollow3D/Hitbox" to="Left Shot" method="OnProjectileHit"]

View File

@@ -216,11 +216,12 @@ size = Vector3(0.856928, 1.65704, 0.82877)
[node name="Capricorn" type="CharacterBody3D" groups=["Player"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.408962, 0)
collision_layer = 25
collision_layer = 0
collision_mask = 0
motion_mode = 1
script = ExtResource("1_aqn5t")
_fireProjectile = ExtResource("2_e6qos")
_altFireProjectile = ExtResource("3_wbhxk")
_fireProjectile = ExtResource("3_wbhxk")
_altFireProjectile = ExtResource("2_e6qos")
_speed = 1.0
[node name="Pivot" type="Node3D" parent="."]
@@ -238,8 +239,8 @@ shape = SubResource("BoxShape3D_r4spg")
[node name="Area3D" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 1.43031, 0)
disable_mode = 2
collision_layer = 16
collision_mask = 4100
collision_layer = 0
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 0, 0)

View File

@@ -1,4 +1,5 @@
using Godot;
using System.Linq;
public partial class CapricornControls : Character
{
@@ -84,10 +85,10 @@ public partial class CapricornControls : Character
{
IsShooting = true;
CanShoot = false;
var projectile = projectileScene.Instantiate<Projectile>();
await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout");
projectile.Position = Position + new Vector3(0f, 1f, 0f);
projectile.ParentCharacter = this;
var projectile = projectileScene.Instantiate<Node3D>();
var projectileCooldown = projectile.GetChildren().OfType<Projectile>().First();
await ToSignal(GetTree().CreateTimer(projectileCooldown.Cooldown), "timeout");
projectile.Position = Position;
GetParent().AddChild(projectile);
CanShoot = true;
IsShooting = false;

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=3 uid="uid://bq40xbqibrk1y"]
[gd_scene load_steps=7 format=3 uid="uid://bq40xbqibrk1y"]
[ext_resource type="Script" path="res://Player/Base/Projectile.cs" id="1_ivbjp"]
[ext_resource type="Texture2D" uid="uid://crlvrwo2l11ja" path="res://Textures/Projectiles/Projectile_Pisces_MultiAttack.png" id="2_a612r"]
[ext_resource type="AudioStream" uid="uid://cw1jlubd7wmw6" path="res://Audio/SFX/blue laser.wav" id="2_oxtlx"]
[ext_resource type="AudioStream" uid="uid://cat08h84wm5gm" path="res://Audio/SFX/ominous.wav" id="4_2g102"]
[sub_resource type="Curve3D" id="Curve3D_h8ghr"]
_data = {
@@ -12,28 +13,32 @@ _data = {
point_count = 2
[sub_resource type="CylinderShape3D" id="CylinderShape3D_ebbqv"]
height = 13.6565
radius = 0.3
[node name="ShotgunBullet" type="Node3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.73894, 0)
script = ExtResource("1_ivbjp")
Cooldown = 1.0
_soundEffect = ExtResource("2_oxtlx")
[node name="Center Shot" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.25)
[node name="Center Shot" type="Path3D" parent="." node_paths=PackedStringArray("_hitBox")]
transform = Transform3D(0.999968, 0, -0.00802843, 0, 1, 0, 0.00802843, 0, 0.999968, -0.0325268, 0, -0.821681)
top_level = true
curve = SubResource("Curve3D_h8ghr")
script = ExtResource("1_ivbjp")
Cooldown = 0.5
_projectileSpeed = 3.0
_soundEffect = ExtResource("2_oxtlx")
_onHitSfx = ExtResource("4_2g102")
_hitBox = NodePath("PathFollow3D/Hitbox")
[node name="PathFollow3D" type="PathFollow3D" parent="Center Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 0, 0)
transform = Transform3D(0.999998, 0, -0.0016, 0, 1, 0, 0.0016, 0, 0.999998, 0, 0, 0)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Center Shot/PathFollow3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00512208, 0, 0.096)
collision_layer = 34
collision_mask = 34
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1000
@@ -48,20 +53,26 @@ shape = SubResource("CylinderShape3D_ebbqv")
axis = 1
texture = ExtResource("2_a612r")
[node name="Left Shot" type="Path3D" parent="."]
transform = Transform3D(0.984808, 0, 0.173648, 0, 1, 0, -0.173648, 0, 0.984808, -0.462206, 0, -0.1)
[node name="Left Shot" type="Path3D" parent="." node_paths=PackedStringArray("_hitBox")]
transform = Transform3D(0.970524, 0, 0.241007, 0, 1, 0, -0.241007, 0, 0.970524, -0.444877, 0, -0.564578)
top_level = true
curve = SubResource("Curve3D_h8ghr")
script = ExtResource("1_ivbjp")
Cooldown = 0.5
_projectileSpeed = 3.0
_soundEffect = ExtResource("2_oxtlx")
_onHitSfx = ExtResource("4_2g102")
_hitBox = NodePath("PathFollow3D/Hitbox")
[node name="PathFollow3D" type="PathFollow3D" parent="Left Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 0, 0)
transform = Transform3D(0.999998, 0, -0.0016, 0, 1, 0, 0.0016, 0, 0.999998, 0, 0, 0)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Left Shot/PathFollow3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03827, 0, 0.0309103)
collision_layer = 34
collision_mask = 34
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1000
@@ -76,20 +87,26 @@ shape = SubResource("CylinderShape3D_ebbqv")
axis = 1
texture = ExtResource("2_a612r")
[node name="Right Shot" type="Path3D" parent="."]
transform = Transform3D(0.984808, 0, -0.173648, 0, 1, 0, 0.173648, 0, 0.984808, 0.426491, 0, 0)
[node name="Right Shot" type="Path3D" parent="." node_paths=PackedStringArray("_hitBox")]
transform = Transform3D(0.95246, 0, -0.304665, 0, 1, 0, 0.304665, 0, 0.95246, 0.441688, 0, -0.681987)
top_level = true
curve = SubResource("Curve3D_h8ghr")
script = ExtResource("1_ivbjp")
Cooldown = 0.5
_projectileSpeed = 3.0
_soundEffect = ExtResource("2_oxtlx")
_onHitSfx = ExtResource("4_2g102")
_hitBox = NodePath("PathFollow3D/Hitbox")
[node name="PathFollow3D" type="PathFollow3D" parent="Right Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 0, 0)
transform = Transform3D(0.999998, 0, -0.0016, 0, 1, 0, 0.0016, 0, 0.999998, 0, 0, 0)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Right Shot/PathFollow3D"]
transform = Transform3D(-1, 0, -0.00159994, 0, 1, 0, 0.00159994, 0, -1, -0.06, 0, 0.096)
collision_layer = 34
collision_mask = 34
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1000
@@ -103,3 +120,7 @@ shape = SubResource("CylinderShape3D_ebbqv")
[node name="Sprite3D" type="Sprite3D" parent="Right Shot/PathFollow3D/Hitbox/CollisionShape3D"]
axis = 1
texture = ExtResource("2_a612r")
[connection signal="body_entered" from="Center Shot/PathFollow3D/Hitbox" to="Center Shot" method="OnProjectileHit"]
[connection signal="body_entered" from="Left Shot/PathFollow3D/Hitbox" to="Left Shot" method="OnProjectileHit"]
[connection signal="body_entered" from="Right Shot/PathFollow3D/Hitbox" to="Right Shot" method="OnProjectileHit"]

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=3 uid="uid://cyn2wn6ffsnu7"]
[gd_scene load_steps=7 format=3 uid="uid://cyn2wn6ffsnu7"]
[ext_resource type="Script" path="res://Player/Base/Projectile.cs" id="1_62kpd"]
[ext_resource type="AudioStream" uid="uid://cw1jlubd7wmw6" path="res://Audio/SFX/blue laser.wav" id="2_7lbn3"]
[ext_resource type="Texture2D" uid="uid://kecmkchurnin" path="res://Textures/Projectiles/Projectile_Pisces_SingleAttack.png" id="2_d8lwd"]
[ext_resource type="AudioStream" uid="uid://cat08h84wm5gm" path="res://Audio/SFX/ominous.wav" id="3_xqtbw"]
[sub_resource type="Curve3D" id="Curve3D_do6j1"]
_data = {
@@ -12,30 +13,33 @@ _data = {
point_count = 2
[sub_resource type="CylinderShape3D" id="CylinderShape3D_njobr"]
height = 11.931
radius = 0.3
[node name="Single" type="Node3D"]
script = ExtResource("1_62kpd")
Cooldown = 1.0
_soundEffect = ExtResource("2_7lbn3")
[node name="Center Shot" type="Path3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -0.25)
[node name="Center Shot" type="Path3D" parent="." node_paths=PackedStringArray("_hitBox")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -0.620083)
top_level = true
curve = SubResource("Curve3D_do6j1")
script = ExtResource("1_62kpd")
Cooldown = 0.5
_projectileSpeed = 3.0
_soundEffect = ExtResource("2_7lbn3")
_onHitSfx = ExtResource("3_xqtbw")
_hitBox = NodePath("PathFollow3D/Hitbox")
[node name="PathFollow3D" type="PathFollow3D" parent="Center Shot"]
transform = Transform3D(-0.999998, 0, 0.00159994, 0, 1, 0, -0.00159994, 0, -0.999998, 0, 0, 0)
transform = Transform3D(0.999998, 0, -0.0016, 0, 1, 0, 0.0016, 0, 0.999998, 0, 0, 0)
loop = false
tilt_enabled = false
[node name="Hitbox" type="RigidBody3D" parent="Center Shot/PathFollow3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
collision_layer = 34
collision_mask = 34
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1000
max_contacts_reported = 1
contact_monitor = true
can_sleep = false
@@ -48,3 +52,5 @@ transform = Transform3D(1, 0, -3.55271e-14, 0, 1, 0, 3.55271e-14, 0, 1, -0.29984
centered = false
axis = 1
texture = ExtResource("2_d8lwd")
[connection signal="body_entered" from="Center Shot/PathFollow3D/Hitbox" to="Center Shot" method="OnProjectileHit"]

View File

@@ -14,7 +14,8 @@ height = 1.67894
[node name="Pisces" type="CharacterBody3D" groups=["Player"]]
transform = Transform3D(0.33, 0, 0, 0, 0.33, 0, 0, 0, 0.33, 0, 0.332056, 0)
collision_layer = 25
collision_layer = 0
collision_mask = 0
motion_mode = 1
script = ExtResource("1_gp8nm")
_fireProjectile = ExtResource("2_rsvhh")
@@ -26,8 +27,8 @@ _altFireProjectile = ExtResource("3_5m8tq")
[node name="Area3D" type="Area3D" parent="Pivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 0, 0)
collision_layer = 16
collision_mask = 4100
collision_layer = 0
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pivot/Area3D"]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0.0162379, 2.20309, -0.302385)

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=3 uid="uid://criqb4bokctlr"]
[gd_scene load_steps=7 format=3 uid="uid://criqb4bokctlr"]
[ext_resource type="Script" path="res://Player/Base/Projectile.cs" id="1_6e1or"]
[ext_resource type="Texture2D" uid="uid://cferkvvp0rjht" path="res://Textures/Projectiles/Projectile_Sagittarius.png" id="1_57flt"]
[ext_resource type="Script" path="res://Player/Sagittarius/Attacks/MegamiBeamShot.cs" id="1_a146o"]
[ext_resource type="AudioStream" uid="uid://m8mvw8acs5sk" path="res://Audio/SFX/Green Wave.wav" id="2_vvcho"]
[ext_resource type="AudioStream" uid="uid://cat08h84wm5gm" path="res://Audio/SFX/ominous.wav" id="3_12vsu"]
[sub_resource type="Curve3D" id="Curve3D_7ok4f"]
_data = {
@@ -15,27 +16,28 @@ point_count = 2
height = 9.57027
radius = 0.57027
[node name="MegamiBeam" type="Node3D" node_paths=PackedStringArray("_pathFollow")]
script = ExtResource("1_a146o")
_pathFollow = NodePath("Path3D/PathFollow3D")
_soundEffect = ExtResource("2_vvcho")
Cooldown = 3.0
_projectileSpeed = 3.0
_soundEffect = ExtResource("2_vvcho")
[node name="MegamiBeam" type="Node3D"]
[node name="Path3D" type="Path3D" parent="."]
[node name="Path3D" type="Path3D" parent="." node_paths=PackedStringArray("_hitBox")]
top_level = true
curve = SubResource("Curve3D_7ok4f")
script = ExtResource("1_6e1or")
Cooldown = 2.0
_projectileSpeed = 3.0
_soundEffect = ExtResource("2_vvcho")
_onHitSfx = ExtResource("3_12vsu")
_hitBox = NodePath("PathFollow3D/Beam")
HasRotation = true
[node name="PathFollow3D" type="PathFollow3D" parent="Path3D"]
transform = Transform3D(-0.999999, 0, 0.000800045, 0, 1, 0, -0.000800045, 0, -0.999999, 0, 1, 0)
transform = Transform3D(0.999999, 0, -0.000799999, 0, 1, 0, 0.000799999, 0, 0.999999, 0, 1, 0)
loop = false
tilt_enabled = false
[node name="Beam" type="RigidBody3D" parent="Path3D/PathFollow3D"]
transform = Transform3D(-1, 0, -8.74229e-08, 0, 1, 0, 8.74229e-08, 0, -1, 0, 0, 0)
collision_layer = 34
collision_mask = 34
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
max_contacts_reported = 1000
@@ -43,10 +45,12 @@ contact_monitor = true
can_sleep = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="Path3D/PathFollow3D/Beam"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
transform = Transform3D(0.5, 0, 5.82077e-11, 0, 0.5, 0, -5.82077e-11, 0, 0.5, 0.000155393, 0, 0.194262)
shape = SubResource("CylinderShape3D_bnunv")
[node name="Sprite3D2" type="Sprite3D" parent="Path3D/PathFollow3D/Beam"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00355998, 0, 0.140453)
transform = Transform3D(-1, 0, 0.000663249, 0, 1, 0, -0.000663249, 0, -1, -0.00355998, 0, 0.140453)
axis = 1
texture = ExtResource("1_57flt")
[connection signal="body_entered" from="Path3D/PathFollow3D/Beam" to="Path3D" method="OnProjectileHit"]

View File

@@ -1,31 +0,0 @@
using Godot;
using System.Linq;
public partial class MegamiBeamShot : Projectile
{
[Export]
private PathFollow3D _pathFollow;
[Export]
public new AudioStream _soundEffect;
public override void _Ready()
{
_pathFollow = GetNode<PathFollow3D>("Path3D/PathFollow3D");
_pathFollow.GetParentNode3D().Rotation = ParentCharacter.GetNode<Node3D>("Pivot").Rotation;
var sfxPlayer = GetTree().Root.GetNode<AudioStreamPlayer>("Main/SFXPlayer");
sfxPlayer.Stream = _soundEffect;
sfxPlayer.Play();
}
public override void _PhysicsProcess(double delta)
{
_pathFollow.Progress += 10f * (float)delta;
if (Mathf.IsEqualApprox(_pathFollow.ProgressRatio, 1.0f))
QueueFree();
}
private void OnBulletHitObject(Node node)
{
QueueFree();
}
}

View File

@@ -607,7 +607,8 @@ radius = 0.25
[node name="Sagittarius" type="CharacterBody3D" groups=["Player"]]
transform = Transform3D(0.9, 0, 0, 0, 0.9, 0, 0, 0, 0.9, 0, 0.559088, 0)
collision_layer = 25
collision_layer = 0
collision_mask = 0
motion_mode = 1
wall_min_slide_angle = 3.14159
script = ExtResource("1_s1hsr")
@@ -618,8 +619,8 @@ _altFireProjectile = ExtResource("2_c3ma7")
[node name="Area3D" type="Area3D" parent="Pivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 0, 0)
collision_layer = 16
collision_mask = 4100
collision_layer = 0
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pivot/Area3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.125003, 0.637504, 0.112771)

View File

@@ -7,6 +7,7 @@ public partial class CutterShot : Projectile
public override void _Process(double delta)
{
_sprite.RotateY(25);
if (!IsQueuedForDeletion())
_sprite.RotateY(25);
}
}

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=3 uid="uid://cxnek5wgpxbft"]
[gd_scene load_steps=7 format=3 uid="uid://cxnek5wgpxbft"]
[ext_resource type="Script" path="res://Player/Scorpio/Attacks/CutterShot.cs" id="1_inha4"]
[ext_resource type="Texture2D" uid="uid://cdryxdasvun4r" path="res://Textures/Projectiles/Projectile_Scorpio.png" id="2_tqxh6"]
[ext_resource type="AudioStream" uid="uid://ce40y3hln3twm" path="res://Audio/SFX/grass cutter.wav" id="2_u4aoe"]
[ext_resource type="AudioStream" uid="uid://cat08h84wm5gm" path="res://Audio/SFX/ominous.wav" id="3_32sc2"]
[sub_resource type="Curve3D" id="Curve3D_5hmi4"]
_data = {
@@ -14,24 +15,27 @@ point_count = 4
[sub_resource type="CylinderShape3D" id="CylinderShape3D_mgm2i"]
height = 8.481
[node name="CutterShot" type="Node3D" node_paths=PackedStringArray("_sprite")]
script = ExtResource("1_inha4")
_sprite = NodePath("Path3D/PathFollow3D/RigidBody3D/CollisionShape3D/Sprite3D")
Cooldown = 0.3
_projectileSpeed = 3.0
_soundEffect = ExtResource("2_u4aoe")
[node name="CutterShot" type="Node3D"]
[node name="Path3D" type="Path3D" parent="."]
[node name="Path3D" type="Path3D" parent="." node_paths=PackedStringArray("_sprite", "_hitBox")]
top_level = true
curve = SubResource("Curve3D_5hmi4")
script = ExtResource("1_inha4")
_sprite = NodePath("PathFollow3D/RigidBody3D/CollisionShape3D/Sprite3D")
Cooldown = 0.7
_projectileSpeed = 4.0
_soundEffect = ExtResource("2_u4aoe")
_onHitSfx = ExtResource("3_32sc2")
_hitBox = NodePath("PathFollow3D/RigidBody3D")
[node name="PathFollow3D" type="PathFollow3D" parent="Path3D"]
transform = Transform3D(-0.782564, 0, 0.622568, 0, 1, 0, -0.622568, 0, -0.782564, 0, 1, 0)
transform = Transform3D(0.782564, 0, -0.622568, 0, 1, 0, 0.622568, 0, 0.782564, 0, 1, 0)
loop = false
tilt_enabled = false
[node name="RigidBody3D" type="RigidBody3D" parent="Path3D/PathFollow3D"]
collision_layer = 2
transform = Transform3D(1, 0, 2.98023e-08, 0, 1, 0, -2.98023e-08, 0, 1, 0, 0, 0)
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
@@ -49,3 +53,5 @@ pixel_size = 0.03
axis = 1
double_sided = false
texture = ExtResource("2_tqxh6")
[connection signal="body_entered" from="Path3D/PathFollow3D/RigidBody3D" to="Path3D" method="OnProjectileHit"]

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=3 uid="uid://cwt4rum7tvyvb"]
[gd_scene load_steps=7 format=3 uid="uid://cwt4rum7tvyvb"]
[ext_resource type="Script" path="res://Player/Scorpio/Attacks/CutterShot.cs" id="1_7xtlh"]
[ext_resource type="Texture2D" uid="uid://cdryxdasvun4r" path="res://Textures/Projectiles/Projectile_Scorpio.png" id="2_6mabu"]
[ext_resource type="AudioStream" uid="uid://ce40y3hln3twm" path="res://Audio/SFX/grass cutter.wav" id="2_qmvk7"]
[ext_resource type="AudioStream" uid="uid://cat08h84wm5gm" path="res://Audio/SFX/ominous.wav" id="3_v1t2f"]
[sub_resource type="Curve3D" id="Curve3D_5hmi4"]
_data = {
@@ -14,24 +15,27 @@ point_count = 4
[sub_resource type="CylinderShape3D" id="CylinderShape3D_mgm2i"]
height = 8.481
[node name="CutterShot" type="Node3D" node_paths=PackedStringArray("_sprite")]
script = ExtResource("1_7xtlh")
_sprite = NodePath("Path3D/PathFollow3D/RigidBody3D/CollisionShape3D/Sprite3D")
Cooldown = 0.3
_projectileSpeed = 3.0
_soundEffect = ExtResource("2_qmvk7")
[node name="CutterAlt" type="Node3D"]
[node name="Path3D" type="Path3D" parent="."]
[node name="CutterShot" type="Path3D" parent="." node_paths=PackedStringArray("_sprite", "_hitBox")]
top_level = true
curve = SubResource("Curve3D_5hmi4")
script = ExtResource("1_7xtlh")
_sprite = NodePath("PathFollow3D/RigidBody3D/CollisionShape3D/Sprite3D")
Cooldown = 0.7
_projectileSpeed = 4.0
_soundEffect = ExtResource("2_qmvk7")
_onHitSfx = ExtResource("3_v1t2f")
_hitBox = NodePath("PathFollow3D/RigidBody3D")
[node name="PathFollow3D" type="PathFollow3D" parent="Path3D"]
transform = Transform3D(-0.782564, 0, -0.622568, 0, 1, 0, 0.622568, 0, -0.782564, 0, 1, 0)
[node name="PathFollow3D" type="PathFollow3D" parent="CutterShot"]
transform = Transform3D(0.782564, 0, 0.622568, 0, 1, 0, -0.622568, 0, 0.782564, 0, 1, 0)
loop = false
tilt_enabled = false
[node name="RigidBody3D" type="RigidBody3D" parent="Path3D/PathFollow3D"]
collision_layer = 2
[node name="RigidBody3D" type="RigidBody3D" parent="CutterShot/PathFollow3D"]
transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 0, 0, 0)
collision_layer = 0
collision_mask = 0
gravity_scale = 0.0
continuous_cd = true
@@ -39,13 +43,15 @@ max_contacts_reported = 100
contact_monitor = true
can_sleep = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="Path3D/PathFollow3D/RigidBody3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="CutterShot/PathFollow3D/RigidBody3D"]
transform = Transform3D(0.999999, 0, 5.96046e-08, 0, 1, 0, -5.96046e-08, 0, 0.999999, 0, 0, 0)
shape = SubResource("CylinderShape3D_mgm2i")
[node name="Sprite3D" type="Sprite3D" parent="Path3D/PathFollow3D/RigidBody3D/CollisionShape3D"]
[node name="Sprite3D" type="Sprite3D" parent="CutterShot/PathFollow3D/RigidBody3D/CollisionShape3D"]
transform = Transform3D(0.156513, 0, 0.124514, 0, 0.2, 0, -0.124514, 0, 0.156513, 0, 0, 0)
pixel_size = 0.03
axis = 1
double_sided = false
texture = ExtResource("2_6mabu")
[connection signal="body_entered" from="CutterShot/PathFollow3D/RigidBody3D" to="CutterShot" method="OnProjectileHit"]

View File

@@ -13,7 +13,8 @@ size = Vector3(0.822782, 0.853857, 0.80108)
[node name="Scorpio" type="CharacterBody3D" groups=["Player"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.55696, 0)
collision_layer = 9
collision_layer = 0
collision_mask = 0
motion_mode = 1
slide_on_ceiling = false
script = ExtResource("1_gw30u")
@@ -24,8 +25,8 @@ _altFireProjectile = ExtResource("3_tw078")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.496155, 0)
[node name="Area3D" type="Area3D" parent="Pivot"]
collision_layer = 16
collision_mask = 4100
collision_layer = 0
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pivot/Area3D"]
shape = SubResource("BoxShape3D_wqp0e")