Exemple #1
0
        public void catchAchievement(object sender, TeamEvent te)
        {
            Team   theSender          = (Team)sender;
            string achievementMessage = theSender.toStringTeamName() + "";

            switch (te.Message)
            {
            case "gotGame":     // Record Streak of 2
                achievementMessage += " have got Game!";
                break;

            case "turkey":     // Record Streak of 3
                achievementMessage += " got a Turkey!";
                break;

            case "unstoppable":     // Record Streak of 5
                achievementMessage += " are unstoppable!!";
                break;

            case "godlike":     // Record Streak of 10
                achievementMessage += " are godlike";
                break;
            }

            Form f = new AchievementUnlocked(achievementMessage);

            f.Location = new Point(Screen.PrimaryScreen.WorkingArea.Location.X / 2,
                                   Screen.PrimaryScreen.WorkingArea.Location.Y - 50);
            f.Show();
        }
Exemple #2
0
        /// <summary>
        /// Method that increments a teams stats for winning a game
        /// </summary>
        public void winGame()
        {
            if (!wonPrevious)
            {
                currentStreak = 1;
                timeOnTable   = BPMSMain.gameLength();
                wonPrevious   = true;
            }
            else
            {
                currentStreak++;

                #region Achievement Event Sender
                string message = "";

                switch (currentStreak)
                {
                case 2:
                    message = "gotGame";
                    break;

                case 3:
                    message = "turkey";
                    break;

                case 5:
                    message = "unstoppable";
                    break;

                case 10:
                    message = "godlike";
                    break;
                }
                if (message != "")
                {
                    TeamEvent te = new TeamEvent(message);
                    Achievement(this, te);
                }
                #endregion

                if (currentStreak > longestStreak)
                {
                    longestStreak = currentStreak;
                }
                timeOnTable += BPMSMain.gameLength();
                wonPrevious  = true;
            }
            rememberStreak = currentStreak;
            Wins++;
        }