Esempio n. 1
0
        private bool PromptPlayerToChooseItem()
        {
            int chosenStackedItemsIndex = BattleAux.KeepPlayerChoosingItem(Player.Items.Count);
            int chosenPokemonIndex      = BattleAux.KeepPlayerChoosingPokemon();

            IPokemon chosenPokemon = Player.PokemonTeam[chosenPokemonIndex].Pokemon;
            IItem    chosenItem    = Player.Items.ElementAt(chosenStackedItemsIndex).Value.FirstOrDefault();

            return(CheckIfShouldKeepBattleGoingAfterItemSelection(chosenItem, chosenStackedItemsIndex, chosenPokemon));
        }
Esempio n. 2
0
        private void PromptPlayerToSelectPokemonAfterEnemyPokemonFainted()
        {
            int chosenPokemonIndex = 0;

            if (Player.PokemonTeam.Where(w => !w.Pokemon.HasFainted()).Count() > 1)
            {
                ConsoleUtils.ShowMessageAndWaitTwoSeconds($"{EnemyTrainer.GetType().Name} is about to send out {EnemyTrainer.GetCurrentPokemon().GetType().Name}");
                ConsoleUtils.ShowMessageBetweenEmptyLines("Which pokemon will you choose?");
                chosenPokemonIndex = BattleAux.KeepPlayerChoosingPokemon();
                SwitchCurrentPokemon(chosenPokemonIndex, isChangingAfterOwnPokemonFainted: true);
            }
            else
            {
                chosenPokemonIndex = Player.PokemonTeam.IndexOf(Player.PokemonTeam.Where(w => !w.Fainted).FirstOrDefault());
                SwitchCurrentPokemon(chosenPokemonIndex, isChangingAfterOwnPokemonFainted: true);
            }
        }
Esempio n. 3
0
        private bool PromptPlayerToSelectPokemon()
        {
            var keepBattleGoingAfterPokemonSelection = false;

            if (Player.PokemonTeam.Where(pkmn => !pkmn.Fainted).Count() == 1)
            {
                ConsoleBattleInfoTrainer.ShowPlayerThereAreNoPokemonLeftToSwitch();
                return(keepBattleGoingAfterPokemonSelection);
            }

            int chosenPokemonIndex = BattleAux.KeepPlayerChoosingPokemon();

            SwitchCurrentPokemon(chosenPokemonIndex);
            keepBattleGoingAfterPokemonSelection = true;

            return(keepBattleGoingAfterPokemonSelection);
        }