Add attack patterns for boss

This commit is contained in:
2023-09-11 20:01:18 -07:00
parent 4d8fbda71b
commit a5d36734ef
26 changed files with 394 additions and 36 deletions

View File

@@ -101,6 +101,7 @@ public partial class Character : CharacterBody3D
public void OnHit(Node3D node)
{
OwnerPlayer.SelectedCharacter.Position = new Vector3(0, 0, -20);
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, OwnerPlayer);
}
}

View File

@@ -1,5 +1,4 @@
using Godot;
using System;
public partial class Projectile : Node3D
{
@@ -37,6 +36,19 @@ public partial class Projectile : Node3D
Delete();
}
public void OnPlayerHit(Node node)
{
SetPhysicsProcess(false);
if (node is Character character && character.HasMethod(Character.MethodName.OnHit))
{
GD.Print("Player hit: " + character.Name);
character.Call(Character.MethodName.OnHit, this);
}
QueueFree();
}
public void Delete()
{
if (!isDeleted)

View File

@@ -6,7 +6,7 @@
[sub_resource type="Curve3D" id="Curve3D_7ok4f"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, -0.0755615, 2.8497, -5.04305, 0, 0, 0, 0, 0, 0, 0, 1, -10),
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 2, -3, 0, 0, 0, 0, 0, 0, 0, 1, -5),
"tilts": PackedFloat32Array(0, 0, 0)
}
point_count = 3
@@ -28,7 +28,8 @@ _projectileSpeed = 3.0
HasRotation = true
[node name="PathFollow3D" type="PathFollow3D" parent="Path3D"]
transform = Transform3D(0.999818, 0.00777275, 0.0169926, 4.65658e-10, 0.909374, -0.415969, -0.0186858, 0.415894, 0.909219, 0, 1, -1)
transform = Transform3D(0.999993, 0, 0, 0, 0.999995, 0, 0, 0, 0.999999, 0, 1, -1)
rotation_mode = 0
loop = false
tilt_enabled = false