diff --git a/client/variants.ts b/client/variants.ts index 6066c5dc7..d871927ce 100644 --- a/client/variants.ts +++ b/client/variants.ts @@ -515,6 +515,33 @@ export const VARIANTS: Record = { ui: { counting: "makruk", showPromoted: true }, }), + makrukhouse: variant({ + name: "makrukhouse", tooltip: "Take captured pieces and drop them back on to the board as your own.", + startFen: "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR[] w - - 0 1", + icon: "Q", + boardFamily: "makruk8x8", pieceFamily: "makruk", + pieceRow: ["k", "s", "m", "n", "r", "p", "m~" as cg.Letter], + promotion: { type: "regular", order: ["m"] }, + pocket: { + roles: ["p", "m", "s", "n", "r"], + captureToHand: true, + }, + }), + + makbug: variant({ + name: "makbug", tooltip: "Thai bughouse chess", displayName: "makbug ᴮᴱᵀᴬ", + startFen: "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR[] w - - 0 1", + icon: "Q", twoBoards: true, + boardFamily: "makruk8x8", pieceFamily: "makruk", + pieceRow: ["k", "s", "m", "n", "r", "p", "m~" as cg.Letter], + promotion: { type: "regular", order: ["m"] }, + pocket: { + roles: ["p", "m", "s", "n", "r"], + captureToHand: true, + }, + ui: { showPromoted: true }, + }), + makpong: variant({ name: "makpong", tooltip: "Makruk variant where kings cannot move to escape out of check.", startFen: "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR w - - 0 1", @@ -704,6 +731,21 @@ export const VARIANTS: Record = { promotion: { type: "regular", roles: [] }, }), + xiangqihouse: variant({ + name: "xiangqihouse", tooltip: "Take captured pieces and drop them back on to the board as your own.", + startFen: "rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR[] w - - 0 1", + icon: "+", + boardFamily: "xiangqi9x10", pieceFamily: "xiangqi", + notation: cg.Notation.XIANGQI_ARBNUM, + colors: { first: "Red", second: "Black" }, + pieceRow: ["k", "a", "c", "r", "b", "n", "p"], + promotion: { type: "regular", roles: [] }, + pocket: { + roles: ["p", "n", "b", "r", "c", "a"], + captureToHand: true, + }, + }), + supply: variant({ name: "supply", tooltip: "Chinese bughouse chess", displayName: "supply chess ᴮᴱᵀᴬ", startFen: "rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR[] w - - 0 1", @@ -1107,7 +1149,7 @@ export const VARIANTS: Record = { }; export const variants = Object.keys(VARIANTS); -const disabledVariants = [ "gothic", "gothhouse", "embassy", "embassyhouse", "gorogoro", "shinobi" ]; +const disabledVariants = [ "gothic", "gothhouse", "embassy", "embassyhouse", "gorogoro", "shinobi", "makrukhouse", "xiangqihouse" ]; export const enabledVariants = variants.filter(v => !disabledVariants.includes(v)); // variants having 0 puzzle so far @@ -1132,7 +1174,7 @@ export const twoBoarsVariants = variants.filter(v => VARIANTS[v].twoBoards); export const variantGroups: { [ key: string ]: { variants: string[] } } = { standard: { variants: [ "chess", "bughouse", "crazyhouse", "atomic", "kingofthehill", "3check", "antichess", "racingkings", "horde", "placement", "duck", "alice", "fogofwar" ] }, - sea: { variants: [ "makruk", "makpong", "cambodian", "sittuyin", "asean" ] }, + sea: { variants: [ "makruk", "makbug", "makpong", "cambodian", "sittuyin", "asean" ] }, shogi: { variants: [ "shogi", "minishogi", "kyotoshogi", "dobutsu", "gorogoroplus", "torishogi", "cannonshogi" ] }, xiangqi: { variants: [ "xiangqi", "supply", "manchu", "janggi", "minixiangqi" ] }, fairy: { variants: [ "shatranj", "capablanca", "capahouse", "dragon", "seirawan", "shouse", "grand", "grandhouse", "shako", "shogun", "hoppelpoppel", "mansindam" ] }, diff --git a/client/variantsIni.ts b/client/variantsIni.ts index 2354d4dcd..def3a835e 100644 --- a/client/variantsIni.ts +++ b/client/variantsIni.ts @@ -288,4 +288,33 @@ commoner = k castlingKingPiece = k # extinction rules prevents to get valid moves for fog FENs ceated on server side #extinctionValue = loss -#extinctionPieceTypes = k` +#extinctionPieceTypes = k + +# Hybrid variant of xiangqi and crazyhouse +[xiangqihouse:xiangqi] +startFen = rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR[] w - - 0 1 +pieceDrops = true +capturesToHand = true +dropChecks = false +whiteDropRegion = *1 *2 *3 *4 *5 +blackDropRegion = *6 *7 *8 *9 *10 +mobilityRegionWhiteFers = d1 f1 e2 d3 f3 +mobilityRegionBlackFers = d8 f8 e9 d10 f10 +mobilityRegionWhiteElephant = c1 g1 a3 e3 i3 c5 g5 +mobilityRegionBlackElephant = c6 g6 a8 e8 i8 c10 g10 +mobilityRegionWhiteSoldier = a4 a5 c4 c5 e4 e5 g4 g5 i4 i5 *6 *7 *8 *9 *10 +mobilityRegionBlackSoldier = *1 *2 *3 *4 *5 a6 a7 c6 c7 e6 e7 g6 g7 i6 i7 + +# Hybrid variant of makruk and crazyhouse +[makrukhouse:makruk] +startFen = rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR[] w - - 0 1 +pieceDrops = true +capturesToHand = true +firstRankPawnDrops = true +promotionZonePawnDrops = true +immobilityIllegal = true + +[makbug:makrukhouse] +startFen = rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR[] w - - 0 1 +capturesToHand = false +twoBoards = true` diff --git a/server/const.py b/server/const.py index 726af5bac..3b96f2c8b 100644 --- a/server/const.py +++ b/server/const.py @@ -217,7 +217,7 @@ class GameStatus(IntEnum): "shinobiplus", "spartan", ), - "makruk": ("makruk", "makpong", "cambodian", "sittuyin", "asean"), + "makruk": ("makruk", "makbug", "makpong", "cambodian", "sittuyin", "asean"), "shogi": ( "shogi", "minishogi", diff --git a/server/fairy.py b/server/fairy.py index 1ca2b9c99..848130213 100644 --- a/server/fairy.py +++ b/server/fairy.py @@ -72,7 +72,14 @@ def __init__( self.sf = sf_alice if variant == "alice" else sf self.chess960 = chess960 self.sfen = False - self.show_promoted = variant in ("makruk", "makpong", "cambodian", "bughouse", "supply") + self.show_promoted = variant in ( + "makruk", + "makpong", + "cambodian", + "bughouse", + "supply", + "makbug", + ) self.legal_moves_need_history = variant in ("janggi", "ataxx") self.nnue = initial_fen == "" self.initial_fen = ( @@ -111,7 +118,7 @@ def start_fen(variant, chess960=False, disabled_fen=""): else: new_fen = sf.start_fen(variant) - if variant == "bughouse" or variant == "supply": + if variant in ("bughouse", "supply", "makbug"): return new_fen + " | " + new_fen elif variant == "manchu": return MANCHU_R_FEN diff --git a/server/variants.py b/server/variants.py index 2f829fb7e..af66cee51 100644 --- a/server/variants.py +++ b/server/variants.py @@ -72,6 +72,8 @@ def __init__(self, variant): FOGOFWAR = Variant("Q", "fogofwar", _("Fog of War"), "🌫") MAKRUK = Variant("m", "makruk", _("Makruk"), "Q") + MAKRUKHOUSE = Variant("Ł", "makrukhouse", _("Makrukhouse"), "Q") + MAKBUG = Variant("ß", "makbug", _("Makbug"), "Q", two_boards=True, base_variant="makrukhouse") # fmt: skip MAKPONG = Variant("l", "makpong", _("Makpong"), "O") CAMBODIAN = Variant("b", "cambodian", _("Ouk Chaktrang"), "!") SITTUYIN = Variant("y", "sittuyin", _("Sittuyin"), ":") @@ -86,8 +88,8 @@ def __init__(self, variant): CANNONSHOGI = Variant("W", "cannonshogi", _("Cannon Shogi"), "💣", byo=True) XIANGQI = Variant("x", "xiangqi", _("Xiangqi"), "|", grand=True) - XIANGQIHOUSE = Variant("x", "xiangqihouse", _("Xiangqihouse"), "|", grand=True) - SUPPLY = Variant("@", "supply", _("Supply Chess"), "¢", grand=True, two_boards=True, base_variant="xiangqihouse") # fmt: skip + XIANGQIHOUSE = Variant("[", "xiangqihouse", _("Xiangqihouse"), "|", grand=True) + SUPPLY = Variant("@", "supply", _("Supply Chess"), "|", grand=True, two_boards=True, base_variant="xiangqihouse") # fmt: skip MANCHU = Variant("M", "manchu", _("Manchu+"), "{", grand=True) JANGGI = Variant("j", "janggi", _("Janggi"), "=", grand=True, byo=True) MINIXIANGQI = Variant("e", "minixiangqi", _("Minixiangqi"), "7") @@ -141,6 +143,7 @@ def get_server_variant(uci_variant, chess960): ServerVariants.GOTHIC, ServerVariants.GOTHHOUSE, ServerVariants.SHINOBI, + ServerVariants.MAKRUKHOUSE, ServerVariants.XIANGQIHOUSE, ) diff --git a/variants.ini b/variants.ini index e14b296d7..214599581 100644 --- a/variants.ini +++ b/variants.ini @@ -302,3 +302,17 @@ mobilityRegionWhiteElephant = c1 g1 a3 e3 i3 c5 g5 mobilityRegionBlackElephant = c6 g6 a8 e8 i8 c10 g10 mobilityRegionWhiteSoldier = a4 a5 c4 c5 e4 e5 g4 g5 i4 i5 *6 *7 *8 *9 *10 mobilityRegionBlackSoldier = *1 *2 *3 *4 *5 a6 a7 c6 c7 e6 e7 g6 g7 i6 i7 + +# Hybrid variant of makruk and crazyhouse +[makrukhouse:makruk] +startFen = rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR[] w - - 0 1 +pieceDrops = true +capturesToHand = true +firstRankPawnDrops = true +promotionZonePawnDrops = true +immobilityIllegal = true + +[makbug:makrukhouse] +startFen = rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR[] w - - 0 1 +capturesToHand = false +twoBoards = true