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

46 lines
973 B
Ucode
Raw Normal View History

Class Ext_TraitTactician extends Ext_TraitBase;
static function string GetPerkDescription()
{
local string S;
S = Super.GetPerkDescription();
S $= "|Trait requires prestige level: #{FF4000}1";
return S;
}
2020-11-28 20:04:55 +00:00
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
2020-11-28 20:04:55 +00:00
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1)
return false;
2020-11-28 20:04:55 +00:00
if(Lvl==0)
{
i = Perk.PerkStats.Find('StatType','Damage');
2020-11-28 20:04:55 +00:00
if(i>=0)
return (Perk.PerkStats[i].CurrentValue>=30);
}
return true;
}
2020-11-28 20:04:55 +00:00
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkCommando(Perk).bUseProfessional = true;
}
2020-11-28 20:04:55 +00:00
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkCommando(Perk).bUseProfessional = false;
}
defaultproperties
{
SupportedPerk=class'Ext_PerkCommando'
TraitGroup=class'Ext_TGroupZEDTime'
NumLevels=1
DefLevelCosts(0)=30
DefMinLevel=35
}