예제 #1
0
        public static globals.gm_challenge_results parseValidString(string s, int level)
        {
            globals.gm_challenge_results g = new globals.gm_challenge_results();

            char best = s.ToCharArray()[1];
            char bind = s.ToCharArray()[2];

            switch (level)
            {
            case 0:
                foreach (globals.gm1_bestclear gmc in Enum.GetValues(typeof(globals.gm1_bestclear)))
                {
                    if ((char)gmc != best)
                    {
                        continue;
                    }

                    if (gmc == globals.gm1_bestclear.None)
                    {
                        g.bestClear = globals.bestclear.None;
                    }
                    else if (gmc == globals.gm1_bestclear.FiveStar)
                    {
                        g.bestClear = globals.bestclear.FiveStar;
                    }
                    else if (gmc == globals.gm1_bestclear.FourStar)
                    {
                        g.bestClear = globals.bestclear.FourStar;
                    }
                    else if (gmc == globals.gm1_bestclear.ThreeStar)
                    {
                        g.bestClear = globals.bestclear.ThreeStar;
                    }
                    else if (gmc == globals.gm1_bestclear.FullCombo)
                    {
                        g.bestClear = globals.bestclear.FullCombo;
                    }
                }
                foreach (globals.gm1_numbindings gmb in Enum.GetValues(typeof(globals.gm1_numbindings)))
                {
                    if ((char)gmb != bind)
                    {
                        continue;
                    }

                    if (gmb == globals.gm1_numbindings.None)
                    {
                        g.numBind = globals.numbindings.None;
                    }
                    else if (gmb == globals.gm1_numbindings.One)
                    {
                        g.numBind = globals.numbindings.One;
                    }
                    else if (gmb == globals.gm1_numbindings.Two)
                    {
                        g.numBind = globals.numbindings.Two;
                    }
                    else if (gmb == globals.gm1_numbindings.Three)
                    {
                        g.numBind = globals.numbindings.Three;
                    }
                    else if (gmb == globals.gm1_numbindings.Four)
                    {
                        g.numBind = globals.numbindings.Four;
                    }
                }
                break;

            case 1:
                foreach (globals.gm2_bestclear gmc in Enum.GetValues(typeof(globals.gm2_bestclear)))
                {
                    if ((char)gmc != best)
                    {
                        continue;
                    }

                    if (gmc == globals.gm2_bestclear.None)
                    {
                        g.bestClear = globals.bestclear.None;
                    }
                    else if (gmc == globals.gm2_bestclear.FiveStar)
                    {
                        g.bestClear = globals.bestclear.FiveStar;
                    }
                    else if (gmc == globals.gm2_bestclear.FourStar)
                    {
                        g.bestClear = globals.bestclear.FourStar;
                    }
                    else if (gmc == globals.gm2_bestclear.ThreeStar)
                    {
                        g.bestClear = globals.bestclear.ThreeStar;
                    }
                    else if (gmc == globals.gm2_bestclear.FullCombo)
                    {
                        g.bestClear = globals.bestclear.FullCombo;
                    }
                }
                foreach (globals.gm2_numbindings gmb in Enum.GetValues(typeof(globals.gm2_numbindings)))
                {
                    if ((char)gmb != bind)
                    {
                        continue;
                    }

                    if (gmb == globals.gm2_numbindings.None)
                    {
                        g.numBind = globals.numbindings.None;
                    }
                    else if (gmb == globals.gm2_numbindings.One)
                    {
                        g.numBind = globals.numbindings.One;
                    }
                    else if (gmb == globals.gm2_numbindings.Two)
                    {
                        g.numBind = globals.numbindings.Two;
                    }
                    else if (gmb == globals.gm2_numbindings.Three)
                    {
                        g.numBind = globals.numbindings.Three;
                    }
                    else if (gmb == globals.gm2_numbindings.Four)
                    {
                        g.numBind = globals.numbindings.Four;
                    }
                }

                break;

            case 2:
                foreach (globals.gm3_bestclear gmc in Enum.GetValues(typeof(globals.gm3_bestclear)))
                {
                    if ((char)gmc != best)
                    {
                        continue;
                    }

                    if (gmc == globals.gm3_bestclear.None)
                    {
                        g.bestClear = globals.bestclear.None;
                    }
                    else if (gmc == globals.gm3_bestclear.FiveStar)
                    {
                        g.bestClear = globals.bestclear.FiveStar;
                    }
                    else if (gmc == globals.gm3_bestclear.FourStar)
                    {
                        g.bestClear = globals.bestclear.FourStar;
                    }
                    else if (gmc == globals.gm3_bestclear.ThreeStar)
                    {
                        g.bestClear = globals.bestclear.ThreeStar;
                    }
                    else if (gmc == globals.gm3_bestclear.FullCombo)
                    {
                        g.bestClear = globals.bestclear.FullCombo;
                    }
                }
                foreach (globals.gm3_numbindings gmb in Enum.GetValues(typeof(globals.gm3_numbindings)))
                {
                    if ((char)gmb != bind)
                    {
                        continue;
                    }

                    if (gmb == globals.gm3_numbindings.None)
                    {
                        g.numBind = globals.numbindings.None;
                    }
                    else if (gmb == globals.gm3_numbindings.One)
                    {
                        g.numBind = globals.numbindings.One;
                    }
                    else if (gmb == globals.gm3_numbindings.Two)
                    {
                        g.numBind = globals.numbindings.Two;
                    }
                    else if (gmb == globals.gm3_numbindings.Three)
                    {
                        g.numBind = globals.numbindings.Three;
                    }
                    else if (gmb == globals.gm3_numbindings.Four)
                    {
                        g.numBind = globals.numbindings.Four;
                    }
                }

                break;

            case 3:
                foreach (globals.gm4_bestclear gmc in Enum.GetValues(typeof(globals.gm4_bestclear)))
                {
                    if ((char)gmc != best)
                    {
                        continue;
                    }

                    if (gmc == globals.gm4_bestclear.None)
                    {
                        g.bestClear = globals.bestclear.None;
                    }
                    else if (gmc == globals.gm4_bestclear.FiveStar)
                    {
                        g.bestClear = globals.bestclear.FiveStar;
                    }
                    else if (gmc == globals.gm4_bestclear.FourStar)
                    {
                        g.bestClear = globals.bestclear.FourStar;
                    }
                    else if (gmc == globals.gm4_bestclear.ThreeStar)
                    {
                        g.bestClear = globals.bestclear.ThreeStar;
                    }
                    else if (gmc == globals.gm4_bestclear.FullCombo)
                    {
                        g.bestClear = globals.bestclear.FullCombo;
                    }
                }
                foreach (globals.gm4_numbindings gmb in Enum.GetValues(typeof(globals.gm4_numbindings)))
                {
                    if ((char)gmb != bind)
                    {
                        continue;
                    }

                    if (gmb == globals.gm4_numbindings.None)
                    {
                        g.numBind = globals.numbindings.None;
                    }
                    else if (gmb == globals.gm4_numbindings.One)
                    {
                        g.numBind = globals.numbindings.One;
                    }
                    else if (gmb == globals.gm4_numbindings.Two)
                    {
                        g.numBind = globals.numbindings.Two;
                    }
                    else if (gmb == globals.gm4_numbindings.Three)
                    {
                        g.numBind = globals.numbindings.Three;
                    }
                    else if (gmb == globals.gm4_numbindings.Four)
                    {
                        g.numBind = globals.numbindings.Four;
                    }
                }

                break;

            case 4:
                foreach (globals.gm5_bestclear gmc in Enum.GetValues(typeof(globals.gm5_bestclear)))
                {
                    if ((char)gmc != best)
                    {
                        continue;
                    }

                    if (gmc == globals.gm5_bestclear.None)
                    {
                        g.bestClear = globals.bestclear.None;
                    }
                    else if (gmc == globals.gm5_bestclear.FiveStar)
                    {
                        g.bestClear = globals.bestclear.FiveStar;
                    }
                    else if (gmc == globals.gm5_bestclear.FourStar)
                    {
                        g.bestClear = globals.bestclear.FourStar;
                    }
                    else if (gmc == globals.gm5_bestclear.ThreeStar)
                    {
                        g.bestClear = globals.bestclear.ThreeStar;
                    }
                    else if (gmc == globals.gm5_bestclear.FullCombo)
                    {
                        g.bestClear = globals.bestclear.FullCombo;
                    }
                }
                foreach (globals.gm5_numbindings gmb in Enum.GetValues(typeof(globals.gm5_numbindings)))
                {
                    if ((char)gmb != bind)
                    {
                        continue;
                    }

                    if (gmb == globals.gm5_numbindings.None)
                    {
                        g.numBind = globals.numbindings.None;
                    }
                    else if (gmb == globals.gm5_numbindings.One)
                    {
                        g.numBind = globals.numbindings.One;
                    }
                    else if (gmb == globals.gm5_numbindings.Two)
                    {
                        g.numBind = globals.numbindings.Two;
                    }
                    else if (gmb == globals.gm5_numbindings.Three)
                    {
                        g.numBind = globals.numbindings.Three;
                    }
                    else if (gmb == globals.gm5_numbindings.Four)
                    {
                        g.numBind = globals.numbindings.Four;
                    }
                }

                break;

            default:
                return(g);
            }
            return(g);
        }
예제 #2
0
        private void endGodMaster(string sceneName, bool died)
        {
            if (!died)
            {
                combo_mod.log("Congrats on winning!");

                globals.gm_challenge_results results = new globals.gm_challenge_results();
                results.numBind = (globals.numbindings)numBindings;
                double successRate = (godmasterTotalHits - numFails) / (double)godmasterTotalHits;

                if (numFails == 0)
                {
                    results.bestClear = globals.bestclear.FullCombo;
                }
                else if (successRate >= FIVE_STAR_SUCCESS_RATE)
                {
                    results.bestClear = globals.bestclear.FiveStar;
                }
                else if (successRate >= FOUR_STAR_SUCCESS_RATE)
                {
                    results.bestClear = globals.bestclear.FourStar;
                }
                else
                {
                    results.bestClear = globals.bestclear.ThreeStar;
                }

                if (results.numBind > globals.ALL_RESULTS[godmasterLevel].numBind)
                {
                    combo_mod.log("Found better score, saving!");
                    globals.ALL_RESULTS[godmasterLevel] = results;
                    cheat_detect.saveResults();
                }
                else if (results.numBind == globals.ALL_RESULTS[godmasterLevel].numBind && results.bestClear > globals.ALL_RESULTS[godmasterLevel].bestClear)
                {
                    combo_mod.log("Found better score, saving!");
                    globals.ALL_RESULTS[godmasterLevel] = results;
                    cheat_detect.saveResults();
                }
                else
                {
                    combo_mod.log("Found worse score than before, not saving.");
                }

                StartCoroutine(showWinScreen());
            }
            else
            {
                combo_mod.log("Sorry for your loss. :(");
                StartCoroutine(showFailureScreen());
            }

            inGodmasterBattle       = false;
            godmasterSceneSpeedMult = 1.0f;
            numHits        = 0;
            currentLevel   = 1;
            godmasterLevel = 0;
            comboMeter     = 0.0;
            updateComboBars();



            cheat_detect.saveResults();
        }