class Board extends Actor;

var _MMRPGPlayer Skater;
var bool bTrick;
var bool bFlip;
var bool bShove;
var bool bHeel;
var bool bImp;
var int flipcount;

#exec AUDIO IMPORT FILE=Sounds\ollie.wav	NAME=ollie	GROUP=Weapons
#exec AUDIO IMPORT FILE=Sounds\boardland.wav	NAME=boardland	GROUP=Weapons

#exec obj load file=..\Textures\CoreTexWood.utx package=CoreTexWood
#exec obj load file=..\Textures\CoreTexMetal.utx package=CoreTexMetal



//x=0.09492 y=0.09492 z=0.18983


function Tick(float deltatime)
{
	local rotator rot;

	If(Skater == None)
	{
		Destroy();
	}

	If(Skater.bSkate == False)
	{
		Destroy();
	}

	If(Skater != None)
	{	
		if (!bTrick)
		{
			rot=Skater.Rotation;
			rot.Pitch = 0;
			rot.Roll = 0;
		}
		if (bShove)
		{
			rot = Skater.Rotation;
			rot.Pitch = 0;
			rot.Roll = 0;
			flipcount += 1;

			if (flipcount == 1)
				rot.Yaw += 7872;
			if (flipcount == 2)
				rot.Yaw += 16368;
			if (flipcount == 3)
				rot.Yaw += 24592;
			if (flipcount == 4)
			{
				rot.Yaw = 0;
				bTrick = False;
				bShove = False;
			}

		}

		if (bFlip)
		{
			rot = Skater.Rotation;
			rot.Pitch = 0;
			flipcount += 1;

			if (flipcount == 1)
				rot.Roll = -8808;
			if (flipcount == 2)
				rot.Roll = -16392;
			if (flipcount == 3)
				rot.Roll = -25040;
			if (flipcount == 4)
				rot.Roll = -32752;
			if (flipcount == 5)
				rot.Roll = -40752;
			if (flipcount == 6)
				rot.Roll = -49224;
			if (flipcount == 6)
				rot.Roll = -57288;
			if (flipcount == 7)
			{
				rot.Roll = -1;
				bTrick = False;
				bFlip = False;
			}
		}
		if (bHeel)
		{
			rot = Skater.Rotation;
			rot.Pitch = 0;
			flipcount += 1;

			if (flipcount == 1)
				rot.Roll = 8808;
			if (flipcount == 2)
				rot.Roll = 16392;
			if (flipcount == 3)
				rot.Roll = 25040;
			if (flipcount == 4)
				rot.Roll = 32752;
			if (flipcount == 5)
				rot.Roll = 40752;
			if (flipcount == 6)
				rot.Roll = 49224;
			if (flipcount == 6)
				rot.Roll = 57288;
			if (flipcount == 7)
			{
				rot.Roll = -1;
				bTrick = False;
				bHeel = False;
			}
		}

		if (bImp)
		{
			rot = Skater.Rotation;
			rot.Roll = -0;
			flipcount += 1;

			if (flipcount == 1)
				rot.Pitch = 73856;
			if (flipcount == 2)
				rot.Pitch = 81832;
			if (flipcount == 3)
				rot.Pitch = 90328;
			if (flipcount == 4)
				rot.Pitch = 98536;
			if (flipcount == 5)
				rot.Pitch = 106336;
			if (flipcount == 6)
				rot.Pitch = 114840;
			if (flipcount == 6)
				rot.Pitch = 124208;
			if (flipcount == 7)
			{
				rot.Pitch = -2;
				bTrick = False;
				bImp = False;
			}
		}
		SetRotation(rot);
	}


	Super.Tick(deltatime);
}



defaultproperties
{
    Physics=Phys_Projectile
    DrawType=DT_Mesh
    Mesh=Mesh'ContenderStuff.board'
    bCollideWhenPlacing=False
    bCollideActors=False
    bCollideWorld=False
    bBlockActors=False
    bBlockPlayers=False
    CollisionRadius=0
    CollisionHeight=0
    MultiSkins(0)=Texture'CoreTexWood.Wood.ClenWhitPine_A'
    MultiSkins(1)=Texture'CoreTexMetal.Metal.Heli_LiftMetl_A'
    MultiSkins(2)=Texture'DeusExDeco.Skins.AlarmLightTex9'
    MultiSkins(3)=Texture'CoreTexMetal.Metal.ShipGrayMetal_A'
}
