constexpr Score KnightOnQueen = S( 21, 11);
constexpr Score LongDiagonalBishop = S( 22, 0);
constexpr Score MinorBehindPawn = S( 16, 0);
- constexpr Score Overload = S( 16, 7);
+ constexpr Score Overload = S( 13, 6);
constexpr Score PawnlessFlank = S( 20, 80);
constexpr Score RookOnPawn = S( 8, 24);
constexpr Score SliderOnQueen = S( 42, 21);
score += ThreatByMinor[type_of(pos.piece_on(s))];
if (type_of(pos.piece_on(s)) != PAWN)
score += ThreatByRank * (int)relative_rank(Them, s);
+
+ else if (pos.blockers_for_king(Them) & s)
+ score += ThreatByRank * (int)relative_rank(Them, s) / 2;
}
b = weak & attackedBy[Us][ROOK];
score += ThreatByRook[type_of(pos.piece_on(s))];
if (type_of(pos.piece_on(s)) != PAWN)
score += ThreatByRank * (int)relative_rank(Them, s);
+
+ else if (pos.blockers_for_king(Them) & s)
+ score += ThreatByRank * (int)relative_rank(Them, s) / 2;
}
- // Bonus for king attacks on pawns or pieces which are not pawn-defended
if (weak & attackedBy[Us][KING])
score += ThreatByKing;
b = shift<Up>(pos.pieces(Us, PAWN)) & ~pos.pieces();
b |= shift<Up>(b & TRank3BB) & ~pos.pieces();
- // Keep only the squares which are not completely unsafe
+ // Keep only the squares which are relatively safe
b &= ~attackedBy[Them][PAWN]
& (attackedBy[Us][ALL_PIECES] | ~attackedBy[Them][ALL_PIECES]);