Exemplo n.º 1
0
 void DoPunch()
 {
     state = BlackbeardState.Punch;
     // Assume we missed player
     missedPlayer = true;
     motor.DoPunch();
 }
Exemplo n.º 2
0
    void DoDie()
    {
        GameController.controller.Win(4.0f);

        motor.DoDie();
        state = BlackbeardState.Dead;
    }
Exemplo n.º 3
0
    void DoStun()
    {
        state = BlackbeardState.Stunned;
        Invoke("Recover", 3);

        canGetHurt = false;

        motor.DoStun();
    }
Exemplo n.º 4
0
    void DoCannon()
    {
        state = BlackbeardState.Cannon;

        cannonCounter = 4;

        //Assume we missed the player
        missedPlayer = true;
        motor.DoCannon();
    }
Exemplo n.º 5
0
    void DoHook()
    {
        state = BlackbeardState.Hook;

        //Assume we missed the player

        missedPlayer = true;

        motor.DoHook();
    }
Exemplo n.º 6
0
    public void NextDecision()
    {
        BlackbeardState oldState = state;

        if (state == BlackbeardState.Dead)
        {
            return;
        }

        switch (state)
        {
        case BlackbeardState.Start:
            DoIdle(2);
            break;

        case BlackbeardState.Idle:
            Invoke("DoPunch", 1);
            break;

        case BlackbeardState.Punch:
            if (missedPlayer && cannonCounter > 0)
            {
                cannonCounter -= 1;
                DoHook();
            }
            else if (missedPlayer && cannonCounter <= 0)
            {
                DoCannon();
            }
            else
            {
                DoIdle(1.0f);
            }
            break;

        case BlackbeardState.Hook:

            if (missedPlayer && cannonCounter <= 0)
            {
                DoCannon();
            }
            else if (missedPlayer)
            {
                cannonCounter -= 1;
                DoPunch();
            }
            else
            {
                DoIdle(1.0f);
            }
            break;

        case BlackbeardState.Cannon:
            DoIdle(1.0f);
            break;

        case BlackbeardState.Guard:
            DoIdle(1.0f);
            break;
        }
    }
Exemplo n.º 7
0
 void DoGuard()
 {
     state = BlackbeardState.Guard;
     motor.DoGuard();
 }
Exemplo n.º 8
0
 void DoIdle(float idle)
 {
     state = BlackbeardState.Idle;
     motor.DoIdle(idle);
 }