60 lines
1.6 KiB
C#
60 lines
1.6 KiB
C#
using Chickensoft.AutoInject;
|
|
using Chickensoft.Collections;
|
|
using Chickensoft.Introspection;
|
|
using Chickensoft.Serialization;
|
|
using Godot;
|
|
using Zennysoft.Game.Implementation;
|
|
using Zennysoft.Game.Ma;
|
|
using Zennysoft.Ma.Adapter;
|
|
using Zennysoft.Ma.Adapter.Entity;
|
|
|
|
[Meta(typeof(IAutoNode)), Id("ammo")]
|
|
public partial class Ammo : Node3D, IEquipableItem, IStackable
|
|
{
|
|
public override void _Notification(int what) => this.Notify(what);
|
|
|
|
[Node] private Sprite3D _sprite { get; set; }
|
|
|
|
public void OnReady()
|
|
{
|
|
Count = new AutoProp<int>(Stats.InitialCount);
|
|
_sprite.Texture = Stats.Texture;
|
|
}
|
|
|
|
public string ItemName => Stats.Name;
|
|
|
|
public string FlavorText => Stats.FlavorText;
|
|
|
|
public string StatDescription => Stats.StatDescription;
|
|
|
|
public float SpawnRate => Stats.SpawnRate;
|
|
|
|
public int ThrowDamage => Stats.ThrowDamage;
|
|
|
|
public float ThrowSpeed => Stats.ThrowSpeed;
|
|
|
|
public ItemTag ItemTag => Stats.ItemTag;
|
|
|
|
public Texture2D GetTexture() => Stats.Texture;
|
|
|
|
[Save("ammo_item_count")]
|
|
public AutoProp<int> Count { get; private set; } = new AutoProp<int>(3);
|
|
|
|
public void SetCount(int count) => Count.OnNext(count);
|
|
|
|
|
|
[Save("ammo_element")]
|
|
public ElementType AmmoElement => Stats.AmmoElement;
|
|
|
|
[Export]
|
|
[Save("ammo_stats")]
|
|
public AmmoStats Stats { get; set; } = new AmmoStats();
|
|
public int BonusAttack { get; }
|
|
public int BonusDefense { get; }
|
|
public int BonusHP { get; }
|
|
public int BonusVT { get; }
|
|
public int BonusLuck { get; }
|
|
public bool Glued { get; set; }
|
|
public ElementalResistanceSet ElementalResistance { get; }
|
|
}
|