Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 4.41 KB | None | 0 0
  1. #define TA          // This is a TA script
  2.  
  3. #include "sfxtype.h"
  4. #include "exptype.h"
  5.  
  6. piece  flare1, flare2, base, wing1, wing2, rearthrust;
  7.  
  8. static-var  Static_Var_1, statechg_DesiredState, statechg_StateChanging, Static_Var_4, bMoving;
  9.  
  10.  
  11. lua_UnitStoppedMoving()
  12. {
  13.     return 0;
  14. }
  15.  
  16. lua_UnitStartedMoving()
  17. {
  18.     return 0;
  19. }
  20.  
  21. activatescr()
  22. {
  23.     move wing1 to x-axis [0.000000] now;
  24.     move wing1 to x-axis [4.999985] speed [5.010010];
  25.     move wing1 to z-axis [0.000000] now;
  26.     move wing1 to z-axis [-1.374985] speed [1.377747];
  27.     move wing2 to x-axis [0.000000] now;
  28.     move wing2 to x-axis [-5.624985] speed [5.636215];
  29.     move wing2 to z-axis [0.000000] now;
  30.     move wing2 to z-axis [-1.499985] speed [1.502945];
  31.     sleep 998;
  32. }
  33.  
  34. deactivatescr()
  35. {
  36.     move wing1 to x-axis [4.999985] now;
  37.     move wing1 to x-axis [0.000000] speed [5.010010];
  38.     move wing1 to z-axis [-1.374985] now;
  39.     move wing1 to z-axis [0.000000] speed [1.377747];
  40.     move wing2 to x-axis [-5.624985] now;
  41.     move wing2 to x-axis [0.000000] speed [5.636215];
  42.     move wing2 to z-axis [-1.499985] now;
  43.     move wing2 to z-axis [0.000000] speed [1.502945];
  44.     sleep 998;
  45. }
  46.  
  47. SmokeUnit(healthpercent, sleeptime, smoketype)
  48. {
  49.     while( get BUILD_PERCENT_LEFT )
  50.     {
  51.         sleep 500;
  52.     }
  53.     while( TRUE )
  54.     {
  55.         healthpercent = get HEALTH;
  56.         if( healthpercent < 66 )
  57.         {
  58.             smoketype = 258;
  59.             if( Rand( 1, 66 ) < healthpercent )
  60.             {
  61.                 smoketype = 257;
  62.             }
  63.             emit-sfx smoketype from base;
  64.         }
  65.         sleeptime = healthpercent * 50;
  66.         if( sleeptime < 200 )
  67.         {
  68.             sleeptime = 200;
  69.         }
  70.         sleep sleeptime;
  71.     }
  72. }
  73.  
  74. RequestState(requestedstate, currentstate)
  75. {
  76.     if( statechg_StateChanging )
  77.     {
  78.         statechg_DesiredState = requestedstate;
  79.         return (0);
  80.     }
  81.     statechg_StateChanging = TRUE;
  82.     currentstate = statechg_DesiredState;
  83.     statechg_DesiredState = requestedstate;
  84.     while( statechg_DesiredState != currentstate )
  85.     {
  86.         if( statechg_DesiredState )
  87.         {
  88.             call-script deactivatescr();
  89.             currentstate = 1;
  90.         }
  91.         else
  92.         {
  93.             call-script activatescr();
  94.             currentstate = 0;
  95.         }
  96.     }
  97.     statechg_StateChanging = FALSE;
  98. }
  99.  
  100. Create()
  101. {
  102.     Static_Var_1 = 0;
  103.     statechg_DesiredState = TRUE;
  104.     statechg_StateChanging = FALSE;
  105.     //start-script Flamers();
  106.     //start-script Crashing();
  107.     start-script SmokeUnit();
  108. }
  109.  
  110. Activate()
  111. {
  112.     start-script RequestState(0);
  113. }
  114.  
  115. Deactivate()
  116. {
  117.     start-script RequestState(1);
  118. }
  119.  
  120. StartMoving()
  121. {
  122.     bMoving = TRUE;
  123.     get PRINT(99,bMoving)
  124.     call-script lua_UnitStartedMoving();
  125. }
  126.  
  127. StopMoving()
  128. {
  129.     bMoving = FALSE;
  130.     get PRINT(9,bMoving)
  131.     call-script lua_UnitStoppedMoving();
  132. }
  133.  
  134. AimFromPrimary(piecenum)
  135. {
  136.     piecenum = flare1;
  137. }
  138.  
  139. AimPrimary(piecenum)
  140. {
  141.     if( bMoving )
  142.     {
  143.         return (1);
  144.     }
  145. }
  146.  
  147. QueryPrimary(piecenum)
  148. {
  149.     piecenum = flare1;
  150. }
  151.  
  152. AimFromSecondary(piecenum)
  153. {
  154.     piecenum = flare1;
  155. }
  156.  
  157. AimSecondary(piecenum)
  158. {
  159.     if( bMoving )
  160.     {
  161.         return (1);
  162.     }
  163. }
  164.  
  165. QuerySecondary(piecenum)
  166. {
  167.     piecenum = flare2;
  168. }
  169.  
  170. SweetSpot(piecenum)
  171. {
  172.     piecenum = base;
  173. }
  174.  
  175. Killed(severity, corpsetype)
  176. {
  177.     //start-script Crashing();
  178.     if( severity <= 25 )
  179.     {
  180.         corpsetype = 1;
  181.         explode base type BITMAPONLY | BITMAP1;
  182.         explode flare1 type BITMAPONLY | BITMAP2;
  183.         explode flare2 type BITMAPONLY | BITMAP3;
  184.         explode rearthrust type BITMAPONLY | BITMAP4;
  185.         explode wing1 type BITMAPONLY | BITMAP5;
  186.         explode wing2 type BITMAPONLY | BITMAP1;
  187.         return (0);
  188.     }
  189.     if( severity <= 50 )
  190.     {
  191.         corpsetype = 2;
  192.         explode base type BITMAPONLY | BITMAP1;
  193.         explode flare1 type FALL | BITMAP2;
  194.         explode flare2 type FALL | BITMAP3;
  195.         explode rearthrust type FALL | BITMAP4;
  196.         explode wing1 type BITMAPONLY | BITMAP5;
  197.         explode wing2 type SHATTER | BITMAP1;
  198.         return (0);
  199.     }
  200.     if( severity <= 99 )
  201.     {
  202.         corpsetype = 3;
  203.         explode base type BITMAPONLY | BITMAP1;
  204.         explode flare1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
  205.         explode flare2 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
  206.         explode rearthrust type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP4;
  207.         explode wing1 type BITMAPONLY | BITMAP5;
  208.         explode wing2 type SHATTER | BITMAP1;
  209.         return (0);
  210.     }
  211.     corpsetype = 3;
  212.     explode base type BITMAPONLY | BITMAP1;
  213.     explode flare1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
  214.     explode flare2 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
  215.     explode rearthrust type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP4;
  216.     explode wing1 type BITMAPONLY | BITMAP5;
  217.     explode wing2 type SHATTER | EXPLODE_ON_HIT | BITMAP1;
  218. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement