ForbodingAngel

Untitled

May 1st, 2014
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. #define TA // This is a TA script
  2.  
  3. #include "sfxtype.h"
  4. #include "exptype.h"
  5.  
  6.  
  7. piece base, turret, barrel1, firepoint1, dirt; // these are the pieces of the model
  8.  
  9. #include "ROCKUNIT.H"
  10.  
  11. static-var gun_1, terraintype, bmoving, moving; // these are the variables
  12.  
  13. // Signal definitions
  14. #define SIG_AIM 2 // this is a aim define
  15.  
  16.  
  17. SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define
  18. {
  19. while( get BUILD_PERCENT_LEFT )
  20. {
  21. sleep 400;
  22. }
  23. while( TRUE )
  24. {
  25. healthpercent = get HEALTH;
  26. if( healthpercent < 66 )
  27. {
  28. smoketype = 256 | 2;
  29. if( Rand( 1, 66 ) < healthpercent )
  30. {
  31. smoketype = 256 | 1;
  32. }
  33. emit-sfx 1026 from base;
  34. }
  35. sleeptime = healthpercent * 50;
  36. if( sleeptime < 200 )
  37. {
  38. sleeptime = 200;
  39. }
  40. sleep sleeptime;
  41. }
  42. }
  43.  
  44. EmitWakes()
  45. {
  46. while( TRUE )
  47. {
  48. if( bMoving )
  49. {
  50. emit-sfx 2 from base;
  51. }
  52. sleep 300;
  53. }
  54. }
  55.  
  56. setSFXoccupy(setSFXoccupy_argument)
  57. {
  58. terraintype = setSFXoccupy_argument;
  59.  
  60. if(terraintype == 2)
  61. {
  62. move base to y-axis [-0.85] speed [50];
  63. set UPRIGHT to 1;
  64. }
  65. else
  66. {
  67. move base to y-axis [0.0] speed [50];
  68. set UPRIGHT to 0;
  69. }
  70. if(terraintype == 4)
  71. {
  72. move base to y-axis [0] speed [50];
  73. set UPRIGHT to 0;
  74. }
  75. else
  76. {
  77. move base to y-axis [-0.85] speed [50];
  78. set UPRIGHT to 1;
  79. }
  80. }
  81.  
  82. Thrust()
  83. {
  84. while( TRUE )
  85. {
  86. if (moving)
  87. {
  88. emit-sfx 1025 + 0 from dirt;
  89. }
  90. sleep 400;
  91. }
  92. }
  93.  
  94. StartMoving()
  95. {
  96. moving=1;
  97. }
  98.  
  99. StopMoving()
  100. {
  101. moving=0;
  102. }
  103.  
  104. Create() // tells it what to do on creation
  105. {
  106. start-script Thrust();
  107. start-script setSFXoccupy();
  108. start-script EmitWakes();
  109. start-script SmokeUnit();
  110. }
  111.  
  112. RestoreAfterDelay() // restore function to turn the turret and so forth back to start
  113. {
  114. sleep 3000;
  115. turn turret to y-axis <0> speed <60>;
  116. turn barrel1 to x-axis <0> speed <30>;
  117. }
  118.  
  119. AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming
  120. {
  121. signal SIG_AIM;
  122. set-signal-mask SIG_AIM;
  123. turn turret to y-axis heading speed <225>;
  124. turn barrel1 to x-axis <0> - pitch speed <150>;
  125. wait-for-turn turret around y-axis;
  126. wait-for-turn barrel1 around x-axis;
  127. start-script RestoreAfterDelay();
  128. return (1);
  129. }
  130.  
  131. FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets
  132. {
  133. emit-sfx 1024 + 0 from firepoint1;
  134. }
  135.  
  136. AimFromWeapon1(piecenum) // where it aims the weapon from
  137. {
  138. piecenum = turret;
  139. }
  140.  
  141. QueryWeapon1(piecenum) // where the shot is called from
  142. {
  143. piecenum = firepoint1;
  144. }
  145.  
  146.  
  147. Killed(severity, corpsetype) // how it explodes
  148. {
  149. corpsetype = 1;
  150. explode barrel1 type EXPLODE_ON_HIT;
  151. explode turret type EXPLODE_ON_HIT;
  152. }
Advertisement
Add Comment
Please, Sign In to add comment