Пример #1
0
        private void SpawnNewEnemy(CharacterBoard newCharacterBoard, Vector3 position, int index)
        {
            // GameObject gameObjectInstantiate = GetTheCorrectGameObjectToInstantiateWay(way[j][i]);
            GameObject gameObjectInstantiate = Instantiate(newCharacterBoard.prefabGameObject, position, Quaternion.identity, gameObject.transform);

            enemyPrefabData.Add(realWayPlayer[index], gameObjectInstantiate);
        }
        public void CompletePathPlayer(int index)   //the index is +1
        {
            TypeMap actualTypeMap = mediatorBoard.GetActualTypeMapByIndex(index);

            switch (actualTypeMap.GetTypeEventBoard())
            {
            case TypeEventBoard.Combat:
                CharacterBoard characterBoardEnemy = mediatorBoard.GetSlotEnemy(index - 1);

                if (characterBoardEnemy != null)
                {
                    Vector2 newVector2         = mediatorBoard.GetPositioByIndex(index - 1);
                    Vector2 vector2ChangeValue = new Vector2(newVector2.y, newVector2.x);
                    mediatorBoard.NewCombatTypeCharacter(vector2ChangeValue, mediatorBoard.GetActualInstanceEnemy(index - 1), characterBoardEnemy);
                    ChangeMoveStatePlayer(true);
                    SetActiveButtonDiceNewRollMove(false);
                    print("enemy in this position: " + vector2ChangeValue);
                }

                print("Combate!!! combate combate combate ");
                break;

            case TypeEventBoard.Event:
                mediatorBoard.StartNewEventMap(actualTypeMap);
                viewSystemDungeon.StartNewEventMap(actualTypeMap);
                print("Recompensame esta");
                break;

            case TypeEventBoard.Exit:
                print("Exit");
                break;
            }
        }
Пример #3
0
        private void Start()
        {
            animator = GetComponent <Animator>();

            _playerBoard = PlayerData.playerData.GetPlayerBoard();

            SetActualHealthPlayer(PlayerData.playerData.Health);
            print("Eliminated this method after created dontdestroyonload");
        }
Пример #4
0
        public CharacterBoard GetSlotEnemy(int indexWay)
        {
            CharacterBoard characterBoardCheck = characterBoardEnemyInitial;

            if (enemyCharData.TryGetValue(realWayPlayer[indexWay], out characterBoardCheck))
            {
                return(characterBoardCheck);
            }
            return(null);
        }
Пример #5
0
        public void NewCombatTypeCharacter(Vector2 lastPosition, GameObject prefabEnemy, CharacterBoard characterBoardEnemy)
        {
            //instanciar combate en la zona que llega por referencia
            gameObjectCombatZone = Instantiate(instantiateCombatZone, new Vector3(lastPosition.x, 0, lastPosition.y), MediatorBoard.Mediator.GetRotationPlayer());

            //cambiar la camara, animacion para mostrar la zona de combate
            GameObject goCamera = GameObject.Find("CameraCombatZone");

            transformCameraCombat.transform.position = goCamera.transform.position;
            transformCameraCombat.transform.rotation = goCamera.transform.rotation;
            transformCameraCombat.SetActive(true);
            transformCameraMain.gameObject.SetActive(false);
            playableDirector.Play();

            //para usar con el player
            goCamera.transform.localPosition = goCamera.transform.localPosition + new Vector3(correctionXEnemy, -0.7f, 0.91f);

            //instanciar el enemigo en la zona
            characterBoard           = characterBoardEnemy;
            enemy                    = prefabEnemy;//Instantiate(characterBoard.prefabGameObject, goCamera.transform.position, MediatorBoard.Mediator.GetRotationPlayer());
            enemy.transform.position = goCamera.transform.position;
            enemy.transform.rotation = MediatorBoard.Mediator.GetRotationPlayer();

            //progcombat
            progressionCombat = MediatorBoard.Mediator.GetProgressionCombat();

            //mover mi jugador a la zona,
            //MediatorBoard.Mediator.ChangePositionPlayerToCombat(new Vector3(lastPosition.x - correctionXEnemy, 0.65f, lastPosition.y));

            //actualizar  UI, tiempo, vida de enemigo
            animatorEnemy = enemy.GetComponent <Animator>();
            StartDataEnemy((int)progressionCombat.GetStat(Stat.Health, characterBoard.GetCharacterClass(), levelEnemy),
                           progressionCombat.GetStat(Stat.AttackSpeed, characterBoard.GetCharacterClass(), levelEnemy));

            ///update life player
            //actualizar habilidades que puede tirar mi jugador, ui combat player
            StartDataCombatPlayer();

            //empieza a correr el tiempo, empiezan a recargarse las habilidades
            isCombat = true;

            //empezar loop de combate
            GOUICombatSystem.SetActive(true);

            //update:
            ////enemigo tiene que mirar si puede atacar en el update (este), entonces empieza a atacar
        }
Пример #6
0
        private void SpawnNewEnemysInSlots()
        {
            int index = Random.Range(minSpawnEnemyInBoard, maxSpawnEnemyInBoard);

            for (int i = 0; i <= index; i++)
            {
                int indexWay = Random.Range(1, realWayPlayer.Count);

                CharacterBoard characterBoardCheck = characterBoardEnemyInitial;

                if (!enemyCharData.TryGetValue(realWayPlayer[indexWay], out characterBoardCheck))
                {
                    enemyCharData.Add(realWayPlayer[indexWay], characterBoardEnemyInitial);
                    SpawnNewEnemy(characterBoardEnemyInitial, new Vector3(realWayPlayer[indexWay].y, positionSpawnY, realWayPlayer[indexWay].x), indexWay);
                }
                else
                {
                    print("Same enemy");
                }
            }
        }
Пример #7
0
 //combat
 public void NewCombatTypeCharacter(Vector2 lastPosition, GameObject prefabEnemy, CharacterBoard characterBoardEnemy) => combatSystem.NewCombatTypeCharacter(lastPosition, prefabEnemy, characterBoardEnemy);