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-05 01:13:14 +00:00
|
|
|
[Export]
|
2024-10-04 12:53:34 +00:00
|
|
|
private string? _projectilePath;
|
|
|
|
|
2024-10-06 08:10:00 +00:00
|
|
|
/// <summary>
|
|
|
|
/// <para>Spells do no collision damage</para>
|
|
|
|
/// <para>法术没有碰撞伤害</para>
|
|
|
|
/// </summary>
|
|
|
|
public override bool EnableContactInjury
|
|
|
|
{
|
|
|
|
get => false;
|
|
|
|
set { }
|
|
|
|
}
|
|
|
|
|
2024-10-04 12:53:34 +00:00
|
|
|
private PackedScene? _projectileScene;
|
|
|
|
public override void _Ready()
|
|
|
|
{
|
|
|
|
base._Ready();
|
2024-10-08 01:26:11 +00:00
|
|
|
if (!string.IsNullOrEmpty(_projectilePath))
|
2024-10-04 12:53:34 +00:00
|
|
|
{
|
|
|
|
_projectileScene = GD.Load<PackedScene>(_projectilePath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-04 02:21:09 +00:00
|
|
|
public override int ItemType
|
|
|
|
{
|
2024-10-05 01:13:14 +00:00
|
|
|
get => Config.ItemType.Spell;
|
2024-10-04 02:21:09 +00:00
|
|
|
}
|
2024-10-04 12:53:34 +00:00
|
|
|
|
|
|
|
public PackedScene? GetProjectile()
|
|
|
|
{
|
|
|
|
return _projectileScene;
|
|
|
|
}
|
|
|
|
|
2024-10-05 08:19:31 +00:00
|
|
|
public virtual void ModifyWeapon(ProjectileWeapon projectileWeapon)
|
2024-10-04 12:53:34 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-10-05 08:19:31 +00:00
|
|
|
public virtual void RestoreWeapon(ProjectileWeapon projectileWeapon)
|
2024-10-04 12:53:34 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-10-05 08:19:31 +00:00
|
|
|
public virtual void ModifyProjectile(int index, Projectile projectile, ref Vector2 velocity)
|
2024-10-04 12:53:34 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2024-10-04 02:21:09 +00:00
|
|
|
}
|