Fix texture stuff
This commit is contained in:
@@ -1,28 +1,39 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Godot;
|
||||
using Zennysoft.Ma.Godot.Adapter;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
[Meta, Id("effect_item")]
|
||||
[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 double ThrowDamage => Stats.ThrowDamage;
|
||||
|
||||
public override float ThrowSpeed => Stats.ThrowSpeed;
|
||||
|
||||
public UsableItemTag UsableItemTag => Stats.UsableItemTag;
|
||||
|
||||
public void SetEffectTag(UsableItemTag effect) => Stats.UsableItemTag = effect;
|
||||
|
||||
[Export]
|
||||
private EffectItemStats _effectItemStats { get; set; } = new EffectItemStats();
|
||||
|
||||
public override string ItemName => _effectItemStats.Name;
|
||||
|
||||
public override string Description => _effectItemStats.Description;
|
||||
|
||||
public override float SpawnRate => _effectItemStats.SpawnRate;
|
||||
|
||||
public override double ThrowDamage => _effectItemStats.ThrowDamage;
|
||||
|
||||
public override float ThrowSpeed => _effectItemStats.ThrowSpeed;
|
||||
|
||||
public UsableItemTag UsableItemTag => _effectItemStats.UsableItemTag;
|
||||
|
||||
public void SetEffectTag(UsableItemTag effect) => _effectItemStats.UsableItemTag = effect;
|
||||
|
||||
public override InventoryItemStats ItemStats { get => _effectItemStats; set => _effectItemStats = (EffectItemStats)value; }
|
||||
[Save("effect_item_stats")]
|
||||
public EffectItemStats Stats { get; set; } = new EffectItemStats();
|
||||
public override Texture2D GetTexture() => Stats.Texture;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user