KF2-Server-Extension/ServerExt/Classes/Ext_TraitDemoNuke.uc
2023-05-14 05:49:12 +03:00

65 lines
1.5 KiB
Ucode

Class Ext_TraitDemoNuke extends Ext_TraitBase;
var localized string GroupDescription;
function string GetPerkDescription()
{
local string S;
S = Super.GetPerkDescription();
S $= "|"$GroupDescription;
return S;
}
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3)
return false;
if (Lvl==0)
{
i = Perk.PerkStats.Find('StatType','Damage');
if (i>=0)
return (Perk.PerkStats[i].CurrentValue>=30);
}
return true;
}
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local ExtPlayerReplicationInfo MyPRI;
MyPRI = ExtPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo);
if (MyPRI == None || Ext_PerkDemolition(Perk) == None)
return;
MyPRI.bNukeActive = true;
Ext_PerkDemolition(Perk).NukeDamageMult = 1.0 + (((float(Level) - 1.f) * 5.f) / 100.f);
}
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local ExtPlayerReplicationInfo MyPRI;
MyPRI = ExtPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo);
if (MyPRI == None || Ext_PerkDemolition(Perk) == None)
return;
MyPRI.bNukeActive = false;
Ext_PerkDemolition(Perk).NukeDamageMult = 1.0;
}
defaultproperties
{
SupportedPerk=class'Ext_PerkDemolition'
TraitGroup=class'Ext_TGroupZEDTime'
NumLevels=4
DefLevelCosts(0)=100
DefLevelCosts(1)=150
DefLevelCosts(2)=200
DefLevelCosts(3)=250
DefMinLevel=100
}