mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Add bonuses for Minors attacking enemy pieces(except pawns) even when they are protected by enemy pawns.
Patch passed STC LLR: 2.95 (-2.94,2.94) [-1.50,4.50] Total: 8206 W: 1426 L: 1304 D: 5476 and LTC LLR: 2.97 (-2.94,2.94) [0.00,6.00] Total: 19534 W: 2821 L: 2640 D: 14073 Bench: 9942172
This commit is contained in:
parent
ffedfa3354
commit
6b354305e1
1 changed files with 9 additions and 1 deletions
|
@ -496,9 +496,17 @@ namespace {
|
|||
|
||||
const Color Them = (Us == WHITE ? BLACK : WHITE);
|
||||
|
||||
Bitboard b, weakEnemies;
|
||||
Bitboard b, weakEnemies, protectedEnemies;
|
||||
Score score = SCORE_ZERO;
|
||||
|
||||
// Protected enemies
|
||||
protectedEnemies = (pos.pieces(Them) ^ pos.pieces(Them,PAWN))
|
||||
& ei.attackedBy[Them][PAWN]
|
||||
& (ei.attackedBy[Us][KNIGHT] | ei.attackedBy[Us][BISHOP]);
|
||||
|
||||
if(protectedEnemies)
|
||||
score += Threat[0][type_of(pos.piece_on(lsb(protectedEnemies)))];
|
||||
|
||||
// Enemies not defended by a pawn and under our attack
|
||||
weakEnemies = pos.pieces(Them)
|
||||
& ~ei.attackedBy[Them][PAWN]
|
||||
|
|
Loading…
Add table
Reference in a new issue