KF2-Server-Extension/ServerExt/Classes/Ext_TGroupRegen.uc

34 lines
955 B
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
class Ext_TGroupRegen extends Ext_TGroupBase;
2020-11-28 20:04:55 +00:00
static function string GetUIInfo(Ext_PerkBase Perk)
2017-10-20 02:00:49 +00:00
{
return Default.GroupInfo$" (MAX "$GetMaxLimit(Perk)$")";
}
2020-11-28 21:54:57 +00:00
2017-10-20 02:00:49 +00:00
static function string GetUIDesc()
{
return Super.GetUIDesc()$"|To buy additional regen abilities:|-Prestige level 1 + Perk level 100 = MAX 2 traits|-Prestige level 5 + Perk level 150 = MAX 3 traits";
}
2020-11-28 20:04:55 +00:00
static function bool GroupLimited(Ext_PerkBase Perk, class<Ext_TraitBase> Trait)
2017-10-20 02:00:49 +00:00
{
local int i;
local byte n;
n = GetMaxLimit(Perk);
2020-11-28 20:12:58 +00:00
for (i=0; i<Perk.PerkTraits.Length; ++i)
if (Perk.PerkTraits[i].CurrentLevel>0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class && --n==0)
2017-10-20 02:00:49 +00:00
return true;
return false;
}
2020-11-28 20:04:55 +00:00
static final function byte GetMaxLimit(Ext_PerkBase Perk)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (Perk.CurrentPrestige<1 || Perk.CurrentLevel<100)
2017-10-20 02:00:49 +00:00
return 1;
return ((Perk.CurrentPrestige<5 || Perk.CurrentLevel<150) ? 2 : 3);
}
defaultproperties
{
}