diff --git a/character/onlyOL/character.js b/character/onlyOL/character.js index 76cabc879..aede05c36 100644 --- a/character/onlyOL/character.js +++ b/character/onlyOL/character.js @@ -10,6 +10,7 @@ const characters = { ol_yufan: ["male", "wu", 3, ["olzongxuan", "olzhiyan"], ["tempname:re_yufan", "die_audio:re_yufan"]], ol_chengpu: ["male", "wu", 4, ["dclihuo", "olchunlao"], ["tempname:xin_chengpu", "die_audio:xin_chengpu"]], ol_wangyi: ["female", "wei", 3, ["olzhenlie", "olmiji"]], + ol_fazheng: ["male", "shu", 3, ["olxuanhuo", "olenyuan"]], }; export default characters; diff --git a/character/onlyOL/skill.js b/character/onlyOL/skill.js index e74b82a59..38136f8d2 100644 --- a/character/onlyOL/skill.js +++ b/character/onlyOL/skill.js @@ -2,6 +2,134 @@ import { lib, game, ui, get, ai, _status } from "../../noname.js"; /** @type { importCharacterConfig['skill'] } */ const skills = { + //法正 + olxuanhuo: { + audio: 2, + trigger: { player: "phaseDrawEnd" }, + filter(event, player) { + return player.countCards("he") > 1 && game.hasPlayer(target => target != player); + }, + async cost(event, trigger, player) { + const ai2 = function (target) { + const player = _status.event.player; + if ( + !game.hasPlayer(current => { + return current != player && current != target; + }) + ) + return get.effect(target, new lib.element.VCard({ name: "shunshou_copy2" }), player, player); + if (get.attitude(player, target) <= 0) return 0; + const num = target.getUseValue(new lib.element.VCard({ name: "sha" }), false); + if (target.hasSkillTag("nogain")) num /= 4; + return num; + }; + event.result = await player + .chooseCardTarget({ + prompt: get.prompt2("olxuanhuo"), + filterCard: true, + selectCard: 2, + position: "he", + filterTarget: lib.filter.notMe, + goon: game.hasPlayer(function (current) { + return current != player && ai2(player, current) > 0; + }), + ai1(card) { + if (!_status.event.goon && game.countPlayer(target => target != _status.event.player) > 1) return 0; + return 7 - get.value(card); + }, + ai2: ai2, + }) + .forResult(); + }, + async content(event, trigger, player) { + const target = event.targets[0]; + await player.give(event.cards, target); + if ( + game.hasPlayer(function (current) { + return current != player && current != target; + }) + ) { + const result2 = await player + .chooseTarget( + function (card, player, target) { + return target != player && target != _status.event.target; + }, + "请选择" + get.translation(target) + "使用【杀】的目标", + true + ) + .set("target", target) + .set("ai", function (target) { + const evt = _status.event, + card = new lib.element.VCard({ name: "sha" }); + if (!evt.target.canUse(card, target, false)) return 0; + return get.effect(target, card, evt.target, evt.player); + }) + .set("target", target) + .forResult(); + if (result2.bool) { + const target2 = result2.targets[0]; + const sha = new lib.element.VCard({ name: "sha" }); + player.line(target2); + if (target.canUse(sha, target2, false)) { + const index = await target + .chooseControl() + .set("choiceList", ["视为对" + get.translation(target2) + "使用一张【杀】", "令" + get.translation(player) + "观看你的手牌并获得你的两张牌"]) + .set("ai", () => { + const player = get.event("player"), + target = get.event("target"), + source = get.event("source"); + const sha = new lib.element.VCard({ name: "sha" }), + shunshou = new lib.element.VCard({ name: "shunshou_copy2" }); + return get.effect(target, sha, player, player) > get.effect(player, shunshou, source, player) * Math.min(2, player.countGainableCards(source, "he")) ? 0 : 1; + }) + .set("source", player) + .set("target", target2) + .forResult("index"); + if (index == 0) { + await target.useCard(sha, false, target2); + return; + } + } + } + } + await player.gainPlayerCard(target, 2, "he", true, "visible"); + }, + ai: { expose: 0.15 }, + }, + olenyuan: { + audio: 2, + group: ["olenyuan1", "olenyuan2"], + }, + olenyuan1: { + inherit: "xinenyuan1", + }, + olenyuan2: { + inherit: "xinenyuan2", + prompt2: event => "令" + get.translation(event.source) + "交给你一张红色手牌或失去1点体力", + getIndex: event => event.num, + async content(event, trigger, player) { + const result = await trigger.source + .chooseToGive( + "恩怨:交给" + get.translation(player) + "一张红色手牌,或失去1点体力", + (card, player) => { + return get.color(card) == "red"; + }, + "h", + player + ) + .set("ai", card => { + const player = _status.event.getParent().player, + source = _status.event.player; + if (get.effect(source, { name: "losehp" }, source, source) >= 0) return 0; + if (get.attitude(player, source) > 0) return 11 - get.value(card); + return 7 - get.value(card); + }) + .forResult(); + if (!result.bool) { + await trigger.source.loseHp(); + } + }, + }, //王异 olzhenlie: { audio: 2, @@ -1425,13 +1553,12 @@ const skills = { olqiaoshui: { audio: "reqiaoshui", inherit: "reqiaoshui", - filter: function (event, player) { + filter(event, player) { return player.countCards("h") > 0 && !player.hasSkill("olqiaoshui_used"); }, - content: function () { - "step 0"; - player.chooseToCompare(target); - "step 1"; + async content(event, trigger, player) { + const target = event.target; + const result = await player.chooseToCompare(target).forResult(); if (result.bool) player.addTempSkill("qiaoshui3", { player: "phaseUseAfter" }); else { player.addTempSkill("qiaoshui2"); @@ -1459,35 +1586,26 @@ const skills = { player: ["loseAfter"], global: ["equipAfter", "addJudgeAfter", "gainAfter", "loseAsyncAfter", "addToExpansionAfter"], }, - filter: function (event, player) { - var evt = event.getl(player); + filter(event, player) { + const evt = event.getl(player); return evt && (evt.es.length || evt.cards2.length > 1); }, - direct: true, - content: function () { - "step 0"; - event.count = 2; - event.logged = false; - "step 1"; - player - .chooseTarget(get.prompt("olxuanfeng"), "弃置一名其他角色的一张牌", function (card, player, target) { + getIndex: () => 2, + async cost(event, trigger, player) { + event.result = await player + .chooseTarget(get.prompt("olxuanfeng"), "弃置一名其他角色的一张牌", (card, player, target) => { if (player == target) return false; return target.countDiscardableCards(player, "he"); }) - .set("ai", function (target) { - return -get.attitude(_status.event.player, target); - }); - "step 2"; - if (result.bool) { - if (!event.logged) { - player.logSkill("olxuanfeng", result.targets); - event.logged = true; - } else player.line(result.targets[0], "green"); - player.discardPlayerCard(result.targets[0], "he", true); - event.count--; - } else event.finish(); - "step 3"; - if (event.count) event.goto(1); + .set("ai", target => { + const player = get.event("player"); + return get.effect(target, { name: "guohe_copy2" }, player, player); + }) + .forResult(); + }, + content() { + const target = event.targets[0]; + player.discardPlayerCard(target, "he", true); }, ai: { reverseEquip: true, diff --git a/character/onlyOL/sort.js b/character/onlyOL/sort.js index 0756254df..5605b582e 100644 --- a/character/onlyOL/sort.js +++ b/character/onlyOL/sort.js @@ -1,5 +1,5 @@ const characterSort = { - onlyOL_yijiang1: ["ol_jianyong", "ol_lingtong", "ol_gaoshun"], + onlyOL_yijiang1: ["ol_jianyong", "ol_lingtong", "ol_gaoshun", "ol_fazheng"], onlyOL_yijiang2: ["ol_caozhang", "ol_chengpu", "ol_wangyi"], onlyOL_yijiang3: ["ol_yufan"], onlyOL_sb: ["ol_sb_jiangwei", "ol_sb_guanyu", "ol_sb_taishici", "ol_sb_yuanshao"], diff --git a/character/onlyOL/translate.js b/character/onlyOL/translate.js index d33be95a9..906d8896d 100644 --- a/character/onlyOL/translate.js +++ b/character/onlyOL/translate.js @@ -72,6 +72,14 @@ const translates = { olzhenlie_info: "当你成为其他角色使用【杀】或普通锦囊牌的目标后,你可以失去1点体力并令此牌对你无效,然后你选择一项:①获得使用者的一张牌;②发动一次〖秘计〗。", olmiji: "秘计", olmiji_info: "结束阶段,若你已受伤,则你可以摸X张牌,然后你可以将至多X张牌任意分配给其他角色(X为你已损失的体力值)。", + ol_fazheng:'OL界法正', + ol_fazheng_prefix:'OL界', + olxuanhuo:'眩惑', + olxuanhuo_info:'摸牌阶段结束时,你可以交给一名其他角色两张牌,然后其选择一项:1.视为对你选择的另一名其他角色使用一张【杀】,2.令你观看并获得其两张牌。', + olenyuan:'恩怨', + olenyuan1:'恩怨', + olenyuan2:'恩怨', + olenyuan_info:'①当你一次性获得一名其他角色超过一张牌后,你可以令其摸一张牌。②当你受到1点伤害后,你可以令伤害来源选择一项:1.将一张红色手牌交给你;2.失去1点体力。', }; export default translates; diff --git a/character/rank.js b/character/rank.js index c6643945b..c91679c5f 100644 --- a/character/rank.js +++ b/character/rank.js @@ -586,6 +586,7 @@ window.noname_character_rank = { "wangrong", "re_fazheng", "tw_re_fazheng", + "ol_fazheng", "huaxin", "re_chunyuqiong", "ns_luyusheng", @@ -2532,6 +2533,7 @@ window.noname_character_rank = { "zhanghuyuechen", "re_fazheng", "tw_re_fazheng", + "ol_fazheng", "re_fuhuanghou", "gongsunkang", "xin_panzhangmazhong", diff --git a/character/yijiang/characterReplace.js b/character/yijiang/characterReplace.js index b46b85660..4559b6160 100644 --- a/character/yijiang/characterReplace.js +++ b/character/yijiang/characterReplace.js @@ -4,7 +4,7 @@ const characterReplaces = { yujin: ["yujin", "yujin_yujin", "ol_yujin", "sb_yujin", "xin_yujin", "re_yujin"], dc_xushu: ["re_xushu", "dc_xushu"], xushu: ["xin_xushu", "xushu"], - fazheng: ["xin_fazheng", "re_fazheng", "sb_fazheng", "tw_re_fazheng", "fazheng"], + fazheng: ["xin_fazheng", "ol_fazheng", "re_fazheng", "sb_fazheng", "tw_re_fazheng", "fazheng"], masu: ["xin_masu", "re_masu", "masu"], xusheng: ["xusheng", "xin_xusheng", "re_xusheng", "old_xusheng"], wuguotai: ["wuguotai", "xin_wuguotai", "re_wuguotai"], diff --git a/image/character/ol_fazheng.jpg b/image/character/ol_fazheng.jpg new file mode 100644 index 000000000..89cda7026 Binary files /dev/null and b/image/character/ol_fazheng.jpg differ