Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define TA // This is a TA script
- piece base, nanopoint1, nanopoint2, frontwings, fengine1, fengine2, rearwings, rengine1, rengine2, righttip, lefttip;
- #include "sfxtype.h"
- #include "exptype.h"
- #define SIG_ACTIVATE 2
- #define jethtrail 1024+0
- #define nanoflame 1025+0
- static-var bMoving, terraintype, statechg_DesiredState, statechg_StateChanging, building, moving, flames, spray;
- SmokeUnit(healthpercent, sleeptime, smoketype)
- {
- 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;
- }
- emit-sfx 1026 from base;
- }
- sleeptime = healthpercent * 50;
- if( sleeptime < 200 )
- {
- sleeptime = 200;
- }
- sleep sleeptime;
- }
- }
- Thrust()
- {
- while( TRUE )
- {
- if (moving)
- {
- emit-sfx jethtrail from fengine1;
- emit-sfx jethtrail from fengine2;
- emit-sfx jethtrail from rengine1;
- emit-sfx jethtrail from rengine2;
- }
- sleep 5;
- }
- }
- buildflame()
- {
- while( TRUE )
- {
- if (building == TRUE)
- {
- emit-sfx nanoflame from nanopoint1;
- emit-sfx nanoflame from nanopoint2;
- }
- sleep 600;
- }
- }
- InitState()
- {
- statechg_DesiredState = TRUE;
- statechg_StateChanging = FALSE;
- }
- Create()
- {
- // start-script Thrust();
- start-script SmokeUnit();
- call-script InitState();
- // turn fengine1 to y-axis <180> now;
- // turn fengine2 to y-axis <180> now;
- // turn rengine1 to y-axis <180> now;
- // turn rengine2 to y-axis <180> now;
- building = FALSE;
- spray = 0;
- start-script buildflame();
- }
- Go(heading, pitch)
- {
- building = TRUE;
- set INBUILDSTANCE to 1;
- while (1) {
- spin lefttip around y-axis speed <50.005495>;
- spin righttip around y-axis speed <50.005495>;
- sleep 30;
- }
- }
- Stop()
- {
- building = FALSE;
- set INBUILDSTANCE to 0;
- stop-spin lefttip around z-axis decelerate <15.000000>;
- stop-spin righttip around z-axis decelerate <15.000000>;
- }
- RequestState(requestedstate, currentstate)
- {
- if( statechg_StateChanging )
- {
- statechg_DesiredState = requestedstate;
- return (0);
- }
- statechg_StateChanging = TRUE;
- currentstate = statechg_DesiredState;
- statechg_DesiredState = requestedstate;
- while( statechg_DesiredState != currentstate )
- {
- if( statechg_DesiredState == 0 )
- {
- call-script Go();
- currentstate = 0;
- }
- if( statechg_DesiredState == 1 )
- {
- call-script Stop();
- currentstate = 1;
- }
- }
- statechg_StateChanging = FALSE;
- }
- Activate()
- {
- signal SIG_ACTIVATE;
- start-script RequestState(0);
- }
- Deactivate()
- {
- signal SIG_ACTIVATE;
- set-signal-mask SIG_ACTIVATE;
- set-signal-mask 0;
- start-script RequestState(1);
- }
- QueryBuildInfo(piecenum)
- {
- piecenum = nanopoint1;
- }
- QueryNanoPiece(piecenum)
- {
- if( spray == 0 )
- {
- piecenum = nanopoint1;
- }
- if( spray == 1 )
- {
- piecenum = nanopoint2;
- }
- ++spray;
- if( spray >= 2 )
- {
- spray = 0;
- }
- }
- StartMoving()
- {
- bMoving = TRUE;
- moving=1;
- }
- StopMoving()
- {
- bMoving = FALSE;
- moving=0;
- }
- MoveRate0()
- {
- flames=0;
- turn frontwings to x-axis <-90.000000> speed <150.000000>;
- turn rearwings to x-axis <-90.000000> speed <150.000000>;
- }
- MoveRate1()
- {
- flames=0;
- turn frontwings to x-axis <-70.005495> speed <150.000000>;
- turn rearwings to x-axis <-70.005495> speed <150.000000>;
- }
- MoveRate2()
- {
- flames=1;
- turn frontwings to x-axis <0.000000> speed <150.000000>;
- turn rearwings to x-axis <0.000000> speed <150.000000>;
- }
- Killed(severity, corpsetype) // how it explodes
- {
- corpsetype = 1;
- explode lefttip type EXPLODE_ON_HIT;
- explode righttip type EXPLODE_ON_HIT;
- explode base type EXPLODE_ON_HIT;
- explode frontwings type EXPLODE_ON_HIT;
- explode rearwings type EXPLODE_ON_HIT;
- }
Advertisement
Add Comment
Please, Sign In to add comment