Exemplo n.º 1
0
 void OnReactivate()
 {
     beSpecial = false;
     isActive  = true;
     Debug.LogFormat("[Flavor Text #{0}] It's back on.", _moduleId);
     textOptions      = JsonConvert.DeserializeObject <List <FlavorTextOption> >(flavorTextJson.text);
     textOption       = textOptions[UnityEngine.Random.Range(0, textOptions.Count)];
     textDisplay.text = textOption.text;
     if (textOption.text == "And here's the Countdown clock...")
     {
         beSpecial = true;
         Debug.LogFormat("[Flavor Text #{0}] It's looking for (Cruel) Countdown.", _moduleId);
     }
     else
     {
         Debug.LogFormat("[Flavor Text #{0}] It's looking for {1}.", _moduleId, textOption.name);
     }
     Debug.LogFormat("[Flavor Text #{0}] It said: {1}", _moduleId, textOption.text);
     if (moduleNames.Contains(textOption.name) ||
         (textOption.name == "The Stare" && starePresent) || beSpecial && (moduleNames.Contains("Countdown") || moduleNames.Contains("Cruel Countdown")))
     {
         Debug.LogFormat("[Flavor Text #{0}] Do you accept it? (You probably should...)", _moduleId);
     }
     else
     {
         Debug.LogFormat("[Flavor Text #{0}] Do you accept it? (You probably should not...)", _moduleId);
     }
 }
Exemplo n.º 2
0
    void Randomize()
    {
        int index;

        //
        if (stageNumber == 1)
        {
            index = UnityEngine.Random.Range(0, 694);
        }
        else if (stageNumber == 2)
        {
            index = UnityEngine.Random.Range(694, 5440);                        //7
        }
        else if (stageNumber == 3)
        {
            index = UnityEngine.Random.Range(5440, 7629);                        //13
        }
        else
        {
            index = UnityEngine.Random.Range(7629, 7891);  //19
        }
        textOption       = textOptions[index];
        textDisplay.text = textOption.text.ToString();
        //Randomize();
        Debug.LogFormat("[Chinese Strokes #{0}] Stage {4}: Selected character: {1} (index {3}), Number of strokes: {2}", moduleId, textOption.text, textOption.number, index, stageNumber);
    }
Exemplo n.º 3
0
 void OnActivate()
 {
     isActive = true;
     Debug.LogFormat("[Flavor Text #{0}] It's on.", _moduleId);
     textOption       = textOptions[UnityEngine.Random.Range(0, textOptions.Count)];
     textDisplay.text = textOption.text;
     if (textOption.text == "And here's the Countdown clock...")
     {
         beSpecial = true;
         Debug.LogFormat("[Flavor Text #{0}] It's looking for (Cruel) Countdown.", _moduleId);
     }
     else
     {
         Debug.LogFormat("[Flavor Text #{0}] It's looking for {1}.", _moduleId, textOption.name);
     }
     Debug.LogFormat("[Flavor Text #{0}] It said: {1}", _moduleId, textOption.text);
     if (moduleNames.Contains(textOption.name) ||
         (textOption.name == "The Stare" && starePresent) || beSpecial && (moduleNames.Contains("Countdown") || moduleNames.Contains("Cruel Countdown")))
     {
         Debug.LogFormat("[Flavor Text #{0}] Do you accept it? (You probably should...)", _moduleId);
     }
     else
     {
         Debug.LogFormat("[Flavor Text #{0}] Do you accept it? (You probably should'nt...)", _moduleId);
     }
     for (int i = 0; i < buttons.Count(); i++)
     {
         int j = i;
         buttons[i].OnInteract += delegate() { OnPress(j); return(false); };
     }
 }
Exemplo n.º 4
0
    void Randomize()
    {
        for (int i = 0; i < 4; i++)
        {
            leds[i].material = off;
        }
        buttonStates     = new[] { false, false, false, false };
        buttonNumbers    = new[] { 0, 0, 0, 0 };
        buttonNumbers[0] = UnityEngine.Random.Range(0, 10);
        buttonNumbers[1] = UnityEngine.Random.Range(0, 10);
        do
        {
            buttonNumbers[1] = UnityEngine.Random.Range(0, 10);
        } while (buttonNumbers[1] == buttonNumbers[0]);
        buttonNumbers[2] = UnityEngine.Random.Range(0, 10);
        do
        {
            buttonNumbers[2] = UnityEngine.Random.Range(0, 10);
        } while (buttonNumbers[2] == buttonNumbers[0] || buttonNumbers[2] == buttonNumbers[1]);
        buttonNumbers[3] = UnityEngine.Random.Range(0, 10);
        do
        {
            buttonNumbers[3] = UnityEngine.Random.Range(0, 10);
        } while (buttonNumbers[3] == buttonNumbers[0] || buttonNumbers[3] == buttonNumbers[1] || buttonNumbers[3] == buttonNumbers[2]);
        string choice = "";

        for (int i = 0; i < buttons.Length; i++)
        {
            string label = buttonNumbers[i].ToString();
            choice += label;
            TextMesh buttonText = buttons[i].GetComponentInChildren <TextMesh>();
            buttonText.text = label;
        }

        textOption       = textOptions[UnityEngine.Random.Range(0, textOptions.Count)];
        textDisplay.text = textOption.text;
        moduleIds        = new List <int>();
        for (int i = 0; i < textOptions.Count; i++)
        {
            if (textOptions[i].text == textOption.text && !moduleIds.Contains(textOptions[i].steam_id))
            {
                moduleIds.Add(textOptions[i].steam_id);
            }
        }
    }
Exemplo n.º 5
0
 void OnActivate()
 {
     isActive = true;
     Debug.LogFormat("[Flavor Text #{0}] It's on.", _moduleId);
     textOption       = textOptions[UnityEngine.Random.Range(0, textOptions.Count)];
     textDisplay.text = textOption.text;
     if (textOption.text == "And here's the Countdown clock...")
     {
         Debug.LogFormat("[Flavor Text #{0}] It's looking for (Cruel) Countdown.", _moduleId);
     }
     else
     {
         Debug.LogFormat("[Flavor Text #{0}] It's looking for {1}.", _moduleId, textOption.name);
     }
     Debug.LogFormat("[Flavor Text #{0}] It said: {1}", _moduleId, textOption.text);
     Debug.LogFormat("[Flavor Text #{0}] Do you accept it?", _moduleId);
     for (int i = 0; i < buttons.Count(); i++)
     {
         int j = i;
         buttons[i].OnInteract += delegate() { OnPress(j); return(false); };
     }
 }