Ejemplo n.º 1
0
        public override void applyOnAttack(StatsController stats)
        {
            var anim = stats.GetComponentInChildren <Animator>();

            anim.runtimeAnimatorController = this.morph.GetComponentInChildren <Animator>().runtimeAnimatorController;
            stats.AddEffect("morphed", null, 20f, () => stats.ClearEffect("morphed"));
            stats.Damage(damage, name);
        }
Ejemplo n.º 2
0
    /// <summary>
    /// If its armed and hits the target object then reduce that objects health and create an explosion
    /// </summary>
    /// <param name="other">The collider on the other side of the collision</param>
    void OnTriggerStay2D(Collider2D other)
    {
        if (armingTime <= 0 && (other.CompareTag(targetTag) || other.gameObject.layer == 8))
        {
            //Create the explosion
            GameObject explosionInstance = Instantiate(explosionPrefab, transform.position + (transform.up * 0.1f), Quaternion.identity);
            explosionInstance.transform.SetParent(GameManager.instance.effectsPool);
            Destroy(explosionInstance, 0.267f);
            Destroy(gameObject);

            //Deal damage to the others objects stats
            StatsController stats = other.GetComponent <StatsController>();
            stats.Damage(damage);
        }
    }
Ejemplo n.º 3
0
 public new virtual void applyOnAttack(StatsController stats)
 {
     stats.Damage(damage, name);
 }