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)