class SecretMover extends DeusExMover;

function DoOpen()
{
	local float rnd;
	rnd = FRand();

	if(rnd < 0.05)
	{
		if(!binitialLocked)
		{
			SpawnSecretBasic();
		}
		else if(initiallockStrength <= 0.250000)
		{
			SpawnSecretAdv();
		}
		else if(initiallockStrength > 0.250000)
		{
			SpawnSecretPro();
		}
	}

	Super.DoOpen();
}


function SpawnSecretAdv()
{
	local float rnd;
	local MMDatacube MMD;
	local SecretPlace SP;
	local SecretPlace SecretP;
	local Vector loc;

	rnd = FRand();

	forEach AllActors(Class'SecretPlace', SP)
	{
		if(SP.Tag == Tag)
		{
			loc = SP.Location;
		}
	}

	if(rnd < 0.2)
	{
		MMD = Spawn(class'DatacubeAdv1',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;
	}
	else if(rnd < 0.4)
	{
		MMD = Spawn(class'DatacubeAdv2',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.6)
	{
		MMD = Spawn(class'DatacubeAdv3',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.8)
	{
		MMD = Spawn(class'DatacubeAdv4',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	//else if(rnd < 0.5)
	else
	{
		MMD = Spawn(class'DatacubeAdv5',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
/*
	else if(rnd < 0.6)
	{
		MMD = Spawn(class'DatacubeAdv6',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.7)
	{
		MMD = Spawn(class'DatacubeAdv7',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.8)
	{
		MMD = Spawn(class'DatacubeAdv8',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.9)
	{
		MMD = Spawn(class'DatacubeAdv9',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else
	{
		MMD = Spawn(class'DatacubeAdv10',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
*/
}

function SpawnSecretPro()
{
	local float rnd;
	local MMDatacube MMD;
	local SecretPlace SP;
	local SecretPlace SecretP;
	local Vector loc;

	rnd = FRand();

	forEach AllActors(Class'SecretPlace', SP)
	{
		if(SP.Tag == Tag)
		{
			loc = SP.Location;
		}
	}

	if(rnd < 0.2)
	{
		MMD = Spawn(class'DatacubePro1',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;
	}
	else if(rnd < 0.4)
	{
		MMD = Spawn(class'DatacubePro2',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.6)
	{
		MMD = Spawn(class'DatacubePro3',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.8)
	{
		MMD = Spawn(class'DatacubePro4',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	//else if(rnd < 0.5)
	else
	{
		MMD = Spawn(class'DatacubePro5',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
/*
	else if(rnd < 0.6)
	{
		MMD = Spawn(class'DatacubePro6',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.7)
	{
		MMD = Spawn(class'DatacubePro7',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.8)
	{
		MMD = Spawn(class'DatacubePro8',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.9)
	{
		MMD = Spawn(class'DatacubePro9',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else
	{
		MMD = Spawn(class'DatacubePro10',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}*/
}


function SpawnSecretBasic()
{
	local float rnd;
	local MMDatacube MMD;
	local SecretPlace SP;
	local SecretPlace SecretP;
	local Vector loc;

	rnd = FRand();

	forEach AllActors(Class'SecretPlace', SP)
	{
		if(SP.Tag == Tag)
		{
			loc = SP.Location;
		}
	}

	if(rnd < 0.2)
	{
		MMD = Spawn(class'DatacubeBasic1',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;
	}
	else if(rnd < 0.4)
	{
		MMD = Spawn(class'DatacubeBasic2',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.6)
	{
		MMD = Spawn(class'DatacubeBasic3',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.8)
	{
		MMD = Spawn(class'DatacubeBasic4',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	//else if(rnd < 0.5)
	else
	{
		MMD = Spawn(class'DatacubeBasic5',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
/*
	else if(rnd < 0.6)
	{
		MMD = Spawn(class'DatacubeBasic6',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.7)
	{
		MMD = Spawn(class'DatacubeBasic7',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.8)
	{
		MMD = Spawn(class'DatacubeBasic8',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else if(rnd < 0.9)
	{
		MMD = Spawn(class'DatacubeBasic9',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}
	else
	{
		MMD = Spawn(class'DatacubeBasic10',,, loc, (Self.Rotation));
		MMD.RespawnTime = 0.0;	
	}*/
}

defaultproperties
{
     MoveTime=1.700000
     bBreakable=False
     InitialState=TriggerOpenTimed
     StayOpenTime=30.000000
}

