status/CurseDrainHealthStatus.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Sandbox;
[Status(99, 0, 1f, 0, true )]
public class CurseDrainHealthStatus : Status
{
public CurseDrainHealthStatus()
{
Title = "Waste Away";
IconPath = "textures/icons/curse_drain.png";
}
public override void Init(Player player)
{
base.Init(player);
}
public override void Refresh()
{
Description = GetDescription(Level);
Player.Modify(this, PlayerStat.HealthRegen, -GetHpDrainAmountForLevel(Level), ModifierType.Add);
}
public override string GetDescription(int newLevel)
{
return string.Format("Lose {0} HP/s", GetHpDrainPrintAmountForLevel(Level));
}
public override string GetUpgradeDescription(int newLevel)
{
return newLevel > 1 ? string.Format( "Lose {0}→{1} HP/s", GetHpDrainPrintAmountForLevel(newLevel - 1), GetHpDrainPrintAmountForLevel(newLevel)) : GetDescription(newLevel);
}
public float GetHpDrainAmountForLevel(int level)
{
return level * 1.0f;
}
public string GetHpDrainPrintAmountForLevel(int level)
{
return string.Format("{0:0}", GetHpDrainAmountForLevel(level));
}
}