The Weapon class defines data structures for game items, including properties for damage, healing, and enchantments. It provides methods to calculate weapon statistics based on a prestige level.
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;
}
public float GetScaledDamage( int prestige )
{
float prestigeScalingFactor = 1.0f;
return this.damageBonus + (prestige * prestigeScalingFactor);
}
public float GetScaledSpecialDamage( int prestige )
{
// The special move starts at a base of 30, scales with weapon bonus,
// and gains an extra 3 points per prestige level to outpace basic attacks.
float specialPrestigeScalingFactor = 3.0f;
return 30f + this.damageBonus + (prestige * specialPrestigeScalingFactor);
}
}