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

27 lines
459 B
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
Class Ext_T_HealthRegHelp extends Info
transient;
var KFPawn_Human PawnOwner;
var byte RegCount;
function PostBeginPlay()
{
PawnOwner = KFPawn_Human(Owner);
2020-11-28 20:12:58 +00:00
if (PawnOwner==None)
2017-10-20 02:00:49 +00:00
Destroy();
else SetTimer(9+FRand(),true);
}
2020-11-28 21:54:57 +00:00
2017-10-20 02:00:49 +00:00
function Timer()
{
2020-11-28 20:12:58 +00:00
if (PawnOwner==None || PawnOwner.Health<=0)
2017-10-20 02:00:49 +00:00
Destroy();
2020-11-28 20:12:58 +00:00
else if (PawnOwner.Health<PawnOwner.HealthMax)
2017-10-20 02:00:49 +00:00
{
PawnOwner.Health = Min(PawnOwner.Health+RegCount,PawnOwner.HealthMax);
}
}
defaultproperties
{
}