예제 #1
0
    //Sensor method: activates a defensive execute upon player entering defensive sensor
    //  Pre: either activates the fighter's primary move or secondary move upon reaction
    public void senseReact(Transform threat)
    {
        if (threat.tag == "Player" && canMove && canMelee)           //If a player is nearby, melee attack
        {
            enemyFighter.executePrimaryMove(threat);
            canMelee = false;
        }
        else                                            //If it's a player attack. Do a defensive water pulse. If it doesn't run, primary attack
        {
            bool moveRan = enemyFighter.executeSecMove(BUBBLE_SHIELD, threat);

            if (!moveRan && canMelee)
            {
                enemyFighter.executePrimaryMove(threat);
                canMelee = false;
            }
        }
    }
    //Sensor method: activates a defensive execute upon player entering defensive sensor
    //  Pre: either activates the fighter's primary move or secondary move upon reaction
    public void senseReact(Transform threat)
    {
        if (canMove)
        {
            bool moveRan = fighter.executeSecMove(SEC_ABILITY, threat);

            if (!moveRan && canMelee)
            {
                fighter.executePrimaryMove(threat);
                canMelee = false;
            }
        }
    }
예제 #3
0
    //Controller for combat. Wiil mostly focus around the mouse
    void combat()
    {
        //Executes primary move upon left click
        if (Input.GetMouseButtonDown(0) && !assistSeqOn)
        {
            selectedFighter.executePrimaryMove();
        }

        //Executes secondary move upon right click
        if (Input.GetMouseButtonDown(1) && !assistSeqOn)
        {
            selectedFighter.executeSecMove(secMoveIndex);
        }
    }
    //Sensor method: activates a defensive execute upon player entering defensive sensor
    //  Pre: either activates the fighter's primary move or secondary move upon reaction
    public void senseReact(Transform threat)
    {
        if (canMove)
        {
            bool moveRan = false;

            if (canDash)
            {
                canDash = false;
                moveRan = enemyFighter.executeSecMove(DEF_MOVE, threat);
            }

            if (!moveRan && canMelee)
            {
                enemyFighter.executePrimaryMove(threat);
                canMelee = false;
            }
        }
    }