Fix texture stuff
This commit is contained in:
@@ -1,40 +1,51 @@
|
||||
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("weapon")]
|
||||
[Meta(typeof(IAutoNode)), Id("weapon")]
|
||||
public partial class Weapon : EquipableItem
|
||||
{
|
||||
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 int Damage => Stats.Damage;
|
||||
|
||||
public override double ThrowDamage => Stats.ThrowDamage;
|
||||
|
||||
public override float ThrowSpeed => Stats.ThrowSpeed;
|
||||
|
||||
public double Luck => Stats.Luck;
|
||||
|
||||
public double AttackSpeed => Stats.AttackSpeed;
|
||||
|
||||
public WeaponTag WeaponTag => Stats.WeaponTag;
|
||||
|
||||
public override ItemTag ItemTag => Stats.ItemTag;
|
||||
|
||||
public ElementType WeaponElement => Stats.WeaponElement;
|
||||
|
||||
public double ElementalDamageBonus => Stats.ElementalDamageBonus;
|
||||
|
||||
public void IncreaseWeaponAttack(int bonus) => Stats.Damage += bonus;
|
||||
|
||||
[Export]
|
||||
private WeaponStats _weaponStats { get; set; } = new WeaponStats();
|
||||
|
||||
public override string ItemName => _weaponStats.Name;
|
||||
|
||||
public override string Description => _weaponStats.Description;
|
||||
|
||||
public override float SpawnRate => _weaponStats.SpawnRate;
|
||||
|
||||
public int Damage => _weaponStats.Damage;
|
||||
|
||||
public override double ThrowDamage => _weaponStats.ThrowDamage;
|
||||
|
||||
public override float ThrowSpeed => _weaponStats.ThrowSpeed;
|
||||
|
||||
public double Luck => _weaponStats.Luck;
|
||||
|
||||
public double AttackSpeed => _weaponStats.AttackSpeed;
|
||||
|
||||
public WeaponTag WeaponTag => _weaponStats.WeaponTag;
|
||||
|
||||
public override ItemTag ItemTag => _weaponStats.ItemTag;
|
||||
|
||||
public ElementType WeaponElement => _weaponStats.WeaponElement;
|
||||
|
||||
public double ElementalDamageBonus => _weaponStats.ElementalDamageBonus;
|
||||
|
||||
public void IncreaseWeaponAttack(int bonus) => _weaponStats.Damage += bonus;
|
||||
|
||||
public override InventoryItemStats ItemStats { get => _weaponStats; set => _weaponStats = (WeaponStats)value; }
|
||||
[Save("weapon_stats")]
|
||||
public WeaponStats Stats { get; set; } = new WeaponStats();
|
||||
public override Texture2D GetTexture() => Stats.Texture;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user