chooseCard添加autochoose

This commit is contained in:
mengxinzxz 2024-04-18 20:01:49 +08:00
parent 9976b982d4
commit e7eca38ef4
2 changed files with 15 additions and 0 deletions

View File

@ -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();

View File

@ -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;