From b4e13aea5d00daa42ea55ee562c7cbb640bc0430 Mon Sep 17 00:00:00 2001 From: kuangthree Date: Sat, 6 Apr 2024 14:35:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E5=A4=84=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E4=B8=8D=E6=BB=A1=E8=B6=B3=E6=9D=A1=E4=BB=B6return;?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/library/element/player.js | 55 +++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/noname/library/element/player.js b/noname/library/element/player.js index 91f3d5ae3..c401366a6 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -5249,7 +5249,6 @@ export class Player extends HTMLDivElement { } drawTo(num, args) { var num2 = num - this.countCards('h'); - if (!num2) return; var next = this.draw(num2); if (Array.isArray(args)) { for (var i = 0; i < args.length; i++) { @@ -5941,8 +5940,11 @@ export class Player extends HTMLDivElement { return next; } doubleDraw() { - if (get.is.changban()) return; var next = game.createEvent('doubleDraw'); + if (get.is.changban()) { + _status.event.next.remove(next); + next.resolve(); + } next.player = this; next.setContent('doubleDraw'); return next; @@ -6421,18 +6423,24 @@ export class Player extends HTMLDivElement { return next; } turnOver(bool) { - if (typeof bool == 'boolean') { - if (bool) { - if (this.isTurnedOver()) return; - } - else { - if (!this.isTurnedOver()) return; - } - } var next = game.createEvent('turnOver'); next.player = this; next.includeOut = true; next.setContent('turnOver'); + if (typeof bool == 'boolean') { + if (bool) { + if (this.isTurnedOver()){ + _status.event.next.remove(next); + next.resolve(); + } + } + else { + if (!this.isTurnedOver()){ + _status.event.next.remove(next); + next.resolve(); + } + } + } return next; } out(skill) { @@ -6483,17 +6491,23 @@ export class Player extends HTMLDivElement { } } link(bool) { - if (typeof bool == 'boolean') { - if (bool) { - if (this.isLinked()) return; - } - else { - if (!this.isLinked()) return; - } - } var next = game.createEvent('link'); next.player = this; next.setContent('link'); + if (typeof bool == 'boolean') { + if (bool) { + if (this.isLinked()){ + _status.event.next.remove(next); + next.resolve(); + } + } + else { + if (!this.isLinked()){ + _status.event.next.remove(next); + next.resolve(); + } + } + } return next; } skip(name) { @@ -7377,11 +7391,14 @@ export class Player extends HTMLDivElement { return next; } exitSubPlayer(remove) { - if (!this.hasSkill('subplayer')) return; var next = game.createEvent('exitSubPlayer'); next.player = this; next.remove = remove; next.setContent('exitSubPlayer'); + if (!this.hasSkill('subplayer')) { + _status.event.next.remove(next); + next.resolve(); + } return next; } getSubPlayers(tag) {