Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.43 KB | None | 0 0
  1. #define TA // This is a TA script
  2.  
  3. #include "sfxtype.h"
  4. #include "exptype.h"
  5.  
  6. piece base, body, turret, sleeves, barrel1, barrel2, barrel3, barrel4,
  7. sleeves2, flare1, flare2, flare3, flare4, mflare1, mflare2, s1,
  8. s2, m1, m2, f1;
  9.  
  10. static-var restore_delay, gun_1, Static_Var_3, gun_2;
  11.  
  12. // Signal definitions
  13. #define SIG_AIM 2
  14. #define SIG_AIM_2 4
  15.  
  16.  
  17. SmokeUnit(healthpercent, sleeptime, smoketype)
  18. {
  19. var Func_Var_4;
  20. while( get BUILD_PERCENT_LEFT )
  21. {
  22. sleep 400;
  23. }
  24. while( TRUE )
  25. {
  26. healthpercent = get HEALTH;
  27. if( healthpercent < 66 )
  28. {
  29. smoketype = 256 | 2;
  30. if( Rand( 1, 66 ) < healthpercent )
  31. {
  32. smoketype = 256 | 1;
  33. }
  34. Func_Var_4 = Rand( 1, 3 );
  35. if( Func_Var_4 == 1 )
  36. {
  37. emit-sfx smoketype from body;
  38. }
  39. if( Func_Var_4 == 2 )
  40. {
  41. emit-sfx smoketype from barrel1;
  42. }
  43. if( Func_Var_4 == 3 )
  44. {
  45. emit-sfx smoketype from sleeves;
  46. }
  47. }
  48. sleeptime = healthpercent * 50;
  49. if( sleeptime < 200 )
  50. {
  51. sleeptime = 200;
  52. }
  53. sleep sleeptime;
  54. }
  55. }
  56.  
  57. Create()
  58. {
  59. dont-cache s1;
  60. dont-cache s2;
  61. dont-cache m1;
  62. dont-cache m2;
  63. dont-cache sleeves;
  64. dont-cache sleeves2;
  65. dont-cache barrel1;
  66. dont-cache barrel2;
  67. dont-cache barrel3;
  68. dont-cache barrel4;
  69. dont-cache turret;
  70. dont-cache flare2;
  71. dont-cache flare1;
  72. dont-cache flare3;
  73. dont-cache flare4;
  74. hide flare1;
  75. hide flare2;
  76. hide flare3;
  77. hide flare4;
  78. gun_1 = body;
  79. Static_Var_3 = 1;
  80. turn sleeves2 to x-axis <-45.000000> now;
  81. restore_delay = 3000;
  82. start-script SmokeUnit();
  83. return (1);
  84. }
  85.  
  86. RestoreAfterDelay()
  87. {
  88. sleep restore_delay;
  89. set-signal-mask 0;
  90. turn sleeves to x-axis <0.000000> speed <76.516484>;
  91. turn turret to y-axis <0.000000> speed <76.516484>;
  92. wait-for-turn sleeves around y-axis;
  93. wait-for-turn turret around x-axis;
  94. }
  95.  
  96. SetMaxReloadTime(Func_Var_1)
  97. {
  98. restore_delay = Func_Var_1 * 2;
  99. }
  100.  
  101. AimPrimary(heading, pitch)
  102. {
  103. signal SIG_AIM;
  104. set-signal-mask SIG_AIM;
  105. turn turret to y-axis heading speed <229.549451>;
  106. turn sleeves to x-axis <0.000000> - pitch speed <229.549451>;
  107. wait-for-turn sleeves around x-axis;
  108. wait-for-turn turret around y-axis;
  109. start-script RestoreAfterDelay();
  110. return (1);
  111. }
  112.  
  113. AimSecondary(heading, pitch)
  114. {
  115. signal SIG_AIM_2;
  116. set-signal-mask SIG_AIM_2;
  117. turn f1 to x-axis <90.000000> now;
  118. turn f1 to y-axis heading now;
  119. return (1);
  120. }
  121.  
  122. FirePrimary(Func_Var_1)
  123. {
  124. set VETERAN_LEVEL to 0;
  125. if( gun_1 == 1 )
  126. {
  127. move barrel1 to z-axis [-1.500000] speed [60.000000];
  128. wait-for-move barrel1 along z-axis;
  129. move barrel1 to z-axis [0.000000] speed [30.000000];
  130. show flare1;
  131. sleep 150;
  132. hide flare1;
  133. }
  134. if( gun_1 == 2 )
  135. {
  136. move barrel2 to z-axis [-1.500000] speed [60.000000];
  137. wait-for-move barrel2 along z-axis;
  138. move barrel2 to z-axis [0.000000] speed [30.000000];
  139. show flare2;
  140. sleep 150;
  141. hide flare2;
  142. }
  143. if( gun_1 == 3 )
  144. {
  145. move barrel3 to z-axis [-1.500000] speed [60.000000];
  146. wait-for-move barrel3 along z-axis;
  147. move barrel3 to z-axis [0.000000] speed [30.000000];
  148. show flare3;
  149. sleep 150;
  150. hide flare3;
  151. }
  152. if( gun_1 == 4 )
  153. {
  154. move barrel4 to z-axis [-1.500000] speed [60.000000];
  155. wait-for-move barrel4 along z-axis;
  156. move barrel4 to z-axis [0.000000] speed [30.000000];
  157. show flare4;
  158. sleep 150;
  159. hide flare4;
  160. }
  161. ++gun_1;
  162. if( gun_1 == 5 )
  163. {
  164. gun_1 = body;
  165. }
  166. }
  167.  
  168. FireSecondary()
  169. {
  170. gun_2 = !gun_2;
  171. }
  172.  
  173. AimFromPrimary(piecenum)
  174. {
  175. piecenum = turret;
  176. }
  177.  
  178. AimFromSecondary(piecenum)
  179. {
  180. piecenum = f1;
  181. }
  182.  
  183. QueryPrimary(piecenum)
  184. {
  185. if( gun_1 == 1 )
  186. {
  187. piecenum = flare1;
  188. }
  189. if( gun_1 == 2 )
  190. {
  191. piecenum = flare2;
  192. }
  193. if( gun_1 == 3 )
  194. {
  195. piecenum = flare3;
  196. }
  197. if( gun_1 == 4 )
  198. {
  199. piecenum = flare4;
  200. }
  201. }
  202.  
  203. QuerySecondary(piecenum)
  204. {
  205. if( gun_2 == 0 )
  206. {
  207. piecenum = mflare1;
  208. }
  209. if( gun_2 == 1 )
  210. {
  211. piecenum = mflare2;
  212. }
  213. }
  214.  
  215. Killed(severity, corpsetype)
  216. {
  217. hide flare1;
  218. hide flare2;
  219. hide flare3;
  220. hide flare4;
  221. if( severity <= 25 )
  222. {
  223. corpsetype = 1;
  224. explode body type BITMAPONLY | BITMAP1;
  225. explode turret type BITMAPONLY | BITMAP2;
  226. explode sleeves type BITMAPONLY | BITMAP5;
  227. explode barrel1 type BITMAPONLY | BITMAP1;
  228. explode barrel2 type BITMAPONLY | BITMAP2;
  229. return (0);
  230. }
  231. if( severity <= 50 )
  232. {
  233. corpsetype = 2;
  234. explode turret type SHATTER | FALL | BITMAP1;
  235. explode body type BITMAPONLY | BITMAP2;
  236. explode sleeves type FALL | BITMAP5;
  237. explode barrel1 type BITMAPONLY | BITMAP1;
  238. explode barrel2 type BITMAPONLY | BITMAP2;
  239. explode barrel3 type BITMAPONLY | BITMAP1;
  240. explode barrel4 type BITMAPONLY | BITMAP2;
  241. return (0);
  242. }
  243. if( severity <= 99 )
  244. {
  245. corpsetype = 3;
  246. explode turret type SHATTER | FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
  247. explode body type BITMAPONLY | BITMAP2;
  248. explode sleeves type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;
  249. explode barrel2 type BITMAPONLY | BITMAP1;
  250. explode barrel1 type BITMAPONLY | BITMAP2;
  251. explode barrel3 type BITMAPONLY | BITMAP1;
  252. explode barrel4 type BITMAPONLY | BITMAP2;
  253. return (0);
  254. }
  255. corpsetype = 3;
  256. explode turret type SHATTER | FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
  257. explode body type BITMAPONLY | BITMAP2;
  258. explode sleeves type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;
  259. explode barrel2 type BITMAPONLY | BITMAP1;
  260. explode barrel1 type BITMAPONLY | BITMAP2;
  261. explode barrel3 type BITMAPONLY | BITMAP1;
  262. explode barrel4 type BITMAPONLY | BITMAP2;
  263. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement