2024-10-05 01:13:14 +00:00
|
|
|
using ColdMint.scripts.pickable;
|
2024-10-04 12:53:34 +00:00
|
|
|
using ColdMint.scripts.projectile;
|
|
|
|
using ColdMint.scripts.weapon;
|
|
|
|
using Godot;
|
|
|
|
|
2024-10-05 01:13:14 +00:00
|
|
|
namespace ColdMint.scripts.spell;
|
2024-10-04 02:21:09 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2024-10-04 12:53:34 +00:00
|
|
|
/// <para>magic</para>
|
2024-10-04 02:21:09 +00:00
|
|
|
/// <para>法术</para>
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>
|
2024-10-04 12:53:34 +00:00
|
|
|
///<para>For projectile weapons</para>
|
2024-10-04 02:21:09 +00:00
|
|
|
///<para>用于抛射体武器</para>
|
|
|
|
/// </remarks>
|
2024-10-05 01:13:14 +00:00
|
|
|
public partial class SpellPickAble : PickAbleTemplate, ISpell
|
2024-10-04 02:21:09 +00:00
|
|
|
{
|
2024-10-12 02:57:58 +00:00
|
|
|
[Export]
|
|
|
|
private string? _projectilePath;
|
2024-10-04 12:53:34 +00:00
|
|
|
|
2024-10-12 02:57:58 +00:00
|
|
|
private PackedScene? _projectileScene;
|
2024-10-04 12:53:34 +00:00
|
|
|
|
2024-10-12 02:57:58 +00:00
|
|
|
public override int ItemType
|
|
|
|
{
|
|
|
|
get => Config.ItemType.Spell;
|
|
|
|
}
|
2024-10-04 12:53:34 +00:00
|
|
|
|
2024-10-12 02:57:58 +00:00
|
|
|
public PackedScene? GetProjectile()
|
|
|
|
{
|
|
|
|
return _projectileScene;
|
|
|
|
}
|
2024-10-04 12:53:34 +00:00
|
|
|
|
2024-10-11 09:22:31 +00:00
|
|
|
|
2024-10-12 02:57:58 +00:00
|
|
|
public override void LoadResource()
|
|
|
|
{
|
|
|
|
base.LoadResource();
|
|
|
|
if (_projectileScene == null && !string.IsNullOrEmpty(_projectilePath))
|
|
|
|
{
|
|
|
|
_projectileScene = ResourceLoader.Load<PackedScene>(_projectilePath);
|
|
|
|
}
|
|
|
|
}
|
2024-10-11 09:22:31 +00:00
|
|
|
|
2024-10-09 08:51:03 +00:00
|
|
|
|
2024-10-12 02:57:58 +00:00
|
|
|
public virtual void ModifyWeapon(ProjectileWeapon projectileWeapon)
|
|
|
|
{
|
2024-10-04 12:53:34 +00:00
|
|
|
|
2024-10-12 02:57:58 +00:00
|
|
|
}
|
2024-10-04 12:53:34 +00:00
|
|
|
|
2024-10-12 02:57:58 +00:00
|
|
|
public virtual void RestoreWeapon(ProjectileWeapon projectileWeapon)
|
|
|
|
{
|
2024-10-04 12:53:34 +00:00
|
|
|
|
2024-10-12 02:57:58 +00:00
|
|
|
}
|
2024-10-04 12:53:34 +00:00
|
|
|
|
2024-10-12 02:57:58 +00:00
|
|
|
public virtual void ModifyProjectile(int index, Projectile projectile, ref Vector2 velocity)
|
|
|
|
{
|
2024-10-04 12:53:34 +00:00
|
|
|
|
2024-10-12 02:57:58 +00:00
|
|
|
}
|
|
|
|
}
|