- // Increase the bonus if the passed pawn is supported by a friendly pawn
- // on the same rank and a bit smaller if it's on the previous rank.
- supportingPawns = pos.pieces(Us, PAWN) & adjacent_files_bb(file_of(s));
- if (supportingPawns & rank_bb(s))
- ebonus += Value(r * 20);
-
- else if (supportingPawns & rank_bb(s - pawn_push(Us)))
- ebonus += Value(r * 12);
-
- // Rook pawns are a special case: They are sometimes worse, and
- // sometimes better than other passed pawns. It is difficult to find
- // good rules for determining whether they are good or bad. For now,
- // we try the following: Increase the value for rook pawns if the
- // other side has no pieces apart from a knight, and decrease the
- // value if the other side has a rook or queen.
- if (file_of(s) == FILE_A || file_of(s) == FILE_H)
- {
- if (pos.non_pawn_material(Them) <= KnightValueMg)
- ebonus += ebonus / 4;
-
- else if (pos.pieces(Them, ROOK, QUEEN))
- ebonus -= ebonus / 4;
- }
-