ActionRet HoldemTournamentAIManual::pfValuePlay(const TableTexture& t, bool debug) { ActionRet ret; ret.name="pfValuePlay"; ret.action=FOLD; ret.amt=0; profile_line(" -- pfValuePlay -- "); bool agg=false, valCall=false; PokerHand h=table->getHand(); int handVal=defRanks.findHand(h); int minHandVal=5+(table->getPositionBeforeAbs())+2*table->getPlayersDead(); if (t.desperate) minHandVal+=10+2*(table->getPlayersAlive()-2-table->getHandsUntilBB(getAIPlayer())); if (t.medAgg) minHandVal+=5; if (t.uberAgg) minHandVal+=10; int minHandValTrue=minHandVal; if (getTotalRaises()>0&&!t.desperate&&!t.uberAgg) minHandValTrue=6; if (getTotalRaises()>0&&!t.desperate&&!t.uberAgg&&table->getPotOdds()<3) minHandVal/=1+getTotalRaises(); agg=handVal<=minHandValTrue; valCall=!agg&&handVal<minHandVal; if (table->isEveryPlayerAllin()) { if (table->getPotOdds()>=3) { agg=true; } } if (debug) { cout << "agg: " << agg << endl; cout << "valC: " << valCall << endl; cout << " Hand Value: " << handVal << endl; cout << " Desp Adj: " << table->getPlayersAlive()-table->getHandsUntilBB(getAIPlayer()) << endl; cout << " Playable Hands: " << minHandVal << endl; cout << " Raisable Hands: " << minHandValTrue << endl; cout << endl; } if (agg) { if ((h[0].GetIndex()=='0'&&h[1].GetIndex()=='J') || (h[1].GetIndex()=='0'&&h[0].GetIndex()=='J')) { agg=false; valCall=true; static int tmpCtr=0; tmpCtr++; cur(0,11) << "10 J fool prevention: " << tmpCtr << endl; } } if (agg) { ret.action=BET; ret.amt=betAgg(); ret.sub="agg"; } else if (valCall) { ret.action=CALL; ret.sub="call"; ret.amt=table->getCostToCall(getAIPlayer()); } return ret; }