Initial commit
This commit is contained in:
27
Characters/Wizard/Wizard.cs
Normal file
27
Characters/Wizard/Wizard.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using Godot;
|
||||
|
||||
public partial class Wizard : CharacterBase
|
||||
{
|
||||
[Export] public PackedScene Projectile { get; set; } = default!;
|
||||
|
||||
public override string[] _GetConfigurationWarnings()
|
||||
{
|
||||
var strings = new List<string>();
|
||||
|
||||
if (!Projectile?.CanInstantiate() ?? true)
|
||||
{
|
||||
strings.Add("Projectile is not set or invalid scene.");
|
||||
}
|
||||
|
||||
return [.. strings];
|
||||
}
|
||||
|
||||
protected override void _UsePrimary()
|
||||
{
|
||||
var projectile = Projectile.Instantiate<ProjectileBase>();
|
||||
|
||||
projectile.Spawn(this);
|
||||
GetTree().CurrentScene.AddChild(projectile);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user