All pastes #510306 Raw Edit

Stuff

public c v1 · immutable
·published 2007-05-25 20:57 UTC
rendered paste body
#define TA			// This is a TA script#include "sfxtype.h"#include "exptype.h"piece  base, ground, turret, canon, barrelA, barrelB, barrelC, barrelD,       flare;static-var  gun_1;// Signal definitions#define SIG_AIM				2SmokeUnit(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;	}	return (0);	// Build by COBBLER Ver4.0 Copyright @1998 DIGITAL CONCEPT SOFTWARE (MANU@inext.fr) / http://www.annihilationcenter.com/DCS/  }Create(){	hide flare;	gun_1 = base;	start-script SmokeUnit();}AimPrimary(heading, pitch){	signal SIG_AIM;	set-signal-mask SIG_AIM;	turn turret to y-axis heading speed <700.000000>;	turn canon to x-axis <0.000000> - pitch speed <500.000000>;	wait-for-turn turret around y-axis;	wait-for-turn canon around x-axis;	return (1);}FirePrimary(){	if( gun_1 == 0 )	{		move barrelA to z-axis [-7.000000] now;		move flare to y-axis [-4.000000] now;		move flare to x-axis [1.000000] now;		move barrelA to z-axis [0.000000] speed [50.000000];	}	if( gun_1 == 1 )	{		move barrelB to z-axis [-7.000000] now;		move flare to x-axis [11.000000] now;		move barrelB to z-axis [0.000000] speed [50.000000];	}	if( gun_1 == 2 )	{		move barrelC to z-axis [-7.000000] now;		move flare to y-axis [0.000000] now;		move flare to x-axis [12.000000] now;		move barrelC to z-axis [0.000000] speed [50.000000];	}	if( gun_1 == 3 )	{		move barrelD to z-axis [-7.000000] now;		move flare to x-axis [0.000000] now;		move barrelD to z-axis [0.000000] speed [50.000000];	}	++gun_1;	if( gun_1 == 4 )	{		gun_1 = base;	}}QueryPrimary(piecenum){	piecenum = flare;}AimFromPrimary(piecenum){	piecenum = turret;}SweetSpot(piecenum){	piecenum = base;}Killed(severity, corpsetype){	hide flare;	if( severity <= 25 )	{		corpsetype = 1;		explode barrelA type BITMAPONLY | BITMAP1;		explode barrelB type BITMAPONLY | BITMAP2;		explode barrelC type BITMAPONLY | BITMAP2;		explode barrelD type BITMAPONLY | BITMAP2;		explode canon type BITMAPONLY | BITMAP3;		explode base type BITMAPONLY | BITMAP2;		explode ground type BITMAPONLY | BITMAP3;		explode turret type BITMAPONLY | BITMAP5;		explode flare type BITMAPONLY | BITMAP1;		return (0);	}	if( severity <= 50 )	{		corpsetype = 2;		explode barrelA type FALL | EXPLODE_ON_HIT | BITMAP1;		explode barrelB type FALL | EXPLODE_ON_HIT | BITMAP2;		explode barrelC type FALL | EXPLODE_ON_HIT | BITMAP2;		explode barrelD type FALL | EXPLODE_ON_HIT | BITMAP2;		explode canon type FALL | EXPLODE_ON_HIT | BITMAP3;		explode base type BITMAPONLY | BITMAP2;		explode ground type FALL | EXPLODE_ON_HIT | BITMAP3;		explode turret type FALL | EXPLODE_ON_HIT | BITMAP5;		explode flare type FALL | EXPLODE_ON_HIT | BITMAP1;		return (0);	}	corpsetype = 3;	explode barrelA type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;	explode barrelB type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;	explode barrelC type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;	explode barrelD type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;	explode canon type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;	explode base type BITMAPONLY | BITMAP2;	explode ground type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;	explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;	explode flare type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1;}