chooseCard添加autochoose
This commit is contained in:
parent
9976b982d4
commit
e7eca38ef4
|
@ -5296,6 +5296,16 @@ export const Content = {
|
||||||
bool: true,
|
bool: true,
|
||||||
links: [],
|
links: [],
|
||||||
};
|
};
|
||||||
|
} else if (event.autochoose()) {
|
||||||
|
event.result = {
|
||||||
|
bool: true,
|
||||||
|
autochoose: true,
|
||||||
|
cards: player.getCards(event.position),
|
||||||
|
confirm: "ok",
|
||||||
|
buttons: [],
|
||||||
|
targets: [],
|
||||||
|
links: [],
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
if (event.isMine()) {
|
if (event.isMine()) {
|
||||||
game.check();
|
game.check();
|
||||||
|
|
|
@ -4776,6 +4776,11 @@ export class Player extends HTMLDivElement {
|
||||||
if (next.filterCard == undefined) next.filterCard = lib.filter.all;
|
if (next.filterCard == undefined) next.filterCard = lib.filter.all;
|
||||||
if (next.selectCard == undefined) next.selectCard = [1, 1];
|
if (next.selectCard == undefined) next.selectCard = [1, 1];
|
||||||
if (next.ai == undefined) next.ai = get.unuseful3;
|
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.setContent("chooseCard");
|
||||||
next._args = Array.from(arguments);
|
next._args = Array.from(arguments);
|
||||||
return next;
|
return next;
|
||||||
|
|
Loading…
Reference in New Issue