Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define TA // This is a TA script
- #include "sfxtype.h"
- #include "exptype.h"
- piece base, body, turret, sleeves, barrel1, barrel2, barrel3, barrel4,
- sleeves2, flare1, flare2, flare3, flare4, mflare1, mflare2, s1,
- s2, m1, m2, f1;
- static-var restore_delay, gun_1, Static_Var_3, gun_2;
- // Signal definitions
- #define SIG_AIM 2
- #define SIG_AIM_2 4
- SmokeUnit(healthpercent, sleeptime, smoketype)
- {
- var Func_Var_4;
- while( get BUILD_PERCENT_LEFT )
- {
- sleep 400;
- }
- while( TRUE )
- {
- healthpercent = get HEALTH;
- if( healthpercent < 66 )
- {
- smoketype = 256 | 2;
- if( Rand( 1, 66 ) < healthpercent )
- {
- smoketype = 256 | 1;
- }
- Func_Var_4 = Rand( 1, 3 );
- if( Func_Var_4 == 1 )
- {
- emit-sfx smoketype from body;
- }
- if( Func_Var_4 == 2 )
- {
- emit-sfx smoketype from barrel1;
- }
- if( Func_Var_4 == 3 )
- {
- emit-sfx smoketype from sleeves;
- }
- }
- sleeptime = healthpercent * 50;
- if( sleeptime < 200 )
- {
- sleeptime = 200;
- }
- sleep sleeptime;
- }
- }
- Create()
- {
- dont-cache s1;
- dont-cache s2;
- dont-cache m1;
- dont-cache m2;
- dont-cache sleeves;
- dont-cache sleeves2;
- dont-cache barrel1;
- dont-cache barrel2;
- dont-cache barrel3;
- dont-cache barrel4;
- dont-cache turret;
- dont-cache flare2;
- dont-cache flare1;
- dont-cache flare3;
- dont-cache flare4;
- hide flare1;
- hide flare2;
- hide flare3;
- hide flare4;
- gun_1 = body;
- Static_Var_3 = 1;
- turn sleeves2 to x-axis <-45.000000> now;
- restore_delay = 3000;
- start-script SmokeUnit();
- return (1);
- }
- RestoreAfterDelay()
- {
- sleep restore_delay;
- set-signal-mask 0;
- turn sleeves to x-axis <0.000000> speed <76.516484>;
- turn turret to y-axis <0.000000> speed <76.516484>;
- wait-for-turn sleeves around y-axis;
- wait-for-turn turret around x-axis;
- }
- SetMaxReloadTime(Func_Var_1)
- {
- restore_delay = Func_Var_1 * 2;
- }
- AimPrimary(heading, pitch)
- {
- signal SIG_AIM;
- set-signal-mask SIG_AIM;
- turn turret to y-axis heading speed <229.549451>;
- turn sleeves to x-axis <0.000000> - pitch speed <229.549451>;
- wait-for-turn sleeves around x-axis;
- wait-for-turn turret around y-axis;
- start-script RestoreAfterDelay();
- return (1);
- }
- AimSecondary(heading, pitch)
- {
- signal SIG_AIM_2;
- set-signal-mask SIG_AIM_2;
- turn f1 to x-axis <90.000000> now;
- turn f1 to y-axis heading now;
- return (1);
- }
- FirePrimary(Func_Var_1)
- {
- set VETERAN_LEVEL to 0;
- if( gun_1 == 1 )
- {
- move barrel1 to z-axis [-1.500000] speed [60.000000];
- wait-for-move barrel1 along z-axis;
- move barrel1 to z-axis [0.000000] speed [30.000000];
- show flare1;
- sleep 150;
- hide flare1;
- }
- if( gun_1 == 2 )
- {
- move barrel2 to z-axis [-1.500000] speed [60.000000];
- wait-for-move barrel2 along z-axis;
- move barrel2 to z-axis [0.000000] speed [30.000000];
- show flare2;
- sleep 150;
- hide flare2;
- }
- if( gun_1 == 3 )
- {
- move barrel3 to z-axis [-1.500000] speed [60.000000];
- wait-for-move barrel3 along z-axis;
- move barrel3 to z-axis [0.000000] speed [30.000000];
- show flare3;
- sleep 150;
- hide flare3;
- }
- if( gun_1 == 4 )
- {
- move barrel4 to z-axis [-1.500000] speed [60.000000];
- wait-for-move barrel4 along z-axis;
- move barrel4 to z-axis [0.000000] speed [30.000000];
- show flare4;
- sleep 150;
- hide flare4;
- }
- ++gun_1;
- if( gun_1 == 5 )
- {
- gun_1 = body;
- }
- }
- FireSecondary()
- {
- gun_2 = !gun_2;
- }
- AimFromPrimary(piecenum)
- {
- piecenum = turret;
- }
- AimFromSecondary(piecenum)
- {
- piecenum = f1;
- }
- QueryPrimary(piecenum)
- {
- if( gun_1 == 1 )
- {
- piecenum = flare1;
- }
- if( gun_1 == 2 )
- {
- piecenum = flare2;
- }
- if( gun_1 == 3 )
- {
- piecenum = flare3;
- }
- if( gun_1 == 4 )
- {
- piecenum = flare4;
- }
- }
- QuerySecondary(piecenum)
- {
- if( gun_2 == 0 )
- {
- piecenum = mflare1;
- }
- if( gun_2 == 1 )
- {
- piecenum = mflare2;
- }
- }
- Killed(severity, corpsetype)
- {
- hide flare1;
- hide flare2;
- hide flare3;
- hide flare4;
- if( severity <= 25 )
- {
- corpsetype = 1;
- explode body type BITMAPONLY | BITMAP1;
- explode turret type BITMAPONLY | BITMAP2;
- explode sleeves type BITMAPONLY | BITMAP5;
- explode barrel1 type BITMAPONLY | BITMAP1;
- explode barrel2 type BITMAPONLY | BITMAP2;
- return (0);
- }
- if( severity <= 50 )
- {
- corpsetype = 2;
- explode turret type SHATTER | FALL | BITMAP1;
- explode body type BITMAPONLY | BITMAP2;
- explode sleeves type FALL | BITMAP5;
- explode barrel1 type BITMAPONLY | BITMAP1;
- explode barrel2 type BITMAPONLY | BITMAP2;
- explode barrel3 type BITMAPONLY | BITMAP1;
- explode barrel4 type BITMAPONLY | BITMAP2;
- return (0);
- }
- if( severity <= 99 )
- {
- corpsetype = 3;
- explode turret type SHATTER | FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
- explode body type BITMAPONLY | BITMAP2;
- explode sleeves type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;
- explode barrel2 type BITMAPONLY | BITMAP1;
- explode barrel1 type BITMAPONLY | BITMAP2;
- explode barrel3 type BITMAPONLY | BITMAP1;
- explode barrel4 type BITMAPONLY | BITMAP2;
- return (0);
- }
- corpsetype = 3;
- explode turret type SHATTER | FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
- explode body type BITMAPONLY | BITMAP2;
- explode sleeves type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;
- explode barrel2 type BITMAPONLY | BITMAP1;
- explode barrel1 type BITMAPONLY | BITMAP2;
- explode barrel3 type BITMAPONLY | BITMAP1;
- explode barrel4 type BITMAPONLY | BITMAP2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement