status/CurseSelfCritStatus.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Sandbox;
[Status( 9, 0, 0.8f, 0, true )]
public class CurseSelfCritStatus : Status
{
public CurseSelfCritStatus()
{
Title = "Critical Wounds";
IconPath = "textures/icons/curse_self_crit.png";
}
public override void Init( Player player )
{
base.Init( player );
}
public override void Refresh()
{
Description = GetDescription( Level );
Player.Modify( this, PlayerStat.SelfCritChance, GetAmountForLevel( Level ), ModifierType.Add );
}
public override string GetDescription( int newLevel )
{
return string.Format( "Dmg you take has {0}% chance to crit for double", GetPercentForLevel( Level ) );
}
public override string GetUpgradeDescription( int newLevel )
{
return newLevel > 1 ? string.Format( "Dmg you take has {0}%→{1}% chance to crit for double", GetPercentForLevel( newLevel - 1 ), GetPercentForLevel( newLevel ) ) : GetDescription( newLevel );
}
public float GetAmountForLevel( int level )
{
return 0.07f * level;
}
public float GetPercentForLevel( int level )
{
return 7 * level;
}
}