File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1146,6 +1146,9 @@ bool Position::legal(Move m) const {
11461146 if (capture (m) && (var->petrifyOnCaptureTypes & type_of (moved_piece (m))) && (st->pseudoRoyals & from))
11471147 return false ;
11481148 Bitboard pseudoRoyals = st->pseudoRoyals & pieces (sideToMove);
1149+ // Add dropped pseudo-royal
1150+ if (type_of (m) == DROP && (extinction_piece_types () & type_of (moved_piece (m))))
1151+ pseudoRoyals |= square_bb (to);
11491152 Bitboard pseudoRoyalsTheirs = st->pseudoRoyals & pieces (~sideToMove);
11501153 if (is_ok (from) && (pseudoRoyals & from))
11511154 pseudoRoyals ^= square_bb (from) ^ kto;
Original file line number Diff line number Diff line change 120120castlingKingPiece = k
121121extinctionValue = loss
122122extinctionPieceTypes = k
123+
124+ [coregaldrop:coregal]
125+ pieceDrops = true
126+ startFen = rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[Qq] w KQkq - 0 1
123127"""
124128
125129sf .load_variant_config (ini_text )
@@ -346,6 +350,11 @@ def test_legal_moves(self):
346350 result = sf .legal_moves ("seirawan" , fen , [])
347351 self .assertIn ("c8g4h" , result )
348352
353+ # Drop pseudo-royals into check
354+ result = sf .legal_moves ("coregaldrop" , sf .start_fen ("coregaldrop" ), [])
355+ self .assertIn ("Q@a3" , result )
356+ self .assertNotIn ("Q@a6" , result )
357+
349358 # In Cannon Shogi the FGC and FSC can also move one square diagonally and, besides,
350359 # move or capture two squares diagonally, by leaping an adjacent piece.
351360 fen = "lnsg1gsnl/1rc1kuab1/p1+A1p1p1p/3P5/6i2/6P2/P1P1P3P/1B1U1ICR1/LNSGKGSNL[] w - - 1 3"
You can’t perform that action at this time.
0 commit comments