Ejemplo n.º 1
0
    private void PurpleAttackComplete()
    {
        CollectLineLocationUI collectLineLocationUI = GetComponent <CollectLineLocationUI>();

        collectLineLocationUI.enabled = false;
        this.uiOverrideFunction(false);
        collectLineLocationUI.Reset();
    }
Ejemplo n.º 2
0
    public override bool PurpleAttack()
    {
        CollectLineLocationUI collectLineLocationUI = GetComponent <CollectLineLocationUI>();

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

        var coroutine = DoPurpleAttack(collectLineLocationUI);

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

        return(true);
    }
Ejemplo n.º 3
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;
    }