public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = true)
    {
        //Debug.Log("Activating" + this.GetType() + " SYNC POWER!");

        if (!secondSync)
        {
            //Pay for activation
            sourceHero.ChangeSpiritAmount(-costActivateSync);
            otherHero.ChangeSpiritAmount(-costActivateSync);

            //Stop other Heros effect
            otherHero.SwitchToSyncPower();
        }

        //Find enemies to do effect on
        GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy");
        enemiesToSlow = new BaseUnit[enemies.Length];

        for (int i = 0; i < enemies.Length; i++)
        {
            enemiesToSlow[i] = enemies[i].GetComponent<BaseUnit>();
            enemiesToSlow[i].SetMovementSpeedBuff(-spiritSyncSlow);
        }
        StartCoroutine(OnDeactivateSync(sourceHero, otherHero));

        return null;
    }
    public override void Collected(Hero collector)
    {
        if (_collected == true) return;

        _collected = true;
        gameObject.collider.enabled = false;
        gameObject.audio.clip = SpiritPickupSound;
        gameObject.audio.Play();
        collector.ChangeSpiritAmount(2);
        gameObject.renderer.enabled = false;
        for (int i = 0; i < gameObject.transform.childCount; i++) {
            gameObject.transform.GetChild(i).gameObject.SetActive(false);
        }
        Destroy(gameObject, SpiritPickupSound.length);
    }
    public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
    {
        DestroyBall();

        if (!secondSync) {
            //Stop other Heros effect
            otherHero.SwitchToSyncPower();

            //Pay for activation
            sourceHero.ChangeSpiritAmount(-costActivateSync);
            otherHero.ChangeSpiritAmount(-costActivateSync);
        }
        InstantiateBall(otherHero, sourceHero, true);
        return null;
    }
    public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
    {
        if (_currentLightning != null) {
            GameObject.Destroy(_currentLightning);
        }

        if (!secondSync) {
            //Stop other Heros effect
            otherHero.SwitchToSyncPower();

            //Pay for activation
            sourceHero.ChangeSpiritAmount(-costActivateSync);
            otherHero.ChangeSpiritAmount(-costActivateSync);
        }
        LightningSync(sourceHero, otherHero);

        return null;
    }
    public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
    {
        //Debug.Log("Activating" + this.GetType() + " SYNC POWER!");
        //Only allow one of these per person
        if (circleActive)
            return null;

        if (!secondSync) {
            //Stop other Heros effect
            otherHero.SwitchToSyncPower();

            //Pay for activation
            sourceHero.ChangeSpiritAmount(-costActivateSync);
            otherHero.ChangeSpiritAmount(-costActivateSync);
        }
        StartCoroutine(DeathRay(sourceHero, otherHero));

        return null;
    }
    public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
    {
        //Debug.Log("Activating" + this.GetType() + " SYNC POWER!");

        if (!secondSync)
        {
            //Pay for activation
            sourceHero.ChangeSpiritAmount(-costActivateSync);
            otherHero.ChangeSpiritAmount(-costActivateSync);

            //Stop other Heros effect
            otherHero.SwitchToSyncPower();
        }

        //Heal both players
        otherHero.Heal(regenPerSync);
        sourceHero.Heal(regenPerSync);

        return null;
    }
示例#7
0
    public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
    {
        //Debug.Log("Activating" + this.GetType() + " SYNC POWER!");

        if (!secondSync) {
            //Stop other Heros effect
            otherHero.SwitchToSyncPower();

            //Pay for activation
            sourceHero.ChangeSpiritAmount(-costActivateSync);
            otherHero.ChangeSpiritAmount(-costActivateSync);
        }

        //Find enemies to do effect on
        _enemiesGO = GameObject.FindGameObjectsWithTag("Enemy");
        var center = (sourceHero.transform.position + otherHero.transform.position) * 0.5f;

        StartCoroutine(CreateSyncExplosion(center));

        return null;
    }
    public override IEnumerator OnActivateSync(Hero sourceHero, Hero otherHero, bool secondSync = false)
    {
        //Debug.Log("Activating" + this.GetType() + " SYNC POWER!");
        /*if (triggerP1 != null) {
            Destroy(triggerP1.gameObject);
        }
        if (triggerP2 != null) {
            Destroy(triggerP2.gameObject);
        }*/

        //This cant be used twice
        /*if (secondSync && otherHero.currentSpiritPower.GetType() == typeof(SpiritImmortal))
            return null;*/

        if (!secondSync) {
            //Stop other Heros effect
            otherHero.SwitchToSyncPower();

            //Pay for activation
            sourceHero.ChangeSpiritAmount(-costActivateSync);
            otherHero.ChangeSpiritAmount(-costActivateSync);
        }

        readyToPull = true;
        ThrowGravityTriggers(sourceHero, otherHero);
        return null;
    }