46 lines
1.3 KiB
C#
46 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("consumable_item")]
|
|
public partial class ConsumableItem : Node3D, IBaseInventoryItem
|
|
{
|
|
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 string ItemName => Stats.Name;
|
|
|
|
public string StatDescription => Stats.StatDescription;
|
|
|
|
public string FlavorText => Stats.FlavorText;
|
|
|
|
public float SpawnRate => Stats.SpawnRate;
|
|
|
|
public int ThrowDamage => Stats.ThrowDamage;
|
|
|
|
public float ThrowSpeed => Stats.ThrowSpeed;
|
|
|
|
[Save("consumable_heal_hp")]
|
|
public int HealHPAmount => Stats.HealHPAmount;
|
|
[Save("consumable_heal_vt")]
|
|
public int HealVTAmount => Stats.HealVTAmount;
|
|
[Save("consumable_increase_hp")]
|
|
public int RaiseHPAmount => Stats.PermanentRaiseHPAmount;
|
|
[Save("consumable_increase_vt")]
|
|
public int RaiseVTAmount => Stats.PermanentRaiseVTAmount;
|
|
|
|
public ItemTag ItemTag => Stats.ItemTag;
|
|
|
|
[Export]
|
|
[Save("consumable_item_stats")]
|
|
public ConsumableItemStats Stats { get; set; } = new ConsumableItemStats();
|
|
public Texture2D GetTexture() => Stats.Texture;
|
|
}
|