constexpr Score MinorBehindPawn = S( 16, 0);
constexpr Score Overload = S( 12, 6);
constexpr Score PawnlessFlank = S( 18, 94);
+ constexpr Score RestrictedPiece = S( 7, 6);
constexpr Score RookOnPawn = S( 10, 28);
constexpr Score SliderOnQueen = S( 49, 21);
constexpr Score ThreatByKing = S( 21, 84);
+ 69 * kingAttacksCount[Them]
+ 185 * popcount(kingRing[Us] & weak)
+ 150 * popcount(pos.blockers_for_king(Us) | unsafeChecks)
- + 4 * tropism
+ + tropism * tropism / 4
- 873 * !pos.count<QUEEN>(Them)
- 6 * mg_value(score) / 8
+ mg_value(mobility[Them] - mobility[Us])
constexpr Direction Up = (Us == WHITE ? NORTH : SOUTH);
constexpr Bitboard TRank3BB = (Us == WHITE ? Rank3BB : Rank6BB);
- Bitboard b, weak, defended, nonPawnEnemies, stronglyProtected, safe;
+ Bitboard b, weak, defended, nonPawnEnemies, stronglyProtected, safe, restricted;
Score score = SCORE_ZERO;
// Non-pawn enemies
score += Overload * popcount(b);
}
+ // Bonus for restricting their piece moves
+ restricted = attackedBy[Them][ALL_PIECES]
+ & ~attackedBy[Them][PAWN]
+ & ~attackedBy2[Them]
+ & attackedBy[Us][ALL_PIECES];
+ score += RestrictedPiece * popcount(restricted);
+
// Bonus for enemy unopposed weak pawns
if (pos.pieces(Us, ROOK, QUEEN))
score += WeakUnopposedPawn * pe->weak_unopposed(Them);