class UR_Bot extends UTBot;

enum BotClass
{
	eSurfer,
	eStealth,
	eAkimbo
};

enum BotWeapon
{
	eSniper,
	eLink,
	eRox,
	eHammer
};

enum BotKit
{
	eSlowField,
	eShield,
	eLandMine,
	eSkyMine
};

struct BotDetails
{
	var BotClass BotClass;
	var BotWeapon BotWeapon;
	var BotKit BotKit;
	//var int ArmourRatio, ColourData;
	//var LinearColor EffectsColour;
};

var BotDetails BotSelection;
var Material StealthMaterial;

simulated function SetAndRespawnBot()
{
	Pawn.InvManager.DiscardInventory();
	
	UR_Pawn(Pawn).VestArmor = 0;
	UR_Pawn(Pawn).HelmetArmor = 0;
	UR_Pawn(Pawn).ThighpadArmor = 0;
	UR_Pawn(Pawn).ShieldBeltArmor = 0;

	switch(BotSelection.BotClass)
	{
		case eSurfer:
			Pawn.Health = 100;
			Pawn.HealthMax = 100;
			UR_Pawn(Pawn).SuperHealthMax = 199;
			Pawn.GroundSpeed = 450;
			Pawn.WaterSpeed = 300;
			Pawn.AirSpeed = 400;
			Pawn.JumpZ = 400;
			UR_Pawn(Pawn).SetInvisible(false);
			UR_Pawn(Pawn).SetSkin(none);
			Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Weap_Surfer' ));

		case eStealth:
			Pawn.Health = 75;
			Pawn.HealthMax = 75;
			UR_Pawn(Pawn).SuperHealthMax = 149;
			Pawn.GroundSpeed = 340;
			Pawn.WaterSpeed = 220;
			Pawn.AirSpeed = 300;
			Pawn.JumpZ = 350;
			UR_Pawn(Pawn).SetInvisible(true);
			UR_Pawn(Pawn).SetSkin(StealthMaterial);
			
		case eAkimbo:
			Pawn.Health = 125;
			Pawn.HealthMax = 125;
			UR_Pawn(Pawn).SuperHealthMax = 249;
			Pawn.GroundSpeed = 300;
			Pawn.WaterSpeed = 200;
			Pawn.AirSpeed = 200;
			Pawn.JumpZ = 300;
			UR_Pawn(Pawn).SetInvisible(false);
			UR_Pawn(Pawn).SetSkin(none);
	}
	
	switch(BotSelection.BotWeapon)
	{
		case eHammer:
			if (BotSelection.BotClass == eAkimbo)
			{
				Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Weap_Hammer_D' ));
			}
			else
			{
				Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Weap_Hammer' ));
			}
			break;
		case eLink:
			if (BotSelection.BotClass == eAkimbo)
			{
				Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Weap_Link_D' ));
			}
			else
			{
				Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Weap_Link' ));
			}
			break;
		case eSniper:
			if (BotSelection.BotClass == eAkimbo)
			{
				Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Weap_Sniper_D' ));
			}
			else
			{
				Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Weap_Sniper' ));
			}
			break;
		case eRox:
			if (BotSelection.BotClass == eAkimbo)
			{
				Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Weap_Rox_D' ));
			}
			else
			{
				Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Weap_Rox' ));
			}
			break;
		default:
			`log("Weapon selection failed in SetAndRespawnPlayer");
			break;
	}
	
	switch(BotSelection.BotKit)
	{
		case eSlowField:
			Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Deployable_SlowField' ));
			break;
		case eShield:
			Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Deployable_Shield' ));
			break;
		case eLandMine:
			Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Deployable_Mine' ));
			break;
		case eSkyMine:
			Weapon(Pawn.CreateInventory( class'UnrealRider.UR_Deployable_SkyMine' ));
			break;
		default:
			`log("Weapon selection failed in SetAndRespawnBot");
			break;
	}
}

function RandomSelectBot()
{
	local float ClassRand, WeaponRand, KitRand;
	
	ClassRand = RandRange(0,3);
	WeaponRand = RandRange(0,4);
	KitRand = RandRange(0,8);
	
	if (ClassRand < 1)
	{
		BotSelection.BotClass = eSurfer;
	}
	else if (ClassRand >= 1 && ClassRand < 2)
	{
		BotSelection.BotClass = eStealth;
	}
	else
	{
		BotSelection.BotClass = eAkimbo;
	}
	
	if (WeaponRand < 1)
	{
		BotSelection.BotWeapon = eSniper;
	}
	else if (WeaponRand >= 1 && WeaponRand < 2)
	{
		BotSelection.BotWeapon = eLink;
	}
	else if (WeaponRand >= 1 && WeaponRand < 2.5)
	{
		BotSelection.BotWeapon = eRox;
	}
	else
	{
		BotSelection.BotWeapon = eHammer;
	}
	
	if (KitRand < 1)
	{
		BotSelection.BotKit = eLandMine;
	}
	else if (KitRand >= 1 && KitRand < 2)
	{
		BotSelection.BotKit = eSkyMine;
	}
	else if (KitRand >= 1 && KitRand < 2)
	{
		BotSelection.BotKit = eSlowField;
	}
	else if (KitRand >= 2 && KitRand < 3)
	{
		BotSelection.BotKit = eShield;
	}
	else
	{
		//Nothing!
	}
}

DefaultProperties
{
}