A simple Weapon model class used by the game. It stores weapon properties (name, damage bonus, block modifier, heal bonus), an enchantment enum and power, and provides methods to compute scaled damage and a scaled special attack value based on a prestige parameter.
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);
}
}