예제 #1
0
        /// <summary>
        /// Loads Enemy trainers content
        /// </summary>
        protected override void LoadContent()
        {
            // Large texture of the enemy trainer:
            //_enemyTrainerTextureLarge = Game.Content.Load<Texture2D>("Resources/Trainers/" + _enemyTrainerName + "Large");
            _enemyTrainerTextureSmall = Game.Content.Load<Texture2D>("Resources/Trainers/" + Name);

            CurrentState = EnemyTrainerState.PlayerNotDiscovered;

            _exclamationBubble = new ExclamationBubble(Game, (int) Position.X, (int) Position.Y) { Visible = false};
            _blackFlash = new BlackFlash(Game) { Visible = false };

            Components.Add(_exclamationBubble);
            Components.Add(_blackFlash);

            Position = Position;

            base.LoadContent();
        }
예제 #2
0
        /// <summary>
        /// What happens when you interact with enemy trainer
        /// </summary>
        /// <param name="currentAnimation"></param>
        public void TriggerTrainer(AnimationKey currentAnimation)
        {
            if (CurrentState == EnemyTrainerState.BattleFinished) return;
            GamePlayScreen.Player.MoveState = MoveState.Frozen;

            switch (currentAnimation) {
                case AnimationKey.Up:
                    CurrentFrame = AnimationKey.Down;
                    break;
            }

            CurrentState = EnemyTrainerState.PlayerDiscovered;
        }
예제 #3
0
        /// <summary>
        /// Flashes black, starts the battle song and gives control to the battle class
        /// </summary>
        public void StartBattle()
        {
            AudioController.PauseAll();
            AudioController.RequestTrack("battle").Play();
            if (_blackFlash.AnimationState == BlackFlashState.Inactive)
                _blackFlash.AnimationState = BlackFlashState.Active;

            if (_blackFlash.AnimationState == BlackFlashState.Finished) {
                ((Game1)Game).BattleScreen.InitializeBattle(GamePlayScreen.Player.PlayerTrainer,
                                                            DataManager.Trainers[Name]);
                CurrentState = EnemyTrainerState.BattleFinished;

            }
        }
예제 #4
0
        /// <summary>
        /// What the trainer says before the battle starts
        /// </summary>
        public void TextAppearing(GameTime gameTime)
        {
            GamePlayScreen.Player.TextPanel.Visible = true;
            GamePlayScreen.Player.TextPanel.TextPromptArrow.Visible = false;
            GamePlayScreen.Player.TextPanel.BattleText.FirstLine = TrainerEnemySayingL1;
            GamePlayScreen.Player.TextPanel.BattleText.SecondLine = TrainerEnemySayingL2;
            WaitingForTextToAppear(gameTime);

            if (GamePlayScreen.Player.TextPanel.TextPromptArrow.State == TextArrowState.Clicked)
            {
                AudioController.RequestTrack("trainerAppears").Stop();
                GamePlayScreen.Player.TextPanel.TextPromptArrow.State = TextArrowState.Inactive;
                CurrentState = EnemyTrainerState.StartingBattle;
                GamePlayScreen.Player.TextPanel.Visible = false;

            }
        }
예제 #5
0
        /// <summary>
        /// The player has been seen and an exclamation bubble apears over the npc
        /// </summary>
        public void PlayerSeen()
        {
            AudioController.PauseAll();
            AudioController.RequestTrack("trainerAppears").Play();
            _timer++;
            _exclamationBubble.Visible = true;

            if (_timer >= 60)
            {
                CurrentState = EnemyTrainerState.TalkingToPlayer;
                _exclamationBubble.Visible = false;
                _timer = 0;
            }
        }