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

66 lines
1.6 KiB
Ucode
Raw Normal View History

Class Ext_TraitZED_SummonExt extends Ext_TraitZEDBase;
2017-10-20 02:00:49 +00:00
2020-11-28 20:04:55 +00:00
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
2017-10-20 02:00:49 +00:00
{
local int i;
local byte MaxLevel;
MaxLevel = 0;
2020-11-28 20:12:58 +00:00
for (i=0; i<Perk.PerkTraits.Length; ++i)
if (Perk.PerkTraits[i].TraitType==Class'Ext_TraitZED_Summon')
2017-10-20 02:00:49 +00:00
{
MaxLevel = Max(Perk.PerkTraits[i].CurrentLevel,1)-1;
break;
}
2020-11-28 20:12:58 +00:00
switch (Level)
2017-10-20 02:00:49 +00:00
{
case 3:
AddHelperType(MaxLevel*0.8,Player);
case 1:
AddHelperType(Rand(MaxLevel*0.4),Player);
break;
case 4:
AddHelperType(MaxLevel*0.8,Player);
case 2:
AddHelperType(MaxLevel*0.8,Player);
break;
}
// Make other traits refresh (apply HP/damage scalers).
2020-11-28 20:12:58 +00:00
for (i=0; i<Perk.PerkTraits.Length; ++i)
if (Perk.PerkTraits[i].CurrentLevel>0 && Class<Ext_TraitZEDBase>(Perk.PerkTraits[i].TraitType)!=None && !Class<Ext_TraitZEDBase>(Perk.PerkTraits[i].TraitType).Default.bIsSummoner)
2017-10-20 02:00:49 +00:00
Perk.PerkTraits[i].TraitType.Static.ApplyEffectOn(Player,Perk,Level,Data);
}
2020-11-28 21:54:57 +00:00
2020-11-28 20:04:55 +00:00
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
2017-10-20 02:00:49 +00:00
{
local Ext_T_ZEDHelper H;
foreach Player.ChildActors(class'Ext_T_ZEDHelper',H)
2020-11-28 20:12:58 +00:00
if (H.bIsExtra)
2017-10-20 02:00:49 +00:00
H.Destroy();
}
2020-11-28 21:54:57 +00:00
2020-11-28 20:04:55 +00:00
static final function AddHelperType(byte Lv, KFPawn_Human Player)
2017-10-20 02:00:49 +00:00
{
local Ext_T_ZEDHelper H;
H = Player.Spawn(class'Ext_T_ZEDHelper',Player);
2020-11-28 20:12:58 +00:00
if (H!=None)
2017-10-20 02:00:49 +00:00
{
H.CurLevel = Lv;
H.bIsExtra = true;
}
}
defaultproperties
{
bIsSummoner=true
NumLevels=4
DefLevelCosts(0)=100
DefLevelCosts(1)=40
DefLevelCosts(2)=80
DefLevelCosts(3)=50
DefMinLevel=100
}