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

32 lines
913 B
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
Class Ext_TraitGhost extends Ext_TraitBase;
2020-11-28 20:04:55 +00:00
static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Class<DamageType> DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
2017-10-20 02:00:49 +00:00
{
local Controller C;
2020-11-28 20:12:58 +00:00
if ((Instigator==None || Instigator==Player.Controller) && DamType==Class'DmgType_Suicided')
2017-10-20 02:00:49 +00:00
return false; // Allow normal suicide to go ahead.
2020-11-28 20:12:58 +00:00
if (Ext_T_GhostHelper(Data).CanResPlayer(Player,Level))
2017-10-20 02:00:49 +00:00
{
// Abort current special move
2020-11-28 20:12:58 +00:00
if (Player.IsDoingSpecialMove())
2017-10-20 02:00:49 +00:00
Player.SpecialMoveHandler.EndSpecialMove();
// Notify AI to stop hunting me.
foreach Player.WorldInfo.AllControllers(class'Controller',C)
C.NotifyKilled(Instigator,Player.Controller,Player,DamType);
return true;
}
return false;
}
defaultproperties
{
bHighPriorityDeath=true
NumLevels=2
TraitData=class'Ext_T_GhostHelper'
DefLevelCosts(0)=30
DefLevelCosts(1)=30
DefMinLevel=30
}