From 1a8078fbc9f4caa8ca7daa8876e29ef19a28a9b0 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sun, 21 Jun 2020 12:50:08 +0200 Subject: [PATCH] Evaluate promoted drops for hand pieces kyotoshogi LLR: 2.98 (-2.94,2.94) [0.00,10.00] Total: 512 W: 306 L: 197 D: 9 --- src/evaluate.cpp | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index eab948a..78ba6ab 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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; -- 1.7.0.4