Add attack patterns for boss
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user