private void HandleCombatOperation()
    {
        if (isDummy || !enableCombatInput)
        {
            return;
        }

        if (CurrentState == StateType.Base)
        {
            ResetTriggers();
            combatTrigger = CombatTrigger.None;
        }

        if (Input.GetKeyDown(controlSet["AtkH"]))
        {
            combatTrigger = CombatTrigger.AtkH;
        }
        else if (Input.GetKeyDown(controlSet["AtkL"]))
        {
            combatTrigger = CombatTrigger.AtkL;
        }
        else if (Input.GetKey(controlSet["SklS"]))
        {
            combatTrigger = CombatTrigger.SklS;
        }
        else if (Input.GetKey(controlSet["SklB"]))
        {
            combatTrigger = CombatTrigger.SklB;
        }

        if (CurrentState == StateType.Base)
        {
            TriggerNextCombatState();
        }
    }
 public void Damaged(Vector2 applyVelocity, float stiffTime, bool isKnockDown, float enemyXPosition)
 {
     combatTrigger       = CombatTrigger.None;
     physics.IsFaceRight = enemyXPosition > transform.position.x;
     enableBaseInput     = false;
     if (damageCo != null)
     {
         StopCoroutine(damageCo);
     }
     physics.SetPhysicsParam(applyVelocity, Vector2.zero, true);
     damageCo = Stiff(stiffTime, isKnockDown);
     StartCoroutine(damageCo);
 }
    public void TriggerNextCombatState()
    {
        PlayerInfo plyinf  = GetComponent <PlayerInfo>();
        string     trigger = Enum.GetName(typeof(CombatTrigger), combatTrigger);

        if (combatTrigger != CombatTrigger.None)
        {
            if (combatTrigger == CombatTrigger.SklS && CurrentState == StateType.Base && physics.IsGrounded && plyinf.AbleToCastSkillS)
            {
                animator.SetTrigger(trigger);
            }
            else if (combatTrigger == CombatTrigger.SklB && CurrentState == StateType.Base && physics.IsGrounded && plyinf.AbleToCastSkillB)
            {
                animator.SetTrigger(trigger);
            }
            else if (combatTrigger != CombatTrigger.SklS && combatTrigger != CombatTrigger.SklB)
            {
                animator.SetTrigger(trigger);
            }
            combatTrigger = CombatTrigger.None;
        }
    }
Esempio n. 4
0
    public void generateEnemiesUsingCombatTrigger(CombatTrigger ct) {
        int additionalEnemies = Random.Range(1, 3);

        GameObject newEnemy = GameObject.Instantiate<GameObject>(prefabSpider);
        newEnemy.transform.position = ct.spiderSpawn1.position;
        newEnemy.transform.rotation = ct.spiderSpawn1.rotation;

        if (additionalEnemies == 0) {
            activeEnemies = new _EnemyCombat[] { newEnemy.GetComponent<_EnemyCombat>() };
        }
        else {
            GameObject newEnemy2 = GameObject.Instantiate<GameObject>(prefabSpider);
            newEnemy2.transform.position = ct.spiderSpawn2.position;
            newEnemy2.transform.rotation = ct.spiderSpawn2.rotation;

            if (additionalEnemies == 1) {
                activeEnemies = new _EnemyCombat[] {
                    newEnemy.GetComponent<_EnemyCombat>(),
                    newEnemy2.GetComponent<_EnemyCombat>()
                };
            }
            else {
                GameObject newEnemy3 = GameObject.Instantiate<GameObject>(prefabSpider);
                newEnemy3.transform.position = ct.spiderSpawn3.position;
                newEnemy3.transform.rotation = ct.spiderSpawn3.rotation;

                activeEnemies = new _EnemyCombat[] {
                    newEnemy.GetComponent<_EnemyCombat>(),
                    newEnemy2.GetComponent<_EnemyCombat>(),
                    newEnemy3.GetComponent<_EnemyCombat>()
                };
            }
        }
    }
Esempio n. 5
0
    public static void triggerCombatMode(CombatTrigger trigger) {
        instance.explorationMode = false;
        instance.combatController.enabled = true;

        instance.combatController.generateEnemiesUsingCombatTrigger(trigger);
        instance.selectMenu.SetActive(true);

        instance.ariaMovement.enterCombat();
        instance.brioMovement.enterCombat();
        instance.cadenceMovement.enterCombat();
    }
Esempio n. 6
0
 public void RemoveCombatTrigger(CombatTrigger obj)
 {
     triggerList.Remove(obj);
 }
Esempio n. 7
0
 public void AddCombatTrigger(CombatTrigger obj)
 {
     triggerList.Add(obj);
 }