X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=068aad9a7d590c7ccbb74c691148ec95b751b641;hp=58058b1ba53b7b31d9923922526e03ec956f99ed;hb=6fed8ff22ab618c89de2bb69bbc379816692baf4;hpb=07b247f9434f3633570aa124539ed5d2fc4f904f diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 58058b1b..068aad9a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -211,10 +211,10 @@ namespace { // Penalties for enemy's safe checks const int QueenContactCheck = 89; - const int QueenCheck = 52; - const int RookCheck = 45; - const int BishopCheck = 5; - const int KnightCheck = 17; + const int QueenCheck = 62; + const int RookCheck = 57; + const int BishopCheck = 48; + const int KnightCheck = 78; // eval_init() initializes king and attack bitboards for a given color @@ -348,6 +348,13 @@ namespace { score -= (TrappedRook - make_score(mob * 22, 0)) * (1 + !pos.can_castle(Us)); } } + + if (Pt == QUEEN) + { + // Penalty if any relative pin or discovered attack against the queen + if (pos.slider_blockers(pos.pieces(), pos.pieces(Them, ROOK, BISHOP), s)) + score -= WeakQueen; + } } if (DoTrace) @@ -399,8 +406,8 @@ namespace { // the pawn shelter (current 'score' value). attackUnits = std::min(72, ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) + 9 * ei.kingAdjacentZoneAttacksCount[Them] - + 27 * popcount(undefended) - + 11 * (popcount(b) + !!ei.pinnedPieces[Us]) + + 21 * popcount(undefended) + + 12 * (popcount(b) + !!ei.pinnedPieces[Us]) - 64 * !pos.count(Them) - mg_value(score) / 8; @@ -489,13 +496,6 @@ namespace { & ~(ei.attackedBy[Us][ALL_PIECES] | ei.attackedBy[Them][ALL_PIECES])) score += LooseEnemies; - // Bonus for pin or discovered attack on the opponent queen - if ( pos.count(Them) == 1 - && pos.slider_blockers(pos.pieces(), - pos.pieces(Us, ROOK, BISHOP), - pos.square(Them))) - score += WeakQueen; - // Non-pawn enemies attacked by a pawn weak = (pos.pieces(Them) ^ pos.pieces(Them, PAWN)) & ei.attackedBy[Us][PAWN];