Files
GameJamDungeon/Zennysoft.Game.Ma/src/items/effect/EffectItem.cs
Zenny 286c221530 Improvements to save and loading
Improvements to Chinthe animation logic
Fix broken Godot Tool system and just use a more manual approach to setting map nodes
Remove ItemDatabase from individual room scenes
2025-10-24 01:33:18 -07:00

44 lines
1.1 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("effect_item")]
public partial class EffectItem : InventoryItem
{
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 override int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
[Save("usable_tag")]
public UsableItemTag UsableItemTag => Stats.UsableItemTag;
public override ItemTag ItemTag => Stats.ItemTag;
public void SetEffectTag(UsableItemTag effect) => Stats.UsableItemTag = effect;
[Export]
[Save("effect_item_stats")]
public EffectItemStats Stats { get; set; } = new EffectItemStats();
public override Texture2D GetTexture() => Stats.Texture;
}