private IEnumerator doCheck()
    {
        yield return(new WaitForSeconds(0.1f));

        Debug.Log(targetsInRange.Count);
        for (int i = 0; i < targetsInRange.Count; i++)
        {
            NTGBattleUnitController temp = targetsInRange[i] as NTGBattleUnitController;
            if (temp != null && temp.alive)
            {
                ShootBase(temp);
                effectType = EffectType.PhysicDamage;
                temp.Hit(owner, this);
                temp.AddPassive(skillController.pBehaviours[0].passiveName, owner, skillController);
                temp.AddPassive("Blow", shooter, p: new[] { this.param[1] });
                FXHit(temp);
            }
        }
        isFly = true;
        targetsInRange.Clear();
        yield return(new WaitForSeconds(pDuration));

        Debug.Log("asdbasd" + pDuration);

        Release();
    }
Esempio n. 2
0
 private void Damage(NTGBattleUnitController otherUnit)
 {
     if (otherUnit != null && otherUnit.alive && otherUnit.group != owner.group && (mask & otherUnit.mask) != 0)
     {
         otherUnit.Hit(shooter, this);
         FXHit(otherUnit);
     }
 }
Esempio n. 3
0
    private IEnumerator doFly()
    {
        FXEA();
        FXEB();
        FXExplode();

        //ef.parent = owner.unitUiAnchor;
        //ef.localPosition = new Vector3(0, -0.36f, 0);
        //ef.localRotation = Quaternion.identity;

        collider.enabled = true;
        yield return(new WaitForSeconds(0.1f));

        collider.enabled = false;

        NTGBattleUnitController t = null;
        var sqrMinDist            = float.MaxValue;

        foreach (NTGBattleUnitController unit in targetsInRange)
        {
            if (unit == lockedTarget)
            {
                t = lockedTarget;
                break;
            }

            var sqrDist = (unit.transform.position - transform.position).sqrMagnitude;
            if (sqrDist < sqrMinDist)
            {
                t          = unit;
                sqrMinDist = sqrDist;
            }
        }
        if (t != null)
        {
            baseValue = this.param[0] + this.param[1] * owner.level;

            t.Hit(owner, this);

            t.AddPassive("Stun", owner, p: new[] { this.param[2] });

            FXHit(t, head: true);

            skillController.StartCD();
        }

        yield return(new WaitForSeconds(2.0f));

        Release();
    }
Esempio n. 4
0
    private IEnumerator doCheck(float times = 0)
    {
        count = times;
        while (pDuration > 0)
        {
            bc.enabled = true;
            yield return(new WaitForSeconds(0.1f));

            float tempFloat = (float)Math.Round((0.5f / (1 + owner.baseAttrs.AtkSpeed)), 1);
            //Debug.Log(tempFloat + " " + count % tempFloat + " " + pDuration);
            if ((count % tempFloat) == 0)
            {
                for (int i = 0; i < targetsInRange.Count; i++)
                {
                    NTGBattleUnitController temp = targetsInRange[i] as NTGBattleUnitController;
                    if (temp != null && temp.alive)
                    {
                        //Debug.Log("targetsInRange " + targetsInRange.Count);
                        ShootBase(temp);
                        effectType = EffectType.PhysicDamage;
                        temp.Hit(owner, this);
                        FXHit(temp);
                    }
                }
                count = 0;
            }

            count     += 0.1f;
            pDuration -= 0.1f;
            bc.enabled = false;
        }
        bc.enabled = false;
        FXReset();
        targetsInRange.Clear();
        Release();
    }