Fix texture stuff
This commit is contained in:
@@ -1,31 +1,43 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Godot;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
[Meta, Id("consumable_item")]
|
||||
[Meta(typeof(IAutoNode)), Id("consumable_item")]
|
||||
public partial class ConsumableItem : 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 int HealHPAmount => Stats.HealHPAmount;
|
||||
|
||||
public int HealVTAmount => Stats.HealVTAmount;
|
||||
|
||||
public int RaiseHPAmount => Stats.RaiseHPAmount;
|
||||
|
||||
public int RaiseVTAmount => Stats.RaiseVTAmount;
|
||||
|
||||
[Export]
|
||||
private ConsumableItemStats _consumableItemStats { get; set; } = new ConsumableItemStats();
|
||||
|
||||
public override string ItemName => _consumableItemStats.Name;
|
||||
|
||||
public override string Description => _consumableItemStats.Description;
|
||||
|
||||
public override float SpawnRate => _consumableItemStats.SpawnRate;
|
||||
|
||||
public override double ThrowDamage => _consumableItemStats.ThrowDamage;
|
||||
|
||||
public override float ThrowSpeed => _consumableItemStats.ThrowSpeed;
|
||||
|
||||
public int HealHPAmount => _consumableItemStats.HealHPAmount;
|
||||
|
||||
public int HealVTAmount => _consumableItemStats.HealVTAmount;
|
||||
|
||||
public int RaiseHPAmount => _consumableItemStats.RaiseHPAmount;
|
||||
|
||||
public int RaiseVTAmount => _consumableItemStats.RaiseVTAmount;
|
||||
|
||||
public override InventoryItemStats ItemStats { get => _consumableItemStats; set => _consumableItemStats = (ConsumableItemStats)value; }
|
||||
[Save("consumable_item_stats")]
|
||||
public ConsumableItemStats Stats { get; set; } = new ConsumableItemStats();
|
||||
public override Texture2D GetTexture() => Stats.Texture;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,14 @@ namespace Zennysoft.Game.Ma;
|
||||
[Meta, Id("consumable_item_stats")]
|
||||
public partial class ConsumableItemStats : InventoryItemStats
|
||||
{
|
||||
[Export]
|
||||
[Save("consumable_item_name")]
|
||||
public override string Name { get; set; } = default!;
|
||||
|
||||
[Export(PropertyHint.MultilineText)]
|
||||
[Save("consumable_item_description")]
|
||||
public override string Description { get; set; } = default!;
|
||||
|
||||
[Export]
|
||||
[Save("consumable_item_raise_hp")]
|
||||
public int RaiseHPAmount { get; set; } = 0;
|
||||
|
||||
Reference in New Issue
Block a user