Skip to content

Commit

Permalink
3 player mode: Better check for kita calls. Fixes #64
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimboom7 committed Jun 6, 2022
1 parent 31fa61e commit fab9764
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ai_offense.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ function callTsumo() {

function callKita() { // 3 player only
if (strategy != STRATEGIES.THIRTEEN_ORPHANS && strategy != STRATEGIES.FOLD) {
if (getNumberOfTilesInTileArray(ownHand, 4, 3) > 1) { //More than one north tile: Check if it's okay to call kita
var handValue = getHandValues(ownHand);
var newHandValue = getHandValues(removeTilesFromTileArray(ownHand, [{ index: 4, type: 3, dora: false }]));
if (handValue.shanten <= 1 && newHandValue.shanten > handValue.shanten) {
return false;
}
}
sendKitaCall();
return true;
}
Expand Down

0 comments on commit fab9764

Please sign in to comment.