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

28 lines
660 B
Ucode
Raw Normal View History

2017-10-19 21:00:49 -05:00
Class Ext_TraitGrenadeUpg extends Ext_TraitBase;
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
{
2020-11-28 23:12:58 +03:00
if (Lvl>=1 && Perk.CurrentLevel<50)
2017-10-19 21:00:49 -05:00
return false;
return Super.MeetsRequirements(Lvl,Perk);
}
2020-11-29 00:54:57 +03:00
2020-11-28 23:04:55 +03:00
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
2017-10-19 21:00:49 -05:00
{
2020-11-28 23:12:58 +03:00
if (Level==1)
2017-10-19 21:00:49 -05:00
Perk.GrenadeClass = Perk.PerkGrenade;
2020-11-28 23:12:58 +03:00
else if (Level==2)
2017-10-19 21:00:49 -05:00
Perk.GrenadeClass = Perk.SuperGrenade;
}
2020-11-29 00:54:57 +03:00
2020-11-28 23:04:55 +03:00
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
2017-10-19 21:00:49 -05:00
{
Perk.GrenadeClass = Perk.Default.GrenadeClass;
}
defaultproperties
{
NumLevels=2
DefLevelCosts(0)=5
DefLevelCosts(1)=50
}