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

34 lines
816 B
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
// Trait group info.
Class Ext_TGroupBase extends Object
abstract;
var() localized string GroupInfo;
2017-10-20 02:00:49 +00:00
var() bool bLimitToOne; // Limit to only one trait for this group.
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.bLimitToOne ? Default.GroupInfo$" (MAX 1)" : Default.GroupInfo);
}
2020-11-28 21:54:57 +00:00
2017-10-20 02:00:49 +00:00
static function string GetUIDesc()
{
return Default.GroupInfo$" trait group";
}
// See if group is already using up limitation.
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;
2020-11-28 20:12:58 +00:00
if (Default.bLimitToOne)
2017-10-20 02:00:49 +00:00
{
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)
2017-10-20 02:00:49 +00:00
return true;
}
return false;
}
defaultproperties
{
}