diff --git a/character/jsrg.js b/character/jsrg.js
index a45c668a7..1d2830e01 100644
--- a/character/jsrg.js
+++ b/character/jsrg.js
@@ -5,10 +5,67 @@ game.import("character", function () {
connect: true,
characterSort: {
jsrg: {
- jiangshanrugu_qi: ["jsrg_liuhong", "jsrg_hejin", "jsrg_sunjian", "jsrg_huangfusong", "jsrg_xushao", "jsrg_dongbai", "jsrg_qiaoxuan", "jsrg_yangbiao", "jsrg_kongrong", "jsrg_zhujun", "jsrg_liubei", "jsrg_wangyun", "jsrg_liuyan", "jsrg_caocao", "jsrg_nanhualaoxian"],
- 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_qi: [
+ "jsrg_liuhong",
+ "jsrg_hejin",
+ "jsrg_sunjian",
+ "jsrg_huangfusong",
+ "jsrg_xushao",
+ "jsrg_dongbai",
+ "jsrg_qiaoxuan",
+ "jsrg_yangbiao",
+ "jsrg_kongrong",
+ "jsrg_zhujun",
+ "jsrg_liubei",
+ "jsrg_wangyun",
+ "jsrg_liuyan",
+ "jsrg_caocao",
+ "jsrg_nanhualaoxian",
+ ],
+ 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",
+ ],
},
},
character: {
@@ -30,8 +87,20 @@ game.import("character", function () {
jsrg_nanhualaoxian: ["male", "qun", 3, ["jsrgshoushu", "jsrgxundao", "jsrglinghua"]],
//承
jsrg_sunce: ["male", "wu", 4, ["jsrgduxing", "jsrgzhiheng", "jsrgzhasi", "jsrgbashi"], ["zhu"]],
- jsrg_xuyou: ["male", "wei", 3, ["jsrglipan", "jsrgqingxi", "jsrgjinmie"], ["doublegroup:wei:qun"]],
- jsrg_lvbu: ["male", "qun", 5, ["jsrgwuchang", "jsrgqingjiao", "jsrgchengxu"], ["doublegroup:shu:qun"]],
+ jsrg_xuyou: [
+ "male",
+ "wei",
+ 3,
+ ["jsrglipan", "jsrgqingxi", "jsrgjinmie"],
+ ["doublegroup:wei:qun"],
+ ],
+ jsrg_lvbu: [
+ "male",
+ "qun",
+ 5,
+ ["jsrgwuchang", "jsrgqingjiao", "jsrgchengxu"],
+ ["doublegroup:shu:qun"],
+ ],
jsrg_zhanghe: ["male", "wei", 4, ["jsrgqiongtu", "jsrgxianzhu"], ["doublegroup:wei:qun"]],
jsrg_zoushi: ["female", "qun", 3, ["jsrgguyin", "jsrgzhangdeng"]],
jsrg_guanyu: ["male", "shu", 5, ["jsrgguanjue", "jsrgnianen"], ["border:wei"]],
@@ -71,17 +140,25 @@ game.import("character", function () {
jsrg_guozhao: ["female", "wei", 3, ["jsrgpianchong", "jsrgzunwei"]],
},
characterIntro: {
- qiaoxuan: "桥玄(110年-184年6月6日),一作乔玄,字公祖。梁国睢阳县(今河南省商丘市睢阳区)人。东汉时期名臣。桥玄年轻时曾任睢阳县功曹,因坚持追究陈国相羊昌的恶行而闻名。后被举为孝廉,历任洛阳左尉、齐相及上谷、汉阳太守、司徒长史、将作大匠。汉桓帝末年,出任度辽将军,击败鲜卑、南匈奴、高句丽侵扰,保境安民。汉灵帝初年,迁任河南尹、少府、大鸿胪。建宁三年(170年),迁司空。次年,拜司徒。光和元年(178年),升任太尉。桥玄有感于国势日衰,于是称病请辞,改任太中大夫。光和七年(184年),桥玄去世,年七十五。桥玄性格刚强,不阿权贵,待人谦俭,尽管屡历高官,但不因为自己处在高位而有所私请。他为官清廉,去世后连下葬的钱都没有,被时人称为名臣。",
+ qiaoxuan:
+ "桥玄(110年-184年6月6日),一作乔玄,字公祖。梁国睢阳县(今河南省商丘市睢阳区)人。东汉时期名臣。桥玄年轻时曾任睢阳县功曹,因坚持追究陈国相羊昌的恶行而闻名。后被举为孝廉,历任洛阳左尉、齐相及上谷、汉阳太守、司徒长史、将作大匠。汉桓帝末年,出任度辽将军,击败鲜卑、南匈奴、高句丽侵扰,保境安民。汉灵帝初年,迁任河南尹、少府、大鸿胪。建宁三年(170年),迁司空。次年,拜司徒。光和元年(178年),升任太尉。桥玄有感于国势日衰,于是称病请辞,改任太中大夫。光和七年(184年),桥玄去世,年七十五。桥玄性格刚强,不阿权贵,待人谦俭,尽管屡历高官,但不因为自己处在高位而有所私请。他为官清廉,去世后连下葬的钱都没有,被时人称为名臣。",
lougui: "娄圭,字子伯,荆州南阳郡(治今河南南阳)人。曹魏时期著名谋士、将军,娄圭年轻时与曹操有交情,曾经随曹操平定冀州,南征刘表,击破马超,立有功劳,连曹操都感叹他的计谋。 后来曹操和他的儿子们一起出去游玩,娄圭当时也一起随行。因言语不当,被南郡(治今湖北荆州)人习授举报,曹操认为有意诽谤,遭杀害。在小说《三国演义》里,娄圭被设定为京兆人(今陕西西安),隐居终南山,道号“梦梅居士”。于第59回登场。",
- xiahourong: "夏侯荣(207年—219年) ,字幼权,名将夏侯渊之子。建安二十四年(219年)汉中之战,父亲夏侯渊战死后,夏侯荣不愿逃跑,随后拔剑冲入敌阵,战死。",
+ xiahourong:
+ "夏侯荣(207年—219年) ,字幼权,名将夏侯渊之子。建安二十四年(219年)汉中之战,父亲夏侯渊战死后,夏侯荣不愿逃跑,随后拔剑冲入敌阵,战死。",
guoxun: "郭脩(?~253年),一作郭循,字孝先,凉州西平人,三国时期曹魏官员。原为曹魏中郎,被蜀汉将领姜维俘虏后降蜀汉,任左将军,后来刺杀了蜀汉大将军费祎。被曹魏追封为长乐乡侯,谥曰威侯。",
- caofang: "曹芳(232年-274年),字兰卿,沛国谯县(今安徽省亳州市)人。三国时期曹魏第三位皇帝(239年1月22日-254年10月17日在位),疑为魏武帝曹操曾孙,任城威王曹彰之孙,任城王曹楷之子。太和六年(232年),生于任城王府。青龙三年(235年),选为魏明帝曹叡养子,册封齐王。景初三年(239年),立为皇太子,同日魏明帝曹叡病死,曹芳正式即位,由大将军曹爽和太尉司马懿共同辅政。正始十年,经历高平陵之变,曹爽倒台,政权落入司马氏手中。嘉平六年(254年),中书令李丰和光禄大夫张缉图谋废掉司马师,改立夏侯玄为大将军。司马师平定叛乱后,将曹芳废为齐王,拥戴高贵乡公曹髦继位。西晋建立后,册封邵陵县公。泰始十年(274年),曹芳病逝,终年四十三岁,谥号为厉。",
+ caofang:
+ "曹芳(232年-274年),字兰卿,沛国谯县(今安徽省亳州市)人。三国时期曹魏第三位皇帝(239年1月22日-254年10月17日在位),疑为魏武帝曹操曾孙,任城威王曹彰之孙,任城王曹楷之子。太和六年(232年),生于任城王府。青龙三年(235年),选为魏明帝曹叡养子,册封齐王。景初三年(239年),立为皇太子,同日魏明帝曹叡病死,曹芳正式即位,由大将军曹爽和太尉司马懿共同辅政。正始十年,经历高平陵之变,曹爽倒台,政权落入司马氏手中。嘉平六年(254年),中书令李丰和光禄大夫张缉图谋废掉司马师,改立夏侯玄为大将军。司马师平定叛乱后,将曹芳废为齐王,拥戴高贵乡公曹髦继位。西晋建立后,册封邵陵县公。泰始十年(274年),曹芳病逝,终年四十三岁,谥号为厉。",
sunjun: "孙峻(219年-256年10月19日),字子远,扬州吴郡富春(今浙江省杭州市)人,昭义中郎将孙静曾孙,定武中郎将孙暠之孙,散骑侍郎孙恭之子。三国时期吴国宗室、权臣。孙峻从小弓马娴熟,胆量非凡。孙权晚年时,孙峻担任武卫都尉,掌握军权,然后又任侍中,开始涉足朝政。孙权临终前,孙峻接受遗诏同诸葛恪、滕胤共同辅佐朝政。此后,其身兼武卫将军,一直主持宫廷的值班、守卫等要害部门,并被封为都乡侯。孙峻生性喜好专断,容不下诸葛恪,于是与吴主孙亮密谋发动政变,在酒宴中设伏兵杀死诸葛恪。孙峻谋杀诸葛恪之后,升任丞相、大将军,督察内外一切军务,假节,晋封富春侯。此后,孙峻独揽朝政。孙峻在任职期间,滥施刑杀,淫乱宫女,和全公主孙鲁班私通。五凤元年(254年),吴侯孙英企图谋杀孙峻,后来事情被泄露,孙英自杀。时隔一年,吴国将军孙仪、张怡、林恂等人乘蜀国使节来访之机,共同谋划诛杀孙峻。后被孙峻发觉,孙仪自杀,林恂等被认为有罪诛死。太平元年(256年),孙峻梦见被诸葛恪所击,因惊悸恐惧发病而死,时年38岁。",
- sunlubansunluyu: "孙鲁班,孙权之女。孙鲁班与孙权二子孙和不睦。孙权长子孙登死后,孙和被立为太子。孙鲁班向孙权进谗言废孙和太子之位,孙和被废后忧愤而死。
孙鲁育,又名小虎,孙权与步练师之女。吴后期,孙鲁班诬陷孙鲁育参与谋反,于是孙峻杀害了孙鲁育。",
- jsrg_caocao: "初平元年二月,董卓徙天子都长安,焚洛阳宫室,众诸侯畏卓兵强,莫敢进。操怒斥众人:“为人臣而临此境,当举义兵以诛暴乱,大众已合,诸君何疑?此一战而天下定矣!”遂引兵汴水,遇卓将徐荣,大破之。操迎天子,攻吕布,伐袁术,安汉室,拜为征西将军。是时,袁绍兼四州之地,将攻许都。操欲扫清寰宇,兴复汉室,遂屯兵官渡。既克绍,操曰:“若天命在吾,吾为周文王矣。”",
- jsrg_sunce: "建安五年,操、绍相拒于官渡,孙策欲阴袭许昌,迎汉帝,遂密治兵,部署诸将。未发,会为许贡门客所刺,将计就计,尽托江东于权,诈死以待天时。八月,操、绍决战,孙策亲冒矢石,斩将刈旗,得扬、豫之地。曹操败走冀、青,刘备远遁荆、益。而后历时七年,孙策三分天下已有其二,帝于洛阳,建霸王未竟之功业。权表求吴王,封为仲帝,共治天下。",
- jsrg_guojia: "初平元年二月,郭嘉拜见袁绍,闻曹操怒斥众诸侯,乃对曰:“董卓于汴水或有埋伏,慎之!”曹操未从,果败于徐荣。三月,曹操与郭嘉论天下事:“使孤成大业者,必此人也。”郭嘉从破袁绍,讨谭、尚,连战数克,计定辽东。时年三十八,征乌桓归途郭嘉因劳染疾,命悬之际竟意外饮下柳皮醋水而愈。建安十三年,曹操屯兵赤壁,郭嘉识破连环之计,议上中下三策,可胜刘备。尚未献策,曹操便决意采纳上策,“奉孝之才,足胜孤百倍,卿言上策,如何不取?”由此,赤壁战后曹操尽得天下。",
- jsrg_zhugeliang: "建兴六年春,汉丞相诸葛亮使赵云、邓芝为先锋,马谡为副将拒箕谷,牵制曹真主力。自率三十万大军攻祁山,三郡叛魏应亮,关中响震。曹叡命张郃拒亮,亮使定军山降将姜维与郃战于街亭,张郃久攻不下。后曹真强攻赵云军,赵云死战,坚守箕谷,马谡、邓芝当场战死忠勇殉国。……既克张郃,曹真溃逃,曹叡弃守长安,迁都邺城。十月,司马懿击退孙权,回援曹真。而后三年,丞相所到之处,无不望风而降,皆箪食壶浆,以迎汉军。尽收豫、徐、兖、并之地,建兴十年春,司马懿父子三人死于诸葛武侯火计,同年,孙权上表称臣,至此四海清平,大汉一统。而后诸葛亮荐蒋琬为丞相,姜维为大将军,自回隆中归隐,后主挽留再三,皆不受。魏延亦辞官相随,侍奉左右。后主时有不决之事,便往隆中拜访相父,均未得面,童子答曰外出云游,遗数锦囊,拆而视之,皆治国之良策也。",
+ sunlubansunluyu:
+ "孙鲁班,孙权之女。孙鲁班与孙权二子孙和不睦。孙权长子孙登死后,孙和被立为太子。孙鲁班向孙权进谗言废孙和太子之位,孙和被废后忧愤而死。
孙鲁育,又名小虎,孙权与步练师之女。吴后期,孙鲁班诬陷孙鲁育参与谋反,于是孙峻杀害了孙鲁育。",
+ jsrg_caocao:
+ "初平元年二月,董卓徙天子都长安,焚洛阳宫室,众诸侯畏卓兵强,莫敢进。操怒斥众人:“为人臣而临此境,当举义兵以诛暴乱,大众已合,诸君何疑?此一战而天下定矣!”遂引兵汴水,遇卓将徐荣,大破之。操迎天子,攻吕布,伐袁术,安汉室,拜为征西将军。是时,袁绍兼四州之地,将攻许都。操欲扫清寰宇,兴复汉室,遂屯兵官渡。既克绍,操曰:“若天命在吾,吾为周文王矣。”",
+ jsrg_sunce:
+ "建安五年,操、绍相拒于官渡,孙策欲阴袭许昌,迎汉帝,遂密治兵,部署诸将。未发,会为许贡门客所刺,将计就计,尽托江东于权,诈死以待天时。八月,操、绍决战,孙策亲冒矢石,斩将刈旗,得扬、豫之地。曹操败走冀、青,刘备远遁荆、益。而后历时七年,孙策三分天下已有其二,帝于洛阳,建霸王未竟之功业。权表求吴王,封为仲帝,共治天下。",
+ jsrg_guojia:
+ "初平元年二月,郭嘉拜见袁绍,闻曹操怒斥众诸侯,乃对曰:“董卓于汴水或有埋伏,慎之!”曹操未从,果败于徐荣。三月,曹操与郭嘉论天下事:“使孤成大业者,必此人也。”郭嘉从破袁绍,讨谭、尚,连战数克,计定辽东。时年三十八,征乌桓归途郭嘉因劳染疾,命悬之际竟意外饮下柳皮醋水而愈。建安十三年,曹操屯兵赤壁,郭嘉识破连环之计,议上中下三策,可胜刘备。尚未献策,曹操便决意采纳上策,“奉孝之才,足胜孤百倍,卿言上策,如何不取?”由此,赤壁战后曹操尽得天下。",
+ jsrg_zhugeliang:
+ "建兴六年春,汉丞相诸葛亮使赵云、邓芝为先锋,马谡为副将拒箕谷,牵制曹真主力。自率三十万大军攻祁山,三郡叛魏应亮,关中响震。曹叡命张郃拒亮,亮使定军山降将姜维与郃战于街亭,张郃久攻不下。后曹真强攻赵云军,赵云死战,坚守箕谷,马谡、邓芝当场战死忠勇殉国。……既克张郃,曹真溃逃,曹叡弃守长安,迁都邺城。十月,司马懿击退孙权,回援曹真。而后三年,丞相所到之处,无不望风而降,皆箪食壶浆,以迎汉军。尽收豫、徐、兖、并之地,建兴十年春,司马懿父子三人死于诸葛武侯火计,同年,孙权上表称臣,至此四海清平,大汉一统。而后诸葛亮荐蒋琬为丞相,姜维为大将军,自回隆中归隐,后主挽留再三,皆不受。魏延亦辞官相随,侍奉左右。后主时有不决之事,便往隆中拜访相父,均未得面,童子答曰外出云游,遗数锦囊,拆而视之,皆治国之良策也。",
},
characterTitle: {},
characterFilter: {
@@ -101,10 +178,15 @@ game.import("character", function () {
"step 0";
var card = get.autoViewAs(event.cards[0]);
card.storage.xumou_jsrg = true;
- player.chooseUseTarget(card, event.cards, `蓄谋:是否使用${get.translation(card)}?`, `请选择要使用的目标。若不使用此牌,则判定区内的所有“蓄谋”牌都将被置入弃牌堆。`);
+ player.chooseUseTarget(
+ card,
+ event.cards,
+ `蓄谋:是否使用${get.translation(card)}?`,
+ `请选择要使用的目标。若不使用此牌,则判定区内的所有“蓄谋”牌都将被置入弃牌堆。`
+ );
"step 1";
if (!result.bool) {
- var cards = player.getCards("j", card => {
+ var cards = player.getCards("j", (card) => {
return (card.viewAs || card.name) == "xumou_jsrg";
});
if (cards.length > 0) player.loseToDiscardpile(cards);
@@ -151,7 +233,8 @@ game.import("character", function () {
mod: {
cardEnabled(card, player) {
if (!card.storage || !card.storage.xumou_jsrg) return;
- if (player.getStorage("xumou_jsrg_temp").includes(get.name(card, false))) return false;
+ if (player.getStorage("xumou_jsrg_temp").includes(get.name(card, false)))
+ return false;
},
},
},
@@ -159,7 +242,14 @@ game.import("character", function () {
jsrgwentian: {
audio: 2,
trigger: {
- player: ["phaseZhunbeiBegin", "phaseJudgeBegin", "phaseDrawBegin", "phaseUseBegin", "phaseDiscardBegin", "phaseJieshuBegin"],
+ player: [
+ "phaseZhunbeiBegin",
+ "phaseJudgeBegin",
+ "phaseDrawBegin",
+ "phaseUseBegin",
+ "phaseDiscardBegin",
+ "phaseJieshuBegin",
+ ],
},
usable: 1,
prompt2: "观看牌堆顶的五张牌,将其中一张交给其他角色,并将其余牌置于牌堆顶或牌堆底",
@@ -167,11 +257,20 @@ game.import("character", function () {
async content(event, trigger, player) {
const cards = get.cards(5);
game.cardsGotoOrdering(cards);
- const { result } = await player.chooseButton(["问天:将一张牌交给一名其他角色", cards], true);
+ const { result } = await player.chooseButton(
+ ["问天:将一张牌交给一名其他角色", cards],
+ true
+ );
if (result.bool) {
- const { result: result2 } = await player.chooseTarget(`将${get.translation(result.links)}交给一名其他角色`, lib.filter.notMe, true).set("ai", target => {
- return get.attitude(get.player(), target);
- });
+ const { result: result2 } = await player
+ .chooseTarget(
+ `将${get.translation(result.links)}交给一名其他角色`,
+ lib.filter.notMe,
+ true
+ )
+ .set("ai", (target) => {
+ return get.attitude(get.player(), target);
+ });
if (result2.bool) {
cards.removeArray(result.links);
const target = result2.targets[0];
@@ -182,7 +281,7 @@ game.import("character", function () {
const next = player.chooseToMove();
next.set("list", [["牌堆顶", cards.filterInD()], ["牌堆底"]]);
next.set("prompt", "问天:点击将牌移动到牌堆顶或牌堆底");
- next.processAI = list => {
+ next.processAI = (list) => {
const cards = list[0][1],
player = _status.event.player;
const top = [];
@@ -231,7 +330,8 @@ game.import("character", function () {
enable: "chooseToUse",
filter: function (event, player) {
for (const name of ["wuxie", "huogong"]) {
- if (event.filterCard(get.autoViewAs({ name }, "unsure"), player, event)) return true;
+ if (event.filterCard(get.autoViewAs({ name }, "unsure"), player, event))
+ return true;
}
return false;
},
@@ -243,7 +343,8 @@ game.import("character", function () {
const event = get.event(),
filter = event._backup.filterCard;
for (const name of ["wuxie", "huogong"]) {
- if (filter(get.autoViewAs({ name }, "unsure"), player, event)) return { name };
+ if (filter(get.autoViewAs({ name }, "unsure"), player, event))
+ return { name };
}
return null;
},
@@ -289,11 +390,11 @@ game.import("character", function () {
async content(event, trigger, player) {
player
.chooseToDebate(
- game.filterPlayer(current => {
+ game.filterPlayer((current) => {
return (current == player || current.isZhu2()) && current.countCards("h");
})
)
- .set("callback", async event => {
+ .set("callback", async (event) => {
const result = event.debateResult;
if (result.bool && result.opinion) {
const { opinion, targets } = result;
@@ -305,7 +406,7 @@ game.import("character", function () {
}
} while (
targets
- .map(current => {
+ .map((current) => {
return current.countCards("h");
})
.reduce((p, c) => {
@@ -335,7 +436,8 @@ game.import("character", function () {
ai: {
damageBonus: true,
skillTagFilter: function (player, tag, arg) {
- if (tag === "damageBonus") return arg && arg.card && game.hasNature(arg.card, "linked");
+ if (tag === "damageBonus")
+ return arg && arg.card && game.hasNature(arg.card, "linked");
},
},
intro: {
@@ -350,10 +452,19 @@ game.import("character", function () {
global: "damageBegin4",
},
filter: function (event, player) {
- return event.player.isIn() && ["fire", "thunder"].some(n => !player.hasSkill(`jsrgyinlve_${n}`) && event.hasNature(n));
+ return (
+ event.player.isIn() &&
+ ["fire", "thunder"].some(
+ (n) => !player.hasSkill(`jsrgyinlve_${n}`) && event.hasNature(n)
+ )
+ );
},
check: function (event, player) {
- if (get.damageEffect(event.player, event.source, player, get.natureList(event.nature)) < -5) return true;
+ if (
+ get.damageEffect(event.player, event.source, player, get.natureList(event.nature)) <
+ -5
+ )
+ return true;
return false;
},
logTarget: "player",
@@ -361,10 +472,16 @@ game.import("character", function () {
trigger.cancel();
const natures = ["fire", "thunder"];
let index;
- if (natures.every(n => !player.hasSkill(`jsrgyinlve_${n}`) && trigger.hasNature(n))) {
- const { result } = await player.chooseControl(["摸牌阶段", "弃牌阶段"]).set("prompt", "请选择要新回合内仅有的阶段");
+ if (natures.every((n) => !player.hasSkill(`jsrgyinlve_${n}`) && trigger.hasNature(n))) {
+ const { result } = await player
+ .chooseControl(["摸牌阶段", "弃牌阶段"])
+ .set("prompt", "请选择要新回合内仅有的阶段");
index = result.index;
- } else index = [0, 1].find(i => !player.hasSkill(`jsrgyinlve_${natures[i]}`) && trigger.hasNature(natures[i]));
+ } else
+ index = [0, 1].find(
+ (i) =>
+ !player.hasSkill(`jsrgyinlve_${natures[i]}`) && trigger.hasNature(natures[i])
+ );
player.addTempSkill(`jsrgyinlve_${natures[index]}`, "roundStart");
player.insertPhase().set("phaseList", [["phaseDraw", "phaseDiscard"][index]]);
},
@@ -390,11 +507,11 @@ game.import("character", function () {
await player.showCards(event.cards);
player
.chooseToDebate(
- game.filterPlayer(current => {
+ game.filterPlayer((current) => {
return current.maxHp <= player.maxHp;
})
)
- .set("callback", async event => {
+ .set("callback", async (event) => {
const result = event.debateResult;
if (result.bool && result.opinion) {
const { cards: fixedCards } = event.getParent("jsrgjinfa");
@@ -402,22 +519,32 @@ game.import("character", function () {
const { opinion, targets } = result;
if (opinion == color) {
const { result } = await player
- .chooseTarget("是否令至多两名参与议事的角色将手牌摸至体力上限?", [1, 2], (card, player, target) => {
- return get.event("targets").includes(target);
- })
+ .chooseTarget(
+ "是否令至多两名参与议事的角色将手牌摸至体力上限?",
+ [1, 2],
+ (card, player, target) => {
+ return get.event("targets").includes(target);
+ }
+ )
.set("targets", targets)
- .set("ai", target => {
+ .set("ai", (target) => {
const player = get.player();
const att = get.attitude(player, target);
if (att <= 0) return -1;
- return att * Math.sqrt(Math.max(0.1, target.maxHp - target.countCards("h")));
+ return (
+ att *
+ Math.sqrt(
+ Math.max(0.1, target.maxHp - target.countCards("h"))
+ )
+ );
});
if (result.bool) {
const targets = result.targets;
targets.sortBySeat();
player.line(targets, "green");
for (const current of targets) {
- if (current.countCards("h") < current.maxHp) await current.drawTo(current.maxHp);
+ if (current.countCards("h") < current.maxHp)
+ await current.drawTo(current.maxHp);
}
}
} else {
@@ -425,7 +552,10 @@ game.import("character", function () {
}
}
const { red, black } = result;
- if ((red.length == 1 && red[0][0] == player) || (black.length == 1 && black[0][0] == player)) {
+ if (
+ (red.length == 1 && red[0][0] == player) ||
+ (black.length == 1 && black[0][0] == player)
+ ) {
const list = lib.group.slice();
list.remove(player.group);
list.push("cancel2");
@@ -437,11 +567,14 @@ game.import("character", function () {
.set("ai", () => {
if (!get.event("change")) return "cancel2";
const controls = get.event("controls");
- const groups = ["wei", "shu"].filter(g => controls.includes(g));
+ const groups = ["wei", "shu"].filter((g) => controls.includes(g));
if (groups.length) return groups.randomGet();
return controls.randomGet();
})
- .set("change", ["wei", "shu"].includes(player.group) ? Math.random() < 0.5 : true);
+ .set(
+ "change",
+ ["wei", "shu"].includes(player.group) ? Math.random() < 0.5 : true
+ );
if (control != "cancel2") {
player.popup(control + "2", get.groupnature(control, "raw"));
player.changeGroup(control);
@@ -468,29 +601,34 @@ game.import("character", function () {
filter: function (event, player) {
if (player.group != "wei") return false;
if (!event.targets.includes(player)) return false;
- if (event.red.some(i => i[0] == player)) return event.black.length;
- if (event.black.some(i => i[0] == player)) return event.red.length;
+ if (event.red.some((i) => i[0] == player)) return event.black.length;
+ if (event.black.some((i) => i[0] == player)) return event.red.length;
return false;
},
async content(event, trigger, player) {
const targets = [];
- if (trigger.red.some(i => i[0] == player)) targets.addArray(trigger.black.map(i => i[0]));
- if (trigger.black.some(i => i[0] == player)) targets.addArray(trigger.red.map(i => i[0]));
+ if (trigger.red.some((i) => i[0] == player))
+ targets.addArray(trigger.black.map((i) => i[0]));
+ if (trigger.black.some((i) => i[0] == player))
+ targets.addArray(trigger.red.map((i) => i[0]));
player.line(targets, "thunder");
- targets.forEach(target => {
+ targets.forEach((target) => {
target.addTempSkill("jsrgfumou_forbid");
target.markAuto(
"jsrgfumou_forbid",
- ["red", "black"].filter(color => {
- return trigger[color].some(i => i[0] == target);
+ ["red", "black"].filter((color) => {
+ return trigger[color].some((i) => i[0] == target);
})
);
});
- game.broadcastAll(targets => {
+ game.broadcastAll((targets) => {
lib.skill.jsrgfumou_backup.targets = targets;
}, targets);
const next = player.chooseToUse();
- next.set("openskilldialog", `是否将一张【影】当【出其不意】对一名与你意见不同的角色使用?`);
+ next.set(
+ "openskilldialog",
+ `是否将一张【影】当【出其不意】对一名与你意见不同的角色使用?`
+ );
next.set("norestore", true);
next.set("_backupevent", "jsrgfumou_backup");
next.set("custom", {
@@ -512,7 +650,8 @@ game.import("character", function () {
log: false,
filterTarget: function (card, player, target) {
const targets = lib.skill.jsrgfumou_backup.targets;
- if (!targets.includes(target) || ui.selected.targets.containsSome(targets)) return false;
+ if (!targets.includes(target) || ui.selected.targets.containsSome(targets))
+ return false;
return lib.filter.targetEnabled.apply(this, arguments);
},
ai1: function (card) {
@@ -528,15 +667,27 @@ game.import("character", function () {
mod: {
cardEnabled: function (card, player) {
const color = get.color(card);
- if (color != "unsure" && player.getStorage("jsrgfumou_forbid").includes(color)) return false;
+ if (
+ color != "unsure" &&
+ player.getStorage("jsrgfumou_forbid").includes(color)
+ )
+ return false;
},
cardRespondable: function (card, player) {
const color = get.color(card);
- if (color != "unsure" && player.getStorage("jsrgfumou_forbid").includes(color)) return false;
+ if (
+ color != "unsure" &&
+ player.getStorage("jsrgfumou_forbid").includes(color)
+ )
+ return false;
},
cardSavable: function (card, player) {
const color = get.color(card);
- if (color != "unsure" && player.getStorage("jsrgfumou_forbid").includes(color)) return false;
+ if (
+ color != "unsure" &&
+ player.getStorage("jsrgfumou_forbid").includes(color)
+ )
+ return false;
},
},
mark: true,
@@ -584,7 +735,7 @@ game.import("character", function () {
audio: 2,
trigger: { player: "phaseUseBegin" },
filter(event, player) {
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
return player.canCompare(current);
});
},
@@ -594,7 +745,7 @@ game.import("character", function () {
.chooseTarget(get.prompt2("jsrgyoujin"), (card, player, target) => {
return player.canCompare(target);
})
- .set("ai", target => {
+ .set("ai", (target) => {
if (!get.event("goon")) return 0;
return -get.attitude(get.player(), target);
})
@@ -623,7 +774,13 @@ game.import("character", function () {
onremove: true,
mod: {
cardEnabled2: function (card, player) {
- if (get.itemtype(card) == "card" && player.getStorage("jsrgyoujin_forbid").some(num => num > get.number(card))) return false;
+ if (
+ get.itemtype(card) == "card" &&
+ player
+ .getStorage("jsrgyoujin_forbid")
+ .some((num) => num > get.number(card))
+ )
+ return false;
},
},
mark: true,
@@ -637,7 +794,7 @@ game.import("character", function () {
audio: 2,
enable: "phaseUse",
filter(event, player) {
- return !player.hasCard(card => {
+ return !player.hasCard((card) => {
return player.hasUseTarget(card, true, true);
});
},
@@ -665,7 +822,7 @@ game.import("character", function () {
player.addSkill("jsrgzhubei_record");
},
filter(event, player) {
- return event.player.hasHistory("damage", evt => {
+ return event.player.hasHistory("damage", (evt) => {
return evt.source == player;
});
},
@@ -676,19 +833,26 @@ game.import("character", function () {
subSkill: {
record: {
trigger: {
- global: ["loseAfter", "equipAfter", "addJudgeAfter", "gainAfter", "loseAsyncAfter", "addToExpansionAfter"],
+ global: [
+ "loseAfter",
+ "equipAfter",
+ "addJudgeAfter",
+ "gainAfter",
+ "loseAsyncAfter",
+ "addToExpansionAfter",
+ ],
},
charlotte: true,
silent: true,
filter(event, player) {
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
if (current.countCards("h")) return false;
const evt = event.getl(current);
return evt && evt.hs && evt.hs.length;
});
},
async content(event, trigger, player) {
- game.countPlayer(current => {
+ game.countPlayer((current) => {
if (current.countCards("h")) return false;
const evt = trigger.getl(current);
if (evt && evt.hs && evt.hs.length) current.addTempSkill("jsrgzhubei_lost");
@@ -720,15 +884,17 @@ game.import("character", function () {
const juedou = new lib.element.VCard({ name: "juedou", storage: { jsrglonglin: true } });
const { result } = await player
.chooseToDiscard(get.prompt2("jsrglonglin"), "he")
- .set("ai", card => {
+ .set("ai", (card) => {
if (get.event("goon")) return 5 - get.value(card);
return 0;
})
.set(
"goon",
- (trigger.player.canUse(juedou, player) ? Math.max(0, get.effect(player, juedou, trigger.player, trigger.player)) : 0) +
+ (trigger.player.canUse(juedou, player)
+ ? Math.max(0, get.effect(player, juedou, trigger.player, trigger.player))
+ : 0) +
trigger.targets
- .map(target => {
+ .map((target) => {
return get.effect(target, trigger.card, trigger.player, player);
})
.reduce((p, c) => {
@@ -741,7 +907,12 @@ game.import("character", function () {
trigger.excluded.addArray(trigger.targets);
game.asyncDelayx();
if (trigger.player.canUse(juedou, player)) {
- const { result } = await trigger.player.chooseBool(`是否视为对${get.translation(player)}使用一张【决斗】?`).set("choice", get.effect(player, juedou, trigger.player, trigger.player) >= 0);
+ const { result } = await trigger.player
+ .chooseBool(`是否视为对${get.translation(player)}使用一张【决斗】?`)
+ .set(
+ "choice",
+ get.effect(player, juedou, trigger.player, trigger.player) >= 0
+ );
if (result.bool) {
player.addTempSkill("jsrglonglin_source");
trigger.player.useCard(juedou, player);
@@ -767,11 +938,11 @@ game.import("character", function () {
mod: {
cardEnabled: function (card, player) {
if (!card.cards) return;
- if (card.cards.some(cardx => get.position(cardx) == "h")) return false;
+ if (card.cards.some((cardx) => get.position(cardx) == "h")) return false;
},
cardSavable: function (card, player) {
if (!card.cards) return;
- if (card.cards.some(cardx => get.position(cardx) == "h")) return false;
+ if (card.cards.some((cardx) => get.position(cardx) == "h")) return false;
},
},
charlotte: true,
@@ -795,7 +966,7 @@ game.import("character", function () {
for (let i = curLen - 1; i >= 0; i--) {
if (
roundCount == 1 &&
- game.hasPlayer(current => {
+ game.hasPlayer((current) => {
const history = current.actionHistory[i];
if (!history.isMe || history.isSkipped) return false;
return true;
@@ -819,7 +990,7 @@ game.import("character", function () {
for (let i = curLen - 1; i >= 0; i--) {
if (
roundCount == 1 &&
- game.hasPlayer(current => {
+ game.hasPlayer((current) => {
const history = current.actionHistory[i];
if (!history.isMe || history.isSkipped) return false;
return true;
@@ -853,27 +1024,37 @@ game.import("character", function () {
if (event.type == "wuxie") return false;
if (
!_status.connectMode &&
- !player.countCards("hs", card => {
+ !player.countCards("hs", (card) => {
return get.type2(card) != "basic";
})
)
return false;
- return get.inpileVCardList(info => {
+ return get.inpileVCardList((info) => {
if (info[0] != "basic") return false;
- return event.filterCard(get.autoViewAs({ name: info[2], nature: info[3] }, "unsure"), player, event);
+ return event.filterCard(
+ get.autoViewAs({ name: info[2], nature: info[3] }, "unsure"),
+ player,
+ event
+ );
}).length;
},
chooseButton: {
dialog(event, player) {
- const vcards = get.inpileVCardList(info => {
+ const vcards = get.inpileVCardList((info) => {
if (info[0] != "basic") return false;
- return event.filterCard(get.autoViewAs({ name: info[2], nature: info[3] }, "unsure"), player, event);
+ return event.filterCard(
+ get.autoViewAs({ name: info[2], nature: info[3] }, "unsure"),
+ player,
+ event
+ );
});
return ui.create.dialog("镇胆", [vcards, "vcard"]);
},
check(button) {
if (get.event().getParent().type != "phase") return 1;
- return get.player().getUseValue({ name: button.link[2], nature: button.link[3] });
+ return get
+ .player()
+ .getUseValue({ name: button.link[2], nature: button.link[3] });
},
backup(links, player) {
return {
@@ -888,7 +1069,12 @@ game.import("character", function () {
};
},
prompt(links, player) {
- return "将一张非基本手牌当" + (get.translation(links[0][3]) || "") + get.translation(links[0][2]) + "使用或打出";
+ return (
+ "将一张非基本手牌当" +
+ (get.translation(links[0][3]) || "") +
+ get.translation(links[0][2]) +
+ "使用或打出"
+ );
},
},
hiddenCard(player, name) {
@@ -925,7 +1111,7 @@ game.import("character", function () {
const next = player.chooseToMove();
next.set("list", [["牌堆顶"], ["牌堆底", cards.reverse()]]);
next.set("prompt", "鹰眎:点击将牌移动到牌堆顶或牌堆底");
- next.processAI = list => {
+ next.processAI = (list) => {
const cards = list[1][1],
player = _status.event.player;
const top = [];
@@ -974,7 +1160,9 @@ game.import("character", function () {
trigger: { player: "phaseBegin" },
prompt2(event, player) {
const num = Math.floor(game.countPlayer() / 2);
- return `你翻面,令你本回合的手牌上限+${num},摸${get.cnNumber(num)}张牌,视为使用一张【解甲归田】(目标角色不能使用这些牌直到其下回合结束)。`;
+ return `你翻面,令你本回合的手牌上限+${num},摸${get.cnNumber(
+ num
+ )}张牌,视为使用一张【解甲归田】(目标角色不能使用这些牌直到其下回合结束)。`;
},
group: ["jsrgtuigu_insert", "jsrgtuigu_recover"],
async content(event, trigger, player) {
@@ -1010,12 +1198,12 @@ game.import("character", function () {
evtx = player.insertPhase();
player
.when("phaseBeforeStart")
- .filter(evtt => evtt == evtx)
+ .filter((evtt) => evtt == evtx)
.then(() => {
game.players
.slice()
.concat(game.dead)
- .forEach(current => {
+ .forEach((current) => {
current.getHistory()._jsrgtuigu = true;
current.getStat()._jsrgtuigu = true;
});
@@ -1032,7 +1220,13 @@ game.import("character", function () {
audio: "jsrgtuigu",
trigger: {
player: "loseAfter",
- global: ["gainAfter", "equipAfter", "addJudgeAfter", "loseAsyncAfter", "addToExpansionAfter"],
+ global: [
+ "gainAfter",
+ "equipAfter",
+ "addJudgeAfter",
+ "loseAsyncAfter",
+ "addToExpansionAfter",
+ ],
},
filter(event, player) {
if (player.isHealthy()) return false;
@@ -1079,7 +1273,8 @@ game.import("character", function () {
blocked: {
mod: {
cardEnabled2(card) {
- if (get.itemtype(card) == "card" && card.hasGaintag("jsrgtuigu")) return false;
+ if (get.itemtype(card) == "card" && card.hasGaintag("jsrgtuigu"))
+ return false;
},
},
charlotte: true,
@@ -1096,12 +1291,15 @@ game.import("character", function () {
audio: 2,
trigger: { player: "useCardToPlayered" },
filter(event, player) {
- if (!event.isFirstTarget || event.targets.length != 1 || event.target == player) return false;
+ if (!event.isFirstTarget || event.targets.length != 1 || event.target == player)
+ return false;
if (event.card.name == "sha") return true;
return event.getParent(3).name == "xumou_jsrg";
},
prompt2(event, player) {
- return `令${get.translation(event.card)}不计入次数限制,且你获得${get.translation(event.target)}一张牌,然后其可以令你本回合至其的距离+2`;
+ return `令${get.translation(event.card)}不计入次数限制,且你获得${get.translation(
+ event.target
+ )}一张牌,然后其可以令你本回合至其的距离+2`;
},
group: "jsrgeqian_prepare",
logTarget: "target",
@@ -1115,12 +1313,15 @@ game.import("character", function () {
await player.gainPlayerCard(trigger.target, "he", true);
const {
result: { bool },
- } = await trigger.target.chooseBool(`是否令${get.translation(player)}至你的距离于本回合内+2?`).set("ai", () => true);
+ } = await trigger.target
+ .chooseBool(`是否令${get.translation(player)}至你的距离于本回合内+2?`)
+ .set("ai", () => true);
if (bool) {
player.addTempSkill("jsrgeqian_distance");
if (!player.storage.jsrgeqian_distance) player.storage.jsrgeqian_distance = {};
const id = trigger.target.playerid;
- if (typeof player.storage.jsrgeqian_distance[id] != "number") player.storage.jsrgeqian_distance[id] = 0;
+ if (typeof player.storage.jsrgeqian_distance[id] != "number")
+ player.storage.jsrgeqian_distance[id] = 0;
player.storage.jsrgeqian_distance[id] += 2;
player.markSkill("jsrgeqian_distance");
}
@@ -1137,11 +1338,13 @@ game.import("character", function () {
while (player.countCards("h") > 0) {
const {
result: { bool, cards },
- } = await player.chooseCard(get.prompt("jsrgeqian"), "你可以蓄谋任意次").set("ai", card => {
- const player = get.player();
- if (player.hasValueTarget(card)) return player.getUseValue(card);
- return 0;
- });
+ } = await player
+ .chooseCard(get.prompt("jsrgeqian"), "你可以蓄谋任意次")
+ .set("ai", (card) => {
+ const player = get.player();
+ if (player.hasValueTarget(card)) return player.getUseValue(card);
+ return 0;
+ });
if (!bool) break;
await player.addJudge({ name: "xumou_jsrg" }, cards);
}
@@ -1179,7 +1382,7 @@ game.import("character", function () {
animationColor: "fire",
filter(event, player) {
return (
- game.countPlayer(current => {
+ game.countPlayer((current) => {
return player.inRange(current);
}) == 1
);
@@ -1210,8 +1413,11 @@ game.import("character", function () {
if (event.target != player) return !player.hasSkill("jsrgdaimou_other");
return (
!player.hasSkill("jsrgdaimou_me") &&
- player.hasCard(card => {
- return (card.viewAs || card.name) == "xumou_jsrg" && lib.filter.cardDiscardable(card, player, "jsrgdaimou");
+ player.hasCard((card) => {
+ return (
+ (card.viewAs || card.name) == "xumou_jsrg" &&
+ lib.filter.cardDiscardable(card, player, "jsrgdaimou")
+ );
}, "j")
);
},
@@ -1226,16 +1432,16 @@ game.import("character", function () {
.chooseButton(
[
"殆谋:请弃置区域里的一张蓄谋牌",
- player.getCards("j", card => {
+ player.getCards("j", (card) => {
return (card.viewAs || card.name) == "xumou_jsrg";
}),
],
true
)
- .set("filterButton", button => {
+ .set("filterButton", (button) => {
return lib.filter.cardDiscardable(button.link, get.player(), "jsrgdaimou");
})
- .set("ai", button => {
+ .set("ai", (button) => {
const player = get.player();
return 1 / Math.max(0.01, player.getUseValue(button.link));
});
@@ -1245,7 +1451,9 @@ game.import("character", function () {
} else {
const {
result: { bool },
- } = await player.chooseBool(get.prompt("jsrgdaimou"), "你可以用牌堆顶的牌蓄谋").set("ai", () => true);
+ } = await player
+ .chooseBool(get.prompt("jsrgdaimou"), "你可以用牌堆顶的牌蓄谋")
+ .set("ai", () => true);
if (bool) {
player.logSkill("jsrgdaimou");
player.addTempSkill("jsrgdaimou_other");
@@ -1264,7 +1472,7 @@ game.import("character", function () {
direct: true,
async content(event, trigger, player) {
if (
- !player.hasCard(card => {
+ !player.hasCard((card) => {
return (card.viewAs || card.name) == "xumou_jsrg";
}, "j")
) {
@@ -1278,13 +1486,13 @@ game.import("character", function () {
.chooseButton(
[
"是否弃置区域里的任意张蓄谋牌并失去〖芳洁〗?",
- player.getCards("j", card => {
+ player.getCards("j", (card) => {
return (card.viewAs || card.name) == "xumou_jsrg";
}),
],
[1, Infinity]
)
- .set("filterButton", button => {
+ .set("filterButton", (button) => {
return lib.filter.cardDiscardable(button.link, get.player(), "jsrgdaimou");
})
.set("ai", () => 0);
@@ -1337,10 +1545,18 @@ game.import("character", function () {
target(player, target) {
let dis = 0.5 - 0.75 * target.needsToDiscard(2, null, true);
if (dis > 0) return dis;
- if (player.hasSkill("jsrgjingju") && player.hasZhuSkill("jsrgweizhui") && get.attitude(player, target) > 0)
- return game.countPlayer(current => {
- if (current === player || current === target || current.group !== "wei") return false;
- return player.hasZhuSkill("jsrgweizhui", current) && get.attitude(player, current) > 0;
+ if (
+ player.hasSkill("jsrgjingju") &&
+ player.hasZhuSkill("jsrgweizhui") &&
+ get.attitude(player, target) > 0
+ )
+ return game.countPlayer((current) => {
+ if (current === player || current === target || current.group !== "wei")
+ return false;
+ return (
+ player.hasZhuSkill("jsrgweizhui", current) &&
+ get.attitude(player, current) > 0
+ );
});
return dis;
},
@@ -1356,24 +1572,32 @@ game.import("character", function () {
!player.canMoveCard(
null,
false,
- game.filterPlayer(i => i != player),
+ game.filterPlayer((i) => i != player),
player,
- card => {
+ (card) => {
return get.position(card) == "j";
}
)
)
return false;
- return get.inpileVCardList(info => {
+ return get.inpileVCardList((info) => {
if (info[0] != "basic") return false;
- return event.filterCard(get.autoViewAs({ name: info[2], nature: info[3] }, "unsure"), player, event);
+ return event.filterCard(
+ get.autoViewAs({ name: info[2], nature: info[3] }, "unsure"),
+ player,
+ event
+ );
}).length;
},
chooseButton: {
dialog: function (event, player) {
- const vcards = get.inpileVCardList(info => {
+ const vcards = get.inpileVCardList((info) => {
if (info[0] != "basic") return false;
- return event.filterCard(get.autoViewAs({ name: info[2], nature: info[3] }, "unsure"), player, event);
+ return event.filterCard(
+ get.autoViewAs({ name: info[2], nature: info[3] }, "unsure"),
+ player,
+ event
+ );
});
return ui.create.dialog("惊惧", [vcards, "vcard"], "hidden");
},
@@ -1382,9 +1606,12 @@ game.import("character", function () {
if (get.event().getParent().type != "phase") return 1;
return (
get.player().getUseValue({ name: button.link[2], nature: button.link[3] }) +
- game.countPlayer(current => {
+ game.countPlayer((current) => {
if (current === player || current.group !== "wei") return false;
- return player.hasZhuSkill("jsrgweizhui", current) && get.attitude(player, current) > 0;
+ return (
+ player.hasZhuSkill("jsrgweizhui", current) &&
+ get.attitude(player, current) > 0
+ );
})
);
},
@@ -1402,9 +1629,9 @@ game.import("character", function () {
player
.moveCard(
`惊惧:将其他角色判定区里的牌移动至你的判定区`,
- game.filterPlayer(i => i != player),
+ game.filterPlayer((i) => i != player),
player,
- card => {
+ (card) => {
return get.position(card) == "j";
}
)
@@ -1424,7 +1651,13 @@ game.import("character", function () {
};
},
prompt: function (links, player) {
- return "选择" + get.translation(links[0][3] || "") + "【" + get.translation(links[0][2]) + "】的目标";
+ return (
+ "选择" +
+ get.translation(links[0][3] || "") +
+ "【" +
+ get.translation(links[0][2]) +
+ "】的目标"
+ );
},
},
ai: {
@@ -1432,7 +1665,7 @@ game.import("character", function () {
const player = get.player(),
event = _status.event;
if (
- player.canMoveCard(null, false, game.filterPlayer(), player, card => {
+ player.canMoveCard(null, false, game.filterPlayer(), player, (card) => {
return get.position(card) == "j";
})
) {
@@ -1441,7 +1674,10 @@ game.import("character", function () {
return 0.5;
}
} else {
- if (event.filterCard({ name: "tao" }, player, event) || event.filterCard({ name: "shan" }, player, event)) {
+ if (
+ event.filterCard({ name: "tao" }, player, event) ||
+ event.filterCard({ name: "shan" }, player, event)
+ ) {
return 4;
}
if (event.filterCard({ name: "sha" }, player, event)) {
@@ -1455,7 +1691,7 @@ game.import("character", function () {
respondSha: true,
respondShan: true,
skillTagFilter: function (player, tag, arg) {
- return player.canMoveCard(null, false, game.filterPlayer(), player, card => {
+ return player.canMoveCard(null, false, game.filterPlayer(), player, (card) => {
return get.position(card) == "j";
});
},
@@ -1475,19 +1711,38 @@ game.import("character", function () {
zhuSkill: true,
direct: true,
filter(event, player) {
- return player != event.player && event.player.group == "wei" && event.player.isIn() && player.hasZhuSkill("jsrgweizhui", event.player);
+ return (
+ player != event.player &&
+ event.player.group == "wei" &&
+ event.player.isIn() &&
+ player.hasZhuSkill("jsrgweizhui", event.player)
+ );
},
async content(event, trigger, player) {
const {
result: { bool, cards },
} = await trigger.player
- .chooseCard(`是否响应${get.translation(player)}的主公技【危坠】?`, "将一张黑色手牌当【过河拆桥】对其使用", (card, player) => {
- if (get.color(card) != "black") return false;
- return player.canUse(get.autoViewAs({ name: "guohe" }, [card]), get.event("target"));
- })
+ .chooseCard(
+ `是否响应${get.translation(player)}的主公技【危坠】?`,
+ "将一张黑色手牌当【过河拆桥】对其使用",
+ (card, player) => {
+ if (get.color(card) != "black") return false;
+ return player.canUse(
+ get.autoViewAs({ name: "guohe" }, [card]),
+ get.event("target")
+ );
+ }
+ )
.set("target", player)
- .set("ai", card => {
- if (get.effect(get.event("target"), get.autoViewAs({ name: "guohe" }, [card]), player) <= 0) return 0;
+ .set("ai", (card) => {
+ if (
+ get.effect(
+ get.event("target"),
+ get.autoViewAs({ name: "guohe" }, [card]),
+ player
+ ) <= 0
+ )
+ return 0;
return 7 - get.value(card);
});
if (bool) {
@@ -1509,7 +1764,9 @@ game.import("character", function () {
const current = targets.shift();
const {
result: { bool },
- } = await current.chooseBool(`是否响应${get.translation(player)}的【邀宴】,于回合结束参与议事?`).set("ai", () => Math.random() < 0.5);
+ } = await current
+ .chooseBool(`是否响应${get.translation(player)}的【邀宴】,于回合结束参与议事?`)
+ .set("ai", () => Math.random() < 0.5);
if (bool) {
toDebateList.add(current);
current.popup("同意", "wood");
@@ -1532,54 +1789,67 @@ game.import("character", function () {
popup: false,
onremove: true,
filter(event, player) {
- return player.getStorage("jsrgyaoyan_hold").some(i => i.isIn());
+ return player.getStorage("jsrgyaoyan_hold").some((i) => i.isIn());
},
async content(event, trigger, player) {
- player.chooseToDebate(player.getStorage("jsrgyaoyan_hold").filter(i => i.isIn())).set("callback", async event => {
- const { bool, opinion, targets } = event.debateResult;
- if (bool && opinion) {
- if (opinion == "red") {
- const notDebated = game.filterPlayer().removeArray(targets);
- if (notDebated.length) {
- const { result } = await player
- .chooseTarget("获得任意名未议事的角色的各一张手牌", [1, Infinity], true, (card, player, target) => {
- return get.event("targets").includes(target) && target.countGainableCards(player, "h");
- })
- .set("targets", notDebated)
- .set("ai", target => {
- const player = get.player();
- const att = get.attitude(player, target);
- return -att;
- });
- if (result.bool) {
- const targets = result.targets;
- targets.sortBySeat();
- player.line(targets, "green");
- for (const current of targets) {
- await player.gainPlayerCard(current, "h", true);
+ player
+ .chooseToDebate(player.getStorage("jsrgyaoyan_hold").filter((i) => i.isIn()))
+ .set("callback", async (event) => {
+ const { bool, opinion, targets } = event.debateResult;
+ if (bool && opinion) {
+ if (opinion == "red") {
+ const notDebated = game.filterPlayer().removeArray(targets);
+ if (notDebated.length) {
+ const { result } = await player
+ .chooseTarget(
+ "获得任意名未议事的角色的各一张手牌",
+ [1, Infinity],
+ true,
+ (card, player, target) => {
+ return (
+ get.event("targets").includes(target) &&
+ target.countGainableCards(player, "h")
+ );
+ }
+ )
+ .set("targets", notDebated)
+ .set("ai", (target) => {
+ const player = get.player();
+ const att = get.attitude(player, target);
+ return -att;
+ });
+ if (result.bool) {
+ const targets = result.targets;
+ targets.sortBySeat();
+ player.line(targets, "green");
+ for (const current of targets) {
+ await player.gainPlayerCard(current, "h", true);
+ }
}
}
- }
- } else {
- const {
- result: { bool, targets: targets2 },
- } = await player
- .chooseTarget("是否对一名议事的角色造成2点伤害?", (card, player, target) => {
- return get.event("targets").includes(target);
- })
- .set("targets", targets)
- .set("ai", target => {
- const player = get.player();
- const eff = get.damageEffect(target, player, player);
- return eff;
- });
- if (bool) {
- player.line(targets2[0]);
- targets2[0].damage(2);
+ } else {
+ const {
+ result: { bool, targets: targets2 },
+ } = await player
+ .chooseTarget(
+ "是否对一名议事的角色造成2点伤害?",
+ (card, player, target) => {
+ return get.event("targets").includes(target);
+ }
+ )
+ .set("targets", targets)
+ .set("ai", (target) => {
+ const player = get.player();
+ const eff = get.damageEffect(target, player, player);
+ return eff;
+ });
+ if (bool) {
+ player.line(targets2[0]);
+ targets2[0].damage(2);
+ }
}
}
- }
- });
+ });
},
},
},
@@ -1591,17 +1861,17 @@ game.import("character", function () {
if (!event.targets.includes(player)) return false;
const damagedPlayers = player
.getHistory("sourceDamage")
- .map(evt => evt.player)
+ .map((evt) => evt.player)
.toUniqued();
let dissent;
const colors = ["red", "black"];
for (const color of colors) {
- if (event[color].some(i => i[0] == player)) {
- dissent = colors.find(i => i != color);
+ if (event[color].some((i) => i[0] == player)) {
+ dissent = colors.find((i) => i != color);
break;
}
}
- return event[dissent].some(i => damagedPlayers.includes(i[0]));
+ return event[dissent].some((i) => damagedPlayers.includes(i[0]));
},
forced: true,
locked: false,
@@ -1610,15 +1880,15 @@ game.import("character", function () {
let myOpinion, dissent;
const colors = ["red", "black"];
for (const color of colors) {
- if (trigger[color].some(i => i[0] == player)) {
+ if (trigger[color].some((i) => i[0] == player)) {
myOpinion = color;
- dissent = colors.find(i => i != color);
+ dissent = colors.find((i) => i != color);
break;
}
}
const damagedPlayers = player
.getHistory("sourceDamage")
- .map(evt => evt.player)
+ .map((evt) => evt.player)
.toUniqued();
let dissident = [];
for (let i = 0; i < trigger[dissent].length; i++) {
@@ -1653,8 +1923,10 @@ game.import("character", function () {
},
filter(event, player) {
const level = event.player != player ? 1 : 2;
- if (event.player != player && event.getParent(level).name != "tuixinzhifu") return false;
- if (event.player == player && event.getParent(level).name != "tuixinzhifu") return false;
+ if (event.player != player && event.getParent(level).name != "tuixinzhifu")
+ return false;
+ if (event.player == player && event.getParent(level).name != "tuixinzhifu")
+ return false;
const card = event.getParent(level + 1).card;
return card && card.storage && card.storage.jsrgdanxin;
},
@@ -1665,10 +1937,10 @@ game.import("character", function () {
const level = trigger.player != player ? 1 : 2;
const { targets } = trigger.getParent(level + 1);
await player.showCards(trigger.cards);
- if (trigger.cards.some(card => get.suit(card) == "heart")) {
+ if (trigger.cards.some((card) => get.suit(card) == "heart")) {
const owners = trigger.cards
- .filter(card => get.suit(card) == "heart")
- .map(card => get.owner(card))
+ .filter((card) => get.suit(card) == "heart")
+ .map((card) => get.owner(card))
.toUniqued();
for (const owner of owners) {
if (owner && owner.isIn()) await owner.recover();
@@ -1678,7 +1950,8 @@ game.import("character", function () {
player.addTempSkill("jsrgdanxin_distance");
if (!player.storage.jsrgdanxin_distance) player.storage.jsrgdanxin_distance = {};
const id = targets[0].playerid;
- if (typeof player.storage.jsrgdanxin_distance[id] != "number") player.storage.jsrgdanxin_distance[id] = 0;
+ if (typeof player.storage.jsrgdanxin_distance[id] != "number")
+ player.storage.jsrgdanxin_distance[id] = 0;
player.storage.jsrgdanxin_distance[id]++;
player.markSkill("jsrgdanxin_distance");
},
@@ -1713,7 +1986,7 @@ game.import("character", function () {
forced: true,
direct: true,
filter(event, player) {
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
return current.countCards("e");
});
},
@@ -1724,14 +1997,18 @@ game.import("character", function () {
.chooseTarget(
"封乡:与一名其他角色交换装备区里的所有牌",
(card, player, target) => {
- return target.countCards("e") + player.countCards("e") > 0 && player != target;
+ return (
+ target.countCards("e") + player.countCards("e") > 0 && player != target
+ );
},
true
)
- .set("ai", target => {
+ .set("ai", (target) => {
const player = get.player();
const att = get.attitude(player, target);
- let delta = get.value(target.getCards("e"), player) - get.value(player.getCards("e"), player);
+ let delta =
+ get.value(target.getCards("e"), player) -
+ get.value(player.getCards("e"), player);
if (att > 0) {
if (delta < 0) delta += att / 3;
} else {
@@ -1753,7 +2030,7 @@ game.import("character", function () {
enable: "phaseUse",
usable: 1,
filter(event, player) {
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
return current.countCards("h") && current != player;
});
},
@@ -1767,10 +2044,10 @@ game.import("character", function () {
const targets = event.targets.sortBySeat();
const next = player
.chooseCardOL(targets, "请展示一张手牌", true)
- .set("ai", card => {
+ .set("ai", (card) => {
return -get.value(card);
})
- .set("aiCard", target => {
+ .set("aiCard", (target) => {
const hs = target.getCards("h");
return { bool: true, cards: [hs.randomGet()] };
});
@@ -1786,14 +2063,15 @@ game.import("character", function () {
(targets, cards, id, player) => {
var dialog = ui.create.dialog(get.translation(player) + "发动了【浮海】", cards);
dialog.videoId = id;
- const getName = target => {
+ const getName = (target) => {
if (target._tempTranslate) return target._tempTranslate;
var name = target.name;
if (lib.translate[name + "_ab"]) return lib.translate[name + "_ab"];
return get.translation(name);
};
for (let i = 0; i < targets.length; i++) {
- dialog.buttons[i].querySelector(".info").innerHTML = getName(targets[i]) + "|" + get.strNumber(cards[i].number);
+ dialog.buttons[i].querySelector(".info").innerHTML =
+ getName(targets[i]) + "|" + get.strNumber(cards[i].number);
}
},
targets,
@@ -1854,7 +2132,7 @@ game.import("character", function () {
if (!hs.length) return false;
const evt = event.getParent("phaseUse");
if (!evt || evt.player != player) return false;
- const num1 = player.getHistory("useCard", evtx => {
+ const num1 = player.getHistory("useCard", (evtx) => {
return evtx.getParent("phaseUse") == evt;
}).length;
if (hs.length < num1) return false;
@@ -1864,7 +2142,8 @@ game.import("character", function () {
},
prompt2(event, player) {
let str = "展示所有手牌,额外结算一次";
- if (event.card.name == "sha" && game.hasNature(event.card)) str += get.translation(event.card.nature);
+ if (event.card.name == "sha" && game.hasNature(event.card))
+ str += get.translation(event.card.nature);
return str + "【" + get.translation(event.card.name) + "】";
},
check(event, player) {
@@ -1934,16 +2213,19 @@ game.import("character", function () {
filterTarget: true,
async content(event, trigger, player) {
const target = event.target;
- const targets = game.filterPlayer(current => target.inRange(current) && current != player).sortBySeat(player);
+ const targets = game
+ .filterPlayer((current) => target.inRange(current) && current != player)
+ .sortBySeat(player);
if (!targets.length) return;
while (targets.length) {
const current = targets.shift();
- if (current.countCards("he")) await current.chooseToDiscard("驰应:请弃置一张牌", "he", true);
+ if (current.countCards("he"))
+ await current.chooseToDiscard("驰应:请弃置一张牌", "he", true);
}
let cards = [];
- game.getGlobalHistory("cardMove", evt => {
+ game.getGlobalHistory("cardMove", (evt) => {
if (evt.getParent(3) == event) {
- cards.addArray(evt.cards.filter(card => get.type(card) == "basic"));
+ cards.addArray(evt.cards.filter((card) => get.type(card) == "basic"));
}
});
if (cards.length <= target.getHp()) {
@@ -1955,7 +2237,9 @@ game.import("character", function () {
order: 6,
result: {
target(player, target) {
- const targets = game.filterPlayer(current => target.inRange(current) && current != player);
+ const targets = game.filterPlayer(
+ (current) => target.inRange(current) && current != player
+ );
let eff = 0;
for (const targetx of targets) {
let effx = get.effect(targetx, { name: "guohe_copy2" }, player, target);
@@ -1978,11 +2262,11 @@ game.import("character", function () {
async content(event, trigger, player) {
const { result } = await player.judge();
let num = 0;
- game.getGlobalHistory("cardMove", evt => {
+ game.getGlobalHistory("cardMove", (evt) => {
if (evt.name != "cardsDiscard") {
if (evt.name != "lose" || evt.position != ui.discardPile) return false;
}
- num += evt.cards.filter(i => get.color(i, false) == result.color).length;
+ num += evt.cards.filter((i) => get.color(i, false) == result.color).length;
});
if (num > 0) player.draw(num);
},
@@ -1995,18 +2279,29 @@ game.import("character", function () {
const storage = player.getStorage("jsrgzunwei");
return (
storage.length < 3 &&
- game.hasPlayer(current => {
- return (player.isDamaged() && current.getHp() > player.getHp() && !storage.includes(2)) || (current.countCards("h") > player.countCards("h") && !storage.includes(0)) || (current.countCards("e") > player.countCards("e") && !storage.includes(1));
+ game.hasPlayer((current) => {
+ return (
+ (player.isDamaged() &&
+ current.getHp() > player.getHp() &&
+ !storage.includes(2)) ||
+ (current.countCards("h") > player.countCards("h") && !storage.includes(0)) ||
+ (current.countCards("e") > player.countCards("e") && !storage.includes(1))
+ );
})
);
},
chooseButton: {
dialog(event, player) {
- const list = ["选择手牌数大于你的一名角色", "选择装备数大于你的一名角色", "选择体力值大于你的一名角色"];
+ const list = [
+ "选择手牌数大于你的一名角色",
+ "选择装备数大于你的一名角色",
+ "选择体力值大于你的一名角色",
+ ];
const choiceList = ui.create.dialog("尊位:请选择一项", "forcebutton", "hidden");
choiceList.add([
list.map((item, i) => {
- if (player.getStorage("jsrgzunwei").includes(i)) item = `${item}`;
+ if (player.getStorage("jsrgzunwei").includes(i))
+ item = `${item}`;
return [i, item];
}),
"textbutton",
@@ -2018,17 +2313,17 @@ game.import("character", function () {
if (player.getStorage("jsrgzunwei").includes(button.link)) return false;
if (button.link == 2) {
if (!player.isDamaged()) return false;
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
return current.getHp() > player.getHp();
});
}
if (button.link == 0) {
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
return current.countCards("h") > player.countCards("h");
});
}
if (button.link == 1) {
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
return current.countCards("e") > player.countCards("e");
});
}
@@ -2066,7 +2361,11 @@ game.import("character", function () {
}
},
prompt(links) {
- return ["选择一名手牌数大于你的其他角色,将手牌数摸至与其相同(至多摸五张)", "选择一名装备区内牌数大于你的其他角色,将其装备区里的牌移至你的装备区,直到你装备数不小于其", "选择一名体力值大于你的其他角色,将体力值回复至与其相同"][links[0]];
+ return [
+ "选择一名手牌数大于你的其他角色,将手牌数摸至与其相同(至多摸五张)",
+ "选择一名装备区内牌数大于你的其他角色,将其装备区里的牌移至你的装备区,直到你装备数不小于其",
+ "选择一名体力值大于你的其他角色,将体力值回复至与其相同",
+ ][links[0]];
},
},
backups: [
@@ -2098,7 +2397,7 @@ game.import("character", function () {
const target = event.target;
do {
if (
- !target.countCards("e", card => {
+ !target.countCards("e", (card) => {
return player.canEquip(card);
})
)
@@ -2106,8 +2405,14 @@ game.import("character", function () {
const {
result: { bool, links },
} = await player
- .chooseButton([`尊位:将${get.translation(target)}的一张装备牌移至你的区域内`, target.getCards("e")], true)
- .set("filterButton", button => {
+ .chooseButton(
+ [
+ `尊位:将${get.translation(target)}的一张装备牌移至你的区域内`,
+ target.getCards("e"),
+ ],
+ true
+ )
+ .set("filterButton", (button) => {
return get.player().canEquip(button.link);
})
.set("ai", get.buttonValue);
@@ -2162,9 +2467,9 @@ game.import("character", function () {
audio: 2,
trigger: { player: "phaseZhunbeiBegin" },
filter: function (event, player) {
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
if (current == player) return false;
- return current.hasCard(card => {
+ return current.hasCard((card) => {
return lib.filter.canBeDiscarded(card, player, current);
}, "e");
});
@@ -2174,18 +2479,27 @@ game.import("character", function () {
content: function () {
"step 0";
player
- .chooseTarget(get.prompt("jsrgqingzi"), "弃置任意名其他角色装备区里的一张牌,然后令这些角色获得〖神速〗直到你的下回合开始", [1, Infinity], (card, player, target) => {
- return (
- target != player &&
- target.hasCard(card => {
- return lib.filter.canBeDiscarded(card, player, target);
- }, "e")
- );
- })
- .set("ai", target => {
+ .chooseTarget(
+ get.prompt("jsrgqingzi"),
+ "弃置任意名其他角色装备区里的一张牌,然后令这些角色获得〖神速〗直到你的下回合开始",
+ [1, Infinity],
+ (card, player, target) => {
+ return (
+ target != player &&
+ target.hasCard((card) => {
+ return lib.filter.canBeDiscarded(card, player, target);
+ }, "e")
+ );
+ }
+ )
+ .set("ai", (target) => {
var player = _status.event.player;
- return target.hasCard(card => {
- return (lib.filter.canBeDiscarded(card, player, target) && get.value(card, target) > 3) || (target.hp == 1 && get.value(card, target) > 0);
+ return target.hasCard((card) => {
+ return (
+ (lib.filter.canBeDiscarded(card, player, target) &&
+ get.value(card, target) > 3) ||
+ (target.hp == 1 && get.value(card, target) > 0)
+ );
});
});
"step 1";
@@ -2200,7 +2514,7 @@ game.import("character", function () {
"step 2";
var target = targets[num];
if (
- target.hasCard(card => {
+ target.hasCard((card) => {
return lib.filter.canBeDiscarded(card, player, target);
}, "e")
) {
@@ -2225,7 +2539,10 @@ game.import("character", function () {
onremove: true,
filter: function (event, player) {
if (event.name == "die") {
- return player == event.player || player.getStorage("jsrgqingzi_clear").includes(event.player);
+ return (
+ player == event.player ||
+ player.getStorage("jsrgqingzi_clear").includes(event.player)
+ );
}
return player.getStorage("jsrgqingzi_clear").length > 0;
},
@@ -2263,7 +2580,7 @@ game.import("character", function () {
trigger: { player: "damageEnd" },
filter: function (event, player) {
if (!event.source || !event.source.isIn()) return false;
- return player.hasCard(card => {
+ return player.hasCard((card) => {
return lib.filter.cardDiscardable(card, player, "jsrgdingce");
});
},
@@ -2273,8 +2590,11 @@ game.import("character", function () {
var target = trigger.source;
event.target = target;
player
- .chooseToDiscard(get.prompt("jsrgdingce", target), "弃置你与其的各一张手牌。若这两张牌颜色相同,你视为使用一张【洞烛先机】。")
- .set("ai", card => {
+ .chooseToDiscard(
+ get.prompt("jsrgdingce", target),
+ "弃置你与其的各一张手牌。若这两张牌颜色相同,你视为使用一张【洞烛先机】。"
+ )
+ .set("ai", (card) => {
if (_status.event.goon) return 6 - get.value(card);
return 0;
})
@@ -2284,7 +2604,7 @@ game.import("character", function () {
player
.getCards("h")
.concat(target.getCards("h"))
- .filter(card => {
+ .filter((card) => {
return get.value(card) < 5.5;
}).length >= 2
)
@@ -2295,9 +2615,12 @@ game.import("character", function () {
if (target.countDiscardableCards(player, "h")) {
var next = player.discardPlayerCard(target, "h", true);
if (target == player)
- next.set("ai", button => {
+ next.set("ai", (button) => {
var card = button.link;
- return (get.color(card, false) == _status.event.color ? 7.5 : 5) - get.value(card);
+ return (
+ (get.color(card, false) == _status.event.color ? 7.5 : 5) -
+ get.value(card)
+ );
}).set("color", get.color(event.card, false));
} else event.finish();
} else event.finish();
@@ -2317,7 +2640,7 @@ game.import("character", function () {
locked: false,
filter: function (event, player) {
if (!event.jsrgzhenfeng) return false;
- return event.jsrgzhenfeng.some(info =>
+ return event.jsrgzhenfeng.some((info) =>
event.filterCard(
{
name: info[2],
@@ -2333,15 +2656,18 @@ game.import("character", function () {
onChooseToUse: function (event) {
if (!event.jsrgzhenfeng && !game.online) {
var str = "";
- game.countPlayer(current => {
- current.getSkills(null, false, false).forEach(skill => {
+ game.countPlayer((current) => {
+ current.getSkills(null, false, false).forEach((skill) => {
var info = get.info(skill);
if (!info || info.charlotte) return;
var translation = get.skillInfoTranslation(skill, current);
str += translation;
});
});
- event.set("jsrgzhenfeng", lib.skill.jsrgzhenfeng.getInclusion(str, null, event.player));
+ event.set(
+ "jsrgzhenfeng",
+ lib.skill.jsrgzhenfeng.getInclusion(str, null, event.player)
+ );
}
},
getInclusion: function (str, checkCard, player) {
@@ -2361,7 +2687,8 @@ game.import("character", function () {
const reg1 = `【${get.translation(nature) + get.translation(name)}】`,
reg2 = `${get.translation(nature)}【${get.translation(name)}】`;
if (str.includes(reg1) || str.includes(reg2)) {
- if (checkCard && checkCard.name == name && checkCard.nature == nature) return true;
+ if (checkCard && checkCard.name == name && checkCard.nature == nature)
+ return true;
list.push([type, "", name, nature]);
}
}
@@ -2376,7 +2703,7 @@ game.import("character", function () {
},
chooseButton: {
dialog: function (event, player) {
- var list = event.jsrgzhenfeng.filter(info => {
+ var list = event.jsrgzhenfeng.filter((info) => {
return event.filterCard(
{
name: info[2],
@@ -2411,18 +2738,29 @@ game.import("character", function () {
isCard: true,
};
var eff = player.getUseValue(card);
- if (["wugu", "zhulu_card", "yiyi", "lulitongxin", "lianjunshengyan", "diaohulishan"].includes(button.link[2])) eff /= 5;
+ if (
+ [
+ "wugu",
+ "zhulu_card",
+ "yiyi",
+ "lulitongxin",
+ "lianjunshengyan",
+ "diaohulishan",
+ ].includes(button.link[2])
+ )
+ eff /= 5;
var info = get.info(card);
if (info.toself) {
var str = player
.getSkills(null, false, false)
- .map(skill => {
+ .map((skill) => {
var info = get.info(skill);
if (!info || info.charlotte) return;
return get.skillInfoTranslation(skill, player);
})
.join("\n");
- if (lib.skill.jsrgzhenfeng.getInclusion(str, card)) eff += get.damageEffect(player, player, player);
+ if (lib.skill.jsrgzhenfeng.getInclusion(str, card))
+ eff += get.damageEffect(player, player, player);
}
return eff;
},
@@ -2448,7 +2786,11 @@ game.import("character", function () {
};
},
prompt: function (links, player) {
- return "视为使用一张" + (get.translation(links[0][3]) || "") + get.translation(links[0][2]);
+ return (
+ "视为使用一张" +
+ (get.translation(links[0][3]) || "") +
+ get.translation(links[0][2])
+ );
},
},
mod: {
@@ -2479,7 +2821,7 @@ game.import("character", function () {
// debugger
var str = event.target
.getSkills(null, false, false)
- .map(skill => {
+ .map((skill) => {
var info = get.info(skill);
if (!info || info.charlotte) return;
return get.skillInfoTranslation(skill, event.target);
@@ -2501,7 +2843,7 @@ game.import("character", function () {
filter: function (event, player) {
return (
player.countCards("he") >= 2 &&
- game.hasPlayer(current => {
+ game.hasPlayer((current) => {
return current.inRange(event.player) && player.canUse("sha", current, false);
})
);
@@ -2511,7 +2853,7 @@ game.import("character", function () {
"step 0";
player
.chooseToDiscard(get.prompt2("jsrgbaohe"), 2, "he")
- .set("ai", card => {
+ .set("ai", (card) => {
var val = _status.event.val;
if (val > 20) return 6 - get.value(card);
if (val > 0) return 4 - get.value(card);
@@ -2520,10 +2862,13 @@ game.import("character", function () {
.set(
"val",
game
- .filterPlayer(current => {
- return current.inRange(trigger.player) && player.canUse("sha", current, false);
+ .filterPlayer((current) => {
+ return (
+ current.inRange(trigger.player) &&
+ player.canUse("sha", current, false)
+ );
})
- .map(i => get.effect(i, { name: "sha" }, player, player))
+ .map((i) => get.effect(i, { name: "sha" }, player, player))
.reduce((p, c) => {
return p + c;
}, 0)
@@ -2531,12 +2876,16 @@ game.import("character", function () {
.set("logSkill", "jsrgbaohe");
"step 1";
if (result.bool) {
- var targets = game.filterPlayer(current => {
+ var targets = game.filterPlayer((current) => {
return current.inRange(trigger.player) && player.canUse("sha", current, false);
});
if (targets.length) {
game.delayex();
- player.useCard({ name: "sha", isCard: true, storage: { jsrgbaohe: true } }, targets, false);
+ player.useCard(
+ { name: "sha", isCard: true, storage: { jsrgbaohe: true } },
+ targets,
+ false
+ );
player.addTempSkill("jsrgbaohe_add");
}
}
@@ -2552,7 +2901,13 @@ game.import("character", function () {
filter: function (event, player) {
let evt = event.getParent(3),
respondTo = event.respondTo;
- if (evt.name != "useCard" || !Array.isArray(respondTo) || !respondTo[1].storage || !respondTo[1].storage.jsrgbaohe) return false;
+ if (
+ evt.name != "useCard" ||
+ !Array.isArray(respondTo) ||
+ !respondTo[1].storage ||
+ !respondTo[1].storage.jsrgbaohe
+ )
+ return false;
return evt.targets.length > evt.num + 1;
},
logTarget: function (event) {
@@ -2593,7 +2948,7 @@ game.import("character", function () {
var player = get.player();
if (
ui.selected.cards.length >=
- game.countPlayer(current => {
+ game.countPlayer((current) => {
return current != player && get.attitude(player, current) > 0;
})
)
@@ -2637,7 +2992,8 @@ game.import("character", function () {
var card = ui.selected.cards[ui.selected.targets.length];
if (!card) return 0;
if (get.value(card) < 0) return -1;
- if (get.value(card) < 1.5 && player.hasSkill("jsrgbaohe")) return (get.sgnAttitude(player, target) + 0.01) / 5;
+ if (get.value(card) < 1.5 && player.hasSkill("jsrgbaohe"))
+ return (get.sgnAttitude(player, target) + 0.01) / 5;
return Math.sqrt(5 - Math.min(4, target.countCards("h")));
},
},
@@ -2668,7 +3024,7 @@ game.import("character", function () {
att = get.attitude(player, target) > 0 ? 1 : -1;
var list = get
.event("controls")
- .map(i => [
+ .map((i) => [
i,
target
.getCards("he")
@@ -2690,10 +3046,12 @@ game.import("character", function () {
player.popup(color, color == "red" ? "fire" : "thunder");
game.log(player, "声明了", color);
var prompt = `追命:${get.translation(player)}声明了${get.translation(color)}`,
- prompt2 = `请弃置任意张牌,然后其展示你一张牌,若此牌颜色为${get.translation(color)},此【杀】不计入次数限制、不可被响应且伤害+1`;
+ prompt2 = `请弃置任意张牌,然后其展示你一张牌,若此牌颜色为${get.translation(
+ color
+ )},此【杀】不计入次数限制、不可被响应且伤害+1`;
yield target
.chooseToDiscard(prompt, prompt2, [1, Infinity], "he", true)
- .set("ai", card => {
+ .set("ai", (card) => {
var color = get.event("color"),
player = get.player();
if (get.position(card) == "e" && get.color(card) == color) return 2;
@@ -2704,7 +3062,7 @@ game.import("character", function () {
if (target.countCards("he"))
result = yield player
.choosePlayerCard(target, "he", true)
- .set("ai", button => {
+ .set("ai", (button) => {
var color = get.event("color"),
att = get.event("att");
if (get.position(button.link) == "e" && get.color(button.link) == color) {
@@ -2744,7 +3102,11 @@ game.import("character", function () {
trigger: { global: "useCardAfter" },
filter: function (event, player) {
if (event.card.name != "sha") return false;
- return event.targets.some(i => i.isIn() && i.hasHistory("lose", evt => evt.cards2.length)) && player.getExpansions("jsrgshacheng").length;
+ return (
+ event.targets.some(
+ (i) => i.isIn() && i.hasHistory("lose", (evt) => evt.cards2.length)
+ ) && player.getExpansions("jsrgshacheng").length
+ );
},
direct: true,
group: "jsrgshacheng_build",
@@ -2754,20 +3116,26 @@ game.import("character", function () {
game.broadcastAll(function () {
_status.noclearcountdown = true;
});
- var targets = trigger.targets.filter(i => i.isIn() && i.hasHistory("lose", evt => evt.cards2.length));
+ var targets = trigger.targets.filter(
+ (i) => i.isIn() && i.hasHistory("lose", (evt) => evt.cards2.length)
+ );
player
- .chooseTarget(get.prompt("jsrgshacheng"), "令一名目标角色摸X张牌,然后移去一张“城”(X为对应角色本回合失去过的牌数且至多为5)", (card, player, target) => {
- return get.event("targets").includes(target);
- })
+ .chooseTarget(
+ get.prompt("jsrgshacheng"),
+ "令一名目标角色摸X张牌,然后移去一张“城”(X为对应角色本回合失去过的牌数且至多为5)",
+ (card, player, target) => {
+ return get.event("targets").includes(target);
+ }
+ )
.set("targets", targets)
- .set("ai", target => {
+ .set("ai", (target) => {
return target == get.event("targetx") ? 1 : 0;
})
.set(
"targetx",
(() => {
let info = [];
- targets.filter(target => {
+ targets.filter((target) => {
let att = get.attitude(player, target);
if (att <= 0) return false;
if (Math.abs(att) > 1) att = Math.sign(att) * Math.sqrt(Math.abs(att));
@@ -2776,7 +3144,7 @@ game.import("character", function () {
att *
target
.getHistory("lose")
- .map(evt => evt.cards2.length)
+ .map((evt) => evt.cards2.length)
.reduce((p, c) => p + c, 0),
]);
return false;
@@ -2819,7 +3187,7 @@ game.import("character", function () {
5,
target
.getHistory("lose")
- .map(evt => evt.cards2.length)
+ .map((evt) => evt.cards2.length)
.reduce((p, c) => p + c, 0)
)
);
@@ -2854,11 +3222,12 @@ game.import("character", function () {
},
jsrgninghan: {
audio: 2,
- init: player => {
+ init: (player) => {
game.addGlobalSkill("jsrgninghan_frozen");
},
- onremove: player => {
- if (!game.hasPlayer(current => current.hasSkill("jsrgninghan"), true)) game.removeGlobalSkill("jsrgninghan_frozen");
+ onremove: (player) => {
+ if (!game.hasPlayer((current) => current.hasSkill("jsrgninghan"), true))
+ game.removeGlobalSkill("jsrgninghan_frozen");
},
trigger: { global: "damageEnd" },
filter: function (event, player) {
@@ -2878,14 +3247,14 @@ game.import("character", function () {
},
aiOrder: (player, card, num) => {
if (num && card.name === "sha" && game.hasNature(card, "ice")) {
- let lg = game.findPlayer(current => current.hasSkill("jsrgninghan"));
+ let lg = game.findPlayer((current) => current.hasSkill("jsrgninghan"));
if (lg) return num + 0.15 * Math.sign(get.attitude(player, lg));
}
},
},
trigger: { player: "dieAfter" },
filter: (event, player) => {
- return !game.hasPlayer(current => !current.hasSkill("jsrgninghan"), true);
+ return !game.hasPlayer((current) => !current.hasSkill("jsrgninghan"), true);
},
silent: true,
forceDie: true,
@@ -2909,9 +3278,16 @@ game.import("character", function () {
var player = map.player,
trigger = map.trigger;
var count = Math.ceil(game.countPlayer() / 2);
- var result = yield player.chooseTarget(`伏匿:请选择至多${get.cnNumber(count)}名角色`, `令这些角色获得共计${get.cnNumber(count)}张【影】`, true, [1, count]).set("ai", target => {
- return get.attitude(get.player(), target) + get.event().getRand(target.playerid);
- });
+ var result = yield player
+ .chooseTarget(
+ `伏匿:请选择至多${get.cnNumber(count)}名角色`,
+ `令这些角色获得共计${get.cnNumber(count)}张【影】`,
+ true,
+ [1, count]
+ )
+ .set("ai", (target) => {
+ return get.attitude(get.player(), target) + get.event().getRand(target.playerid);
+ });
if (result.bool) {
var targets = result.targets.slice().sortBySeat(_status.currentPhase);
player.logSkill("jsrgfuni", targets);
@@ -2921,7 +3297,7 @@ game.import("character", function () {
if (num == 1 || num == count) {
result = {
bool: true,
- links: targets.map(current => {
+ links: targets.map((current) => {
return `${num}|${current.playerid}`;
}),
};
@@ -2941,7 +3317,7 @@ game.import("character", function () {
}
result = yield player
.chooseButton(dialog, true)
- .set("filterButton", button => {
+ .set("filterButton", (button) => {
var total = 0,
info = button.link.split("|");
var numFix = 0;
@@ -2962,7 +3338,10 @@ game.import("character", function () {
return total == get.event("count");
})
.set("selectButton", () => {
- return [get.event("len"), Math.max(get.event("len"), ui.selected.buttons.length) + 1];
+ return [
+ get.event("len"),
+ Math.max(get.event("len"), ui.selected.buttons.length) + 1,
+ ];
})
.set("len", targets.length)
.set("custom", {
@@ -2997,14 +3376,14 @@ game.import("character", function () {
.set(
"aiResult",
(() => {
- var result = targets.map(i => {
+ var result = targets.map((i) => {
return [i == player ? 2 : 1, i.playerid];
});
var rest = count - targets.length - 1;
while (rest--) result[Math.floor(Math.random() * result.length)][0]++;
return {
bool: true,
- links: result.map(i => `${i[0]}|${i[1]}`),
+ links: result.map((i) => `${i[0]}|${i[1]}`),
};
})()
);
@@ -3040,7 +3419,7 @@ game.import("character", function () {
global: ["loseAfter", "loseAsyncAfter", "cardsDiscardAfter"],
},
filter: function (event, player) {
- return event.getd().some(i => get.name(i, false) == "ying");
+ return event.getd().some((i) => get.name(i, false) == "ying");
},
forced: true,
content: function () {
@@ -3075,7 +3454,7 @@ game.import("character", function () {
filter: function (event, player) {
return (
player.countCards("hes") &&
- game.hasPlayer(current =>
+ game.hasPlayer((current) =>
player.canUse(
{
name: "sha",
@@ -3089,7 +3468,12 @@ game.import("character", function () {
direct: true,
content: function () {
var next = player.chooseToUse();
- next.set("openskilldialog", `###${get.prompt("jsrgchuanxin")}###将一张牌当【杀】使用,且当一名角色受到此【杀】伤害时,此伤害+X(X为其本回合回复过的体力值)。`);
+ next.set(
+ "openskilldialog",
+ `###${get.prompt(
+ "jsrgchuanxin"
+ )}###将一张牌当【杀】使用,且当一名角色受到此【杀】伤害时,此伤害+X(X为其本回合回复过的体力值)。`
+ );
next.set("norestore", true);
next.set("_backupevent", "jsrgchuanxin_backup");
next.set("addCount", false);
@@ -3114,7 +3498,8 @@ game.import("character", function () {
ai1: function (card) {
var player = get.player();
var maxVal = 5.5;
- if (get.name(card, false) == "ying" && player.hasSkill("jsrgchuanxin")) maxVal -= 3;
+ if (get.name(card, false) == "ying" && player.hasSkill("jsrgchuanxin"))
+ maxVal -= 3;
return maxVal - get.value(card);
},
precontent: function () {
@@ -3125,9 +3510,10 @@ game.import("character", function () {
add: {
trigger: { global: "damageBegin3" },
filter: function (event, player) {
- if (!event.card || !event.card.storage || !event.card.storage.jsrgchuanxin) return false;
+ if (!event.card || !event.card.storage || !event.card.storage.jsrgchuanxin)
+ return false;
if (event.getParent().type != "card") return false;
- return game.hasGlobalHistory("changeHp", evt => {
+ return game.hasGlobalHistory("changeHp", (evt) => {
return evt.getParent().name == "recover" && evt.player == event.player;
});
},
@@ -3135,10 +3521,10 @@ game.import("character", function () {
charlotte: true,
content: function () {
var num = game
- .getGlobalHistory("changeHp", evt => {
+ .getGlobalHistory("changeHp", (evt) => {
return evt.getParent().name == "recover" && evt.player == trigger.player;
})
- .map(evt => evt.num)
+ .map((evt) => evt.num)
.reduce((p, c) => p + c, 0);
trigger.num += num;
game.log(trigger.card, "的伤害+" + num);
@@ -3159,7 +3545,13 @@ game.import("character", function () {
var list = [];
for (var name of lib.inpile) {
var info = lib.card[name];
- if (!info || info.notarget || (info.selectTarget && info.selectTarget != 1) || !get.tag({ name: name }, "damage")) continue;
+ if (
+ !info ||
+ info.notarget ||
+ (info.selectTarget && info.selectTarget != 1) ||
+ !get.tag({ name: name }, "damage")
+ )
+ continue;
if (name == "sha") {
list.push(["基本", "", "sha"]);
for (var nature of lib.inpile_nature) list.push(["基本", "", name, nature]);
@@ -3211,7 +3603,7 @@ game.import("character", function () {
.when("phaseEnd")
.then(() => {
var num = 0;
- player.checkHistory("sourceDamage", evt => {
+ player.checkHistory("sourceDamage", (evt) => {
if (evt.card.storage.jsrgcuifeng) num += evt.num;
});
if (num == 0 || num > 1) {
@@ -3226,11 +3618,16 @@ game.import("character", function () {
};
},
prompt: function (links, player) {
- return "请选择" + (get.translation(links[0][3]) || "") + get.translation(links[0][2]) + "的目标";
+ return (
+ "请选择" +
+ (get.translation(links[0][3]) || "") +
+ get.translation(links[0][2]) +
+ "的目标"
+ );
},
},
mod: {
- targetInRange: card => {
+ targetInRange: (card) => {
if (card.storage && card.storage.jsrgcuifeng) return true;
},
},
@@ -3252,13 +3649,25 @@ game.import("character", function () {
var list = [];
for (var name of lib.inpile) {
var info = lib.card[name];
- if (!info || info.type != "trick" || info.notarget || get.tag({ name: name }, "damage")) continue;
+ if (
+ !info ||
+ info.type != "trick" ||
+ info.notarget ||
+ get.tag({ name: name }, "damage")
+ )
+ continue;
list.push(["锦囊", "", name]);
}
return ui.create.dialog("登难", [list, "vcard"]);
},
filter: function (button, player) {
- return _status.event.getParent().filterCard({ name: button.link[2], isCard: true }, player, _status.event.getParent());
+ return _status.event
+ .getParent()
+ .filterCard(
+ { name: button.link[2], isCard: true },
+ player,
+ _status.event.getParent()
+ );
},
check: function (button) {
var player = _status.event.player;
@@ -3284,11 +3693,12 @@ game.import("character", function () {
.when("phaseEnd")
.then(() => {
var targets = [];
- player.checkHistory("useCard", evt => {
- if (evt.card.storage.jsrgdengnan) targets.addArray(evt.targets);
+ player.checkHistory("useCard", (evt) => {
+ if (evt.card.storage.jsrgdengnan)
+ targets.addArray(evt.targets);
});
if (
- targets.every(current => {
+ targets.every((current) => {
return current.hasHistory("damage");
})
) {
@@ -3303,7 +3713,12 @@ game.import("character", function () {
};
},
prompt: function (links, player) {
- return "请选择" + (get.translation(links[0][3]) || "") + get.translation(links[0][2]) + "的目标";
+ return (
+ "请选择" +
+ (get.translation(links[0][3]) || "") +
+ get.translation(links[0][2]) +
+ "的目标"
+ );
},
},
ai: {
@@ -3319,7 +3734,7 @@ game.import("character", function () {
enable: "chooseToUse",
locked: false,
filter: function (event, player) {
- return ["juedou", "tao"].some(name => {
+ return ["juedou", "tao"].some((name) => {
return (
!player.getStorage("jsrgfenjian_used").includes(name) &&
event.filterCard(
@@ -3335,12 +3750,22 @@ game.import("character", function () {
});
},
hiddenCard: function (player, name) {
- if (["juedou", "tao"].some(i => i == name && !player.getStorage("jsrgfenjian_used").includes(name))) return true;
+ if (
+ ["juedou", "tao"].some(
+ (i) => i == name && !player.getStorage("jsrgfenjian_used").includes(name)
+ )
+ )
+ return true;
return false;
},
chooseButton: {
dialog: function (event, player) {
- var dialog = ui.create.dialog("奋剑", [["juedou", "tao"].filter(name => !player.getStorage("jsrgfenjian_used").includes(name)), "vcard"]);
+ var dialog = ui.create.dialog("奋剑", [
+ ["juedou", "tao"].filter(
+ (name) => !player.getStorage("jsrgfenjian_used").includes(name)
+ ),
+ "vcard",
+ ]);
dialog.direct = true;
return dialog;
},
@@ -3413,7 +3838,7 @@ game.import("character", function () {
return Math.max(get.order({ name: "juedou" }), get.order({ name: "tao" })) + 0.2;
},
result: {
- player: player => {
+ player: (player) => {
if (_status.event.dying) return 2 * get.sgnAttitude(player, _status.event.dying);
return 1;
},
@@ -3439,7 +3864,9 @@ game.import("character", function () {
enable: "phaseUse",
filter: function (event, player) {
if (player.hasSkill("jsrgguiji_used")) return false;
- return game.hasPlayer(current => lib.skill.jsrgguiji.filterTarget("keiki", player, current));
+ return game.hasPlayer((current) =>
+ lib.skill.jsrgguiji.filterTarget("keiki", player, current)
+ );
},
filterTarget: function (card, player, target) {
return target.countCards("h") < player.countCards("h") && target.hasSex("male");
@@ -3457,11 +3884,11 @@ game.import("character", function () {
target: function (player, target) {
var val = player
.getCards("h")
- .map(i => get.value(i))
+ .map((i) => get.value(i))
.reduce((p, c) => p + c, 0);
var val2 = target
.getCards("h")
- .map(i => get.value(i))
+ .map((i) => get.value(i))
.reduce((p, c) => p + c, 0);
return val - val2;
},
@@ -3483,11 +3910,11 @@ game.import("character", function () {
return (
player
.getCards("h")
- .map(i => get.value(i))
+ .map((i) => get.value(i))
.reduce((p, c) => p + c, 0) <
event.player
.getCards("h")
- .map(i => get.value(i))
+ .map((i) => get.value(i))
.reduce((p, c) => p + c, 0) +
4 * Math.random()
);
@@ -3496,7 +3923,10 @@ game.import("character", function () {
"step 0";
if (trigger.name == "phaseUse") {
player
- .chooseBool(get.prompt("jsrgguiji_swapback", trigger.player), "与其交换手牌。")
+ .chooseBool(
+ get.prompt("jsrgguiji_swapback", trigger.player),
+ "与其交换手牌。"
+ )
.set("ai", () => {
return get.event("bool");
})
@@ -3522,14 +3952,16 @@ game.import("character", function () {
audio: 2,
trigger: { player: "phaseZhunbeiBegin" },
filter: function (event, player) {
- return [1, 2, 3, 4, 5].some(i => player.countEmptySlot(i));
+ return [1, 2, 3, 4, 5].some((i) => player.countEmptySlot(i));
},
forced: true,
locked: false,
global: "jsrgjiaohao_g",
content: function () {
"step 0";
- var count = Math.ceil([1, 2, 3, 4, 5].map(i => player.countEmptySlot(i)).reduce((p, c) => p + c, 0) / 2);
+ var count = Math.ceil(
+ [1, 2, 3, 4, 5].map((i) => player.countEmptySlot(i)).reduce((p, c) => p + c, 0) / 2
+ );
player.gain(lib.card.ying.getYing(count), "gain2");
},
subSkill: {
@@ -3538,19 +3970,21 @@ game.import("character", function () {
enable: "phaseUse",
usable: 1,
filter: function (event, player) {
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
if (current == player || !current.hasSkill("jsrgjiaohao")) return false;
- return player.hasCard(card => {
+ return player.hasCard((card) => {
return get.type(card) == "equip" && current.canEquip(card);
});
});
},
filterTarget: function (card, player, target) {
if (target.isMin()) return false;
- return target != player && target.hasSkill("jsrgjiaohao") && target.canEquip(card);
+ return (
+ target != player && target.hasSkill("jsrgjiaohao") && target.canEquip(card)
+ );
},
selectTarget: function () {
- var num = game.countPlayer(current => {
+ var num = game.countPlayer((current) => {
return current.hasSkill("jsrgjiaohao");
});
return num > 1 ? 1 : -1;
@@ -3566,10 +4000,12 @@ game.import("character", function () {
return 6 - get.value(card);
},
prompt: function () {
- var list = game.filterPlayer(current => {
+ var list = game.filterPlayer((current) => {
return current.hasSkill("jsrgjiaohao");
});
- return `将一张装备牌置于${get.translation(list)}${list.length > 1 ? "中的一人" : ""}的装备区`;
+ return `将一张装备牌置于${get.translation(list)}${
+ list.length > 1 ? "中的一人" : ""
+ }的装备区`;
},
discard: false,
lose: false,
@@ -3610,12 +4046,15 @@ game.import("character", function () {
"step 0";
if (!player.countCards("h")) {
var cards = [];
- game.checkGlobalHistory("cardMove", evt => {
- if ((evt.name == "lose" && evt.position == ui.discardPile) || evt.name == "cardsDiscard") {
+ game.checkGlobalHistory("cardMove", (evt) => {
+ if (
+ (evt.name == "lose" && evt.position == ui.discardPile) ||
+ evt.name == "cardsDiscard"
+ ) {
cards.addArray(evt.cards.filterInD("d"));
}
});
- var cardsx = cards.map(card => {
+ var cardsx = cards.map((card) => {
var cardx = ui.create.card();
cardx.init(get.cardInfo(card));
cardx._cardid = card.cardid;
@@ -3641,32 +4080,41 @@ game.import("character", function () {
return cards.length;
},
onremove: function (player) {
- var cards2 = player.getCards("s", card => {
+ var cards2 = player.getCards("s", (card) => {
return card.hasGaintag("jsrgmanjuan");
});
if (player.isOnline2()) {
player.send(
function (cards, player) {
- cards.forEach(i => i.delete());
+ cards.forEach((i) => i.delete());
if (player == game.me) ui.updatehl();
},
cards2,
player
);
}
- cards2.forEach(i => i.delete());
+ cards2.forEach((i) => i.delete());
if (player == game.me) ui.updatehl();
},
group: ["jsrgmanjuan_use", "jsrgmanjuan_lose"],
content: function () {
var cards = [];
- var idList = player.getCards("s", card => card.hasGaintag("jsrgmanjuan")).map(i => i._cardid);
- game.checkGlobalHistory("cardMove", evt => {
- if ((evt.name == "lose" && evt.position == ui.discardPile) || evt.name == "cardsDiscard") {
- cards.addArray(evt.cards.filter(i => get.position(i, true) == "d" && !idList.includes(i.cardid)));
+ var idList = player
+ .getCards("s", (card) => card.hasGaintag("jsrgmanjuan"))
+ .map((i) => i._cardid);
+ game.checkGlobalHistory("cardMove", (evt) => {
+ if (
+ (evt.name == "lose" && evt.position == ui.discardPile) ||
+ evt.name == "cardsDiscard"
+ ) {
+ cards.addArray(
+ evt.cards.filter(
+ (i) => get.position(i, true) == "d" && !idList.includes(i.cardid)
+ )
+ );
}
});
- var cards2 = cards.map(card => {
+ var cards2 = cards.map((card) => {
var cardx = ui.create.card();
cardx.init(get.cardInfo(card));
cardx._cardid = card.cardid;
@@ -3676,7 +4124,12 @@ game.import("character", function () {
},
mod: {
cardEnabled2: function (card, player) {
- if (get.itemtype(card) == "card" && card.hasGaintag("jsrgmanjuan") && player.getStorage("jsrgmanjuan_used").includes(get.number(card, false))) return false;
+ if (
+ get.itemtype(card) == "card" &&
+ card.hasGaintag("jsrgmanjuan") &&
+ player.getStorage("jsrgmanjuan_used").includes(get.number(card, false))
+ )
+ return false;
},
},
},
@@ -3689,25 +4142,33 @@ game.import("character", function () {
popup: false,
firstDo: true,
filter: function (event, player) {
- var cards = player.getCards("s", card => card.hasGaintag("jsrgmanjuan") && card._cardid);
+ var cards = player.getCards(
+ "s",
+ (card) => card.hasGaintag("jsrgmanjuan") && card._cardid
+ );
return (
event.cards &&
- event.cards.some(card => {
+ event.cards.some((card) => {
return cards.includes(card);
})
);
},
content: function () {
- var idList = player.getCards("s", card => card.hasGaintag("jsrgmanjuan")).map(i => i._cardid);
+ var idList = player
+ .getCards("s", (card) => card.hasGaintag("jsrgmanjuan"))
+ .map((i) => i._cardid);
var cards = [];
- game.checkGlobalHistory("cardMove", evt => {
- if ((evt.name == "lose" && evt.position == ui.discardPile) || evt.name == "cardsDiscard") {
- cards.addArray(evt.cards.filter(i => idList.includes(i.cardid)));
+ game.checkGlobalHistory("cardMove", (evt) => {
+ if (
+ (evt.name == "lose" && evt.position == ui.discardPile) ||
+ evt.name == "cardsDiscard"
+ ) {
+ cards.addArray(evt.cards.filter((i) => idList.includes(i.cardid)));
}
});
var cards2 = [];
for (var card of trigger.cards) {
- var cardx = cards.find(cardx => cardx.cardid == card._cardid);
+ var cardx = cards.find((cardx) => cardx.cardid == card._cardid);
if (cardx) cards2.push(cardx);
}
var cards3 = trigger.cards.slice();
@@ -3716,14 +4177,14 @@ game.import("character", function () {
if (player.isOnline2()) {
player.send(
function (cards, player) {
- cards.forEach(i => i.delete());
+ cards.forEach((i) => i.delete());
if (player == game.me) ui.updatehl();
},
cards3,
player
);
}
- cards3.forEach(i => i.delete());
+ cards3.forEach((i) => i.delete());
if (player == game.me) ui.updatehl();
if (!player.storage.jsrgmanjuan_used) {
player.when({ global: "phaseAfter" }).then(() => {
@@ -3732,13 +4193,22 @@ game.import("character", function () {
}
player.markAuto(
"jsrgmanjuan_used",
- cards3.map(card => get.number(card, false))
+ cards3.map((card) => get.number(card, false))
);
},
},
lose: {
trigger: {
- global: ["loseEnd", "equipEnd", "addJudgeEnd", "gainEnd", "loseAsyncEnd", "addToExpansionEnd", "cardsGotoOrderingBegin", "phaseAfter"],
+ global: [
+ "loseEnd",
+ "equipEnd",
+ "addJudgeEnd",
+ "gainEnd",
+ "loseAsyncEnd",
+ "addToExpansionEnd",
+ "cardsGotoOrderingBegin",
+ "phaseAfter",
+ ],
},
charlotte: true,
forced: true,
@@ -3746,10 +4216,12 @@ game.import("character", function () {
firstDo: true,
filter: function (event, player) {
if (event.name == "phase") return true;
- var idList = player.getCards("s", card => card.hasGaintag("jsrgmanjuan")).map(i => i._cardid);
+ var idList = player
+ .getCards("s", (card) => card.hasGaintag("jsrgmanjuan"))
+ .map((i) => i._cardid);
return (
event.cards &&
- event.cards.some(card => {
+ event.cards.some((card) => {
return idList.includes(card.cardid);
})
);
@@ -3757,31 +4229,38 @@ game.import("character", function () {
content: function () {
var cards2;
if (trigger.name == "phase") {
- cards2 = player.getCards("s", card => {
+ cards2 = player.getCards("s", (card) => {
return card.hasGaintag("jsrgmanjuan");
});
} else {
var idList = [];
- game.checkGlobalHistory("cardMove", evt => {
- if ((evt.name == "lose" && evt.position == ui.discardPile) || evt.name == "cardsDiscard") {
- idList.addArray(evt.cards.filter(i => get.position(i, true) == "d").map(i => i.cardid));
+ game.checkGlobalHistory("cardMove", (evt) => {
+ if (
+ (evt.name == "lose" && evt.position == ui.discardPile) ||
+ evt.name == "cardsDiscard"
+ ) {
+ idList.addArray(
+ evt.cards
+ .filter((i) => get.position(i, true) == "d")
+ .map((i) => i.cardid)
+ );
}
});
- cards2 = player.getCards("s", card => {
+ cards2 = player.getCards("s", (card) => {
return card.hasGaintag("jsrgmanjuan") && !idList.includes(card._cardid);
});
}
if (player.isOnline2()) {
player.send(
function (cards, player) {
- cards.forEach(i => i.delete());
+ cards.forEach((i) => i.delete());
if (player == game.me) ui.updatehl();
},
cards2,
player
);
}
- cards2.forEach(i => i.delete());
+ cards2.forEach((i) => i.delete());
if (player == game.me) ui.updatehl();
},
},
@@ -3792,7 +4271,7 @@ game.import("character", function () {
enable: "phaseUse",
usable: 1,
filter: function (event, player) {
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
return player.canCompare(current);
});
},
@@ -3806,10 +4285,10 @@ game.import("character", function () {
player.chooseToCompare(target).set(
"small",
get.attitude(player, target) > 0 &&
- (player.countCards("h", card => {
+ (player.countCards("h", (card) => {
return get.value(card) < 6;
}) <= 1 ||
- target.countCards("h", card => {
+ target.countCards("h", (card) => {
return get.value(card) < 6;
}) <= 1)
);
@@ -3862,18 +4341,24 @@ game.import("character", function () {
direct: true,
content: function () {
"step 0";
- var damaged = game.filterPlayer(current => {
- return current.hasAllHistory("sourceDamage", evt => evt.player == player);
+ var damaged = game.filterPlayer((current) => {
+ return current.hasAllHistory("sourceDamage", (evt) => evt.player == player);
});
var undamaged = game.filterPlayer().removeArray(damaged);
player.chooseCardTarget({
prompt: get.prompt("jsrgniluan"),
- prompt2: `${undamaged.length ? "选择一张牌弃置并选择一名未对你造成过伤害的角色,你对其造成1点伤害" : ""}${undamaged.length && damaged.length ? ";
或" : ""}${damaged.length ? "仅选择一名对你造成过伤害的角色,你令其摸两张牌" : ""}。`,
+ prompt2: `${
+ undamaged.length
+ ? "选择一张牌弃置并选择一名未对你造成过伤害的角色,你对其造成1点伤害"
+ : ""
+ }${undamaged.length && damaged.length ? ";
或" : ""}${
+ damaged.length ? "仅选择一名对你造成过伤害的角色,你令其摸两张牌" : ""
+ }。`,
damaged: damaged,
aiTarget: (() => {
if (
undamaged.includes(player) &&
- !undamaged.some(i => {
+ !undamaged.some((i) => {
if (i === player) return false;
let att = get.attitude(player, i);
if (att > 0) return true;
@@ -3884,10 +4369,13 @@ game.import("character", function () {
return player;
var info = game
.filterPlayer()
- .map(current => {
+ .map((current) => {
let damage = undamaged.includes(current),
card = { name: damage ? "damage" : "draw" };
- return [current, get.effect(current, card, player, player) * (damage ? 0.7 : 2)];
+ return [
+ current,
+ get.effect(current, card, player, player) * (damage ? 0.7 : 2),
+ ];
})
.sort((a, b) => b[1] - a[1])[0];
if (info[1] > 0) return info[0];
@@ -3994,7 +4482,8 @@ game.import("character", function () {
game.addGlobalSkill("jsrgjiemeng_effect");
},
onremove: () => {
- if (!game.hasPlayer(i => i.hasSkill("jsrgjiemeng"), true)) game.removeGlobalSkill("jsrgjiemeng_effect");
+ if (!game.hasPlayer((i) => i.hasSkill("jsrgjiemeng"), true))
+ game.removeGlobalSkill("jsrgjiemeng_effect");
},
subSkill: {
effect: {
@@ -4002,12 +4491,12 @@ game.import("character", function () {
globalFrom: function (from, to, distance) {
if (from.group != "qun") return;
if (to.hasZhuSkill("jsrgjiemeng")) return;
- return distance - game.countPlayer(current => current.group == "qun");
+ return distance - game.countPlayer((current) => current.group == "qun");
},
},
trigger: { player: "dieAfter" },
filter: () => {
- return !game.hasPlayer(i => i.hasSkill("jsrgjiemeng"), true);
+ return !game.hasPlayer((i) => i.hasSkill("jsrgjiemeng"), true);
},
silent: true,
forceDie: true,
@@ -4028,20 +4517,31 @@ game.import("character", function () {
usable: 1,
filter: function (event, player) {
if (player.hasJudge("bingliang")) return false;
- if (!game.hasPlayer(current => current.hasSkill("jsrghuozhong"))) return false;
- return player.countCards("hes", card => get.color(card) == "black" && get.type2(card) != "trick") > 0;
+ if (!game.hasPlayer((current) => current.hasSkill("jsrghuozhong"))) return false;
+ return (
+ player.countCards(
+ "hes",
+ (card) => get.color(card) == "black" && get.type2(card) != "trick"
+ ) > 0
+ );
},
viewAs: { name: "bingliang" },
position: "hes",
discard: false,
prompt: function () {
- var list = game.filterPlayer(target => {
+ var list = game.filterPlayer((target) => {
return target.hasSkill("jsrghuozhong");
});
- return `将一张黑色非锦囊牌当【兵粮寸断】置于自己的判定区,然后令${get.translation(list)}${list.length > 1 ? "中的一人" : ""}摸两张牌。`;
+ return `将一张黑色非锦囊牌当【兵粮寸断】置于自己的判定区,然后令${get.translation(
+ list
+ )}${list.length > 1 ? "中的一人" : ""}摸两张牌。`;
},
filterCard: function (card, player, event) {
- return get.color(card) == "black" && get.type2(card) != "trick" && player.canAddJudge({ name: "bingliang", cards: [card] });
+ return (
+ get.color(card) == "black" &&
+ get.type2(card) != "trick" &&
+ player.canAddJudge({ name: "bingliang", cards: [card] })
+ );
},
selectTarget: -1,
filterTarget: function (card, player, target) {
@@ -4052,14 +4552,18 @@ game.import("character", function () {
},
precontent: function* (event, map) {
var player = map.player;
- var targets = game.filterPlayer(current => current.hasSkill("jsrghuozhong"));
+ var targets = game.filterPlayer((current) => current.hasSkill("jsrghuozhong"));
var result;
if (targets.length) result = { bool: true, targets: targets };
else
result = yield player
- .chooseTarget("请选择一名传教士,发动其的【惑众】", true, (card, player, target) => {
- return get.event("targets").includes(target);
- })
+ .chooseTarget(
+ "请选择一名传教士,发动其的【惑众】",
+ true,
+ (card, player, target) => {
+ return get.event("targets").includes(target);
+ }
+ )
.set("targets", targets);
if (result.bool) {
var target = result.targets[0];
@@ -4077,7 +4581,14 @@ game.import("character", function () {
ai: {
result: {
player: function (player) {
- if (game.hasPlayer(current => get.attitude(player, current) > 2 && current.hasSkill("jsrghuozhong"))) return 1;
+ if (
+ game.hasPlayer(
+ (current) =>
+ get.attitude(player, current) > 2 &&
+ current.hasSkill("jsrghuozhong")
+ )
+ )
+ return 1;
return 0;
},
},
@@ -4095,20 +4606,20 @@ game.import("character", function () {
event.getParent().type == "card" &&
event.card &&
event.card.name == "sha" &&
- game.hasPlayer(current => {
+ game.hasPlayer((current) => {
return current != player && current.countCards("j");
})
);
},
prompt: "是否发动【日彗】?",
prompt2: function (event, player) {
- var list = game.filterPlayer(current => {
+ var list = game.filterPlayer((current) => {
return current != player && current.countCards("j");
});
return `令${get.translation(list)}${list.length > 1 ? "各" : ""}摸一张牌。`;
},
logTarget: function (event, player) {
- return game.filterPlayer(current => {
+ return game.filterPlayer((current) => {
return current != player && current.countCards("j");
});
},
@@ -4118,7 +4629,8 @@ game.import("character", function () {
},
mod: {
cardUsableTarget: function (card, player, target) {
- if (card.name == "sha" && !player.getStorage("jsrgrihui_targeted").includes(target)) return true;
+ if (card.name == "sha" && !player.getStorage("jsrgrihui_targeted").includes(target))
+ return true;
},
},
subSkill: {
@@ -4145,8 +4657,12 @@ game.import("character", function () {
global: "phaseEnd",
},
filter: function (event, player) {
- if (!Array.from(ui.discardPile.childNodes).some(i => i.name == "chixueqingfeng")) return false;
- return game.hasGlobalHistory("everything", evt => ["useCard", "respond"].includes(evt.name) && evt.player.isIn());
+ if (!Array.from(ui.discardPile.childNodes).some((i) => i.name == "chixueqingfeng"))
+ return false;
+ return game.hasGlobalHistory(
+ "everything",
+ (evt) => ["useCard", "respond"].includes(evt.name) && evt.player.isIn()
+ );
},
popup: false,
forced: true,
@@ -4154,7 +4670,9 @@ game.import("character", function () {
group: "jsrghujian_begin",
content: function () {
"step 0";
- var cards = Array.from(ui.discardPile.childNodes).filter(i => i.name == "chixueqingfeng");
+ var cards = Array.from(ui.discardPile.childNodes).filter(
+ (i) => i.name == "chixueqingfeng"
+ );
if (cards.length) {
event.cards = cards;
var history = _status.globalHistory,
@@ -4170,7 +4688,10 @@ game.import("character", function () {
}
if (target && target.isIn()) {
event.target = target;
- target.chooseBool(`是否响应${get.translation(player)}的【护剑】?`, "获得弃牌堆里的【赤血青锋】。");
+ target.chooseBool(
+ `是否响应${get.translation(player)}的【护剑】?`,
+ "获得弃牌堆里的【赤血青锋】。"
+ );
} else event.finish();
} else event.finish();
"step 1";
@@ -4211,7 +4732,10 @@ game.import("character", function () {
return player.hasCard({ type: "equip" }, "hs");
},
check: function (card) {
- return (get.name(card, false) == "chixueqingfeng" ? 20 : 12) - _status.event.player.getUseValue(card);
+ return (
+ (get.name(card, false) == "chixueqingfeng" ? 20 : 12) -
+ _status.event.player.getUseValue(card)
+ );
},
ai: {
order: 0.001,
@@ -4224,25 +4748,36 @@ game.import("character", function () {
forced: true,
locked: false,
filter: function (event, player) {
- return game.hasPlayer(i => i != player);
+ return game.hasPlayer((i) => i != player);
},
content: function* (event, map) {
var player = map.player,
trigger = map.trigger,
- targets = game.filterPlayer(i => i != player);
- var shas = player.mayHaveSha(target, "use", null, "count") - player.getCardUsable("sha", true);
+ targets = game.filterPlayer((i) => i != player);
+ var shas =
+ player.mayHaveSha(target, "use", null, "count") - player.getCardUsable("sha", true);
for (var target of targets) {
var att = get.attitude(target, player);
var result = yield target
- .chooseCard("he", `负山:是否交给${get.translation(player)}一张牌?`, `若如此做,其此阶段使用【杀】的次数上限+1`)
+ .chooseCard(
+ "he",
+ `负山:是否交给${get.translation(player)}一张牌?`,
+ `若如此做,其此阶段使用【杀】的次数上限+1`
+ )
.set("att", att)
- .set("ai", card => {
+ .set("ai", (card) => {
if (!get.event("goon")) return -get.value(card);
var isSha = get.name(card, get.event("target")) == "sha";
if (get.event("att") < 0) return (isSha ? 0 : 5) - get.value(card);
return (isSha ? 10 : 0) - get.value(card);
})
- .set("goon", (att > 0 && shas >= 0) || (att < 0 && target.hp > player.getCardUsable("sha", true) && shas < -1 / Math.max(1, player.hp)))
+ .set(
+ "goon",
+ (att > 0 && shas >= 0) ||
+ (att < 0 &&
+ target.hp > player.getCardUsable("sha", true) &&
+ shas < -1 / Math.max(1, player.hp))
+ )
.set("target", player);
if (result.bool) {
target.give(result.cards, player);
@@ -4254,16 +4789,20 @@ game.import("character", function () {
}
player
.when("phaseUseAfter")
- .filter(evt => evt == trigger)
+ .filter((evt) => evt == trigger)
.then(() => {
player.logSkill("jsrgfushan");
if (
player.getCardUsable("sha", true) >
- player.getHistory("useCard", evt => {
- return evt.getParent("phaseUse") == trigger && evt.card.name == "sha" && evt.addCount !== false;
+ player.getHistory("useCard", (evt) => {
+ return (
+ evt.getParent("phaseUse") == trigger &&
+ evt.card.name == "sha" &&
+ evt.addCount !== false
+ );
}).length &&
player.storage.jsrgfushan_given &&
- player.storage.jsrgfushan_given.every(i => i.isIn())
+ player.storage.jsrgfushan_given.every((i) => i.isIn())
) {
player.loseHp(2);
} else {
@@ -4360,10 +4899,14 @@ game.import("character", function () {
forceDie: true,
forceOut: true,
filter: function (event, player) {
- return event.card.name == "juedou" && event.card.storage && event.card.storage.jsrgduxing;
+ return (
+ event.card.name == "juedou" &&
+ event.card.storage &&
+ event.card.storage.jsrgduxing
+ );
},
content: function () {
- game.countPlayer(current => {
+ game.countPlayer((current) => {
current.removeSkill("jsrgduxing_allsha");
}, true);
},
@@ -4379,9 +4922,11 @@ game.import("character", function () {
filter: function (event, player) {
if (event.getParent().type != "card") return false;
var respondEvts = [];
- respondEvts.addArray(event.player.getHistory("useCard")).addArray(event.player.getHistory("respond"));
- respondEvts = respondEvts.filter(i => i.respondTo).map(evt => evt.respondTo);
- return respondEvts.some(list => {
+ respondEvts
+ .addArray(event.player.getHistory("useCard"))
+ .addArray(event.player.getHistory("respond"));
+ respondEvts = respondEvts.filter((i) => i.respondTo).map((evt) => evt.respondTo);
+ return respondEvts.some((list) => {
return list[0] == player;
});
},
@@ -4415,7 +4960,7 @@ game.import("character", function () {
},
filter: function (event, player) {
if (event.name == "useCard")
- return event.targets.some(target => {
+ return event.targets.some((target) => {
return target != player;
});
return true;
@@ -4441,7 +4986,11 @@ game.import("character", function () {
if (event.responded) return false;
if (player.storage.jsrgbashiing) return false;
if (!player.hasZhuSkill("jsrgbashi")) return false;
- if (!event.filterCard({ name: "sha" }, player, event) && !event.filterCard({ name: "shan" }, player, event)) return false;
+ if (
+ !event.filterCard({ name: "sha" }, player, event) &&
+ !event.filterCard({ name: "shan" }, player, event)
+ )
+ return false;
return game.hasPlayer(function (current) {
return current != player && current.group == "wu";
});
@@ -4459,11 +5008,20 @@ game.import("character", function () {
if (!target) event.finish();
else if (!target.isIn() || target == player) event.redo();
else if (target.group == "wu") {
- if ((target == game.me && !_status.auto) || get.attitude(target, player) > 2 || target.isOnline()) {
+ if (
+ (target == game.me && !_status.auto) ||
+ get.attitude(target, player) > 2 ||
+ target.isOnline()
+ ) {
player.storage.jsrgbashiing = true;
- var list = ["sha", "shan"].filter(name => trigger.filterCard({ name: name }, player, trigger));
- var names = list.map(i => "【" + get.translation(i) + "】").join("或");
- var next = target.chooseToRespond("是否替" + get.translation(player) + "打出一张" + names + "?", { name: list });
+ var list = ["sha", "shan"].filter((name) =>
+ trigger.filterCard({ name: name }, player, trigger)
+ );
+ var names = list.map((i) => "【" + get.translation(i) + "】").join("或");
+ var next = target.chooseToRespond(
+ "是否替" + get.translation(player) + "打出一张" + names + "?",
+ { name: list }
+ );
next.set("ai", function () {
var event = _status.event;
return get.attitude(event.player, event.source) - 2;
@@ -4520,7 +5078,7 @@ game.import("character", function () {
var getV = function (group) {
var val = 1;
if (group == "wei" || group == "qun") val++;
- game.countPlayer(current => {
+ game.countPlayer((current) => {
if (current.group != group) return false;
var att = get.attitude(player, current);
if (att > 0) val++;
@@ -4547,7 +5105,7 @@ game.import("character", function () {
player.logSkill("jsrglipan");
player.popup(group + "2", get.groupnature(group, "raw"));
player.changeGroup(group);
- var num = game.countPlayer(current => {
+ var num = game.countPlayer((current) => {
return current.group == group && current != player;
});
if (num > 0) player.draw(num);
@@ -4570,7 +5128,7 @@ game.import("character", function () {
},
content: function () {
"step 0";
- var targets = game.filterPlayer(current => {
+ var targets = game.filterPlayer((current) => {
return current.group == player.group;
});
targets.sortBySeat();
@@ -4583,11 +5141,15 @@ game.import("character", function () {
position: "hes",
prompt: "是否将一张牌当【决斗】对" + get.translation(player) + "使用?",
filterCard: function (card, player) {
- return player.canUse(get.autoViewAs({ name: "juedou" }, [card]), _status.event.getParent().player);
+ return player.canUse(
+ get.autoViewAs({ name: "juedou" }, [card]),
+ _status.event.getParent().player
+ );
},
filterTarget: function (card, player, target) {
var source = _status.event.getParent().player;
- if (target != source && !ui.selected.targets.includes(source)) return false;
+ if (target != source && !ui.selected.targets.includes(source))
+ return false;
card = get.autoViewAs({ name: "juedou" }, [card]);
return lib.filter.filterTarget.apply(this, arguments);
},
@@ -4603,7 +5165,12 @@ game.import("character", function () {
ai1: function (card) {
var player = _status.event.player,
target = _status.event.getParent().player;
- var eff = get.effect(target, get.autoViewAs({ name: "juedou" }, [card]), player, player);
+ var eff = get.effect(
+ target,
+ get.autoViewAs({ name: "juedou" }, [card]),
+ player,
+ player
+ );
if (eff <= 0) return 0;
return (player.hp == 1 ? 10 : 6) - get.value(card);
},
@@ -4617,7 +5184,7 @@ game.import("character", function () {
if (result.bool) {
var cards = result.cards;
var cardx = get.autoViewAs({ name: "juedou" }, cards);
- var targets = result.targets.filter(targetx => {
+ var targets = result.targets.filter((targetx) => {
return target.canUse(cardx, targetx);
});
if (targets.length) target.useCard(cardx, cards, targets);
@@ -4632,7 +5199,9 @@ game.import("character", function () {
enable: "phaseUse",
filter: function (event, player) {
if (player.group != "qun") return false;
- return game.hasPlayer(current => lib.skill.jsrgqingxi.filterTarget("", player, current));
+ return game.hasPlayer((current) =>
+ lib.skill.jsrgqingxi.filterTarget("", player, current)
+ );
},
groupSkill: true,
filterTarget: function (card, player, target) {
@@ -4644,7 +5213,8 @@ game.import("character", function () {
player.addTempSkill("jsrgqingxi_used", "phaseUseAfter");
player.markAuto("jsrgqingxi_used", [target]);
var num = player.countCards("h") - target.countCards("h");
- if (num > 0) player.chooseToDiscard(num, true, "轻袭:弃置" + get.cnNumber(num) + "张手牌");
+ if (num > 0)
+ player.chooseToDiscard(num, true, "轻袭:弃置" + get.cnNumber(num) + "张手牌");
"step 1";
var card = {
name: "sha",
@@ -4667,7 +5237,7 @@ game.import("character", function () {
});
_status.event.putTempCache("jsrgqingxi_result", "ph", ph);
}
- ph.slice(0, num).forEach(i => {
+ ph.slice(0, num).forEach((i) => {
val += get.value(i, player);
});
eff = Math.sign(eff) * Math.sqrt(Math.abs(eff));
@@ -4689,7 +5259,7 @@ game.import("character", function () {
usable: 1,
filter: function (event, player) {
if (player.group != "wei") return false;
- return game.hasPlayer(current => current.countCards("h") > player.countCards("h"));
+ return game.hasPlayer((current) => current.countCards("h") > player.countCards("h"));
},
groupSkill: true,
filterTarget: function (card, player, target) {
@@ -4712,12 +5282,13 @@ game.import("character", function () {
order: 0.5,
result: {
target: function (player, target) {
- var eff = get.effect(target, { name: "sha", nature: "fire" }, player, target) / 30;
+ var eff =
+ get.effect(target, { name: "sha", nature: "fire" }, player, target) / 30;
if (
!target.mayHaveShan(
player,
"use",
- target.getCards("h", i => {
+ target.getCards("h", (i) => {
return i.hasGaintag("sha_notshan");
})
)
@@ -4735,7 +5306,12 @@ game.import("character", function () {
source: "damageSource",
},
filter: function (event, player) {
- return event.card && event.card.storage && event.card.storage.jsrgjinmie && event.card.storage.jsrgjinmie.isIn();
+ return (
+ event.card &&
+ event.card.storage &&
+ event.card.storage.jsrgjinmie &&
+ event.card.storage.jsrgjinmie.isIn()
+ );
},
forced: true,
popup: false,
@@ -4768,7 +5344,7 @@ game.import("character", function () {
filter: function (event, player) {
var cards = event.getg(player);
if (!cards.length) return false;
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
if (current == player) return false;
return event.getl(current).cards2.length;
});
@@ -4776,7 +5352,7 @@ game.import("character", function () {
group: "jsrgwuchang_add",
content: function () {
"step 0";
- var targets = game.filterPlayer(current => {
+ var targets = game.filterPlayer((current) => {
if (current == player) return false;
return trigger.getl(current).cards2.length;
});
@@ -4790,7 +5366,12 @@ game.import("character", function () {
source: "damageBegin1",
},
filter: function (event, player) {
- if (!event.card || !["sha", "juedou"].includes(event.card.name) || event.getParent().type != "card") return false;
+ if (
+ !event.card ||
+ !["sha", "juedou"].includes(event.card.name) ||
+ event.getParent().type != "card"
+ )
+ return false;
return event.player.group == player.group;
},
forced: true,
@@ -4812,11 +5393,11 @@ game.import("character", function () {
if (!player.countCards("hes")) return false;
return (
(!player.hasSkill("jsrgqingjiao_tuixinzhifu") &&
- game.hasPlayer(current => {
+ game.hasPlayer((current) => {
return current.countCards("h") > player.countCards("h");
})) ||
(!player.hasSkill("jsrgqingjiao_chenghuodajie") &&
- game.hasPlayer(current => {
+ game.hasPlayer((current) => {
return current.countCards("h") < player.countCards("h");
}))
);
@@ -4829,7 +5410,13 @@ game.import("character", function () {
lose: false,
delay: false,
filterTarget: function (card, player, target) {
- var mod = game.checkMod(ui.selected.cards[0], player, "unchanged", "cardEnabled2", player);
+ var mod = game.checkMod(
+ ui.selected.cards[0],
+ player,
+ "unchanged",
+ "cardEnabled2",
+ player
+ );
if (!mod) return false;
var del = target.countCards("h") - player.countCards("h");
if (del == 0) return false;
@@ -4847,7 +5434,10 @@ game.import("character", function () {
order: 7,
result: {
player: function (player, target) {
- var name = target.countCards("h") > player.countCards("h") ? "tuixinzhifu" : "chenghuodajie";
+ var name =
+ target.countCards("h") > player.countCards("h")
+ ? "tuixinzhifu"
+ : "chenghuodajie";
var list = [];
if (ui.selected.cards.length) list.addArray(ui.selected.cards);
var card = get.autoViewAs({ name: name }, list);
@@ -4871,14 +5461,14 @@ game.import("character", function () {
locked: false,
filter: function (event, player) {
if (player.group != "shu") return false;
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
return current != player && current.group == player.group;
});
},
groupSkill: true,
content: function () {
trigger.directHit.addArray(
- game.filterPlayer(current => {
+ game.filterPlayer((current) => {
return current != player && current.group == player.group;
})
);
@@ -4902,11 +5492,13 @@ game.import("character", function () {
isCard: true,
},
filter: function (event, player) {
- if (!player.countCards("he", card => _status.connectMode || get.type(card) != "basic")) return false;
+ if (!player.countCards("he", (card) => _status.connectMode || get.type(card) != "basic"))
+ return false;
return player.group == "qun" && !player.hasSkill("jsrgqiongtu_check");
},
viewAsFilter: function (player) {
- if (!player.countCards("he", card => _status.connectMode || get.type(card) != "basic")) return false;
+ if (!player.countCards("he", (card) => _status.connectMode || get.type(card) != "basic"))
+ return false;
return player.group == "qun" && !player.hasSkill("jsrgqiongtu_check");
},
filterCard: function (card) {
@@ -4946,7 +5538,11 @@ game.import("character", function () {
global: "useCardAfter",
},
filter: function (event, player) {
- return event.card.name == "wuxie" && event.card.storage && event.card.storage.jsrgqiongtu;
+ return (
+ event.card.name == "wuxie" &&
+ event.card.storage &&
+ event.card.storage.jsrgqiongtu
+ );
},
forced: true,
popup: false,
@@ -4977,7 +5573,7 @@ game.import("character", function () {
filter: function (event, player) {
return (
player.group == "wei" &&
- player.hasCard(card => {
+ player.hasCard((card) => {
return _status.connectMode || get.type(card) == "trick";
}, "hs")
);
@@ -5000,8 +5596,12 @@ game.import("character", function () {
cards: [card],
};
if (
- game.hasPlayer(current => {
- return player.canUse(cardx, current) && get.effect(current, card, player, player) > 0 && get.effect(current, cardx, player, player) > 0;
+ game.hasPlayer((current) => {
+ return (
+ player.canUse(cardx, current) &&
+ get.effect(current, card, player, player) > 0 &&
+ get.effect(current, cardx, player, player) > 0
+ );
})
)
return 15 - get.value(card);
@@ -5023,7 +5623,8 @@ game.import("character", function () {
filter: function (event, player) {
var targets = event.getParent(2).targets;
if (!targets || targets.length != 1) return false;
- if (!event.card || !event.card.storage || !event.card.storage.jsrgxianzhu) return false;
+ if (!event.card || !event.card.storage || !event.card.storage.jsrgxianzhu)
+ return false;
var target = event.player,
card = event.cards[0];
if (!target.isIn()) return false;
@@ -5049,7 +5650,12 @@ game.import("character", function () {
popup: false,
firstDo: true,
filter: function (event, player) {
- if (event.card.storage && event.card.storage.jsrgxianzhu && event.addCount !== false) return true;
+ if (
+ event.card.storage &&
+ event.card.storage.jsrgxianzhu &&
+ event.addCount !== false
+ )
+ return true;
return false;
},
content: function () {
@@ -5068,13 +5674,15 @@ game.import("character", function () {
player: "phaseZhunbeiBegin",
},
check: function (event, player) {
- return player.isTurnedOver() || game.countPlayer2(current => current.hasSex("male")) >= 2;
+ return (
+ player.isTurnedOver() || game.countPlayer2((current) => current.hasSex("male")) >= 2
+ );
},
content: function () {
"step 0";
player.turnOver();
"step 1";
- var targets = game.filterPlayer(current => current != player && current.hasSex("male"));
+ var targets = game.filterPlayer((current) => current != player && current.hasSex("male"));
event.targets = targets;
player.line(targets);
game.delayx();
@@ -5089,7 +5697,12 @@ game.import("character", function () {
.set(
"bool",
(function () {
- return target.isTurnedOver() || (get.attitude(target, player) > 0 && (game.countPlayer2(current => current.hasSex("male")) >= 3 || (target.getHp() <= 1 && player.hasSkill("jsrgzhangdeng"))));
+ return (
+ target.isTurnedOver() ||
+ (get.attitude(target, player) > 0 &&
+ (game.countPlayer2((current) => current.hasSex("male")) >= 3 ||
+ (target.getHp() <= 1 && player.hasSkill("jsrgzhangdeng"))))
+ );
})()
);
"step 3";
@@ -5098,7 +5711,7 @@ game.import("character", function () {
}
if (targets.length) event.goto(2);
"step 4";
- var targets = game.filterPlayer(current => {
+ var targets = game.filterPlayer((current) => {
return current == player || current.isTurnedOver();
});
event.targets = targets;
@@ -5113,7 +5726,7 @@ game.import("character", function () {
event.index++;
if (event.index >= targets.length) event.index = 0;
"step 6";
- if (event.num >= game.countPlayer2(current => current.hasSex("male"))) event.finish();
+ if (event.num >= game.countPlayer2((current) => current.hasSex("male"))) event.finish();
else event.goto(5);
},
},
@@ -5125,10 +5738,10 @@ game.import("character", function () {
filter: function (event, player) {
return (
event.player
- .getHistory("useSkill", evt => {
+ .getHistory("useSkill", (evt) => {
return evt.skill == "jsrgzhangdeng_jiu";
})
- .map(evt => evt.event)
+ .map((evt) => evt.event)
.indexOf(event.log_event) == 1
);
},
@@ -5145,7 +5758,7 @@ game.import("character", function () {
filter: function (event, player) {
return (
player.isTurnedOver() &&
- game.hasPlayer(current => {
+ game.hasPlayer((current) => {
return current.hasSkill("jsrgzhangdeng") && current.isTurnedOver();
})
);
@@ -5154,7 +5767,7 @@ game.import("character", function () {
viewAsFilter: function (player) {
return (
player.isTurnedOver() &&
- game.hasPlayer(current => {
+ game.hasPlayer((current) => {
return current.hasSkill("jsrgzhangdeng") && current.isTurnedOver();
})
);
@@ -5163,7 +5776,7 @@ game.import("character", function () {
selectCard: -1,
precontent: function () {
player.logSkill("jsrgzhangdeng_jiu");
- var targets = game.filterPlayer(current => {
+ var targets = game.filterPlayer((current) => {
return current.hasSkill("jsrgzhangdeng") && current.isTurnedOver();
});
player.line(targets[0]);
@@ -5184,7 +5797,7 @@ game.import("character", function () {
forced: true,
content: function () {
"step 0";
- var targets = game.filterPlayer(current => current != player);
+ var targets = game.filterPlayer((current) => current != player);
var suit = get.suit(trigger.card);
for (var target of targets) {
target.addTempSkill("jsrgguanjue_ban");
@@ -5197,13 +5810,16 @@ game.import("character", function () {
charlotte: true,
mod: {
cardEnabled: function (card, player) {
- if (player.getStorage("jsrgguanjue_ban").includes(get.suit(card))) return false;
+ if (player.getStorage("jsrgguanjue_ban").includes(get.suit(card)))
+ return false;
},
cardRespondable: function (card, player) {
- if (player.getStorage("jsrgguanjue_ban").includes(get.suit(card))) return false;
+ if (player.getStorage("jsrgguanjue_ban").includes(get.suit(card)))
+ return false;
},
cardSavable: function (card, player) {
- if (player.getStorage("jsrgguanjue_ban").includes(get.suit(card))) return false;
+ if (player.getStorage("jsrgguanjue_ban").includes(get.suit(card)))
+ return false;
},
},
mark: true,
@@ -5227,7 +5843,8 @@ game.import("character", function () {
if (name == "sha") {
for (var nature of lib.inpile_nature) {
card.nature = nature;
- if (event.filterCard(get.autoViewAs(card, "unsure"), player, event)) return true;
+ if (event.filterCard(get.autoViewAs(card, "unsure"), player, event))
+ return true;
}
}
}
@@ -5239,23 +5856,51 @@ game.import("character", function () {
var list = [];
for (var name of lib.inpile) {
if (name == "sha") {
- if (event.filterCard(get.autoViewAs({ name }, "unsure"), player, event)) list.push(["基本", "", "sha"]);
+ if (event.filterCard(get.autoViewAs({ name }, "unsure"), player, event))
+ list.push(["基本", "", "sha"]);
for (var nature of lib.inpile_nature) {
- if (event.filterCard(get.autoViewAs({ name, nature }, "unsure"), player, event)) list.push(["基本", "", "sha", nature]);
+ if (
+ event.filterCard(
+ get.autoViewAs({ name, nature }, "unsure"),
+ player,
+ event
+ )
+ )
+ list.push(["基本", "", "sha", nature]);
}
- } else if (get.type(name) == "basic" && event.filterCard(get.autoViewAs({ name }, "unsure"), player, event)) list.push(["基本", "", name]);
+ } else if (
+ get.type(name) == "basic" &&
+ event.filterCard(get.autoViewAs({ name }, "unsure"), player, event)
+ )
+ list.push(["基本", "", name]);
}
var dialog = ui.create.dialog("念恩", [list, "vcard"]);
dialog.direct = true;
return dialog;
},
filter: function (button, player) {
- return _status.event.getParent().filterCard(get.autoViewAs({ name: button.link[2], nature: button.link[3] }, "unsure"), player, _status.event.getParent());
+ return _status.event
+ .getParent()
+ .filterCard(
+ get.autoViewAs({ name: button.link[2], nature: button.link[3] }, "unsure"),
+ player,
+ _status.event.getParent()
+ );
},
check: function (button) {
if (_status.event.getParent().type != "phase") return 1;
var player = _status.event.player;
- if (["wugu", "zhulu_card", "yiyi", "lulitongxin", "lianjunshengyan", "diaohulishan"].includes(button.link[2])) return 0;
+ if (
+ [
+ "wugu",
+ "zhulu_card",
+ "yiyi",
+ "lulitongxin",
+ "lianjunshengyan",
+ "diaohulishan",
+ ].includes(button.link[2])
+ )
+ return 0;
return player.getUseValue({
name: button.link[2],
nature: button.link[3],
@@ -5275,7 +5920,11 @@ game.import("character", function () {
player.logSkill("jsrgnianen");
delete event.result.skill;
var card = event.result.card;
- if (get.color(card, player) != "red" || get.name(card) != "sha" || get.natureList(card).length) {
+ if (
+ get.color(card, player) != "red" ||
+ get.name(card) != "sha" ||
+ get.natureList(card).length
+ ) {
player.addTempSkill("jsrgnianen_blocker");
player.addAdditionalSkill("jsrgnianen_blocker", "mashu");
}
@@ -5283,13 +5932,22 @@ game.import("character", function () {
};
},
prompt: function (links, player) {
- return "将一张牌当做" + (get.translation(links[0][3]) || "") + get.translation(links[0][2]) + "使用";
+ return (
+ "将一张牌当做" +
+ (get.translation(links[0][3]) || "") +
+ get.translation(links[0][2]) +
+ "使用"
+ );
},
},
hiddenCard: function (player, name) {
if (!lib.inpile.includes(name)) return false;
var type = get.type2(name);
- return type == "basic" && player.countCards("hes") > 0 && !player.hasSkill("jsrgnianen_blocker");
+ return (
+ type == "basic" &&
+ player.countCards("hes") > 0 &&
+ !player.hasSkill("jsrgnianen_blocker")
+ );
},
ai: {
fireAttack: true,
@@ -5321,32 +5979,39 @@ game.import("character", function () {
enable: "phaseUse",
usable: 1,
filterTarget: function (card, player, target) {
- return game.hasPlayer(current => {
+ return game.hasPlayer((current) => {
return current.inRangeOf(target);
});
},
content: function () {
"step 0";
- var num = game.countPlayer(current => {
+ var num = game.countPlayer((current) => {
return current.inRangeOf(target);
});
var len = target.countCards("h");
num = Math.max(0, Math.min(len + num, 5) - len);
if (num > 0) target.draw(num);
"step 1";
- var num = game.countPlayer(current => {
+ var num = game.countPlayer((current) => {
return current.inRange(target);
});
- if (num > 0) target.chooseToDiscard(num, "he", true, get.translation(player) + "对你发动了【论势】", "请弃置" + get.cnNumber(num) + "张牌");
+ if (num > 0)
+ target.chooseToDiscard(
+ num,
+ "he",
+ true,
+ get.translation(player) + "对你发动了【论势】",
+ "请弃置" + get.cnNumber(num) + "张牌"
+ );
},
ai: {
order: 6,
result: {
target: function (player, target) {
- var num1 = game.countPlayer(current => {
+ var num1 = game.countPlayer((current) => {
return current.inRangeOf(target);
}),
- num2 = game.countPlayer(current => {
+ num2 = game.countPlayer((current) => {
return current.inRange(target);
});
var len = target.countCards("h");
@@ -5364,7 +6029,7 @@ game.import("character", function () {
direct: true,
filter: function (event, player) {
return (
- game.countPlayer(current => {
+ game.countPlayer((current) => {
return current.getEquips(1).length;
}) >= 2
);
@@ -5386,14 +6051,14 @@ game.import("character", function () {
}
return num >= 2;
})
- .set("ai", target => {
+ .set("ai", (target) => {
var sign = -1;
var val = 0;
if (ui.selected.targets.length) {
sign = 1;
var targetx = ui.selected.targets[0];
var cards = targetx.getEquips(1);
- var list = cards.map(card => {
+ var list = cards.map((card) => {
return [card, get.value(card, targetx)];
});
list.sort((a, b) => {
@@ -5402,7 +6067,7 @@ game.import("character", function () {
val = get.attitude(_status.event.player, targetx) * list[0][1];
}
var cards = target.getEquips(1);
- var list = cards.map(card => {
+ var list = cards.map((card) => {
return [card, get.value(card, target)];
});
list.sort((a, b) => {
@@ -5416,7 +6081,7 @@ game.import("character", function () {
targets.sortBySeat();
event.targets = targets;
player.logSkill("jsrgguitu", targets);
- event.rangeList = targets.map(target => {
+ event.rangeList = targets.map((target) => {
return target.getAttackRange();
});
var weapons = [];
@@ -5426,20 +6091,24 @@ game.import("character", function () {
if (weapons.length > 2) {
var list = ["诡图:选择要交换的武器牌"];
for (var target of targets) {
- list.addArray(['