const Score OtherCheck = S(10, 10);
const Score ThreatByHangingPawn = S(71, 61);
const Score LooseEnemies = S( 0, 25);
+ const Score WeakQueen = S(35, 0);
const Score Hanging = S(48, 27);
const Score ThreatByPawnPush = S(38, 22);
const Score Unstoppable = S( 0, 20);
// 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
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)
// 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<QUEEN>(Them)
- mg_value(score) / 8;
Square s = pop_lsb(&b);
assert(pos.pawn_passed(Us, s));
+ assert(!(pos.pieces(PAWN) & forward_bb(Us, s)));
int r = relative_rank(Us, s) - RANK_2;
int rr = r * (r - 1);
// Endgame with opposite-colored bishops, but also other pieces. Still
// a bit drawish, but not as drawish as with only the two bishops.
else
- sf = ScaleFactor(46 * sf / SCALE_FACTOR_NORMAL);
+ sf = ScaleFactor(46);
}
// Endings where weaker side can place his king in front of the opponent's
// pawns are drawish.