Exemplo n.º 1
0
        private IEnumerator GrabProjectiles(PlayerController owner)
        {
            Collider[] enemyProjectiles = Physics.OverlapSphere(owner.transform.position, m_radius, m_grabMask, QueryTriggerInteraction.Collide);
            //Do some sort of visual here
            if (enemyProjectiles.Length == 0)
            {
                //If anyprojectiles are near but not caught, minus the grab skill
                enemyProjectiles = Physics.OverlapSphere(owner.transform.position, m_missRadius, m_grabMask, QueryTriggerInteraction.Collide);
                if (enemyProjectiles.Length != 0)
                {
                    CurveFlowManager.AppendValue("GrabSkill", 0.0f);
                }
                //Spell has not gotten a projectile, don't lock casting and just let the whiff animation play
                yield return(null);
            }
            else
            {
                //Spell has gotten at least one projectile, grab them and enter into the special mode for it
                owner.m_abilityManager.m_isCasting = true;
                float DRAWTIME = 0.6f;
                //Disable their projectileMovement scripts and then pull all them in all fancy like
                for (int j = 0; j < enemyProjectiles.Length; j++)
                {
                    ProjectileMovement proj = enemyProjectiles[j].GetComponent <ProjectileMovement>();
                    owner.StartCoroutine(DrawInProjectile(owner, proj, DRAWTIME));
                    CurveFlowManager.AppendValue("GrabSkill", 1.0f);
                }
                yield return(new WaitForSeconds(DRAWTIME));

                owner.m_abilityManager.SetGrab(enemyProjectiles.Length);
                owner.m_abilityManager.m_isCasting = false;
            }
        }
Exemplo n.º 2
0
 private void OnTriggerEnter(Collider other)
 {
     if (m_isDead)
     {
         return;
     }
     //enemy projectile
     if (other.gameObject.layer == 12)
     {
         if (!m_invincible)
         {
             ProjectileMovement proj = other.gameObject.GetComponent <ProjectileMovement>();
             if (proj != null && proj.gameObject.layer == 12)
             {
                 TakeDamage(proj.m_damage);
                 proj.gameObject.SetActive(false);
                 //If they got hit by a projectile and could have grabbed it
                 if (m_abilityManager.IsGrabAvalible())
                 {
                     CurveFlowManager.AppendValue("GrabSkill", 0.0f);
                 }
             }
             else
             {
                 Debug.Log("Hit by unkown object: " + other.gameObject.name);
             }
         }
     }
     //room trigger
     else if (other.gameObject.layer == 16)
     {
         other.gameObject.SetActive(false);
         WorldController.i.StartCombat(other.transform.parent);
     }
 }
Exemplo n.º 3
0
 public void EnemyWhiffAttack()
 {
     //if currently invincble or if the dodge is on cooldown (in this case, assumed player already dodged)
     if (m_invincible || !m_abilityManager.IsDodgeAvalible())
     {
         CurveFlowManager.AppendValue("DodgeSkill", 1.0f);
     }
 }
Exemplo n.º 4
0
 public void TakeMeleeAttack(int damage)
 {
     if (m_invincible)
     {
         //DodgeSkill also includes other skills that make you invincible (if they exist)
         CurveFlowManager.AppendValue("DodgeSkill", 1.0f);
     }
     else
     {
         TakeDamage(damage);
         if (m_abilityManager.IsDodgeAvalible())
         {
             CurveFlowManager.AppendValue("DodgeSkill", 0.0f);
         }
     }
 }