Esempio n. 1
0
    void RageEffect()
    {
        Collider[] colliders = Physics.OverlapSphere(transform.position, spellRadius);

        //List<TroopsManager> troops = new List<TroopsManager>();

        foreach (Collider insideCollider in colliders)
        {
            TroopsManager troops = insideCollider.GetComponent <TroopsManager>();

            if (troops != null)
            {
                //ragedTroops.Add(troops);
                //troops.inSideAnotherRage = true;
                troops.Rage(damageIncrease, speedIncrease, this.gameObject);
            }

            //else if(troops != null && (transform.position - troops.transform.position).sqrMagnitude > spellRadius)
            //{
            //    Debug.Log("moved");
            //    troops.RemoveRageEffect();
            //}
        }

        //foreach(TroopsManager troops in allTroops)
        //{
        //    if (troops != null && (transform.position - troops.transform.position).sqrMagnitude > spellRadius)
        //    {
        //        //Debug.Log("moved");
        //        troops.RemoveRageEffect();
        //    }
        //}
    }
Esempio n. 2
0
    void HealEffect()
    {
        Collider[] colliders = Physics.OverlapSphere(transform.position, spellRadius);

        //List<TroopsManager> troops = new List<TroopsManager>();

        foreach (Collider insideCollider in colliders)
        {
            TroopsManager troops = insideCollider.GetComponent <TroopsManager>();

            if (troops != null)
            {
                troops.Heal(healAmount);
            }
        }
    }