Пример #1
0
    void CreatePassword()
    {
        for (int i = 0; i < m_receivePasswordsLocks.Count; i++)
        {
            string firstLetter  = m_letters[Random.Range(0, m_letters.Length)];
            string secondLetter = m_letters[Random.Range(0, m_letters.Length)];
            string thirdLetter  = m_letters[Random.Range(0, m_letters.Length)];
            m_currentPassword = string.Format("{0}{1}{2}", firstLetter, secondLetter, thirdLetter);

            m_allPasswords[i] = m_currentPassword;
        }
        for (int i = 0; i < 3; i++)
        {
            m_receivePasswordsLocks[i].password = m_allPasswords[i];
            int randomKey = Random.Range(0, m_lockNumbers.Count);
            if (i == 0)
            {
                robotBodyPasswordButtonScript.ReceivePassword(m_allPasswords[0]);
            }
            if (i == 2)
            {
                m_safePasswords[3] = m_allPasswords[i];
                m_safeLocksScript.actualPassword = m_allPasswords[i];
            }
            m_receivePasswordsKeys[(m_lockNumbers[randomKey])].password = m_allPasswords[i];
            string message = string.Format("////CONFIDENTIAL////\n---For Authorised Personnel Only---\n{0} has the password for {1}", m_keyObjectNames[(m_lockNumbers[randomKey])], m_lockObjectNames[i]);
            documentButtons[i].documentText = message;
            m_hackingDocumentScript.RecieveDocumentMessages(message, i);
            m_lockNumbers.Remove(m_lockNumbers[randomKey]);
        }

        SafePasswords();
    }
    void CreatePassword()
    {
        for (int i = 0; i < m_receivePasswordsLocks.Count; i++)
        {
            m_allPasswords[i] = generatePassword.GetGeneratePassword(3);
        }

        for (int i = 0; i < 3; i++)
        {
            m_receivePasswordsLocks[i].password = m_allPasswords[i];
            int randomKey = Random.Range(0, m_lockNumbers.Count);

            switch (i)
            {
            case 0:
                robotBodyPasswordButtonScript.ReceivePassword(m_allPasswords[0]);
                aiObjectivesScript.ReceivePassword(m_allPasswords[0]);
                break;

            case 2:
                m_safePasswords[3] = m_allPasswords[i];
                m_safeLocksScript.actualPassword = m_allPasswords[i];
                break;
            }

            m_receivePasswordsKeys[(m_lockNumbers[randomKey])].password = m_allPasswords[i];
            string message = string.Format("////CONFIDENTIAL////\n---For Authorised Personnel Only---\n{0} has the password for {1}", m_keyObjectNames[(m_lockNumbers[randomKey])], m_lockObjectNames[i]);
            documentButtons[i].documentText = message;
            m_hackingDocumentScript.RecieveDocumentMessages(message, i);
            m_lockNumbers.Remove(m_lockNumbers[randomKey]);
        }

        SafePasswords();
    }
Пример #3
0
 void AISwitchInfo()
 {
     for (int i = 6; i < 9; i++)
     {
         m_hackingDocumentScript.RecieveDocumentMessages(m_actionMessages[i - 1], i);
         documentButtons[i - 6].GetComponent <DocumentButton>().documentText = m_actionMessages[i - 1];
     }
 }
Пример #4
0
    void GenerateStarSign()
    {
        m_correctStarSign    = Random.Range(0, 12);
        starsignImage.sprite = starsigns[m_currentStarsign];
        string starsignMessage = string.Format("////CONFIDENTIAL////\n---For Authorised Personnel Only---\nThe star sign that unlocks the safe is {0}", starsignNames[m_correctStarSign]);

        documentButtons[0].GetComponent <DocumentButton>().documentText = string.Format("The star sign that unlocks the safe is {0}", starsignNames[m_correctStarSign]);
        scientistComputerScript.ReceiveStarsign(starsignMessage);

        m_hackingDocuments.RecieveDocumentMessages(starsignMessage, 4);
    }
Пример #5
0
    void RandomiseButtonOrder()
    {
        int button1ID = Random.Range(0, 100);
        int button2ID = Random.Range(0, 100);
        int button3ID = Random.Range(0, 100);
        int button4ID = Random.Range(0, 100);

        int currentRank = 1;

        for (int i = 0; i < 100; i++)
        {
            if (i == button1ID)
            {
                m_rankOrder[0] = currentRank;
                currentRank   += 1;
            }
            if (i == button2ID)
            {
                m_rankOrder[1] = currentRank;
                currentRank   += 1;
            }
            if (i == button3ID)
            {
                m_rankOrder[2] = currentRank;
                currentRank   += 1;
            }
            if (i == button4ID)
            {
                m_rankOrder[3] = currentRank;
                currentRank   += 1;
            }
        }

        /*for (int i = 0; i < m_rankOrder.Length; i++)
         * {
         *  print(m_rankOrder[i]);
         * }*/
        //print(string.Format("{0},{1},{2},{3}", m_rankOrder[0], m_rankOrder[1], m_rankOrder[2], m_rankOrder[3]));
        string message = string.Format("////CONFIDENTIAL////\n---For Authorised Personnel Only---\n The order of the buttons are: \n{0},{1},{2},{3}", shapeNames[m_rankOrder[0] - 1], shapeNames[m_rankOrder[1] - 1], shapeNames[m_rankOrder[2] - 1], shapeNames[m_rankOrder[3] - 1]);//all goes wrong, remove shapenames part

        m_hackingDocumentScript.RecieveDocumentMessages(message, 3);
        documentButton.GetComponent <DocumentButton>().documentText = string.Format("The order of the shapes are: \n{0}, {1}, {2}, {3}", shapeNames[m_rankOrder[0] - 1], shapeNames[m_rankOrder[1] - 1], shapeNames[m_rankOrder[2] - 1], shapeNames[m_rankOrder[3] - 1]);
        scientistComputerScript.ReceiveSequence(message);
        for (int i = 0; i < 4; i++)
        {
            m_safeLockScript.sequenceOrder[i] = m_rankOrder[i];
        }
    }
Пример #6
0
    void Start()
    {
        //print("Start");
        m_scientistWinScript = scientist.GetComponent <ScientistWin>();
        m_safeAS             = safe.GetComponent <AudioSource>();
        m_freezeControls     = gameController.GetComponent <FreezeControls>();
        m_hackingDocuments   = ai.GetComponent <HackingDocuments>();
        m_safeAnim           = safe.GetComponent <Animator>();
        UpdatePanels();
        m_lockedOutTime      = lockedOutTime;
        m_countingDown       = m_lockedOutTime;
        locksText.text       = string.Format("({0}/3) Locks Unlocked", m_locksUnlocked);
        m_correctStarSign    = Random.Range(0, 12);
        starsignImage.sprite = starsigns[m_currentStarsign];
        string starsignMessage = string.Format("////CONFIDENTIAL////\n---For Authorised Personnel Only---\nThe star sign that unlocks the safe is {0}", starsignNames[m_correctStarSign]);

        documentButtons[0].GetComponent <DocumentButton>().documentText = string.Format("The star sign that unlocks the safe is {0}", starsignNames[m_correctStarSign]);
        scientistComputerScript.ReceiveStarsign(starsignMessage);

        m_hackingDocuments.RecieveDocumentMessages(starsignMessage, 4);
        safeCanvas.SetActive(false);
    }