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

50 lines
1.3 KiB
Ucode
Raw Normal View History

class ExtSM_Player_Emote extends KFSM_Player_Emote;
2020-11-28 20:04:55 +00:00
static function byte PackFlagsBase(KFPawn P)
{
2020-11-28 20:04:55 +00:00
return class'ExtEmoteList'.static.GetEmoteIndex(class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(P.Controller)));
}
function PlayAnimation()
{
2020-11-28 20:04:55 +00:00
AnimName = class'ExtEmoteList'.static.GetEmoteFromIndex(KFPOwner.SpecialMoveFlags);
2020-11-28 20:04:55 +00:00
PlaySpecialMoveAnim(AnimName, AnimStance, BlendInTime, BlendOutTime, 1.f);
2020-11-28 20:04:55 +00:00
if(KFPOwner.Role == ROLE_Authority)
{
2020-11-28 20:04:55 +00:00
KFGameInfo(KFPOwner.WorldInfo.Game).DialogManager.PlayDialogEvent(KFPOwner, 31);
}
// Store camera mode for restoration after move ends
LastCameraMode = 'FirstPerson';
2020-11-28 20:04:55 +00:00
if(PCOwner != none && PCOwner.PlayerCamera != none)
{
LastCameraMode = PCOwner.PlayerCamera.CameraStyle;
}
// Set camera to emote third person camera
2020-11-28 20:04:55 +00:00
if(PCOwner == none || !PawnOwner.IsLocallyControlled())
{
2020-11-28 20:04:55 +00:00
KFPOwner.SetWeaponAttachmentVisibility(false);
return;
}
2020-11-28 20:04:55 +00:00
if(PCOwner.CanViewCinematics())
{
2020-11-28 20:04:55 +00:00
PCOwner.ClientSetCameraFade(true, FadeInColor, vect2d(1.f, 0.f), FadeInTime, true);
PCOwner.PlayerCamera.CameraStyle = 'Emote';
// Switch camera modes immediately in single player or on client
2020-11-28 20:04:55 +00:00
if(PCOwner.WorldInfo.NetMode != NM_DedicatedServer)
{
2020-11-28 20:04:55 +00:00
PCOwner.ClientSetCameraMode('Emote');
}
2020-11-28 20:04:55 +00:00
KFPOwner.SetWeaponAttachmentVisibility(false);
}
}
DefaultProperties
{
}