Beispiel #1
0
 private void Awake()
 {
     ae            = GetComponentInParent <AnimatedEnemy>();
     barController = GetComponentInChildren <BarController>();
     if (barController == null)
     {
         throw new MissingComponentException();
     }
 }
Beispiel #2
0
 public override void ApplyProjectileEffect(AnimatedEnemy e)
 {
     if (Random.Range(0f, 1f) < slowChance)
     {
         e.ewalk.Slow(timeSlowed, slowIntensity);
         GameObject go = Instantiate(effectParticle, e.gameObject.transform.position + e.GetOverheadOffset(), e.gameObject.transform.rotation);
         go.transform.parent = e.gameObject.transform;
         Destroy(go, timeSlowed);
     }
 }
    /// <summary>
    /// ApplyEffect gets the Enemy script from the target. Then loops through each effect in its list, calling
    /// the appropriate function to give the target script its effect.
    /// </summary>
    void ApplyEffect()
    {
        AnimatedEnemy nme = target.gameObject.GetComponent <AnimatedEnemy>();

        foreach (Effect e in myEffects)
        {
            if (e is ImpactEffect)
            {
                ((ImpactEffect)e).ApplyProjectileEffect(nme);
            }
        }
    }
Beispiel #4
0
 public override void ApplyProjectileEffect(AnimatedEnemy e)
 {
     e.ehealth.TakeDamageOverTime(numberOfTicks, tickDamage, myType, tickDelay, tickParticles);
 }
Beispiel #5
0
 private void Awake()
 {
     ae = GetComponent <AnimatedEnemy>();
 }
 public override void ApplyProjectileEffect(AnimatedEnemy e)
 {
     e.ehealth.TakeDamage(damage, myType, null);
 }
 abstract public void ApplyProjectileEffect(AnimatedEnemy e); // used to add stuff to the enemy upon hitting etc