void DoPunch() { state = BlackbeardState.Punch; // Assume we missed player missedPlayer = true; motor.DoPunch(); }
void DoDie() { GameController.controller.Win(4.0f); motor.DoDie(); state = BlackbeardState.Dead; }
void DoStun() { state = BlackbeardState.Stunned; Invoke("Recover", 3); canGetHurt = false; motor.DoStun(); }
void DoCannon() { state = BlackbeardState.Cannon; cannonCounter = 4; //Assume we missed the player missedPlayer = true; motor.DoCannon(); }
void DoHook() { state = BlackbeardState.Hook; //Assume we missed the player missedPlayer = true; motor.DoHook(); }
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; } }
void DoGuard() { state = BlackbeardState.Guard; motor.DoGuard(); }
void DoIdle(float idle) { state = BlackbeardState.Idle; motor.DoIdle(idle); }