rule: Support removing unplaced piece

If a player forms the mill in the placing phase, she will remove
the opponent's unplaced piece and continue to make a move.
This commit is contained in:
Calcitem 2021-10-02 19:49:41 +08:00
parent 9bbb0d3b29
commit 74f098043d
No known key found for this signature in database
GPG Key ID: F2F7C29E054CFB80
55 changed files with 471 additions and 6 deletions

View File

@ -694,7 +694,35 @@ bool Position::put_piece(Square s, bool updateRecord)
} else {
pieceToRemoveCount = rule.mayRemoveMultiple ? n : 1;
update_key_misc();
action = Action::remove;
if (rule.mayOnlyRemoveUnplacedPieceInPlacingPhase) {
pieceInHandCount[them] -= 1; // Or pieceToRemoveCount?;
if (pieceInHandCount[them] < 0) {
pieceInHandCount[them] = 0;
}
assert(pieceInHandCount[WHITE] >= 0 && pieceInHandCount[BLACK] >= 0);
if (pieceInHandCount[WHITE] == 0 && pieceInHandCount[BLACK] == 0) {
if (check_if_game_is_over()) {
return true;
}
phase = Phase::moving;
action = Action::select;
if (rule.isDefenderMoveFirst) {
change_side_to_move();
}
if (check_if_game_is_over()) {
return true;
}
}
} else {
action = Action::remove;
}
}
} else if (phase == Phase::moving) {

View File

@ -33,6 +33,7 @@ struct Rule rule = {
false, // 先摆棋者先行棋
false, // 多个“三连”只能提一子
false, // 不能提对手的“三连”子,除非无子可提;
false, // 摆子阶段不移除对方未摆的棋子;
true, // 摆棋满子闷棋只有12子棋才出现算先手负
true, // 走棋阶段不能行动(被“闷”)算负
true, // 剩三子时可以飞棋
@ -59,6 +60,7 @@ const struct Rule RULES[N_RULES] = {
false, // 先摆棋者先行棋
false, // 多个“三连”只能提一子
false, // 不能提对手的“三连”子,除非无子可提;
false, // 摆子阶段不移除对方未摆的棋子;
true, // 摆棋满子闷棋只有12子棋才出现算先手负
true, // 走棋阶段不能行动(被“闷”)算负
false, // 剩三子时不可以飞棋
@ -82,6 +84,7 @@ const struct Rule RULES[N_RULES] = {
true, // 后摆棋者先行棋
false, // 多个“三连”只能提一子
true, // 可以提对手的“三连”子
false, // 摆子阶段不移除对方未摆的棋子;
true, // 摆棋满子闷棋只有12子棋才出现算先手负
true, // 走棋阶段不能行动(被“闷”)算负
false, // 剩三子时不可以飞棋
@ -100,6 +103,7 @@ const struct Rule RULES[N_RULES] = {
false, // 先摆棋者先行棋
false, // 多个“三连”只能提一子
false, // 不能提对手的“三连”子,除非无子可提;
false, // 摆子阶段不移除对方未摆的棋子;
true, // 摆棋满子闷棋只有12子棋才出现算先手负
true, // 走棋阶段不能行动(被“闷”)算负
true, // 剩三子时可以飞棋
@ -123,6 +127,7 @@ const struct Rule RULES[N_RULES] = {
false, // 先摆棋者先行棋
false, // 多个“三连”只能提一子
false, // 不能提对手的“三连”子,除非无子可提;
false, // 摆子阶段不移除对方未摆的棋子;
true, // 摆棋满子闷棋只有12子棋才出现算先手负
true, // 走棋阶段不能行动(被“闷”)算负
true, // 剩三子时可以飞棋
@ -141,6 +146,7 @@ const struct Rule RULES[N_RULES] = {
false, // 先摆棋者先行棋
false, // 多个“三连”只能提一子
false, // 不能提对手的“三连”子,除非无子可提;
false, // 摆子阶段不移除对方未摆的棋子;
true, // 摆棋满子闷棋只有12子棋才出现算先手负
true, // 走棋阶段不能行动(被“闷”)算负
true, // 剩三子时可以飞棋

View File

@ -56,6 +56,9 @@ struct Rule
// Enable this option to disable the limitation.
bool mayRemoveFromMillsAlways;
// If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move.
bool mayOnlyRemoveUnplacedPieceInPlacingPhase;
// At the end of the placing phase, when the board is full,
// the side that places first loses the game, otherwise, the game is a draw.
bool isWhiteLoseButNotDrawWhenBoardFull;

View File

@ -142,6 +142,11 @@ void on_mayRemoveFromMillsAlways(const Option &o)
rule.mayRemoveFromMillsAlways = (bool)o;
}
void on_mayOnlyRemoveUnplacedPieceInPlacingPhase(const Option &o)
{
rule.mayOnlyRemoveUnplacedPieceInPlacingPhase = (bool)o;
}
void on_isWhiteLoseButNotDrawWhenBoardFull(const Option &o)
{
rule.isWhiteLoseButNotDrawWhenBoardFull = (bool)o;
@ -211,6 +216,7 @@ void init(OptionsMap &o)
o["IsDefenderMoveFirst"] << Option(false, on_isDefenderMoveFirst);
o["MayRemoveMultiple"] << Option(false, on_mayRemoveMultiple);
o["MayRemoveFromMillsAlways"] << Option(false, on_mayRemoveFromMillsAlways);
o["MayOnlyRemoveUnplacedPieceInPlacingPhase"] << Option(false, on_mayOnlyRemoveUnplacedPieceInPlacingPhase);
o["IsWhiteLoseButNotDrawWhenBoardFull"] << Option(true, on_isWhiteLoseButNotDrawWhenBoardFull);
o["IsLoseButNotChangeSideWhenNoWay"] << Option(true, on_isLoseButNotChangeSideWhenNoWay);
o["MayFly"] << Option(true, on_mayFly);

View File

@ -92,6 +92,7 @@ class Config {
static bool isDefenderMoveFirst = false;
static bool mayRemoveMultiple = false;
static bool mayRemoveFromMillsAlways = false;
static bool mayOnlyRemoveUnplacedPieceInPlacingPhase = false;
static bool isWhiteLoseButNotDrawWhenBoardFull = true;
static bool isLoseButNotChangeSideWhenNoWay = true;
static bool mayFly = true;
@ -195,6 +196,9 @@ class Config {
Config.mayRemoveMultiple = settings['MayRemoveMultiple'] ?? false;
rule.mayRemoveFromMillsAlways = Config.mayRemoveFromMillsAlways =
settings['MayRemoveFromMillsAlways'] ?? false;
rule.mayOnlyRemoveUnplacedPieceInPlacingPhase =
Config.mayOnlyRemoveUnplacedPieceInPlacingPhase =
settings['MayOnlyRemoveUnplacedPieceInPlacingPhase'] ?? false;
rule.isWhiteLoseButNotDrawWhenBoardFull =
Config.isWhiteLoseButNotDrawWhenBoardFull =
settings['IsWhiteLoseButNotDrawWhenBoardFull'] ?? true;
@ -275,6 +279,8 @@ class Config {
settings['IsDefenderMoveFirst'] = Config.isDefenderMoveFirst;
settings['MayRemoveMultiple'] = Config.mayRemoveMultiple;
settings['MayRemoveFromMillsAlways'] = Config.mayRemoveFromMillsAlways;
settings['MayOnlyRemoveUnplacedPieceInPlacingPhase'] =
Config.mayOnlyRemoveUnplacedPieceInPlacingPhase;
settings['IsWhiteLoseButNotDrawWhenBoardFull'] =
Config.isWhiteLoseButNotDrawWhenBoardFull;
settings['IsLoseButNotChangeSideWhenNoWay'] =

View File

@ -164,6 +164,8 @@ class NativeEngine extends Engine {
'setoption name MayRemoveMultiple value ${Config.mayRemoveMultiple}');
await send(
'setoption name MayRemoveFromMillsAlways value ${Config.mayRemoveFromMillsAlways}');
await send(
'setoption name MayOnlyRemoveUnplacedPieceInPlacingPhase value ${Config.mayOnlyRemoveUnplacedPieceInPlacingPhase}');
await send(
'setoption name IsWhiteLoseButNotDrawWhenBoardFull value ${Config.isWhiteLoseButNotDrawWhenBoardFull}');
await send(

View File

@ -1200,5 +1200,13 @@
"algorithm": "الخوارزمية",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "قم بإزالة القطعة غير الموضوعة",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "إذا قام اللاعب بتشكيل الطاحونة في مرحلة التسوية ، فسوف يقوم بإزالة القطعة غير الموضوعة للخصم ويستمر في التحرك.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Алгоритъм",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Отстранете непоставеното парче",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Ако играч формира мелницата във фазата на поставяне, тя ще премахне непоставената фигура на противника и ще продължи да прави ход.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "অ্যালগরিদম",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "স্থানহীন টুকরা সরান",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "যদি প্লেয়ার প্লেসিং পর্যায়ে মিল গঠন করে, সে প্রতিপক্ষের স্থানহীন টুকরাটি সরিয়ে দেবে এবং একটি পদক্ষেপ নিতে থাকবে।",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritmus",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Odstraňte neumístěný kus",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Pokud hráč vytvoří mlýn ve fázi umisťování, odstraní soupeřovu neumístěnou figurku a pokračuje v tahu.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritme",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Fjern uplaceret stykke",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Hvis en spiller danner møllen i placeringsfasen, vil hun fjerne modstanderens uplacerede brik og fortsætte med at foretage et træk.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algorithmus",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Entfernen Sie nicht platzierte Steine",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Wenn ein Spieler in der Platzierungsphase die Mühle bildet, entfernt er den nicht platzierten Stein des Gegners und macht weiter seinen Zug.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algorithmus",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Entfernen Sie nicht platzierte Steine",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Wenn ein Spieler in der Platzierungsphase die Mühle bildet, entfernt er den nicht platzierten Stein des Gegners und macht weiter seinen Zug.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Αλγόριθμος",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Αφαιρέστε το μη τοποθετημένο κομμάτι",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Εάν ένας παίκτης σχηματίσει το μύλο στη φάση τοποθέτησης, θα αφαιρέσει το μη τοποθετημένο κομμάτι του αντιπάλου και θα συνεχίσει να κάνει μια κίνηση.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algorithm",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Remove unplaced piece",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritmo",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Quitar pieza no colocada",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Si un jugador forma el molino en la fase de colocación, retirará la pieza no colocada del oponente y continuará haciendo un movimiento.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritm",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Eemaldage asetamata tükk",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Kui mängija moodustab veski paigutamise faasis, eemaldab ta vastase asetamata tüki ja jätkab käigu tegemist.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "الگوریتم",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "قطعه بدون محل را بردارید",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "اگر بازیکنی آسیاب را در مرحله قرار دادن تشکیل دهد ، مهره بدون محل حریف را برداشته و به حرکت خود ادامه می دهد.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritmi",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Poista sijoittamaton kappale",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Jos pelaaja muodostaa myllyn sijoitusvaiheessa, hän poistaa vastustajan sijoittamattoman palan ja jatkaa siirtoa.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algorithme",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Retirer la pièce non placée",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Si un joueur forme le moulin lors de la phase de placement, il retirera la pièce non placée de l'adversaire et continuera à se déplacer.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "અલ્ગોરિધમ",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "સ્થાનાંતરિત ભાગ દૂર કરો",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "જો કોઈ ખેલાડી પ્લેસિંગ તબક્કામાં મિલની રચના કરે છે, તો તે વિરોધીના સ્થાનાંતરિત ભાગને દૂર કરશે અને ચાલ ચાલુ રાખશે.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "कलन विधि",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "हटाए गए टुकड़े को हटा दें",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "यदि कोई खिलाड़ी प्लेसिंग चरण में चक्की बनाता है, तो वह प्रतिद्वंद्वी के स्थान से हटाए गए टुकड़े को हटा देगी और एक चाल चलती रहेगी।",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritam",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Uklonite nenamješteni komad",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Ako igrač formira mlin u fazi postavljanja, uklonit će protivnikov nezamješten dio i nastaviti činiti potez.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritmus",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Távolítsa el az elhelyezett darabot",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Ha egy játékos az elhelyezési szakaszban megalapítja a malmot, akkor eltávolítja az ellenfél elhelyezett darabját, és folytatja a lépést.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "algoritma",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Hapus bagian yang tidak ditempatkan",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Jika seorang pemain membentuk penggilingan di fase penempatan, dia akan menghapus bidak lawan yang belum ditempatkan dan terus bergerak.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritmo",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Rimuovere il pezzo non posizionato",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Se un giocatore forma il mulino nella fase di piazzamento, rimuoverà il pezzo non piazzato dell'avversario e continuerà a fare una mossa.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "アルゴリズム",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "相手の手に残っているチェスの駒しか食べられない",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "スリーカムが形成されると、対戦相手の配置されていないピースのみをキャプチャしてゲームを続行できます。",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "ಅಲ್ಗಾರಿದಮ್",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "ಸ್ಥಳವಿಲ್ಲದ ತುಂಡನ್ನು ತೆಗೆಯಿರಿ",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "ಇರಿಸುವ ಹಂತದಲ್ಲಿ ಆಟಗಾರ್ತಿಯು ಗಿರಣಿಯನ್ನು ರೂಪಿಸಿದರೆ, ಆಕೆ ಎದುರಾಳಿಯ ಸ್ಥಾನವಿಲ್ಲದ ತುಂಡನ್ನು ತೆಗೆದು ಚಲನೆಯನ್ನು ಮುಂದುವರಿಸುತ್ತಾಳೆ.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "연산",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "배치되지 않은 조각 제거",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "플레이어가 배치 단계에서 밀을 형성하면 상대의 배치되지 않은 조각을 제거하고 계속 이동합니다.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritmas",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Pašalinkite neįdėtą gabalą",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Jei žaidėjas suformuoja malūną dėjimo stadijoje, ji pašalina priešininko nepadėtą figūrą ir toliau daro ėjimą.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritms",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Noņemiet neizvietoto gabalu",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Ja spēlētājs ievieto dzirnavas ievietošanas fāzē, viņa noņem pretinieka nenovietoto gabalu un turpina gājienu.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Алгоритам",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Отстранете го непоставеното парче",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Ако играчот ја формира воденицата во фазата на пласман, таа ќе го отстрани непласираното парче на противничката и ќе продолжи да прави потег.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritma",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Tanggalkan kepingan yang tidak diletak",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Sekiranya pemain membentuk kilang dalam fasa penempatan, dia akan mengeluarkan bahagian lawan yang tidak ditempatkan dan terus bergerak.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritme",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Verwijder niet-geplaatst stuk",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Als een speler de molen vormt in de plaatsingsfase, zal ze het niet-geplaatste stuk van de tegenstander verwijderen en doorgaan met een zet.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritme",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Fjern det uplasserte stykket",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Hvis en spiller danner møllen i plasseringsfasen, vil hun fjerne motstanderens uplasserte brikke og fortsette å gjøre et trekk.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algorytm",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Usuń nieumieszczony kawałek",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Jeśli gracz utworzy młyn w fazie układania, usunie nieumieszczony pion przeciwnika i kontynuuje ruch.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritmo",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Remova a peça não colocada",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Se um jogador formar o moinho na fase de colocação, ele removerá a peça não colocada do oponente e continuará a fazer um movimento.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritm",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Îndepărtați piesa neplasată",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Dacă un jucător formează moara în faza de plasare, va elimina piesa neplasată a adversarului și va continua să facă o mișcare.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Алгоритм",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Удалить неразмещенный кусок",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Если игрок формирует мельницу в фазе размещения, он удалит неразмещенную фишку противника и продолжит движение.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritmus",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Odstráňte neuložený kus",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Ak hráč formuje mlyn vo fáze kladenia, odstráni súperovo neumiestnené miesto a pokračuje v ťahu.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritem",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Odstranite nenastavljen kos",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Če igralec v fazi postavitve oblikuje mlin, bo odstranil nasprotnikov nezameščen kos in nadaljeval s potezo.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritmi",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Hiqni copën e pavendosur",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Nëse një lojtar formon mullirin në fazën e vendosjes, ajo do të heqë pjesën e pavendosur të kundërshtarit dhe do të vazhdojë të bëjë një lëvizje.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Алгоритам",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Уклоните непостављени комад",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Ако играч формира воденицу у фази постављања, она ће уклонити противников незамењени део и наставити да прави потез.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritm",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Ta bort oplacerad bit",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Om en spelare bildar kvarnen i placeringsfasen, tar hon bort motståndarens oplacerade bit och fortsätter att göra ett drag.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "అల్గోరిథం",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "ఉంచని భాగాన్ని తొలగించండి",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "ప్లేసింగ్ ఉంచే దశలో ఒక క్రీడాకారుడు మిల్లును ఏర్పాటు చేస్తే, ఆమె ప్రత్యర్థి యొక్క అన్‌ప్లాస్డ్ భాగాన్ని తీసివేసి, ఒక కదలికను కొనసాగిస్తుంది.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "อัลกอริทึม",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "ถอดชิ้นส่วนที่ไม่ได้วาง",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "หากผู้เล่นสร้างโรงสีในขั้นตอนการวาง เธอจะถอดชิ้นส่วนที่ไม่ได้วางของคู่ต่อสู้ออกและทำการเคลื่อนไหวต่อไป",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "algoritma",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Yerleştirilmemiş parçayı kaldır",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Bir oyuncu değirmeni yerleştirme aşamasında oluşturursa, rakibin yerleştirilmemiş taşını kaldıracak ve hamle yapmaya devam edecektir.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Algoritm",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "O'rnatilmagan qismni olib tashlang",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Agar o'yinchi joylashtirish bosqichida tegirmonni hosil qilsa, u raqibning joylanmagan qismini olib tashlaydi va harakatni davom ettiradi.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "Thuật toán",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "Loại bỏ mảnh không có vị trí",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "Nếu một người chơi hình thành cối xay trong giai đoạn đặt, cô ấy sẽ loại bỏ quân cờ của đối thủ và tiếp tục di chuyển.",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "算法",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "只能吃掉未摆的子",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "当形成三连时,只能吃掉对手未摆的棋子并继续行棋。",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -1200,5 +1200,13 @@
"algorithm": "算法",
"@algorithm": {
"description": "Algorithm"
},
"removeUnplacedPiece": "只能吃掉未擺的子",
"@removeUnplacedPiece": {
"description": "Remove unplaced piece"
},
"removeUnplacedPiece_Detail": "當形成三連時,只能吃掉對手未擺的棋子並繼續行棋。",
"@removeUnplacedPiece_Detail": {
"description": "If a player forms the mill in the placing phase, she will remove the opponent's unplaced piece and continue to make a move."
}
}

View File

@ -522,7 +522,37 @@ class Position {
} else {
pieceToRemoveCount = rule.mayRemoveMultiple ? n : 1;
updateKeyMisc();
action = Act.remove;
if (rule.mayOnlyRemoveUnplacedPieceInPlacingPhase &&
pieceInHandCount[them] != null) {
pieceInHandCount[them] =
pieceInHandCount[them]! - 1; // Or pieceToRemoveCount?
if (pieceInHandCount[them]! < 0) {
pieceInHandCount[them] = 0;
}
if (pieceInHandCount[PieceColor.white] == 0 &&
pieceInHandCount[PieceColor.black] == 0) {
if (checkIfGameIsOver()) {
return true;
}
phase = Phase.moving;
action = Act.select;
if (rule.isDefenderMoveFirst) {
changeSideToMove();
}
if (checkIfGameIsOver()) {
return true;
}
}
} else {
action = Act.remove;
}
Game.instance.focusIndex = squareToIndex[s] ?? invalidIndex;
Audios.playTone(Audios.millSoundId);
}

View File

@ -30,6 +30,7 @@ class Rule {
bool isDefenderMoveFirst = false;
bool mayRemoveMultiple = false;
bool mayRemoveFromMillsAlways = false;
bool mayOnlyRemoveUnplacedPieceInPlacingPhase = false;
bool isWhiteLoseButNotDrawWhenBoardFull = true;
bool isLoseButNotChangeSideWhenNoWay = true;
bool mayFly = true;

View File

@ -263,10 +263,14 @@ class _GamePageState extends State<GamePage>
if (Game.instance.engineType == EngineType.humanVsAi && mounted) {
showTip(S.of(context).tipPlaced);
} else if (mounted) {
var side = Game.instance.sideToMove == PieceColor.white
? S.of(context).black
: S.of(context).white;
showTip(side + S.of(context).tipToMove);
if (rule.mayOnlyRemoveUnplacedPieceInPlacingPhase) {
showTip(S.of(context).tipPlaced); // TODO: Change tip
} else {
var side = Game.instance.sideToMove == PieceColor.white
? S.of(context).black
: S.of(context).white;
showTip(side + S.of(context).tipToMove);
}
}
}
ret = true;

View File

@ -109,6 +109,14 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
subtitleString:
S.of(context).isWhiteLoseButNotDrawWhenBoardFull_Detail,
),
ListItemDivider(),
SettingsSwitchListTile(
context: context,
value: Config.mayOnlyRemoveUnplacedPieceInPlacingPhase,
onChanged: setMayOnlyRemoveUnplacedPieceInPlacingPhase,
titleString: S.of(context).removeUnplacedPiece,
subtitleString: S.of(context).removeUnplacedPiece_Detail,
),
],
),
SizedBox(height: AppTheme.sizedBoxHeight),
@ -402,6 +410,17 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
Config.save();
}
setMayOnlyRemoveUnplacedPieceInPlacingPhase(bool value) async {
setState(() {
rule.mayOnlyRemoveUnplacedPieceInPlacingPhase =
Config.mayOnlyRemoveUnplacedPieceInPlacingPhase = value;
});
print("[config] rule.mayOnlyRemoveUnplacedPieceInPlacingPhase: $value");
Config.save();
}
// Moving
setMayMoveInPlacingPhase(bool value) async {