32 lines
913 B
Ucode
Raw Normal View History

2017-10-19 21:00:49 -05:00
Class Ext_TraitGhost extends Ext_TraitBase;
2020-11-28 23:04:55 +03:00
static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Class<DamageType> DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
2017-10-19 21:00:49 -05:00
{
local Controller C;
2020-11-28 23:12:58 +03:00
if ((Instigator==None || Instigator==Player.Controller) && DamType==Class'DmgType_Suicided')
2017-10-19 21:00:49 -05:00
return false; // Allow normal suicide to go ahead.
2020-11-28 23:12:58 +03:00
if (Ext_T_GhostHelper(Data).CanResPlayer(Player,Level))
2017-10-19 21:00:49 -05:00
{
// Abort current special move
2020-11-28 23:12:58 +03:00
if (Player.IsDoingSpecialMove())
2017-10-19 21:00:49 -05: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
}