From e209f58c8974dd1bfe065ab4fbb04516c0c089cb Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Wed, 8 May 2024 18:47:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=95=8C=E8=99=9E=E7=BF=BB=E3=80=90?= =?UTF-8?q?=E7=BA=B5=E7=8E=84=E3=80=91=E4=BF=AE=E6=94=B9=EF=BC=8Ccharacter?= =?UTF-8?q?\onlyOL\skill.js=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/onlyOL/skill.js | 13 ++++++++++++- character/onlyOL/translate.js | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/character/onlyOL/skill.js b/character/onlyOL/skill.js index a6d981727..a0634a4cb 100644 --- a/character/onlyOL/skill.js +++ b/character/onlyOL/skill.js @@ -311,7 +311,18 @@ const skills = { let cards = []; for (const target of [player, player.getPrevious()]) { const evt = event.getl(target); - if (evt && evt.cards2 && evt.cards2.some(i => get.position(i) == "d")) cards.addArray(evt.cards2.filter(i => get.position(i) == "d")); + if (evt && evt.cards2 && evt.cards2.some(i => get.position(i) == "d")) { + if ( + target == player || + target + .getHistory("lose", evt => { + return evt.type == "discard" && evt.getlx !== false; + }) + .indexOf(event) == 0 + ) { + cards.addArray(evt.cards2.filter(i => get.position(i) == "d")); + } + } } return cards; }, diff --git a/character/onlyOL/translate.js b/character/onlyOL/translate.js index b593a0622..1854ec216 100644 --- a/character/onlyOL/translate.js +++ b/character/onlyOL/translate.js @@ -57,7 +57,7 @@ const translates = { ol_yufan: "OL界虞翻", ol_yufan_prefix: "OL界", olzongxuan: "纵玄", - olzongxuan_info: "当你或你的上家因弃置而失去牌后,你可以将位于弃牌堆的这些牌中的任意牌以任意顺序置于牌堆顶。", + olzongxuan_info: "当你弃置而失去牌后,或你的上家每回合因弃置首次失去牌后,你可以将位于弃牌堆的这些牌中的任意牌以任意顺序置于牌堆顶。", olzhiyan: "直言", olzhiyan_info: "你或你的上家的结束阶段,你可以令一名角色正面朝上摸一张牌,然后若此牌:为装备牌,则其使用此牌并回复1点体力;不为装备牌且其体力值大于等于你,则其失去1点体力。", ol_chengpu: "OL界程普", From 8306c04c9df938b4f433ef8356d74912846cbb86 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Wed, 8 May 2024 18:50:11 +0800 Subject: [PATCH 2/4] =?UTF-8?q?Revert=20"=E7=95=8C=E8=99=9E=E7=BF=BB?= =?UTF-8?q?=E3=80=90=E7=BA=B5=E7=8E=84=E3=80=91=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?character\onlyOL\skill.js=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/onlyOL/skill.js | 13 +------------ character/onlyOL/translate.js | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/character/onlyOL/skill.js b/character/onlyOL/skill.js index a0634a4cb..a6d981727 100644 --- a/character/onlyOL/skill.js +++ b/character/onlyOL/skill.js @@ -311,18 +311,7 @@ const skills = { let cards = []; for (const target of [player, player.getPrevious()]) { const evt = event.getl(target); - if (evt && evt.cards2 && evt.cards2.some(i => get.position(i) == "d")) { - if ( - target == player || - target - .getHistory("lose", evt => { - return evt.type == "discard" && evt.getlx !== false; - }) - .indexOf(event) == 0 - ) { - cards.addArray(evt.cards2.filter(i => get.position(i) == "d")); - } - } + if (evt && evt.cards2 && evt.cards2.some(i => get.position(i) == "d")) cards.addArray(evt.cards2.filter(i => get.position(i) == "d")); } return cards; }, diff --git a/character/onlyOL/translate.js b/character/onlyOL/translate.js index 1854ec216..b593a0622 100644 --- a/character/onlyOL/translate.js +++ b/character/onlyOL/translate.js @@ -57,7 +57,7 @@ const translates = { ol_yufan: "OL界虞翻", ol_yufan_prefix: "OL界", olzongxuan: "纵玄", - olzongxuan_info: "当你弃置而失去牌后,或你的上家每回合因弃置首次失去牌后,你可以将位于弃牌堆的这些牌中的任意牌以任意顺序置于牌堆顶。", + olzongxuan_info: "当你或你的上家因弃置而失去牌后,你可以将位于弃牌堆的这些牌中的任意牌以任意顺序置于牌堆顶。", olzhiyan: "直言", olzhiyan_info: "你或你的上家的结束阶段,你可以令一名角色正面朝上摸一张牌,然后若此牌:为装备牌,则其使用此牌并回复1点体力;不为装备牌且其体力值大于等于你,则其失去1点体力。", ol_chengpu: "OL界程普", From f3d89f3da4c2730d1ca94c29421425ddfcb99253 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Wed, 8 May 2024 18:50:57 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=95=8C=E8=99=9E=E7=BF=BB=E3=80=90?= =?UTF-8?q?=E7=BA=B5=E7=8E=84=E3=80=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/onlyOL/skill.js | 13 ++++++++++++- character/onlyOL/translate.js | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/character/onlyOL/skill.js b/character/onlyOL/skill.js index a6d981727..a0634a4cb 100644 --- a/character/onlyOL/skill.js +++ b/character/onlyOL/skill.js @@ -311,7 +311,18 @@ const skills = { let cards = []; for (const target of [player, player.getPrevious()]) { const evt = event.getl(target); - if (evt && evt.cards2 && evt.cards2.some(i => get.position(i) == "d")) cards.addArray(evt.cards2.filter(i => get.position(i) == "d")); + if (evt && evt.cards2 && evt.cards2.some(i => get.position(i) == "d")) { + if ( + target == player || + target + .getHistory("lose", evt => { + return evt.type == "discard" && evt.getlx !== false; + }) + .indexOf(event) == 0 + ) { + cards.addArray(evt.cards2.filter(i => get.position(i) == "d")); + } + } } return cards; }, diff --git a/character/onlyOL/translate.js b/character/onlyOL/translate.js index b593a0622..1854ec216 100644 --- a/character/onlyOL/translate.js +++ b/character/onlyOL/translate.js @@ -57,7 +57,7 @@ const translates = { ol_yufan: "OL界虞翻", ol_yufan_prefix: "OL界", olzongxuan: "纵玄", - olzongxuan_info: "当你或你的上家因弃置而失去牌后,你可以将位于弃牌堆的这些牌中的任意牌以任意顺序置于牌堆顶。", + olzongxuan_info: "当你弃置而失去牌后,或你的上家每回合因弃置首次失去牌后,你可以将位于弃牌堆的这些牌中的任意牌以任意顺序置于牌堆顶。", olzhiyan: "直言", olzhiyan_info: "你或你的上家的结束阶段,你可以令一名角色正面朝上摸一张牌,然后若此牌:为装备牌,则其使用此牌并回复1点体力;不为装备牌且其体力值大于等于你,则其失去1点体力。", ol_chengpu: "OL界程普", From e336008638c4bbd6a4e598adda71bac71e2bb240 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Wed, 8 May 2024 18:53:19 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=97=8F=E9=92=9F=E4=BC=9A=E3=80=90?= =?UTF-8?q?=E8=BF=82=E5=BF=97=E3=80=91minor=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/clan/skill.js | 86 ++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/character/clan/skill.js b/character/clan/skill.js index 778eb456c..37903f9e3 100644 --- a/character/clan/skill.js +++ b/character/clan/skill.js @@ -1017,20 +1017,13 @@ const skills = { content() { "step 0"; player.unmarkSkill("clanyuzhi"); - if ( - player.countCards("h", card => { - return card.hasGaintag("clanyuzhi") && lib.filter.cardDiscardable(card, player); - }) - ) { + const cards = player.getCards("h", card => { + return card.hasGaintag("clanyuzhi") && lib.filter.cardDiscardable(card, player); + }); + if (cards.length) { event.logged = true; - player.chooseToDiscard( - player.countCards("h"), - "h", - (card, player) => { - return card.hasGaintag("clanyuzhi"); - }, - true - ).logSkill = "clanyuzhi"; + player.logSkill("clanyuzhi"); + player.discard(cards); } "step 1"; player.removeGaintag("clanyuzhi"); @@ -2186,13 +2179,10 @@ const skills = { "step 6"; var current = targets.shift(); current - .chooseToUse( - function (card, player, event) { - if (get.name(card) != "sha") return false; - return lib.filter.filterCard.apply(this, arguments); - }, - "联诛:是否对" + get.translation(event.targetx) + "使用一张杀?" - ) + .chooseToUse(function (card, player, event) { + if (get.name(card) != "sha") return false; + return lib.filter.filterCard.apply(this, arguments); + }, "联诛:是否对" + get.translation(event.targetx) + "使用一张杀?") .set("targetRequired", true) .set("complexSelect", true) .set("filterTarget", function (card, player, target) { @@ -2355,21 +2345,24 @@ const skills = { filter(event, player) { return game.hasPlayer(current => player.canCompare(current)); }, - async cost(event, trigger, player){ - event.result = await player.chooseTarget(get.prompt("clanliuju"), "与一名其他角色拼点,输的角色可以使用任意张拼点牌中的非基本牌", (card, player, target) => { - return player.canCompare(target); - }).set("ai", target => { - var player = _status.event.player; - var ts = target.getCards("h").sort((a, b) => get.number(a) - get.number(b)); - if (get.attitude(player, target) < 0) { - var hs = player.getCards("h").sort((a, b) => get.number(a) - get.number(b)); - if (!hs.length || !ts.length) return 0; - if (get.type(hs[0], null, false) == "basic" && get.value(hs[0]) > 6) return 0; - if (get.number(hs[0]) < get.number(ts[0]) || get.type(hs[0], null, false) == "basic") return 1; - return Math.random() - 0.7; - } - return get.type(ts[0]) != "basic"; - }).forResult(); + async cost(event, trigger, player) { + event.result = await player + .chooseTarget(get.prompt("clanliuju"), "与一名其他角色拼点,输的角色可以使用任意张拼点牌中的非基本牌", (card, player, target) => { + return player.canCompare(target); + }) + .set("ai", target => { + var player = _status.event.player; + var ts = target.getCards("h").sort((a, b) => get.number(a) - get.number(b)); + if (get.attitude(player, target) < 0) { + var hs = player.getCards("h").sort((a, b) => get.number(a) - get.number(b)); + if (!hs.length || !ts.length) return 0; + if (get.type(hs[0], null, false) == "basic" && get.value(hs[0]) > 6) return 0; + if (get.number(hs[0]) < get.number(ts[0]) || get.type(hs[0], null, false) == "basic") return 1; + return Math.random() - 0.7; + } + return get.type(ts[0]) != "basic"; + }) + .forResult(); }, content() { "step 0"; @@ -2381,9 +2374,12 @@ const skills = { var loser = result.bool ? target : player; var cards = []; game.getGlobalHistory("cardMove", evt => { - if (evt.getParent(2).name === "chooseToCompare" && evt.getParent(3) === event) cards.addArray(evt.cards.filter(i => { - return get.position(i, true) == "d" && get.type(i, null, false) != "basic"; - })); + if (evt.getParent(2).name === "chooseToCompare" && evt.getParent(3) === event) + cards.addArray( + evt.cards.filter(i => { + return get.position(i, true) == "d" && get.type(i, null, false) != "basic"; + }) + ); }); event.loser = loser; event.distance = [get.distance(player, target), get.distance(target, player)]; @@ -2393,11 +2389,15 @@ const skills = { "step 2"; var cardsx = cards.filter(i => get.position(i, true) == "d" && event.loser.hasUseTarget(i)); if (!cardsx.length) event.goto(6); - else event.loser.chooseButton(["留驹:是否使用其中的一张牌?", cardsx]).set("filterButton", button => { - return _status.event.player.hasUseTarget(button.link); - }).set("ai", button => { - return _status.event.player.getUseValue(button.link) + 0.1; - }); + else + event.loser + .chooseButton(["留驹:是否使用其中的一张牌?", cardsx]) + .set("filterButton", button => { + return _status.event.player.hasUseTarget(button.link); + }) + .set("ai", button => { + return _status.event.player.getUseValue(button.link) + 0.1; + }); "step 3"; if (result.bool) { var card = result.links[0];