int correctButtons(TextMesh s)
    {
        switch (s.text)
        {
        case "A":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetBatteryCount(Battery.AA);
            break;

        case "B":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetBatteryHolderCount();
            break;

        case "C":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetPortCount();
            break;

        case "D":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetBatteryCount(Battery.D);
            break;

        case "E":
            digitAdded = int.Parse(NumberDisplays[0].text) + 5;
            break;

        case "F":
            digitAdded = int.Parse(NumberDisplays[0].text) % 5;
            break;

        case "G":
            digitAdded = int.Parse(NumberDisplays[0].text) + 69;
            break;

        case "H":
            int gi = 0;
            gi         = bomb.GetModuleNames().Where(x => x == "Forget Me Now").Count();
            digitAdded = int.Parse(NumberDisplays[0].text) + gi;
            break;

        case "I":
            digitAdded = int.Parse(NumberDisplays[0].text) + 18;
            break;

        case "J":
            int ni = 0;
            ni = bomb.GetModuleNames().Where(x => x == "The Necronomicon").Count();
            if (ni >= 1)
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + oldOnes(bomb.GetSerialNumberNumbers().Last());
            }
            else
            {
                int pi = bomb.GetPorts().Where(x => x == "ps/2").Count();
                digitAdded = int.Parse(NumberDisplays[0].text) + pi;
            }
            break;

        case "K":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetIndicators().Count();
            break;

        case "L":
            if (bomb.GetBatteryCount() == 4 && bomb.GetBatteryHolderCount() == 3 && bomb.GetPortCount() == 2)
            {
                digitAdded = int.Parse(NumberDisplays[0].text);
            }
            else
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + 3;
            }
            break;

        case "M":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetModuleNames().Count();
            break;

        case "N":
            if (bomb.GetBatteryCount(Battery.D) == 2 || bomb.GetBatteryCount(Battery.AA) == 6)
            {
                digitAdded = int.Parse(NumberDisplays[0].text) % 5;
            }
            else
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetPortPlateCount();
            }
            break;

        case "O":
            digitAdded = int.Parse(NumberDisplays[0].text) + 18;
            break;

        case "P":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetPortCount(Port.PS2);
            break;

        case "Q":
            if (bomb.GetSerialNumberLetters().Count() < 4)
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + (bomb.GetSerialNumberLetters().Count() * bomb.GetSerialNumberLetters().First());
            }
            else
            {
                if (bomb.GetSerialNumberNumbers().Sum() > 38)
                {
                    digitAdded = int.Parse(NumberDisplays[0].text) + (bomb.GetSerialNumberNumbers().Sum() % 20);
                }
                else
                {
                    digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetSerialNumberNumbers().Sum();
                }
            }
            break;

        case "R":
            if ((bomb.GetBatteryCount() + bomb.GetPortCount(Port.PS2)) - bomb.GetSerialNumberNumbers().Sum() < 0)
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + 1;
            }
            else
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + (bomb.GetBatteryCount() + bomb.GetPortCount(Port.PS2)) - bomb.GetSerialNumberNumbers().Sum();
            }
            break;

        case "S":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetSerialNumberNumbers().Sum();
            break;

        case "T":
            if (bomb.GetSerialNumberNumbers().Sum() > 10)
            {
                digitAdded = int.Parse(NumberDisplays[0].text) * 5;
            }
            else
            {
                digitAdded = int.Parse(NumberDisplays[0].text) * 10;
            }
            digitAdded %= 100;
            break;

        case "U":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetSerialNumberNumbers().Count();
            break;

        case "V":
            int a = 0;
            foreach (string module in bomb.GetModuleNames())
            {
                string temp = module.ToLower();
                if (temp.Contains("forget") && !temp.Contains("forgetting") && !temp.Contains("forgets"))
                {
                    a++;
                }
            }
            if (a > 0)
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + (bomb.GetBatteryCount() * 2);
                break;
            }
            else
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetBatteryCount();
                break;
            }

        case "W":
            digitAdded = int.Parse(NumberDisplays[0].text) * 25;
            break;

        case "X":
            digitAdded = int.Parse(NumberDisplays[0].text) + 25;
            if (bomb.GetBatteryCount(Battery.D) == 2 || bomb.GetBatteryCount(Battery.AA) == 6)
            {
                digitAdded %= 5;
            }
            else
            {
                digitAdded += bomb.GetPortPlateCount();
            }
            digitAdded += bomb.GetSerialNumberNumbers().Sum();
            digitAdded += bomb.GetBatteryCount(Battery.AA);
            if (bomb.GetSerialNumberNumbers().Sum() > 10)
            {
                digitAdded *= 5;
            }
            else
            {
                digitAdded *= 10;
            }
            digitAdded %= 100;
            digitAdded += bomb.GetPortPlateCount();
            break;

        case "Y":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetPortPlateCount();
            break;

        case "Z":
            digitAdded = int.Parse(NumberDisplays[0].text) + 11;
            break;
        }
        Debug.LogFormat("[Alphabetical Ruling #{0}] Rule used: {1}", moduleId, s.text);
        return(digitAdded);
    }
Beispiel #2
0
    int correctButtons(TextMesh s)
    {
        int digitAdded = 0;

        switch (s.text)
        {
        case "A":
            digitAdded = int.Parse(NumberDisplays[0].text) - bomb.GetSerialNumberNumbers().Last();
            break;

        case "B":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetPortCount(Port.Parallel);
            break;

        case "C":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetBatteryHolderCount();
            break;

        case "D":
            digitAdded = int.Parse(NumberDisplays[0].text) - bomb.GetBatteryCount(Battery.AA);
            break;

        case "E":
            digitAdded = int.Parse(NumberDisplays[0].text) + 280;
            break;

        case "F":
            digitAdded = int.Parse(NumberDisplays[0].text) % 6;
            break;

        case "G":
            digitAdded = int.Parse(NumberDisplays[0].text) - 69;
            break;

        case "H":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetPortCount(Port.PS2);
            break;

        case "I":
            digitAdded = int.Parse(NumberDisplays[0].text) - bomb.GetModuleIDs().Where(x => x == "omegaForget").Count();
            break;

        case "J":
            int ni = 0;
            ni = bomb.GetModuleIDs().Where(x => x == "necronomicon").Count();
            if (ni >= 1 && (!(bomb.GetSerialNumberNumbers().Last() == 0) && !(bomb.GetSerialNumberNumbers().Last() == 9)))
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + oldOnes(bomb.GetSerialNumberNumbers().Last());
            }
            else
            {
                int pi = bomb.GetPortCount(Port.PS2);
                digitAdded = int.Parse(NumberDisplays[0].text) + pi;
            }
            break;

        case "K":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetIndicators().Count();
            break;

        case "L":
            if (bomb.GetBatteryCount() == 4 && bomb.GetBatteryHolderCount() == 3 && bomb.GetPortCount() == 2)
            {
                digitAdded = int.Parse(NumberDisplays[0].text);
            }
            else
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + 3;
            }
            break;

        case "M":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetModuleNames().Count();
            break;

        case "N":
            if (bomb.GetBatteryCount() == 2 && bomb.GetBatteryHolderCount() == 1 && bomb.GetPortCount(Port.PS2) > 0)
            {
                digitAdded = int.Parse(NumberDisplays[0].text) - factorialGive(bomb.GetSerialNumberNumbers().Last());
            }
            else
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetModuleIDs().Where(x => x == "kugelblitz").Count();
            }
            break;

        case "O":
            digitAdded = int.Parse(NumberDisplays[0].text) + 81;
            break;

        case "P":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetPortCount(Port.Serial);
            break;

        case "Q":
            if (bomb.GetPortCount() > 2)
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetPortPlateCount() + 2;
            }
            else
            {
                digitAdded = int.Parse(NumberDisplays[0].text);
            }
            break;

        case "R":
            digitAdded = int.Parse(NumberDisplays[0].text) + (bomb.GetBatteryCount(Battery.D) + bomb.GetPortCount(Port.PS2)) - bomb.GetSerialNumberNumbers().Sum();
            digitAdded = Math.Abs(digitAdded);
            break;

        case "S":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetSerialNumberNumbers().Sum();
            break;

        case "T":
            if (bomb.GetSerialNumberNumbers().Sum() > 10)
            {
                digitAdded = int.Parse(NumberDisplays[0].text) * 5;
            }
            else
            {
                digitAdded = int.Parse(NumberDisplays[0].text) * 10;
            }
            digitAdded %= 100;
            break;

        case "U":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetSerialNumberNumbers().Count();
            break;

        case "V":
            int a = 0;
            foreach (string module in bomb.GetModuleNames())
            {
                string temp = module.ToLower();
                if (temp.Contains("forget") && !temp.Contains("forgetting") && !temp.Contains("forgets"))
                {
                    a++;
                }
            }
            if (a > 0)
            {
                digitAdded = int.Parse(NumberDisplays[0].text) + (bomb.GetBatteryCount() * 2);
                break;
            }
            else
            {
                digitAdded = int.Parse(NumberDisplays[0].text) * 49;
                break;
            }

        case "W":
            digitAdded = int.Parse(NumberDisplays[0].text) * 25;
            break;

        case "X":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetBatteryCount() + bomb.GetBatteryHolderCount();
            break;

        case "Y":
            digitAdded = int.Parse(NumberDisplays[0].text) + bomb.GetPortPlateCount() - 1;
            break;

        case "Z":
            digitAdded = int.Parse(NumberDisplays[0].text) + 11;
            break;
        }
        a[currentStage - 1] += digitAdded % 10;
        digitAdded          %= 10;
        if (digitAdded < 0)
        {
            digitAdded += 10;
        }
        ;
        if (digitAdded == 0)
        {
            Debug.LogFormat("[Alphabetical Ruling #{0}] Number to press: {1}", moduleId, digitAdded + 1);
        }
        else
        {
            Debug.LogFormat("[Alphabetical Ruling #{0}] Number to press: {1}", moduleId, digitAdded);
        }
        Debug.LogFormat("[Alphabetical Ruling #{0}] Rule used: {1}", moduleId, s.text);
        return(digitAdded);
    }