Beispiel #1
0
 private TurnStateEnum UseAttackAction(IPlayerStatus player, IEnemy enemy)
 {
     return(player.MainHandAttack(enemy) &&
            player.BonusActionAvailable
         ? TurnStateEnum.OffHandAttack
         : TurnStateEnum.End);
 }
Beispiel #2
0
 protected override void TearDown()
 {
     player    = null;
     enemy     = null;
     status    = null;
     turnEvent = null;
 }
Beispiel #3
0
 private void CompleteTurns(IPlayerStatus status, IEnemy enemy)
 {
     for (int i = 0; i < numTurns; i++)
     {
         stateMachine.TakeTurn(status, enemy);
     }
 }
Beispiel #4
0
 public override TurnStateEnum Execute(IPlayerStatus player, IEnemy enemy)
 {
     Validate(player, enemy);
     player.EndTurn();
     TurnComplete = true;
     return(TurnStateEnum.Start);
 }
Beispiel #5
0
        public void ShowStageCleared(string key, IPlayerStatus status)
        {
            if (status == null)
            {
                return;                 //nothing to display
            }
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(delegate
                {
                    ShowStageCleared(key, status);
                }));
            }
            else
            {
                _currentPlayerStatus    = status; //keep a pointer to what should be displayed if we're not showing it now.
                flashForeground.Visible = true;
                //flashBackground.Visible = false;
                _log.DebugFormat("Loading swf file: {0}  into Background.", _collectBonuSwfFile);
                flashForeground.Movie = _collectBonuSwfFile;
                flashForeground.Tag   = key;                              //not used

                string stageBonus    = status.StageBonus.ToString();      // "1000000";
                string bonusLevel    = status.BonusMultiplier.ToString(); // "2";
                string hearts        = status.Hearts.ToString();          // "85";
                string heartValue    = "1000";                            //?? where should I get this?
                string enemiesKilled = status.EnemiesKilled.ToString();   // "200";
                string enemyValue    = "500";                             //?? where should I get this?
                callFlashString(flashForeground, "CollectBonus", "stagecleared", status.Scores[status.CurrentPlayerIndex], stageBonus, bonusLevel, hearts, heartValue, enemiesKilled, enemyValue);
                //CollectBonus(reason:String[stagecleared,endofball], baseScore:String, stageBonus:String, bonusLvl:String, hearts:String, heartValue:String, enemies:String, enemyValue:String):void");
            }
        }
Beispiel #6
0
 public override TurnStateEnum Execute(IPlayerStatus player, IEnemy enemy)
 {
     Validate(player, enemy);
     ValidatePlayerState(player);
     player.ActionSurge();
     return(TurnStateEnum.Action);
 }
Beispiel #7
0
        public void ShowMap(string key, IPlayerStatus status)
        {
            if (status == null)
            {
                return;                 //nothing to display
            }
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(delegate
                {
                    ShowMap(key, status);
                }));
            }
            else
            {
                lock (_lock)
                {
                    _currentPlayerStatus    = status; //keep a pointer to what should be displayed if we're not showing it now.
                    flashForeground.Visible = true;
                    //flashBackground.Visible = false;
                    _log.DebugFormat("Loading swf file: {0} into Foreground.", _mapSwfFile);
                    flashForeground.Movie = _mapSwfFile;
                    flashForeground.Tag   = key; //not used

                    //flash is 1 based array
                    callFlashString(flashForeground, "ShowLevelMap", (int)_currentPlayerStatus.LevelIndex + 1, _currentPlayerStatus.RoomIndex + 1);
                }
            }
        }
        public GameLoadCommand(ICommunicator communicator, IPlayerStatus playerStatus, GameLoadPhrases phrases)
        {
            _communicator = communicator;
            _playerStatus = playerStatus;

            _genericPhrases = PhraseBook.Ingest(phrases.Generic);
        }
Beispiel #9
0
 private ulong GetNumberOfBrokenGuns(IPlayerStatus status)
 {
     ulong total = status.MainHand.CanFire()
         ? (ulong)0 : 1;
     total += (ulong)status.OffHands.Where(x => !x.CanFire()).Count();
     return total;
 }
Beispiel #10
0
        protected override void Setup()
        {
            player = new Player(always10, 11, 11, FightingStyle.Archery, mh, ohs, feats, buffs);
            enemy  = new Enemy(14);
            status = new PlayerStatus(always10, player);

            ret = (TurnStateEnum)(999);
        }
Beispiel #11
0
 internal static void SetGameStatus(IPlayerStatus playerStatus)
 {
     if (_instance._currentMode != DisplayConstants.Modes.ActiveGameMode.ACTIVEGAMEMODE)
     {
         return;
     }
     getInstance()._display.SetGameStatus(playerStatus);
     PlayerStatus.IsDirty = false;  //THIS SHOULD BE THE ONLY PLACE TO SET THIS
 }
Beispiel #12
0
        public DetourPlanner(INavigator navigator, IDetourDataService detourDataService, IPlayerStatus playerStatus, ILogger logger)
        {
            _navigator         = navigator;
            _detourDataService = detourDataService;
            _playerStatus      = playerStatus;
            _logger            = logger;

            _detourAmount = _defaultDetourAmount;
        }
Beispiel #13
0
        public override TurnStateEnum Execute(IPlayerStatus player, IEnemy enemy)
        {
            Validate(player, enemy);
            ValidatePlayerCanStartTurn(player);

            return(player.NumberOfTurnsPassed == 0
                ? TurnStateEnum.FirstTurnSpellBuff
                : TurnStateEnum.Action);
        }
Beispiel #14
0
        public ProgressCommand(ICommunicator communicator, INavigator navigator, IPlayerStatus playerStatus, ProgressPhrases phrases)
        {
            _navigator    = navigator;
            _communicator = communicator;
            _playerStatus = playerStatus;

            _progressPhrases       = PhraseBook.Ingest(phrases.Progress);
            _systemsScannedPhrases = PhraseBook.Ingest(phrases.SystemsScanned);
        }
        public NextScanCommand(ICommunicator communicator, INavigator navigator, IPlayerStatus playerStatus, NextScanPhrases phrases)
        {
            _navigator    = navigator;
            _communicator = communicator;
            _playerStatus = playerStatus;

            _skipPhrases     = PhraseBook.Ingest(phrases.SkipSystem);
            _nextScanPhrases = PhraseBook.Ingest(phrases.NextScan);
            _completePhrases = PhraseBook.Ingest(phrases.ScansComplete);
        }
        public RescanSystemCommand(ICommunicator communicator, INavigator navigator, IPlayerStatus playerStatus, RescanSystemPhrases phrases, ScansRemainingPhrases scanPhrases)
        {
            _navigator    = navigator;
            _communicator = communicator;
            _playerStatus = playerStatus;

            _errorPhrase         = phrases.Error;
            _systemUnscanned     = PhraseBook.Ingest(phrases.SystemUnscanned);
            _notExpeditionSystem = PhraseBook.Ingest(scanPhrases.SkipSystem);
        }
        public FindNextSystemCommand(ICommunicator communicator, INavigator navigator, IGalaxyMap galaxyMap, FindNextSystemPhrases phrases, IPlayerStatus playerStatus)
        {
            _communicator = communicator;
            _navigator    = navigator;
            _galaxyMap    = galaxyMap;
            _playerStatus = playerStatus;

            _phraseBook       = PhraseBook.Ingest(phrases.Phrases);
            _finalDestination = PhraseBook.Ingest(phrases.FinalDestination);
        }
Beispiel #18
0
        private void CompleteTurn(TurnStateMachine fsm,
                                  IPlayerStatus status,
                                  IEnemy enemy)
        {
            int currentTurn = status.NumberOfTurnsPassed;

            while (status.NumberOfTurnsPassed == currentTurn)
            {
                Assert.DoesNotThrow(() => fsm.TakeTurn(status, enemy));
            }
        }
Beispiel #19
0
        public TakeADetourCommand(INavigator navigator, ICommunicator communicator, IDetourPlanner detourPlanner, IPlayerStatus playerStatus, PlotExpeditionPhrases phrases, ILogger logger, GrammarPhrases grammar)
        {
            _navigator     = navigator;
            _communicator  = communicator;
            _detourPlanner = detourPlanner;
            _playerStatus  = playerStatus;
            _logger        = logger;
            _grammar       = grammar;

            _expeditionExists = phrases.ExpeditionExists;
            _detourFound      = phrases.ExpeditionPlotted;
        }
        public ScansRemainingCommand(ICommunicator communicator, INavigator navigator, IPlayerStatus playerStatus, ScansRemainingPhrases phrases)
        {
            _communicator = communicator;
            _navigator    = navigator;
            _playerStatus = playerStatus;
            _andPhrase    = phrases.AndPhrase;
            _planetPhrase = phrases.PlanetPhrase;

            _skipPhraseBook   = PhraseBook.Ingest(phrases.SkipSystem);
            _completePhrases  = PhraseBook.Ingest(phrases.SystemComplete);
            _remainingPhrases = PhraseBook.Ingest(phrases.ScansRemaining);
        }
Beispiel #21
0
        public CelestialScanCommand(ICommunicator communicator, INavigator navigator, IPlayerStatus playerStatus, CelestialScanPhrases phrases)
        {
            _communicator = communicator;
            _navigator    = navigator;
            _playerStatus = playerStatus;

            _scanCompletePhrases       = PhraseBook.Ingest(phrases.ScanComplete);
            _allScansCompletePhrases   = PhraseBook.Ingest(phrases.AllScansComplete);
            _oneRemainingPhrases       = PhraseBook.Ingest(phrases.SingleScanRemaining);
            _multipleRemainingPhrases  = PhraseBook.Ingest(phrases.MultipleScansRemaining);
            _expeditionCompletePhrases = PhraseBook.Ingest(phrases.ExpeditionComplete);
        }
Beispiel #22
0
        public override TurnStateEnum Execute(IPlayerStatus player, IEnemy enemy)
        {
            Validate(player, enemy);

            TurnStateEnum ret = TurnStateEnum.End;

            if (!IsBroken(player.MainHand))
            {
                ret = UseAction(player, enemy);
            }

            return(ret);
        }
Beispiel #23
0
        public PlanExpeditionCommand(ICommunicator communicator, INavigator navigator, IUserDataService userDataService, IPlayerStatus playerStatus, PlotExpeditionPhrases phrases, CelestialValues celestialValues, IDetourPlanner detourPlanner)
        {
            _navigator       = navigator;
            _communicator    = communicator;
            _userDataService = userDataService;
            _playerStatus    = playerStatus;
            _celestialValues = celestialValues;
            _detourPlanner   = detourPlanner;

            _expeditionExists  = phrases.ExpeditionExists;
            _unableToPlot      = phrases.UnableToPlot;
            _expeditionPlotted = phrases.ExpeditionPlotted;
        }
Beispiel #24
0
        public Player(PlayerInput input, IManager manager, byte clientId, Coordinate curPoint, Coordinate halfDefault)
        {
            this._input      = input;
            this._clientId   = clientId;
            this._manager    = manager;
            this._match      = manager.Match;
            this._propCore   = new PropertyCore(this);
            this._status     = new PlayerStatus(this, curPoint, halfDefault);
            this._report     = new PlayerReport(input, clientId);
            _report.ClientId = clientId;
            _report.Position = input.Position;
            _report.Name     = input.FamilyName;

            #region ISkill
            this.boostCore   = new BoostCore(this._match);
            this.buffCore    = new BuffCore(this._match);
            this.specBuffCoe = new SpecBuffCore();
            #endregion

            #region Buff
            int last    = _match.RoundPerMinute * 90;
            int point   = 0;
            int percent = 0;
            if (null != input.PropList)
            {
                foreach (var item in input.PropList)
                {
                    if (null == item.BuffId)
                    {
                        continue;
                    }
                    point   = (int)(item.Point * 100);
                    percent = (int)(item.Percent * 10000);
                    this.AddBuff(_manager.CreatePropBuff(last, point, percent, item.BuffId));
                }
            }
            if (null != input.BoostList)
            {
                foreach (var item in input.BoostList)
                {
                    if (null == item.BuffId)
                    {
                        continue;
                    }
                    point   = (int)(item.Point * 100);
                    percent = (int)(item.Percent * 10000);
                    this.AddBoost(_manager.CreateBoostBuff(item.BoostType, last, point, percent, item.BuffId));
                }
            }
            #endregion
        }
Beispiel #25
0
        private TurnStateEnum UseAction(IPlayerStatus player, IEnemy enemy)
        {
            TurnStateEnum ret = TurnStateEnum.End;

            if (IsMisfired(player.MainHand))
            {
                ret = UseActionFixMisfire(player);
            }
            else
            {
                ret = UseAttackAction(player, enemy);
            }

            return(ret);
        }
Beispiel #26
0
        public void TakeTurn(IPlayerStatus status, IEnemy enemy)    //TODO: ret?
        {
            //TODO: change this. Not sure what role I wnat to have vs the simulator
            //This completes a turn. Simulator aggregates per turn data? not sure
            Assert.IsNotNull(status);
            Assert.IsNotNull(enemy);

            TurnStateEnum nextState;

            do
            {
                nextState    = currentState.Execute(status, enemy);
                currentState = stateMachine[nextState];
            }while (!currentState.TurnComplete);
        }
Beispiel #27
0
        public override TurnStateEnum Execute(IPlayerStatus player, IEnemy enemy)
        {
            Validate(player, enemy);
            Assert.IsTrue(player.BonusActionAvailable);
            Assert.IsTrue(player.OffhandAttackAvailable);

            bool hasValidOh = TrySetValidOffHand(player);

            if (hasValidOh)
            {
                player.OffHandAttack(enemy);
            }

            return(TurnStateEnum.End);
        }
Beispiel #28
0
 private SimulationSummary AccumulateResults(IPlayerStatus status, IEnemy enemy)
 {
     return new SimulationSummary()
     {
         Cost = (ulong)status.MainHand.Cost +
                (ulong)status.OffHands
                             .Select(x => x.Cost)
                             .Sum(),
         Crits = (ulong)status.NumberOfCrits,
         DamageDone = (ulong)enemy.DamageTaken,
         Hits = (ulong)enemy.HitsTaken,
         Shots = (ulong)status.NumberOfShots,
         NumberOfBrokenGuns = GetNumberOfBrokenGuns(status),
         ShotsLostToMisfire = 0  //TODO: Calculate at end of sim? Num max shots - reloads - actual shots
     };
 }
Beispiel #29
0
        //public void CallFunction(string methodName, string varName, int val)
        //{
        //    flash1.CallFunction(string.Format(METHODSTRING, methodName,
        //        varName, val));
        //}
        #endregion

        #region * Player Status *
        /// <summary>
        /// Shown on the FOREGROUND
        /// </summary>
        /// <param name="status"></param>
        public void SetGameStatus(IPlayerStatus status)
        {
            if (status == null)
            {
                return;                    //nothing to display
            }
            _currentPlayerStatus = status; //keep a pointer to what should be displayed if we're not showing it now.
            if (flashBackground.Movie != _playerstatusSwfFile)
            {
                _log.Error("Cannot SetGameStatus because current movie on background is " + flashBackground.Movie);
                return;
            }
            try
            {
                //we may not be showing the GameScreen.
                //_log.Debug("NOW SHOWING ONE BACKGROUND: " + flashBackground.Movie);
                lock (_lock)
                {
                    if (flashBackground.Movie != _playerstatusSwfFile)
                    {
                        _log.Error("Cannot SetGameStatus because current movie on background is " + flashBackground.Movie);
                        return;
                    }
                    string response = flashBackground.CallFunction(string.Format(METHODSETGAMESTATUS,
                                                                                 _currentPlayerStatus.Ball,
                                                                                 _currentPlayerStatus.Scores[0],
                                                                                 _currentPlayerStatus.Scores[1],
                                                                                 _currentPlayerStatus.Scores[2],
                                                                                 _currentPlayerStatus.Scores[3],
                                                                                 _currentPlayerStatus.CurrentPlayerIndex,
                                                                                 _currentPlayerStatus.NumPlayers));
                    //TODO: This method needs to have all of these functions as well.
                    callFlashString(flashBackground, "SetCharacterIndex", (int)_currentPlayerStatus.PlayerCharacter);
                    callFlashString(flashBackground, "SetShield", _currentPlayerStatus.HasShield ? "1" : "0");
                    callFlashString(flashBackground, "SetCross", _currentPlayerStatus.HasCross ? "1" : "0");
                    callFlashString(flashBackground, "SetMagicLevel", _currentPlayerStatus.Magic);
                    callFlashString(flashBackground, "SetWeaponLevel", _currentPlayerStatus.Weapon);
                    callFlashString(flashBackground, "SetPlayerStatus", _currentPlayerStatus.PlayerHealthStatus);
                    callFlashString(flashBackground, "SetBonusValue", _currentPlayerStatus.BonusMultiplier);
                    callFlashString(flashBackground, "SetItem", _currentPlayerStatus.RoomItemString);
                }
            }
            catch (Exception ex)
            {
                _log.Error("Error setting GameStatus.", ex);
            }
        }
Beispiel #30
0
        public TurnStateEnum Execute(IPlayerStatus player, IEnemy enemy)
        {
            if (ReturnExecute[current] == TurnStateEnum.End)
            {
                MockPlayerStatus mockPlayer = (MockPlayerStatus)player;
                mockPlayer.NumberOfTurnsPassed++;
                TurnComplete = true;
            }
            else
            {
                TurnComplete = false;
            }

            TurnStateEnum next = GetNext();

            return(next);
        }
 public PlayerStatusProcessor(IPlayerStatus status)
 {
     playerStatus = status;
 }
Beispiel #32
0
        /// <summary>
        /// Shown on the FOREGROUND
        /// </summary>
        /// <param name="status"></param>
        public void SetGameStatus(IPlayerStatus status)
        {
            if (status == null) return; //nothing to display

            _currentPlayerStatus = status; //keep a pointer to what should be displayed if we're not showing it now.
            if (flashBackground.Movie != _playerstatusSwfFile)
            {
                _log.Error("Cannot SetGameStatus because current movie on background is " + flashBackground.Movie);
                return;
            }
            try
            {
                //we may not be showing the GameScreen.
                //_log.Debug("NOW SHOWING ONE BACKGROUND: " + flashBackground.Movie);
                lock (_lock)
                {
                    if (flashBackground.Movie != _playerstatusSwfFile)
                    {
                        _log.Error("Cannot SetGameStatus because current movie on background is " + flashBackground.Movie);
                        return;
                    }
                    string response = flashBackground.CallFunction(string.Format(METHODSETGAMESTATUS,
                        _currentPlayerStatus.Ball,
                        _currentPlayerStatus.Scores[0],
                        _currentPlayerStatus.Scores[1],
                        _currentPlayerStatus.Scores[2],
                        _currentPlayerStatus.Scores[3],
                        _currentPlayerStatus.CurrentPlayerIndex,
                        _currentPlayerStatus.NumPlayers));
                    //TODO: This method needs to have all of these functions as well.
                    callFlashString(flashBackground, "SetCharacterIndex", (int)_currentPlayerStatus.PlayerCharacter);
                    callFlashString(flashBackground, "SetShield", _currentPlayerStatus.HasShield ? "1" : "0");
                    callFlashString(flashBackground, "SetCross", _currentPlayerStatus.HasCross ? "1" : "0");
                    callFlashString(flashBackground, "SetMagicLevel", _currentPlayerStatus.Magic);
                    callFlashString(flashBackground, "SetWeaponLevel", _currentPlayerStatus.Weapon);
                    callFlashString(flashBackground, "SetPlayerStatus", _currentPlayerStatus.PlayerHealthStatus);
                    callFlashString(flashBackground, "SetBonusValue", _currentPlayerStatus.BonusMultiplier);
                    callFlashString(flashBackground, "SetItem", _currentPlayerStatus.RoomItemString);
                }
            }
            catch (Exception ex)
            {
                _log.Error("Error setting GameStatus.", ex);
            }
        }
Beispiel #33
0
        /// <summary>
        /// SpellBonusMovie.fla
        ///This is the Card-flipping movie.  There are 2 rows of 7 cards each.  Top cards spell BELMONT, 
        ///bottom cards spell DRACULA.  To flip a card, call either SpellBellmont or SpellDracula with the correct string array.
        ///Flips a card or forces cards to be seen/hidden.  The string parameter is a string array where each character can 
        ///be an a=Flip now, A=Set to Flipped, x=unFlipped, and .=Unchanged.
        ///ie, a string of “aAxx...” would mean to flip the 1st card, show the 2nd card flipped, force the 3rd and 4th cards 
        ///to be unflipped and keep the remaining three cards in whatever state they are now.
        ///function SpellBelmont(belmont:String):void
        ///After a card is flipped with animation and the animation is completed, this event will return which card has finished.
        ///values are:
        /// @spellfinished=BELMONTSPELLBCARD
        /// @spellfinished=BELMONTSPELLECARD
        /// @spellfinished=BELMONTSPELLLCARD
        /// @spellfinished=BELMONTSPELLMCARD
        /// @spellfinished=BELMONTSPELLOCARD
        /// @spellfinished=BELMONTSPELLNCARD
        /// @spellfinished=BELMONTSPELLTCARD
        /// @spellfinished=DRACULASPELLDCARD
        /// @spellfinished=DRACULASPELLRCARD
        /// @spellfinished=DRACULASPELLACARD
        /// @spellfinished=DRACULASPELLCCARD
        /// @spellfinished=DRACULASPELLUCARD
        /// @spellfinished=DRACULASPELLLCARD
        /// @spellfinished=DRACULASPELLA2CARD
        /// event @spellfinished
        /// </summary>
        public void ShowAddLetter(string key, IPlayerStatus status, Dictionary<string, string> args)
        {
            if (status == null || args == null) return; //nothing to display

            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(delegate
                {
                    ShowAddLetter(key, status, args);
                }));
            }
            else
            {
                flashForeground.Visible = true;

                bool wasPlaying = false;
                if (flashForeground.Movie == _showLetterSwfFile)
                    wasPlaying = true; //if we're playing, we don't reinit values
                else
                {
                    flashForeground.Movie = _showLetterSwfFile;
                    _cardsLeftToTurn = 0; //turning this back on means we might have orphaned animations
                }
                flashForeground.Tag = key; //not used

                bool isBelmont = false;
                if (args.ContainsKey("BELMONT"))
                    isBelmont = true;

                char[] belmont;
                char[] dracula;
                if (wasPlaying)
                {
                    belmont = new char[7] { '.', '.', '.', '.', '.', '.', '.' }; //leave previous values
                    dracula = new char[7] { '.', '.', '.', '.', '.', '.', '.' }; //leave previous values
                }
                else
                {
                    belmont = new char[7] { 'x', 'x', 'x', 'x', 'x', 'x', 'x' };
                    dracula = new char[7] { 'x', 'x', 'x', 'x', 'x', 'x', 'x' };
                    for (int i = 0; i < 7; i++)
                    {
                        belmont[i] = status.Belmont[i] ? 'A' : 'x'; //x is off, Uppercase is flipped
                        dracula[i] = status.Dracula[i] ? 'A' : 'x'; //x is off, Uppercase is flipped
                    }
                }
                if (args.ContainsKey("FLIPPED"))
                {
                    int newCard = int.Parse(args["FLIPPED"]); // parse the index of the flipped card
                    if (isBelmont)
                        belmont[newCard] = 'a';
                    else
                        dracula[newCard] = 'a';
                }
                _cardsLeftToTurn++;
                callFlashString(flashForeground, "SpellBelmont", new string(belmont));
                callFlashString(flashForeground, "SpellDracula", new string(dracula));
            }
        }
Beispiel #34
0
        public void ShowMap(string key, IPlayerStatus status)
        {
            if (status == null) return; //nothing to display

            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(delegate
                {
                    ShowMap(key, status);
                }));
            }
            else
            {
                lock (_lock)
                {
                    _currentPlayerStatus = status; //keep a pointer to what should be displayed if we're not showing it now.
                    flashForeground.Visible = true;
                    //flashBackground.Visible = false;
                    _log.DebugFormat("Loading swf file: {0} into Foreground.", _mapSwfFile);
                    flashForeground.Movie = _mapSwfFile;
                    flashForeground.Tag = key; //not used

                    //flash is 1 based array
                    callFlashString(flashForeground, "ShowLevelMap", (int)_currentPlayerStatus.LevelIndex + 1, _currentPlayerStatus.RoomIndex + 1);
                }
            }
        }
Beispiel #35
0
 internal static void SetGameStatus(IPlayerStatus playerStatus)
 {
     if (_instance._currentMode != DisplayConstants.Modes.ActiveGameMode.ACTIVEGAMEMODE)
         return;
     getInstance()._display.SetGameStatus(playerStatus);
     PlayerStatus.IsDirty = false;  //THIS SHOULD BE THE ONLY PLACE TO SET THIS
 }
 public PlayerStatusViewModel(IPlayerStatus status)
 {
     playerStatus = status;
 }
Beispiel #37
0
        public void ShowStageCleared(string key, IPlayerStatus status)
        {
            if (status == null) return; //nothing to display

            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(delegate
                {
                    ShowStageCleared(key, status);
                }));
            }
            else
            {
                _currentPlayerStatus = status; //keep a pointer to what should be displayed if we're not showing it now.
                flashForeground.Visible = true;
                //flashBackground.Visible = false;
                _log.DebugFormat("Loading swf file: {0}  into Background.", _collectBonuSwfFile);
                flashForeground.Movie = _collectBonuSwfFile;
                flashForeground.Tag = key; //not used

                string stageBonus = status.StageBonus.ToString(); // "1000000";
                string bonusLevel = status.BonusMultiplier.ToString(); // "2";
                string hearts = status.Hearts.ToString(); // "85";
                string heartValue = "1000"; //?? where should I get this?
                string enemiesKilled = status.EnemiesKilled.ToString(); // "200";
                string enemyValue = "500"; //?? where should I get this?
                callFlashString(flashForeground, "CollectBonus", "stagecleared", status.Scores[status.CurrentPlayerIndex], stageBonus, bonusLevel, hearts, heartValue, enemiesKilled, enemyValue);
                //CollectBonus(reason:String[stagecleared,endofball], baseScore:String, stageBonus:String, bonusLvl:String, hearts:String, heartValue:String, enemies:String, enemyValue:String):void");
            }
        }
Beispiel #38
0
 //might need to break this out to it's own movie so it can interrupt.
 public void ShowShootAgain(string scene, IPlayerStatus status)
 {
     if (flashBackground.Movie != _playerstatusSwfFile)
     {
         _log.Error("Cannot ShowShootAgain because current movie on background is " + flashBackground.Movie);
         return;
     }
     try
     {
         lock (_lock)
         {
             if (flashBackground.Movie != _playerstatusSwfFile)
             {
                 _log.Error("Cannot ShowShootAgain because current movie on background is " + flashBackground.Movie);
                 return;
             }
             callFlashEmpty(flashBackground, "ShootAgain");
         }
     }
     catch (Exception ex)
     {
         _log.Error("Error calling ShowShootAgain.", ex);
     }
 }