Code: Select all
#define TA // This is a TA script
#include "sfxtype.h"
#include "exptype.h"
piece base, top;
static-var ACTIVATE;
// Signal definitions
#define SIG_AIM 2
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 smoketype from base;
}
sleeptime = healthpercent * 50;
if( sleeptime < 200 )
{
sleeptime = 200;
}
sleep sleeptime;
}
}
Activate()
{
set ACTIVATE to 1;
spin top around y-axis speed <300> accelerate <15>;
while(ACTIVATE==1);
{
move top to y-axis [5] speed [10];
sleep 100;
move top to y-axis [0] speed [10];
}
}
Deactivate()
{
set ACTIVATE to 0;
stop-spin top around y-axis decelerate <25>;
wait-for-turn top around y-axis;
}
Create()
{
start-script SmokeUnit();
set ACTIVATE to 0;
}
AimPrimary(heading, pitch)
{
}
FirePrimary()
{
}
AimFromPrimary(piecenum)
{
}
QueryPrimary(piecenum)
{
}
SweetSpot(piecenum)
{
piecenum = base;
}
Killed(severity, corpsetype)
{
hide top;
if( severity <= 25 )
{
corpsetype = 1;
explode top type BITMAPONLY | BITMAP1;
explode base type BITMAPONLY | BITMAP2;
return (0);
}
if( severity <= 50 )
{
corpsetype = 2;
explode top type FALL | BITMAP1;
explode base type BITMAPONLY | BITMAP2;
return (0);
}
if( severity <= 99 )
{
corpsetype = 3;
explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
explode base type BITMAPONLY | BITMAP2;
return (0);
}
corpsetype = 3;
explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
explode base type BITMAPONLY | BITMAP2;
}