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]; 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界程普",