A game perk definition for an 'Epic' perk that is currently disabled. It adjusts the player's last-punch force multiplier when applied and defines scaling values for punch force and ram damage.
using System;
using Sandbox;
[Perk( Rarity.Epic, disabled: true, includedAtStart: false, alwaysOfferDebug: false )]
public class PerkPunchForce : Perk
{
private enum Mod { LastPunchForce, Dmg };
static PerkPunchForce()
{
//Register<PerkPunchForce>(
// name: "Flesh Projectile",
// imagePath: "textures/icons/vector/punch_force.png",
// description: level => $"Your last punch in the clip has {GetValue( level, Mod.LastPunchForce ).ToString("0.#")}x force, and ramming an enemy into another does {GetValue( level, Mod.Dmg ).ToString( "0.#" )} dmg",
// upgradeDescription: level => $"Your last punch in the clip has {GetValue( level - 1, Mod.LastPunchForce ).ToString( "0.#" )}→{GetValue( level, Mod.LastPunchForce ).ToString( "0.#" )}x force, and ramming an enemy into another does {GetValue( level - 1, Mod.Dmg ).ToString( "0.#" )}→{GetValue( level, Mod.Dmg ).ToString( "0.#" )} dmg"
//);
}
public override void Start()
{
base.Start();
}
public override void Refresh()
{
base.Refresh();
Player.Modify( this, PlayerStat.LastPunchForceMultiplier, GetValue( Level, Mod.LastPunchForce ), ModifierType.Add );
}
private static float GetValue( int level, Mod mod, bool isPercent = false )
{
switch ( mod )
{
case Mod.LastPunchForce:
default:
return 45f + 5f * level;
case Mod.Dmg:
return 10f + level * 2f;
}
}
}