From e164f9fdb02335b35341c3b92339c078332c9340 Mon Sep 17 00:00:00 2001 From: copcap Date: Sat, 18 May 2024 20:02:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9tempBanSkill=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BD=BF=E5=85=B6=E5=8F=AF=E6=B0=B8=E4=B9=85=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E6=8A=80=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/library/element/content.js | 4 ++-- noname/library/element/player.js | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/noname/library/element/content.js b/noname/library/element/content.js index a367e9ed8..447d1dd65 100644 --- a/noname/library/element/content.js +++ b/noname/library/element/content.js @@ -5604,7 +5604,7 @@ export const Content = { controls.remove("cancel2"); if ((event.direct && controls.length == 1) || event.forceDirect) { event.result = { - control: event.controls[0].link, + control: event.controls[0], links: get.links([event.controls[0]]), }; return; @@ -5620,7 +5620,7 @@ export const Content = { controls.remove("cancel2"); if ((event.direct && controls.length == 1) || event.forceDirect) { event.result = { - control: event.controls[0].link, + control: event.controls[0], links: get.links([event.controls[0]]), }; return; diff --git a/noname/library/element/player.js b/noname/library/element/player.js index 41e074e0f..5ddfae65d 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -8037,19 +8037,21 @@ export class Player extends HTMLDivElement { if (log !== false && this.hasSkill(skill)) game.log(this, "的技能", `#g【${get.translation(skill)}】`, "暂时失效了"); - if (!expire) expire = { global: ["phaseAfter", "phaseBeforeStart"] }; - else if (typeof expire == "string" || Array.isArray(expire)) expire = { global: expire }; - this.when(expire, false) - .assign({ - firstDo: true, - }) - .vars({ - bannedSkill: skill, - }) - .then(() => { - delete player.storage[`temp_ban_${bannedSkill}`]; - }) - .finish(); + if (expire !== "forever") { + if (!expire) expire = { global: ["phaseAfter", "phaseBeforeStart"] }; + else if (typeof expire == "string" || Array.isArray(expire)) expire = { global: expire }; + this.when(expire, false) + .assign({ + firstDo: true, + }) + .vars({ + bannedSkill: skill, + }) + .then(() => { + delete player.storage[`temp_ban_${bannedSkill}`]; + }) + .finish(); + } } return skill; }