Advertisement
Guest User

Untitled

a guest
Feb 18th, 2013
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.97 KB | None | 0 0
  1. //=============================================================================
  2. // DXNMission68Script.
  3. //=============================================================================
  4. class DXNMission68Script extends MissionScript;
  5.  
  6. var byte savedSoundVolume;
  7. var float endgameDelays[4];
  8. var float endgameTimer;
  9. var localized string endgameQuote[8];
  10. var HUDMissionStartTextDisplay quoteDisplay;
  11. var bool bQuotePrinted;
  12. var Float displayTime;
  13.  
  14. // ----------------------------------------------------------------------
  15. // InitStateMachine()
  16. // ----------------------------------------------------------------------
  17.  
  18. function InitStateMachine()
  19. {
  20. Super.InitStateMachine();
  21.  
  22. // Set the PlayerTraveling flag (always want it set for
  23. // the intro and endgames)
  24. flags.SetBool('PlayerTraveling', True, True, 0);
  25. }
  26.  
  27. // ----------------------------------------------------------------------
  28. // FirstFrame()
  29. //
  30. // Stuff to check at first frame
  31. // ----------------------------------------------------------------------
  32.  
  33. function FirstFrame()
  34. {
  35.  
  36. Super.FirstFrame();
  37.  
  38. endgameTimer = 0.0;
  39.  
  40. if (Player != None)
  41. {
  42.  
  43. // Start the conversation
  44.  
  45.  
  46. // turn down the sound so we can hear the speech
  47. savedSoundVolume = SoundVolume;
  48. SoundVolume = 32;
  49. Player.SetInstantSoundVolume(SoundVolume);
  50. }
  51.  
  52.  
  53.  
  54. }
  55.  
  56. // ----------------------------------------------------------------------
  57. // PreTravel()
  58. //
  59. // Set flags upon exit of a certain map
  60. // ----------------------------------------------------------------------
  61.  
  62. function PreTravel()
  63. {
  64. // restore the sound volume
  65. SoundVolume = savedSoundVolume;
  66. Player.SetInstantSoundVolume(SoundVolume);
  67.  
  68. Super.PreTravel();
  69. }
  70.  
  71. // ----------------------------------------------------------------------
  72. // FinishCinematic()
  73. // ----------------------------------------------------------------------
  74.  
  75. function FinishCinematic()
  76. {
  77. local CameraPoint cPoint;
  78.  
  79. if (quoteDisplay != None)
  80. {
  81. quoteDisplay.Destroy();
  82. quoteDisplay = None;
  83. }
  84.  
  85. // Loop through all the CameraPoints and set the "nextPoint"
  86. // to None will will effectively cause them to halt.
  87. // This prevents the screen from fading while the credits are rolling.
  88.  
  89. foreach player.AllActors(class'CameraPoint', cPoint)
  90. cPoint.nextPoint = None;
  91.  
  92. flags.SetBool('EndgameExplosions', False);
  93. SetTimer(0, False);
  94. Player.ShowCredits(True);
  95. }
  96.  
  97. // ----------------------------------------------------------------------
  98. // PrintEndgameQuote()
  99. // ----------------------------------------------------------------------
  100.  
  101. function PrintEndgameQuote(int num)
  102. {
  103. local int i;
  104. local DeusExRootWindow root;
  105.  
  106. bQuotePrinted = True;
  107. flags.SetBool('EndgameExplosions', False);
  108.  
  109. root = DeusExRootWindow(Player.rootWindow);
  110. if (root != None)
  111. {
  112. quoteDisplay = HUDMissionStartTextDisplay(root.NewChild(Class'HUDMissionStartTextDisplay', True));
  113. if (quoteDisplay != None)
  114. {
  115. // quoteDisplay.displayTime = endgameDelays[num];
  116. quoteDisplay.SetWindowAlignments(HALIGN_Center, VALIGN_Center);
  117.  
  118. for (i=0; i<2; i++)
  119. quoteDisplay.AddMessage(endgameQuote[2*num+i]);
  120.  
  121. quoteDisplay.StartMessage();
  122. }
  123. }
  124. }
  125.  
  126. // ----------------------------------------------------------------------
  127. // ExplosionEffects()
  128. // ----------------------------------------------------------------------
  129.  
  130. function ExplosionEffects()
  131. {
  132. local float size;
  133. local int i;
  134. local Vector loc, endloc, HitLocation, HitNormal;
  135. local Actor HitActor;
  136. local MetalFragment frag;
  137.  
  138. if (FRand() < 0.8)
  139. {
  140. // pick a random explosion size and modify everything accordingly
  141. size = FRand();
  142.  
  143. // play a sound
  144. if (size < 0.5)
  145. Player.PlaySound(Sound'LargeExplosion1', SLOT_None, 2.0,, 16384);
  146. else
  147. Player.PlaySound(Sound'LargeExplosion2', SLOT_None, 2.0,, 16384);
  148.  
  149. // have random metal fragments fall from the ceiling
  150. if (FRand() < 0.8)
  151. {
  152. for (i=0; i<Int(size*10.0); i++)
  153. {
  154. loc = Player.Location + 512.0 * VRand();
  155. loc.Z = Player.Location.Z;
  156. endloc = loc;
  157. endloc.Z += 1024.0;
  158. HitActor = Trace(HitLocation, HitNormal, endloc, loc, False);
  159. if (HitActor == None)
  160. HitLocation = endloc;
  161.  
  162. // spawn some explosion effects
  163. if (size < 0.5)
  164. Spawn(class'ExplosionMedium',,, HitLocation+8*HitNormal);
  165. else
  166. Spawn(class'ExplosionLarge',,, HitLocation+8*HitNormal);
  167.  
  168. if (FRand() < 0.5)
  169. {
  170. frag = Spawn(class'MetalFragment',,, HitLocation);
  171. if (frag != None)
  172. {
  173. frag.CalcVelocity(vect(20000,0,0),256);
  174. frag.DrawScale = 0.5 + 2.0 * FRand();
  175. if (FRand() < 0.75)
  176. frag.bSmoking = True;
  177. }
  178. }
  179. }
  180. }
  181. }
  182. }
  183.  
  184. // ----------------------------------------------------------------------
  185. // ----------------------------------------------------------------------
  186.  
  187. defaultproperties
  188. {
  189. displayTime=5.000000
  190. endgameDelays(0)=13.500000
  191. endgameDelays(1)=13.500000
  192. endgameDelays(2)=10.500000
  193. endgameDelays(3)=10.500000
  194. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement