3D Boss scripts implementation

This commit is contained in:
Marco 2025-06-30 17:28:19 +02:00
commit dbf7f1a963
29 changed files with 1805 additions and 1188 deletions

View file

@ -0,0 +1,47 @@
using System.Threading.Tasks;
using Cirno.Scripts.Resources;
using Godot;
namespace Cirno.Scripts.AttackPatterns;
[GlobalClass]
[Tool]
public partial class WaitPattern : AttackPattern
{
[Export] public float SecondsToWait = 1f;
public override IPatternMachine MakeMachine(Node parent)
{
return new WaitPatternMachine(this, parent);
}
public class WaitPatternMachine(WaitPattern pattern, Node parent) : IPatternMachine
{
public Node Parent => parent;
private bool _isComplete = false;
protected IScriptHost3D Boss;
public void Start()
{
_isComplete = false;
_ = WaitAsync(pattern.SecondsToWait);
}
public void UpdatePattern(double delta)
{
}
private async Task WaitAsync(float time)
{
await Task.Delay((int)time * 1000);
_isComplete = true;
}
public bool IsComplete()
{
return _isComplete;
}
}
}

View file

@ -0,0 +1 @@
uid://cg7gi3tva4gvw