From 62797a75bf2f57cd8555ea6912e8550509443503 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Sun, 21 Apr 2024 10:23:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=8F=E9=92=9F=E7=B9=87=E3=80=90=E8=AF=AB?= =?UTF-8?q?=E5=8E=89=E3=80=91bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/clan.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/character/clan.js b/character/clan.js index 4eaddce5c..9df46279e 100644 --- a/character/clan.js +++ b/character/clan.js @@ -241,9 +241,12 @@ game.import("character", function () { } map[get.cardNameLength(i)]++; } - const num2 = Object.keys(map).sort((a, b) => map[b] - map[a])[0]; - if (num >= num2) return target.countCards('h') * 5 * get.sgn(get.sgn(get.attitude(player, target)) - 0.5); - return -target.countCards('h'); + let list = Object.keys(map).sort((a, b) => map[b] - map[a]); + list = list.filter(i => map[i] == map[list[0]]).map(i => parseInt(i)); + if (num >= target.countCards("h", card => { + return list.includes(get.cardNameLength(card)); + })) return target.countCards("h") * 5 * get.sgn(get.sgn(get.attitude(player, target)) - 0.5); + return -target.countCards("h"); }).set('num', num).forResult(); }, async content(event, trigger, player) { @@ -263,8 +266,11 @@ game.import("character", function () { } map[get.cardNameLength(i)]++; } - const num2 = Object.keys(map).sort((a, b) => map[b] - map[a])[0]; - const cards = target.getCards("he", card => get.cardNameLength(card) == num2); + let list = Object.keys(map).sort((a, b) => map[b] - map[a]); + list = list.filter(i => map[i] == map[list[0]]).map(i => parseInt(i)); + const cards = target.getCards("h", card => { + return list.includes(get.cardNameLength(card)); + }); if (num > 0 && cards.length >= num) { const topCards = get.cards(num); game.updateRoundNumber();