2017-10-20 02:00:49 +00:00
|
|
|
Class Ext_T_MonsterPRI extends PlayerReplicationInfo;
|
|
|
|
|
|
|
|
var repnotify class<Pawn> MonsterType;
|
|
|
|
var repnotify PlayerReplicationInfo OwnerPRI;
|
|
|
|
var Controller OwnerController;
|
|
|
|
var string MonsterName;
|
|
|
|
var int HealthStatus,HealthMax;
|
|
|
|
var Pawn PawnOwner;
|
|
|
|
var KFExtendedHUD OwnerHUD;
|
|
|
|
|
|
|
|
replication
|
|
|
|
{
|
|
|
|
// Things the server should send to the client.
|
|
|
|
if (bNetDirty)
|
|
|
|
OwnerPRI,MonsterType,HealthStatus,HealthMax;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Make no efforts with this one.
|
|
|
|
simulated event PostBeginPlay()
|
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (WorldInfo.NetMode!=NM_Client)
|
2017-10-20 02:00:49 +00:00
|
|
|
SetTimer(1,true);
|
|
|
|
}
|
2020-11-28 21:54:57 +00:00
|
|
|
|
2017-10-20 02:00:49 +00:00
|
|
|
simulated event Destroyed()
|
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (OwnerHUD!=None)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
|
|
|
OwnerHUD.MyCurrentPet.RemoveItem(Self);
|
|
|
|
OwnerHUD = None;
|
|
|
|
}
|
2020-11-28 20:04:55 +00:00
|
|
|
if (WorldInfo.GRI != None)
|
2017-10-20 02:00:49 +00:00
|
|
|
WorldInfo.GRI.RemovePRI(self);
|
|
|
|
}
|
2020-11-28 21:54:57 +00:00
|
|
|
|
2017-10-20 02:00:49 +00:00
|
|
|
simulated event ReplicatedEvent(name VarName)
|
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (VarName=='OwnerPRI' && OwnerPRI!=None)
|
2017-10-20 02:00:49 +00:00
|
|
|
NotifyOwner();
|
2020-11-28 20:12:58 +00:00
|
|
|
else if (VarName=='MonsterType' && MonsterType!=None)
|
2017-10-20 02:00:49 +00:00
|
|
|
MonsterName = Class'KFExtendedHUD'.Static.GetNameOf(MonsterType);
|
|
|
|
}
|
2020-11-28 21:54:57 +00:00
|
|
|
|
2017-10-20 02:00:49 +00:00
|
|
|
simulated 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 (HealthStatus!=PawnOwner.Health)
|
2017-10-20 02:00:49 +00:00
|
|
|
HealthStatus = PawnOwner.Health;
|
|
|
|
}
|
2020-11-28 21:54:57 +00:00
|
|
|
|
2017-10-20 02:00:49 +00:00
|
|
|
simulated final function NotifyOwner()
|
|
|
|
{
|
|
|
|
local PlayerController PC;
|
|
|
|
|
|
|
|
PC = GetALocalPlayerController();
|
2020-11-28 20:12:58 +00:00
|
|
|
if (PC==None || PC.PlayerReplicationInfo!=OwnerPRI || KFExtendedHUD(PC.MyHUD)==None)
|
2017-10-20 02:00:49 +00:00
|
|
|
return;
|
|
|
|
OwnerHUD = KFExtendedHUD(PC.MyHUD);
|
|
|
|
OwnerHUD.MyCurrentPet.AddItem(Self);
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
|
|
|
bBot=true
|
|
|
|
}
|