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

28 lines
574 B
Ucode
Raw Normal View History

Class Ext_TraitZEDBase extends Ext_TraitBase;
2017-10-19 21:00:49 -05:00
var class<Ext_TraitZEDBase> BaseTrait;
var bool bIsSummoner;
2020-11-28 23:04:55 +03:00
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
2017-10-19 21:00:49 -05:00
{
local int i;
// First check level.
2020-11-28 23:12:58 +03:00
if (Perk.CurrentLevel<Default.MinLevel)
2017-10-19 21:00:49 -05:00
return false;
2023-05-14 05:49:12 +03:00
2017-10-19 21:00:49 -05:00
// Then check stats.
2020-11-28 23:12:58 +03:00
if (Lvl==0 && Default.BaseTrait!=None)
2017-10-19 21:00:49 -05:00
{
i = Perk.PerkTraits.Find('TraitType',Default.BaseTrait);
2020-11-28 23:12:58 +03:00
if (i>=0)
2017-10-19 21:00:49 -05:00
return (Perk.PerkTraits[i].CurrentLevel>0);
}
return true;
}
defaultproperties
{
TraitGroup=class'Ext_TGroupMonster'
BaseTrait=class'Ext_TraitZED_Summon'
}