class CyBotTrailer expands Cybot
abstract;

var bool bReadyToFollow;

var() name TAnimLoop;
var() sound TSoundLoop;

simulated function PostBeginPlay()
{
	PlayAnim('Openning', 2.0, 0.0);
	SetRotation(rot(0,0,0));
}

simulated function AnimEnd()
{
	if (!bReadyToFollow)
	{
		bReadyToFollow = True;
		LoopAnim(TAnimLoop, 15.0);
		AmbientSound = TSoundLoop;
	}
}

function SpawnWreckedPiece( vector SpawnDir)
{
local WreckedPiece wp;

	wp = Spawn(Class'WreckedPiece',,, Location, rotator(vect(0,0,20) + SpawnDir.X * vect(1,0,0) + SpawnDir.Y * vect(0,1,0)));
	GiveProperties(wp);
}

simulated function GiveProperties(actor A)
{
	A.AnimSequence = AnimSequence;
	A.AnimFrame = AnimFrame;
	A.DrawScale = DrawScale;
	A.Mesh = Mesh;

	Destroy();
}

simulated function Tick( float DeltaTime)
{
	if (Owner != None)
		Velocity = Owner.Velocity;
}


defaultproperties
{
	Physics=PHYS_Projectile
	RemoteRole=ROLE_SimulatedProxy
	SoundVolume=80
	SoundRadius=50
}
