示例#1
0
    protected override void Hit(AbilityHitDetector projectile)
    {
        base.Hit(projectile);

        Debug.Log("hit " + projectile.velocity);
        Knockback(projectile.velocity, Mathf.Abs(projectile.ability.damage));
    }
示例#2
0
    public override void OnUse(AbilityHitDetector AHD = null)
    {
        MeleeAbilityHitDetector MAHD = new GameObject().AddComponent <MeleeAbilityHitDetector>();

        MAHD.Init(this, "Enemy", UsedBy.AimDirection);
        base.OnUse(MAHD);
    }
示例#3
0
    protected override void Hit(AbilityHitDetector projectile)
    {
        base.Hit(projectile);

        Knockback(projectile.velocity, Mathf.Abs(projectile.ability.damage));
        Burrow();
    }
示例#4
0
 public override void Trigger(AbilityHitDetector hitWith)
 {
     Debug.Log("Me");
     hitDetector = hitWith;
     ((RangedAbilityHitDetector)hitDetector).HitSlave.StopAllCoroutines();
     ((RangedAbilityHitDetector)hitDetector).HitSlave.StartCoroutine(PlayAnimation());
 }
示例#5
0
 protected virtual void Hit(AbilityHitDetector projectile)
 {
     if (!invincible)
     {
         //ChangeHealth((int)projectile.ability.damage);
         //lastAttacker = projectile.ability.UsedBy.gameObject;
     }
 }
示例#6
0
    public override void OnUse(AbilityHitDetector AHD = null)
    {
        if (ready)
        {
            for (int i = 0; i < projectileCount; i++)
            {
                RangedAbilityHitDetector temp = new GameObject().AddComponent <RangedAbilityHitDetector>();
                temp.Init(this, "Enemy", UsedBy.AimDirection, lifeTime);

                base.OnUse(temp);
            }
        }
    }
示例#7
0
    public virtual void OnHit(AbilityHitDetector attack, GameObject hit)
    {
        if (OnHitSound != string.Empty)
        {
            AudioManager.Instance.PlayAudioClip(OnHitSound);
        }
        InitOnHitEffects();

        if (hit.tag == foeTag)
        {
            if (foeTag == "Enemy")
            {
                float lvl = UsedBy.gameObject.GetComponent <Player>().Level;
                int   dmg;
                if (lvl > 1f)
                {
                    dmg = (int)(damage * (1f + (((float)UsedBy.gameObject.GetComponent <Player>().Level * 10f) / 100f)));
                }
                else
                {
                    dmg = (int)(damage);
                }
                hit.gameObject.GetComponent <Enemy>().lastAttacker = UsedBy.gameObject;
                hit.gameObject.GetComponent <Enemy>().ChangeHealth(-dmg);
                hit.gameObject.GetComponent <Enemy>().attacking = true;
            }
            else if (foeTag == "Player")
            {
                hit.gameObject.GetComponent <Player>().ChangeHealth(-(int)damage);
            }
        }

        for (int i = 0; i < OnHitEffectInstance.Count; i++)
        {
            if (hit == null)
            {
                OnHitEffectInstance[i].Trigger(attack);
            }
            else
            {
                OnHitEffectInstance[i].Trigger(attack, hit);
            }
        }
    }
示例#8
0
    public virtual void OnUse(AbilityHitDetector AHD = null)
    {
        if (OnUseSound != string.Empty)
        {
            AudioManager.Instance.PlayAudioClip(OnUseSound);
        }
        if (ready)
        {
            InitOnUseEffects();

            Debug.Log("OnUseEffectInstance " + OnUseEffectInstance.Count);
            for (int i = 0; i < OnUseEffectInstance.Count; i++)
            {
                if (AHD != null)
                {
                    OnUseEffectInstance[i].Trigger(AHD);
                }
                else
                {
                    OnUseEffectInstance[i].Trigger(this);
                }
            }

            if (cooldown > 0)
            {
                if (CDC != null)
                {
                    slave.StopCoroutine(CDC);
                }

                CDC = slave.StartCoroutine(CoolDownCoroutine());

                if (OnAbilityUse != null)
                {
                    OnAbilityUse();
                }
            }
        }
    }
示例#9
0
 public override void Trigger(AbilityHitDetector hitWith, GameObject hit)
 {
     Debug.Log(debugText);
 }
示例#10
0
 public override void Trigger(AbilityHitDetector hitWith, GameObject hitTarget)
 {
     hitDetector = hitWith;
     ((RangedAbilityHitDetector)hitDetector).HitSlave.StopAllCoroutines();
     ((RangedAbilityHitDetector)hitDetector).HitSlave.StartCoroutine(PlayAnimation());
 }
示例#11
0
 public virtual void Trigger(AbilityHitDetector hitWith, GameObject hit)
 {
 }
示例#12
0
 public virtual void Trigger(AbilityHitDetector hitWith)
 {
 }