Exemplo n.º 1
0
        protected override IEnumerator OnRun()
        {
            int treeIndex             = 1;
            var trees                 = Cheats.FindTree();
            int anotherAliveTreeIndex = -1;

            for (int i = 0; i < trees.Count; i++)
            {
                if (!Cheats.TreeFelled(trees[i]))
                {
                    anotherAliveTreeIndex = i;
                    break;
                }
            }

            yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            yield return(Commands.PlayerMoveCommand(trees[anotherAliveTreeIndex].transform.position, new ResultData <PlayerMoveResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            if (new UseTargetChecker(Context, trees[treeIndex].transform.position).Check() == true)
            {
                Fail($"Объект {trees[treeIndex].name} в фокусе, хотя не должен быть.");
            }
        }
Exemplo n.º 2
0
        protected override IEnumerator OnRun()
        {
            var        trees        = Cheats.FindTree();
            GameObject farthestTree = null;
            float      farthestDist = 0f;

            for (int i = 0; i < trees.Count; i++)
            {
                var dist = Vector3.Distance(trees[i].transform.position, Context.GetPlayerPosition());
                if (dist > farthestDist)
                {
                    farthestDist = dist;
                    farthestTree = trees[i];
                }
            }

            var playerMoveResult = new ResultData <PlayerMoveResult>();

            yield return(Commands.PlayerMoveCommand(farthestTree.transform.position, playerMoveResult));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            if (playerMoveResult.GetData().FailMove == true)
            {
                Fail($"Игрок не смог переместится используя Dpad.");
            }
        }
Exemplo n.º 3
0
        protected override IEnumerator OnRun()
        {
            int treeIndex = 0;
            var trees     = Cheats.FindTree();

            yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            for (int i = 0; i < 3; i++)
            {
                yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Use, new ResultData <SimpleCommandResult>()));

                yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));
            }
            yield return(Commands.WaitForSecondsCommand(3, new ResultData <SimpleCommandResult>()));

            yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Inventory, new ResultData <SimpleCommandResult>()));

            if (new TreeCountChecker(Context, 3).Check() == false)
            {
                Fail($"В инвентаре не хватает бревна, а должно быть 3шт.");
            }
            yield return(Commands.UseButtonClickCommand(Screens.Inventory.Button.Close, new ResultData <SimpleCommandResult>()));
        }
Exemplo n.º 4
0
        protected override IEnumerator OnRun()
        {
            yield return(RemoveAxesFromInventory());

            int treeIndex = 0;
            var trees     = Cheats.FindTree();

            yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            for (int i = 0; i < 3; i++)
            {
                yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Use, new ResultData <SimpleCommandResult>()));

                yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));
            }
            yield return(Commands.WaitForSecondsCommand(3, new ResultData <SimpleCommandResult>()));

            if (new TreeFelledChecker(Context, trees[treeIndex]).Check() == true)
            {
                Fail($"Дерево срублено, хотя не должно быть.");
            }

            yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Inventory, new ResultData <SimpleCommandResult>()));

            if (new TreeCountChecker(Context, 0).Check() == false)
            {
                Fail($"В инвентаре есть бревно, хотя не должно быть.");
            }
            yield return(Commands.UseButtonClickCommand(Screens.Inventory.Button.Close, new ResultData <SimpleCommandResult>()));
        }
Exemplo n.º 5
0
        protected override IEnumerator OnRun()
        {
            int treeIndex = 0;
            var trees     = Cheats.FindTree();

            yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            for (int i = 0; i < 3; i++)
            {
                yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Use, new ResultData <SimpleCommandResult>()));

                yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));
            }

            if (new UseActiveChecker(Context).Check() == true)
            {
                Fail($"Кнопка действия ещё активна, хотя не должна быть.");
            }

            yield return(Commands.PlayerMoveCommand(trees[treeIndex + 1].transform.position, new ResultData <PlayerMoveResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            if (new UseActiveChecker(Context).Check() == false)
            {
                Fail($"Кнопка действия не активна, хотя должна быть.");
            }
        }
Exemplo n.º 6
0
        protected override IEnumerator OnRun()
        {
            int treeIndex = 1;
            var trees     = Cheats.FindTree();

            yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            if (new UseTargetChecker(Context, trees[treeIndex].transform.position).Check() == false)
            {
                Fail($"Объект {trees[treeIndex].name} не в фокусе, хотя должен быть.");
            }
        }
Exemplo n.º 7
0
        protected override IEnumerator OnRun()
        {
            yield return(Commands.WaitDialogCommand(Screens.Start.Content.StartScreen, false, new ResultData <WaitItemResult>()));

            var trees = Cheats.FindTree();

            yield return(Commands.PlayerMoveCommand(trees[0].transform.position, new ResultData <PlayerMoveResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            for (int i = 0; i < 3; i++)
            {
                yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Use, new ResultData <SimpleCommandResult>()));

                yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));
            }
        }
Exemplo n.º 8
0
        protected override IEnumerator OnRun()
        {
            int treeIndex = 0;
            var trees     = Cheats.FindTree();

            yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Use, new ResultData <SimpleCommandResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            if (new TreeFelledChecker(Context, trees[treeIndex]).Check() == true)
            {
                Fail($"Дерево срублено меньше чем за 3 заруба, хотя не должно было.");
            }
        }
Exemplo n.º 9
0
        protected override IEnumerator OnRun()
        {
            int treeIndex = 0;
            var trees     = Cheats.FindTree();

            yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>()));

            yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));

            for (int i = 0; i < 3; i++)
            {
                yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Use, new ResultData <SimpleCommandResult>()));

                yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>()));
            }
            yield return(Commands.WaitForSecondsCommand(3, new ResultData <SimpleCommandResult>()));

            if (new UseTargetChecker(Context, trees[treeIndex].transform.position).Check() == true)
            {
                Fail($"Дерево ещё в таргете, хотя не должно быть.");
            }
        }