ActionRet HoldemTournamentAIManual::pfBlindSteal(const TableTexture& t, bool debug)
{
	ActionRet ret;
	ret.name="pfBlindSteal";
	ret.action=FOLD;
	ret.amt=0;

	profile_line(" -- pfBlindSteal() -- ");

	PokerHand h=table->getHand();

	bool steal=true;
	if (t.totalaction>=1) steal=false;
	if (getTableHandedness()>1) steal=false;
	if (t.activeafter>1) steal=false;
	bool cashGood=true;
	for (int i=0; i<10; i++) {
		if (table->isActive(i)) {
			if (table->getStack(i)<500||table->getStack(i)<table->getBB()*2) {
				cashGood=false;
			}
		}
	}
	if (!cashGood) steal=false;
	bool cardsGood=false;
	if (!t.desperate&&(h[0].GetRank()==h[1].GetRank()||h[0].GetRank()>10||h[1].GetRank()>10)) cardsGood=true;
	if ( t.desperate&&(h[0].GetRank()==h[1].GetRank()||h[0].GetRank()>9 ||h[1].GetRank()>9 )) cardsGood=true;
	if (   t.uberAgg&&(h[0].GetRank()==h[1].GetRank()||h[0].GetRank()>10||h[1].GetRank()>10)) cardsGood=true;
	if (!cardsGood) steal=false;

	if (table->getBB()==20) steal=false;

	if (debug) {
		cout << "steal: " << steal << endl;
		cout << " cost2call: " << table->getCostToCall(getAIPlayer()) << endl;
		cout << " afterActive: " << table->getPositionAfterActive() << endl;
		cout << " cardsGood: " << cardsGood << endl;
		cout << " cashGood: " << cashGood << endl;
		cout << endl;
	}

	if (steal) {
		ret.action=BET;
		ret.amt=betAgg();
	}

	return ret;
}