Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.38 KB | None | 0 0
  1. #define TA // This is a TA script
  2.  
  3. #include "sfxtype.h"
  4. #include "exptype.h"
  5.  
  6. piece flaremg1, flaremg2, flaremg, flaremini, launcher1, launcher2, base, hullcenter,
  7. hullleft, hullright, drivetrain, tguardleft, tguardright, detail_fl, detail_fr, detail_bl,
  8. detail_br, hullcenter_broken, hullleft_broken, hullright_broken, drivetrain_broken, tguardleft_broken, tguardright_broken, detail_fl_broken,
  9. detail_fr_broken, detail_bl_broken, detail_br_broken, turret, standard, standard_broken, advanced, advanced_broken,
  10. miniturret, gunpitch, standard_sleeves, advanced_sleeves, standard_sleeves_broken, advanced_sleeves_broken, gun, gun1,
  11. gun2, aamissles, id0, id1, n00, n01, n02, n03,
  12. n04, n05, n06, n07, n08, n09, n10, n11,
  13. n12, n13, n14, n15, n16, n17, n18, n19;
  14.  
  15. static-var restore_delay, Static_Var_2, gun_1, Static_Var_4, Static_Var_5,
  16. Static_Var_6, Static_Var_7, Static_Var_8, Static_Var_9, Static_Var_10,
  17. statechg_DesiredState, statechg_StateChanging;
  18.  
  19. // Signal definitions
  20. #define SIG_AIM 2
  21. #define SIG_AIM_2 4
  22.  
  23.  
  24. SmokeUnit(healthpercent, sleeptime, smoketype)
  25. {
  26. while( get BUILD_PERCENT_LEFT )
  27. {
  28. sleep 400;
  29. }
  30. while( TRUE )
  31. {
  32. healthpercent = get HEALTH;
  33. if( healthpercent < 66 )
  34. {
  35. smoketype = 256 | 2;
  36. if( Rand( 1, 66 ) < healthpercent )
  37. {
  38. smoketype = 256 | 1;
  39. }
  40. emit-sfx smoketype from hullcenter;
  41. }
  42. sleeptime = healthpercent * 50;
  43. if( sleeptime < 200 )
  44. {
  45. sleeptime = 200;
  46. }
  47. sleep sleeptime;
  48. }
  49. }
  50.  
  51. Reverse(Func_Var_1)
  52. {
  53. if( Func_Var_1 >= 1 )
  54. {
  55. Static_Var_10 = 1;
  56. turn base to y-axis <180.000000> now;
  57. }
  58. if( Func_Var_1 <= 0 )
  59. {
  60. Static_Var_10 = 0;
  61. turn base to y-axis <0.000000> now;
  62. }
  63. }
  64.  
  65. HitByWeapon(Func_Var_1, Func_Var_2)
  66. {
  67. turn base to z-axis Func_Var_2 speed <105.016484>;
  68. turn base to x-axis Func_Var_1 speed <105.016484>;
  69. wait-for-turn base around z-axis;
  70. wait-for-turn base around x-axis;
  71. turn base to z-axis <0.000000> speed <30.005495>;
  72. turn base to x-axis <0.000000> speed <30.005495>;
  73. }
  74.  
  75. go()
  76. {
  77. }
  78.  
  79. stop()
  80. {
  81. }
  82.  
  83. InitState()
  84. {
  85. statechg_DesiredState = TRUE;
  86. statechg_StateChanging = FALSE;
  87. }
  88.  
  89. RequestState(requestedstate, currentstate)
  90. {
  91. if( statechg_StateChanging )
  92. {
  93. statechg_DesiredState = requestedstate;
  94. return (0);
  95. }
  96. statechg_StateChanging = TRUE;
  97. currentstate = statechg_DesiredState;
  98. statechg_DesiredState = requestedstate;
  99. while( statechg_DesiredState != currentstate )
  100. {
  101. if( statechg_DesiredState == 0 )
  102. {
  103. call-script go();
  104. currentstate = 0;
  105. }
  106. if( statechg_DesiredState == 1 )
  107. {
  108. call-script stop();
  109. currentstate = 1;
  110. }
  111. }
  112. statechg_StateChanging = FALSE;
  113. }
  114.  
  115. Activate()
  116. {
  117. if( Static_Var_2 == 0 )
  118. {
  119. set ACTIVATION to 0;
  120. }
  121. }
  122.  
  123. Deactivate()
  124. {
  125. }
  126.  
  127. reload()
  128. {
  129. set-signal-mask 0;
  130. Static_Var_5 = 1;
  131. sleep 5500;
  132. Static_Var_4 = 1;
  133. Static_Var_5 = 0;
  134. }
  135.  
  136. Create(Func_Var_1)
  137. {
  138. Static_Var_8 = 20000;
  139. Static_Var_7 = 0;
  140. Static_Var_10 = 0;
  141. hide n00;
  142. hide n01;
  143. hide n02;
  144. hide n03;
  145. hide n04;
  146. hide n05;
  147. hide n06;
  148. hide n07;
  149. hide n08;
  150. hide n09;
  151. hide n10;
  152. hide n11;
  153. hide n12;
  154. hide n13;
  155. hide n14;
  156. hide n15;
  157. hide n16;
  158. hide n17;
  159. hide n18;
  160. hide n19;
  161. hide hullcenter_broken;
  162. hide hullleft_broken;
  163. hide hullright_broken;
  164. hide drivetrain_broken;
  165. hide tguardleft_broken;
  166. hide tguardright_broken;
  167. hide detail_fl_broken;
  168. hide detail_fr_broken;
  169. hide detail_bl_broken;
  170. hide detail_br_broken;
  171. hide standard_broken;
  172. hide advanced_broken;
  173. hide standard_sleeves_broken;
  174. hide advanced_sleeves_broken;
  175. hide standard;
  176. hide advanced;
  177. hide miniturret;
  178. hide standard_sleeves;
  179. hide advanced_sleeves;
  180. hide aamissles;
  181. hide gun;
  182. hide gun1;
  183. hide gun2;
  184. hide flaremg;
  185. hide flaremg1;
  186. hide flaremg2;
  187. hide flaremini;
  188. Static_Var_5 = 0;
  189. gun_1 = flaremg1;
  190. restore_delay = 1000;
  191. while( get BUILD_PERCENT_LEFT )
  192. {
  193. sleep 1000;
  194. }
  195. Func_Var_1 = Rand( 0, 9 );
  196. Static_Var_2 = 0;
  197. show standard;
  198. show standard_sleeves;
  199. show gun;
  200. Static_Var_9 = 2;
  201. Static_Var_4 = 1;
  202. if( Func_Var_1 == 0 )
  203. {
  204. Static_Var_2 = 1;
  205. hide standard;
  206. show advanced;
  207. hide standard_sleeves;
  208. show advanced_sleeves;
  209. hide gun;
  210. show gun1;
  211. show gun2;
  212. show aamissles;
  213. Static_Var_6 = 2;
  214. }
  215. show miniturret;
  216. if( Func_Var_1 == 0 )
  217. {
  218. show n00;
  219. }
  220. if( Func_Var_1 == 1 )
  221. {
  222. show n01;
  223. }
  224. if( Func_Var_1 == 2 )
  225. {
  226. show n02;
  227. }
  228. if( Func_Var_1 == 3 )
  229. {
  230. show n03;
  231. }
  232. if( Func_Var_1 == 4 )
  233. {
  234. show n04;
  235. }
  236. if( Func_Var_1 == 5 )
  237. {
  238. show n05;
  239. }
  240. if( Func_Var_1 == 6 )
  241. {
  242. show n06;
  243. }
  244. if( Func_Var_1 == 7 )
  245. {
  246. show n07;
  247. }
  248. if( Func_Var_1 == 8 )
  249. {
  250. show n08;
  251. }
  252. if( Func_Var_1 == 9 )
  253. {
  254. show n09;
  255. }
  256. if( Func_Var_1 > 9 )
  257. {
  258. show n09;
  259. }
  260. Func_Var_1 = Rand( 0, 9 );
  261. if( Func_Var_1 == 0 )
  262. {
  263. show n10;
  264. }
  265. if( Func_Var_1 == 1 )
  266. {
  267. show n11;
  268. }
  269. if( Func_Var_1 == 2 )
  270. {
  271. show n12;
  272. }
  273. if( Func_Var_1 == 3 )
  274. {
  275. show n13;
  276. }
  277. if( Func_Var_1 == 4 )
  278. {
  279. show n14;
  280. }
  281. if( Func_Var_1 == 5 )
  282. {
  283. show n15;
  284. }
  285. if( Func_Var_1 == 6 )
  286. {
  287. show n16;
  288. }
  289. if( Func_Var_1 == 7 )
  290. {
  291. show n17;
  292. }
  293. if( Func_Var_1 == 8 )
  294. {
  295. show n18;
  296. }
  297. if( Func_Var_1 == 9 )
  298. {
  299. show n19;
  300. }
  301. start-script SmokeUnit();
  302. set ACTIVATION to 0;
  303. if( Static_Var_2 == 1 )
  304. {
  305. set ACTIVATION to 1;
  306. }
  307. call-script InitState();
  308. }
  309.  
  310. SetMaxReloadTime(Func_Var_1)
  311. {
  312. restore_delay = Func_Var_1 * 2;
  313. }
  314.  
  315. RestoreAfterDelay()
  316. {
  317. sleep restore_delay;
  318. turn turret to y-axis <0.000000> speed <80.016484>;
  319. turn gunpitch to x-axis <0.000000> speed <60.005495>;
  320. }
  321.  
  322. RestoreAfterDelay2()
  323. {
  324. sleep restore_delay;
  325. turn miniturret to y-axis <0.000000> speed <100.016484>;
  326. turn miniturret to x-axis <0.000000> speed <90.005495>;
  327. }
  328.  
  329. AimPrimary(heading, pitch)
  330. {
  331. signal SIG_AIM;
  332. set-signal-mask SIG_AIM;
  333. if( Static_Var_9 == 2 )
  334. {
  335. if( Static_Var_10 == 0 )
  336. {
  337. turn turret to y-axis heading speed <70.038462>;
  338. }
  339. else
  340. {
  341. turn turret to y-axis <180.000000> + heading speed <70.038462>;
  342. }
  343. turn gunpitch to x-axis <0.000000> - pitch speed <50.027473>;
  344. }
  345. if( Static_Var_9 == 1 )
  346. {
  347. if( Static_Var_10 == 0 )
  348. {
  349. turn turret to y-axis heading speed <60.000000>;
  350. }
  351. else
  352. {
  353. turn turret to y-axis <180.000000> + heading speed <60.000000>;
  354. }
  355. turn gunpitch to x-axis <0.000000> - pitch speed <30.005495>;
  356. }
  357. if( Static_Var_9 == 0 )
  358. {
  359. if( Static_Var_10 == 0 )
  360. {
  361. turn turret to y-axis heading speed <60.000000>;
  362. }
  363. else
  364. {
  365. turn turret to y-axis <180.000000> + heading speed <60.000000>;
  366. }
  367. turn gunpitch to x-axis <0.000000> - pitch speed <30.000000>;
  368. }
  369. if( Static_Var_2 == 0 )
  370. {
  371. while( Static_Var_4 <= 0 )
  372. {
  373. if( Static_Var_5 != 1 )
  374. {
  375. start-script reload();
  376. }
  377. sleep 400;
  378. }
  379. }
  380. while( Static_Var_9 == 0 )
  381. {
  382. sleep 2000;
  383. }
  384. wait-for-turn turret around y-axis;
  385. wait-for-turn gunpitch around x-axis;
  386. start-script RestoreAfterDelay();
  387. return (1);
  388. }
  389.  
  390. FirePrimary()
  391. {
  392. if( Static_Var_2 == 0 )
  393. {
  394. show flaremg;
  395. move gun to z-axis [-2.400000] speed [500.000000];
  396. sleep 150;
  397. hide flaremg;
  398. wait-for-move gun along z-axis;
  399. move gun to z-axis [0.000000] speed [3.000000];
  400. }
  401. if( Static_Var_2 == 1 )
  402. {
  403. if( gun_1 == 0 )
  404. {
  405. show flaremg1;
  406. move gun1 to z-axis [-2.400000] speed [500.000000];
  407. sleep 150;
  408. hide flaremg1;
  409. wait-for-move gun1 along z-axis;
  410. move gun1 to z-axis [0.000000] speed [3.000000];
  411. }
  412. if( gun_1 == 1 )
  413. {
  414. show flaremg2;
  415. move gun2 to z-axis [-2.400000] speed [500.000000];
  416. sleep 150;
  417. hide flaremg2;
  418. wait-for-move gun2 along z-axis;
  419. move gun2 to z-axis [0.000000] speed [3.000000];
  420. }
  421. gun_1 = !gun_1;
  422. }
  423. if( Static_Var_2 == 0 )
  424. {
  425. --Static_Var_4;
  426. if( Static_Var_5 != 1 )
  427. {
  428. start-script reload();
  429. }
  430. }
  431. }
  432.  
  433. QueryPrimary(piecenum)
  434. {
  435. if( Static_Var_2 == 0 )
  436. {
  437. piecenum = flaremg;
  438. }
  439. if( Static_Var_2 == 1 )
  440. {
  441. piecenum = !gun_1;
  442. }
  443. }
  444.  
  445. AimFromPrimary(piecenum)
  446. {
  447. piecenum = turret;
  448. }
  449.  
  450. AimSecondary(heading, pitch)
  451. {
  452. signal SIG_AIM_2;
  453. set-signal-mask SIG_AIM_2;
  454. if( Static_Var_10 == 0 )
  455. {
  456. turn miniturret to y-axis heading speed <325.071429>;
  457. }
  458. else
  459. {
  460. turn miniturret to y-axis <180.000000> + heading speed <325.071429>;
  461. }
  462. turn miniturret to x-axis <-0.005495> - pitch speed <300.071429>;
  463. wait-for-turn miniturret around y-axis;
  464. while( Static_Var_9 == 0 )
  465. {
  466. sleep 2000;
  467. }
  468. start-script RestoreAfterDelay2();
  469. return (1);
  470. }
  471.  
  472. FireSecondary()
  473. {
  474. show flaremini;
  475. sleep 150;
  476. hide flaremini;
  477. }
  478.  
  479. AimFromSecondary(piecenum)
  480. {
  481. piecenum = miniturret;
  482. }
  483.  
  484. QuerySecondary(piecenum)
  485. {
  486. piecenum = flaremini;
  487. }
  488.  
  489. SweetSpot(piecenum)
  490. {
  491. piecenum = base;
  492. }
  493.  
  494. Killed(severity, corpsetype)
  495. {
  496. hide flaremg;
  497. hide flaremg1;
  498. hide flaremg2;
  499. hide flaremini;
  500. if( severity <= 25 )
  501. {
  502. corpsetype = 1;
  503. explode base type BITMAPONLY | BITMAP1;
  504. explode flaremg type BITMAPONLY | BITMAP2;
  505. explode turret type BITMAPONLY | BITMAP4;
  506. explode miniturret type BITMAPONLY | BITMAP2;
  507. explode aamissles type BITMAPONLY | BITMAP5;
  508. return (0);
  509. }
  510. if( severity <= 50 )
  511. {
  512. corpsetype = 2;
  513. explode base type BITMAPONLY | BITMAP1;
  514. explode standard type FALL | BITMAP2;
  515. explode gun type FALL | BITMAP3;
  516. explode aamissles type BITMAPONLY | BITMAP4;
  517. explode hullcenter type SHATTER | BITMAP5;
  518. explode miniturret type FALL | BITMAP2;
  519. return (0);
  520. }
  521. if( severity <= 99 )
  522. {
  523. corpsetype = 3;
  524. explode base type BITMAPONLY | BITMAP1;
  525. explode gun type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
  526. explode hullcenter type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
  527. explode flaremg type BITMAPONLY | BITMAP4;
  528. explode gun type SHATTER | BITMAP5;
  529. explode gun type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
  530. explode standard type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;
  531. return (0);
  532. }
  533. corpsetype = 3;
  534. explode base type BITMAPONLY | BITMAP1;
  535. explode miniturret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
  536. explode hullcenter type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
  537. explode aamissles type BITMAPONLY | BITMAP4;
  538. explode hullcenter type SHATTER | EXPLODE_ON_HIT | BITMAP5;
  539. explode gun type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
  540. explode standard type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;
  541. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement