ForbodingAngel

Untitled

Mar 8th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. #define TA // This is a TA script
  2.  
  3.  
  4. piece base, nanopoint1, nanopoint2, frontwings, fengine1, fengine2, rearwings, rengine1, rengine2, righttip, lefttip;
  5.  
  6. #include "sfxtype.h"
  7. #include "exptype.h"
  8.  
  9. #define SIG_ACTIVATE 2
  10. #define jethtrail 1024+0
  11. #define nanoflame 1025+0
  12.  
  13. static-var bMoving, terraintype, statechg_DesiredState, statechg_StateChanging, building, moving, flames, spray;
  14.  
  15. SmokeUnit(healthpercent, sleeptime, smoketype)
  16. {
  17. while( get BUILD_PERCENT_LEFT )
  18. {
  19. sleep 400;
  20. }
  21. while( TRUE )
  22. {
  23. healthpercent = get HEALTH;
  24. if( healthpercent < 66 )
  25. {
  26. smoketype = 256 | 2;
  27. if( Rand( 1, 66 ) < healthpercent )
  28. {
  29. smoketype = 256 | 1;
  30. }
  31. emit-sfx 1026 from base;
  32. }
  33. sleeptime = healthpercent * 50;
  34. if( sleeptime < 200 )
  35. {
  36. sleeptime = 200;
  37. }
  38. sleep sleeptime;
  39. }
  40. }
  41.  
  42. Thrust()
  43. {
  44. while( TRUE )
  45. {
  46. if (moving)
  47. {
  48. emit-sfx jethtrail from fengine1;
  49. emit-sfx jethtrail from fengine2;
  50. emit-sfx jethtrail from rengine1;
  51. emit-sfx jethtrail from rengine2;
  52. }
  53. sleep 5;
  54. }
  55. }
  56.  
  57. buildflame()
  58. {
  59. while( TRUE )
  60. {
  61. if (building == TRUE)
  62. {
  63. emit-sfx nanoflame from nanopoint1;
  64. emit-sfx nanoflame from nanopoint2;
  65.  
  66. }
  67. sleep 600;
  68. }
  69. }
  70.  
  71.  
  72.  
  73. InitState()
  74. {
  75. statechg_DesiredState = TRUE;
  76. statechg_StateChanging = FALSE;
  77. }
  78.  
  79. Create()
  80. {
  81. // start-script Thrust();
  82. start-script SmokeUnit();
  83. call-script InitState();
  84. // turn fengine1 to y-axis <180> now;
  85. // turn fengine2 to y-axis <180> now;
  86. // turn rengine1 to y-axis <180> now;
  87. // turn rengine2 to y-axis <180> now;
  88. building = FALSE;
  89. spray = 0;
  90. start-script buildflame();
  91. }
  92.  
  93. Go(heading, pitch)
  94. {
  95. building = TRUE;
  96. set INBUILDSTANCE to 1;
  97.  
  98.  
  99. while (1) {
  100. spin lefttip around y-axis speed <50.005495>;
  101. spin righttip around y-axis speed <50.005495>;
  102. sleep 30;
  103. }
  104. }
  105.  
  106. Stop()
  107. {
  108. building = FALSE;
  109. set INBUILDSTANCE to 0;
  110.  
  111. stop-spin lefttip around z-axis decelerate <15.000000>;
  112. stop-spin righttip around z-axis decelerate <15.000000>;
  113. }
  114.  
  115. RequestState(requestedstate, currentstate)
  116. {
  117. if( statechg_StateChanging )
  118. {
  119. statechg_DesiredState = requestedstate;
  120. return (0);
  121. }
  122. statechg_StateChanging = TRUE;
  123. currentstate = statechg_DesiredState;
  124. statechg_DesiredState = requestedstate;
  125. while( statechg_DesiredState != currentstate )
  126. {
  127. if( statechg_DesiredState == 0 )
  128. {
  129. call-script Go();
  130. currentstate = 0;
  131. }
  132. if( statechg_DesiredState == 1 )
  133. {
  134. call-script Stop();
  135. currentstate = 1;
  136. }
  137. }
  138. statechg_StateChanging = FALSE;
  139. }
  140.  
  141. Activate()
  142. {
  143. signal SIG_ACTIVATE;
  144. start-script RequestState(0);
  145. }
  146.  
  147. Deactivate()
  148. {
  149. signal SIG_ACTIVATE;
  150. set-signal-mask SIG_ACTIVATE;
  151.  
  152. set-signal-mask 0;
  153. start-script RequestState(1);
  154. }
  155.  
  156. QueryBuildInfo(piecenum)
  157. {
  158. piecenum = nanopoint1;
  159. }
  160.  
  161. QueryNanoPiece(piecenum)
  162. {
  163. if( spray == 0 )
  164. {
  165. piecenum = nanopoint1;
  166. }
  167. if( spray == 1 )
  168. {
  169. piecenum = nanopoint2;
  170. }
  171. ++spray;
  172. if( spray >= 2 )
  173. {
  174. spray = 0;
  175. }
  176. }
  177.  
  178.  
  179. StartMoving()
  180. {
  181. bMoving = TRUE;
  182. moving=1;
  183. }
  184.  
  185. StopMoving()
  186. {
  187. bMoving = FALSE;
  188. moving=0;
  189. }
  190.  
  191. MoveRate0()
  192. {
  193. flames=0;
  194. turn frontwings to x-axis <-90.000000> speed <150.000000>;
  195. turn rearwings to x-axis <-90.000000> speed <150.000000>;
  196. }
  197. MoveRate1()
  198. {
  199. flames=0;
  200. turn frontwings to x-axis <-70.005495> speed <150.000000>;
  201. turn rearwings to x-axis <-70.005495> speed <150.000000>;
  202. }
  203. MoveRate2()
  204. {
  205. flames=1;
  206. turn frontwings to x-axis <0.000000> speed <150.000000>;
  207. turn rearwings to x-axis <0.000000> speed <150.000000>;
  208. }
  209.  
  210.  
  211.  
  212. Killed(severity, corpsetype) // how it explodes
  213. {
  214. corpsetype = 1;
  215. explode lefttip type EXPLODE_ON_HIT;
  216. explode righttip type EXPLODE_ON_HIT;
  217. explode base type EXPLODE_ON_HIT;
  218. explode frontwings type EXPLODE_ON_HIT;
  219. explode rearwings type EXPLODE_ON_HIT;
  220. }
Advertisement
Add Comment
Please, Sign In to add comment