diff --git a/noname/library/element/content.js b/noname/library/element/content.js index 7ed9cb15c..0cd1bda8a 100644 --- a/noname/library/element/content.js +++ b/noname/library/element/content.js @@ -5296,6 +5296,16 @@ export const Content = { bool: true, links: [], }; + } else if (event.autochoose()) { + event.result = { + bool: true, + autochoose: true, + cards: player.getCards(event.position), + confirm: "ok", + buttons: [], + targets: [], + links: [], + }; } else { if (event.isMine()) { game.check(); diff --git a/noname/library/element/player.js b/noname/library/element/player.js index a032847db..a8a1a244c 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -4776,6 +4776,11 @@ export class Player extends HTMLDivElement { if (next.filterCard == undefined) next.filterCard = lib.filter.all; if (next.selectCard == undefined) next.selectCard = [1, 1]; if (next.ai == undefined) next.ai = get.unuseful3; + next.autochoose = function () { + if (!this.forced) return false; + if (typeof this.selectCard == "function") return false; + return get.select(this.selectCard)[0] >= this.player.countCards(this.position); + }; next.setContent("chooseCard"); next._args = Array.from(arguments); return next;