28 lines
599 B
C#
28 lines
599 B
C#
using System.Collections.Generic;
|
|
using Godot;
|
|
|
|
public partial class Knight : CharacterBase
|
|
{
|
|
[Export] public PackedScene Weapon { get; set; } = default!;
|
|
|
|
public override string[] _GetConfigurationWarnings()
|
|
{
|
|
var strings = new List<string>();
|
|
|
|
if (!Weapon?.CanInstantiate() ?? true)
|
|
{
|
|
strings.Add("Weapon is not set or invalid scene.");
|
|
}
|
|
|
|
return [.. strings];
|
|
}
|
|
|
|
protected override void _UsePrimary()
|
|
{
|
|
var weapon = Weapon.Instantiate<MeleeBase>();
|
|
|
|
weapon.Spawn(this);
|
|
AddChild(weapon);
|
|
}
|
|
}
|