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

165 lines
4.1 KiB
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
class VS_ZedRecentZed extends VS_ZedClotBase;
var repnotify bool bWasWoken;
var transient float WakeUpAnimTime;
replication
{
2020-11-28 20:12:58 +00:00
if (true)
2017-10-20 02:00:49 +00:00
bWasWoken;
}
2020-11-28 20:04:55 +00:00
simulated function float StartAttackAnim(byte Num) // Return animation duration.
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (FPHandModel!=None)
2017-10-20 02:00:49 +00:00
FPHandModel.PlayHandsAnim('Atk_Combo1_V3',1.5f);
return PlayBodyAnim('Atk_Combo1_V3',EAS_UpperBody,1.5f);
}
simulated event ReplicatedEvent(name VarName)
{
2020-11-28 20:12:58 +00:00
switch (VarName)
2017-10-20 02:00:49 +00:00
{
case 'bWasWoken':
2020-11-28 20:12:58 +00:00
if (bWasWoken)
2017-10-20 02:00:49 +00:00
WakeUp();
break;
default:
Super.ReplicatedEvent(VarName);
}
}
2020-11-28 21:54:57 +00:00
2017-10-20 02:00:49 +00:00
simulated function WakeUp() // Just spawned from transformed into a zombie.
{
bWasWoken = true;
bNoWeaponFiring = true;
WakeUpAnimTime = BodyStanceNodes[EAS_FullBody].PlayCustomAnim('Getup_Fast_F_V1',1.f);
SetTimer(WakeUpAnimTime,false,'GotUp');
GoToState('WakingUp');
}
2020-11-28 21:54:57 +00:00
2017-10-20 02:00:49 +00:00
simulated function GotUp()
{
2020-11-28 20:12:58 +00:00
if (Health<=0)
2017-10-20 02:00:49 +00:00
return;
ClearTimer('GotUp');
bWasWoken = false;
bNoWeaponFiring = false;
2020-11-28 20:12:58 +00:00
if (WorldInfo.NetMode!=NM_Client)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (ExtPlayerController(Controller)!=None)
2017-10-20 02:00:49 +00:00
ExtPlayerController(Controller).EnterRagdollMode(false);
2020-11-28 20:12:58 +00:00
else if (Controller!=None)
2017-10-20 02:00:49 +00:00
Controller.ReplicatedEvent('EndRagdollMove');
}
GoToState('Auto');
}
state WakingUp
{
Ignores TakeDamage, FaceRotation;
function UnPossessed()
{
Super.UnPossessed();
2023-05-14 02:49:12 +00:00
2017-10-20 02:00:49 +00:00
ClearTimer('GotUp');
KilledBy(None);
LifeSpan = 2.f;
}
}
simulated function NotifyTeamChanged()
{
// Applies Character Info for < ROLE_Authority
2020-11-28 20:12:58 +00:00
if (PlayerReplicationInfo != None)
2017-10-20 02:00:49 +00:00
SetCharacterArch(GetCharacterInfo());
}
simulated function SetCharacterAnimationInfo()
{
local KFCharacterInfo_Monster M;
Super.SetCharacterAnimationInfo();
// Keep monster animations.
M = KFCharacterInfo_Monster'ZED_ARCH.ZED_Clot_UnDev_Archetype';
2020-11-28 19:53:57 +00:00
Mesh.AnimSets = M.AnimSets;
2020-11-28 20:04:55 +00:00
if (Mesh.AnimTreeTemplate != M.AnimTreeTemplate)
2017-10-20 02:00:49 +00:00
Mesh.SetAnimTreeTemplate(M.AnimTreeTemplate);
2020-11-28 20:04:55 +00:00
if (M.AnimArchetype != None)
2017-10-20 02:00:49 +00:00
PawnAnimInfo = M.AnimArchetype;
}
simulated function KFCharacterInfoBase GetCharacterInfo()
{
2020-11-28 20:12:58 +00:00
if (ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None)
2017-10-20 02:00:49 +00:00
return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch();
return Super.GetCharacterInfo();
}
2020-11-28 20:04:55 +00:00
simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bForce)
2017-10-20 02:00:49 +00:00
{
local KFPlayerReplicationInfo KFPRI;
2020-11-28 20:04:55 +00:00
KFPRI = KFPlayerReplicationInfo(PlayerReplicationInfo);
2017-10-20 02:00:49 +00:00
if (Info != CharacterArch)
{
// Set Family Info
CharacterArch = Info;
2020-11-28 20:04:55 +00:00
CharacterArch.SetCharacterFromArch(self, KFPRI);
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch(KFCharacterInfo_Human(CharacterArch), self, KFPRI);
class'ExtCharacterInfo'.Static.SetFirstPersonArmsFromArch(KFCharacterInfo_Human(CharacterArch), self, KFPRI);
2017-10-20 02:00:49 +00:00
SetCharacterAnimationInfo();
// Sounds
SoundGroupArch = Info.SoundGroupArch;
if (WorldInfo.NetMode != NM_DedicatedServer)
{
// refresh weapon attachment (attachment bone may have changed)
if (WeaponAttachmentTemplate != None)
{
WeaponAttachmentChanged(true);
}
}
2020-11-28 20:12:58 +00:00
if (CharacterArch != none)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:12:58 +00:00
if (CharacterArch.VoiceGroupArchName != "")
2017-10-20 02:00:49 +00:00
VoiceGroupArch = class<KFPawnVoiceGroup>(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class'));
}
}
}
// Dont gore and gib because human chars don't support it.
simulated function HandlePartialGoreAndGibs(class<KFDamageType> DmgType,vector HitLocation,vector HitDirection,name HitBoneName,bool ObliterateGibs);
simulated function PlayHeadAsplode();
simulated function bool PlayDismemberment(int InHitZoneIndex, class<KFDamageType> InDmgType, optional vector HitDirection)
{
return false;
}
2020-11-28 21:54:57 +00:00
2017-10-20 02:00:49 +00:00
event OnRigidBodyLinearConstraintViolated(name StretchedBoneName);
simulated function ApplyHeadChunkGore(class<KFDamageType> DmgType, vector HitLocation, vector HitDirection);
defaultproperties
{
Health=300
HealthMax=300
FPHandOffset=(X=-35,Z=-60)
HitsPerAttack=1
HPScaler=0.4
MonsterArchPath="ZED_ARCH.ZED_Clot_UnDev_Archetype"
CharacterMonsterArch=KFCharacterInfo_Monster'ZED_ARCH.ZED_Clot_UnDev_Archetype'
GroundSpeed=700
MeleeDamage=35
2023-05-14 02:49:12 +00:00
2017-10-20 02:00:49 +00:00
// Stats
XPValues(0)=11
XPValues(1)=11
XPValues(2)=11
XPValues(3)=11
2023-05-14 02:49:12 +00:00
}