52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using Chickensoft.AutoInject;
|
|
using Chickensoft.Introspection;
|
|
using Chickensoft.Serialization;
|
|
using Godot;
|
|
using Zennysoft.Ma.Adapter;
|
|
|
|
namespace Zennysoft.Game.Ma;
|
|
|
|
[Meta(typeof(IAutoNode)), Id("weapon")]
|
|
public partial class Weapon : EquipableItem
|
|
{
|
|
public override void _Notification(int what) => this.Notify(what);
|
|
|
|
[Node] private Sprite3D _sprite { get; set; } = default!;
|
|
|
|
public override void _Ready()
|
|
{
|
|
_sprite.Texture = Stats.Texture;
|
|
}
|
|
|
|
public override string ItemName => Stats.Name;
|
|
|
|
public override string Description => Stats.Description;
|
|
|
|
public override float SpawnRate => Stats.SpawnRate;
|
|
|
|
public int Damage => Stats.Damage;
|
|
|
|
public override double ThrowDamage => Stats.ThrowDamage;
|
|
|
|
public override float ThrowSpeed => Stats.ThrowSpeed;
|
|
|
|
public double Luck => Stats.Luck;
|
|
|
|
public double AttackSpeed => Stats.AttackSpeed;
|
|
|
|
public WeaponTag WeaponTag => Stats.WeaponTag;
|
|
|
|
public override ItemTag ItemTag => Stats.ItemTag;
|
|
|
|
public ElementType WeaponElement => Stats.WeaponElement;
|
|
|
|
public double ElementalDamageBonus => Stats.ElementalDamageBonus;
|
|
|
|
public void IncreaseWeaponAttack(int bonus) => Stats.Damage += bonus;
|
|
|
|
[Export]
|
|
[Save("weapon_stats")]
|
|
public WeaponStats Stats { get; set; } = new WeaponStats();
|
|
public override Texture2D GetTexture() => Stats.Texture;
|
|
}
|