Exemplo n.º 1
0
        /// <summary>
        /// Player lost a ball.  This is where we decrement the number of
        /// balls on the playfield and test for end of game or end of ball.
        /// </summary>
        public void BallDrained()
        {
            bool ballLost = TroughManager.BallDrained(_isTilted);

            //check if that's the last ball
            if (ballLost) //that last outlane counted.
            {
                //time to check the trough if it's full
                Task.Factory.StartNew(() =>
                {
                    int counter = 2;
                    bool isTroughFull;
                    do
                    {
                        isTroughFull = TroughManager.WaitForAllBalls(300, false);
                        counter--;
                    } while (!isTroughFull || counter >= 0);
                    if (isTroughFull)
                    {
                        EndOfBall();
                    }
                });
            }
            else //ball was saved.  play animation
            {
                DisplayManager.PlayCutScene(DisplayConstants.CutScenes.Bonuses.SHOOTAGAIN);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Collect and reset the bonus points for this player.
 /// </summary>
 public void CollectBonus()
 {
     _log.Debug("Calculating Bonus for Player " + PlayerStatus.PlayerUp);
     //calculate bonus
     DisplayManager.PlayCutScene(DisplayConstants.CutScenes.Bonuses.COLLECTBONUS);
     //now actually add the value to his score
     //PlayerStatus.CurrentPlayer.Score = ????
 }
Exemplo n.º 3
0
        /// <summary>
        /// Plays the player intro (MAP) and primes the table for the player status.
        /// </summary>
        public void StartPlayIntro()
        {
            //select user
            //ask the credit manager if we have credits
            PlayerStatus.CurrentPlayer.PlayerHealthStatus = "Player "
                                                            + PlayerStatus.PlayerUp + " is up";

            DisplayManager.PlaySequence(DisplayConstants.Modes.ActiveGameMode.ACTIVEGAMEMODE);
            //Character is selected, now let's show the map.
            DisplayManager.PlayCutScene(DisplayConstants.CutScenes.MapMode.MAP);
            SoundManager.PlayMusic(SoundConstants.Music.LevelStart, false);
            SoundManager.PlayMusic(SoundConstants.Music.Level1Normal, true);
            //DisplayManager.SetGameStatus(PlayerStatus.CurrentPlayer);
            SwitchManager.EnableFlippers(true);
        }
 private void addDraculaLetter(int letterIndex)
 {
     if (!_instance._isTilted)
     {
         if (PlayerStatus.CurrentPlayer.AddDraculaLetter(letterIndex)) //true if new card
         {
             Dictionary <string, string> args = new Dictionary <string, string>();
             args.Add("DRACULA", "TRUE");
             args.Add("FLIPPED", letterIndex.ToString());
             DisplayManager.PlayCutScene(DisplayConstants.CutScenes.ActiveGameMode.ADDLETTER, args);
             _instance.AddScore(ScoreConstants.LETTERNEW);
         }
         else
         {
             _instance.AddScore(ScoreConstants.LETTER);
         }
     }
 }
Exemplo n.º 5
0
            public TrophyRoomMode()
            {
                _log.Info("Trophy Room Mode Started");
                DisplayManager.OnAnimationCompleted += new DisplayEventHandler(DisplayManager_OnAnimationCompleted);
                SwitchManager.RegisterSwitchHandler(handleSwitchChanges);

                //Rotate Playfield to CenterScoop position
                SwitchManager.RotateStage(SwitchConstants.StagePositions.TrophyScoop);
                SwitchManager.RotateCross(false);

                //Play "Collect Trophy" instructional video
                DisplayManager.PlayCutScene(DisplayConstants.CutScenes.ActiveGameMode.COLLECTTROPHY);
                LightManager.PlaySequence(LightingConstants.Lfx.CollectTrophySlow);

                _collectBonusTimer = new Timer(new TimerCallback(collectBonusTimerHandler),
                                               null, 1000, 1000); //ticks every second
                _timeStarted = new System.Diagnostics.Stopwatch();
                _timeStarted.Start();
            }
Exemplo n.º 6
0
        /// <summary>
        /// Initialize the table for a new game.
        /// </summary>
        public void ResetForNewGame()
        {
            PlayerStatus.Reset();
            AddPlayer();

            //TroughManager.CheckForStuckBall()
            //check quickly
            if (!TroughManager.WaitForAllBalls(5, false))
            {
                DisplayManager.PlayCutScene(DisplayConstants.CutScenes.Test.BALLSEARCH);
            }
            //ok, we've got a stuck ball somewhere.
            int attempts = 0;

            while (attempts < 5 && !TroughManager.WaitForAllBalls(5000, true))
            {
                DisplayManager.PlayCutScene(DisplayConstants.CutScenes.Test.BALLSEARCH);
                attempts++;
            }

            _isTilted = false;
        }