From 5b14f043fdfbee000bc6985910ec303a72afa7a1 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Thu, 30 May 2024 22:44:22 +0800 Subject: [PATCH] =?UTF-8?q?OL=E6=9D=8E=E5=A9=89=E6=8A=80=E8=83=BD=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sp/character.js | 2 +- character/sp/skill.js | 156 ++++++++++++++++++++++++++++++++++++++ character/sp/translate.js | 4 + 3 files changed, 161 insertions(+), 1 deletion(-) diff --git a/character/sp/character.js b/character/sp/character.js index 71f6d26e0..a1fb3bd07 100644 --- a/character/sp/character.js +++ b/character/sp/character.js @@ -11,7 +11,7 @@ const characters = { tianchou: ["male", "qun", 4, ["olshandao"]], liyi: ["male", "wu", 4, ["olchanshuang", "olzhanjin"]], caoyu: ["male", "wei", 3, ["olgongjie", "olxiangxv", "olxiangzuo"]], - ol_liwan: ["female", "wei", 3, ["ollianju", "olsilv"]], + ol_liwan: ["female", "wei", 3, ["relianju", "resilv"]], ol_dingshangwan: ["female", "wei", 3, ["olfudao", "olfengyan"]], zhangyan: ["male", "qun", 4, ["olsuji", "ollangdao"]], ol_tw_zhangji: ["male", "wei", 3, ["skill_zhangji_A", "skill_zhangji_B"], ["unseen"]], diff --git a/character/sp/skill.js b/character/sp/skill.js index 89c24e91a..26e0f2914 100644 --- a/character/sp/skill.js +++ b/character/sp/skill.js @@ -2050,6 +2050,162 @@ const skills = { lose: { charlotte: true }, }, }, + relianju: { + audio: "ollianju", + trigger: { player: "phaseJieshuBegin" }, + filter(event, player) { + return player.hasHistory("useCard", evt => { + return (evt.cards || []).some(card => get.position(card, true) == "d"); + }); + }, + async cost(event, trigger, player) { + event.result = await player + .chooseTarget(get.prompt("relianju"), "令一名其他角色获得你本回合使用的且进入弃牌堆的至多两张颜色相同的牌", lib.filter.notMe) + .set("ai", target => { + const player = get.event("player"); + let att = get.attitude(_status.event.player, target); + if (target.hasJudge("lebu")) att /= 2; + if (target.hasSkillTag("nogain")) att /= 10; + return att / (1 + get.distance(player, target, "absolute")); + }) + .forResult(); + }, + async content(event, trigger, player) { + const cards = player + .getHistory("useCard", evt => { + return (evt.cards || []).some(card => get.position(card, true) == "d"); + }) + .reduce((sum, evt) => { + return sum.addArray(evt.cards.filter(card => get.position(card, true) == "d")); + }, []), + target = event.targets[0]; + const result = await player + .chooseButton(["联句:选择令" + get.translation(target) + "获得的牌", cards], [1, 2], true) + .set("filterButton", button => { + return !ui.selected.buttons.some(but => get.color(but.link) != get.color(button.link)); + }) + .set("ai", button => { + return get.value(button.link, get.event("target")); + }) + .set("target", target) + .forResult(); + if (result.bool) { + const color = get.color(result.links[0], false); + await target.gain(result.links, "gain2").set('gaintag', ["resilv"]); + player.when({ global: "phaseJieshuBegin" }) + .filter( + evt => + evt.player == target && + target.hasHistory("useCard", evt => { + return (evt.cards || []).some(card => get.position(card, true) == "d" && get.color(card) != color); + }) + ) + .then(() => { + const cards = trigger.player + .getHistory("useCard", evt => { + return (evt.cards || []).some(card => get.position(card, true) == "d" && get.color(card) != color); + }) + .reduce((sum, evt) => { + return sum.addArray(evt.cards.filter(card => get.position(card, true) == "d" && get.color(card) != color)); + }, []); + player + .chooseButton(["联句:请选择获得的牌", cards], [1, 2], true) + .set("filterButton", button => { + return !ui.selected.buttons.some(but => get.color(but.link) != get.color(button.link)); + }) + .set("ai", button => { + return get.value(button.link, get.event("target")); + }); + }) + .then(() => { + if (result.bool) { + player.gain(result.links, "gain2").gaintag.add("resilv"); + } + }) + .vars({ color: color }); + } + }, + }, + resilv: { + audio: "olsilv", + trigger: { player: "damageEnd" }, + forced: true, + content() { + player.draw().gaintag = ["resilv"]; + }, + group: "resilv_restore", + subSkill: { + restore: { + audio: "olsilv", + trigger: { global: ["loseAfter", "loseAsyncAfter"] }, + filter(event, player) { + if (event.type != "discard" || event.getlx === false) return false; + if (event.name == "lose") { + if (!event.player.isIn()) return false; + return event.cards2.some(card => { + return (event.gaintag_map[card.cardid] || []).includes("resilv") && get.position(card, true) == "d"; + }); + } + return game.hasPlayer(target => { + return target.hasHistory("lose", evt => { + if (evt.getParent() != event || evt.position != ui.discardPile) return false; + return evt.cards2.some(card => { + if (get.position(card, true) != "d") return false; + return (evt.gaintag_map[card.cardid] || []).includes("resilv"); + }); + }); + }); + }, + forced: true, + logTarget(event, player) { + if (event.name == "lose") return event.player; + return game + .filterPlayer(target => { + return target.hasHistory("lose", evt => { + if (evt.getParent() != event || evt.position != ui.discardPile) return false; + return evt.cards2.some(card => { + if (get.position(card, true) != "d") return false; + return evt.gaintag_map[card.cardid] && evt.gaintag_map[card.cardid].includes("resilv"); + }); + }); + }) + .sortBySeat(); + }, + async content(event, trigger, player) { + if (trigger.name == "lose") { + await trigger.player.gain( + trigger.cards2.filter(card => { + return (trigger.gaintag_map[card.cardid] || []).includes("resilv") && get.position(card, true) == "d"; + }), + "gain2" + ); + } else { + for (const target of lib.skill.resilv_restore.logTarget(trigger, player)) { + await target.gain( + target + .getHistory("lose", evt => { + if (evt.getParent() != trigger || evt.position != ui.discardPile) return false; + return evt.cards2.some(card => { + if (get.position(card, true) != "d") return false; + return (evt.gaintag_map[card.cardid] || []).includes("resilv"); + }); + }) + .reduce((sum, evt) => { + return sum.addArray( + evt.cards2.filter(card => { + if (get.position(card, true) != "d") return false; + return (evt.gaintag_map[card.cardid] || []).includes("resilv"); + }) + ); + }, []), + "gain2" + ); + } + } + }, + }, + }, + }, //丁尚涴 olfudao: { audio: 2, diff --git a/character/sp/translate.js b/character/sp/translate.js index e93d0f64b..2c22fb760 100644 --- a/character/sp/translate.js +++ b/character/sp/translate.js @@ -1189,6 +1189,10 @@ const translates = { ollianju_info: "结束阶段,你可以令一名其他角色获得你本回合使用的最后一张牌A对应的所有位于弃牌堆的实体牌并记录A的牌名,然后其下个结束阶段可以令你获得其本回合使用的最后一张牌B对应的所有位于弃牌堆的实体牌,然后若A与B的牌名相同,则你失去1点体力;若A与B的牌名不同,则你可以视为使用A。", olsilv: "思闾", olsilv_info: "锁定技,每回合每项限一次,当你获得或失去你发动〖联句〗记录的最后一次牌名的同名牌后,你展示这些牌,然后摸一张牌。", + relianju: "联句", + relianju_info: "结束阶段,你可以令一名其他角色获得你本回合使用的至多两张位于弃牌堆且颜色相同的牌,称为“思闾”,然后你于其下个结束阶段获得其本回合使用的至多两张不同于此颜色的位于弃牌堆且颜色相同且颜色的牌,称为“思闾”。", + resilv: "思闾", + resilv_info: "锁定技。①当你受到伤害后,你摸一张牌,称为“思闾”。②一名角色因弃置“思闾”牌使“思闾”牌进入弃牌堆后,其获得之。", xueji_old: "血祭", xueji_old_info: "出牌阶段限一次,你可以弃置一张红色牌并对攻击范围内的至多X名角色各造成1点伤害(X为你已损失的体力值),然后这些角色各摸一张牌。", oldhuxiao: "虎啸",