diff --git a/character/jsrg/character.js b/character/jsrg/character.js index 4b8c6ed02..51a746f4f 100644 --- a/character/jsrg/character.js +++ b/character/jsrg/character.js @@ -106,6 +106,12 @@ const characters = { hp: 3, skills: ["jsrgyansha", "jsrgqingping"], }, + jsrg_yl_luzhi: { + sex: "male", + group: "qun", + hp: 3, + skills: ["jsrgruzong", "jsrgdaoren"], + }, }; export default characters; diff --git a/character/jsrg/skill.js b/character/jsrg/skill.js index a638bbdbd..ff9d60ccb 100644 --- a/character/jsrg/skill.js +++ b/character/jsrg/skill.js @@ -3,6 +3,105 @@ import { lib, game, ui, get, ai, _status } from "../../noname.js"; /** @type { importCharacterConfig['skill'] } */ const skills = { //江山如故·衰 + //卢植 + jsrgruzong: { + trigger: { player: "phaseEnd" }, + filter(event, player) { + const target = lib.skill.jsrgruzong.getTarget(player); + if (!target) return false; + const hs = player.countCards("h"); + if (target !== player) return target.countCards("h") > hs; + return game.hasPlayer(current => current !== player && current.countCards("h") < hs); + }, + getTarget(player) { + const targets = []; + player.checkHistory("useCard", evt => targets.addArray(evt.targets)); + return targets.length === 1 ? targets[0] : null; + }, + frequent: true, + async cost(event, trigger, player) { + const target = lib.skill.jsrgruzong.getTarget(player); + if (target !== player) { + const bool = await player.chooseBool(get.prompt("jsrgruzong", target), "将手牌数摸至与该角色相同").set("frequentSkill", "jsrgruzong"); + if (bool) { + event.result = { + bool, + targets: [target], + cost_data: "drawToOthers", + }; + } + } else { + event.result = await player + .chooseTarget(get.prompt("jsrgruzong"), "令任意名角色将手牌数摸至与你相同", (card, player, target) => { + return target.countCards("h") < player.countCards("h"); + }) + .set("ai", target => { + const player = get.player(); + return (get.attitude(player, target) * Math.sqrt(player.countCards("h") - target.countCards("h"))) / (target.hasSkillTag("nogain") ? 1 : 10); + }); + } + }, + async content(event, trigger, player) { + if (event.cost_data === "drawToOthers") { + const num = Math.min(5, event.targets[0].countCards("h") - player.countCards("h")); + if (num > 0) await player.draw(num); + } else { + const num = player.countCards("h"); + game.asyncDraw(event.targets.sortBySeat(), target => { + return Math.min(5, num - target.countCards("h")); + }); + } + }, + }, + jsrgdaoren: { + enable: "phaseUse", + usable: 1, + filter(event, player) { + return player.countCards("h") > 0; + }, + filterCard: true, + position: "h", + discard: false, + lose: false, + delay: false, + filterTarget: lib.filter.notMe, + check(card) { + return 6 - get.value(card); + }, + async content(event, trigger, player) { + const target = event.target; + await player.give(event.cards, target); + const targets = game + .filterPlayer(current => { + return player.inRange(current) && target.inRange(current); + }) + .sortBySeat(); + for (const current of targets) { + player.line(current); + await current.damage("nocard"); + await game.asyncDelayx(); + } + }, + ai: { + order: 2, + result: { + player(player, target){ + const targets = game.filterPlayer(current => { + return player.inRange(current) && target.inRange(current); + }); + if (targets.length === 0) return false; + return targets.reduce((p, c)=>{ + let eff = get.damageEffect(c, player, player); + if (eff < 0 && current.hp <= 2) { + const att = get.attitude(player, current); + if (att > 0) eff *= Math.sqrt(att); + } + return p + eff; + }, 0) + }, + }, + }, + }, //刘表 jsrgyansha: { trigger: { player: "phaseZhunbeiBegin" }, @@ -62,11 +161,12 @@ const skills = { jsrgqingping: { trigger: { player: "phaseJieshuBegin" }, frequent: true, - filter(event, player){ - const targets = game.filterPlayer(current => player.inRange(current)), hs = player.countCards("h"); - return targets.length > 0 && targets.every(current => current.countCards("h") <= hs); + filter(event, player) { + const targets = game.filterPlayer(current => player.inRange(current)), + hs = player.countCards("h"); + return targets.length > 0 && targets.every(current => current.countCards("h") <= hs); }, - async content(event, trigger, player){ + async content(event, trigger, player) { await player.draw(game.countPlayer(current => player.inRange(current))); }, }, diff --git a/character/jsrg/sort.js b/character/jsrg/sort.js index c0cdd35a9..a318345d4 100644 --- a/character/jsrg/sort.js +++ b/character/jsrg/sort.js @@ -3,7 +3,7 @@ const characterSort = { jiangshanrugu_cheng: ["jsrg_sunce", "jsrg_xuyou", "jsrg_lvbu", "jsrg_zhanghe", "jsrg_zoushi", "jsrg_guanyu", "jsrg_chendeng", "jsrg_zhenji", "jsrg_zhangliao", "jsrg_xugong", "jsrg_chunyuqiong"], jiangshanrugu_zhuan: ["jsrg_guojia", "jsrg_zhangfei", "jsrg_machao", "jsrg_lougui", "jsrg_zhangren", "jsrg_huangzhong", "jsrg_xiahourong", "jsrg_sunshangxiang", "jsrg_pangtong", "jsrg_hansui", "jsrg_zhangchu", "jsrg_xiahouen", "jsrg_fanjiangzhangda"], jiangshanrugu_he: ["jsrg_zhugeliang", "jsrg_jiangwei", "jsrg_luxun", "jsrg_zhaoyun", "jsrg_simayi", "jsrg_guoxun", "jsrg_sunlubansunluyu", "jsrg_caofang", "jsrg_sunjun", "jsrg_liuyong", "jsrg_weiwenzhugezhi", "jsrg_zhangxuan", "jsrg_gaoxiang", "jsrg_guozhao"], - jiangshanrugu_shuai: ["jsrg_yuanshao", "jsrg_caojiewangfu", "jsrg_songhuanghou", "jsrg_zhangjiao", "jsrg_dongzhuo", "jsrg_yangqiu", "jsrg_zhanghuan", "jsrg_liubiao"], + jiangshanrugu_shuai: ["jsrg_yuanshao", "jsrg_caojiewangfu", "jsrg_songhuanghou", "jsrg_zhangjiao", "jsrg_dongzhuo", "jsrg_yangqiu", "jsrg_zhanghuan", "jsrg_liubiao", "jsrg_yl_luzhi"], }; const characterSortTranslate = { diff --git a/character/jsrg/translate.js b/character/jsrg/translate.js index 2c8ef9273..7b27eb27d 100644 --- a/character/jsrg/translate.js +++ b/character/jsrg/translate.js @@ -415,6 +415,12 @@ const translates = { jsrgyansha_info: "准备阶段,你可以视为对任意名角色使用【五谷丰登】。此牌结算结束后,所有非目标角色可以依次将一张装备牌当作【杀】对其中一名目标角色使用。", jsrgqingping: "清平", jsrgqingping_info: "结束阶段,若你攻击范围内的角色均有手牌且手牌数均不大于你,则你可以摸等同于这些角色数的牌。", + jsrg_yl_luzhi: "衰卢植", + jsrg_yl_luzhi_prefix: "衰", + jsrgruzong: "儒宗", + jsrgruzong_info: "回合结束时,若你本回合使用牌指定过的目标角色仅有一名,则你可以将手牌数摸至与其相同。若该角色为你自己,则你可以改为令任意名其他角色将手牌摸至与你相同(均至多摸五张)。", + jsrgdaoren: "蹈刃", + jsrgdaoren_info: "出牌阶段限一次,你可以将一张手牌交给一名其他角色,然后对你与其攻击范围内均包含的所有角色各造成1点伤害。", }; export default translates; diff --git a/character/rank.js b/character/rank.js index 1e0ae3885..de5b6479f 100644 --- a/character/rank.js +++ b/character/rank.js @@ -1108,6 +1108,7 @@ window.noname_character_rank = { "jsrg_dongzhuo", "jsrg_zhanghuan", "jsrg_liubiao", + "jsrg_yl_luzhi", ], b: [ "junk_guanyu", diff --git a/character/shenhua/characterReplace.js b/character/shenhua/characterReplace.js index 51158102f..8c78b2a2d 100644 --- a/character/shenhua/characterReplace.js +++ b/character/shenhua/characterReplace.js @@ -38,7 +38,7 @@ const characterReplaces = { zhugezhan: ["zhugezhan", "old_zhugezhan"], ol_lusu: ["re_lusu", "ol_lusu", "dc_sb_lusu"], zhanghe: ["zhanghe", "re_zhanghe", "sb_zhanghe"], - yl_luzhi: ["yl_luzhi", "sb_yl_luzhi", "tw_yl_luzhi"], + yl_luzhi: ["yl_luzhi", "jsrg_yl_luzhi", "sb_yl_luzhi", "tw_yl_luzhi"], sunliang: ["sunliang", "xin_sunliang"], }; diff --git a/image/character/jsrg_yl_luzhi.jpg b/image/character/jsrg_yl_luzhi.jpg new file mode 100644 index 000000000..e12421227 Binary files /dev/null and b/image/character/jsrg_yl_luzhi.jpg differ