Ejemplo n.º 1
0
    protected override void Hit(AbilityHitDetector projectile)
    {
        base.Hit(projectile);

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

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

        Knockback(projectile.velocity, Mathf.Abs(projectile.ability.damage));
        Burrow();
    }
Ejemplo n.º 4
0
 public override void Trigger(AbilityHitDetector hitWith)
 {
     Debug.Log("Me");
     hitDetector = hitWith;
     ((RangedAbilityHitDetector)hitDetector).HitSlave.StopAllCoroutines();
     ((RangedAbilityHitDetector)hitDetector).HitSlave.StartCoroutine(PlayAnimation());
 }
Ejemplo n.º 5
0
 protected virtual void Hit(AbilityHitDetector projectile)
 {
     if (!invincible)
     {
         //ChangeHealth((int)projectile.ability.damage);
         //lastAttacker = projectile.ability.UsedBy.gameObject;
     }
 }
Ejemplo n.º 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);
            }
        }
    }
Ejemplo n.º 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);
            }
        }
    }
Ejemplo n.º 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();
                }
            }
        }
    }
Ejemplo n.º 9
0
 public override void Trigger(AbilityHitDetector hitWith, GameObject hit)
 {
     Debug.Log(debugText);
 }
Ejemplo n.º 10
0
 public override void Trigger(AbilityHitDetector hitWith, GameObject hitTarget)
 {
     hitDetector = hitWith;
     ((RangedAbilityHitDetector)hitDetector).HitSlave.StopAllCoroutines();
     ((RangedAbilityHitDetector)hitDetector).HitSlave.StartCoroutine(PlayAnimation());
 }
Ejemplo n.º 11
0
 public virtual void Trigger(AbilityHitDetector hitWith, GameObject hit)
 {
 }
Ejemplo n.º 12
0
 public virtual void Trigger(AbilityHitDetector hitWith)
 {
 }