Example #1
0
    public override void StartAutoAttack(GameObject target)
    {
        var coroutine = DoAutoAttack(target);

        this.attackState = AttackState.create(coroutine, true);
        StartCoroutine(coroutine);
    }
Example #2
0
    public override bool GreenAttack()
    {
        var coroutine = DoGreenAttack();

        this.attackState = AttackState.create(coroutine, false);
        StartCoroutine(coroutine);
        ActivateCooldown(AttackType.GREEN);
        return(true);
    }
Example #3
0
    public override bool RedAttack(GameObject target)
    {
        if (OutOfRange(target))
        {
            return(false);
        }

        var coroutine = DoRedAttack(target);

        this.attackState = AttackState.create(coroutine, false);
        StartCoroutine(coroutine);
        ActivateCooldown(AttackType.RED);
        return(true);
    }
Example #4
0
    public override bool BlueAttack()
    {
        CollectLocationUI collectLocationUI = GetComponent <CollectLocationUI>();

        // enable polling for selected location
        collectLocationUI.enabled = true;
        this.uiOverrideFunction(true);

        var coroutine = DoBlueAttack(collectLocationUI);

        this.attackState = AttackState.create(coroutine, true, BlueAttackComplete);
        StartCoroutine(coroutine);

        return(true);
    }
Example #5
0
    private IEnumerator DoPurpleAttack(CollectLineLocationUI collectLineLocationUI)
    {
        // give us an extra frame for the substate animation control
        yield return(null);

        while (!collectLineLocationUI.IsComplete())
        {
            yield return(new WaitForSeconds(0.1f));
        }

        this.uiOverrideFunction(false);
        ActivateCooldown(AttackType.PURPLE);

        // now that we've actually selected a location, change to be uninterruptable
        this.attackState = AttackState.create();

        // start the travel animation now that we've selected. wait a frame.
        this.anim.SetTrigger("select");

        this.immobile = true;

        var rocks = GameObject.Instantiate(this.prefabPurpleAttack, collectLineLocationUI.GetLocation(), Quaternion.identity) as GameObject;

        //TODO i have no idea how this works. geometry is not my strong suit
        // theres definitely a way i can do this in one operation but this works so im done
        rocks.transform.rotation  = Quaternion.LookRotation(collectLineLocationUI.GetMoveDelta());
        rocks.transform.rotation *= Quaternion.Euler(0, 90f, 0);

        collectLineLocationUI.Reset();

        StartCoroutine(DestroyPurpleWall(rocks));

        yield return(new WaitForSeconds(3.0f));

        // exit and give a frame for the transition
        this.anim.SetTrigger("exitSubState");
        yield return(null);

        this.immobile             = false;
        this.attackState.finished = true;
    }
Example #6
0
    private IEnumerator DoBlueAttack(CollectLocationUI collectLocationUI)
    {
        // give us an extra frame for the substate animation control
        yield return(null);

        while (!collectLocationUI.IsLocationSelected())
        {
            yield return(new WaitForSeconds(0.1f));
        }

        this.uiOverrideFunction(false);
        ActivateCooldown(AttackType.BLUE);

        // now that we've actually selected a location, change to be uninterruptable
        this.attackState = AttackState.create();

        // start the travel animation now that we've selected. wait a frame.
        this.anim.SetTrigger("select");

        this.immobile     = true;
        this.invulnerable = true;

        yield return(new WaitForSeconds(2.0f));

        transform.position = collectLocationUI.GetLocation();
        collectLocationUI.Reset();

        yield return(new WaitForSeconds(2.0f));

        // exit and give a frame for the transition
        this.anim.SetTrigger("exitSubState");
        yield return(null);

        this.immobile             = false;
        this.invulnerable         = false;
        this.attackState.finished = true;
    }