class UR_Game extends UTCTFGame_Content
	config(UnrealRider);


event PostLogin( PlayerController NewPlayer )
{
  super.PostLogin(NewPlayer);
  UR_PLayerController(NewPlayer).ShowClassMenu();

}
function RestartPlayer(Controller aPlayer)
{
	super.RestartPlayer(aPlayer);

	if (UR_Bot(aPlayer) != None)
	{
		UR_Bot(aPlayer).RandomSelectBot();
		UR_Bot(aPlayer).SetAndRespawnBot();
	}
	else if(UR_PlayerController(aPLayer)!= None)
    {
      SetAndRespawnPlayer(UR_PlayerController(aPLayer));
    }
}

function AddDefaultInventory( pawn PlayerPawn )
{
 super.AddDefaultInventory(PlayerPawn);

   	if (UR_Bot(PlayerPawn.Controller) != None)
	{
		UR_Bot(PlayerPawn.Controller).RandomSelectBot();
		UR_Bot(PlayerPawn.Controller).SetAndRespawnBot();
	}
}

reliable server function SetAndRespawnPlayer(UR_PlayerController PC)
{
    local UR_PlayerReplicationInfo UR_PRI;
    UR_PRI = UR_PlayerReplicationInfo(PC.PlayerReplicationInfo);

    PC.Pawn.InvManager.DiscardInventory();

    UR_Pawn(PC.Pawn).VestArmor = 0;
	UR_Pawn(PC.Pawn).HelmetArmor = 0;
	UR_Pawn(PC.Pawn).ThighpadArmor = 0;
	UR_Pawn(PC.Pawn).ShieldBeltArmor = 0;

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

			if (UR_PRI.ArmourRatio == 0)
			{
				UR_Pawn(PC.Pawn).GroundSpeed += 50;
				UR_Pawn(PC.Pawn).WaterSpeed += 50;
				UR_Pawn(PC.Pawn).AirSpeed += 50;
				UR_Pawn(PC.Pawn).JumpZ += 25;
				break;
			}
			else if (UR_PRI.ArmourRatio == 1)
			{
				UR_Pawn(PC.Pawn).GroundSpeed += 25;
				UR_Pawn(PC.Pawn).WaterSpeed += 25;
				UR_Pawn(PC.Pawn).AirSpeed += 25;
				UR_Pawn(PC.Pawn).VestArmor = 15;
				break;
			}
			else if (UR_PRI.ArmourRatio == 2)
			{
				UR_Pawn(PC.Pawn).VestArmor = 30;
				break;
			}
			else if (UR_PRI.ArmourRatio == 3)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 15;
				UR_Pawn(PC.Pawn).WaterSpeed -= 15;
				UR_Pawn(PC.Pawn).AirSpeed -= 15;
				UR_Pawn(PC.Pawn).JumpZ -= 15;
				UR_Pawn(PC.Pawn).VestArmor = 45;
				UR_Pawn(PC.Pawn).HelmetArmor = 10;
				break;
			}
			else if (UR_PRI.ArmourRatio == 4)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 30;
				UR_Pawn(PC.Pawn).WaterSpeed -= 30;
				UR_Pawn(PC.Pawn).AirSpeed -= 30;
				UR_Pawn(PC.Pawn).JumpZ -= 30;
				UR_Pawn(PC.Pawn).VestArmor = 60;
				UR_Pawn(PC.Pawn).HelmetArmor = 20;
				break;
			}
			else if (UR_PRI.ArmourRatio == 5)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 45;
				UR_Pawn(PC.Pawn).WaterSpeed -= 45;
				UR_Pawn(PC.Pawn).AirSpeed -= 45;
				UR_Pawn(PC.Pawn).JumpZ -= 45;
				UR_Pawn(PC.Pawn).VestArmor = 75;
				UR_Pawn(PC.Pawn).HelmetArmor = 20;
				UR_Pawn(PC.Pawn).ThighpadArmor = 10;
				break;
			}
			else if (UR_PRI.ArmourRatio == 6)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 60;
				UR_Pawn(PC.Pawn).WaterSpeed -= 60;
				UR_Pawn(PC.Pawn).AirSpeed -= 60;
				UR_Pawn(PC.Pawn).JumpZ -= 60;
				UR_Pawn(PC.Pawn).VestArmor = 100;
				UR_Pawn(PC.Pawn).HelmetArmor = 20;
				UR_Pawn(PC.Pawn).ThighpadArmor = 20;
				break;
			}
			else if (UR_PRI.ArmourRatio == 7)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 75;
				UR_Pawn(PC.Pawn).WaterSpeed -= 75;
				UR_Pawn(PC.Pawn).AirSpeed -= 75;
				UR_Pawn(PC.Pawn).JumpZ -= 75;
				UR_Pawn(PC.Pawn).VestArmor = 110;
				UR_Pawn(PC.Pawn).HelmetArmor = 20;
				UR_Pawn(PC.Pawn).ThighpadArmor = 20;
				break;
			}
			else
			{
				`log("Armour Allocation failed in SetAndRespawnPlayer");
			}

			break;
		case eStealth:
			UR_Pawn(PC.Pawn).Health = 75;
			UR_Pawn(PC.Pawn).HealthMax = 75;
			UR_Pawn(PC.Pawn).SuperHealthMax = 149;
			UR_Pawn(PC.Pawn).GroundSpeed = 340;
			UR_Pawn(PC.Pawn).WaterSpeed = 220;
			UR_Pawn(PC.Pawn).AirSpeed = 300;
			UR_Pawn(PC.Pawn).JumpZ = 350;
			UR_Pawn(PC.Pawn).SetInvisible(true);
			UR_Pawn(PC.Pawn).SetSkin(class'UR_PLayerController'.default.StealthMaterial);

			if (UR_PRI.ArmourRatio == 0)
			{
				UR_Pawn(PC.Pawn).GroundSpeed += 50;
				UR_Pawn(PC.Pawn).WaterSpeed += 50;
				UR_Pawn(PC.Pawn).AirSpeed += 50;
				UR_Pawn(PC.Pawn).JumpZ += 25;
				break;
			}
			if (UR_PRI.ArmourRatio == 1)
			{
				UR_Pawn(PC.Pawn).GroundSpeed += 25;
				UR_Pawn(PC.Pawn).WaterSpeed += 25;
				UR_Pawn(PC.Pawn).AirSpeed += 25;
				UR_Pawn(PC.Pawn).VestArmor = 10;
				break;
			}
			else if (UR_PRI.ArmourRatio == 2)
			{
				UR_Pawn(PC.Pawn).VestArmor = 20;
				break;
			}
			else if (UR_PRI.ArmourRatio == 3)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 15;
				UR_Pawn(PC.Pawn).WaterSpeed -= 15;
				UR_Pawn(PC.Pawn).AirSpeed -= 15;
				UR_Pawn(PC.Pawn).JumpZ -= 15;
				UR_Pawn(PC.Pawn).VestArmor = 30;
				UR_Pawn(PC.Pawn).HelmetArmor = 10;
				break;
			}
			else if (UR_PRI.ArmourRatio == 4)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 30;
				UR_Pawn(PC.Pawn).WaterSpeed -= 30;
				UR_Pawn(PC.Pawn).AirSpeed -= 30;
				UR_Pawn(PC.Pawn).JumpZ -= 30;
				UR_Pawn(PC.Pawn).VestArmor = 40;
				UR_Pawn(PC.Pawn).HelmetArmor = 20;
				break;
			}
			else if (UR_PRI.ArmourRatio == 5)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 45;
				UR_Pawn(PC.Pawn).WaterSpeed -= 45;
				UR_Pawn(PC.Pawn).AirSpeed -= 45;
				UR_Pawn(PC.Pawn).JumpZ -= 45;
				UR_Pawn(PC.Pawn).VestArmor = 50;
				UR_Pawn(PC.Pawn).HelmetArmor = 20;
				UR_Pawn(PC.Pawn).ThighpadArmor = 10;
				break;
			}
			else if (UR_PRI.ArmourRatio == 6)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 60;
				UR_Pawn(PC.Pawn).WaterSpeed -= 60;
				UR_Pawn(PC.Pawn).AirSpeed -= 60;
				UR_Pawn(PC.Pawn).JumpZ -= 60;
				UR_Pawn(PC.Pawn).VestArmor = 50;
				UR_Pawn(PC.Pawn).HelmetArmor = 25;
				UR_Pawn(PC.Pawn).ThighpadArmor = 25;
				break;
			}
			else if (UR_PRI.ArmourRatio == 7)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 75;
				UR_Pawn(PC.Pawn).WaterSpeed -= 75;
				UR_Pawn(PC.Pawn).AirSpeed -= 75;
				UR_Pawn(PC.Pawn).JumpZ -= 75;
				UR_Pawn(PC.Pawn).VestArmor = 70;
				UR_Pawn(PC.Pawn).HelmetArmor = 25;
				UR_Pawn(PC.Pawn).ThighpadArmor = 25;
				break;
			}
			else
			{
				`log("Armour Allocation failed in SetAndRespawnPlayer");
			}

			break;
		case eAkimbo:
			UR_Pawn(PC.Pawn).Health = 125;
			UR_Pawn(PC.Pawn).HealthMax = 125;
			UR_Pawn(PC.Pawn).SuperHealthMax = 249;
			UR_Pawn(PC.Pawn).GroundSpeed = 300;
			UR_Pawn(PC.Pawn).WaterSpeed = 200;
			UR_Pawn(PC.Pawn).AirSpeed = 200;
			UR_Pawn(PC.Pawn).JumpZ = 300;
			UR_Pawn(PC.Pawn).SetInvisible(false);
			UR_Pawn(PC.Pawn).SetSkin(none);

			if (UR_PRI.ArmourRatio == 0)
			{
				UR_Pawn(PC.Pawn).GroundSpeed += 50;
				UR_Pawn(PC.Pawn).WaterSpeed += 50;
				UR_Pawn(PC.Pawn).AirSpeed += 50;
				UR_Pawn(PC.Pawn).JumpZ += 25;
				break;
			}
			else if (UR_PRI.ArmourRatio == 1)
			{
				UR_Pawn(PC.Pawn).GroundSpeed += 25;
				UR_Pawn(PC.Pawn).WaterSpeed += 25;
				UR_Pawn(PC.Pawn).AirSpeed += 25;
				UR_Pawn(PC.Pawn).VestArmor = 25;
				break;
			}
			else if (UR_PRI.ArmourRatio == 2)
			{
				UR_Pawn(PC.Pawn).VestArmor = 50;
				break;
			}
			else if (UR_PRI.ArmourRatio == 3)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 15;
				UR_Pawn(PC.Pawn).WaterSpeed -= 15;
				UR_Pawn(PC.Pawn).AirSpeed -= 15;
				UR_Pawn(PC.Pawn).JumpZ -= 15;
				UR_Pawn(PC.Pawn).VestArmor = 50;
				UR_Pawn(PC.Pawn).HelmetArmor = 25;
				break;
			}
			else if (UR_PRI.ArmourRatio == 4)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 30;
				UR_Pawn(PC.Pawn).WaterSpeed -= 30;
				UR_Pawn(PC.Pawn).AirSpeed -= 30;
				UR_Pawn(PC.Pawn).JumpZ -= 30;
				UR_Pawn(PC.Pawn).VestArmor = 50;
				UR_Pawn(PC.Pawn).HelmetArmor = 25;
				UR_Pawn(PC.Pawn).ThighpadArmor = 25;
				break;
			}
			else if (UR_PRI.ArmourRatio == 5)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 45;
				UR_Pawn(PC.Pawn).WaterSpeed -= 45;
				UR_Pawn(PC.Pawn).AirSpeed -= 45;
				UR_Pawn(PC.Pawn).JumpZ -= 45;
				UR_Pawn(PC.Pawn).VestArmor = 50;
				UR_Pawn(PC.Pawn).HelmetArmor = 25;
				UR_Pawn(PC.Pawn).ThighpadArmor = 25;
				UR_Pawn(PC.Pawn).ShieldBeltArmor = 25;
				break;
			}
			else if (UR_PRI.ArmourRatio == 6)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 60;
				UR_Pawn(PC.Pawn).WaterSpeed -= 60;
				UR_Pawn(PC.Pawn).AirSpeed -= 60;
				UR_Pawn(PC.Pawn).JumpZ -= 60;
				UR_Pawn(PC.Pawn).VestArmor = 50;
				UR_Pawn(PC.Pawn).HelmetArmor = 25;
				UR_Pawn(PC.Pawn).ThighpadArmor = 25;
				UR_Pawn(PC.Pawn).ShieldBeltArmor = 50;
				break;
			}
			else if (UR_PRI.ArmourRatio == 7)
			{
				UR_Pawn(PC.Pawn).GroundSpeed -= 75;
				UR_Pawn(PC.Pawn).WaterSpeed -= 75;
				UR_Pawn(PC.Pawn).AirSpeed -= 75;
				UR_Pawn(PC.Pawn).JumpZ -= 60;
				UR_Pawn(PC.Pawn).VestArmor = 50;
				UR_Pawn(PC.Pawn).HelmetArmor = 25;
				UR_Pawn(PC.Pawn).ThighpadArmor = 25;
				UR_Pawn(PC.Pawn).ShieldBeltArmor = 100;
				break;
			}
			else
			{
				`log("Armour Allocation failed in SetAndRespawnPlayer");
			}

			break;
		default:
			`log("class selection failed in SetAndRespawnPlayer");
			break;
	}

	switch(PC.getWeapon())
	{
		case eHammer:
			if (PC.getClass() == eAkimbo)
			{
				UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Weap_Hammer_D' );
			}
			else
			{
				UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Weap_Hammer' );
			}
			break;
		case eLink:
			if (PC.getClass() == eAkimbo)
			{
				UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Weap_Link_D' );
			}
			else
			{
				UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Weap_Link' );
			}
			break;
		case eSniper:
			if (PC.getClass() == eAkimbo)
			{
				UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Weap_Sniper_D' );
			}
			else
			{
				UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Weap_Sniper' );
			}
			break;
		case eRox:
			if (PC.getClass() == eAkimbo)
			{
				UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Weap_Rox_D' );
			}
			else
			{
				UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Weap_Rox' );
			}
			break;
		default:
			`log("Weapon selection failed in SetAndRespawnPlayer");
			break;
	}

	switch(pc.getKit())
	{
		case eSlowField:
			UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Deployable_SlowField' );
			break;
		case eShield:
			UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Deployable_Shield' );
			break;
		case eLandMine:
			UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Deployable_Mine' );
			break;
		case eSkyMine:
			UR_Pawn(PC.Pawn).CreateInventory( class'UnrealRider.UR_Deployable_SkyMine' );
			break;
		default:
			`log("Weapon selection failed in SetAndRespawnPlayer");
			break;
	}
}
DefaultProperties
{
	PlayerControllerClass=Class'UnrealRider.UR_PlayerController'
    BotClass=class'UnrealRider.UR_Bot'
    PlayerReplicationInfoClass=class'UnrealRider.UR_PlayerReplicationInfo'
	DefaultPawnClass=Class'UnrealRider.UR_Pawn'
	HUDType=Class'UnrealRider.UR_HUD'
	DefaultInventory.Empty
	bAllowTranslocator = false
	bAllowHoverboard = true
	bUndrivenVehicleDamage=false
	Description="Capture the Flag, with objectives. Shee Labs Game Development (Beta One)"
	MapPrefixes(0)="CTFPlus"
	GameName="CTF++"
	GoalScore=3
}