Closes #352.
// Other win rules
if ( pos.captures_to_hand()
|| pos.count_in_hand(c, ALL_PIECES)
- || pos.extinction_value() != VALUE_NONE
+ || (pos.extinction_value() != VALUE_NONE && !pos.extinction_pseudo_royal())
|| (pos.capture_the_flag_piece() && pos.count(c, pos.capture_the_flag_piece())))
return false;
// Restricted pieces
Bitboard restricted = pos.pieces(~c, KING);
+ // Atomic kings can not help checkmating
+ if (pos.extinction_pseudo_royal() && pos.blast_on_capture() && pos.extinction_piece_types().find(COMMONER) != pos.extinction_piece_types().end())
+ restricted |= pos.pieces(c, COMMONER);
for (PieceType pt : pos.piece_types())
if (pt == KING || !(pos.board_bb(c, pt) & pos.board_bb(~c, KING)))
restricted |= pos.pieces(c, pt);
bool extinction_single_piece() const;
int extinction_piece_count() const;
int extinction_opponent_piece_count() const;
+ bool extinction_pseudo_royal() const;
PieceType capture_the_flag_piece() const;
Bitboard capture_the_flag(Color c) const;
bool flag_move() const;
return var->extinctionOpponentPieceCount;
}
+inline bool Position::extinction_pseudo_royal() const {
+ assert(var != nullptr);
+ return var->extinctionPseudoRoyal;
+}
+
inline PieceType Position::capture_the_flag_piece() const {
assert(var != nullptr);
return var->flagPiece;
},
"atomic": {
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1": (False, False), # startpos
+ "8/8/8/8/3K4/3k4/8/8 b - - 0 1": (True, True), # K vs K
+ "k7/p7/8/8/8/8/8/K7 w - - 0 1": (True, False), # K vs KP
+ "k7/q7/8/8/8/8/8/K7 w - - 0 1": (True, False), # K vs KQ
},
"3check": {
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 3+3 0 1": (False, False), # startpos