private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag(parent.tag))
        {
            return;
        }
        if (other.tag == "Untagged")
        {
            return;
        }
        if (parent)
        {
            if (other.TryGetComponent <Units>(out Units script))
            {
                if ((script.UnitTag == UnitsTag.Minion ||
                     script.UnitTag == UnitsTag.Champion) &&
                    !other.CompareTag(parent.tag))
                {
                    parent.HitObject = other.transform.gameObject;
                    Units unit = parent.transform.GetComponent <Units>();

                    float Damage = unit.Attack(AttackType.AD_SKILL, parent.skillFactor, parent.LevelperValues[parent.CurrentLevel].addDamage);
                    float Suffer = 0.0f;

                    {
                        Suffer = script.hit(AttackType.AD_SKILL, Damage, parent.gameObject.GetComponent <Units>(), unit.UnitStatus.armorPenetration);
                    }
                }
            }
        }

        {
            Object.Destroy(gameObject);
        }
    }
Example #2
0
    IEnumerator FlyingAnimation()
    {
        pc.stop();
        Vector3 target = HitObject.transform.position;

        target.y = this.transform.position.y;
        float step = flyspeed * Time.deltaTime;

        while (Vector3.Distance(target, this.transform.position) > 1f && HitObject)
        {
            this.transform.position = Vector3.MoveTowards(this.transform.position, target, step);
            this.transform.LookAt(target);
            yield return(null);
        }
        pc.targetpos = this.transform.position;
        pc.Play();
        animator.SetBool("ResonatingStrike", false);

        if (HitObject)
        {
            if (HitObject.TryGetComponent <Units>(out var script))
            {
                Units unit = transform.GetComponent <Units>();

                float Damage = unit.Attack(AttackType.AD_SKILL, skillFactor, LevelperValues[CurrentLevel].addDamage);

                float Suffer = 0.0f;
                {
                    Suffer = script.hit(AttackType.AD_SKILL, Damage, unit, unit.UnitStatus.armorPenetration);
                }
            }

            HitObject = null;
        }
    }
Example #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject == parent)
        {
            return;
        }
        if (other.CompareTag(parent.transform.tag == "Red" ? "Blue" : "Red"))
        {
            Vector3    pos      = new Vector3(0, 0, 0);
            GameObject Effecter = Instantiate(Effect, pos, Quaternion.identity, other.transform);
            SoundManager.instance.PlaySE("SFX_charmHit", Effecter);
            Effecter.GetComponent <CharmEffect>().initialize(parent);
            Charm charm = parent.GetComponent <Charm>();
            Units unit  = parent.GetComponent <Units>();

            float Damage = unit.Attack(AttackType.AP_SKILL, charm.skillFactor, charm.LevelperValues[charm.CurrentLevel].addDamage);
            float Suffer = 0.0f;
            if (other.TryGetComponent <Units>(out var script))
            {
                Suffer = script.hit(AttackType.AP_SKILL, Damage, parent.GetComponent <Ahri>(), unit.UnitStatus.magicResist);
            }
            Debug.Log("Damage = " + Damage + " / " + "Suffer = " + Suffer);
        }
        Object.Destroy(this.gameObject);
    }
 private void OnTriggerEnter(Collider other)
 {
     if (other.transform.gameObject == Target)
     {
         float Damage = Parent.Attack(AttackType.MELEE);
         float Suffer;
         if (other.TryGetComponent <Units>(out var script))
         {
             Suffer = script.hit(AttackType.MELEE, Damage, Parent, Parent.UnitStatus.armorPenetration);
         }
         ParticleStop();
     }
 }
Example #5
0
 private void OnTriggerEnter(Collider other)
 {
     if (parentMinion.Target)
     {
         if (other.transform.gameObject == parentMinion.Target)
         {
             float Damage = parentMinion.Attack(AttackType.MELEE);
             float Suffer;
             if (other.TryGetComponent <Units>(out var script))
             {
                 Suffer = script.hit(AttackType.MELEE, Damage, null, parentMinion.UnitStatus.armorPenetration);
             }
         }
     }
 }
Example #6
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject == target)
        {
            SpritRush foxfire = parent.GetComponent <SpritRush>();
            Units     unit    = parent.GetComponent <Units>();

            float Damage = unit.Attack(AttackType.AP_SKILL, foxfire.skillFactor, foxfire.LevelperValues[foxfire.CurrentLevel].addDamage);
            float Suffer = 0.0f;
            if (other.TryGetComponent <Units>(out var script))
            {
                Suffer = script.hit(AttackType.AP_SKILL, Damage, parent.GetComponent <Ahri>(), unit.UnitStatus.magicResist);
            }
            Object.Destroy(gameObject);
        }
    }
Example #7
0
 private void OnTriggerEnter(Collider other)
 {
     if (parentMinion.Target)
     {
         if (other.transform.gameObject == target)
         {
             float Damage = parentMinion.Attack(AttackType.MELEE);
             float Suffer = 0.0f;
             if (other.TryGetComponent <Units>(out var script))
             {
                 Suffer = script.hit(AttackType.MELEE, Damage, null, parentMinion.UnitStatus.armorPenetration);
             }
             Debug.Log("Damage = " + Damage + " / " + "Suffer = " + Suffer);
             Object.Destroy(this.gameObject);
         }
     }
 }
Example #8
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag(parent.transform.tag == "Red" ? "Blue" : "Red"))
        {
            OrbofDeception orb  = parent.GetComponent <OrbofDeception>();
            Units          unit = parent.GetComponent <Units>();

            float Damage = unit.Attack(AttackType.AP_SKILL, orb.skillFactor, orb.LevelperValues[orb.CurrentLevel].addDamage);
            float Suffer = 0.0f;
            if (other.TryGetComponent <Units>(out var script))
            {
                Suffer = script.hit(AttackType.AP_SKILL, Damage, parent.GetComponent <Units>(), unit.UnitStatus.magicResist);
            }

            Debug.Log("Damage = " + Damage + " / " + "Suffer = " + Suffer);
        }
    }
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag(parent.tag == "Red" ? "Blue" : "Red"))
        {
            if (other.TryGetComponent <Units>(out Units script))
            {
                DragonRage rage = parent.GetComponent <DragonRage>();
                Units      unit = parent.GetComponent <Units>();

                float Damage = unit.Attack(AttackType.AD_SKILL, rage.skillFactor, rage.LevelperValues[rage.CurrentLevel].addDamage);
                float Suffer = 0.0f;

                {
                    Suffer = script.hit(AttackType.AD_SKILL, Damage, parent.GetComponent <Units>(), unit.UnitStatus.armorPenetration);
                }
            }
        }
    }
Example #10
0
    private void OnTriggerEnter(Collider other)
    {
        if (parent)
        {
            if (other.TryGetComponent <Units>(out Units script))
            {
                if ((script.UnitTag == UnitsTag.Minion ||
                     script.UnitTag == UnitsTag.Champion) &&
                    !other.CompareTag(parent.tag))
                {
                    Units unit = parent.transform.GetComponent <Units>();

                    float Damage = unit.Attack(AttackType.AP_SKILL, parent.skillFactor, parent.LevelperValues[parent.CurrentLevel].addDamage);
                    float Suffer = 0.0f;

                    {
                        Suffer = script.hit(AttackType.AP_SKILL, Damage, parent.GetComponent <Units>(), unit.UnitStatus.magicPenetration);
                    }
                }
            }
        }
    }
Example #11
0
    private void CreateDragonRage()
    {
        GameObject particle1 = PhotonNetwork.Instantiate("Character/Leesin/DragonRage1", chest.transform.position, this.transform.rotation);

        particle1.transform.SetParent(this.transform);

        GameObject particle = PhotonNetwork.Instantiate("Character/Leesin/DragonRage2", Target.transform.position, this.transform.rotation);

        particle.transform.SetParent(Target.transform);

        if (particle.TryGetComponent <DragonRageParticle>(out var script))
        {
            script.init(this.transform.gameObject);
        }

        //target damage
        {
            Units unit   = transform.GetComponent <Units>();
            float Damage = unit.Attack(AttackType.AD_SKILL, skillFactor, LevelperValues[CurrentLevel].addDamage);
            float Suffer = Target.GetComponent <Units>().hit(AttackType.AD_SKILL, Damage, this.transform.GetComponent <Units>(), unit.UnitStatus.armorPenetration);
        }
    }