private void Finish()
        {
            finished = true;
            DisableTimer();

            string report = "";

            int points = testComplete ? ActivitySettings.pointsPerChallenge : 0;

            if (shortCount > 0)
            {
                report += "A bit of smoke there. ";
            }
            else
            {
                points += 5;
            }

            if (testComplete)
            {
                report += "Well done. No short circuits. ";
            }
            else if (directWired)
            {
                report += "Made the first connection. Points for no short circuits. ";
            }
            else
            {
                report += "No connections made unfortunately. ";
                points  = 0;
            }

            Utils.RegisterActivityAndUpdateExperience(points);

            infoPanel.SetText(report + "Points earned: " + ActivitySettings.Asset.currentActivityScore);
            infoPanel.TryBonus();

            infoPanel.ShowFor(ActivitySettings.Asset.titleDisplayTime, () => { PostExit(true); });
        }
        private void Finish()
        {
            complete = true;

            string report = "";

            int total = correctConnections;

            if (total == CORRECT_COUNT)
            {
                total *= correctConnections;
            }

            total -= (incorrectConnections * INCORRECT_MULTIPLIER);

            if (shortCircuit)
            {
                total   = 0;
                report += "Short circuit! ";
            }

            if (correctConnections == CORRECT_COUNT && incorrectConnections == 0)
            {
                PlayReward();
            }

            Utils.RegisterActivityAndUpdateExperience(total);

            report += string.Format("Correct connections: {0} out of {1}. Incorrect connections: {2}. Total points: {3}",
                                    correctConnections, correctConnectionList.Count, incorrectConnections, ActivitySettings.Asset.currentActivityScore);

            infoPanel.SetText(report);
            infoPanel.TryBonus();

            infoPanel.ShowFor(ActivitySettings.Asset.titleDisplayTime, () => { PostExit(true); });
        }
Esempio n. 3
0
        private void Finish()
        {
            int points     = 0;
            int deductions = shortCount * ShortMultiplier;

            DisableTimer();

            string report = "";

            if (testComplete)
            {
                report += "Testing successfully completed. ";

                points = ActivitySettings.pointsPerChallenge - deductions;
                if (shortCount < 3)
                {
                    if (shortCount == 0)
                    {
                        PlayReward();
                        report += "Bonus for no short circuits! ";
                    }
                    else
                    {
                        report += string.Format("Partial bonus. Short circuit count: {0}. ", shortCount);
                    }

                    points += ActivitySettings.pointsPerChallenge - deductions;
                }
                else
                {
                    report += string.Format("Correct final result, but unfortunately {0} short circuits. ", shortCount);
                }
            }
            else if (switch1Test.TestComplete || switch2Test.TestComplete || closedCount > 0)
            {
                points  = (ActivitySettings.pointsPerChallenge / 3) - deductions;
                report += "Got one switch working correctly, which is a start. ";
                if (shortCount > 0)
                {
                    if (shortCount > 1)
                    {
                        report += string.Format("But there were {0} short circuits. ", shortCount);
                    }
                    else
                    {
                        report += "But there was a short circuit. ";
                    }
                }
            }
            else
            {
                report += "Not much to report here. No connections made. ";
                if (shortCount > 0)
                {
                    if (shortCount > 1)
                    {
                        report += string.Format("But you did manage {0} short circuits. ", shortCount);
                    }
                    else
                    {
                        report += "But you did manage a short circuit. ";
                    }
                }
            }

            Utils.RegisterActivityAndUpdateExperience(points);

            if (infoPanel)
            {
                infoPanel.SetText(report + "Points earned: " + ActivitySettings.Asset.currentActivityScore);
                infoPanel.TryBonus();

                infoPanel.ShowFor(ActivitySettings.Asset.titleDisplayTime, () => { PostExit(true); });
            }
        }
Esempio n. 4
0
        private void Finish()
        {
            int    deductions = 0;
            int    bonus = 0, score = 0;
            string response = "";

            DisableTimer();

            complete = true;

            if (catastrophicFail)
            {
                response = "You activated a fuse that was off! Very dangerous. Someone may be working on that circuit. ";
            }
            else
            {
                bool gotResult = selectedSwitches.Contains(correctFuseToSwitchOff);
                if (gotResult)
                {
                    response += string.Format("Fuse {0} is correct. ", correctFuseToSwitchOff);
                    if (selectedSwitches.Count == 1)
                    {
                        response += "Sensational! Did it first try. Sorry about the damaged fuse chart, but you worked around it. ";
                        PlayReward();
                    }
                    else
                    {
                        response += "Faulty circuit shut down. Summary of search for BB power point fuse: ";
                    }
                }

                foreach (var s in selectedSwitches)
                {
                    if ((s >= 1 && s <= 6) || s == 10 || s == 12 || s == 14 || s == 15)
                    {
                        response   += string.Format("Fuse {0} is clearly marked, and doesn't match. ", s);
                        deductions += deductForLabelledFuse;
                    }
                    else if (s == 11 || s == 13)
                    {
                        response   += string.Format("It couldn't be fuse {0}, as it was down while the powerpoint was sparking. What's more, it's very dangerous closing an unknown fuse! ", s);
                        deductions += deductForDownFuse;
                    }
                    else if (s == 7 || s == 9)
                    {
                        response   += string.Format("Fuse {0} is in the part of a clear sequence in the chart, and doesn't match BB. ", s);
                        deductions += deductForSequenceFuse;
                    }
                }

                if (gotResult)
                {
                    score = ActivitySettings.pointsPerChallenge - deductions;
                    if (deductions < 5)
                    {
                        bonus = ActivitySettings.pointsPerChallenge - deductions;
                    }
                }
            }
            Utils.RegisterActivityAndUpdateExperience(score + bonus);

            response += "Points: " + ActivitySettings.Asset.currentActivityScore;

            storeRoomInfoPanel.SetText(response);
            storeRoomInfoPanel.TryBonus();

            infoPanel.SetText(response);
            infoPanel.TryBonus();

            infoPanel.ShowFor(ActivitySettings.Asset.titleDisplayTime, () => { PostExit(true); });
        }