Plain data model for a Weapon used by the game. Defines an EnchantmentType enum and properties for name, damageBonus, blockModifier, healBonus, enchantment, and enchantPower, with a constructor that initializes those fields.
using Sandbox;
using System;
namespace Keyboard_Warriors_.Models;
public class Weapon
{
public enum EnchantmentType
{
None,
Fire,
Poison,
Ice,
Sparks,
DamageHP,
Stun,
Bleed,
LifeSteal,
ShieldBreak
}
public string name { get; set; }
public int damageBonus { get; set; }
public float blockModifier { get; set; }
public int healBonus { get; set; }
public EnchantmentType enchantment { get; set; }
public int enchantPower { get; set; }
// Primary constructor matching your existing code structure
public Weapon( string name, int damageBonus, float blockModifier, int healBonus )
{
this.name = name;
this.damageBonus = damageBonus;
this.blockModifier = blockModifier;
this.healBonus = healBonus;
this.enchantment = EnchantmentType.None;
this.enchantPower = 0;
}
}