All pastes #792526 Raw Edit

rcdraco

public text v1 · immutable
·published 2007-11-21 14:25 UTC
rendered paste body
//This is a The Plot of War Script



piece	base, fw1, fw2, mw1, mw2, bw1, bw2, lfoot, rfoot, bfoot, gun, cap, b1, b2, fp1, fp2;


#define FIRING_THING	2
#define MAX_SPEED	75


static-var x, siegemode;



Create()
	{
	siegemode = 0;
	}

StartMoving()
	{ 
 	spin fw1 around x-axis speed <140> accelerate <35>;
 	spin fw2 around x-axis speed <140> accelerate <35>;
 	spin mw1 around x-axis speed <140> accelerate <35>;
 	spin mw2 around x-axis speed <140> accelerate <35>;
 	spin bw1 around x-axis speed <140> accelerate <35>;
 	spin bw2 around x-axis speed <140> accelerate <35>;
	}

StopMoving()
	{ 
	stop-spin fw1 around x-axis;
 	stop-spin fw2 around x-axis;
 	stop-spin mw1 around x-axis;
 	stop-spin mw2 around x-axis;
 	stop-spin bw1 around x-axis;
 	stop-spin bw2 around x-axis;
	}

Activate()
	{
	siegemode = 1;
	set MAX_SPEED to 1;
	turn lfoot to z-axis <-90> speed [15];
	move lfoot to y-axis [-3] speed [15];
	move lfoot to x-axis [6] speed [15];
	turn rfoot to z-axis <90> speed [15];
	move rfoot to y-axis [-3] speed [15];
	move rfoot to x-axis [-6] speed [15];
	turn bfoot to x-axis <-90> speed [15];
	move bfoot to y-axis [-3] speed [15];
	move bfoot to z-axis [-6] speed [15];
	wait-for-move bfoot along z-axis;
	}

Deactivate()
	{
	siegemode = 0;
	set MAX_SPEED to [3];
	turn lfoot to z-axis <0> speed [15];
	move lfoot to y-axis [0] speed [15];
	move lfoot to x-axis [0] speed [15];
	turn rfoot to z-axis <0> speed [15];
	move rfoot to y-axis [0] speed [15];
	move rfoot to x-axis [0] speed [15];
	turn bfoot to x-axis <0> speed [15];
	move bfoot to y-axis [0] speed [15];
	move bfoot to z-axis [0] speed [15];
	wait-for-move bfoot along z-axis;
	}

AimPrimary(heading, pitch)
	{
	while (siegemode == 1)
		{
		signal FIRING_THING;
		set-signal-mask FIRING_THING;
		turn gun to y-axis heading speed <350>;
		turn cap to x-axis <0> - pitch speed <350>;
		wait-for-turn gun around y-axis;
		wait-for-turn cap around x-axis;
		return (1);
		}
	}

FirePrimary()
	{
	if (x == 1)
		{
		move b1 to z-axis [-2] now;
		move b1 to z-axis [0] speed [15];
		}
	if (x == 2)
		{
		move b2 to z-axis [-2] now;
		move b2 to z-axis [0] speed [15];
		}
	}

AimFromPrimary(piecenum)
	{
	piecenum = gun;
	}

QueryPrimary(piecenum)
	{
	if ( x == 1 )
		{
		piecenum = fp1;
		}
	else if ( x == 2 )
		{
		piecenum = fp2;
		}
	++x;
	if ( x == 3 )
		{
		x = 1;
		}
	}

Killed(severity, corpsetype)
	{		
	}