From 02ad755d743f8d340ca61659b444f9f205fce9ca Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Sat, 1 Jun 2024 18:21:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E6=9D=80=E8=B0=8B=E8=B0=8B=E5=85=B3?= =?UTF-8?q?=E5=B9=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/xianding/character.js | 1 + character/xianding/skill.js | 95 +++++++++++++++++++++++++++ character/xianding/sort.js | 2 +- character/xianding/translate.js | 4 ++ character/yijiang/characterReplace.js | 2 +- 5 files changed, 102 insertions(+), 2 deletions(-) diff --git a/character/xianding/character.js b/character/xianding/character.js index f794b5d70..e89921651 100644 --- a/character/xianding/character.js +++ b/character/xianding/character.js @@ -1,4 +1,5 @@ const characters = { + dc_sb_guanping: ["male", "shu", 4, ["dcsbwuwei"]], dc_sb_caoang: ["male", "wei", 4, ["dcsbfengmin", "dcsbzhiwang", "dcsbjueying"]], dc_caoshuang: ["male", "wei", 4, ["dcjianzhuan", "dcfanshi"]], dc_simashi: ["male", "wei", 3, ["dcsanshi", "dczhenrao", "dcchenlve"]], diff --git a/character/xianding/skill.js b/character/xianding/skill.js index e2aefd9bb..7a6eec614 100644 --- a/character/xianding/skill.js +++ b/character/xianding/skill.js @@ -3,6 +3,101 @@ import cards from "../sp2/card.js"; /** @type { importCharacterConfig['skill'] } */ const skills = { + //关平 + dcsbwuwei: { + audio: 2, + enable: "phaseUse", + filter(event, player) { + const count = player.getStat("skill").dcsbwuwei; + if (count && count > player.countMark("dcsbwuwei_count")) return false; + const colors = player.getCards("h").reduce((list, card) => list.add(get.color(card)), []); + return colors.some(color => event.filterCard(get.autoViewAs(lib.skill.dcsbwuwei.viewAs, player.getCards("h", { color: color })), player, event)); + }, + viewAs: { name: "sha", storage: { dcsbwuwei: true } }, + locked: false, + mod: { + targetInRange(card) { + if (card.storage && card.storage.dcsbwuwei) return true; + }, + cardUsable(card, player, num) { + if (card.storage && card.storage.dcsbwuwei) return Infinity; + }, + }, + filterCard: () => false, + selectCard: -1, + async precontent(event, _, player) { + let colors = player.getCards("h").reduce((list, card) => list.add(get.color(card)), []), + evt = event.getParent(); + colors = colors.filter(color => evt.filterCard(get.autoViewAs(lib.skill.dcsbwuwei.viewAs, player.getCards("h", { color: color })), player, evt)); + colors = colors.map(color => (color == "none" ? "none2" : color)); + const result = await player.chooseControl(colors, "cancel2").set("prompt", "武威:将一种颜色的所有手牌当作【杀】使用").forResult(); + const color = result.control == "none2" ? "none" : result.control; + if (color == "cancel2") { + evt.goto(0); + return; + } + player.addTempSkill("dcsbwuwei_effect"); + event.result.cards = player.getCards("h", { color: color }); + event.result.card.cards = player.getCards("h", { color: color }); + }, + ai: { + order(item, player) { + return get.order({ name: "sha" }, player) - 0.001; + }, + }, + subSkill: { + effect: { + charlotte: true, + trigger: { player: "useCard" }, + filter(event, player) { + return (event.card.storage || {}).dcsbwuwei && (event.cards || []).length; + }, + forced: true, + popup: false, + async content(event, trigger, player) { + let result, + types = trigger.cards.reduce((list, card) => list.add(get.type(card, player)), []); + if (types.length >= 3) { + result = { bool: true, links: [0, 1, 2] }; + } else { + result = await player + .chooseButton(["武威:请选择" + get.cnNumber(types.length) + "项执行", [["摸一张牌", "令目标角色本回合非锁定技失效", "令本回合〖武威〗可发动次数+1"].map((item, i) => [i, item]), "textbutton"]]) + .set("forced", true) + .set("selectButton", types.length) + .set("ai", button => { + return [1, 3, 2].slice(0, get.event("selectButton")).includes(button.link) ? 1 : 0; + }) + .forResult(); + } + if (result.bool) { + result.links.sort((a, b) => a - b); + for (const i of result.links) { + game.log(player, "选择了", "#g【武威】", "的", "#y第" + get.cnNumber(i + 1, true) + "项"); + } + if (result.links.includes(0)) await player.draw(); + if (result.links.includes(1)) { + for (const target of trigger.targets || []) { + target.addTempSkill("fengyin"); + } + } + if (result.links.includes(2)) { + player.addTempSkill("dcsbwuwei_count"); + player.addMark("dcsbwuwei_count", 1, false); + } + if (result.links.length == 3) { + trigger.baseDamage++; + game.log(trigger.card, "造成的伤害", "#y+1"); + } + } + }, + }, + count: { + charlotte: true, + onremove: true, + intro: { content: "本回合〖武威〗可发动次数+#" }, + }, + }, + }, //曹昂 dcsbfengmin: { audio: 2, diff --git a/character/xianding/sort.js b/character/xianding/sort.js index 5ea17de15..5c353c6fc 100644 --- a/character/xianding/sort.js +++ b/character/xianding/sort.js @@ -16,7 +16,7 @@ const characterSort = { sp2_mouding: ["dc_sb_jiaxu", "dc_sb_lusu", "dc_sb_zhouyu", "dc_sb_simayi"], sp2_zhonghu: ["dc_jiangji", "dc_wangling", "dc_simashi", "dc_caoshuang"], sp2_zijing: ["dc_sb_zhugejin"], - sp2_waitingforsort: ["dc_sb_caoang"], + sp2_waitingforsort: ["dc_sb_caoang", "dc_sb_guanping"], }; const characterSortTranslate = { diff --git a/character/xianding/translate.js b/character/xianding/translate.js index 4c1244182..5b016aaca 100644 --- a/character/xianding/translate.js +++ b/character/xianding/translate.js @@ -623,6 +623,10 @@ const translates = { dcsbzhiwang_info: "每回合限一次,当你因受到牌造成的伤害进入濒死状态时,你可以将此伤害改为无来源并选择一名其他角色,其于本回合结束时可以使用本回合令你进入濒死状态的牌。", dcsbjueying: "绝影", dcsbjueying_info: "当你受到伤害时,你可以弃置装备区里的【绝影】,然后防止此伤害。", + dc_sb_guanping: "新杀谋关平", + dc_sb_guanping_prefix: "新杀谋", + dcsbwuwei: "武威", + dcsbwuwei_info: "出牌阶段限一次,你可以将一种颜色的所有手牌当作无距离和次数限制的【杀】使用,然后你选择执行以下X项(X为转化为此【杀】的牌的类别数):①摸一张牌;②令目标角色本回合非锁定技失效;③令本回合〖武威〗可发动次数+1。然后若你执行了所有项,则此【杀】造成的伤害+1。", }; export default translates; diff --git a/character/yijiang/characterReplace.js b/character/yijiang/characterReplace.js index 810c3ec2d..7366501b1 100644 --- a/character/yijiang/characterReplace.js +++ b/character/yijiang/characterReplace.js @@ -48,7 +48,7 @@ const characterReplaces = { gongsunyuan: ["gongsunyuan", "re_gongsunyuan"], zhoucang: ["zhoucang", "re_zhoucang", "xin_zhoucang"], guotufengji: ["guotufengji", "re_guotufengji"], - guanping: ["guanping", "re_guanping"], + guanping: ["guanping", "re_guanping", "dc_sb_guanping"], caifuren: ["caifuren", "re_caifuren", "xin_caifuren"], guyong: ["guyong", "re_guyong", "xin_guyong", "tw_guyong"], yj_jushou: ["yj_jushou", "re_jushou", "xin_jushou"],