Evaluate promoted drops for hand pieces
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 21 Jun 2020 10:50:08 +0000 (12:50 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 21 Jun 2020 10:50:08 +0000 (12:50 +0200)
kyotoshogi
LLR: 2.98 (-2.94,2.94) [0.00,10.00]
Total: 512 W: 306 L: 197 D: 9

src/evaluate.cpp

index eab948a..78ba6ab 100644 (file)
@@ -446,6 +446,9 @@ namespace {
         }
         Bitboard theirHalf = pos.board_bb() & ~forward_ranks_bb(Them, relative_rank(Them, Rank((pos.max_rank() - 1) / 2), pos.max_rank()));
         mobility[Us] += DropMobility * popcount(b & theirHalf & ~attackedBy[Them][ALL_PIECES]);
+        if (pos.promoted_piece_type(pt) != NO_PIECE_TYPE && pos.drop_promoted())
+            score += make_score(std::max(PieceValue[MG][pos.promoted_piece_type(pt)] - PieceValue[MG][pt], VALUE_ZERO),
+                                std::max(PieceValue[EG][pos.promoted_piece_type(pt)] - PieceValue[EG][pt], VALUE_ZERO)) / 4 * pos.count_in_hand(Us, pt);
     }
 
     return score;