Пример #1
0
        // Move Commands
        private List <BattleCommand> GetMoveCommands(
            Pokemon pokemon,
            Trainer trainer,
            List <BattleCommand> setCommands,
            List <Pokemon> otherCommandablePokemon)
        {
            List <BattleCommand>    commands     = new List <BattleCommand>();
            List <Pokemon.Moveslot> useableMoves = model.GetPokemonUseableMoves(pokemon);

            if (useableMoves.Count == 0)
            {
                // Struggle
                commands.Add(model.GetStruggleCommand(pokemon));
            }
            else
            {
                for (int i = 0; i < useableMoves.Count; i++)
                {
                    // TODO: proper targeting system
                    BattleCommand moveCommand = BattleCommand.CreateMoveCommand(
                        commandUser: pokemon,
                        moveID: useableMoves[i].moveID,
                        targetPositions:
                        model.GetMoveAutoTargets(
                            pokemon,
                            MoveDatabase.instance.GetMoveData(useableMoves[i].moveID)),
                        isExplicitlySelected: true);
                    commands.Add(moveCommand);
                }
            }
            return(commands);
        }