-------------------------------------------------------------------
ShellMapTick = function()
	if BlankStateFollow then
		ticks = ticks + 1
		local t = (ticks + 66) % (3540 * speed) * (math.pi / 162) / speed;
		Camera.Position = viewportOrigin + WVec.New(18600 * math.sin(t), 19990 * math.cos(t), 0)
		Trigger.AfterDelay(1, function() ShellMapTick() end)
	end
end
-------------------------------------------------------------------
FollowCamerasTick = function()
	RandomFollowStateCount = Utils.RandomInteger(1, 5)
	if FollowBigMonster and not BigMonster.IsDead then
		if BigMonsterCamera.IsInWorld then BigMonsterCamera.Teleport(BigMonster.Location) end
		Camera.Position = BigMonster.CenterPosition
	end
	if FollowSuperMan and not SuperMan.IsDead then
		if SuperManCamera.IsInWorld then SuperManCamera.Teleport(SuperMan.Location) end
		Camera.Position = SuperMan.CenterPosition
	end
	if FollowBlackHawkGDI and not BlackHawkGDI.IsDead then
		if BlackHawkGDICamera.IsInWorld then BlackHawkGDICamera.Teleport(BlackHawkGDI.Location) end
		Camera.Position = BlackHawkGDI.CenterPosition
	end
	if FollowTerroristCarryall and not TerroristCarryall.IsDead then
		if TerroristCarryallCamera.IsInWorld then TerroristCarryallCamera.Teleport(TerroristCarryall.Location) end
		Camera.Position = TerroristCarryall.CenterPosition
	end
	if TrafficCarFollow and not FollowTrafficCar.IsDead then
		if FollowTrafficCarCamera.IsInWorld then FollowTrafficCarCamera.Teleport(FollowTrafficCar.Location) end
		Camera.Position = FollowTrafficCar.CenterPosition
	end
	Trigger.AfterDelay(0.000001, function() FollowCamerasTick() end)
end
-------------------------------------------------------------------
FollowBigMonsterState = function()
	FollowBigMonster = true
	FollowSuperMan = false
	FollowBlackHawkGDI = false
	FollowTerroristCarryall = false
	TrafficCarFollow = false
	BlankStateFollow = false
end
FollowSuperManState = function()
	FollowBigMonster = false
	FollowSuperMan = true
	FollowBlackHawkGDI = false
	FollowTerroristCarryall = false
	TrafficCarFollow = false
	BlankStateFollow = false
end
FollowBlackHawkGDIState = function()
	FollowBigMonster = false
	FollowSuperMan = false
	FollowBlackHawkGDI = true
	FollowTerroristCarryall = false
	TrafficCarFollow = false
	BlankStateFollow = false
end
FollowTerroristCarryallState = function()
	FollowBigMonster = false
	FollowSuperMan = false
	FollowBlackHawkGDI = false
	FollowTerroristCarryall = true
	TrafficCarFollow = false
	BlankStateFollow = false
end
TrafficCarFollowState = function()
	FollowBigMonster = false
	FollowSuperMan = false
	FollowBlackHawkGDI = false
	FollowTerroristCarryall = false
	TrafficCarFollow = true
	BlankStateFollow = false
end
FollowBlankState = function()
	FollowBigMonster = false
	FollowSuperMan = false
	FollowBlackHawkGDI = false
	FollowTerroristCarryall = false
	TrafficCarFollow = false
	BlankStateFollow = true
end
-------------------------------------------------------------------
RandomFollowStates = function()
	if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then
		if RandomFollowStateCount == 1 then
			if SuperMan.IsInWorld then
				FollowSuperManState()
				SuperMan.GrantUpgrade("eye.prefix")
			else
				RandomFollowStates() 
			end
			Trigger.AfterDelay(Utils.RandomInteger(222, 666), function()
				if SuperMan.IsInWorld then SuperMan.RevokeUpgrade("eye.prefix") end
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then 
					RandomFollowStates() 
				end 
			end)
		elseif RandomFollowStateCount == 2 then
			if BlackHawkGDI.IsInWorld then
				FollowBlackHawkGDIState()
				BlackHawkGDI.GrantUpgrade("eye.prefix")
			else
				RandomFollowStates() 
			end
			Trigger.AfterDelay(Utils.RandomInteger(222, 666), function()
				if BlackHawkGDI.IsInWorld then BlackHawkGDI.RevokeUpgrade("eye.prefix") end
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then 
					RandomFollowStates() 
				end 
			end)
		elseif RandomFollowStateCount == 3 then
			if TerroristCarryall.IsInWorld then
				FollowTerroristCarryallState()
				TerroristCarryall.GrantUpgrade("eye.prefix")
			else
				RandomFollowStates() 
			end
			Trigger.AfterDelay(Utils.RandomInteger(222, 666), function()
				if TerroristCarryall.IsInWorld then TerroristCarryall.RevokeUpgrade("eye.prefix") end
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then 
					RandomFollowStates() 
				end 
			end)
		elseif RandomFollowStateCount == 4 then
			if FollowTrafficCar.IsInWorld then
				TrafficCarFollowState()
				FollowTrafficCar.GrantUpgrade("eye.prefix")
			else
				RandomFollowStates() 
			end
			Trigger.AfterDelay(Utils.RandomInteger(222, 666), function()
				if FollowTrafficCar.IsInWorld then FollowTrafficCar.RevokeUpgrade("eye.prefix") end
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then 
					RandomFollowStates() 
				end 
			end)
		elseif RandomFollowStateCount == 5 then
			FollowBlankState()
			Trigger.AfterDelay(Utils.RandomInteger(222, 666), function()
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then 
					RandomFollowStates() 
				end 
			end)
		end
	end
end
-------------------------------------------------------------------

