Overhaul item and inventory and clean up bits and pieces

This commit is contained in:
2026-02-15 01:19:27 -08:00
parent a1f4a29eb3
commit 69b25aacb9
219 changed files with 4378 additions and 2355 deletions

View File

@@ -2,14 +2,13 @@ using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
using System;
using Zennysoft.Ma.Adapter;
using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode)), Id("weapon")]
public partial class Weapon : EquipableItem
public partial class Weapon : Node3D, IWeapon
{
public override void _Notification(int what) => this.Notify(what);
@@ -25,26 +24,26 @@ public partial class Weapon : EquipableItem
_bonusLuck = Stats.BonusLuck;
}
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
[Save("weapon_attack_speed")]
public double AttackSpeed => Stats.AttackSpeed;
[Save("weapon_tag")]
public WeaponTag WeaponTag => Stats.WeaponTag;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
[Save("weapon_element")]
public ElementType WeaponElement => Stats.WeaponElement;
public override ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance, Stats.HolyResistance, Stats.CurseResistance);
public ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance, Stats.HolyResistance, Stats.CurseResistance);
public void IncreaseAttack(int bonus) => _bonusDamage += bonus;
@@ -58,11 +57,15 @@ public partial class Weapon : EquipableItem
public void SetLuck(int newBonus) => _bonusLuck = newBonus;
public override int BonusAttack { get => _bonusDamage; }
public int BonusAttack { get => _bonusDamage; }
public override int BonusDefense { get => _bonusDefense; }
public int BonusDefense { get => _bonusDefense; }
public override int BonusLuck { get => _bonusLuck; }
public int BonusLuck { get => _bonusLuck; }
public int BonusHP { get; }
public int BonusVT { get; }
[Save("weapon_bonus_damage")]
private int _bonusDamage { get; set; } = 0;
@@ -76,6 +79,9 @@ public partial class Weapon : EquipableItem
[Export]
[Save("weapon_stats")]
public WeaponStats Stats { get; set; } = new WeaponStats();
public Augment Augment { get; set; }
public override Texture2D GetTexture() => Stats.Texture;
public bool Glued { get; set; }
public Texture2D GetTexture() => Stats.Texture;
}