public static PlayerAction PassivePlayerAction(GetTurnContext context, HandRankType combination, int raiseAmount, int pushAmount) { if (CustomHandStreightChecks.GotStrongHand(combination)) { if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotTheStrongestHand(combination)) { if (!context.CanCheck && (context.MoneyToCall > context.CurrentPot / 2 || context.MoneyToCall > context.SmallBlind * 14) && context.MoneyLeft > 0) { return(PlayerAction.Raise(context.MoneyLeft)); } else if (context.MoneyLeft >= context.SmallBlind * pushAmount) { return(PlayerAction.Raise(context.SmallBlind * pushAmount)); } else { return(PlayerAction.Raise(context.MoneyLeft)); } } else if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotVeryStrongHand(combination)) { if (!context.CanCheck && (context.MoneyToCall > context.CurrentPot / 2 * 3 || context.MoneyToCall > context.SmallBlind * 20) && context.MoneyLeft > 0) { return(PlayerAction.Raise(context.MoneyLeft)); } else if (context.MoneyLeft >= context.SmallBlind * raiseAmount) { return(PlayerAction.Raise(context.SmallBlind * raiseAmount)); } else { return(PlayerAction.Raise(context.MoneyLeft)); } } else { if (context.MoneyLeft > 0) { return(PlayerAction.Raise(context.SmallBlind * 6)); } else { return(PlayerAction.CheckOrCall()); } } } else { if (context.CanCheck && context.MoneyLeft > 0) { return(PlayerAction.Raise((context.SmallBlind * raiseAmount) - context.SmallBlind)); } else if (context.MoneyToCall <= context.SmallBlind * 2) { return(PlayerAction.CheckOrCall()); } return(CheckOrFoldCustomAction(context)); } }
public static PlayerAction BigStackMethod(GetTurnContext context, CardValueType preFlopCards, Card firstCard, Card secondCard, IReadOnlyCollection <Card> communityCards) { List <Card> currentCards = new List <Card>(); currentCards.Add(firstCard); currentCards.Add(secondCard); if (context.RoundType == GameRoundType.PreFlop) { if (context.MoneyLeft / context.SmallBlind > 50) { if (!context.CanCheck && context.MyMoneyInTheRound == context.SmallBlind) { // we are first and we can paid SmallBlind , can Raise and can Fold return(CustomPlayerActions.AgressivePlayerActionPreflop(context, preFlopCards, 7, 9)); } else if (!context.CanCheck && context.MoneyToCall > context.SmallBlind) { // oppponent is first and has raised with moneyToCall - opponent has raised pre-flop // we can Re-Raise (very strong hand only) - we can call (Verystrong or string) - we Fold return(CustomPlayerActions.PassivePlayerActionPreFlop(context, preFlopCards, 11, 21)); } else if (context.CanCheck) { // opponet is first and he has paid SmallBlind // we can check or raise here return(CustomPlayerActions.AgressivePlayerActionPreflop(context, preFlopCards, 8, 11)); } return(PlayerAction.CheckOrCall()); } else if (context.MoneyLeft / context.SmallBlind > 15 && (context.MoneyLeft / context.SmallBlind <= 50)) { if (!context.CanCheck && context.MyMoneyInTheRound == context.SmallBlind) { // we are first and we can paid SmallBlind , can Raise and can Fold return(CustomPlayerActions.AgressivePlayerActionPreflop(context, preFlopCards, 8, 11)); } else if (!context.CanCheck && context.MoneyToCall > context.SmallBlind) { // oppponent is first and has raised with moneyToCall - opponent has raised pre-flop // we can Re-Raise (very strong hand only) - we can call (Verystrong or string) - we Fold return(CustomPlayerActions.PassivePlayerActionPreFlop(context, preFlopCards, 11, 21)); } else if (context.CanCheck) { // opponet is first and he has paid SmallBlind // we can check or raise here return(CustomPlayerActions.AgressivePlayerActionPreflop(context, preFlopCards, 8, 14)); } return(PlayerAction.CheckOrCall()); } else if (context.MoneyLeft / context.SmallBlind <= 15) { if (!context.CanCheck && context.MyMoneyInTheRound == context.SmallBlind) { // we are first and we can paid SmallBlind , can Raise and can Fold return(CustomPlayerActions.AgressivePlayerActionPreflop(context, preFlopCards, 9, 14)); } else if (!context.CanCheck && context.MoneyToCall > context.SmallBlind) { // oppponent is first and has raised with moneyToCall - opponent has raised pre-flop // we can Re-Raise (very strong hand only) - we can call (Verystrong or string) - we Fold return(CustomPlayerActions.PassivePlayerActionPreFlop(context, preFlopCards, 11, 21)); } else if (context.CanCheck) { // opponet is first and he has paid SmallBlind // we can check or raise here return(CustomPlayerActions.AgressivePlayerActionPreflop(context, preFlopCards, 10, 14)); } return(PlayerAction.CheckOrCall()); } return(CustomPlayerActions.CheckOrFoldCustomAction(context)); } else if (context.RoundType == GameRoundType.Flop) { // TODO // add strong logic for FLOP // (do we have good card conmbination from our 2 cards and the floppef 3 cards) // иif we have already played aggresivly (all-in) we should check/call // if NOT god combination - we can check or fold // if strong combination we can put more agressiong and raise/all-in currentCards.AddRange(communityCards); var combination = Logic.Helpers.Helpers.GetHandRank(currentCards); if (CustomHandStreightChecks.GotStrongHand(combination)) { if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotTheStrongestHand(combination)) { return(CustomPlayerActions.AgressivePlayerAction(context, preFlopCards, combination, 2, 12)); } else if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotVeryStrongHand(combination)) { return(CustomPlayerActions.AgressivePlayerAction(context, preFlopCards, combination, 2, 14)); } return(PlayerAction.CheckOrCall()); } else { // TODO add here a method to see if we have chance to make good hand and add logic if (context.MoneyLeft > 0) { return(CustomPlayerActions.PassivePlayerAction(context, combination, 6, 8)); } return(CustomPlayerActions.CheckOrFoldCustomAction(context)); } // return PlayerAction.CheckOrCall(); } else if (context.RoundType == GameRoundType.Turn) { // TODO // add strong logic for FLOP // (do we have good card conmbination from our 2 cards and the floppef 4 cards) // иif we have already played aggresivly (all-in) we should check/call // if NOT god combination - we can check or fold // if strong combination we can put more agressiong and raise/all-in currentCards.Clear(); currentCards.Add(firstCard); currentCards.Add(secondCard); currentCards.AddRange(communityCards); var combination = Logic.Helpers.Helpers.GetHandRank(currentCards); if (CustomHandStreightChecks.GotStrongHand(combination)) { if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotTheStrongestHand(combination)) { return(CustomPlayerActions.AgressivePlayerAction(context, preFlopCards, combination, 2, 12)); } else if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotVeryStrongHand(combination)) { return(CustomPlayerActions.AgressivePlayerAction(context, preFlopCards, combination, 2, 15)); } return(PlayerAction.CheckOrCall()); } else { // TODO add here a method to see if we have chance to make good hand and add logic if (context.MoneyLeft > 0) { return(CustomPlayerActions.PassivePlayerAction(context, combination, 6, 8)); } return(CustomPlayerActions.CheckOrFoldCustomAction(context)); } } else { // GameRoundType.River (final card) // TODO // add strong logic for FLOP // (do we have good card conmbination from our 2 cards and the floppef 5 cards) // иif we have already played aggresivly (all-in) we should check/call // if NOT god combination - we can check or fold // if strong combination we can put more agressiong and raise/all-in currentCards.Clear(); currentCards.Add(firstCard); currentCards.Add(secondCard); currentCards.AddRange(communityCards); var combination = Logic.Helpers.Helpers.GetHandRank(currentCards); if (CustomHandStreightChecks.GotStrongHand(combination)) { if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotTheStrongestHand(combination)) { return(CustomPlayerActions.AgressivePlayerAction(context, preFlopCards, combination, 2, 18)); } else if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotVeryStrongHand(combination)) { return(CustomPlayerActions.AgressivePlayerAction(context, preFlopCards, combination, 2, 15)); } return(PlayerAction.CheckOrCall()); } else { // TODO add here a method to see if we have chance to make good hand and add logic if (context.MoneyLeft > 0) { return(CustomPlayerActions.PassivePlayerAction(context, combination, 6, 8)); } return(CustomPlayerActions.CheckOrFoldCustomAction(context)); } } }
public static PlayerAction AgressivePlayerAction(GetTurnContext context, CardValueType preFlopCards, HandRankType combination, int potMultiplier, int raiseSbMultipliyer) { if (preFlopCards == CardValueType.Recommended) { if (CustomHandStreightChecks.GotStrongHand(combination)) { if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotTheStrongestHand(combination)) { if ((context.MoneyToCall > context.CurrentPot / 2 || context.MoneyToCall > context.SmallBlind * 14) && context.MoneyLeft > 0) { return(PlayerAction.Raise(context.MoneyLeft)); } else if (context.MoneyLeft >= context.SmallBlind * raiseSbMultipliyer) { return(PlayerAction.Raise(context.CurrentPot * potMultiplier)); } else { return(PlayerAction.Raise(context.MoneyLeft)); } } else if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotVeryStrongHand(combination)) { if (!context.CanCheck && (context.MoneyToCall > context.CurrentPot / 2 * 3 || context.MoneyToCall > context.SmallBlind * 20) && context.MoneyLeft > 0) { return(PlayerAction.Raise(context.MoneyLeft)); } else if (context.MoneyLeft >= context.SmallBlind * raiseSbMultipliyer) { return(PlayerAction.Raise(context.CurrentPot * potMultiplier)); } else { return(PlayerAction.Raise(context.MoneyLeft)); } } else { if (context.MoneyLeft > 0) { return(PlayerAction.Raise(context.SmallBlind * 6)); } else { return(PlayerAction.CheckOrCall()); } } } else { if (context.CanCheck && context.MoneyLeft > 0 && context.MyMoneyInTheRound == 0) { return(PlayerAction.Raise((context.SmallBlind * raiseSbMultipliyer) - context.SmallBlind)); } else if (context.MoneyToCall <= context.SmallBlind * 2) { return(PlayerAction.CheckOrCall()); } else { return(CheckOrFoldCustomAction(context)); } } } else if (preFlopCards == CardValueType.NotRecommended || preFlopCards == CardValueType.Risky) { if (CustomHandStreightChecks.GotStrongHand(combination)) { if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotTheStrongestHand(combination)) { if (!context.CanCheck && (context.MoneyToCall > context.SmallBlind * 10) && context.MoneyLeft > 0) { return(PlayerAction.Raise(context.MoneyLeft)); } else if (context.MoneyLeft > 0) { return(PlayerAction.Raise(context.CurrentPot * potMultiplier)); } else { return(CheckOrFoldCustomAction(context)); } } else if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotVeryStrongHand(combination)) { if (!context.CanCheck && (context.MoneyToCall > context.CurrentPot / 2 * 3 || context.MoneyToCall > context.SmallBlind * 20) && context.MoneyLeft > 0) { return(PlayerAction.Raise(context.MoneyLeft)); } else if (context.MoneyLeft > 0) { return(PlayerAction.Raise(context.CurrentPot * potMultiplier)); } else { return(CheckOrFoldCustomAction(context)); } } else { if (context.MoneyLeft > 0) { return(PlayerAction.Raise(context.SmallBlind * 6)); } else { return(CheckOrFoldCustomAction(context)); } } } else { if (context.CanCheck && context.MoneyLeft > 0 && context.MyMoneyInTheRound == 0) { return(PlayerAction.CheckOrCall()); } else if (context.MoneyToCall <= context.SmallBlind * 2) { return(PlayerAction.CheckOrCall()); } else { return(CheckOrFoldCustomAction(context)); } } } else { if (CustomHandStreightChecks.GotStrongHand(combination)) { if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotTheStrongestHand(combination)) { if (!context.CanCheck && (context.MoneyToCall > context.CurrentPot / 2 || context.MoneyToCall > context.SmallBlind * 14) && context.MoneyLeft > 0) { return(PlayerAction.Raise(context.MoneyLeft)); } else if (context.MoneyLeft > 0) { return(PlayerAction.Raise(context.CurrentPot * potMultiplier)); } else { return(PlayerAction.Raise(context.MoneyLeft)); } } else if (context.MoneyLeft > 0 && CustomHandStreightChecks.GotVeryStrongHand(combination)) { if (!context.CanCheck && (context.MoneyToCall > context.CurrentPot / 2 * 3 || context.MoneyToCall > context.SmallBlind * 20) && context.MoneyLeft > 0) { return(PlayerAction.Raise(context.MoneyLeft)); } else if (context.MoneyLeft >= context.SmallBlind * raiseSbMultipliyer) { return(PlayerAction.Raise(context.CurrentPot * potMultiplier)); } else { return(PlayerAction.Raise(context.MoneyLeft)); } } else { if (context.MoneyLeft > 0) { return(PlayerAction.Raise(context.SmallBlind * 6)); } else { return(CheckOrFoldCustomAction(context)); } } } else { if (context.CanCheck && context.MoneyLeft > 0 && context.MyMoneyInTheRound == 0) { return(PlayerAction.CheckOrCall()); } else if (context.MoneyToCall <= context.SmallBlind * 2) { return(PlayerAction.CheckOrCall()); } else { return(CheckOrFoldCustomAction(context)); } } } }