Fix texture stuff

This commit is contained in:
2025-03-09 12:24:30 -07:00
parent b93630756c
commit d8c5bc8f78
112 changed files with 671 additions and 355 deletions

View File

@@ -1,38 +1,49 @@
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("throwable_item")]
[Meta(typeof(IAutoNode)), Id("throwable_item")]
public partial class ThrowableItem : InventoryItem
{
[Export]
private ThrowableItemStats _throwableItemStats { get; set; }
public override void _Notification(int what) => this.Notify(what);
public override string ItemName => _throwableItemStats.Name;
[Node] private Sprite3D _sprite { get; set; } = default!;
public override string Description => _throwableItemStats.Description;
public override void _Ready()
{
_sprite.Texture = Stats.Texture;
}
public override float SpawnRate => _throwableItemStats.SpawnRate;
public override string ItemName => Stats.Name;
public override double ThrowDamage => _throwableItemStats.ThrowDamage;
public override string Description => Stats.Description;
public override float ThrowSpeed => _throwableItemStats.ThrowSpeed;
public override float SpawnRate => Stats.SpawnRate;
public ElementType ElementType => _throwableItemStats.ElementType;
public override double ThrowDamage => Stats.ThrowDamage;
public ThrowableItemTag ThrowableItemTag => _throwableItemStats.ThrowableItemTag;
public override float ThrowSpeed => Stats.ThrowSpeed;
public int HealHPAmount => _throwableItemStats.HealHPAmount;
public ElementType ElementType => Stats.ElementType;
public int HealVTAmount => _throwableItemStats.HealVTAmount;
public ThrowableItemTag ThrowableItemTag => Stats.ThrowableItemTag;
public void SetElementType(ElementType elementType) => _throwableItemStats.ElementType = elementType;
public int HealHPAmount => Stats.HealHPAmount;
public void SetDescription(string description) => _throwableItemStats.Description = description;
public int HealVTAmount => Stats.HealVTAmount;
public void SetElementType(ElementType elementType) => Stats.ElementType = elementType;
public void SetDescription(string description) => Stats.Description = description;
public int Count { get; }
public override InventoryItemStats ItemStats { get => _throwableItemStats; set => _throwableItemStats = (ThrowableItemStats)value; }
[Export]
[Save("throwable_item_stats")]
public ThrowableItemStats Stats { get; set; }
public override Texture2D GetTexture() => Stats.Texture;
}