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

27 lines
459 B
Ucode
Raw Normal View History

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