All pastes #404150 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-20 20:58 UTC
rendered paste body
#define TA			// This is a TA script

#include "sfxtype.h"
#include "exptype.h"

piece  base, body, aim, emitnano, muzzle;

static-var  Static_Var_1, Static_Var_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 aim;
		}
		sleeptime = healthpercent * 50;
		if( sleeptime < 200 )
		{
			sleeptime = 200;
		}
		sleep sleeptime;
	}
}

StartBuilding(h,p)
{
	signal 1;
	set-signal-mask 1;
	turn aim to y-axis h speed <160>;
	wait-for-turn aim around y-axis;
	set INBUILDSTANCE to 1;
	while (1) {
		emit-sfx 2048 from muzzle;
		sleep 60;
	}
}

StopBuilding()
{
	set INBUILDSTANCE to 0;
	signal 1;
	set-signal-mask 1;
	sleep 5000;
	turn aim to y-axis 0 speed <160>;
}

Create()
{
	start-script SmokeUnit();
	hide muzzle;
}

QueryNanoPiece(piecenum)
{
	piecenum = emitnano;
}

SweetSpot(piecenum)
{
	piecenum = aim;
}

Killed(severity, corpsetype)
{
	if( severity <= 25 )
	{
		corpsetype = 1;
		explode base type BITMAPONLY | BITMAP1;
		explode aim type BITMAPONLY | BITMAP3;
		return (0);
	}
	if( severity <= 50 )
	{
		corpsetype = 2;
		explode base type FALL | BITMAP1;
		explode aim type FALL | BITMAP3;
		return (0);
	}
	if( severity <= 99 )
	{
		corpsetype = 3;
		explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
		explode aim type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
		return (0);
	}
	corpsetype = 3;
	explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;
	explode aim type SHATTER | EXPLODE_ON_HIT | BITMAP3;
}