Guest User

X:Com Enforcer_Spectator Class

a guest
May 30th, 2021
25
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Spectator.
  3. //=============================================================================
  4. class Spectator extends PlayerPawn;
  5.  
  6. var bool bChaseCam;
  7.  
  8. function InitPlayerReplicationInfo()
  9. {
  10. Super.InitPlayerReplicationInfo();
  11. PlayerReplicationInfo.bIsSpectator = true;
  12. }
  13.  
  14. event FootZoneChange(ZoneInfo newFootZone)
  15. {
  16. }
  17.  
  18. event HeadZoneChange(ZoneInfo newHeadZone)
  19. {
  20. }
  21.  
  22. event PainTimer()
  23. {
  24. }
  25.  
  26. exec function XWalk()
  27. {
  28. }
  29.  
  30. exec function BehindView( Bool B )
  31. {
  32. bBehindView = B;
  33. bChaseCam = bBehindView;
  34. if ( ViewTarget == None )
  35. bBehindView = false;
  36. }
  37.  
  38. function ChangeTeam( int N )
  39. {
  40. Level.Game.ChangeTeam(self, N);
  41. }
  42.  
  43. exec function Taunt( name Sequence )
  44. {
  45. }
  46.  
  47. exec function CallForHelp()
  48. {
  49. }
  50.  
  51. exec function ThrowWeapon()
  52. {
  53. }
  54.  
  55. exec function Suicide()
  56. {
  57. }
  58.  
  59. exec function XFly()
  60. {
  61. UnderWaterTime = -1;
  62. SetCollision(false, false, false);
  63. bCollideWorld = true;
  64. GotoState('CheatFlying');
  65.  
  66. ClientRestart();
  67. }
  68.  
  69. function ServerChangeSkin( coerce string SkinName, coerce string FaceName, byte TeamNum )
  70. {
  71. }
  72.  
  73. function ClientReStart()
  74. {
  75. //log("client restart");
  76. Velocity = vect(0,0,0);
  77. Acceleration = vect(0,0,0);
  78. BaseEyeHeight = Default.BaseEyeHeight;
  79. EyeHeight = BaseEyeHeight;
  80.  
  81. GotoState('CheatFlying');
  82. }
  83.  
  84. function PlayerTimeOut()
  85. {
  86. if (Health > 0)
  87. Died(None, 'dropped', Location);
  88. }
  89.  
  90. exec function Grab()
  91. {
  92. }
  93.  
  94. // Send a message to all players.
  95. exec function Say( string S )
  96. {
  97. if ( Len(S) > 63 )
  98. S = Left(S,63);
  99. if ( !Level.Game.bMuteSpectators )
  100. BroadcastMessage( PlayerReplicationInfo.PlayerName$":"$S, true );
  101. }
  102.  
  103. //=============================================================================
  104. // functions.
  105.  
  106. exec function RestartLevel()
  107. {
  108. }
  109.  
  110. // This pawn was possessed by a player.
  111. function Possess()
  112. {
  113. bIsPlayer = true;
  114. DodgeClickTime = FMin(0.3, DodgeClickTime);
  115. EyeHeight = BaseEyeHeight;
  116. NetPriority = 2;
  117. Weapon = None;
  118. Inventory = None;
  119. XFly();
  120. }
  121.  
  122. function PostBeginPlay()
  123. {
  124. if (Level.LevelEnterText != "" )
  125. ClientMessage(Level.LevelEnterText);
  126. bIsPlayer = true;
  127. FlashScale = vect(1,1,1);
  128. if ( Level.NetMode != NM_Client )
  129. ScoringType = Level.Game.ScoreboardType;
  130. }
  131.  
  132. //=============================================================================
  133. // Inventory-related input notifications.
  134.  
  135. // The player wants to switch to weapon group numer I.
  136. exec function SwitchWeapon (byte F )
  137. {
  138. }
  139.  
  140. exec function NextItem()
  141. {
  142. }
  143.  
  144. exec function PrevItem()
  145. {
  146. }
  147.  
  148. exec function Fire( optional float F )
  149. {
  150. ViewPlayerNum(-1);
  151. bBehindView = bChaseCam;
  152. if ( ViewTarget == None )
  153. bBehindView = false;
  154. }
  155.  
  156. // The player wants to alternate-fire.
  157. exec function AltFire( optional float F )
  158. {
  159. bBehindView = false;
  160. Viewtarget = None;
  161. ClientMessage(ViewingFrom@OwnCamera, 'Event', true);
  162. }
  163.  
  164. //=================================================================================
  165.  
  166. function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation,
  167. Vector momentum, name damageType)
  168. {
  169. }
  170.  
  171.  
RAW Paste Data