status/CurseHealthPackStatus.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Sandbox;
[Status( 3, 0, 1f, 0, true )]
public class CurseHealthPackStatus : Status
{
public CurseHealthPackStatus()
{
Title = "Poison Packs";
IconPath = "textures/icons/curse_health_pack.png";
}
public override void Init( Player player )
{
base.Init( player );
}
public override void Refresh()
{
Description = GetDescription( Level );
Player.Modify( this, PlayerStat.HealthPackAmount, -GetAmountForLevel( Level ), ModifierType.Add );
}
public override string GetDescription( int newLevel )
{
return string.Format( "Health packs heal {0} less HP", GetAmountForLevel( Level ) );
}
public override string GetUpgradeDescription( int newLevel )
{
return newLevel > 1 ? string.Format( "Health packs heal {0}→{1} less HP", GetAmountForLevel( newLevel - 1 ), GetAmountForLevel( newLevel ) ) : GetDescription( newLevel );
}
public float GetAmountForLevel( int level )
{
return 25 * level;
}
}