'use strict';
game.import('character',function(lib,game,ui,get,ai,_status){
return {
name:'diy',
connect:true,
connectBanned:['diy_tianyu','diy_yangyi','diy_lukang','ns_huamulan','ns_yuji','ns_duangui','ns_liuzhang','key_yuu'],
character:{
noname:["female","key",3,["noname_zhuyuan","noname_duocai"]],
sp_key_yuri:['female','qun',4,['mubing','ziqu','diaoling']],
key_lucia:['female','key','2/3',['lucia_duqu','lucia_zhenren']],
key_kyousuke:['male','key',4,['nk_shekong','key_huanjie']],
key_yuri:['female','key',3,['yuri_xingdong','key_huanjie','yuri_wangxi'],['zhu']],
key_haruko:['female','key',4,['haruko_haofang','haruko_zhuishi']],
key_umi:['female','key',3,['umi_chaofan','umi_lunhui','umi_qihuan']],
key_umi2:['female','key',3,[],['unseen']],
key_rei:['male','key',4,['xiandeng','shulv','xisheng']],
key_komari:['female','key',3,['komari_tiankou','komari_xueshang']],
key_yukine:['female','key',3,['yukine_wenzhou']],
key_yusa:['female','key',3,['yusa_yanyi','yusa_misa','dualside'],['dualside:key_misa']],
key_misa:['female','key',3,['misa_yehuo','misa_yusa','dualside'],['unseen']],
key_masato:['male','key','4/8',['masato_baoquan']],
key_iwasawa:['female','key',3,['iwasawa_yinhang','iwasawa_mysong']],
key_kengo:['male','key',4,['kengo_weishang','kengo_guidui']],
key_yoshino:['male','key',4,['yoshino_jueyi']],
key_yui:['female','key',3,['yui_jiang','yui_lieyin','yui_takaramono']],
key_tsumugi:['female','key',3,['tsumugi_mugyu','tsumugi_huilang']],
key_saya:['female','key',3,['saya_shouji','saya_powei']],
key_harukakanata:['female','key',3,['haruka_shuangche']],
key_inari:['female','key',2,['inari_baiwei','inari_huhun']],
key_shiina:['female','key',3,['shiina_qingshen','shiina_feiyan']],
key_sunohara:['double','key','3/3/2',['sunohara_chengshuang','sunohara_tiaoyin','sunohara_jianren']],
key_rin:['female','key',3,['rin_baoqiu']],
key_sasami:['female','key',3,['sasami_miaobian']],
key_akane:['female','key',3,['akane_jugu','akane_quanqing','akane_yifu'],['zhu']],
key_doruji:['female','key',16,['doruji_feiqu']],
key_yuiko:['female','key',3,['yuiko_fenglun','yuiko_dilve']],
key_riki:['double','key',3,['riki_spwenji','riki_nvzhuang','riki_mengzhong']],
key_hisako:['female','key',3,['hisako_yinbao','hisako_zhuanyun']],
key_hinata:['male','key',4,['hinata_qiulve','hinata_ehou']],
key_noda:['male','key',4,['noda_fengcheng','noda_xunxin']],
key_tomoya:['male','key',4,['tomoya_shangxian','tomoya_wangjin']],
key_nagisa:['female','key',3,['nagisa_tiandu','nagisa_fuxin']],
key_ayato:['male','key',3,['ayato_jianshen','ayato_zonghuan']],
key_ao:['female','key',3,['ao_xishi','ao_kuihun','ao_shixin']],
key_yuzuru:['male','key',5,['yuzuru_wuxin','yuzuru_deyi']],
sp_key_kanade:['female','key',3,['kanade_mapo','kanade_benzhan']],
key_mio:['female','key',3,['mio_tuifu','mio_tishen']],
key_midori:['female','key',3,['midori_nonghuan','midori_tishen']],
key_kyoko:['female','key',3,['kyoko_juwu','kyoko_zhengyi']],
key_shizuru:['female','key',3,['shizuru_nianli','shizuru_benzhan']],
key_shiorimiyuki:['female','key',3,['shiorimiyuki_banyin','shiorimiyuki_tingxian']],
key_miki:['female','key',3,['miki_shenqiang','miki_huanmeng','miki_zhiluo']],
key_shiori:['female','key','2/3',['shiori_huijuan']],
key_kaori:['female','key','3/4',['kaori_siyuan']],
key_akiko:['female','key',3,['akiko_dongcha']],
key_abyusa:['female','key',3,['abyusa_jueqing','abyusa_dunying']],
key_godan:['male','key',6,['godan_yuanyi','godan_feiqu','godan_xiaoyuan']],
key_yuu:['male','key',3,['yuu_lveduo']],
key_ryoichi:['male','key',4,['ryoichi_baoyi','ryoichi_tuipi']],
key_kotori:['female','key',3,['kotori_yumo','kotori_huazhan']],
key_jojiro:['male','key',4,['jojiro_shensu','jojiro_shunying']],
key_shiroha:['female','key',3,['shiroha_yuzhao','shiroha_guying','shiroha_jiezhao']],
key_shizuku:['female','key',3,['shizuku_sizhi','shizuku_biyi','shizuku_sanhua']],
key_hiroto:['male','key',3,['hiroto_huyu','hiroto_tuolao']],
key_sakuya:['male','key',3,['youlong','luanfeng','sakuya_junbu']],
key_youta:['male','key',4,[]],
key_rumi:['female','key','3/4',['rumi_shuwu']],
key_chihaya:['female','key',3,['chihaya_liewu','chihaya_youfeng']],
key_yukito:['male','key',4,['yukito_kongwu','yukito_yaxiang']],
key_crow:['male','key',4,[],['unseen']],
key_asara:['female','key',3,['asara_shelu','asara_yingwei']],
key_kotomi:['female','key',3,['kotomi_qinji','kotomi_chuanxiang']],
key_mia:['female','key',3,['mia_shihui','mia_qianmeng']],
key_kano:['female','key',3,['kano_liezhen','kano_poyu']],
db_key_liyingxia:['female','shu',3,['liyingxia_sanli','liyingxia_zhenjun','liyingxia_wumai'],['doublegroup:shu:key']],
key_erika:['female','key','3/3/2',['erika_shisong','erika_yousheng']],
key_satomi:['female','key',3,['satomi_luodao','satomi_daohai']],
key_kud:['female','key',3,['kud_qiaoshou','kud_buhui']],
key_misuzu:['female','key',3,['misuzu_hengzhou','misuzu_nongyin','misuzu_zhongxing']],
key_kamome:['female','key',3,['kamome_yangfan','kamome_huanmeng','kamome_jieban']],
key_nao:['female','key',3,['nao_duyin','nao_wanxin','nao_shouqing']],
key_yuuki:['female','key',3,['yuuki_yicha']],
key_kotarou:['male','key',3,['kotarou_rewrite','kotarou_aurora']],
key_tenzen:['male','key',4,['tenzen_fenghuan','tenzen_retianquan']],
key_kyouko:['female','key',3,['kyouko_rongzhu','kyouko_gongmian']],
key_kyou:['female','key',3,['kyou_zhidian','kyou_duanfa']],
key_seira:['female','key',3,['seira_xinghui','seira_yuanying']],
key_kiyu:['female','key',3,['kiyu_yuling','kiyu_rexianyu']],
key_tomoyo:['female','key',4,['tomoyo_wuwei','tomoyo_zhengfeng']],
key_minagi:['female','key',3,['minagi_peiquan','minagi_huanliu']],
key_michiru:['female','key',3,['michiru_sheyuan']],
ns_huangchengyan:['male','shu',3,['nslongyue','nszhenyin']],
ns_sunchensunjun:['male','wu',5,['nsxianhai','nsxingchu']],
ns_yuanxi:['male','qun',4,['nsshengyan','nsdaizhan']],
ns_caoshuang:['male','wei',4,['nsjiquan','nsfuwei']],
ns_sunyi:['male','wu',4,['nsguolie']],
ns_huangwudie:['female','shu',4,['nsdiewu','nslingying','nspojian']],
ns_chentai:['male','wei',4,['nsweiyuan','nsjuxian']],
ns_zhangning:['female','qun',3,['nsfuzhou','nsguidao','nstaiping']],
ns_yanghu:['male','jin',3,['nsbizhao','nsqingde','nsyidi'],['hiddenSkill']],
ns_zanghong:['male','qun',4,['nsshimeng']],
ns_ruanji:['male','wei',3,['nsshizui','nsxiaoye']],
ns_limi:['male','jin',3,['nstuilun']],
ns_zhonglimu:['male','wu',4,['nskuanhuai','nsdingbian']],
prp_zhugeliang:['male','shu',3,['nsxingyun','nshanlang']],
ns_zhangwei:['female','shu',3,['nsqiyue','nsxuezhu']],
diy_wenyang:['male','wei','4/6',['lvli','choujue']],
// diy_caocao:['male','wei',4,['xicai','diyjianxiong','hujia']],
diy_hanlong:['male','wei',4,['siji','ciqiu']],
diy_feishi:['male','shu',3,['nsshuaiyan','moshou']],
diy_liuyan:['male','qun',3,['juedao','geju']],
// diy_luxun:['male','wu',3,['shaoying','zonghuo']],
diy_yuji:['male','qun',3,['diyguhuo','diychanyuan']],
// diy_zhouyu:['male','wu',3,['jieyan','honglian']],
// diy_zhouyu:['male','wu',3,['xiongzi','yaliang']],
diy_caiwenji:['female','qun',3,['beige','guihan']],
diy_lukang:['male','wu',4,['luweiyan','qianxun']],
// diy_xuhuang:['male','wei',4,['diyduanliang']],
// diy_dianwei:['male','wei',4,['diyqiangxi']],
// diy_huangzhong:['male','shu',4,['liegong','fuli']],
// diy_weiyan:['male','shu',4,['diykuanggu']],
diy_zhenji:['female','wei',3,['diy_jiaoxia','yiesheng']],
// diy_menghuo:['male','shu',4,['huoshou','zaiqix']],
//re_huangyueying:['female','shu',3,['rejizhi','qicai']],
diy_liufu:['male','wei',3,['zhucheng','duoqi']],
diy_xizhenxihong:['male','shu',4,['fuchou','jinyan']],
diy_liuzan:['male','wu',4,['kangyin']],
diy_zaozhirenjun:['male','wei',3,['liangce','jianbi','diyjuntun']],
diy_yangyi:['male','shu',3,['choudu','liduan']],
diy_tianyu:['male','wei',4,['chezhen','youzhan']],
ns_zuoci:['male','qun',3,['nsxinsheng','nsdunxing']],
ns_lvzhi:['female','qun',3,['nsnongquan','nsdufu']],
ns_wangyun:["male","qun",4,["liangji","jugong","chengmou"]],
ns_nanhua:["male","qun",3,["nshuanxian","nstaiping_nh","nsshoudao"]],
ns_nanhua_left:["male","qun",2,[],['unseen']],
ns_nanhua_right:["female","qun",2,[],['unseen']],
ns_huamulan:['female','qun',3,['nscongjun','xiaoji','gongji']],
ns_huangzu:['male','qun',4,['nsjihui','nsmouyun']],
ns_jinke:['male','qun',4,['nspinmin','nsshishou']],
ns_yanliang:['male','qun',4,['nsduijue','nsshuangxiong','dualside'],['dualside:ns_wenchou']],
ns_wenchou:['male','qun',2,['nsguanyong','dualside'],['unseen']],
ns_caocao:['male','wei',4,['nscaiyi','nsgefa','nshaoling']],
ns_caocaosp:['male','qun',3,['nsjianxiong','nsxionglue']],
ns_zhugeliang:['male','shu',3,['nsguanxing','kongcheng','nsyunxing']],
ns_wangyue:['male','qun',4,['nsjianshu','nscangjian']],
ns_yuji:['male','qun',3,['nsyaowang','nshuanhuo']],
ns_xinxianying:['female','wei',3,['nsdongcha','nscaijian','nsgongjian']],
ns_guanlu:['male','wei',3,['nsbugua','nstuiyan','nstianji']],
ns_simazhao:['male','wei',3,['nszhaoxin','nsxiuxin','nsshijun']],
ns_sunjian:['male','wu',4,['nswulie','nshunyou','nscangxi']],
ns_duangui:['male','qun',3,['nscuanquan','nsjianning','nschangshi','nsbaquan']],
ns_zhangbao:['male','qun',3,['nsfuhuo','nswangfeng']],
ns_masu:['male','shu',3,['nstanbing','nsxinzhan']],
ns_zhangxiu:['male','qun',4,['nsbaiming','nsfuge']],
ns_lvmeng:['male','wu',3,['nsqinxue','nsbaiyi']],
ns_shenpei:['male','qun',3,['nshunji','shibei']],
ns_yujisp:['male','qun',3,['nsguhuo']],
ns_yangyi:['male','shu',3,['nsjuanli','nsyuanchou']],
ns_liuzhang:['male','qun',3,['nsanruo','nsxunshan','nskaicheng']],
// ns_zhaoyun:['male','qun',3,[]],
// ns_lvmeng:['male','qun',3,[]],
// ns_zhaoyunshen:['male','qun',3,[]],
// ns_lisu:['male','qun',3,[]],
// ns_sunhao:['male','qun',3,[]],
ns_xinnanhua:['male','qun',3,['ns_xiandao','ns_xiuzheng','ns_chuanshu']],
ns_caimao:['male','qun',4,['nsdingzhou']],
ns_luyusheng:['female','wu',3,['nshuaishuang','nsfengli']],
ns_chengpu:['male','wu',4,['decadelihuo','decadechunlao']],
ns_sundeng:['male','wu',4,['xinkuangbi']],
ns_duji:['male','wei',3,['xinfu_andong','xinyingshi']],
old_jiakui:['male','wei',4,['tongqu','xinwanlan']],
ol_guohuai:['male','wei',3,['rejingce']],
junk_zhangrang:['male','qun',3,['junktaoluan']],
old_bulianshi:['female','wu',3,['anxu','zhuiyi']],
ol_maliang:['male','shu',3,['zishu','xinyingyuan']],
junk_liubei:['male','shu',4,['junkrende','jijiang'],['zhu']],
junk_huangyueying:['female','shu',3,['junkjizhi','junkqicai']],
},
characterFilter:{
key_jojiro:function(mode){
return mode=='chess'||mode=='tafang';
},
key_yuu:function(mode){
return mode=='identity'||mode=='doudizhu'||mode=='single'||(mode=='versus'&&_status.mode!='standard'&&_status.mode!='three');
},
key_tomoya:function(mode){
return mode!='chess'&&mode!='tafang'&&mode!='stone';
},
key_sunohara:function(mode){
return mode!='guozhan';
},
ns_duangui:function(mode){
return mode=='identity'&&_status.mode=='normal';
},
diy_liuyan:function(mode){
return mode!='chess'&&mode!='tafang';
}
},
characterSort:{
diy:{
diy_yijiang:["key_kud","key_misuzu","key_kamome","key_nao",
"ns_huangchengyan","ns_sunchensunjun","ns_yuanxi","ns_caoshuang"],
diy_yijiang2:["key_yuuki","key_tenzen","key_kyouko","key_kotarou","key_kyou",
"ns_chentai","ns_huangwudie","ns_sunyi","ns_zhangning","ns_yanghu"],
diy_yijiang3:['ns_ruanji','ns_zanghong','ns_limi','ns_zhonglimu','prp_zhugeliang','key_seira','key_kiyu','key_tomoyo','key_minagi','key_michiru'],
diy_tieba:["ns_zuoci","ns_lvzhi","ns_wangyun","ns_nanhua","ns_nanhua_left","ns_nanhua_right","ns_huamulan","ns_huangzu","ns_jinke","ns_yanliang","ns_wenchou","ns_caocao","ns_caocaosp","ns_zhugeliang","ns_wangyue","ns_yuji","ns_xinxianying","ns_guanlu","ns_simazhao","ns_sunjian","ns_duangui","ns_zhangbao","ns_masu","ns_zhangxiu","ns_lvmeng","ns_shenpei","ns_yujisp","ns_yangyi","ns_liuzhang","ns_xinnanhua","ns_luyusheng"],
diy_fakenews:["diy_wenyang","ns_zhangwei","ns_caimao","ns_chengpu",'ns_sundeng','ns_duji'],
diy_xushi:["diy_feishi","diy_hanlong","diy_liufu","diy_liuyan","diy_liuzan","diy_tianyu","diy_xizhenxihong","diy_yangyi","diy_zaozhirenjun"],
diy_default:["diy_yuji","diy_caiwenji","diy_lukang","diy_zhenji"],
diy_noname:['noname'],
diy_key:["key_lucia","key_kyousuke","key_yuri","key_haruko","key_umi","key_rei","key_komari","key_yukine","key_yusa","key_misa","key_masato","key_iwasawa","key_kengo","key_yoshino","key_yui","key_tsumugi","key_saya","key_harukakanata","key_inari","key_shiina","key_sunohara","key_rin","key_sasami","key_akane","key_doruji","key_yuiko","key_riki","key_hisako","key_hinata","key_noda","key_tomoya","key_nagisa","key_ayato","key_ao","key_yuzuru","sp_key_kanade","key_mio","key_midori","key_kyoko","key_shizuru","key_shiorimiyuki","key_miki","key_shiori","key_kaori","sp_key_yuri","key_akiko","key_abyusa","key_godan","key_yuu","key_ryoichi","key_kotori","key_jojiro","key_shiroha","key_shizuku","key_hiroto","key_sakuya","key_youta","key_rumi","key_chihaya","key_yukito","key_asara","key_kotomi","key_mia","key_kano","db_key_liyingxia","key_erika","key_satomi"],
diy_trashbin:['old_jiakui','ol_guohuai','junk_zhangrang','old_bulianshi','junk_sunquan','ol_maliang','junk_liubei','junk_huangyueying'],
},
},
characterIntro:{
noname:'无名杀的吉祥物。
画师:空城
技能设计:李木子',
diy_hanlong:'韩龙,魏国刺客。他孤身一人深入到了长城外的敌人领地,成功刺杀了敌方首领轲比能,瓦解了鲜卑民族,曹魏边境因此获得了几十年的安稳。',
ns_zhangwei:'血骑教习·张葳,三国杀集换式卡牌游戏《阵面对决》中的帝畿系列卡牌。游卡桌游官方原创的三国时期女性角色。',
diy_feishi:'字公举,生卒年不详,益州犍为郡南安县(今四川省乐山市)人。刘璋占据益州时,以费诗为绵竹县县令。刘备进攻刘璋夺取益州,费诗举城而降,后受拜督军从事,转任牂牁郡太守,再为州前部司马。',
diy_lukang:'字幼节,吴郡吴县(今江苏苏州)人。三国时期吴国名将,丞相陆逊次子。',
diy_liufu:'字元颖,沛国相县(今安徽濉溪县西北)人。东汉末年名守。在汉末避难于淮南,说服袁术将戚寄和秦翊率部投奔曹操,曹操大悦,使司徒辟其为掾属。',
diy_xizhenxihong:'习珍,襄阳人。三国时蜀汉将领。先主刘备时曾任零陵北部都尉,加裨将军。建安二十四年,关羽率荆州大军攻打樊城,唯有习珍据城不降。被困月余,直到箭尽粮绝,拔剑自刎而死。习宏,生卒年不详,习珍之弟。曾在东吴入侵蜀汉时建议哥哥习珍伪降,约樊胄举兵。习珍死后,弟弟习宏落在东吴,有问必不答,终身不为孙权发一言。',
diy_zaozhirenjun:'枣祗,生卒年月不详,东汉末年颍川阳翟(今河南省禹州市)人。曾任东阿令、羽林监、屯田都尉、陈留太守等职。任峻(?—204年),字伯达,河南郡中牟县人。曹操每次出征,任峻通常在后方补给军队。后来发生饥荒,枣祗建议实施屯田,任峻被任命为典农中郎将,招募百姓在许下屯田,结果连年丰收,积谷足以装满全部粮仓。',
diy_yangyi:'字威公,襄阳(今湖北襄阳)人,三国时期蜀汉政治家。最初,为荆州刺史傅群的主簿,后投奔关羽,任为功曹。羽遣其至成都,大受刘备赞赏,擢为尚书。建兴三年(225年)任丞相参军,此后一直跟随诸葛亮战斗。亮卒,他部署安全退军。亮生前定蒋琬继己任,仪仅拜中军师。建兴十三年(235年),因多出怨言,被削职流放至汉嘉郡。但杨仪仍不自省,又上书诽谤,言辞激烈,最后下狱,自杀身亡。',
diy_tianyu:'字国让,渔阳雍奴(今天津市武清区东北)人。三国时期曹魏将领。初从刘备,因母亲年老回乡,后跟随公孙瓒,公孙瓒败亡,劝说鲜于辅加入曹操。曹操攻略河北时,田豫正式得到曹操任用,历任颖阴、郎陵令、弋阳太守等。',
chentai:'陈泰(200年~260年),字玄伯,颍川许昌(今河南省许昌市)人。三国时期魏国名将,司空陈群之子。陈泰早年起家员外散骑侍郎,其父陈群死后袭封颍阴侯,历任游击将军、并州、雍州刺史、尚书等职,高平陵政变发生时,陈泰力劝大将军曹爽投降,因此得到掌权的司马氏信任,此后为了回避朝廷的争斗,陈泰主动请求外调雍州任职,任内成功防御蜀将姜维的多次进攻。甘露元年(256年),陈泰被调回朝中任尚书右仆射,曾随司马昭两度抵抗东吴的进攻,后改任左仆射。甘露五年(260年),魏帝曹髦被弑杀,陈泰闻讯后悲痛过度,呕血而死,享年六十一岁。追赠司空,赐谥为穆。',
huangwudie:'黄舞蝶是在现代三国作品中出场的虚拟人物,设定为蜀汉大将黄忠之女,跟随父亲一同投效刘备,在游戏中是一名不错的女将。',
sunyi:'孙翊(184年~204年),又名孙俨,字叔弼,是孙坚的第三子,孙策、孙权的弟弟。曾被大臣推荐为继承者。孙权继位后,孙翊任丹杨太守,后被身边的人边鸿刺杀。',
zhangning:'《三国杀·阵面对决》中登场的角色。张角之女,能呼雷掣电。',
yanghu:'羊祜(221年-278年12月27日),字叔子,泰山郡南城县人。西晋时期杰出的战略家、政治家、文学家,曹魏上党太守羊衜的儿子,名儒蔡邕的女儿蔡文姬的外甥。出身“泰山羊氏”,博学能文,清廉正直。曹魏时期,接受公车征辟,出任中书郎,迁给事黄门侍郎。姐姐嫁给大将军司马师,投靠司马氏家族,仕途平步青云。魏元帝曹奂即位,出任秘书监、相国从事中郎、中领军,统领御林军,兼管内外政事,册封钜平县子,迁。西晋建立后,迁中军将军、散骑常侍、郎中令,册封钜平侯。泰始五年(269年),出任车骑将军、荆州都督,加任开府仪同三司坐镇襄阳,屯田兴学,以德怀柔,深得军民之心;扩充军备,训练士兵,全力准备灭亡孙吴,累迁征南大将军,册封南城侯。咸宁四年,去世,临终前举荐杜预接任职务,获赠侍中、太傅,谥号为“成”。唐宋时期,配享武庙。',
ns_wangyue:'王越,东汉末年游侠(生卒年不详),乃辽东燕山人士,擅使剑术, 三国时期史阿的师父,曹丕的师公,官职虎贲将军。在史书《典论》中略有记载。',
},
characterTitle:{
key_satomi:'#rHeaven Burns Red',
key_erika:'#rHeaven Burns Red',
db_key_liyingxia:'#rHeaven Burns Red',
key_kano:'#bAIR',
key_mia:'#bLoopers',
key_kotomi:'#gClannad',
key_asara:'#bRewrite',
key_yukito:'#bAIR',
key_chihaya:'#bRewrite',
key_rumi:'#rONE ~輝く季節へ~',
key_youta:'#b神様になった日',
key_sakuya:'#bRewrite',
key_hiroto:'#b神様になった日',
key_shizuku:'#bSummer Pockets',
key_shiroha:'#bSummer Pockets',
key_jojiro:'#bCharlotte
战棋专属角色',
key_kotori:'#bRewrite',
key_ryoichi:'#bSummer Pockets',
key_yuu:'#bCharlotte',
key_godan:'#rAngel Beats!',
key_abyusa:'#rAngel Beats!',
key_akiko:'#bKanon',
key_kaori:'#bKanon',
key_shiori:'#bKanon',
key_miki:'#bSummer Pockets',
key_shiorimiyuki:'#rAngel Beats!',
key_shizuru:'#bRewrite',
key_kyoko:'#bSummer Pockets',
sp_key_kanade:'#rAngel Beats!',
key_yuzuru:'#rAngel Beats!',
key_tsumugi:'#bSummer Pockets',
key_ayato:'#rAngel Beats!',
key_nagisa:'#gClannad',
key_tomoya:'#gClannad',
key_noda:'#rAngel Beats!',
key_hinata:'#rAngel Beats!',
key_hisako:'#rAngel Beats!',
key_doruji:'#bLittle Busters!',
key_riki:'#bLittle Busters!',
key_yuiko:'#bLittle Busters!',
key_akane:'#bRewrite',
key_sasami:'#bLittle Busters!',
key_rin:'#bLittle Busters!',
key_shiina:'#rAngel Beats!',
key_inari:'#bSummer Pockets',
key_saya:'#bLittle Busters!',
key_harukakanata:'#bLittle Busters!',
key_tsumugi:'#bSummer Pockets',
key_yui:'#rAngel Beats!',
key_yoshino:'#bRewrite',
key_kengo:'#bLittle Busters!',
key_iwasawa:'#rAngel Beats!',
key_masato:'#bLittle Busters!',
key_yusa:'#bCharlotte',
key_misa:'#rCharlotte',
key_yukine:'#gClannad',
key_komari:'#bLittle Busters!',
key_umi:'#bSummer Pockets',
key_rei:'#gHarmonia',
key_lucia:'#bRewrite',
key_kyousuke:'#bLittle Busters!',
key_yuri:'#rAngel Beats!',
key_haruko:'#bAIR',
sp_key_yuri:'#bAngel Beats!',
key_kud:'#b千夜',
key_misuzu:'#b长发及腰黑长直',
key_kamome:'#b仿生纱',
key_nao:'#b潮鸣',
key_kyou:'#b长发及腰黑长直',
key_yuuki:'#b4399司命',
key_kyouko:'#b阿阿阿687',
key_tenzen:'#b皋耳击',
key_kotarou:'#bb1154486224',
key_seira:'#b阿开木木W🍀',
key_kiyu:'#b无面◎隐者',
key_tomoyo:'#b长发及腰黑长直',
key_minagi:'#b无面◎隐者',
ns_huangchengyan:'#g竹邀月',
ns_sunchensunjun:'#gVenusjeu',
ns_yuanxi:'#g食茸二十四',
ns_caoshuang:'#g荬庀芬兰',
ns_chentai:'#g荀彧III荀文若',
ns_huangwudie:'#g你爸爸来了164',
ns_sunyi:'#g无民氏4251',
ns_zhangning:'#g如颍隋行1314',
ns_yanghu:'#ginCenv',
ns_ruanji:'#g伯约的崛起',
ns_zanghong:'#g阿七',
ns_limi:'#g-心若困兽-',
ns_zhonglimu:'#gJG赛文♠7',
prp_zhugeliang:'#g阿开木木W🍀',
ns_luyusheng:'#g猫咪大院 - 魚と水',
ns_caimao:'#gP尔号玩家◆',
diy_wenyang:'#g最粗的梦想XD',
ns_zuoci:'#bskystarwuwei',
ns_lvzhi:'#bskystarwuwei',
ns_wangyun:'#rSukincen',
ns_guanlu:'#rSukincen',
ns_xinnanhua:'#rSukincen',
ns_nanhua:'#g戒除联盟',
ns_shenpei:'#g戒除联盟',
ns_huamulan:'#p哎别管我是谁',
ns_jinke:'#p哎别管我是谁',
ns_huangzu:'#r小芯儿童鞋',
ns_lisu:'#r小芯儿童鞋',
ns_yanliang:'#r丶橙续缘',
ns_wenchou:'#r丶橙续缘',
ns_caocao:'#r一瞬间丶遗忘',
ns_caocaosp:'#g希望教主',
ns_zhugeliang:'#p死不死什么的',
ns_xinxianying:'#b扶苏公子',
ns_zhangbao:'#b扶苏公子',
ns_wangyue:'#p废城君',
ns_sunjian:'#b兔子两只2',
ns_lvmeng:'#b兔子两只2',
ns_yujisp:'#b兔子两只2',
ns_yuji:'#g蔚屿凉音',
ns_simazhao:'#r一纸载春秋',
ns_duangui:'#b宝宝酱紫萌萌哒',
ns_masu:'#g修女',
ns_zhangxiu:'#p本因坊神策',
ns_yangyi:'#p本因坊神策',
ns_liuzhang:'#r矮子剑薄荷糖',
},
card:{
kano_paibingbuzhen:{
fullskin:true,
type:'trick',
enable:true,
filterTarget:true,
selectTarget:[1,3],
derivation:'key_kano',
content:function(){
'step 0'
target.draw();
'step 1'
var hs=target.getCards('he');
if(!hs.length) event.finish();
else if(hs.length==1) event._result={bool:true,cards:hs};
else target.chooseCard('he',true,'选择一张牌置入仁库');
'step 2'
if(result.bool){
var card=result.cards[0];
target.$throw(card,1000);
target.lose(card,'toRenku');
}
},
contentAfter:function(){
if(player.isIn()&&_status.renku.length&&function(){
var cards=_status.renku;
if(cards.length==1) return true;
var color=get.color(cards[0],false),type=get.type(cards[0],false);
for(var i=1;icard.hasGaintag('minagi_tag'),'h');
},
filterCard:function(card){
return card.hasGaintag('minagi_tag');
},
position:'h',
filterTarget:lib.filter.notMe,
discard:false,
lose:false,
delay:false,
promptfunc:()=>'出牌阶段,你可以赠予一张“米券”,然后执行一项本回合内未被选择过的效果:⒈对其造成1点伤害;⒉摸两张牌;⒊弃置其的两张牌;⒋亮出牌堆顶的一张牌,然后你可以使用之。',
check:function(card){
var player=_status.event.player;
if(get.cardtag(card,'gifts')&&get.type(card,false)=='equip'&&game.hasPlayer(function(current){
return current!=player&¤t.canEquip(card,true)&&!current.hasSkillTag('refuseGifts')&&get.effect(current,card,player,player)>0;
})) return 2;
return 1+Math.random();
},
content:function(){
'step 0'
var next=game.createEvent('_yongjian_zengyu');
next.player=player;
next.target=target;
next.cards=cards;
next.setContent(lib.skill._yongjian_zengyu.content);
'step 1'
var list=player.getStorage('minagi_peiquan_yukito');
if(list.length>=4) event.finish();
else{
var yukito=get.translation(target);
player.chooseButton([
'配券:请选择一项执行',
[[
['damage','选项一:对'+yukito+'造成1点伤害'],
['draw','选项二:摸两张牌'],
['discard','选项三:弃置'+yukito+'的两张牌'],
['use','选项四:亮出牌堆顶的一张牌,然后可以使用之'],
],'textbutton']
],true).set('list',list).set('filterButton',function(button){
return !_status.event.list.contains(button.link);
}).set('ai',function(button){
var player=_status.event.player,target=_status.event.getParent().target;
switch(button.link){
case 'damage':return get.damageEffect(target,player,player);
case 'draw':return get.effect(player,{name:'wuzhong'},player,player)
case 'discard':return get.effect(target,{name:'guohe_copy2'},player,player)*Math.min(1.6,target.countCards('he'));
case 'use':return _status.event.getRand('minagi_peiquan')*4;
}
});
}
'step 2'
player.markAuto('minagi_peiquan_yukito',result.links);
player.addTempSkill('minagi_peiquan_yukito');
switch(result.links[0]){
case 'damage':target.damage('nocard');break;
case 'draw':player.draw(2);break;
case 'discard':player.discardPlayerCard(target,2,'he',true);break;
}
if(result.links[0]!='use') event.finish();
'step 3'
var card=get.cards()[0];
game.cardsGotoOrdering(card);
player.showCards(card);
player.chooseUseTarget(card,'是否使用'+get.translation(card)+'?');
},
ai:{
order:4,
result:{
player:function(player,target){
var baseEffect=Math.min(3,get.effect(target,'_yongjian_zengyu',player,player));
var choices=['damage','draw','discard','use'];
choices.removeArray(player.getStorage('minagi_peiquan_yukito'));
if(choices.length<=0) return baseEffect;
var eff=Math.max.apply(Math,choices.map(function(choice){
switch(choice){
case 'damage':return get.damageEffect(target,player,player);
case 'draw':return get.effect(player,{name:'wuzhong'},player,player);
case 'discard':return get.effect(target,{name:'guohe_copy2'},player,player)*Math.min(1.6,target.countCards('he'));
case 'use':return _status.event.getRand('minagi_peiquan')*4;
}
}));
return baseEffect+eff;
},
},
},
group:'minagi_peiquan_umareta',
subSkill:{
yukito:{charlotte:true,onremove:true},
umareta:{
trigger:{
global:'phaseBefore',
player:'enterGame',
},
forced:true,
filter:function(event,player){
return (event.name!='phase'||game.phaseNumber==0)&&player.countCards('h')>0;
},
content:function(){
var hs=player.getCards('h');
player.addGaintag(hs,'minagi_tag');
},
},
},
},
minagi_huanliu:{
trigger:{player:'phaseZhunbeiBegin'},
direct:true,
content:function(){
'step 0'
player.chooseTarget(lib.filter.notMe,get.prompt('minagi_huanliu'),'和一名其他角色进行“协力”,并获得“远野小满”的所有对应技能').set('ai',function(target){
return get.threaten(target)*Math.sqrt(1+target.countCards('h'))*((target.isTurnedOver()||target.hasJudge('lebu'))?0.1:1);
});
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('minagi_huanliu',target);
player.chooseCooperationFor(target,'minagi_huanliu').set('ai',function(button){
var base=0;
switch(button.link){
case 'cooperation_damage':base=0.1;break;
case 'cooperation_draw':base=0.6;break;
case 'cooperation_discard':base=0.1;break;
case 'cooperation_use':base=0.3;break;
}
return base+Math.random();
});
player.addAdditionalSkill('cooperation',['minagi_huanliu_effect','michiru_sheyuan']);
}
else event.finish();
'step 2'
game.delayx();
},
subSkill:{
effect:{
charlotte:true,
trigger:{global:'phaseJieshuBegin'},
forced:true,
logTarget:'player',
filter:function(event,player){
return player.checkCooperationStatus(event.player,'minagi_huanliu')&&player.countCards('h')>0;
},
content:function(){
game.log(player,'和',trigger.player,'的协力成功');
var hs=player.getCards('h');
player.addGaintag(hs,'minagi_tag');
game.delayx();
},
},
},
derivation:'michiru_sheyuan',
},
michiru_sheyuan:{
charlotte:true,
enable:'chooseToUse',
filter:function(event,player){
if(player.hasSkill('michiru_sheyuan_round')) return false;
var hs=player.getCards('h');
if(!hs.length) return false;
for(var i of hs){
if(i.hasGaintag('minagi_tag')) return false;
if(!game.checkMod(i,player,'unchanged','cardEnabled2',player)) return false;
}
for(var name of lib.inpile){
var type=get.type(name);
if(type!='basic'&&type!='trick') return false;
var card=get.autoViewAs({name:name},hs)
if(event.filterCard(card,player,event)) return true;
if(name=='sha'){
for(var nature of lib.inpile_nature){
card.nature=nature;
if(event.filterCard(card,player,event)) return true;
}
}
}
return false;
},
hiddenCard:function(player,name){
var type=get.type(name);
if(type!='basic'&&type!='trick') return false;
if(player.hasSkill('michiru_sheyuan_round')) return false;
var hs=player.getCards('h');
if(!hs.length) return false;
if(_status.connectMode) return true;
for(var i of hs){
if(i.hasGaintag('minagi_tag')) return false;
if(!game.checkMod(i,player,'unchanged','cardEnabled2',player)) return false;
}
return true;
},
chooseButton:{
dialog:function(event,player){
var list=[],hs=player.getCards('h');
for(var name of lib.inpile){
var type=get.type(name);
if(type!='basic'&&type!='trick') continue;
var card=get.autoViewAs({name:name},hs);
if(event.filterCard(card,player,event)) list.push([type,'',name]);
if(name=='sha'){
for(var nature of lib.inpile_nature){
card.nature=nature;
if(event.filterCard(card,player,event)) list.push([type,'',name,nature]);
}
}
}
return ui.create.dialog('舍愿',[list,'vcard'],'hidden');
},
check:function(button){
var player=_status.event.player;
var card={
name:button.link[2],
nature:button.link[3],
};
if(_status.event.getParent().type=='phase') return player.getUseValue(card,null,true);
return 1;
},
backup:function(links,player){
return {
viewAs:{
name:links[0][2],
nature:links[0][3],
},
filterCard:true,
position:'h',
selectCard:-1,
onuse:function(result,player){
player.addTempSkill('michiru_sheyuan_round','roundStart');
},
}
},
prompt:function(links,player){
return '将所有手牌当做'+(get.translation(links[0][3])||'')+get.translation(links[0][2])+'使用,然后摸等量的牌';
},
},
ai:{
respondSha:true,
respondShan:true,
skillTagFilter:function(player,tag,arg){
return lib.skill.michiru_sheyuan.hiddenCard(player,'s'+tag.slice(8));
},
order:1,
result:{
player:function(player){
if(_status.event.dying) return get.attitude(player,_status.event.dying);
return 1;
},
},
},
subSkill:{
round:{
charlotte:true,
trigger:{player:'useCardAfter'},
forced:true,
popup:false,
filter:function(event,player){
return event.skill=='michiru_sheyuan_backup';
},
content:function(){
player.draw(trigger.cards.length);
},
},
backup:{},
},
},
//坂上智代
tomoyo_wuwei:{
enable:['chooseToUse','chooseToRespond'],
viewAs:{name:'sha'},
viewAsFilter:function(player){
var storage=player.getStorage('tomoyo_wuwei_mark');
return player.hasCard(function(card){
return !storage.contains(get.suit(card));
},'hs');
},
position:'hs',
filterCard:function(card,player){
var storage=player.getStorage('tomoyo_wuwei_mark');
return !storage.contains(get.suit(card));
},
check:function(card){
return 5-get.value(card);
},
onuse:function(result,player){
player.markAuto('tomoyo_wuwei_mark',[get.suit(result.card,false)]);
player.addTempSkill('tomoyo_wuwei_mark');
},
onrespond:function(event,player){
player.markAuto('tomoyo_wuwei_mark',[get.suit(event.card,false)]);
player.addTempSkill('tomoyo_wuwei_mark');
},
group:'tomoyo_wuwei_combo',
subSkill:{
mark:{
charlotte:true,
onremove:true,
},
combo:{
trigger:{global:'useCardAfter'},
direct:true,
filter:function(event,player){
return event.card.name=='shan'&&player.inRangeOf(event.player)&&player.canUse('sha',event.player,false);
},
content:function(){
player.chooseToUse('武威:是否对'+get.translation(trigger.player)+'使用一张【杀】?',function(card,player,event){
if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments);
},trigger.player,-1).set('addCount',false).logSkill='tomoyo_wuwei_combo';
},
},
},
},
tomoyo_zhengfeng:{
dutySkill:true,
trigger:{player:'phaseZhunbeiBegin'},
direct:true,
filter:function(event,player){
return game.hasPlayer((current)=>player.inRange(current));
},
content:function(){
'step 0'
player.chooseTarget(get.prompt('tomoyo_zhengfeng'),'令一名攻击范围内的角色进行判定。其于你的下回合开始前使用与判定结果颜色相同的牌时,你摸一张牌。',function(card,player,target){
return player.inRange(target);
}).set('ai',function(target){
var player=_status.event.player;
if(player.hp<=1&&!player.countCards('h')) return 0;
var hs=target.countCards('h'),thr=get.threaten(target);
if(target.hasJudge('lebu')) return 0;
return Math.sqrt(1+hs)*Math.sqrt(Math.max(1,1+thr));
});
'step 1'
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('tomoyo_zhengfeng',target);
target.judge();
}
'step 2'
player.addTempSkill('tomoyo_zhengfeng_tomoyo',{player:'phaseBeginStart'});
player.markAuto('tomoyo_zhengfeng_tomoyo',[{
target:target,
color:result.color,
}]);
},
group:'tomoyo_zhengfeng_after',
subSkill:{
tomoyo:{
charlotte:true,
onremove:true,
mod:{
inRangeOf:function(source,player){
var list=player.getStorage('tomoyo_zhengfeng_tomoyo');
for(var obj of list){
if(obj.target==source) return true;
}
},
},
trigger:{global:'useCard'},
forced:true,
filter:function(event,player){
var color=get.color(event.card);
if(color=='none') return false;
var list=player.getStorage('tomoyo_zhengfeng_tomoyo');
for(var obj of list){
if(obj.target==event.player&&color==obj.color) return true;
}
return false;
},
content:function(){
player.draw();
},
intro:{
mark:function(dialog,students,player){
if(!students||!students.length) return '全校风纪良好!';
var str='';
for(var i of students){
if(str.length>0) str+='
';
str+=get.translation(i.target);
str+=':';
str+=get.translation(i.color);
}
dialog.addText(str);
},
},
},
after:{
trigger:{player:'phaseJieshuBegin'},
filter:function(event,player){
return !player.hasHistory('useSkill',function(evt){
return evt.skill=='tomoyo_zhengfeng';
});
},
prompt:'整风:是否放弃使命?',
prompt2:'你可以减1点体力上限并失去〖武威〗,摸两张牌并回复1点体力,然后获得技能〖长誓〗。',
skillAnimation:true,
animationColor:'gray',
check:function(event,player){
return (player.hp*1.1+player.countCards('h'))<3;
},
content:function(){
'step 0'
game.log(player,'放弃了身为学生会长的使命');
player.awakenSkill('tomoyo_zhengfeng');
player.loseMaxHp();
'step 1'
player.removeSkill('tomoyo_wuwei');
'step 2'
player.draw(2);
player.recover();
'step 3'
player.addSkill('tomoyo_changshi');
},
},
},
},
tomoyo_changshi:{
trigger:{
global:['gainAfter','loseAsyncAfter'],
},
forced:true,
filter:function(event,player){
return game.hasPlayer(function(current){
return current!=player&&event.getg(current).length>1&&player.inRangeOf(current);
});
},
content:function(){
player.draw();
},
group:'tomoyo_changshi_recover',
subSkill:{
recover:{
trigger:{global:'recoverAfter'},
forced:true,
filter:function(event,player){
return event.player.isAlive()&&player.inRangeOf(event.player);
},
content:function(){
player.changeHujia(1);
},
},
},
},
//天宫希优
kiyu_yuling:{
mod:{
targetEnabled:function(card){
var info=get.info(card);
if(!info||(info.type!='trick'&&info.type!='delay')) return;
if(info.range) return false;
},
},
trigger:{target:'useCardToTargeted'},
forced:true,
charlotte:true,
filter:function(event,player){
return event.card.name=='sha'&&event.player.countCards('he')>0;
},
logTarget:'player',
content:function(){
trigger.player.chooseToDiscard('he',true,get.distance(trigger.player,player));
},
ai:{
threaten:0.7,
effect:{
target:function(card,player,target,current){
if(card.name=='sha') return 0.7;
},
},
},
},
kiyu_rexianyu:{
trigger:{player:'phaseUseEnd'},
charlotte:true,
unique:true,
filter:function(event,player){
return !player.hasSkill('kiyu_rexianyu_round',null,null,false)&&player.hasHistory('useCard',function(evt){
var type=get.type(evt.card);
if(type!='basic'&&type!='trick') return false;
return evt.getParent('phaseUse')==event;
});
},
direct:true,
content:function(){
'step 0'
var history=player.getHistory('useCard',function(evt){
var type=get.type(evt.card);
if(type!='basic'&&type!='trick') return false;
return evt.getParent('phaseUse')==trigger;
});
var list=[];
event.list=list;
for(var i=0;i0;
},
logTarget:'player',
check:function(event,player){
var target=event.player;
var next=target.next;
if(target.getSeatNum()>next.getSeatNum()) return true;
if(target.countCards('h')<4&&target.countCards('h',function(card){
return target.hasUseTarget(card,null,true);
})<2) return false;
return true;
},
content:function(){
'step 0'
var target=trigger.player,cards=target.getCards('h');
var next=player.chooseToMove('先预:预测'+get.translation(target)+'使用牌的顺序',true);
next.set('list',[
[get.translation(target)+'的手牌',cards]
]);
next.set('processAI',function(list){
var cards=list[0][1].slice(0);
var target=_status.event.getTrigger().player;
cards.sort(function(a,b){
return get.order(b,target)-get.order(a,target);
});
return [cards];
});
'step 1'
if(result.bool){
var list=result.moved[0];
player.storage.kiyu_xianyu_lastrun=list;
player.addTempSkill('kiyu_xianyu_lastrun',list);
}
},
subSkill:{
lastrun:{
trigger:{global:'phaseUseAfter'},
forced:true,
charlotte:true,
onremove:true,
content:function(){
var num=0,index=-1,target=trigger.player;
var cards=player.getStorage('kiyu_xianyu_lastrun');
var history=target.getHistory('useCard',function(event){
return event.getParent('phaseUse')==trigger;
});
for(var evt of history){
var goon=false;
for(var card of evt.cards){
var index2=cards.indexOf(card);
if(index2>index){
goon=true;
index=index2;
}
}
if(goon) num++;
}
if(num>0){
num=Math.min(3,num);
player.draw(num);
if(target.isIn()){
target.addTempSkill('kiyu_xianyu_effect');
target.addMark('kiyu_xianyu_effect',num,false);
}
}
},
},
effect:{
charlotte:true,
onremove:true,
mod:{
maxHandcard:function(player,num){
return num+player.countMark('kiyu_xianyu_effect');
},
},
},
},
},
//樱庭星罗
seira_xinghui:{
trigger:{player:'phaseZhunbeiBegin'},
check:function(event,player){
return !player.getExpansions('seira_xinghui').length;
},
content:function(){
'step 0'
game.delayx();
'step 1'
if(get.isLuckyStar(player)){
event.num=6;
player.throwDice(6);
}
else player.throwDice();
'step 2'
var cards=get.cards(num);
event.cards=cards;
game.cardsGotoOrdering(cards);
var next=player.chooseToMove();
next.set('prompt','星辉:选择要作为“星屑”的牌(先选择的在上)');
next.set('list',[
['置于武将牌上',cards],
['置入弃牌堆'],
]);
next.processAI=function(list){
var cards=list[0][1],player=_status.event.player;
var top=[];
var judges=player.getCards('j');
var stopped=false;
if(!player.hasWuxie()){
for(var i=0;i0;
},
content:function(){
trigger.num++;
game.log(player,'造成了','#y暴击伤害');
},
group:['seira_xinghui_draw','seira_xinghui_judge'],
},
draw:{
trigger:{player:'drawBefore'},
forced:true,
filter:function(event,player){
return player.getExpansions('seira_xinghui').length>0;
},
content:function(){
var cards=player.getExpansions('seira_xinghui');
var num=Math.min(cards.length,trigger.num);
trigger.num-=num;
player.gain(cards.slice(0,num),'draw');
if(trigger.num==0) trigger.cancel();
},
},
judge:{
trigger:{player:'judgeBegin'},
forced:true,
filter:function(event,player){
return player.getExpansions('seira_xinghui').length>0;
},
content:function(){
trigger.directresult=player.getExpansions('seira_xinghui')[0];
},
},
},
},
seira_yuanying:{
enable:'phaseUse',
usable:1,
filterTarget:true,
selectTarget:2,
multitarget:true,
multiline:true,
line:{color:[253, 153, 182]},
content:function(){
game.countPlayer(function(current){
if(!targets.contains(current)){
current.removeSkill('seira_yinyuan');
}
else{
current.addSkillLog('seira_yinyuan');
}
});
game.delayx();
},
ai:{
order:1,
result:{target:1},
expose:0.1,
},
derivation:'seira_yinyuan',
},
seira_yinyuan:{
enable:'phaseUse',
usable:1,
filterTarget:function(card,player,target){
return target!=player&&target.hasSkill('seira_yinyuan',null,null,false)&&target.countCards('hej')>0;
},
content:function(){
player.gainPlayerCard(target,true,'hej');
target.recover();
},
mark:true,
intro:{content:'你的手牌对其他“姻缘者”可见。出牌阶段限一次,你可以获得一名其他“姻缘者”区域内的一张牌,然后其回复1点体力。'},
ai:{
order:9,
viewHandcard:true,
skillTagFilter:function(player,tag,arg){
if(player==arg) return false;
return player.hasSkill('seira_yinyuan')&&arg.hasSkill('seira_yinyuan');
},
result:{
player:function(player,target){
var effect=get.effect(target,{name:'shunshou_copy'},player,player);
if(target.isDamaged()){
if(effect<0) effect/=2;
effect+=get.recoverEffect(target,player,player);
}
return effect;
},
},
},
},
//派对浪客
nsxingyun:{
audio:2,
enable:'chooseToUse',
getSixiang:function(card){
if(typeof card=='string') card={name:card};
if(card.name=='shan') return '玄武';
var type=get.type(card,null,false);
if(type=='delay') return '朱雀';
if(get.tag(card,'damage')) return '白虎';
if(get.tag(card,'recover')) return '玄武';
if(type=='trick') return '青龙';
return false;
},
filter:function(event,player){
if(player.hasSkill('nsxingyun_round')) return false;
var list=player.getStorage('nsxingyun');
if(list.length>=4) return false;
for(var i of lib.inpile){
var type=lib.skill.nsxingyun.getSixiang(i);
if(!type||list.contains(type)) continue;
if(event.filterCard({name:i},player,event)) return true;
if(i=='sha'){
for(var j of lib.inpile_nature){
if(event.filterCard({name:i,nature:j},player,event)) return true;
}
}
}
return false;
},
chooseButton:{
dialog:function(event,player){
var map={青龙:[],朱雀:[],白虎:[],玄武:[]};
var list=player.getStorage('nsxingyun');
for(var i of lib.inpile){
var type=lib.skill.nsxingyun.getSixiang(i);
if(!type||list.contains(type)) continue;
if(event.filterCard({name:i},player,event)) map[type].push([get.type2(i,false),'',i]);
if(i=='sha'){
for(var j of lib.inpile_nature){
if(event.filterCard({name:i,nature:j},player,event)) map[type].push([get.type2(i,false),'',i,j]);
}
}
}
var dialog=['星陨','hidden'];
for(var i in map){
if(map[i].length>0){
dialog.push(''+i+'
');
dialog.push([map[i],'vcard']);
}
}
return ui.create.dialog.apply(ui.create,dialog);
},
filter:function(button,player){
return _status.event.getParent().filterCard({
name:button.link[2],
nature:button.link[3],
},player,_status.event.getParent());
},
check:function(button){
if(_status.event.getParent().type!='phase') return 1;
return _status.event.player.getUseValue({
name:button.link[2],
nature:button.link[3],
},false);
},
backup:function(links,player){
return {
selectCard:1,
filterCard:true,
popname:true,
position:'hs',
check:function(card){
return 7-get.value(card);
},
viewAs:{name:links[0][2],nature:links[0][3]},
precontent:function(){
player.addTempSkill('nsxingyun_round');
},
}
},
prompt:function(links,player){
return '将一张手牌当做'+(get.translation(links[0][3])||'')+get.translation(links[0][2])+'使用';
}
},
ai:{
threaten:2.6,
order:1,
result:{player:1},
},
group:'nsxingyun_clear',
derivation:['nsxingyun_faq','bazhen'],
subSkill:{
backup:{},
clear:{
trigger:{player:'useCardAfter'},
forced:true,
popup:false,
filter:function(event,player){
return event.skill=='nsxingyun_backup'&&event.cards.length==1
&&lib.skill.nsxingyun.getSixiang(event.card)!=lib.skill.nsxingyun.getSixiang(event.cards[0])&&!player.getStorage('nsxingyun').contains(lib.skill.nsxingyun.getSixiang(event.card));
},
content:function(){
'step 0'
player.draw(2);
player.markAuto('nsxingyun',[lib.skill.nsxingyun.getSixiang(trigger.card)]);
'step 1'
if(player.getStorage('nsxingyun').length>=4) player.addSkillLog('bazhen');
},
},
round:{
charlotte:true,
onremove:true,
},
},
},
nshanlang:{
trigger:{player:'phaseZhunbeiBegin'},
direct:true,
filter:function(event,player){
return player.countCards('h')>0&&game.hasPlayer(
(current)=>player!=current&&player.canCompare(current)
);
},
content:function(){
'step 0'
var goon=player.hasCard(function(card){
return get.value(card)<=7;
},'h');
player.chooseTarget([1,3],get.prompt('nshanlang'),'和至多三名角色进行拼点',function(card,player,target){
return target!=player&&player.canCompare(target);
}).set('ai',function(target){
if(!_status.event.goon) return false;
var att=get.attitude(_status.event.player,target);
if(att>=0) return 0;
if(target.hasSkillTag('noh')) att/=3;
return -att/Math.sqrt(target.countCards('h'));
}).set('goon',goon);
'step 1'
if(result.bool){
event.max_num=0;
var targets=result.targets.sortBySeat();
player.logSkill('nshanlang',targets);
player.chooseToCompare(targets).callback=lib.skill.nshanlang.callback;
}
else event.finish();
'step 2'
if(event.target){
player.chooseBool('是否令'+get.translation(target)+'获得一张牌?').set('goon',get.attitude(player,target)>0).set('ai',()=>_status.event.goon);
}
else event.finish();
'step 3'
if(result.bool){
var card=get.cardPile2(function(card){
return !lib.skill.nsxingyun.getSixiang(card);
});
if(card) target.gain(card,'gain2');
}
},
callback:function(){
var list=[[player,event.num1],[target,event.num2]],evt=event.getParent(2);
for(var i of list){
if(i[1]>evt.max_num){
evt.max_num=i[1];
evt.target=i[0];
}
else if(evt.target&&i[1]==evt.max_num&&i[0]!=evt.target){
delete evt.target;
}
}
},
},
//钟离牧
nskuanhuai:{
trigger:{player:'phaseUseBegin'},
content:function(){
'step 0'
var card=get.discardPile(function(card){
return get.type(card)!='basic';
});
if(card) player.gain(card,'gain2');
'step 1'
player.addTempSkill('nskuanhuai_blocker','phaseUseAfter');
player.addTempSkill('nskuanhuai_effect');
},
subSkill:{
blocker:{
charlotte:true,
mod:{
cardEnabled:function(card){
if(get.type(card)=='basic') return false;
},
cardSavable:function(card){
if(get.type(card)=='basic') return false;
},
},
},
effect:{
trigger:{player:'phaseDiscardEnd'},
charlotte:true,
direct:true,
filter:function(event,player){
return player.hasHistory('lose',function(evt){
if(evt.type!='discard'||evt.getParent('phaseDiscard')!=event) return false;
for(var i of evt.cards2){
if(get.type(i,false)=='basic'&&get.position(i,true)=='d'&&player.hasUseTarget(i)) return true;
}
return false;
});
},
content:function(){
'step 0'
var cards=[];
player.getHistory('lose',function(evt){
if(evt.type!='discard'||evt.getParent('phaseDiscard')!=trigger) return false;
for(var i of evt.cards2){
if(get.type(i,false)=='basic'&&get.position(i,true)=='d') cards.push(i);
}
return false;
});
event.cards=cards;
'step 1'
var cards2=event.cards.filter(function(i){
return get.position(i,true)=='d'&&player.hasUseTarget(i);
});
if(cards2.length){
player.chooseButton(['宽怀:是否使用其中一张牌?',cards2]);
}
else event.finish();
'step 2'
if(result.bool){
var card=result.links[0];
cards.remove(card);
player.chooseUseTarget(card,true);
if(cards.length>0) event.goto(1);
}
},
},
},
},
nsdingbian:{
trigger:{player:'useCard'},
forced:true,
filter:function(event,player){
if(player!=_status.currentPhase) return false;
return get.type(event.card)!='basic';
},
content:function(){
'step 0'
player.addTempSkill('nsdingbian_mark');
player.addMark('nsdingbian_mark',1,false);
var storage=player.getStorage('nsdingbian_ignore');
var goon=false;
for(var i of lib.inpile){
if(get.type(i)=='basic'&&!storage.contains(i)){
goon=true;
break;
}
}
if(goon) player.chooseControl().set('choiceList',[
'从牌堆中获得一张基本牌',
'令一种基本牌于本回合内不计入手牌上限',
]).set('prompt','定边:请选择一项').set('ai',function(){
var player=_status.event.player;
var list=['tao','shan'],list2=player.getStorage('nsdingbian_ignore');
list.removeArray(list2);
if(!list.length) return 0;
var num1=player.countCards('hs',function(card){
return get.type(card)!='basic'&&player.hasValueTarget(card,null,true);
}),num2=player.getHandcardLimit();
if(player.countCards('h',list)<=num2-num1) return 0;
return 1;
});
else event._result={index:0};
'step 1'
if(result.index==0){
var card=get.cardPile2(function(card){
return get.type(card,false)=='basic';
});
if(card) player.gain(card,'gain2');
event.finish();
}
else{
var list=[],storage=player.getStorage('nsdingbian_ignore');
for(var i of lib.inpile){
if(get.type(i)=='basic'&&!storage.contains(i)){
list.push(i);
}
}
player.chooseButton(['令一种基本牌于本回合内不计入手牌上限',[list,'vcard']],true).set('ai',function(button){
var name=button.link[2],player=_status.event.player;
if(name=='sha') return 0;
var cards=player.getCards('h',name);
if(!cards.length) return 0;
return get.value(cards,player);
});
}
'step 2'
player.markAuto('nsdingbian_ignore',[result.links[0][2]]);
},
subSkill:{
mark:{
onremove:function(player){
delete player.storage.nsdingbian_mark;
delete player.storage.nsdingbian_ignore;
},
mod:{
maxHandcard:(player,num)=>num-player.countMark('nsdingbian_mark'),
ignoredHandcard:function(card,player){
if(player.getStorage('nsdingbian_ignore').contains(get.name(card,player))){
return true;
}
},
cardDiscardable:function(card,player,name){
if(name=='phaseDiscard'&&player.getStorage('nsdingbian_ignore').contains(get.name(card,player))){
return false;
}
},
},
intro:{content:'手牌上限-#'},
},
},
},
//李密
nstuilun:{
trigger:{player:'phaseJieshuBegin'},
filter:function(event,player){
return player.hp>1&&player.countCards('h')>1&&player.hasCard(function(card){
return lib.filter.cardDiscardable(card,player,'nstuilun');
},'h');
},
prompt2:'失去任意点体力(至多失去至1点)并弃置任意张手牌(至多弃置至一张)。',
check:function(event,player){
if(game.hasPlayer(function(current){
return current!=player&¤t.hp>=player.hp;
})) return true;
return false;
},
content:function(){
'step 0'
if(player.hp==2) event._result={index:0};
else{
var list=[];
for(var i=1;i1&&player.hasCard(function(card){
return lib.filter.cardDiscardable(card,player,'nstuilun');
},'h')){
player.chooseToDiscard('h',true,[1,player.countCards('h')-1]);
}
else game.delayx();
'step 3'
player.addTempSkill('nstuilun_effect',{player:'phaseBegin'});
},
subSkill:{
effect:{
charlotte:true,
trigger:{global:'phaseBegin'},
forced:true,
popup:false,
filter:function(event,player){
return player.hp0&&player.countCards('h')=get.effect(target,{name:'losehp'},player,player)) return 0;
return 1;
});
}
else event.goto(3);
'step 2'
if(result.index==0) target.recover();
else target.loseHp();
'step 3'
if(trigger.player.countCards('h')>player.countCards('h')){
var str=get.cnNumber(player.hp);
player.chooseTarget('退论:是否令一名角色摸一张牌或弃置一张牌?').set('ai',function(target){
var player=_status.event.player;
var att=get.attitude(player,target);
if(att>0||target.countCards('he')==0) return get.effect(target,{name:'wuzhong'},player,player)/2;
return get.effect(target,{name:'guohe_copy2'},target,player);
});
}
else event.finish();
'step 4'
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('nstuilun_effect',target);
if(!target.countCards('he')) event._result={index:0};
else player.chooseControl('摸一张牌','弃置一张牌').set('prompt','令'+get.translation(target)+'…').set('ai',function(player){
var evt=_status.event;
return get.attitude(evt.player,evt.getParent().target)>0?0:1;
});
}
else event.finish();
'step 5'
if(result.index==0) target.draw();
else target.chooseToDiscard('he',true);
},
},
},
},
//阮籍
nsshizui:{
trigger:{target:'useCardToTargeted'},
usable:1,
direct:true,
filter:function(event,player){
var type=get.type(event.card,null,false);
return (type=='basic'||type=='trick')&&player.countCards('he')>0&&player.hasUseTarget({name:'jiu'},null,true);
},
content:function(){
'step 0'
var suit=get.suit(trigger.card),cards=trigger.cards.filterInD();
var str='弃置一张牌并视为使用一张【酒】';
if(lib.suit.contains(suit)) str+=(';若弃置'+get.translation(suit)+'牌,则'+get.translation(trigger.card)+'对你无效');
if(cards.length) str+=(';若弃置♣牌则获得'+get.translation(cards));
str+='。';
var next=player.chooseToDiscard('he',get.prompt('nsshizui'),str);
next.set('val1',cards.length?get.value(cards,player):0);
next.set('val2',-get.effect(player,trigger.card,trigger.player,player));
next.set('suit',suit);
next.set('ai',function(card){
var base=2,suit=get.suit(card);
if(suit=='club') base+=_status.event.val1;
if(suit==_status.event.suit) base+=_status.event.val2;
return base-get.value(card);
}).logSkill='nsshizui';
'step 1'
if(result.bool){
event.suit1=get.suit(result.cards[0],player);
player.chooseUseTarget('jiu',true);
}
else{
player.storage.counttrigger.nsshizui--;
event.finish();
}
'step 2'
var suit1=event.suit1,suit2=get.suit(trigger.card,false);
if(suit1==suit2&&lib.suit.contains(suit1)) trigger.excluded.add(player);
if(suit1=='club'){
var cards=trigger.cards.filterInD();
if(cards.length>0) player.gain(cards,'gain2');
}
},
},
nsxiaoye:{
trigger:{global:'phaseJieshuBegin'},
direct:true,
filter:function(event,player){
return player.hasHistory('useCard',function(evt){
return evt.card.name=='jiu';
})&&event.player.hasHistory('useCard',function(evt){
return (evt.card.name=='sha'||get.type(evt.card)=='trick')&&player.hasUseTarget({
name:evt.card.name,
nature:evt.card.nature,
isCard:true,
});
})
},
content:function(){
'step 0'
var list=[];
trigger.player.getHistory('useCard',function(evt){
if(evt.card.name!='sha'&&get.type(evt.card)!='trick') return;
if(evt.card.name=='sha'&&evt.card.nature) list.add('sha:'+evt.card.nature);
else list.add(evt.card.name);
});
for(var i=0;i1||player.countCards('hs',['tao','jiu'])) return 1;
if(!ui.selected.targets.length){
if(target!=player) return 0;
if(player.hasSha()) return 1;
return 0;
}
if(ui.selected.targets.length>1&&!target.hasSha()) return 0;
return 1;
},
},
},
},
tenzen_fenghuan:{
trigger:{global:'useCardAfter'},
direct:true,
filter:function(event,player){
if(player==event.player||event.targets.length!=1||event.targets[0]!=player||!event.player.isIn()||
(event.card.name!='sha'&&(get.type(event.card,null,false)!='trick'||!get.tag(event.card,'damage')))) return false;
if(!player.canUse({
name:event.card.name,
nature:event.card.nature,
isCard:true,
},event.player,false)) return false;
var num=get.number(event.card);
if(typeof num!='number') return false;
num*=2;
var hs=player.getCards('he');
for(var i of hs){
num-=get.number(i);
if(num<=0) return true;
}
return false;
},
content:function(){
'step 0'
var num=get.number(trigger.card)*2;
var card={
name:trigger.card.name,
nature:trigger.card.nature,
isCard:true,
};
player.chooseToDiscard('he',get.prompt('tenzen_fenghuan',trigger.player),'弃置任意张点数之和不小于'+num+'的牌,然后视为对其使用一张'+get.translation(card)).set('selectCard',function(){
var cards=ui.selected.cards,num=_status.event.cardNumber;
for(var i of cards){
num-=get.number(i);
if(num<=0) return [cards.length,cards.length+1];
}
return [cards.length+1,cards.length+1];
}).set('cardNumber',num).set('logSkill',['tenzen_fenghuan',trigger.player]).set('effect',get.effect(trigger.player,card,player,player)).set('ai',function(card){
var eff=_status.event.effect;
if(eff<=0) return 0;
for(var i of ui.selected.cards) eff-=get.value(i)/Math.sqrt(get.number(i)/3);
return eff-get.value(card)/Math.sqrt(get.number(card)/3);
});
'step 1'
if(result.bool){
var card={
name:trigger.card.name,
nature:trigger.card.nature,
isCard:true,
},target=trigger.player;
if(target.isIn()&&player.canUse(card,target,false)) player.useCard(card,target,false);
}
},
},
tenzen_retianquan:{
trigger:{player:'useCardToPlayered'},
filter:function(event,player){
return event.card.name=='sha'&&(player.hp>0||player.hasCard(function(card){
return lib.filter.cardDiscardable(card,player,'tenzen_retianquan');
},'he'));
},
logTarget:'target',
usable:1,
check:function(event,player){
if(get.attitude(player,event.target)>=0) return false;
if(player.hp>player.maxHp/2) return true;
if(player.hasCard(function(card){
return lib.filter.cardDiscardable(card,player,'tenzen_retianquan')&&get.value(card)<6;
},'he')) return true;
return true;
},
prompt2:'你可失去1点体力或弃置一张牌,展示牌堆顶的三张牌(若你的体力值小于体力上限的50%,则改为展示五张牌)。每有一张基本牌,其所需使用的【闪】的数量便+1。然后若此牌造成过伤害,则你获得展示牌中的所有非基本牌。',
content:function(){
'step 0'
player.chooseToDiscard('弃置一张牌,或点「取消」失去一点体力','he').set('goon',(player.hp>player.maxHp/2)).set('ai',function(card){
var val=get.value(card);
if(_status.event.goon) return 0.1-val;
return 6-val;
});
'step 1'
if(!result.bool) player.loseHp();
'step 2'
var cards=get.cards(player.hp<=player.maxHp/2?5:3);
player.showCards(cards,get.translation(player)+'发动了【天全】');
game.cardsGotoOrdering(cards).relatedEvent=trigger.getParent();
var num=cards.filter(function(card){
return get.type(card,false)=='basic';
}).length;
if(num){
if(trigger.card.name=='sha'){
var id=trigger.target.playerid;
var map=trigger.getParent().customArgs;
if(!map[id]) map[id]={};
if(typeof map[id].shanRequired=='number'){
map[id].shanRequired+=num;
}
else{
map[id].shanRequired=1+num;
}
}
}
if(num<5){
var next=game.createEvent('tenzen_retianqua_gain');
next.cards=cards;
next.player=player;
event.next.remove(next);
trigger.getParent().after.push(next);
next.setContent(function(){
if(player.getHistory('sourceDamage',function(evt){
return evt.card==event.parent.card;
}).length>0) player.gain(cards.filter(function(card){
return get.type(card,false)!='basic';
}),'gain2');
});
}
},
},
satomi_luodao:{
trigger:{player:'useCardToPlayered'},
logTarget:'target',
filter:function(event,player){
return event.card.name=='sha'&&event.target.countCards('h')>0;
},
content:function(){
'step 0'
var target=trigger.target;
event.target=target;
target.showHandcards(get.translation(player)+'对'+get.translation(target)+'发动了【落刀】');
'step 1'
if(target.hasCard(function(card){
return get.name(card,target)=='shan';
},'h')){
player.discardPlayerCard(target,true,'h','visible').set('filterButton',function(button){
return get.name(button.link)=='shan';
});
}
else if(player.countCards('he')>0) player.chooseToDiscard('he',true);
},
},
satomi_daohai:{
trigger:{player:'phaseJieshuBegin'},
filter:function(event,player){
return player.hasHistory('lose',function(evt){
return evt.type=='discard'&&evt.cards2.length>0;
})&&player.hasUseTarget({name:'wugu'});
},
check:function(event,player){
return player.getUseValue({name:'wugu'})+player.getUseValue({name:'lebu'})>0;
},
content:function(){
'step 0'
player.chooseUseTarget('wugu',true);
'step 1'
if(result.bool){
var cards=[];
player.getHistory('gain',function(evt){
if(evt.getParent().name=='wugu'&&evt.getParent(4)==event){
cards.addArray(evt.cards);
}
});
cards=cards.filter(function(card){
return player.getCards('h').contains(card)&&game.checkMod(card,player,'unchanged','cardEnabled2',player);
});
if(cards.length){
player.chooseCardTarget({
prompt:'是否将获得的牌当做【乐不思蜀】使用?',
filterCard:function(card){
return _status.event.cards.contains(card);
},
cards:cards,
filterTarget:function(card,player,target){
var card=get.autoViewAs({name:'lebu'},ui.selected.cards);
return player.canUse(card,target);
},
ai1:()=>1,
ai2:function(target){
var player=_status.event.player,card=get.autoViewAs({name:'lebu'},ui.selected.cards);
return get.effect(target,{name:'lebu'},player,player);
},
})
}
else event.finish();
}
else event.finish();
'step 2'
if(result.bool){
player.useCard({name:'lebu'},result.cards,result.targets[0]);
}
},
},
erika_shisong:{
trigger:{player:'useCard'},
forced:true,
charlotte:true,
filter:function(event,player){
if(player!=_status.currentPhase) return false;
var index=player.getHistory('useCard').indexOf(event),history=player.actionHistory;
for(var i=history.length-2;i>=0;i--){
if(history[i].isMe){
var evt=history[i].useCard[index];
return evt&&get.type2(evt.card)==get.type(event.card);
}
}
return false;
},
content:function(){
player.draw();
},
mod:{
maxHandcard:function(player,num){
return num+player.hujia;
},
},
},
erika_yousheng:{
dutySkill:true,
group:['erika_yousheng_achieve','erika_yousheng_fail','erika_yousheng_mamori'],
trigger:{global:'useCardToTarget'},
direct:true,
filter:function(event,player){
return player.getStorage('erika_yousheng').contains(event.target)&&
(event.card.name=='sha'||(get.type2(event.card,false)=='trick'&&get.tag(event.card,'damage')>0))&&
(player.countMark('erika_yousheng_ruka')+1)<=player.countCards('he');
},
intro:{
content:'已保护$',
},
content:function(){
'step 0'
var num=(player.countMark('erika_yousheng_ruka')+1);
player.chooseToDiscard('he',num,get.prompt('erika_yousheng',trigger.target),'弃置'+(num)+'张牌,并转移'+get.translation(trigger.card)).logSkill=['erika_yousheng',trigger.target];
'step 1'
if(result.bool){
var ruka=trigger.target,evt=trigger.getParent();
evt.targets.remove(ruka);
evt.triggeredTargets2.remove(ruka);
evt.targets.push(player);
evt.triggeredTargets2.push(player);
player.addTempSkill('erika_yousheng_ruka');
var str='erika_yousheng_'+player.playerid;
if(!evt[str]) evt[str]=[];
evt[str].add(ruka);
}
},
subSkill:{
achieve:{
trigger:{player:'changeHujiaAfter'},
forced:true,
skillAnimation:'legend',
animationColor:'water',
filter:function(event,player){
return player.storage.erika_yousheng&&event.num<0&&!player.hujia;
},
content:function(){
'step 0'
player.awakenSkill('erika_yousheng');
game.log(player,'成功完成使命');
var list=[player];
list.addArray(player.storage.erika_yousheng);
list.sortBySeat();
list=list.filter(function(current){
return current.isAlive();
});
player.line(list,'green');
game.asyncDraw(list,3);
'step 1'
game.delayx();
},
},
fail:{
trigger:{global:'damageEnd'},
forced:true,
filter:function(event,player){
return player.getStorage('erika_yousheng').contains(event.player)&&event.card&&(event.card.name=='sha'||(get.type2(event.card,false)=='trick'&&get.tag(event.card,'damage')>0));
},
content:function(){
player.awakenSkill('erika_yousheng');
game.log(player,'使命失败');
var num=player.hujia;
if(num>0){
player.changeHujia(-num);
player.chooseToDiscard(num,true,'he');
}
},
},
mamori:{
trigger:{global:'roundStart'},
skillAnimation:true,
animationColor:'wood',
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt('erika_yousheng'),[1,2],lib.filter.notMe,'选择至多两名其他角色。你减2点体力上限并获得3点护甲。').set('ai',function(ruka){
return -1;
});
'step 1'
if(result.bool){
player.logSkill('erika_yousheng_mamori',result.targets);
player.awakenSkill('erika_yousheng_mamori');
player.markAuto('erika_yousheng',result.targets);
player.loseMaxHp(2);
player.changeHujia(3);
}
},
},
ruka:{
trigger:{global:'useCardAfter'},
direct:true,
charlotte:true,
filter:function(event,player){
return event['erika_yousheng_'+player.playerid]&&event.cards.filterInD().length>0;
},
content:function(){
'step 0'
player.chooseTarget('是否令一名原目标角色获得'+get.translation(trigger.cards.filterInD())+'?',function(card,player,target){
return _status.event.targets.contains(target);
}).set('targets',trigger['erika_yousheng_'+player.playerid]);
'step 1'
if(result.bool){
var ruka=result.targets[0];
player.line(ruka,'green');
ruka.gain(trigger.cards.filterInD(),'gain2');
}
},
},
},
},
liyingxia_sanli:{
trigger:{target:'useCardToTargeted'},
forced:true,
filter:function(event,player){
if(event.player==player||event.player!=_status.currentPhase) return false;
var index=event.player.getHistory('useCard',function(evt){
return evt.targets.contains(player);
}).indexOf(event.getParent());
if(index==2) return event.player.isAlive()&&player.countCards('he')>0;
return index<2&&index>-1;
},
logTarget:'player',
content:function(){
'step 0'
var index=trigger.player.getHistory('useCard',function(evt){
return evt.targets.contains(player);
}).indexOf(trigger.getParent());
if(index==2){
player.chooseCard('he',true,'三礼:交给'+get.translation(trigger.player)+'一张牌');
}
else{
player.draw();
event.finish();
}
'step 1'
if(result.bool){
player.give(result.cards,trigger.player);
}
},
},
liyingxia_zhenjun:{
trigger:{player:'phaseJieshuBegin'},
direct:true,
filter:function(event,player){
return player.group=='key';
},
content:function(){
'step 0'
var num=player.getHistory('useCard',function(evt){
return evt.card.name=='sha'||(get.type(evt.card)=='trick'&&get.tag(evt.card,'damage')>0);
}).length+1;
player.chooseTarget(get.prompt('liyingxia_zhenjun'),[1,num],'令至多'+get.cnNumber(num)+'名角色各摸一张牌').set('ai',(serafu)=>get.attitude(_status.event.player,serafu));
'step 1'
if(result.bool){
var targets=result.targets.sortBySeat();
player.logSkill('liyingxia_zhenjun',targets);
game.asyncDraw(targets);
for(var i of targets) i.addTempSkill('liyingxia_zhenjun_enhance',{player:player==i?'phaseJieshuBegin':'phaseAfter'});
}
else event.finish();
'step 2'
game.delayx();
},
subSkill:{
enhance:{
trigger:{source:'damageBegin1'},
forced:true,
charlotte:true,
mark:true,
filter:(event,player)=>(player==_status.currentPhase),
intro:{content:'下回合首次造成的伤害+1'},
content:function(){
trigger.num++;
player.removeSkill(event.name);
},
},
},
},
liyingxia_wumai:{
trigger:{global:'roundStart'},
direct:true,
filter:function(event,player){
return player.group=='shu'&&(player.getStorage('liyingxia_wumai').length<4||game.hasPlayer((current)=>current.isDamaged()));
},
content:function(){
'step 0'
var list=lib.skill.liyingxia_wumai.derivation.slice(0);
list.removeArray(player.getStorage('liyingxia_wumai'));
if(list.length){
player.chooseControl(list,'cancel2').set('prompt',get.prompt('liyingxia_wumai')).set('prompt2','获得一个技能直到本轮结束');
}
else{
event.num=Math.min(3,game.countPlayer((current)=>current.isDamaged()));
player.chooseBool(get.prompt('liyingxia_wumai')+'(可摸'+get.cnNumber(event.num)+'张牌)')
event.goto(2);
}
'step 1'
if(result.control!='cancel2'){
player.logSkill('liyingxia_wumai');
player.markAuto('liyingxia_wumai',[result.control]);
player.addTempSkill(result.control,'roundStart');
game.log(player,'获得了技能','#g【'+get.translation(result.control)+'】')
}
event.finish();
'step 2'
if(result.bool){
player.logSkill('liyingxia_wumai');
player.draw(num);
}
},
derivation:['bazhen','rejizhi','reguanxing','youlong'],
},
kano_liezhen:{
trigger:{player:'phaseJieshuBegin'},
filter:function(event,player){
return player.getHistory('useCard').length>0;
},
direct:true,
frequent:true,
content:function(){
'step 0'
var history=player.getHistory('useCard');
if(history.length>1){
var type=get.type2(history[0].card,false);
for(var i=1;i0&&(event.card.name=='sha'||get.type(event.card)=='trick'&&get.tag(event.card,'damage')>0);
},
check:function(trigger,player){
return get.effect(player,trigger.card,trigger.player,player)<0;
},
content:function(){
'step 0'
player.judge();
'step 1'
var bool=false,type=get.type2(result.card.name);
for(var i of _status.renku){
if(get.suit(i)==result.suit||get.type2(i)==type){
bool=true;break;
}
}
if(bool){
player.chooseButton(['是否移去一张牌,令'+get.translation(trigger.card)+'对你无效?',_status.renku]).set('types',[result.suit,type]).set('filterButton',function(button){
var types=_status.event.types;
return get.suit(button.link,false)==types[0]||get.type2(button.link,false)==types[1];
}).set('ai',()=>1);
}
else event.finish();
'step 2'
if(result.bool){
var card=result.links[0];
player.$throw(card,1000);
_status.renku.remove(card);
game.cardsDiscard(card).fromRenku=true;
game.log(player,'将',card,'置入了弃牌堆');
trigger.excluded.add(player);
game.updateRenku();
}
},
init:function(player){
player.storage.renku=true;
},
},
mia_shihui:{
trigger:{player:'phaseDrawBegin1'},
forced:true,
filter:function(event,player){
return !event.numFixed;
},
content:function(){
trigger.changeToZero();
var num=0;all=player.getAllHistory();
if(all.length>1){
for(var i=all.length-2;i>=0;i--){
if(all[i].isMe){
for(var evt of all[i].lose){
if(evt.type=='discard') num+=evt.cards2.length;
}
break;
}
}
}
player.draw(1+num);
},
group:'mia_shihui_recover',
subSkill:{
recover:{
trigger:{player:'phaseJieshuBegin'},
forced:true,
filter:function(event,player){
return player.isDamaged()||player.countCards('he')>0;
},
content:function(){
player.chooseToDiscard('he',true);
player.recover();
},
},
},
},
mia_qianmeng:{
trigger:{
global:'phaseBefore',
player:'enterGame',
},
forced:true,
dutySkill:true,
filter:function(event,player){
return (event.name!='phase'||game.phaseNumber==0);
},
content:function(){
'step 0'
player.draw();
'step 1'
if(player.countCards('he')>0){
player.chooseCard('he',true,'潜梦:选择一张牌置于牌堆中');
}
else event.finish();
'step 2'
if(result.bool){
var card=result.cards[0];
player.storage.mia_qianmeng=card;
player.$throw(card,1000);
player.lose(card,ui.cardPile).insert_index=function(){
return ui.cardPile.childNodes[Math.ceil(ui.cardPile.childNodes.length/2)];
};
}
else event.finish();
'step 3'
game.delayx();
},
onremove:true,
group:['mia_qianmeng_achieve','mia_qianmeng_fail'],
subSkill:{
achieve:{
trigger:{
global:['gainAfter','loseAsyncAfter'],
},
forced:true,
filter:function(event,player){
var card=player.storage.mia_qianmeng;
if(event.name=='gain'){
var source=event.player,cards=event.getg(source);
return cards.contains(card)&&source.getCards('hejsx').contains(card);
}
else{
if(event.type!='gain') return false;
var owner=get.owner(card);
return owner&&event.getg(owner).contains(card);
}
},
skillAnimation:true,
animationColor:'key',
content:function(){
'step 0'
game.log(player,'成功完成使命');
player.awakenSkill('mia_qianmeng');
var card=player.storage.mia_qianmeng,owner=get.owner(card);
if(owner&&owner!=player) owner.give(card,player);
'step 1'
if(player.hp1){
for(var i=all.length-2;i>=0;i--){
if(all[i].isMe){
num+=all[i].useCard.length;
break;
}
}
}
trigger.num+=num;
},
},
kyou_zhidian:{
locked:false,
mod:{
targetInRange:function(card){
if(card.kyou_zhidian) return true;
},
aiOrder:function(player,card,numx){
var num=_status.event._kyou_zhidian_baseValue;
if(num>0&&get.type2(card)=='trick'&&player.getUseValue(card)get.type2(card)=='trick')>0;
},
filterCard:function(card){
return get.type2(card)=='trick';
},
onChooseToUse:function(event){
event._kyou_zhidian_baseValue=event.player.getUseValue({name:'sha'});
},
check:function(card){
var num=_status.event._kyou_zhidian_baseValue,player=_status.event.player;
return num-player.getUseValue(card);
},
prompt:'将一张锦囊牌当做【杀】使用',
viewAs:{
name:'sha',
kyou_zhidian:true,
},
group:'kyou_zhidian_aim',
ai:{
respondSha:true,
skillTagFilter:(player)=>player.countCards('hs',(card)=>get.type2(card)=='trick')>0,
},
subSkill:{
aim:{
trigger:{
player:'useCardToPlayered',
},
forced:true,
locked:false,
filter:function(event,player){
return event.isFirstTarget&&event.card.name=='sha';
},
logTarget:'target',
content:function(){
'step 0'
var list=['不可被响应','无视防具','伤害+1','不计入次数'];
list.remove(player.storage.kyou_zhidian);
player.chooseControl(list).set('prompt','掷典:请为'+get.translation(trigger.card)+'选择一种效果').set('choice',function(){
if(list.contains('不计入次数')&&player.hasSha()) return '不计入次数';
if(list.contains('不可被响应')&&trigger.target.mayHaveShan()) return '不可被响应';
if(list.contains('伤害+1')) return '伤害+1';
return list.randomGet();
}()).set('ai',()=>_status.event.choice);
'step 1'
var target=trigger.target;
player.storage.kyou_zhidian=result.control;
game.log(player,'对',target,'的',trigger.card,'#g'+result.control);
switch(result.control){
case '不可被响应':
trigger.directHit.add(target);
break;
case '无视防具':
target.addTempSkill('qinggang2');
target.storage.qinggang2.add(trigger.card);
break;
case '伤害+1':
var map=trigger.customArgs;
var id=target.playerid;
if(!map[id]) map[id]={};
if(!map[id].extraDamage) map[id].extraDamage=0;
map[id].extraDamage++;
break;
case '不计入次数':
var evt=trigger.getParent();
if(evt.addCount!==false){
evt.addCount=false;
player.getStat().card.sha--;
}
break;
}
},
}
},
},
kyou_duanfa:{
trigger:{player:'damageBegin2'},
limited:true,
skillAnimation:true,
animationColor:'thunder',
filter:function(event,player){
return player.hp<=event.num;
},
content:function(){
player.awakenSkill('kyou_duanfa');
if(player.countCards('h')>0) player.chooseToDiscard('h',true,player.countCards('h'));
player.recover();
trigger.cancel();
player.addTempSkill('kyou_duanfa_draw',{player:'phaseBegin'});
},
subSkill:{
draw:{
trigger:{target:'useCardToTargeted'},
forced:true,
charlotte:true,
filter:function(event,player){
if(event.card.name=='sha') return true;
return get.type(event.card,false)=='trick'&&get.tag(event.card,'damage')>0;
},
content:function(){
player.draw();
},
},
},
},
kotarou_aurora:{
trigger:{
player:['damageEnd','loseHpEnd','gainMaxHpEnd']
},
forced:true,
charlotte:true,
filter:function(event,player){
return !player.isDisabled(1);
},
content:function(){
if(player.isEmpty(1)){
var card=get.cardPile2(function(card){
return get.subtype(card)=='equip1'&&!get.cardtag(card,'gifts')&&player.canUse(card,player);
});
if(card) player.chooseUseTarget(card,true);
}
else player.chooseUseTarget('sha',true,false);
},
},
kotarou_rewrite:{
enable:'phaseUse',
charlotte:true,
filter:function(event,player){
return !player.hasSkill('kotarou_rewrite_block');
},
content:function(){
'step 0'
player.getHistory('custom').push({kotarou_rewrite:true});
player.chooseControl().set('choiceList',[
'视为使用一张本局游戏没有以此法使用过的基本牌或普通锦囊牌',
'移动场上的一张牌',
'增加一点体力上限并失去1点体力',
'本回合内下一次造成的伤害+1',
'本回合内下一次回复体力时,额外回复一点体力',
'本回合内手牌上限和【杀】的使用次数+1 ',
]).set('ai',function(){
var player=_status.event.player;
if(player.hp>2&&player.getUseValue({name:'sha'})>0) return 2;
return 0;
});
'step 1'
lib.skill.kotarou_rewrite.rewrites[result.index](player,event);
if(result.index!=0) event.goto(3);
'step 2'
if(result.bool){
player.storage.kotarou_rewrite.push(result.links[0][2]);
player.chooseUseTarget(true,{name:result.links[0][2],nature:result.links[0][3],isCard:true});
}
'step 3'
if(player.getHistory('custom',function(evt){
return evt&&evt.kotarou_rewrite==true;
}).length>=3) player.addTempSkill('kotarou_rewrite_block');
},
onremove:true,
rewrites:[
function(player,event){
var list=[];
if(!player.storage.kotarou_rewrite) player.storage.kotarou_rewrite=[];
for(var i of lib.inpile){
if(player.storage.kotarou_rewrite.contains(i)) continue;
var type=get.type(i);
if((type=='basic'||type=='trick')) list.push([type,'',i]);
if(i=='sha'){
for(var j of lib.inpile_nature) list.push([type,'',i,j]);
}
}
if(list.length){
player.chooseButton(['改写:视为使用一张基本牌或普通锦囊牌',[list,'vcard']],true).set('filterButton',function(button){
return player.hasUseTarget({name:button.link[2],nature:button.link[3],isCard:true},null,true);
}).set('ai',function(button){
return player.getUseValue({name:button.link[2],nature:button.link[3],isCard:true});
});
}
else event._result={bool:false};
},
function(player,event){
player.moveCard(true);
},
function(player,event){
if(player.maxHp<5) player.gainMaxHp();
player.loseHp();
},
function(player,event){
player.addSkill('kotarou_rewrite_damage');
player.addMark('kotarou_rewrite_damage',1,false);
game.log(player,'本回合下次造成的伤害','#y+1');
},
function(player,event){
player.addSkill('kotarou_rewrite_recover');
player.addMark('kotarou_rewrite_recover',1,false);
game.log(player,'本回合下次回复的体力','#y+1');
},
function(player,event){
player.addSkill('kotarou_rewrite_sha');
player.addMark('kotarou_rewrite_sha',1,false);
game.log(player,'本回合的手牌上限和使用【杀】的次数上限','#y+1');
},
],
ai:{
order:4,
result:{
player:function(player){
if(player.getHistory('custom',function(evt){
return evt&&evt.kotarou_rewrite==true;
}).length>=2) return 0;
return 1;
},
}
},
},
kotarou_rewrite_damage:{
onremove:true,
trigger:{source:'damageBegin1'},
forced:true,
content:function(){
trigger.num+=player.countMark('kotarou_rewrite_damage');
player.removeSkill('kotarou_rewrite_damage');
},
charlotte:true,
intro:{content:'下一次造成的伤害+#'},
},
kotarou_rewrite_recover:{
onremove:true,
trigger:{player:'recoverBegin'},
forced:true,
content:function(){
trigger.num+=player.countMark('kotarou_rewrite_recover');
player.removeSkill('kotarou_rewrite_recover');
},
charlotte:true,
intro:{content:'下一次回复的体力+#'},
},
kotarou_rewrite_sha:{
onremove:true,
mod:{
maxHandcard:function(player,num){
return num+player.countMark('kotarou_rewrite_sha');
},
cardUsable:function(card,player,num){
if(card.name=='sha') return num+player.countMark('kotarou_rewrite_sha');
}
},
charlotte:true,
intro:{content:'手牌上限和出杀次数+#'},
},
kotarou_rewrite_block:{
trigger:{player:'phaseEnd'},
forced:true,
charlotte:true,
content:function(){
player.removeSkill('kotarou_rewrite');
player.removeSkill('kotarou_aurora');
if(player.maxHp>3) player.loseMaxHp(player.maxHp-3)
},
},
tenzen_yixing:{
trigger:{
global:'damageEnd',
},
filter:function(event,player){
if(!event.card||(event.card.name!='sha'&&event.card.name!='juedou')) return false;
var hairi=event.source;
if(hairi&&(hairi==player||player.inRangeOf(hairi))&&hairi.isAlive()&&(hairi.name1!='key_shizuku'&&hairi.name2!='key_shizuku')) return true;
hairi=event.player;
return (hairi&&(hairi==player||player.inRange(hairi))&&hairi.isAlive()&&(hairi.name1!='key_shizuku'&&hairi.name2!='key_shizuku'));
},
frequent:true,
content:function(){
'step 0'
player.draw();
'step 1'
if(player.countCards('he')>0){
player.chooseCard('he',true,'将一张牌作为“兴”置于武将牌上');
}
else event.finish();
'step 2'
if(result.bool){
var cards=result.cards;
player.addToExpansion(cards,player,'give').gaintag.add('tenzen_yixing');
}
},
intro:{
content:'expansion',
onunmark:'expansion',
},
onremove:function(player,skill){
var cards=player.getExpansions(skill);
if(cards.length) player.loseToDiscardpile(cards);
},
group:'tenzen_yixing_counter',
subSkill:{
counter:{
trigger:{target:'useCardToTargeted'},
filter:function(event,player){
if(player==event.player||!player.getExpansions('tenzen_yixing').length) return false;
return event.targets.length==1&&(event.card.name=='sha'||get.type(event.card)=='trick');
},
prompt2:function(event){
return '获得一张“兴”,且'+get.translation(event.card)+'结算完成后可以弃置两张牌,视为对'+get.translation(event.player)+'使用一张同名牌';
},
check:function(event,player){
if(!player.storage.tenzen_lingyu&&player.getExpansions('tenzen_yixing').length<3) return false;
var card={
name:event.card.name,
nature:event.card.nature,
isCard:true,
}
return player.canUse(card,event.player,false)&&get.effect(event.player,card,player,player)>0;
},
content:function(){
'step 0'
player.chooseButton(['选择获得一张“兴”',player.getExpansions('tenzen_yixing')],true);
'step 1'
if(result.bool){
player.gain(result.links,'gain2');;
}
var next=game.createEvent('tenzen_yixing_insert');
event.next.remove(next);
trigger.getParent().after.push(next);
next.player=player;
next.target=trigger.player;
next.setContent(lib.skill.tenzen_yixing.content_extra);
},
},
},
content_extra:function(){
'step 0'
var card=event.getParent().card;
event.card={
name:card.name,
nature:card.nature,
isCard:true,
};
if(player.countCards('he')>1&&target&&target.isIn()&&player.canUse(event.card,target,false)){
player.chooseToDiscard('he',2,'是否弃置两张牌,视为对'+get.translation(target)+'使用'+get.translation(event.card)+'?').set('ai',function(card){
return 5-get.value(card);
});
}
else event.finish();
'step 1'
if(result.bool) player.useCard(card,target,false,'tenzen_yixing');
},
},
tenzen_lingyu:{
trigger:{player:'phaseZhunbeiBegin'},
forced:true,
juexingji:true,
skillAnimation:true,
animationColor:'water',
filter:function(event,player){
return player.getExpansions('tenzen_yixing').length>=player.hp;
},
content:function(){
player.awakenSkill('tenzen_lingyu');
player.storage.tenzen_lingyu=true;
player.loseMaxHp();
if(player.isHealthy()) player.draw(2);
player.addSkill('tenzen_tianquan');
},
},
tenzen_tianquan:{
trigger:{player:'useCardToPlayered'},
filter:function(event,player){
return (event.card.name=='sha'||event.card.name=='juedou')&&event.targets.length==1&&player.getExpansions('tenzen_yixing').length>1;
},
logTarget:'target',
usable:1,
check:function(event,player){
return get.attitude(player,event.target)<0;
},
content:function(){
'step 0'
//player.viewHandcards(trigger.target);
player.chooseButton(['选择移去两张“兴”',player.getExpansions('tenzen_yixing')],true,2);
'step 1'
if(result.bool){
player.loseToDiscardpile(result.links);
var cards=get.cards(5);
player.showCards(cards,get.translation(player)+'发动了【天全】');
game.cardsGotoOrdering(cards).relatedEvent=trigger.getParent();
var num=cards.filter(function(card){
return get.type(card,false)=='basic';
}).length;
if(num){
if(trigger.card.name=='sha'){
var id=trigger.target.playerid;
var map=trigger.getParent().customArgs;
if(!map[id]) map[id]={};
if(typeof map[id].shanRequired=='number'){
map[id].shanRequired+=num;
}
else{
map[id].shanRequired=1+num;
}
}
else{
var idt=trigger.target.playerid;
var map=trigger.getParent().customArgs;
if(!map[idt]) map[idt]={};
if(!map[idt].shaReq) map[idt].shaReq={};
if(!map[idt].shaReq[idt]) map[idt].shaReq[idt]=1;
map[idt].shaReq[idt]++;
}
}
if(num<5){
var next=game.createEvent('tenzen_lingyu_gain');
next.cards=cards;
next.player=player;
event.next.remove(next);
trigger.getParent().after.push(next);
next.setContent(function(){
if(player.getHistory('sourceDamage',function(evt){
return evt.card==event.parent.card;
}).length>0) player.gain(cards.filter(function(card){
return get.type(card,false)!='basic';
}),'gain2');
});
}
}
},
},
kyouko_rongzhu:{
trigger:{global:'gainEnd'},
filter:function(event,player){
if(player==event.player||event.getParent().name=='kyouko_rongzhu') return false;
var evt=event.getl(player);
return evt&&evt.cards2&&evt.cards2.length>0;
},
logTarget:'player',
check:function(event,player){
return get.attitude(player,event.player)>0;
},
content:function(){
'step 0'
player.draw();
'step 1'
var target=trigger.player;
if(player.countCards('he')>0&&target.isIn()){
player.chooseCard('he',true,'将一张牌交给'+get.translation(target));
}
else event.finish();
'step 2'
if(result.bool){
player.give(result.cards,trigger.player);
var target=_status.currentPhase;
var name;
if(target==player){
name='kyouko_rongzhu_me';
player.addTempSkill(name);
player.addMark(name,1,false);
}
else if(target==trigger.player){
name='kyouko_rongzhu_notme';
player.addTempSkill(name);
player.addMark(name,1,false);
}
}
},
subSkill:{
me:{
mod:{
maxHandcard:function(player,num){
return num+player.countMark('kyouko_rongzhu_me');
},
},
intro:{content:'手牌上限+#'},
onremove:true,
},
notme:{
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha') return num+player.countMark('kyouko_rongzhu_notme');
},
},
intro:{content:'使用杀的次数上限+#'},
onremove:true,
},
},
},
kyouko_gongmian:{
enable:'phaseUse',
prompt:'出牌阶段,你可以选择一名未以此法选择过的角色,若其手牌:大于你,你获得其一张牌,然后交给其一张牌;小于你,其交给你一张牌,然后你交给其一张牌;等于你,你与其各摸一张牌。',
filter:function(event,player){
return game.hasPlayer(function(current){
return current!=player&&lib.skill.kyouko_gongmian.filterTarget(null,player,current);
});
},
filterTarget:function(card,kyouko,hina){
if(kyouko==hina||kyouko.getStorage('kyouko_gongmian').contains(hina)) return false;
var hs=hina.countCards('he');
if(hs==0) return kyouko.countCards('h')==0;
return true;
},
content:function(){
'step 0'
player.markAuto('kyouko_gongmian',targets);
var hs=player.countCards('h'),ts=target.countCards('h');
player.getHistory('custom').push({kyouko_gongmian:true});
if(hs>ts){
event.utype=1;
target.chooseCard('he',true,'交给'+get.translation(player)+'一张牌');
}
else if(hs==ts){
game.asyncDraw([player,target]);
event.utype=2;
}
else{
event.utype=3;
player.gainPlayerCard(target,true,'he');
}
'step 1'
if(event.utype==2){
game.delayx();
event.finish();
}
else if(!result.bool) event.finish();
else if(event.utype==1) target.give(result.cards,player);
'step 2'
if(player.countCards('he')>0){
player.chooseCard('he',true,'交给'+get.translation(target)+'一张牌');
}
else event.finish();
'step 3'
if(result.bool) player.give(result.cards,target);
},
intro:{
content:'已与$共勉',
},
group:['kyouko_gongmian_use','kyouko_gongmian_discard'],
ai:{
order:6,
result:{
target:function(player,target){
if(player.getHistory('custom',function(evt){
return evt.kyouko_gongmian==true;
}).length) return 0;
return 1;
},
},
},
},
kyouko_gongmian_use:{
trigger:{player:'phaseUseEnd'},
direct:true,
filter:function(event,player){
return player.getHistory('custom',function(evt){
return evt.kyouko_gongmian==true;
}).length>0&&game.hasPlayer(function(current){
return current!=player&¤t.countGainableCards(player,'hej')>0;
});
},
content:function(){
'step 0'
event.num=player.getHistory('custom',function(evt){
return evt.kyouko_gongmian==true;
}).length;
player.chooseTarget(get.prompt('kyouko_gongmian'),'获得一名其他角色的至多'+get.cnNumber(event.num)+'张牌,然后交给其等量的牌',function(card,player,target){
return target!=player&&target.countGainableCards(player,'hej')>0;
}).set('ai',function(target){
var player=_status.event.player,att=get.attitude(player,target);
if(att>0) return att;
var he=player.getCards('he');
if(target.countCards('he',function(card){
return get.value(card,target)>7;
})&&he.length>0) return -att+5-Math.min.apply(Math,he.map(function(card){
return get.value(card,player);
}));
return 0;
});
'step 1'
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('kyouko_gongmian',target);
player.gainPlayerCard(target,'hej',true,[1,num]);
}
else event.finish();
'step 2'
if(target.isIn()&&result.bool&&result.cards&&result.cards.length&&player.countCards('he')>0){
var num=result.cards.length,hs=player.getCards('he');
if(hs.length<=num) event._result={bool:true,cards:hs};
else player.chooseCard('he',true,num,'交给'+get.translation(target)+get.cnNumber(num)+'张牌');
}
else event.finish();
'step 3'
if(result.bool&&result.cards&&result.cards.length){
player.give(result.cards,target);
}
},
},
kyouko_gongmian_discard:{
trigger:{player:'phaseDiscardBegin'},
direct:true,
filter:function(event,player){
var hs=player.countCards('h');
return hs>0&&player.getHistory('custom',function(evt){
return evt.kyouko_gongmian==true;
}).length>=player.hp&&game.hasPlayer(function(current){
return current!=player&¤t.countCards('h')0) player.gain(hs,target,'giveAuto','bySelf');
}
else event.finish();
'step 2'
if(target.isIn()&&player.countCards('h')>0){
var hs=player.getCards('h'),num=Math.ceil(hs.length/2);
if(hs.length<=num) event._result={bool:true,cards:hs};
else player.chooseCard('he',true,num,'交给'+get.translation(target)+get.cnNumber(num)+'张牌');
}
else event.finish();
'step 3'
if(result.bool&&result.cards&&result.cards.length){
player.give(result.cards,target);
}
},
},
yuuki_yicha:{
trigger:{player:'phaseUseBegin'},
frequent:true,
createDialog:function(id){
var dialog=ui.create.dialog('hidden');
(dialog.textPrompt=dialog.add('异插')).style.textAlign='center';
dialog.cards=[];
dialog.rawButtons=[];
dialog.videoId=id;
var cards=[];
for(var i=0;i<3;i++){
var card=ui.create.card(null,null,true);
card.pos=i;
card.pos_x=i;
card.pos_y=0;
cards.push(card);
dialog.rawButtons.push(card);
}
dialog.add(cards);
cards=[];
for(var i=0;i<3;i++){
var card=ui.create.card(null,null,true);
card.pos=i+3;
card.pos_x=i;
card.pos_y=1;
cards.push(card);
dialog.rawButtons.push(card);
}
dialog.add(cards);
for(var i of dialog.buttons){
i.pos_x=i.link.pos_x;
i.pos_y=i.link.pos_y;
i.link=i.link.pos;
}
dialog.open();
},
addCard:function(card,id,pos){
var dialog=get.idDialog(id);
if(!dialog) return;
for(var i=0;i0){
var color=get.color(list[0],false);
if(list.length>1){
for(var i=1;i0) event.goto(3);
'step 6'
game.broadcastAll('closeDialog',event.videoId);
player.chooseTarget('令一名角色获得'+get.translation(cards),true).set('ai',function(target){
return get.attitude(_status.event.player,target);
});
'step 7'
if(result.bool&&result.targets&&result.targets.length){
var target=result.targets[0];
player.line(target,'green');
target.gain(cards,'gain2');
}
},
},
kotomi_qinji:{
trigger:{player:'phaseUseBegin'},
filter:function(event,player){
return player.hasUseTarget('wanjian');
},
direct:true,
content:function(){
player.addTempSkill('kotomi_qinji2');
player.chooseUseTarget({name:'wanjian',isCard:true},get.prompt('kotomi_qinji'),'视为使用一张【万箭齐发】').logSkill='kotomi_qinji';
},
},
kotomi_qinji2:{
trigger:{source:'damageBefore'},
forced:true,
popup:false,
filter:function(event,player){
return event.getParent().skill=='kotomi_qinji';
},
content:function(){
trigger.cancel();
trigger.player.loseHp(trigger.num);
},
},
kotomi_chuanxiang:{
global:'kotomi_chuanxiang2',
},
kotomi_chuanxiang2:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return !player.hasSkill('kotomi_chuanxiang')&&player.countCards('e',lib.skill.kotomi_chuanxiang2.filterCard)>0;
},
filterCard:function(card,player){
if(!player) player=_status.event.player;
return game.hasPlayer(function(current){
return current!=player&¤t.isEmpty(get.subtype(card,false));
});
},
position:'e',
filterTarget:function(card,player,target){
return target!=player&&target.isEmpty(get.subtype(ui.selected.cards[0],false));
},
check:function(card){
if(get.value(card)<=0) return 10;
var player=_status.event.player;
if(game.hasPlayer(function(current){
return current.hasSkill('kotomi_chuanxiang')&&get.attitude(player,current)>0;
})){
var subtype=get.subtype(card,false);
if(player.countCards('hs',function(cardx){
return get.type(cardx)=='equip'&&get.subtype(cardx,false)==subtype&&player.canUse(cardx,player)&&get.effect(player,cardx,player,player)>0;
})) return 8;
return 7/Math.max(1,get.value(card));
}
return 0;
},
prepare:'give',
discard:false,
lose:false,
content:function(){
'step 0'
target.equip(cards[0]);
var list=game.filterPlayer(function(current){
return current.hasSkill('kotomi_chuanxiang');
});
game.asyncDraw(list,function(targetx){
return targetx==target?2:1;
});
'step 1'
game.delayx();
},
ai:{
order:8,
result:{
target:function(player,target){
var card=ui.selected.cards[0];
if(!card) return 0;
var eff=get.effect(target,card,player,target);
if(target.hasSkill('kotomi_chuanxiang')) eff++;
return eff;
},
},
},
},
asara_shelu:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return player.countCards('he')>0&&game.hasPlayer(function(current){
return current!=player&¤t.countCards('h')>0;
});
},
filterCard:true,
position:'he',
filterTarget:function(card,player,target){
return target!=player&&target.countCards('h')>0;
},
check:function(card){
return 6-get.value(card);
},
content:function(){
'step 0'
if(!target.countCards('h')) event.finish();
else player.choosePlayerCard(target,'h',true);
'step 1'
player.showCards(result.cards);
event.cards2=result.cards;
'step 2'
target.$give(event.cards2,player,false);
target.loseToSpecial(event.cards2,'asara_yingwei',player).visible=true;
var card1=cards[0],card2=event.cards2[0];
if(card1.suit==card2.suit) player.draw(2);
if(card1.number==card2.number) player.recover();
},
ai:{
order:6,
result:{
target:-1,
},
},
},
asara_yingwei:{
trigger:{player:'useCard1'},
forced:true,
filter:function(event,player){
return player.getHistory('lose',function(evt){
if(evt.getParent()!=event) return false;
for(var i in evt.gaintag_map){
if(evt.gaintag_map[i].contains('asara_yingwei')) return true;
}
return false;
}).length>0;
},
content:function(){
if(!trigger.card.yingbian){
trigger.card.yingbian=true;
var info=get.info(trigger.card);
if(info&&info.yingbian) info.yingbian(trigger);
player.addTempSkill('yingbian_changeTarget');
}
},
},
yukito_kongwu:{
enable:'phaseUse',
usable:1,
content:function(){
"step 0"
if(_status.connectMode) event.time=lib.configOL.choose_timeout;
event.videoId=lib.status.videoId++;
if(player.isUnderControl()){
game.swapPlayerAuto(player);
}
var switchToAuto=function(){
game.pause();
game.countChoose();
setTimeout(function(){
_status.imchoosing=false;
event._result={
bool:true,
score:get.rand(1,5),
};
if(event.dialog) event.dialog.close();
if(event.control) event.control.close();
game.resume();
},5000);
};
var createDialog=function(player,id){
if(_status.connectMode) lib.configOL.choose_timeout='30';
if(player==game.me) return;
var str=get.translation(player)+'正在表演《小空飞天》...
';
ui.create.dialog(str).videoId=id;
};
var chooseButton=function(){
var roundmenu=false;
if(ui.roundmenu&&ui.roundmenu.display!='none'){
roundmenu=true;
ui.roundmenu.style.display='none';
}
var event=_status.event;
event.settleed=false;
event.score=0;
event.dialog=ui.create.dialog('forcebutton','hidden');
event.dialog.textPrompt=event.dialog.add('准备好了吗?准备好了的话就点击屏幕开始吧!
');
event.dialog.textPrompt.style["z-index"]=10;
event.switchToAuto=function(){
event._result={
bool:true,
score:event.score,
};
event.dialog.close();
game.resume();
_status.imchoosing=false;
if(roundmenu) ui.roundmenu.style.display='';
};
event.dialog.classList.add('fixed');
event.dialog.classList.add('scroll1');
event.dialog.classList.add('scroll2');
event.dialog.classList.add('fullwidth');
event.dialog.classList.add('fullheight');
event.dialog.classList.add('noupdate');
event.dialog.style.overflow='hidden';
event.dialog.open();
var height=event.dialog.offsetHeight;
var width=event.dialog.offsetWidth;
var top=50;
var speed=0;
var start=false;
var bird=ui.create.div('');
bird.style["background-image"]='linear-gradient(rgba(6, 3, 55, 1), rgba(6, 3, 35, 1))';
bird.style["border-radius"]='3px';
var pipes=[];
bird.style.position='absolute';
bird.style.height='40px';
bird.style.width='40px';
bird.style.left=Math.ceil(width/3)+'px';
bird.style.top=(top/100*height)+'px';
bird.updatePosition=function(){
bird.style.transform='translateY('+(top/100*height-bird.offsetTop)+'px)';
};
event.dialog.appendChild(bird);
var isDead=function(){
if(top>100||top<0) return true;
var btop=top;
var bleft=100/3;
var bdown=btop+5;
var bright=bleft+5;
for(var i of pipes){
var left2=i.left;
var right2=left2+10;
var bottom2=i.height1;
var top2=i.height2;
if(left2>bright||right2top2) return true;
return false;
}
return false;
};
var fly=function(){
if(!start){
start=true;
event.dialog.textPrompt.innerHTML='当前分数:'+event.score+'
';
speed=-4;
event.fly=setInterval(function(){
top+=speed;
if(top<0) top=0;
bird.updatePosition();
for(var i of pipes){
i.left-=0.5;
i.updateLeft();
}
speed+=0.5;
if(speed>2.5) speed=2.5;
if(isDead()==true){
event.settle();
}
},35);
var addPipe=function(){
var num=get.rand(5,55);
var pipe1=ui.create.div('');
pipe1.style["background-image"]='linear-gradient(rgba(57, 133, 4, 1), rgba(60, 135, 6, 1))';
pipe1.style["border-radius"]='3px';
pipe1.style.position='absolute';
pipe1.height1=num;
pipe1.height2=num+50;
pipe1.left=110;
pipe1.num=1;
pipe1.style.height=Math.ceil(height*num/100)+'px';
pipe1.style.width=(width/10)+'px';
pipe1.style.left=(pipe1.left*width/100)+'px';
pipe1.style.top='0px';
var pipe2=ui.create.div('');
pipe2.style["background-image"]='linear-gradient(rgba(57, 133, 4, 1), rgba(60, 135, 6, 1))';
pipe2.style["border-radius"]='3px';
pipe1.pipe2=pipe2;
pipe2.style.position='absolute';
pipe2.style.height=Math.ceil((100-pipe1.height2)*height/100)+'px';
pipe2.style.width=(width/10)+'px';
pipe2.style.left=(pipe1.left*width/100)+'px';
pipe2.style.top=Math.ceil(pipe1.height2*height/100)+'px';
pipes.add(pipe1);
event.dialog.appendChild(pipe1);
event.dialog.appendChild(pipe2);
pipe1.updateLeft=function(){
this.style.transform='translateX('+((this.left/100*width)-this.offsetLeft)+'px)';
this.pipe2.style.transform='translateX('+((this.left/100*width)-this.pipe2.offsetLeft)+'px)';
if(this.left<25&&!this.score){
this.score=true;
event.score++;
event.dialog.textPrompt.innerHTML='当前分数:'+event.score+'
';
if(event.score>=5) event.settle();
}
if(this.left<-15){
this.remove();
this.pipe2.remove();
pipes.remove(this);
}
}
};
event.addPipe=setInterval(addPipe,2500);
}
else if(speed>0){
speed=-4;
}
};
document.addEventListener(lib.config.touchscreen?'touchend':'click',fly);
event.settle=function(){
clearInterval(event.fly);
clearInterval(event.addPipe);
document.removeEventListener(lib.config.touchscreen?'touchend':'click',fly);
setTimeout(function(){
event.switchToAuto()
},1000);
};
game.pause();
game.countChoose();
};
//event.switchToAuto=switchToAuto;
game.broadcastAll(createDialog,player,event.videoId);
if(event.isMine()){
chooseButton();
}
else if(event.isOnline()){
event.player.send(chooseButton);
event.player.wait();
game.pause();
}
else{
switchToAuto();
}
"step 1"
game.broadcastAll(function(id,time){
if(_status.connectMode) lib.configOL.choose_timeout=time;
var dialog=get.idDialog(id);
if(dialog){
dialog.close();
}
},event.videoId,event.time);
var result=event.result||result;
game.log(player,'获得了','#g'+result.score+'分');
if(!result.score){
player.chooseToDiscard(2,true,'he');
event.finish();
return;
}
var list=[];
var list2=[];
for(var i=0;i<5;i++){
if(lib.skill.yukito_kongwu.moves[i].filter(player,true)) list.push(i);
else list2.push(i);
}
if(list.length>=result.score) list=list.randomGets(result.score);
else list.addArray(list2.randomGets(result.score-list.length));
list.sort();
event.videoId=lib.status.videoId++;
var func=function(id,list){
var choiceList=ui.create.dialog('控物:请选择一项','forcebutton');
choiceList.videoId=id;
for(var ii=0;ii';
str+=lib.skill.yukito_kongwu.moves[i].prompt;
if(!bool) str+='';
str+='';
var next=choiceList.add(str);
next.firstChild.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.button);
next.firstChild.link=i;
for(var j in lib.element.button){
next[j]=lib.element.button[j];
}
choiceList.buttons.add(next.firstChild);
}
return choiceList;
};
if(player.isOnline2()){
player.send(func,event.videoId,list);
}
event.dialog=func(event.videoId,list);
if(player!=game.me||_status.auto){
event.dialog.style.display='none';
}
var next=player.chooseButton();
next.set('dialog',event.videoId);
next.set('forced',true);
next.set('filterButton',function(button){
return lib.skill.yukito_kongwu.moves[button.link].filter(_status.event.player);
});
next.set('ai',function(button){
if(lib.skill.yukito_kongwu.moves[button.link].filter(_status.event.player,true)) return 1+Math.random();
return Math.random();
});
"step 2"
if(player.isOnline2()){
player.send('closeDialog',event.videoId);
}
event.dialog.close();
var num=result.links[0];
switch(num){
case 0:event.goto(3);break;
case 1:event.goto(5);break;
case 2:event.goto(7);break;
case 3:event.goto(9);break;
case 4:player.moveCard(true);event.finish();break;
}
"step 3"
player.chooseTarget(true,'令一名角色摸两张牌').set('ai',function(target){
var player=_status.event.player;
var att=get.attitude(player,target)/Math.sqrt(1+target.countCards('h'));
if(target.hasSkillTag('nogain')) att/=10;
return att;
});
"step 4"
if(result.bool){
var target=result.targets[0];
player.line(target,'green');
target.draw(2);
}
event.finish();
"step 5"
player.chooseTarget(true,'对一名角色造成1点伤害').set('ai',function(target){
var player=_status.event.player;
return get.damageEffect(target,player,player);
});
"step 6"
if(result.bool){
var target=result.targets[0];
player.line(target,'green');
target.damage();
}
event.finish();
"step 7"
player.chooseTarget(true,'令一名已受伤的角色回复1点体力',function(card,player,target){
return target.isDamaged();
}).set('ai',function(target){
var player=_status.event.player;
return get.recoverEffect(target,player,player);
});
"step 8"
if(result.bool){
var target=result.targets[0];
player.line(target,'green');
target.recover();
}
event.finish();
"step 9"
player.chooseTarget(true,'弃置一名角色区域内的两张牌',function(card,player,target){
return target.countDiscardableCards(player,'hej')>0;
}).set('ai',function(target){
return -get.attitude(_status.event.player,target);
});
"step 10"
if(result.bool){
var target=result.targets[0];
player.line(target,'green');
player.discardPlayerCard(target,'hej',true,2);
}
event.finish();
},
moves:[
{
prompt:'令一名角色摸两张牌',
filter:()=>true,
},
{
prompt:'对一名角色造成1点伤害',
filter:function(player,ai){
if(!ai) return true;
return game.hasPlayer(function(current){
return get.damageEffect(current,player,player)>0;
});
},
},
{
prompt:'令一名已受伤的角色回复1点体力',
filter:function(player,ai){
return game.hasPlayer(function(current){
if(current.isDamaged()) return !ai||get.recoverEffect(current,player,player)>0;
});
}
},
{
prompt:'弃置一名角色区域内的两张牌',
filter:function(player,ai){
return game.hasPlayer(function(current){
return current.countDiscardableCards(player,'hej',function(card){
if(!ai) return true;
return get.buttonValue({link:card})*get.attitude(player,current)>0;
})>=(ai?1:Math.min(2,current.countDiscardableCards(player,'hej')));
});
},
},
{
prompt:'移动场上的一张牌',
filter:function(player,ai){
return player.canMoveCard(ai);
},
},
],
ai:{
order:10,
result:{player:1},
threaten:3.2,
}
},
yukito_yaxiang:{
enable:'chooseToUse',
limited:true,
filter:function(event,player){
return event.type=='dying'&&(player.name1=='key_yukito'||player.name2=='key_yukito');
},
filterTarget:function(card,player,target){
return target==_status.event.dying;
},
selectTarget:-1,
skillAnimation:true,
animationColor:'key',
content:function(){
'step 0'
player.awakenSkill('yukito_yaxiang');
player.reinit('key_yukito','key_crow');
'step 1'
if(target.hp<3) target.recover(3-target.hp);
'step 2'
var cards=target.getCards('j');
if(cards.length) target.discard(cards);
'step 3'
target.addSkill('misuzu_zhongyuan');
},
derivation:'misuzu_zhongyuan',
ai:{
save:true,
order:4,
result:{
target:function(player,target){
if(get.attitude(player,target)<4) return false;
if(player.countCards('h',function(card){
var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player);
if(mod2!='unchanged') return mod2;
var mod=game.checkMod(card,player,target,'unchanged','cardSavable',player);
if(mod!='unchanged') return mod;
var savable=get.info(card).savable;
if(typeof savable=='function') savable=savable(card,player,target);
return savable;
})>=1-target.hp) return false;
if(target==player||target==get.zhu(player)) return true;
return !player.hasUnknown();
},
},
},
},
misuzu_zhongyuan:{
trigger:{player:'judge'},
skillAnimation:true,
animationColor:'key',
direct:true,
content:function(){
'step 0'
var str='你的'+(trigger.judgestr||'')+'判定为'+
get.translation(trigger.player.judging[0])+',是否发动【终愿】修改判定结果?';
if(player.isUnderControl()){
game.swapPlayerAuto(player);
}
var switchToAuto=function(){
_status.imchoosing=false;
event._result={
bool:false,
};
if(event.dialog) event.dialog.close();
if(event.control) event.control.close();
};
var chooseButton=function(player,str){
var event=_status.event;
player=player||event.player;
if(!event._result) event._result={};
var dialog=ui.create.dialog(str,'forcebutton','hidden');
event.dialog=dialog;
dialog.addText('花色');
var table=document.createElement('div');
table.classList.add('add-setting');
table.style.margin='0';
table.style.width='100%';
table.style.position='relative';
var listi=['spade','heart','club','diamond'];
for(var i=0;i';
td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
if(_status.dragged) return;
if(_status.justdragged) return;
_status.tempNoButton=true;
setTimeout(function(){
_status.tempNoButton=false;
},500);
var link=this.link;
var current=this.parentNode.querySelector('.bluebg');
if(current){
current.classList.remove('bluebg');
}
this.classList.add('bluebg');
event._result.suit=link;
});
}
dialog.content.appendChild(table);
dialog.addText('点数');
var table2=document.createElement('div');
table2.classList.add('add-setting');
table2.style.margin='0';
table2.style.width='100%';
table2.style.position='relative';
for(var i=1;i<14;i++){
var td=ui.create.div('.shadowed.reduce_radius.pointerdiv.tdnode');
td.link=i;
table2.appendChild(td);
var num=i;
td.innerHTML=''+get.strNumber(num)+'';
td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
if(_status.dragged) return;
if(_status.justdragged) return;
_status.tempNoButton=true;
setTimeout(function(){
_status.tempNoButton=false;
},500);
var link=this.link;
var current=this.parentNode.querySelector('.bluebg');
if(current){
current.classList.remove('bluebg');
}
this.classList.add('bluebg');
event._result.number=link;
});
}
dialog.content.appendChild(table2);
dialog.add(' ');
event.dialog.open();
event.switchToAuto=function(){
event._result={
bool:false,
};
event.dialog.close();
event.control.close();
game.resume();
_status.imchoosing=false;
};
event.control=ui.create.control('ok','cancel2',function(link){
var result=event._result;
if(link=='cancel2') result.bool=false;
else{
if(!result.number||!result.suit) return;
result.bool=true;
}
event.dialog.close();
event.control.close();
game.resume();
_status.imchoosing=false;
});
for(var i=0;i=5&&!player._chihaya_liewu;
},
skillAnimation:true,
animationColor:'orange',
content:function(){
player._chihaya_liewu=true;
player.loseMaxHp(4);
player.addSkill('chihaya_huairou');
},
},
chihaya_huairou:{
audio:2,
enable:"phaseUse",
position:'he',
filter:function(event,player){
return player.countCards('he',{type:'equip'})>0;
},
filterCard:function(card){
return get.type(card)=='equip';
},
check:function(card){
if(_status.event.player.isDisabled(get.subtype(card))) return 5;
return 3-get.value(card);
},
content:function(){
player.draw();
},
discard:false,
visible:true,
loseTo:'discardPile',
prompt:"将一张装备牌置入弃牌堆并摸一张牌",
delay:0.5,
prepare:function(cards,player){
player.$throw(cards,1000);
game.log(player,'将',cards,'置入了弃牌堆');
},
ai:{
order:10,
result:{
player:1,
},
},
},
chihaya_youfeng:{
enable:'chooseToUse',
zhuanhuanji:true,
mark:true,
intro:{
content:function(storage,player){
return storage?'每轮限一次,你可以废除你的一个装备栏,视为使用一张基本牌。':'每轮限一次,你可以加1点体力上限,视为使用一张普通锦囊牌。';
},
},
marktext:'☯',
init:function(player){
player.storage.chihaya_youfeng=false;
},
hiddenCard:function(player,name){
if(player.storage.chihaya_youfeng&&player.countDisabled()>=5) return false;
if(player.hasSkill('chihaya_youfeng_'+(player.storage.chihaya_youfeng||false))) return false;
var type=get.type(name);
if(player.storage.chihaya_youfeng) return type=='basic';
return type=='trick';
},
filter:function(event,player){
if(player.storage.chihaya_youfeng&&player.countDisabled()>=5) return false;
if(player.hasSkill('chihaya_youfeng_'+(player.storage.chihaya_youfeng||false))) return false;
var type=player.storage.chihaya_youfeng?'basic':'trick';
for(var name of lib.inpile){
if(get.type(name)!=type) continue;
if(event.filterCard({name:name,isCard:true},player,event)) return true;
}
return false;
},
chooseButton:{
dialog:function(event,player){
var dialog=ui.create.dialog('游凤','hidden');
if(player.storage.chihaya_youfeng){
var table=document.createElement('div');
table.classList.add('add-setting');
table.style.margin='0';
table.style.width='100%';
table.style.position='relative';
for(var i=1;i<6;i++){
if(player.isDisabled(i)) continue;
var td=ui.create.div('.shadowed.reduce_radius.pointerdiv.tdnode');
td.innerHTML=''+get.translation('equip'+i)+'';
td.link=i;
td.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.button);
for(var j in lib.element.button){
td[j]=lib.element.button[i];
}
table.appendChild(td);
dialog.buttons.add(td);
}
dialog.content.appendChild(table);
}
var type=player.storage.chihaya_youfeng?'basic':'trick';
var list=[];
for(var name of lib.inpile){
if(get.type(name)!=type) continue;
if(event.filterCard({name:name,isCard:true},player,event)){
list.push([type,'',name]);
if(name=='sha'){
for(var j of lib.inpile_nature) list.push([type,'',name,j]);
}
}
}
dialog.add([list,'vcard']);
return dialog;
},
filter:function(button){
if(ui.selected.buttons.length&&typeof button.link==typeof ui.selected.buttons[0].link) return false;
return true;
},
select:function(){
if(_status.event.player.storage.chihaya_youfeng) return 2;
return 1;
},
check:function(button){
var player=_status.event.player;
if(typeof button.link=='number'){
var card=player.getEquip(button.link);
if(card){
var val=get.value(card);
if(val>0) return 0;
return 5-val;
}
switch(button.link){
case 3:return 4.5;break;
case 4:return 4.4;break;
case 5:return 4.3;break;
case 2:return (3-player.hp)*1.5;break;
case 1:{
if(game.hasPlayer(function(current){
return (get.realAttitude||get.attitude)(player,current)<0&&get.distance(player,current)>1;
})) return 0;
return 3.2;
}
}
}
var name=button.link[2];
var evt=_status.event.getParent();
if(get.type(name)=='basic'){
if(name=='shan') return 2;
if(evt.type=='dying'){
if(get.attitude(player,evt.dying)<2) return false;
if(name=='jiu') return 2.1;
return 1.9;
}
if(evt.type=='phase') return player.getUseValue({name:name,nature:button.link[3],isCard:true});
return 1;
}
if(!['chuqibuyi','shuiyanqijunx','juedou','nanman','wanjian','shunshou','zhujinqiyuan'].contains(name)) return 0;
var card={name:name,isCard:true};
if(['shunshou','zhujinqiyuan'].contains(card.name)){
if(!game.hasPlayer(function(current){
return get.attitude(player,current)!=0&&get.distance(player,current)<=1&&player.canUse(card,current)&&get.effect(current,card,player,player)>0;
})) return 0;
return player.getUseValue(card)-7;
}
return player.getUseValue(card)-4;
},
backup:function(links,player){
if(links.length==1) return {
filterCard:function(){return false},
selectCard:-1,
viewAs:{
name:links[0][2],
nature:links[0][3],
isCard:true,
},
popname:true,
precontent:function(){
player.logSkill('chihaya_youfeng');
player.gainMaxHp();
delete event.result.skill;
player.addTempSkill('chihaya_youfeng_'+(player.storage.chihaya_youfeng||false),'roundStart');
player.changeZhuanhuanji('chihaya_youfeng');
},
}
if(typeof links[1]=='number') links.reverse();
var equip=links[0];
var name=links[1][2];
var nature=links[1][3];
return {
filterCard:function(){return false},
selectCard:-1,
equip:equip,
viewAs:{
name:name,
nature:nature,
isCard:true,
},
popname:true,
precontent:function(){
player.logSkill('chihaya_youfeng');
player.disableEquip(lib.skill.chihaya_youfeng_backup.equip);
delete event.result.skill;
player.addTempSkill('chihaya_youfeng_'+(player.storage.chihaya_youfeng||false),'roundStart');
player.changeZhuanhuanji('chihaya_youfeng');
},
}
},
prompt:function(links,player){
if(links.length==1) return '增加一点体力上限,视为使用'+(get.translation(links[0][3])||'')+get.translation(links[0][2]);
if(typeof links[1]=='number') links.reverse();
var equip='equip'+links[0];
var name=links[1][2];
var nature=links[1][3];
return '废除自己的'+get.translation(equip)+'栏,视为使用'+(get.translation(nature)||'')+get.translation(name);
},
},
ai:{
respondSha:true,
respondShan:true,
skillTagFilter:function(player,tag,arg){
if(arg=='respond') return false;
if(!player.storage.chihaya_youfeng||player.hasSkill('chihaya_youfeng_true')) return false;
},
order:1,
result:{
player:1,
},
},
},
chihaya_youfeng_true:{charlotte:true},
chihaya_youfeng_false:{charlotte:true},
rumi_shuwu:{
mod:{
cardUsable:function(card){
if(card.name=='sha') return Infinity;
},
targetInRange:function(card){
if(card.name=='sha') return true;
},
},
trigger:{player:'useCard2'},
direct:true,
filter:function(event,player){
var card=event.card;
var info=get.info(card);
if(info.type!='trick'||info.allowMultiple==false) return false;
if(event.targets&&!info.multitarget){
if(game.hasPlayer(function(current){
return !event.targets.contains(current)&&lib.filter.targetEnabled2(card,player,current);
})){
return true;
}
}
return false;
},
content:function(){
'step 0'
var prompt2='为'+get.translation(trigger.card)+'增加一个目标';
player.chooseTarget(get.prompt('rumi_shuwu'),function(card,player,target){
var player=_status.event.player;
return !_status.event.targets.contains(target)&&lib.filter.targetEnabled2(_status.event.card,player,target);
}).set('prompt2',prompt2).set('ai',function(target){
var trigger=_status.event.getTrigger();
var player=_status.event.player;
return get.effect(target,trigger.card,player,player);
}).set('card',trigger.card).set('targets',trigger.targets);
'step 1'
if(result.bool){
if(!event.isMine()) game.delayx();
event.targets=result.targets;
}
else{
event.finish();
}
'step 2'
if(event.targets){
player.logSkill('rumi_shuwu',event.targets);
trigger.targets.addArray(event.targets);
}
},
group:'rumi_shuwu2',
},
rumi_shuwu2:{
trigger:{player:'phaseUseEnd'},
forced:true,
filter:function(event,player){
if(player.hp<=3) return true;
if(player.getHistory('useCard',function(evt){
return evt.card.name=='sha'&&evt.addCount!==false&&evt.getParent('phaseUse')==event;
}).length<=1) return true;
if(player.getHistory('sourceDamage',function(evt){
return get.type(evt.card,false)=='trick'&&evt.getParent('phaseUse')==event;
}).length==0) return true;
return false;
},
content:function(){
var num=0;
if(player.hp<=3) num++;
if(player.getHistory('useCard',function(evt){
return evt.card.name=='sha'&&evt.addCount!==false&&evt.getParent('phaseUse')==trigger;
}).length<=1) num++;
if(player.getHistory('sourceDamage',function(evt){
return get.type(evt.card,false)=='trick'&&evt.getParent('phaseUse')==trigger;
}).length==0) num++;
player.draw(num);
player.addTempSkill('rumi_shuwu3');
player.addMark('rumi_shuwu3',num,false);
},
},
rumi_shuwu3:{
mod:{
maxHandcard:function(player,num){
return num+player.countMark('rumi_shuwu3');
},
},
onremove:true,
},
sakuya_junbu:{
mod:{
targetInRange:function(card,player){
if(player.countDisabled()>=1) return true;
},
cardUsable:function(card,player){
if(player.countDisabled()>=2) return Infinity;
},
},
trigger:{player:'useCard2'},
direct:true,
filter:function(event,player){
if(player.countDisabled()>=4) return true;
return lib.skill.sakuya_junbu.filter2.apply(this,arguments);
},
filter2:function(event,player){
if(player.countDisabled()<3) return false;
var card=event.card;
var info=get.info(card);
if(info.allowMultiple==false) return false;
if(event.targets&&!info.multitarget){
if(game.hasPlayer(function(current){
return !event.targets.contains(current)&&lib.filter.targetEnabled2(card,player,current);
})){
return true;
}
}
return false;
},
content:function(){
'step 0'
if(player.countDisabled()>=4){
trigger.directHit.addArray(game.players);
if(!lib.skill.sakuya_junbu.filter2(trigger,player)){
event.finish();
return;
}
}
var prompt2='为'+get.translation(trigger.card)+'增加一个目标';
player.chooseTarget(get.prompt('sakuya_junbu'),function(card,player,target){
var player=_status.event.player;
return !_status.event.targets.contains(target)&&lib.filter.targetEnabled2(_status.event.card,player,target);
}).set('prompt2',prompt2).set('ai',function(target){
var trigger=_status.event.getTrigger();
var player=_status.event.player;
return get.effect(target,trigger.card,player,player);
}).set('card',trigger.card).set('targets',trigger.targets);
'step 1'
if(result.bool){
if(!event.isMine()) game.delayx();
event.targets=result.targets;
}
else{
event.finish();
}
'step 2'
if(event.targets){
player.logSkill('sakuya_junbu',event.targets);
trigger.targets.addArray(event.targets);
}
},
group:'sakuya_junbu_damage',
subSkill:{
damage:{
trigger:{source:'damageBegin1'},
forced:true,
sub:true,
filter:function(event,player){
return player.countDisabled()>=5&&event.getParent().type=='card';
},
logTarget:'player',
content:function(){
player.loseHp();
trigger.num++;
},
},
},
},
hiroto_huyu:{
trigger:{global:'phaseUseEnd'},
direct:true,
noHidden:true,
filter:function(event,player){
return player!=event.player&&player.hasSkill('hiroto_huyu')&&!player.hasSkill('hiroto_zonglve')&&event.player.countCards('h')>0;
},
content:function(){
'step 0'
trigger.player.chooseCard(2,'h','是否对'+get.translation(player)+'发动【虎驭】?','将两张手牌交给该角色,然后令其获得〖纵略〗并于下回合获得该角色获得的所有牌').set('goon',function(){
var source=trigger.player;
if(get.attitude(source,player)>0) return 7;
if(source.hp>2) return 4;
return 0;
}()).set('ai',function(card){
return _status.event.goon-get.value(card);
});
'step 1'
if(result.bool){
var target=trigger.player;
player.logSkill('hiroto_huyu',target);
target.give(result.cards,player);
player.storage.hiroto_huyu2=target;
player.addSkill('hiroto_zonglve');
player.addSkill('hiroto_huyu2');
}
},
derivation:'hiroto_zonglve',
},
hiroto_huyu2:{
trigger:{player:'phaseEnd'},
forced:true,
popup:false,
charlotte:true,
content:function(){
player.removeSkill('hiroto_huyu2');
player.removeSkill('hiroto_zonglve');
player.removeGaintag('hiroto_huyu2');
var target=player.storage.hiroto_huyu2;
if(target&&target.isAlive()){
var cards=[];
player.getHistory('gain',function(evt){
cards.addArray(evt.cards);
});
var he=player.getCards('he');
cards=cards.filter(function(card){
return he.contains(card);
});
if(cards.length) target.gain(cards,player,'giveAuto','bySelf');
}
},
mark:'character',
intro:{content:'已成为$的工具人'},
group:'hiroto_huyu_gain',
},
hiroto_huyu_gain:{
trigger:{player:'gainBegin'},
silent:true,
filter:function(event,player){
if(player==_status.currentPhase) event.gaintag.add('hiroto_huyu2');
return false;
},
},
hiroto_zonglve:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return player.countCards('h')>0&&game.hasPlayer(function(current){
return current!=player&¤t.countCards('h')>0;
});
},
filterTarget:function(card,player,target){
return target!=player&&target.countCards('h')>0;
},
filterCard:true,
delay:false,
charlotte:true,
position:'h',
discard:false,
lose:false,
content:function(){
'step 0'
player.choosePlayerCard(true,target,'h');
'step 1'
event.card=result.cards[0];
player.$compare(cards[0],target,event.card);
game.log(player,'展示了',cards[0]);
game.log(target,'展示了',event.card)
game.delay(3.5);
'step 2'
game.broadcastAll(ui.clear);
if(get.color(cards[0],player)==get.color(card,target)){
target.damage('nocard');
target.discard(card).animate=false;
}
else player.gainPlayerCard(target,true,2,'hej');
},
mod:{
maxHandcard:function(player,num){
return num+3;
},
},
ai:{
order:7,
result:{
target:-1,
},
},
},
hiroto_tuolao:{
trigger:{player:'phaseAfter'},
forced:true,
juexingji:true,
skillAnimation:true,
animationColor:'water',
filter:function(event,player){
return player.phaseNumber>1&&!player.getHistory('lose',function(evt){
return evt.getParent(2).name=='hiroto_huyu2';
}).length;
},
content:function(){
player.awakenSkill('hiroto_tuolao');
player.draw(3);
player.removeSkill('hiroto_huyu');
player.addSkill('hiroto_zonglve');
},
},
shizuku_sizhi:{
audio:2,
enable:'phaseUse',
getResult:function(cards){
var l=cards.length;
var all=Math.pow(l,2);
var list=[];
for(var i=1;i0) array.push(cards[j])
}
var num=0;
for(var k of array){
num+=get.number(k);
}
if(num==13) list.push(array);
}
if(list.length){
list.sort(function(a,b){
if(a.length!=b.length) return b.length-a.length;
return get.value(a)-get.value(b);
});
return list[0];
}
return list;
},
usable:1,
filterCard:function(card){
var num=0;
for(var i=0;i0) array.push(cards[j])
}
var numx=0;
for(var k of array){
numx+=get.number(k);
}
if(numx==num) list.push(array);
}
if(list.length){
list.sort(function(a,b){
return get.value(a)-get.value(b);
});
return list[0];
}
return list;
}());
next.set('ai',function(card){
if(!_status.event.cardResult.contains(card)) return 0;
return 6-get.value(card);
});
'step 2'
if(result.bool) player.recover();
},
},
shizuku_sanhua:{
trigger:{player:'die'},
forceDie:true,
skillAnimation:true,
animationColor:'thunder',
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt2('shizuku_sanhua'),lib.filter.notMe).set('ai',function(target){
return get.attitude(_status.event.player,target);
});
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('shizuku_sanhua',target);
var names=[];
var cards=[];
while(cards.length<4){
var card=get.cardPile2(function(card){
return !cards.contains(card)&&!names.contains(card.name)&&get.type(card)=='basic';
});
if(card){
cards.push(card);
names.push(card.name);
}
else break;
}
if(cards.length) target.gain(cards,'gain2');
}
},
},
shiroha_yuzhao:{
trigger:{
global:'phaseBefore',
player:'enterGame',
},
forced:true,
charlotte:true,
filter:function(event,player){
return (event.name!='phase'||game.phaseNumber==0);
},
content:function(){
player.addToExpansion(get.cards(game.countGroup()),'draw').gaintag.add('shiroha_yuzhao');
},
marktext:'兆',
intro:{
markcount:'expansion',
mark:function(dialog,content,player){
var content=player.getExpansions('shiroha_yuzhao');
if(content&&content.length){
if(player==game.me||player.isUnderControl()){
dialog.addAuto(content);
}
else{
return '共有'+get.cnNumber(content.length)+'张牌';
}
}
},
content:function(content,player){
var content=player.getExpansions('shiroha_yuzhao');
if(content&&content.length){
if(player==game.me||player.isUnderControl()){
return get.translation(content);
}
return '共有'+get.cnNumber(content.length)+'张牌';
}
}
},
group:'shiroha_yuzhao_umi',
},
shiroha_yuzhao_umi:{
trigger:{global:'phaseBegin'},
forced:true,
filter:function(event,player){
return player.getExpansions('shiroha_yuzhao').length>0&&get.distance(event.player,player)<=1;
},
content:function(){
'step 0'
event.num=game.countGroup();
player.addToExpansion(get.cards(event.num)).gaintag.add('shiroha_yuzhao');
'step 1'
var next=player.chooseToMove(),num=game.countGroup();
next.set('prompt','预兆:将'+get.cnNumber(num)+'张牌置于牌堆顶');
next.set('num',num);
next.set('forced',true);
next.set('filterOk',function(moved){
return moved[1].length==_status.event.num;
});
next.set('filterMove',function(from,to,moved){
if(to!=1) return true;
return moved[1].length<_status.event.num;
});
next.set('list',[
[get.translation(player)+'(你)的“兆”',player.getExpansions('shiroha_yuzhao')],
['牌堆顶'],
]);
next.set('processAI',function(list){
var cards=list[0][1],cards2=cards.randomRemove(_status.event.num);
return [cards,cards2];
});
'step 2'
if(result&&result.bool){
var cards=result.moved[1];
player.lose(cards,ui.cardPile,'insert');
}
game.updateRoundNumber();
},
},
shiroha_guying:{
derivation:'shiroha_guying_rewrite',
trigger:{
player:'damageBegin3',
source:'damageBegin1',
},
direct:true,
filter:function(event,player,name){
if(!player.storage.shiroha_jiezhao&&player.hasSkill('shiroha_guying_temp')) return false;
if(name=='damageBegin3') return true;
return player!=event.player;
},
locked:function(skill,player){
if(!player||!player.storage.shiroha_jiezhao) return true;
return false;
},
content:function(){
'step 0'
var num=event.triggername=='damageBegin3'?-1:1;
event.num=num;
if(player.storage.shiroha_jiezhao||!player.hasSkill('shiroha_guying')){
if(num>0) player.chooseBool(get.prompt('shiroha_guying',trigger.player),'进行判定。若判定结果为黑色,则即将对其造成的伤害+1');
else player.chooseBool(get.prompt('shiroha_guying'),'进行判定。若判定结果为红色,则即将受到的伤害-1');
}
else event._result={bool:true};
'step 1'
if(result.bool){
player.addTempSkill('shiroha_guying_temp');
player.judge(function(card){
return (get.color(card)==(_status.event.getParent('shiroha_guying').num>0?'black':'red'))?2:0;
}).judge2=function(result){
return result.bool?true:false;
};
}
else event.finish();
'step 2'
if(result.bool) trigger.num+=num;
},
},
shiroha_guying_temp:{charlotte:true},
shiroha_jiezhao:{
trigger:{global:'judge'},
direct:true,
filter:function(event,player){
return player.getExpansions('shiroha_yuzhao').length&&event.player.isAlive();
},
content:function(){
"step 0"
var list=player.getExpansions('shiroha_yuzhao');
player.chooseButton([get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+get.translation(trigger.player.judging[0])+
','+get.prompt('shiroha_jiezhao'),list,'hidden'],function(button){
var card=button.link;
var trigger=_status.event.getTrigger();
var player=_status.event.player;
var judging=_status.event.judging;
var result=trigger.judge(card)-trigger.judge(judging);
var attitude=get.attitude(player,trigger.player);
return result*attitude;
}).set('judging',trigger.player.judging[0]).set('filterButton',function(button){
var player=_status.event.player;
var card=button.link;
var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player);
if(mod2!='unchanged') return mod2;
var mod=game.checkMod(card,player,'unchanged','cardRespondable',player);
if(mod!='unchanged') return mod;
return true;
});
"step 1"
if(result.bool){
event.forceDie=true;
player.respond(result.links,'shiroha_jiezhao','highlight','noOrdering');
result.cards=result.links;
}
else{
event.finish();
}
"step 2"
if(result.bool){
if(trigger.player.judging[0].clone){
trigger.player.judging[0].clone.classList.remove('thrownhighlight');
game.broadcast(function(card){
if(card.clone){
card.clone.classList.remove('thrownhighlight');
}
},trigger.player.judging[0]);
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
}
game.cardsDiscard(trigger.player.judging[0]);
trigger.player.judging[0]=result.cards[0];
trigger.orderingCards.addArray(result.cards);
game.log(trigger.player,'的判定牌改为',result.cards[0]);
game.delay(2);
}
"step 3"
if(!player.getExpansions('shiroha_yuzhao').length){
player.storage.shiroha_jiezhao=true;
player.gainMaxHp();
player.recover();
var list=['umi_chaofan','ao_xishi','tsumugi_mugyu','kamome_jieban'];
var skill=list.randomGet();
player.addSkillLog(skill);
player.flashAvatar('shiroha_jiezhao','key_'+skill.split('_')[0]);
}
},
ai:{
rejudge:true,
tag:{
rejudge:0.6
}
},
derivation:['umi_chaofan','ao_xishi','tsumugi_mugyu','kamome_jieban'],
},
jojiro_shensu:{
group:['jojiro_shensu1','jojiro_shensu2','jojiro_shensu4'],
charlotte:true,
},
jojiro_shensu1:{
trigger:{player:'phaseJudgeBefore'},
direct:true,
content:function(){
"step 0"
var check= player.countCards('h')>2;
player.chooseTarget(get.prompt("jojiro_shensu"),"跳过判定阶段和摸牌阶段,视为对一名其他角色使用一张【杀】",function(card,player,target){
if(player==target) return false;
return player.canUse({name:'sha'},target,false);
}).set('check',check).set('ai',function(target){
if(!_status.event.check) return 0;
return get.effect(target,{name:'sha'},_status.event.player);
});
"step 1"
if(result.bool){
player.logSkill('jojiro_shensu',result.targets);
player.useCard({name:'sha',isCard:true},result.targets[0],false);
trigger.cancel();
player.skip('phaseDraw');
}
}
},
jojiro_shensu2:{
trigger:{player:'phaseUseBefore'},
direct:true,
filter:function(event,player){
return player.countCards('he',{type:'equip'})>0;
},
content:function(){
"step 0"
var check=player.needsToDiscard();
player.chooseCardTarget({
prompt:get.prompt('jojiro_shensu'),
prompt2:"弃置一张装备牌并跳过出牌阶段,视为对一名其他角色使用一张【杀】",
filterCard:function(card,player){
return get.type(card)=='equip'&&lib.filter.cardDiscardable(card,player)
},
position:'he',
filterTarget:function(card,player,target){
if(player==target) return false;
return player.canUse({name:'sha'},target,false);
},
ai1:function(card){
if(_status.event.check) return 0;
return 6-get.value(card);
},
ai2:function(target){
if(_status.event.check) return 0;
return get.effect(target,{name:'sha'},_status.event.player);
},
check:check
});
"step 1"
if(result.bool){
player.logSkill('jojiro_shensu',result.targets);
player.discard(result.cards[0]);
player.useCard({name:'sha',isCard:true},result.targets[0]);
trigger.cancel();
}
}
},
jojiro_shensu4:{
trigger:{player:'phaseDiscardBefore'},
direct:true,
content:function(){
"step 0"
var check=player.needsToDiscard()||player.isTurnedOver()||(player.hasSkill('shebian')&&player.canMoveCard(true,true));
player.chooseTarget(get.prompt('jojiro_shensu'),"跳过弃牌阶段并将武将牌翻面,视为对一名其他角色使用一张【杀】",function(card,player,target){
if(player==target) return false;
return player.canUse({name:'sha'},target,false);
}).set('check',check).set('ai',function(target){
if(!_status.event.check) return 0;
return get.effect(target,{name:'sha'},_status.event.player,_status.event.player);
});
"step 1"
if(result.bool){
player.logSkill('jojiro_shensu',result.targets);
player.turnOver();
player.useCard({name:'sha',isCard:true},result.targets[0],false);
trigger.cancel();
}
}
},
jojiro_shunying:{
trigger:{player:'phaseEnd'},
forced:true,
charlotte:true,
filter:function(event,player){
return player.getHistory('skipped').length>0;
},
content:function(){
'step 0'
var num=player.getHistory('skipped').length;
event.num=num;
player.chooseToMoveChess(num,'瞬影:移动至多'+get.cnNumber(num)+'格或失去1点体力');
'step 1'
if(!result.bool) player.loseHp();
else player.draw(num);
},
},
kotori_yumo:{
trigger:{
global:'phaseBefore',
player:'enterGame',
},
forced:true,
charlotte:true,
filter:function(event,player){
return (event.name!='phase'||game.phaseNumber==0);
},
content:function(){
var list=['wei','shu','wu','qun','jin'];
for(var i of list){
if(!player.hasMark('kotori_yumo_'+i)){
player.addMark('kotori_yumo_'+i,1,false);
game.log(player,'获得了一个',lib.translate['kotori_yumo_'+i].replace(/魔物/g,'【魔物】'));
}
}
},
group:['kotori_yumo_damage','kotori_yumo_gain'],
},
kotori_yumo_damage:{
trigger:{global:'damageEnd'},
forced:true,
filter:function(event,player){
var name='kotori_yumo_'+event.player.group;
return lib.skill[name]&&!player.hasMark(name);
},
popup:false,
content:function(){
game.log(player,'对',trigger.player,'发动了','#g【驭魔】');
var group=trigger.player.group;
player.popup('驭魔',get.groupnature(group));
player.addMark('kotori_yumo_'+group,1,false);
game.log(player,'获得了一个',lib.translate['kotori_yumo_'+group].replace(/魔物/g,'【魔物】'));
},
},
kotori_yumo_gain:{
trigger:{player:'phaseBegin'},
direct:true,
filter:function(event,player){
var list=['wei','shu','wu','qun','key','jin'];
for(var i in list){
if(player.hasMark('kotori_yumo_'+list[i])) return true;
}
return false;
},
content:function(){
'step 0'
var list=['wei','shu','wu','qun','key','jin'];
var list2=[];
for(var i of list){
if(player.hasMark('kotori_yumo_'+i)) list2.push('kotori_skill_'+i);
}
list2.push('cancel2');
player.chooseControl(list2).set('prompt','###是否发动【驭魔】?###弃置对应的标记并获得下列技能中的一个,或点取消,不获得技能').set('choice',function(){
if(list2.contains('kotori_skill_shu')&&player.countCards('h',function(card){
return get.name(card,player)=='sha'&&player.getUseValue(card)>0;
})>1) return 'kotori_skill_shu';
if(list2.contains('kotori_skill_key')&&player.hp>1) return 'kotori_skill_key';
if(list2.contains('kotori_skill_qun')&&player.isDamaged()&&player.needsToDiscard()>1) return 'kotori_skill_qun';
return 'cancel2';
}()).set('ai',function(){
return _status.event.choice;
});
'step 1'
if(result.control!='cancel2'){
player.logSkill('kotori_yumo');
var name='kotori_yumo_'+result.control.slice(13);
player.removeMark(name,1,false);game.log(player,'移去了一个',lib.translate[name].replace(/魔物/g,'【魔物】'));
player.addTempSkill(result.control);
game.log(player,'获得了技能',lib.translate[name].replace(/魔物/g,'【'+get.translation(result.control)+'】'));
}
},
},
kotori_skill_wei:{
trigger:{player:'phaseBegin'},
direct:true,
filter:function(event,player){
return player.countCards('he')>0;
},
content:function(){
'step 0'
player.chooseCardTarget({
prompt:get.prompt2(event.name),
filterCard:lib.filter.cardDiscardable,
filterTarget:function(card,player,target){
return player!=target;
},
position:'he',
ai1:function(card){
return 6-get.value(card);
},
ai2:function(target){
return 1/(1+target.countCards('he'))*-get.attitude(_status.event.player,target);
},
});
'step 1'
if(result.bool){
player.logSkill(event.name,result.targets);
player.discard(result.cards);
result.targets[0].chooseToDiscard('弃置一张牌,或令'+get.translation(player)+'摸一张牌','he').ai=lib.skill.zhiheng.check;
}
else event.finish();
'step 2'
if(!result.bool) player.draw();
},
},
kotori_skill_shu:{
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha') return num+1;
},
},
trigger:{player:'phaseUseEnd'},
forced:true,
filter:function(event,player){
return player.getHistory('useCard',function(evt){
return evt.card&&evt.card.name=='sha'&&evt.getParent('phaseUse')==event;
}).length>1;
},
content:function(){player.draw()},
},
kotori_skill_wu:{
trigger:{player:'phaseEnd'},
forced:true,
filter:function(event,player){
return player.countCards('h')!=player.hp;
},
content:function(){player.draw()},
},
kotori_skill_qun:{
trigger:{player:'phaseDiscardBegin'},
forced:true,
filter:function(event,player){
return (player.isDamaged()||player.countCards('h')-player.hp>1);
},
content:function(){
var num=0;
if(player.isDamaged()) num++;
if(player.countCards('h')-player.hp>1) num++;
player.addMark('kotori_qunxin_temp',num,false);
player.addTempSkill('kotori_qunxin_temp','phaseDiscardEnd');
},
},
kotori_skill_key:{
enable:'phaseUse',
usable:1,
content:function(){
"step 0"
player.draw();
"step 1"
player.changeHujia(1);
"step 2"
var evt=event.getParent('phase');
if(evt&&evt.after){
var next=player.loseHp();
event.next.remove(next);
evt.after.push(next);
}
},
ai:{
order:10,
result:{
player:function(player){
return player.hp-1;
},
},
},
},
kotori_skill_jin:{
trigger:{player:'phaseDrawEnd'},
filter:function(event,player){
var hs=player.getCards('h');
return hs.length>0&&player.getHistory('gain',function(evt){
if(evt.getParent().name!='draw'||evt.getParent('phaseDraw')!=event) return false;
for(var i of evt.cards){
if(hs.contains(i)) return true;
}
return false;
}).length>0;
},
check:function(event,player){
var hs=player.getCards('h'),cards=[],suits=[];
player.getHistory('gain',function(evt){
if(evt.getParent().name!='draw'||evt.getParent('phaseDraw')!=event) return false;
for(var i of evt.cards){
if(hs.contains(i)){
cards.add(i);
suits.add(get.suit(i,player));
}
}
});
return cards.length==suits.length;
},
content:function(){
var hs=player.getCards('h'),cards=[],suits=[];
player.getHistory('gain',function(evt){
if(evt.getParent().name!='draw'||evt.getParent('phaseDraw')!=trigger) return false;
for(var i of evt.cards){
if(hs.contains(i)){
cards.add(i);
suits.add(get.suit(i,player));
}
}
});
player.showCards(cards,get.translation(player)+'发动了【晋势】');
if(cards.length==suits.length) player.draw();
},
},
kotori_qunxin_temp:{
onremove:true,
mod:{
maxHandcard:function(player,num){
return num+player.countMark('kotori_qunxin_temp');
},
},
},
kotori_yumo_wei:{
marktext:'魔',
intro:{name:'魔物',content:'mark'},
},
kotori_yumo_shu:{
marktext:'魔',
intro:{name:'魔物',content:'mark'},
},
kotori_yumo_wu:{
marktext:'魔',
intro:{name:'魔物',content:'mark'},
},
kotori_yumo_qun:{
marktext:'魔',
intro:{name:'魔物',content:'mark'},
},
kotori_yumo_key:{
marktext:'魔',
intro:{name:'魔物',content:'mark'},
},
kotori_yumo_jin:{
marktext:'魔',
intro:{name:'魔物',content:'mark'},
},
kotori_huazhan:{
charlotte:true,
enable:'chooseToUse',
filter:function(event,player){
var bool=false;
var list=['wei','shu','wu','qun','key','jin'];
for(var i of list){
if(player.hasMark('kotori_yumo_'+i)&&!player.getStorage('kotori_huazhan2').contains('kotori_yumo_'+i)){
bool=true;break;
}
}
return bool&&event.filterCard({name:'kaihua',isCard:true},player,event);
},
chooseButton:{
dialog:function(event,player){
return ui.create.dialog('###花绽###'+lib.translate.kotori_huazhan_info);
},
chooseControl:function(event,player){
var list=['wei','shu','wu','qun','key','jin'];
var list2=[];
for(var i of list){
if(player.hasMark('kotori_yumo_'+i)&&!player.getStorage('kotori_huazhan2').contains('kotori_yumo_'+i)) list2.push('kotori_yumo_'+i);
}
list2.push('cancel2');
return list2;
},
check:function(){
var player=_status.event.player;
var list=['wei','shu','wu','qun','key','jin'];
var list2=[];
for(var i of list){
if(player.hasMark('kotori_yumo_'+i)&&!player.getStorage('kotori_huazhan2').contains('kotori_yumo_'+i)) list2.push('kotori_yumo_'+i);
}
if(list2.contains('kotori_yumo_wei')) return 'kotori_yumo_wei';
if(list2.contains('kotori_yumo_wu')) return 'kotori_yumo_wu';
if(list2.contains('kotori_yumo_qun')) return 'kotori_yumo_qun';
if(list2.contains('kotori_yumo_key')) return 'kotori_yumo_key';
if(list2.contains('kotori_yumo_shu')&&game.hasPlayer(function(current){
return current.group=='shu';
})) return 'kotori_yumo_shu';
return 'cancel2';
},
backup:function(result,player){
return {
markname:result.control,
viewAs:{name:'kaihua',isCard:true},
filterCard:function(){return false},
selectCard:-1,
precontent:function(){
delete event.result.skill;
var name=lib.skill.kotori_huazhan_backup.markname;
if(!player.storage.kotori_huazhan2) player.storage.kotori_huazhan2=[];
player.storage.kotori_huazhan2.push(name);
player.addTempSkill('kotori_huazhan2');
player.popup('花绽',get.groupnature(name.slice(12)));
game.log(player,'发动了技能',lib.translate[name].replace(/魔物/g,'【花绽】'));
player.removeMark(name,1,false);
;game.log(player,'移去了一个',lib.translate[name].replace(/魔物/g,'【魔物】'));
},
}
}
},
ai:{
order:1,
result:{
player:function(player){
if(player.countCards('he',function(card){
if(get.type(card,player)=='equip') return get.value(card)<6;
return get.value(card)<5;
})<2) return 0;
return player.getUseValue({name:'kaihua'});
},
},
},
},
kotori_huazhan2:{onremove:true},
ryoichi_baoyi:{
trigger:{
player:'loseAfter',
global:['gainAfter','equipAfter','addJudgeAfter','loseAsyncAfter','addToExpansionAfter'],
},
filterTarget:function(card,player,target){
return target!=player&&(target.hasSex('female')||target.countCards('hej')>0);
},
filter:function(event,player){
var evt=event.getl(player);
return evt&&evt.es&&evt.es.length>0&&game.hasPlayer(function(target){
return lib.skill.ryoichi_baoyi.filterTarget;
});
},
forced:true,
content:function(){
'step 0'
event.count=trigger.getl(player).es.length;
player.draw(event.count);
'step 1'
event.count--;
if(game.hasPlayer(function(target){
return lib.skill.ryoichi_baoyi.filterTarget(null,player,target);
})){
player.chooseTarget(true,lib.skill.ryoichi_baoyi.filterTarget,'请选择【爆衣】的目标').set('ai',function(target){
return -get.attitude(_status.event.player,target);
});
}
else event.finish();
'step 2'
if(result.bool&&result.targets&&result.targets.length){
var target=result.targets[0];
player.line(target,'green');
if(target.hasSex('female')) target.loseHp();
else player.discardPlayerCard(target,2,'hej',true);
}
else event.finish();
'step 3'
if(event.count&&game.hasPlayer(function(target){
return lib.skill.ryoichi_baoyi.filterTarget(null,player,target);
})) event.goto(1);
},
},
ryoichi_tuipi:{
mod:{
targetEnabled:function(card){
if(card.name=='shunshou'||card.name=='guohe') return false;
},
},
trigger:{player:'phaseDiscardBegin'},
forced:true,
content:function(){
trigger.setContent(lib.skill.ryoichi_tuipi.phaseDiscardContent);
},
phaseDiscardContent:function(){
"step 0"
var num=0;
var hs=player.getCards('he');
num+=hs.length;
for(var i=0;i0) return false;
if(event.player.hasJudge('lebu')||!event.player.needsToDiscard()) return false;
return true;
},
logTarget:'player',
content:function(){
'step 0'
player.turnOver();
'step 1'
if(player.isTurnedOver()){
player.addTempSkill('yuu_lveduo4','roundStart')
if(!player.storage.yuu_lveduo) player.storage.yuu_lveduo=[];
player.storage.yuu_lveduo.push(trigger.player);
trigger.player._trueMe=player;
game.addGlobalSkill('autoswap');
if(trigger.player==game.me){
game.notMe=true;
if(!_status.auto) ui.click.auto();
}
player.addSkill('yuu_lveduo2');
trigger.player.addSkill('yuu_lveduo3');
}
},
},
yuu_lveduo2:{
trigger:{
player:'turnOverEnd',
},
lastDo:true,
charlotte:true,
forceDie:true,
forced:true,
silent:true,
filter:function(event,player){
return !player.isTurnedOver();
},
content:function(){
var target=game.findPlayer(function(current){
return current._trueMe==player;
});
if(target){
if(target==game.me){
if(!game.notMe) game.swapPlayerAuto(target._trueMe)
else delete game.notMe;
if(_status.auto) ui.click.auto();
}
delete target._trueMe;
target.removeSkill('yuu_lveduo3');
var skills=target.getStockSkills(true,true).filter(function(skill){
var info=get.info(skill);
return info&&info.charlotte==true;
});
if(skills.length){
target.removeSkill(skills);
player.addSkill(skills);
lib.translate.yuu_lveduo_info=lib.translate.yuu_lveduo_full_info;
}
if(target.name=='key_yusa'){
delete target.storage.dualside;
target.storage.dualside_over=true;
target.unmarkSkill('dualside');
target.removeSkill('dualside');
}
else if(target.name=='key_misa'){
delete target.storage.dualside;
target.storage.dualside_over=true;
target.unmarkSkill('dualside');
target.reinit('key_misa','key_yusa');
target.removeSkill('yusa_misa');
target.removeSkill('dualside');
target.turnOver(false);
}
}
player.removeSkill('yuu_lveduo2');
},
},
yuu_lveduo3:{
trigger:{
player:['phaseAfter','dieAfter'],
global:'phaseBefore',
},
lastDo:true,
charlotte:true,
forceDie:true,
forced:true,
silent:true,
content:function(){
player.removeSkill('yuu_lveduo3');
},
onremove:function(player){
if(player._trueMe&&player._trueMe.isTurnedOver()) player._trueMe.turnOver();
},
},
yuu_lveduo4:{charlotte:true},
godan_yuanyi:{
trigger:{player:'phaseBegin'},
forced:true,
content:function(){
'step 0'
var num=game.roundNumber;
if(num&&typeof num=='number') player.draw(Math.min(3,num));
'step 1'
var next=player.phaseUse();
event.next.remove(next);
trigger.next.push(next);
},
},
godan_feiqu:{
inherit:'doruji_feiqu',
},
godan_xiaoyuan:{
trigger:{player:'changeHp'},
forced:true,
juexingji:true,
skillAnimation:true,
animationColor:'soil',
filter:function(event,player){
return event.num<0&&player.hp<4;
},
content:function(){
player.awakenSkill('godan_xiaoyuan');
player.loseMaxHp(3);
player.draw(3);
player.removeSkill('godan_feiqu');
},
},
abyusa_jueqing:{
audio:2,
trigger:{source:'damageBegin2'},
skillAnimation:true,
animationColor:'water',
filter:function(event,player){
return player!=event.player&&!player.storage.abyusa_jueqing_rewrite;
},
prompt2:function(event,player){
var num=get.cnNumber(2*event.num,true);
return '令即将对其造成的伤害翻倍至'+num+'点,并令自己失去'+get.cnNumber(event.num)+'点体力';
},
check:function(event,player){
return player.hp>event.num&&event.player.hp>event.num&&!event.player.hasSkillTag('filterDamage',null,{
player:player,
card:event.card,
})&&get.attitude(player,event.player)<0;
},
locked:function(skill,player){
return player&&player.storage.abyusa_jueqing_rewrite;
},
logTarget:'player',
content:function(){
player.loseHp(trigger.num);
trigger.num*=2;
player.storage.abyusa_jueqing_rewrite=true;
},
derivation:'abyusa_jueqing_rewrite',
group:'abyusa_jueqing_rewrite',
subSkill:{
rewrite:{
trigger:{source:'damageBefore'},
forced:true,
charlotte:true,
audio:'abyusa_jueqing',
filter:function(event,player){
return player.storage.abyusa_jueqing_rewrite==true;
},
check:function(){return false;},
content:function(){
trigger.cancel();
trigger.player.loseHp(trigger.num);
},
ai:{
jueqing:true,
skillTagFilter:function(player){
return player.storage.abyusa_jueqing_rewrite==true;
},
}
}
},
},
akiko_dongcha:{
trigger:{global:'phaseBefore'},
forced:true,
filter:function(event,player){
return get.mode()=='identity'&&game.phaseNumber==0;
},
content:function(){
var func=function(){
game.countPlayer(function(current){
current.setIdentity();
});
};
if(player==game.me) func();
else if(player.isOnline()) player.send(func);
if(!player.storage.zhibi) player.storage.zhibi=[];
player.storage.zhibi.addArray(game.players);
},
ai:{
viewHandcard:true,
skillTagFilter:function(player,tag,arg){
if(player==arg) return false;
},
},
},
abyusa_dunying:{
trigger:{player:['phaseZhunbeiBegin','phaseJieshuBegin']},
forced:true,
filter:function(event,player){
return player.isDamaged();
},
content:function(){
player.draw(player.getDamagedHp());
},
mod:{
globalTo:function(from,to,num){
return num+to.getDamagedHp();
},
},
},
kaori_siyuan:{
enable:'phaseUse',
filter:function(event,player){
return player.countCards('he',lib.skill.kaori_siyuan.filterCard);
},
filterCard:function(card){
return ['equip','delay'].contains(get.type(card,false));
},
filterTarget:function(card,player,target){
if(player==target) return false;
var card=ui.selected.cards[0];
if(get.type(card,false)=='delay') return target.canAddJudge({name:card.name});
return target.isEmpty(get.subtype(card,false));
},
discard:false,
lose:false,
prepare:'give',
content:function(){
'step 0'
var card=cards[0];
if(get.type(card,false)=='equip') target.equip(card);
else target.addJudge(card);
'step 1'
var list=[];
for(var i of lib.inpile){
var type=get.type(i);
if(type=='basic'||type=='trick') list.push([type,'',i]);
if(i=='sha'){
for(var j of lib.inpile_nature) list.push([type,'',i,j]);
}
}
player.chooseButton(['是否视为使用一张基本牌或普通锦囊牌?',[list,'vcard']]).set('filterButton',function(button){
return player.hasUseTarget({name:button.link[2],nature:button.link[3],isCard:true});
}).set('ai',function(button){
return player.getUseValue({name:button.link[2],nature:button.link[3],isCard:true});
});
'step 2'
if(result.bool){
player.chooseUseTarget(true,{name:result.links[0][2],nature:result.links[0][3],isCard:true});
}
},
ai:{
basic:{
order:10
},
result:{
target:function(player,target){
var card=ui.selected.cards[0];
if(card) return get.effect(target,card,target,target);
return 0;
},
},
}
},
shiori_huijuan:{
trigger:{global:'phaseJieshuBegin'},
direct:true,
locked:true,
filter:function(event,player){
return event.player!=player&&event.player.getHistory('useCard',function(evt){
return evt.isPhaseUsing()&&['basic','trick'].contains(get.type(evt.card))&&player.hasUseTarget({
name:evt.card.name,
nature:evt.card.nature,
isCard:true,
});
}).length>0;
},
content:function(){
'step 0'
var list=[];
trigger.player.getHistory('useCard',function(evt){
if(!evt.isPhaseUsing()||!['basic','trick'].contains(get.type(evt.card))) return;
if(evt.card.name=='sha'&&evt.card.nature) list.add('sha:'+evt.card.nature);
else list.add(evt.card.name);
});
for(var i=0;i=0){
if(stat[i].isMe) break;
if(stat[i].skill&&stat[i].skill.shiori_huijuan) num++;
}
return num>=Math.max(2,game.countPlayer()/2);
},
forced:true,
content:function(){
'step 0'
if(!player.countDiscardableCards(player,'ej')) event._result={bool:false};
else player.discardPlayerCard(player,'ej').set('ai',function(button){
var card=button.link;
var player=_status.event.player;
if(get.position(card)=='j') return 7+Math.random();
return 4+player.needsToDiscard()-get.value(card);
});
'step 1'
if(!result.bool) player.skip('phaseUse');
},
},
miki_shenqiang:{
trigger:{
global:'phaseBefore',
player:'enterGame',
},
forced:true,
filter:function(event,player){
return (event.name!='phase'||game.phaseNumber==0);
},
content:function(){
player.equip(game.createCard2('miki_hydrogladiator','club',6));
player.equip(game.createCard2('miki_binoculars','diamond',6));
},
mod:{
canBeDiscarded:function(card){
if(get.position(card)=='e'&&['equip1','equip5'].contains(get.subtype(card))) return false;
},
},
},
miki_huanmeng:{
inherit:'kamome_huanmeng',
},
miki_zhiluo:{
trigger:{global:'phaseEnd'},
filter:function(event,player){
return !event.player.countCards('e')&&player.inRange(event.player);
},
direct:true,
locked:true,
content:function(){
'step 0'
if(!player.canUse('sha',trigger.player,false)) event._result={index:0};
else player.chooseControl().set('prompt','制裸:请选择一项').set('choiceList',[
'摸一张牌',
'视为对'+get.translation(trigger.player)+'使用一张【杀】',
]).set('ai',function(){
if(get.effect(_status.event.getTrigger().player,{name:'sha'},_status.event.player)>0) return 1;
return 0;
});
'step 1'
if(result.index==0){
player.logSkill('miki_zhiluo');
player.draw();
}
else player.useCard({name:'sha',isCard:true},trigger.player,'miki_zhiluo');
},
},
miki_hydrogladiator_skill:{
trigger:{
source:'damageSource',
},
direct:true,
locked:true,
popup:'海德洛',
filter:function(event,player){
return event.getParent().name=='sha'&&game.hasPlayer(function(current){
return (current==event.player||current!=player&&get.distance(current,event.player)<=1)&¤t.countDiscardableCards(player,'he')>0;
});
},
content:function(){
'step 0'
var list=[];
var choiceList=[];
if(trigger.player.countDiscardableCards(player,'he')>0){
list.push(true);
choiceList.push('弃置'+get.translation(trigger.player)+'的两张牌');
}
if(game.hasPlayer(function(current){
return current!=player&&get.distance(current,trigger.player)<=1;
})){
list.push(false);
choiceList.push('弃置所有至'+get.translation(trigger.player)+'距离为1的角色的各一张牌');
}
event.list=list;
if(list.length==1) event._result={index:0};
else{
player.chooseControl().set('choiceList',choiceList).set('prompt','海德洛格拉迪尔特·改').set('ai',function(){
var player=_status.event.player;
var source=_status.event.getTrigger().player;
var num=game.countPlayer(function(current){
if(current!=player&&get.distance(current,source)<=1&¤t.countDiscardableCards(player,'he')>0) return -get.sgn(get.attitude(player,current));
});
if(num>Math.min(2,source.countDiscardableCards(player,'he'))) return 1;
return 0;
});
}
'step 1'
if(event.list[result.index]){
player.logSkill(['miki_hydrogladiator_skill','海德洛'],trigger.player);
player.discardPlayerCard(trigger.player,'he',2,true);
event.finish();
}
else{
event.targets=game.filterPlayer(function(current){
return current!=player&&get.distance(current,trigger.player)<=1;
}).sortBySeat();
player.logSkill(['miki_hydrogladiator_skill','海德洛'],event.targets);
}
'step 2'
var target=targets.shift();
if(target.countDiscardableCards(player,'he')>0) player.discardPlayerCard(target,'he',true);
if(targets.length) event.redo();
},
},
miki_binoculars:{
locked:true,
ai:{
viewHandcard:true,
skillTagFilter:function(player,tag,arg){
if(player==arg) return false;
},
},
},
kud_qiaoshou:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return !player.getExpansions('kud_qiaoshou_equip').length&&player.countCards('h')>0;
},
chooseButton:{
dialog:function(){
var list=[];
var list2=['pyzhuren_heart','pyzhuren_diamond','pyzhuren_club','pyzhuren_spade','pyzhuren_shandian','rewrite_zhuge'];
list2.addArray(lib.inpile);
for(var i of list2){
var sub=get.subtype(i);
if(['equip1','equip4'].contains(sub)) list.push([sub,'',i]);
}
return ui.create.dialog('巧手:选择一种装备牌',[list,'vcard'],'hidden');
},
check:function(button){
var player=_status.event.player;
var name=button.link[2];
if(get.subtype(name)=='equip4'||player.getEquip(name)) return 0;
var sha=player.countCards('h','sha');
switch(name){
case 'rewrite_zhuge':
return sha-player.getCardUsable('sha');
case 'guding':
if(sha>0&&game.hasPlayer(function(current){
return get.attitude(player,current)<0&&!current.countCards('h')&&player.canUse('sha',current)&&get.effect(current,{name:'sha'},player)>0;
})) return 1.4+Math.random();
return 0;
case 'guanshi':
if(sha>0) return 0.7+Math.random();
return 0;
case 'qinggang':
if(sha>0) return 0.4+Math.random();
return 0;
case 'zhuque':
if(game.hasPlayer(function(current){
return get.attitude(player,current)<0&¤t.getEquip('tengjia')&&get.effect(current,{name:'sha',nature:'fire'},player)>0;
})) return 1.2+Math.random();
return 0;
default: return 0;
}
},
backup:function(links){
var next=get.copy(lib.skill.kud_qiaoshou_backupx);
next.cardname=links[0][2];
return next;
},
prompt:function(links){
return '将一张手牌置于武将牌上,然后视为装备'+get.translation(links[0][2]);
},
},
group:'kud_qiaoshou_end',
ai:{
notemp:true,
order:5,
result:{
player:1,
},
},
},
kud_qiaoshou_backupx:{
filterCard:true,
discard:false,
lose:false,
delay:false,
check:function(event,player){
return 6-get.value(card);
},
content:function(){
'step 0'
player.addToExpansion(cards,player,'give').gaintag.add('kud_qiaoshou_equip');
'step 1'
if(!player.getExpansions('kud_qiaoshou_equip').length) return;
player.addTempSkill('kud_qiaoshou_equip',{player:['phaseUseEnd','phaseZhunbeiBegin']});
var name=lib.skill.kud_qiaoshou_backup.cardname;
player.storage.kud_qiaoshou_equip2=name;
var info=lib.card[name].skills;
if(info&&info.length) player.addAdditionalSkill('kud_qiaoshou_equip',info);
player.draw();
game.log(player,'声明了','#y'+get.translation(name));
},
ai:{
result:{
player:1,
},
},
},
kud_qiaoshou_equip:{
charlotte:true,
mod:{
globalFrom:function(from,to,distance){
var info=lib.card[from.storage.kud_qiaoshou_equip2];
if(info&&info.distance&&info.distance.globalFrom) return distance+info.distance.globalFrom;
},
globalTo:function(from,to,distance){
var info=lib.card[to.storage.kud_qiaoshou_equip2];
if(info&&info.distance&&info.distance.globalTo) return distance+info.distance.globalTo;
},
attackRange:function(from,distance){
var info=lib.card[from.storage.kud_qiaoshou_equip2];
if(info&&info.distance&&info.distance.attackFrom) return distance-info.distance.attackFrom;
},
attackTo:function(from,to,distance){
var info=lib.card[to.storage.kud_qiaoshou_equip2];
if(info&&info.distance&&info.distance.attackTo) return distance+info.distance.attackTo;
},
},
onremove:function(player,skill){
var cards=player.getExpansions(skill);
if(cards.length) player.loseToDiscardpile(cards);
},
intro:{
markcount:'expansion',
mark:function(dialog,storage,player){
dialog.add(player.getExpansions('kud_qiaoshou_equip'));
dialog.addText('当前装备:'+get.translation(player.storage.kud_qiaoshou_equip2));
var str2=lib.translate[player.storage.kud_qiaoshou_equip2+'_info'];
if(str2){
if(str2.length>=12) dialog.addText(str2,false);
else dialog.addText(str2);
}
},
onunmark:function(storage,player){
player.removeAdditionalSkill('kud_qiaoshou_equip');
delete player.storage.kud_qiaoshou_equip2;
player.addEquipTrigger();
},
},
},
kud_qiaoshou_end:{
trigger:{player:'phaseJieshuBegin'},
direct:true,
filter:function(event,player){
return player.countCards('h')>0&&!player.getExpansions('kud_qiaoshou_equip').length;
},
content:function(){
'step 0'
var list=[];
var list2=['rewrite_bagua','rewrite_renwang','rewrite_tengjia','rewrite_baiyin'];
list2.addArray(lib.inpile);
for(var i of list2){
var sub=get.subtype(i);
if(['equip2','equip3'].contains(sub)) list.push([sub,'',i]);
}
player.chooseButton([get.prompt('kud_qiaoshou'),[list,'vcard']]).set('ai',function(button){
var player=_status.event.player;
var name=button.link[2];
if(get.subtype(name)=='equip3'||player.getEquip(name)) return false;
switch(name){
case 'yexingyi':
if(player.hp>2||player.getEquip('bagua')||player.getEquip('tengjia')) return 1.5+Math.random();
return 0.5+Math.random();
case 'rewrite_bagua':case 'rewrite_renwang':
if(player.getEquip('bagua')||player.getEquip('tengjia')||player.getEquip('renwang')) return Math.random();
return 1.2+Math.random();
case 'rewrite_tengjia':
if(player.getEquip('baiyin')) return 1.3+Math.random();
return Math.random();
case 'rewrite_baiyin':
return 0.4+Math.random();
default: return 0;
}
});
'step 1'
if(result.bool){
player.logSkill('kud_qiaoshou');
event.cardname=result.links[0][2];
player.chooseCard('h',true,'将一张手牌置于武将牌上,然后视为装备'+get.translation(event.cardname));
}
else event.finish();
'step 2'
var cards=result.cards;
player.addToExpansion(cards,player,'give').gaintag.add('kud_qiaoshou_equip');
'step 3'
if(!player.getExpansions('kud_qiaoshou_equip').length) return;
player.addTempSkill('kud_qiaoshou_equip',{player:['phaseUseEnd','phaseZhunbeiBegin']});
var name=event.cardname;
player.storage.kud_qiaoshou_equip2=name;
player.markAuto('kud_qiaoshou_equip',cards);
var info=lib.card[name].skills;
if(info&&info.length) player.addAdditionalSkill('kud_qiaoshou_equip',info);
player.draw();
game.log(player,'声明了','#y'+get.translation(name));
},
},
kud_buhui:{
enable:'chooseToUse',
filter:function(event,player){
return event.type=='dying'&&player==event.dying&&(player.getExpansions('kud_qiaoshou_equip').length+player.countCards('e'))>0;
},
skillAnimation:true,
limited:true,
animationColor:'gray',
content:function(){
'step 0'
player.awakenSkill('kud_buhui');
var cards=player.getCards('e').concat(player.getExpansions('kud_qiaoshou_equip'));
if(cards.length) player.discard(cards);
player.removeSkill('kud_qiaoshou_equip');
player.draw(cards.length);
player.addSkill('kud_chongzhen');
'step 1'
var num=2-player.hp;
if(num) player.recover(num);
},
derivation:'riki_chongzhen',
ai:{
order:0.5,
result:{
player:1,
},
save:true,
skillTagFilter:function(player,tag,target){
return player==target;
},
},
},
kud_chongzhen:{
inherit:'riki_chongzhen',
},
misuzu_hengzhou:{
trigger:{player:['phaseJieshuBegin','recoverEnd','damageEnd','phaseDrawBegin2','phaseZhunbeiBegin']},
forced:true,
character:true,
filter:function(event,player){
if(event.name=='phaseZhunbei') return true;
if(['damage','recover'].contains(event.name)) return event.num>0;
var num=player.countMark('misuzu_hengzhou');
if(event.name=='phaseDraw') return num>0&&!event.numFixed;
return num>3;
},
content:function(){
var num=player.countMark('misuzu_hengzhou');
if(trigger.name=='phaseDraw') trigger.num+=num;
else if(trigger.name=='phaseJieshu'){
player.removeMark('misuzu_hengzhou',num);
player.loseHp();
}
else player.addMark('misuzu_hengzhou',trigger.num||1);
},
intro:{
name:'诅咒',
name2:'诅咒',
content:'mark',
},
marktext:'诅',
mod:{
maxHandcard:function(player,num){
return num+player.countMark('misuzu_hengzhou');
},
},
ai:{
notemp:true,
},
},
misuzu_nongyin:{
enable:'chooseToUse',
viewAs:{
name:'tao',
isCard:true,
},
viewAsFilter:function(player){
return !player.hasJudge('lebu')&&player.countCards('hes',function(card){
return get.color(card)=='red'&&get.type(card,'trick')!='trick';
});
},
filterCard:function(card){
return get.color(card)=='red'&&get.type(card,'trick')!='trick';
},
check:function(card){
return 7+(_status.event.dying||_status.event.player).getDamagedHp()-get.value(card);
},
ignoreMod:true,
position:'hes',
precontent:function(){
player.logSkill('misuzu_nongyin');
player.$throw(event.result.cards);
player.addJudge({name:'lebu'},event.result.cards);
event.result.card.cards=[];
event.result.cards=[];
delete event.result.skill;
delete event.result.card.suit;
delete event.result.card.number;
},
ai:{
result:0.5,
},
},
misuzu_zhongxing:{
trigger:{
player:'loseAfter',
global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
},
direct:true,
filter:function(event,player){
var evt=event.getl(player);
return evt&&evt.js&&evt.js.length>0&&!player.hasSkill('misuzu_zhongxing_haruko');
},
content:function(){
'step 0'
player.chooseTarget(get.prompt('misuzu_zhongxing'),'令一名角色选择摸两张牌或回复1点体力').set('ai',function(card){
return get.attitude(_status.event.player,card);
});
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('misuzu_zhongxing',target);
player.addTempSkill('misuzu_zhongxing_haruko');
target.chooseDrawRecover(2,true);
}
},
},
misuzu_zhongxing_haruko:{charlotte:true},
kamome_suitcase:{
trigger:{player:['phaseJudgeBefore','phaseDiscardBefore','turnOverBefore']},
forced:true,
popup:false,
equipSkill:true,
content:function(){
trigger.cancel();
},
},
kamome_yangfan:{
trigger:{
player:['loseAfter','enterGame'],
global:['equipAfter','addJudgeAfter','phaseBefore','gainAfter','loseAsyncAfter','addToExpansionAfter'],
},
forced:true,
filter:function(event,player){
if(typeof event.getl!='function') return (event.name!='phase'||game.phaseNumber==0);
var evt=event.getl(player);
return evt&&evt.player==player&&evt.es&&evt.es.length;
},
content:function(){
if(trigger.getl) player.draw(2*trigger.getl(player).es.length);
else player.equip(game.createCard2('kamome_suitcase','spade',1));
},
ai:{
noe:true,
reverseEquip:true,
effect:{
target:function(card,player,target,current){
if(get.type(card)=='equip'&&!get.cardtag(card,'gifts')) return [1,3];
}
}
}
},
kamome_huanmeng:{
trigger:{player:'phaseZhunbeiBegin'},
frequent:true,
content:function(){
"step 0"
var num=1+player.countCards('e');
var cards=get.cards(num);
game.cardsGotoOrdering(cards);
var next=player.chooseToMove();
next.set('list',[
['牌堆顶',cards],
['牌堆底'],
]);
next.set('prompt','幻梦:点击将牌移动到牌堆顶或牌堆底');
next.processAI=function(list){
var cards=list[0][1],player=_status.event.player;
var top=[];
var judges=player.getCards('j');
var stopped=false;
if(!player.hasWuxie()){
for(var i=0;i=num&&!player.hasSkill('kamome_jieban_phase');
},
content:function(){
'step 0'
event.num=player.storage.kamome_jieban?1:2;
player.chooseCardTarget({
position:'he',
filterCard:true,
filterTarget:lib.filter.notMe,
selectCard:event.num,
prompt:get.prompt('kamome_jieban'),
prompt2:event.num==2?'将两张牌交给一名其他角色,然后其交给你一张牌。':'将一张牌交给一名其他角色,然后其交给你两张牌。',
ai1:function(card){
if(card.name=='du') return 20;
var val=get.value(card);
var player=_status.event.player;
if(get.position(card)=='e'){
if(val<=0) return 10;
return 10/val;
}
return 6-val;
},
ai2:function(target){
var player=_status.event.player;
var att=get.attitude(player,target);
if(ui.selected.cards[0].name=='du') return -2*att;
if(att>0) return 1.5*att;
var num=get.select(_status.event.selectCard)[1];
if(att<0&&num==1) return -0.7*att;
return att;
},
});
'step 1'
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('kamome_jieban',target);
player.addTempSkill('kamome_jieban_phase');
player.give(result.cards,target);
player.changeZhuanhuanji('kamome_jieban');
}
else event.finish();
'step 2'
var num=3-event.num;
var hs=target.getCards('he');
if(hs.length){
if(hs.length<=num) event._result={bool:true,cards:hs};
else{
target.chooseCard('he',true,'交给'+get.translation(player)+get.cnNumber(num)+'张牌',num).set('ai',function(card){
var player=_status.event.player;
var target=_status.event.getParent().player;
if(get.attitude(player,target)>0){
if(!target.hasShan()&&card.name=='shan') return 10;
if(get.type(card)=='equip'&&!get.cardtag(card,'gifts')&&target.hasUseTarget(card)) return 10-get.value(card);
return 6-get.value(card);
}
return -get.value(card);
});
}
}
else event.finish();
'step 3'
target.give(result.cards,player);
},
},
kamome_jieban_phase:{charlotte:true},
nao_duyin:{
trigger:{global:'phaseBegin'},
filter:function(event,player){
return event.player!=player&&(!player.storage.nao_duyin||!player.storage.nao_duyin.contains(event.player));
},
logTarget:'player',
charlotte:true,
check:function(){
return false;
},
content:function(){
'step 0'
player.chooseToDiscard('he','弃置一张牌,或将武将牌翻面').set('ai',function(card){
if(_status.event.player.isTurnedOver()) return 0;
return 6-get.value(card);
});
'step 1'
if(!result.bool) player.turnOver();
player.addTempSkill('nao_duyin2',{player:'phaseAfter'});
if(!player.storage.nao_duyin) player.storage.nao_duyin=[];
player.storage.nao_duyin.push(trigger.player);
if(!player.storage.nao_duyin2) player.storage.nao_duyin2=[];
player.storage.nao_duyin2.push(trigger.player);
player.markSkill('nao_duyin2');
},
},
nao_duyin2:{
intro:{
content:'$不能使用牌指定你为目标,对$使用牌没有距离和次数限制',
},
mod:{
targetEnabled:function(card,player,target){
if(target.storage.nao_duyin2&&target.storage.nao_duyin2.contains(player)) return false;
},
targetInRange:function(card,player,target){
if(player.storage.nao_duyin2&&player.storage.nao_duyin2.contains(target)) return true;
},
},
trigger:{player:'useCardEnd'},
firstDo:true,
silent:true,
onremove:true,
filter:function(event,player){
if(player.storage.nao_duyin2){
for(var i of player.storage.nao_duyin2){
if(event.targets.contains(i)) return true;
}
}
return false;
},
content:function(){
if(trigger.addCount!==false){
trigger.addCount=false;
var stat=player.getStat();
if(stat&&stat.card&&stat.card[trigger.card.name]) stat.card[trigger.card.name]--;
}
},
},
nao_wanxin:{
trigger:{global:'phaseEnd'},
hasHistory:function(player){
return player.getHistory('damage').length>0;
},
filter:function(event,player){
return game.hasPlayer(function(current){
return lib.skill.nao_wanxin.hasHistory(current);
});
},
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt2('nao_wanxin'),function(card,player,target){
return _status.event.yuus.contains(target);
}).set('yuus',game.filterPlayer(function(current){
return lib.skill.nao_wanxin.hasHistory(current);
})).set('ai',function(target){
return get.attitude(_status.event.player,target);
});
'step 1'
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('nao_wanxin',target);
target.draw(2);
}
else event.finish();
'step 2'
player.turnOver(false);
'step 3'
player.link(false);
if(target==player) event.finish();
'step 4'
target.turnOver(false);
'step 5'
target.link(false);
},
},
nao_shouqing:{
global:'nao_shouqing2',
},
nao_shouqing2:{
enable:'phaseUse',
viewAs:function(){
return {name:'tao'}
},
filterCard:{name:'tao'},
ignoreMod:true,
filterTarget:function(card,player,target){
return target!=player&&target.isDamaged()&&target.hasSkill('nao_shouqing');
},
selectTarget:function(){
return game.countPlayer(function(current){
return lib.skill.nao_shouqing2.filterTarget(null,_status.event.player,current);
})>1?1:-1;
},
filter:function(event,player){
return player.countCards('hs','tao')&&game.hasPlayer(function(current){
return lib.skill.nao_shouqing2.filterTarget(null,player,current)
});
},
position:'hs',
onuse:function(links,player){
player.addSkill('nao_shouqing3');
player.addMark('nao_shouqing3',1,false);
},
prompt:function(){
var list=game.filterPlayer(function(current){
return lib.skill.nao_shouqing2.filterTarget(null,_status.event.player,current);
});
var str='对'+get.translation(list);
if(list.length>1) str+='中的一名角色';
str+='使用一张【桃】';
return str;
},
},
nao_shouqing3:{
intro:{
content:'手牌上限+#',
},
mod:{
maxHandcard:function(player,num){
return num+player.countMark('nao_shouqing3');
},
},
trigger:{player:'useCardAfter'},
forced:true,
popup:false,
filter:function(event,player){
return event.skill=='nao_shouqing2';
},
content:function(){
player.draw();
},
},
shiorimiyuki_banyin:{
trigger:{player:['damageEnd','recoverEnd']},
direct:true,
filter:function(event,player){
return game.hasPlayer(function(current){
return current!=player&¤t.isDamaged();
})
},
content:function(){
'step 0'
player.chooseTarget(get.prompt('shiorimiyuki_banyin'),'令一名其他角色回复1点体力',lib.filter.notMe).set('ai',function(target){
var player=_status.event.player;
return get.recoverEffect(target,player,player);
});
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('shiorimiyuki_banyin',target);
target.recover();
}
},
},
shiorimiyuki_tingxian:{
trigger:{player:'phaseUseBegin'},
direct:true,
content:function(){
'step 0'
player.chooseControl('一张','两张','三张','cancel2').set('prompt',get.prompt2('shiorimiyuki_tingxian')).set('ai',function(){
var player=_status.event.player;
var max=Math.min(player.hp+1,player.maxHp)
var min=Math.min(Math.max(max-2,max-player.hp),3);
if(min) return min-1;
return 3;
});
'step 1'
if(result.control=='cancel2') return;
player.logSkill('shiorimiyuki_tingxian');
var num=1+result.index;
player.draw(num).gaintag=['shiorimiyuki_tingxian'];
player.recover();
player.addTempSkill('shiorimiyuki_tingxian2');
},
},
shiorimiyuki_tingxian2:{
trigger:{player:'phaseUseEnd'},
forced:true,
charlotte:true,
mod:{
aiOrder:function(player,card,num){
if(get.itemtype(card)=='card'&&card.hasGaintag('shiorimiyuki_tingxian')) return num+2;
},
aiValue:function(player,card,num){
if(get.itemtype(card)=='card'&&card.hasGaintag('shiorimiyuki_tingxian')) return 0;
},
},
filter:function(event,player){
return player.countCards('h',function(card){
return card.hasGaintag('shiorimiyuki_tingxian');
})>0;
},
content:function(){
player.loseHp(player.countCards('h',function(card){
return card.hasGaintag('shiorimiyuki_tingxian');
}));
player.removeGaintag('shiorimiyuki_tingxian');
},
},
shizuru_nianli:{
enable:'chooseToUse',
charlotte:true,
prompt:'展示一张♦/♣/♥/♠手牌,然后视为使用一张雷杀/闪/桃/无懈可击',
viewAs:function(cards,player){
var name=false;
var nature=null;
switch(get.suit(cards[0],player)){
case 'club':name='shan';break;
case 'diamond':name='sha';nature='thunder';break;
case 'spade':name='wuxie';break;
case 'heart':name='tao';break;
}
if(name) return {name:name,nature:nature,isCard:true};
return null;
},
check:function(card){
var player=_status.event.player;
if(_status.event.type=='phase'){
var max=0;
var name2;
var list=['sha','tao'];
var map={sha:'diamond',tao:'heart'}
for(var i=0;i0&&player.getUseValue({name:name,nature:name=='sha'?'fire':null})>0){
var temp=get.order({name:name,nature:name=='sha'?'fire':null});
if(temp>max){
max=temp;
name2=map[name];
}
}
}
if(name2==get.suit(card,player)) return 1;
return 0;
}
return 1;
},
ignoreMod:true,
filterCard:function(card,player,event){
event=event||_status.event;
var filter=event._backup.filterCard;
var name=get.suit(card,player);
if(name=='club'&&filter({name:'shan'},player,event)) return true;
if(name=='diamond'&&filter({name:'sha',nature:'thunder'},player,event)) return true;
if(name=='spade'&&filter({name:'wuxie'},player,event)) return true;
if(name=='heart'&&filter({name:'tao'},player,event)) return true;
return false;
},
filter:function(event,player){
if(player.hasSkill('shizuru_nianli_round')) return false;
var filter=event.filterCard;
if(filter({name:'sha',nature:'thunder'},player,event)&&player.countCards('h',{suit:'diamond'})) return true;
if(filter({name:'shan'},player,event)&&player.countCards('h',{suit:'club'})) return true;
if(filter({name:'tao'},player,event)&&player.countCards('h',{suit:'heart'})) return true;
if(filter({name:'wuxie'},player,event)&&player.countCards('h',{suit:'spade'})) return true;
return false;
},
precontent:function(){
player.logSkill('shizuru_nianli');
player.addTempSkill('shizuru_nianli_round','roundStart');
player.showCards(get.translation(player)+'发动了【念力】',event.result.cards.slice(0));
event.result.card.cards=[];
event.result.cards=[];
delete event.result.skill;
delete event.result.card.suit;
delete event.result.card.number;
event.getParent().addCount=false;
event.getParent().shizuru_nianli=true;
},
ai:{
respondSha:true,
respondShan:true,
skillTagFilter:function(player,tag){
if(player.hasSkill('shizuru_nianli_round')) return false;
var name;
switch(tag){
case 'respondSha':name='diamond';break;
case 'respondShan':name='club';break;
case 'save':name='heart';break;
}
if(!player.countCards('h',{suit:name})) return false;
},
order:function(item,player){
if(player&&_status.event.type=='phase'){
var max=0;
var list=['sha','tao'];
var map={sha:'diamond',tao:'heart'}
for(var i=0;i0&&player.getUseValue({name:name,nature:name=='sha'?'thunder':null})>0){
var temp=get.order({name:name,nature:name=='sha'?'thunder':null});
if(temp>max) max=temp;
}
}
max/=1.1;
return max;
}
return 2;
},
},
hiddenCard:function(player,name){
if(name=='wuxie') return player.countCards('h',function(card){
return _status.connectMode||get.suit(card)=='spade';
})>0&&!player.hasSkill('shizuru_nianli_round');
if(name=='tao') return player.countCards('h',{suit:'heart'})>0&&!player.hasSkill('shizuru_nianli_round');
return false;
},
group:'shizuru_nianli_clear',
subSkill:{
round:{
mark:true,
intro:{content:'本轮已发动'},
},
clear:{
trigger:{player:'useCardAfter'},
lastDo:true,
silent:true,
filter:function(event,player){
return event.getParent().shizuru_nianli==true;
},
content:function(){
player.getHistory('useCard').remove(trigger);
},
},
},
},
shizuru_benzhan:{
trigger:{global:['useCard','respond']},
usable:1,
direct:true,
filter:function(event,player){
return Array.isArray(event.respondTo)&&event.respondTo[0]!=event.player&&[event.respondTo[0],event.player].contains(player);
},
content:function(){
'step 0'
event.type=get.type(trigger.card)=='basic';
var prompt=event.type?'令一名角色摸两张牌或弃置两张牌':'令一名角色回复1点体力或对其造成1点伤害';
player.chooseTarget(get.prompt('shizuru_benzhan'),prompt).set('ai',function(target){
var player=_status.event.player;
if(_status.event.getParent().type){
var att=get.attitude(player,target);
if(target.hasSkillTag('nogain')) return -att;
if(target.countCards('he')==1&&att<0) att/=2;
return Math.abs(att)*(1+0.1*(Math.min(0,5-target.countCards('h'))))
}
return Math.max(get.recoverEffect(target,player,player),get.damageEffect(target,player,player))
});
'step 1'
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('shizuru_benzhan',target,'thunder');
var trans=get.translation(target);
var list;
if(event.type){
if(!target.countCards('he')) event._result={index:0};
else list=['令'+trans+'摸两张牌','令'+trans+'弃置两张牌'];
}
else{
if(target.isHealthy()) event._result={index:1};
else list=['令'+trans+'回复1点体力','对'+trans+'造成1点伤害'];
}
player.chooseControl().set('choiceList',list).set('choice',function(){
if(event.type) return (get.attitude(player,target)>0)?0:1;
return (get.recoverEffect(target,player,player)>get.damageEffect(target,player,player))?0:1;
}()).set('ai',function(){
return _status.event.choice;
});
}
else{
player.storage.counttrigger[event.name]--;
event.finish();
}
'step 2'
player.addExpose(0.2);
if(event.type){
if(result.index==0) target.draw(2);
else target.chooseToDiscard(2,'he',true);
}
else{
if(result.index==0) target.recover();
else target.damage();
}
},
},
kyoko_juwu:{
trigger:{global:['loseAfter','cardsDiscardAfter','loseAsyncAfter','equipAfter']},
direct:true,
filter:function(event,player){
if(player==_status.currentPhase) return false;
var cards=event.getd();
if(!cards.length) return false;
cards.removeArray(event.getd(player));
for(var card of cards){
if(get.position(card,true)=='d'&&get.type(card,null,false)=='equip') return true;
}
return false;
},
content:function(){
'step 0'
if(trigger.delay==false) game.delay();
'step 1'
var cards=trigger.getd();
cards.removeArray(trigger.getd(player));
cards=cards.filter(function(card){
if(get.position(card,true)=='d'&&get.type(card,null,false)=='equip') return true;
});
player.chooseButton([get.prompt('kyoko_juwu'),cards],[1,cards.length]).set('ai',function(){return 1});
'step 2'
if(result.bool){
player.gain(result.links,'gain2','log');
player.logSkill('kyoko_juwu');
}
},
},
kyoko_zhengyi:{
group:['kyoko_jingce','kyoko_shelie','kyoko_zhiheng'],
count:function(player){
var list=[];
player.countCards('e',function(card){
list.add(get.suit(card,player));
});
return list.length;
},
},
kyoko_jingce:{
trigger:{player:['phaseUseEnd','phaseJieshuBegin']},
filter:function(event,player){
var num=lib.skill.kyoko_zhengyi.count(player);
if(!num||(event.name=='phaseUse')==(num>3)) return false;
return player.getHistory('useCard',function(evt){
return event.name!='phaseUse'||evt.getParent('phaseUse')==event;
}).length>=player.hp;
},
frequent:true,
content:function(){
'step 0'
if(trigger.name=='phaseUse'){
player.draw(2);
event.finish();
return;
}
var list=[],history=player.getHistory('useCard');
for(var i of history){
list.add(get.suit(i.card));
if(list.length>=player.hp) break;
}
if(list.length>=player.hp) event.goon=true;
else player.chooseControl('摸牌阶段','出牌阶段').set('prompt','精策:选择要执行的额外阶段');
'step 1'
if(event.goon||result.index==0){
var next=player.phaseDraw();
event.next.remove(next);
trigger.getParent().next.push(next);
}
if(event.goon||result.index==1){
var next=player.phaseUse();
event.next.remove(next);
trigger.getParent().next.push(next);
}
},
},
kyoko_shelie:{
audio:2,
trigger:{player:'phaseDrawBegin1'},
filter:function(event,player){
return !event.numFixed&&lib.skill.kyoko_zhengyi.count(player)>1;
},
content:function(){
"step 0"
trigger.changeToZero();
event.cards=get.cards(5);
game.cardsGotoOrdering(event.cards);
event.videoId=lib.status.videoId++;
game.broadcastAll(function(player,id,cards){
var str;
if(player==game.me&&!_status.auto){
str='涉猎:获取花色各不相同的牌';
}
else{
str='涉猎';
}
var dialog=ui.create.dialog(str,cards);
dialog.videoId=id;
},player,event.videoId,event.cards);
event.time=get.utc();
game.addVideo('showCards',player,['涉猎',get.cardsInfo(event.cards)]);
game.addVideo('delay',null,2);
"step 1"
var next=player.chooseButton([0,5],true);
next.set('dialog',event.videoId);
next.set('filterButton',function(button){
for(var i=0;i0){
game.delay(0,time);
}
"step 3"
game.broadcastAll('closeDialog',event.videoId);
var cards2=event.cards2;
player.gain(cards2,'log','gain2');
},
},
kyoko_zhiheng:{
enable:'phaseUse',
usable:1,
position:'he',
filter:function(event,player){
return lib.skill.kyoko_zhengyi.count(player)>2;
},
prompt:function(){
var str='弃置任意张牌并摸等量的牌';
if(lib.skill.kyoko_zhengyi.count(_status.event.player)>3) str+=',若弃置了所有手牌则多摸一张牌。';
return str;
},
filterCard:lib.filter.cardDiscardable,
discard:false,
lose:false,
delay:false,
selectCard:[1,Infinity],
check:function(card){
var player=_status.event.player;
if(get.position(card)=='h'){
return 8-get.value(card);
}
return 6-get.value(card)
},
content:function(){
'step 0'
player.discard(cards);
event.num=1;
var hs=player.getCards('h');
if(!hs.length||lib.skill.kyoko_zhengyi.count(player)<4) event.num=0;
else for(var i=0;i1;
},
content:function(){
player.awakenSkill(event.name);
var num=player.maxHp-player.hp;
player.recover(num);
player.draw(num);
if(_status.characterlist&&_status.characterlist.contains('key_midori')){
player.reinit('key_mio','key_midori',false);
_status.characterlist.remove('key_midori');
_status.characterlist.add('key_mio');
}
},
},
midori_nonghuan:{
enable:'phaseUse',
charlotte:true,
filter:function(event,player){
return (player.getStat('skill').midori_nonghuan||0)0;
},
content:function(){
'step 0'
var stat=player.getStat();
if(!stat.midori_nonghuan) stat.midori_nonghuan=[];
stat.midori_nonghuan.push(target);
player.gainPlayerCard(target,'hej',true);
player.draw();
'step 1'
if(player.countCards('he')>0) player.chooseCard('he',true,'交给'+get.translation(target)+'一张牌');
else event.goto(3);
'step 2'
player.give(result.cards,target);
'step 3'
var history=game.getGlobalHistory('cardMove');
for(var i=0;i1;
},
content:function(){
player.awakenSkill(event.name);
var num=player.maxHp-player.hp;
player.recover(num);
player.draw(num);
if(_status.characterlist&&_status.characterlist.contains('key_mio')){
player.reinit('key_midori','key_mio',false);
_status.characterlist.remove('key_mio');
_status.characterlist.add('key_midori');
}
},
},
kanade_mapo:{
derivation:'mapodoufu',
enable:'chooseToUse',
viewAs:{name:'mapodoufu'},
filterCard:{suit:'heart'},
viewAsFilter:function(player){
return player.countCards('hes',{suit:'heart'})>0;
},
position:'hes',
mod:{
selectTarget:function(card,player,range){
if(card.name=='mapodoufu'&&range[1]!=-1) range[1]++;
},
},
check:function(card){
var player=_status.event.player;
if(game.countPlayer(function(current){
return player.canUse('mapodoufu',current)&&get.effect(current,{name:'mapodoufu'},player,player)>0;
})>1) return 6-get.value(card);
return 4-get.value(card);
},
},
kanade_benzhan:{
trigger:{global:['useCard','respond']},
direct:true,
usable:1,
filter:function(event,player){
return Array.isArray(event.respondTo)&&event.respondTo[0]!=event.player&&[event.respondTo[0],event.player].contains(player);
},
content:function(){
'step 0'
event.type=get.type(trigger.card)=='basic';
var prompt=event.type?'令一名角色摸两张牌或弃置两张牌':'令一名角色回复1点体力或对其造成1点伤害';
player.chooseTarget(get.prompt('kanade_benzhan'),prompt).set('ai',function(target){
var player=_status.event.player;
if(_status.event.getParent().type){
var att=get.attitude(player,target);
if(target.hasSkillTag('nogain')) return -att;
if(target.countCards('he')==1&&att<0) att/=2;
return Math.abs(att)*(1+0.1*(Math.min(0,5-target.countCards('h'))))
}
return Math.max(get.recoverEffect(target,player,player),get.damageEffect(target,player,player))
});
'step 1'
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('kanade_benzhan',target,'thunder');
var trans=get.translation(target);
var list;
if(event.type){
if(!target.countCards('he')) event._result={index:0};
else list=['令'+trans+'摸两张牌','令'+trans+'弃置两张牌'];
}
else{
if(target.isHealthy()) event._result={index:1};
else list=['令'+trans+'回复1点体力','对'+trans+'造成1点伤害'];
}
player.chooseControl().set('choiceList',list).set('choice',function(){
if(event.type) return (get.attitude(player,target)>0)?0:1;
return (get.recoverEffect(target,player,player)>get.damageEffect(target,player,player))?0:1;
}()).set('ai',function(){
return _status.event.choice;
});
}
else{
player.storage.counttrigger[event.name]--;
event.finish();
}
'step 2'
player.addExpose(0.2);
if(event.type){
if(result.index==0) target.draw(2);
else target.chooseToDiscard(2,'he',true);
}
else{
if(result.index==0) target.recover();
else target.damage();
}
},
},
yuzuru_wuxin:{
trigger:{player:'phaseJieshuBegin'},
direct:true,
content:function(){
'step 0'
player.chooseCardTarget({
filterTarget:function(){
if(ui.selected.cards.length) return false;
return true;
},
filterCard:function(){
if(ui.selected.targets.length) return false;
return lib.filter.cardDiscardable.apply(this,arguments);
},
selectTarget:function(){
if(!ui.selected.cards.length) return [1,1];
return [0,0];
},
selectCard:function(){
if(ui.selected.targets.length) return [0,0];
if(!ui.selected.cards.length) return [0,2];
return [2,2];
},
prompt:get.prompt2('yuzuru_wuxin'),
complexCard:true,
complexTarget:true,
ai1:function(card){
var player=_status.event.player;
if(player.hp>3) return 0;
return (player.getDamagedHp()*2)-get.value(card);
},
ai2:function(target){
if(player.hp<4||target.hasSkillTag('nogain')) return 0;
return get.attitude(_status.event.player,target);
},
});
'step 1'
if(result.bool){
if(result.cards.length){
player.logSkill('yuzuru_wuxin');
player.discard(result.cards);
player.recover();
}
else{
var target=result.targets[0];
player.logSkill('yuzuru_wuxin',target,{color:[194,117,92]});
player.loseHp();
target.draw(2);
}
}
},
},
yuzuru_deyi:{
derivation:['yuzuru_kunfen','yuzuru_quji','yuzuru_wangsheng','yuzuru_kunfen_rewrite','yuzuru_quji_rewrite'],
trigger:{global:'dieAfter'},
forced:true,
unique:true,
juexingji:true,
skillAnimation:true,
animationColor:'orange',
content:function(){
player.awakenSkill('yuzuru_deyi');
player.removeSkill('yuzuru_wuxin');
player.addSkillLog('yuzuru_kunfen');
player.addSkillLog('yuzuru_quji');
player.addSkillLog('yuzuru_wangsheng');
player.loseMaxHp();
player.recover();
},
},
yuzuru_kunfen:{
trigger:{player:'phaseJieshuBegin'},
forced:true,
content:function(){
'step 0'
if(!player.storage._yuzuru_sss) player.loseHp();
player.draw(2);
'step 1'
if(player.countCards('he')<2) event.finish();
else{
player.chooseCardTarget({
selectCard:2,
filterTarget:lib.filter.notMe,
prompt:'是否交给一名其他角色两张牌?',
position:'he',
ai1:function(card){
var player=_status.event.player;
if(player.maxHp-player.hp==1&&card.name=='du') return 30;
var check=player.countCards('h')-2;
if(check<1) return 0;
if(player.hp>1&&check<2) return 0;
return get.unuseful(card)+9;
},
ai2:function(target){
var att=get.attitude(_status.event.player,target);
if(ui.selected.cards.length==1&&ui.selected.cards[0].name=='du') return 1-att;
return att-2;
},
});
}
'step 2'
if(result.bool) player.give(result.cards,result.targets[0]);
},
},
yuzuru_quji:{
audio:2,
enable:'phaseUse',
usable:1,
position:'he',
filterCard:true,
selectCard:function(){
var player=_status.event.player;
return player.getDamagedHp();
},
filterTarget:function(card,player,target){
return target!=player&&target.hp0){
player.chooseCardTarget({
selectCard:[1,Infinity],
filterTarget:lib.filter.notMe,
prompt:'将任意张牌交给一名其他角色,或点【取消】。',
position:'he',
ai1:function(card){
var player=_status.event.player;
if(get.suit(card,false)=='heart'&&game.hasPlayer(function(current){
return current.hasSkill('kanade_mapo')&&get.attitude(player,current)>0;
})) return 1;
return 0;
},
ai2:function(kanade){
if(kanade.hasSkill('kanade_mapo')&&get.attitude(_status.event.player,kanade)>0) return 2;
return 0;
},
});
}
else event.goto(2);
'step 1'
if(result.bool) player.give(result.cards,result.targets[0]);
'step 2'
player.loseMaxHp();
'step 3'
if(player.hp<2) player.recover(2-player.hp);
},
},
ao_xishi:{
trigger:{
player:['useCard','respond'],
target:'useCardToTargeted',
},
forced:true,
filter:function(event,player,name){
return (name=='useCard'||name=='respond'||event.player!=player)&&get.suit(event.card)=='diamond';
},
content:function(){player.draw()},
},
ao_kuihun:{
trigger:{global:'dying'},
logTarget:'player',
line:'thunder',
filter:function(event,player){
return player!=event.player;
},
content:function(){
'step 0'
player.draw();
'step 1'
if(!trigger.player.countCards('h')) event.finish();
else player.chooseButton(['选择一张牌作为「蝶」',trigger.player.getCards('h')]).set('ai',function(button){
var val=get.buttonValue(button);
if(get.attitude(_status.event.player,get.owner(button.link))<=0) return 10+val;
if(val<=0) return 20;
if(button.link.name=='tao'||button.link.name=='jiu') return 0;
return 1/val;
});
'step 2'
if(result.bool){
player.addToExpansion(result.links,trigger.player,'give').set('log',false).gaintag.add('ao_diegui');
game.log(result.links,'飞向了',player);
}
},
locked:false,
mod:{
targetInRange:function(card,player){
var list=player.getExpansions('ao_diegui');
for(var i=0;i2;
},
content:function(){
player.awakenSkill('ao_shixin');
player.removeSkill('ao_kuihun');
player.addSkill('ao_diegui');
player.gainMaxHp();
player.recover();
},
},
ao_diegui:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return player.getExpansions('ao_diegui').length>0;
},
chooseButton:{
dialog:function(event,player){
return ui.create.dialog('蝶归',player.getExpansions('ao_diegui'),'hidden');
},
backup:function(links,player){
return {
card:links,
filterCard:function(){return false},
selectCard:-1,
filterTarget:true,
delay:false,
content:lib.skill.ao_diegui.contentx,
line:'thunder',
ai:{
result:{
target:function(player,target){
if(target!=player&&target.hasSkillTag('nogain')) return 0;
var num=1;
if(target.isTurnedOver()) num+=2;
if(target.isLinked()) num+=0.5;
return num;
},
}
},
}
},
prompt:function(links,player){
return '选择一名角色,令其获得'+get.translation(links[0])+',摸两张牌并将武将牌复原。'
},
},
contentx:function(){
'step 0'
player.give(lib.skill.ao_diegui_backup.card,target,'visible');
target.draw(2);
'step 1'
target.link(false);
'step 2'
target.turnOver(false);
},
intro:{
name:'七影蝶',
content:'expansion',
markcount:'expansion',
},
onremove:function(player,skill){
var cards=player.getExpansions(skill);
if(cards.length) player.loseToDiscardpile(cards);
},
ai:{order:1,result:{player:1}},
},
ayato_jianshen:{
mod:{
cardnature:function(card,player){
if(get.name(card)=='sha') return 'kami';
},
},
ai:{threaten:3},
},
ayato_zonghuan:{
enable:'phaseUse',
usable:1,
filterTarget:function(card,player,target){
return target!=player&&target.countCards('h')>0;
},
content:function(){
'step 0'
player.chooseButton(['请选择'+get.translation(target)+'的一张手牌',target.getCards('h')],true).set('ai',get.buttonValue);
'step 1'
if(result.bool){
var card=result.links[0];
event.card=card;
if(!lib.filter.cardEnabled(card,target)) event._result={bool:false};
else{
var targets=game.players.slice(0);
var info=get.info(card);
var range;
if(!info.notarget){
var select=get.copy(info.selectTarget);
if(select==undefined){
range=[1,1];
}
else if(typeof select=='number') range=[select,select];
else if(get.itemtype(select)=='select') range=select;
else if(typeof select=='function') range=select(card,player);
game.checkMod(card,target,range,'selectTarget',target);
}
if(info.notarget||range[1]==-1){
if(range[1]==-1){
for(var i=0;i0;
};
}
else{
var next=player.chooseTarget();
next.set('_get_card',card);
next.set('source',target);
next.set('filterTarget',function(card,player,target){
return lib.filter.filterTarget(_status.event._get_card,_status.event.source,target);
});
next.set('ai',function(target){
var evt=_status.event;
return get.effect(target,evt._get_card,evt.source,evt.player)
});
next.set('selectTarget',function(){
var card=get.card(),player=_status.event.source;
if(card==undefined) return;
var range;
var select=get.copy(get.info(card).selectTarget);
if(select==undefined){
if(get.info(card).filterTarget==undefined) return[0,0];
range=[1,1];
}
else if(typeof select=='number') range=[select,select];
else if(get.itemtype(select)=='select') range=select;
else if(typeof select=='function') range=select(card,player);
game.checkMod(card,player,range,'selectTarget',player);
return range;
});
next.set('prompt',event.prompt||('选择'+get.translation(target)+'使用'+get.translation(card)+'的目标'));
next.set('prompt2','或点「取消」令其将此牌置入弃牌堆');
}
}
}
else event.finish();
'step 2'
if(result.bool){
target.useCard(card,event.targets2||result.targets,false,'noai');
player.draw();
}
else{
target.lose(card,ui.discardPile);
target.$throw(card);
game.log(target,'将',card,'置入了弃牌堆');
}
},
ai:{order:10,result:{target:-1}},
},
nagisa_tiandu:{
trigger:{player:'judgeEnd'},
charlotte:true,
frequent:function(event){
if(event.result.card.name=='du') return false;
return true;
},
check:function(event){
if(event.result.card.name=='du') return false;
return true;
},
filter:function(event,player){
return get.position(event.result.card,true)=='o';
},
content:function(){
player.gain(trigger.result.card,'gain2');
}
},
nagisa_fuxin:{
trigger:{
global:['gainAfter','loseAfter','loseAsyncAfter','damageEnd'],
},
filter:function(event,player){
var source=_status.currentPhase;
if(event.name=='damage'){
return event.player.isAlive()&&event.player!=source;
}
else if(event.name=='lose'){
if(event.type!='discard'||event.player==source||event.player.isDead()) return false;
if((event.discarder||event.getParent(2).player)==event.player) return false;
if(!event.getl(event.player).hs.length) return false;
return true;
}
else if(event.name=='gain'){
if(event.giver||event.getParent().name=='_yongjian_zengyu') return false;
var cards=event.getg(event.player);
if(!cards.length) return false;
return game.hasPlayer(function(current){
if(current==event.player||current==source) return false;
var hs=event.getl(current).hs;
for(var i of hs){
if(cards.contains(i)) return true;
}
return false;
});
}
else if(event.type=='gain'){
if(event.giver||!event.player||event.player==source||event.player.isDead()) return false;
var hs=event.getl(event.player);
return game.hasPlayer(function(current){
if(current==event.player) return false;
var cards=event.getg(current);
for(var i of cards){
if(hs.contains(i)) return true;
}
});
}
else if(event.type=='discard'){
if(!event.discarder) return false;
return game.hasPlayer(function(current){
return current!=source&¤t!=event.discarder&&event.getl(current).hs.length>0;
});
}
return false;
},
direct:true,
content:function(){
'step 0'
var targets=[],source=_status.currentPhase;
if(trigger.name=='gain'){
var cards=trigger.getg(trigger.player);
targets.addArray(game.filterPlayer(function(current){
if(current==trigger.player||current==source) return false;
var hs=trigger.getl(current).hs;
for(var i of hs){
if(cards.contains(i)) return true;
}
return false;
}));
}
else if(trigger.name=='loseAsync'&&trigger.type=='discard'){
targets.addArray(game.filterPlayer(function(current){
return current!=trigger.discarder&¤t!=source&&trigger.getl(current).hs.length>0;
}));
}
else targets.push(trigger.player);
event.targets=targets.sortBySeat();
if(!event.targets.length) event.finish();
'step 1'
var target=targets.shift();
event.target=target;
if(target.isAlive()) player.chooseBool(get.prompt2('nagisa_fuxin',target)).set('ai',function(){
var evt=_status.event.getParent();
return get.attitude(evt.player,evt.target)>0&&get.attitude(evt.player,_status.currentPhase)<=0;
});
else{
if(targets.length>0) event.goto(1);
else event.finish();
}
'step 2'
if(result.bool){
player.logSkill('nagisa_fuxin',target);
target.judge();
}
else{
if(targets.length>0) event.goto(1);
else event.finish();
}
'step 3'
if(result.color=='red') target.draw();
else{
var source=_status.currentPhase;
if(source){
source.chooseToDiscard('he',true);
}
}
if(targets.length>0) event.goto(1);
},
ai:{expose:0.2},
},
tomoya_shangxian:{
trigger:{player:'phaseUseBegin'},
mark:true,
locked:true,
intro:{
content:function(s){
return '计算与其他角色的距离时始终从'+(s?'逆':'顺')+'时针计算'
},
},
content:function(){
player.draw();
player.storage.tomoya_shangxian=!player.storage.tomoya_shangxian;
},
ai:{
left_hand:true,
right_hand:true,
skillTagFilter:function(player,tag){
return (player.storage.tomoya_shangxian==true)==(tag=='left_hand');
},
},
},
tomoya_wangjin:{
trigger:{global:'phaseJieshuBegin'},
filter:function(event,player){
return player!=event.player&&!player.hasSkill('tomoya_wangjin_'+player.inRange(event.player));
},
logTarget:'player',
check:function(event,player){
var target=event.player;
var bool=player.inRange(target);
if(!bool){
if(target.hp>player.hp) return get.effect(target,{name:'sha',isCard:true},player,player)>0;
var temp=target;
while(true){
temp=temp.getNext();
if(temp==target||temp==_status.roundStart) return true;
if(temp==player) continue;
if(temp.hp>player.hp&&!player.inRange(temp)&&get.effect(temp,{name:'sha',isCard:true},player,player)>0) return false;
}
}
if(get.attitude(player,target)<2) return false;
if(target.hp=2&&!temp.hasSkillTag('nogain')) return false;
}
},
content:function(){
'step 0'
event.bool=player.inRange(trigger.player);
player.addTempSkill('tomoya_wangjin_'+event.bool,'roundStart');
if(event.bool){
trigger.player.draw();
}
else player.draw(2);
'step 1'
if(event.bool){
if(trigger.player.hp0) trigger.player.discardPlayerCard(player,'h',true);
else event.finish();
}
'step 2'
if(event.bool){
player.chooseCard('h','是否交给'+get.translation(trigger.player)+'一张牌?');
}
else{
event.finish();
if(player.hp>=trigger.player.hp) return;
var card={name:'sha',isCard:true};
if(player.canUse(card,trigger.player,false)) player.useCard(card,trigger.player,false);
}
'step 3'
if(result.bool) player.give(result.cards,target);
},
subSkill:{true:{charlotte:true},false:{charlotte:true}},
ai:{expose:0.2},
},
noda_fengcheng:{
trigger:{
player:"gainAfter",
},
forced:true,
filter:function(event,player){
return get.itemtype(event.source)=='player'&&event.bySelf!=true;
},
check:function(event,player){
return get.attitude(player,event.source)>0;
},
logTarget:"source",
content:function(){
trigger.source.draw();
},
},
noda_xunxin:{
enable:'phaseUse',
viewAs:{name:'juedou'},
filter:function(event,player){
return (player.getStat('skill').noda_xunxin||0)0;
},
content:function(){
'step 0'
event.giver=trigger.turn;
event.gainner=event.giver==player?trigger.target:player;
event.giver.chooseCard('he',true,'交给'+get.translation(event.gainner)+'一张牌');
'step 1'
event.giver.give(result.cards,event.gainner);
},
},
hinata_qiulve:{
enable:['chooseToUse','chooseToRespond'],
viewAsFilter:function(player){
return player.countCards('hes',function(card){
return get.type(card)!='basic';
})>0;
},
viewAs:{name:'sha'},
filterCard:function(card,player){
return get.type(card)!='basic';
},
locked:false,
position:'hes',
check:function(card){
var val=get.value(card);
if(val>=6) return 0;
if(get.color(card)=='black') return 12-val;
return 6-val;
},
mod:{
targetInRange:function(card,player,target){
if(_status.event.skill=='hinata_qiulve') return true;
},
},
group:'hinata_qiulve_clear',
ai:{
respondSha:true,
skillTagFilter:function(player){
return player.countCards('hes',function(card){
return get.type(card)!='basic';
})>0;
},
},
},
hinata_qiulve_clear:{
trigger:{player:'useCard1'},
firstDo:true,
silent:true,
filter:function(event,player){
return event.skill=='hinata_qiulve';
},
content:function(){
if(get.color(trigger.card)=='red') trigger.directHit.addArray(game.players);
else if(trigger.addCount!==false){
trigger.addCount=false;
var stat=player.getStat().card;
if(stat.sha) stat.sha--;
}
},
},
hinata_ehou:{
trigger:{global:'useCardAfter'},
direct:true,
filter:function(event,player){
return player!=event.player&&event.targets&&event.targets.contains(player)&&(_status.connectMode||player.hasSha());
},
content:function(){
'step 0'
player.chooseToUse({
logSkill:'hinata_ehou',
preTarget:trigger.player,
prompt:'是否发动【扼喉】,对'+get.translation(trigger.player)+'使用一张【杀】?',
filterCard:function(card,player){
return get.name(card)=='sha'&&lib.filter.filterCard.apply(this,arguments);
},
filterTarget:function(card,player,target){
return target==_status.event.preTarget&&lib.filter.filterTarget.apply(this,arguments);
},
addCount:false,
});
'step 1'
if(result.bool&&player.getHistory('sourceDamage',function(evt){
return evt.getParent(4)==event;
}).length) player.draw();
},
},
hisako_yinbao:{
trigger:{player:['damageEnd','recoverAfter']},
content:function(){
'step 0'
player.judge(function(card){
return get.suit(card)=='spade'?2:-2;
}).judge2=function(result){
return result.bool;
};
'step 1'
if(result.bool){
player.chooseTarget(lib.filter.notMe,true,'选择一名其他角色,对其造成1点雷属性伤害').set('ai',function(target){
var player=_status.event.player;
return get.damageEffect(target,player,player,'thunder');
});
}
else event.finish();
'step 2'
var target=result.targets[0];
player.addExpose(0.2);
player.line(target,'thunder');
target.damage('thunder');
},
},
hisako_zhuanyun:{
trigger:{player:'judgeBegin'},
forced:true,
charlotte:true,
silent:true,
filter:function(event,player){
return !event.directresult;
},
content:function(){
var tempcard=false,temp=-Infinity;
for(var i=0;itemp){
tempcard=card;
temp=temp2;
}
}
if(tempcard) trigger.directresult=tempcard;
},
ai:{luckyStar:true},
},
riki_spwenji:{
audio:2,
trigger:{player:'phaseUseBegin'},
direct:true,
filter:function(event,player){
return game.hasPlayer(function(current){
return current!=player&¤t.countCards('he');
});
},
content:function(){
'step 0'
player.chooseTarget(get.prompt2('riki_spwenji'),function(card,player,target){
return target!=player&&target.countCards('he');
}).set('ai',function(target){
var att=get.attitude(_status.event.player,target);
if(att>0) return Math.sqrt(att)/10;
return 5-att;
});
'step 1'
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('riki_spwenji',target);
target.chooseCard('he',true,'问计:将一张牌交给'+get.translation(player));
}
else{
event.finish();
}
'step 2'
if(result.bool){
player.addTempSkill('riki_spwenji_respond');
player.storage.riki_spwenji_respond=get.type2(result.cards[0],target);
event.target.give(result.cards,player,true);
}
},
ai:{expose:0.2},
subSkill:{
respond:{
onremove:true,
trigger:{player:'useCard'},
forced:true,
charlotte:true,
audio:'riki_spwenji',
filter:function(event,player){
return get.type2(event.card)==player.storage.riki_spwenji_respond;
},
content:function(){
trigger.directHit.addArray(game.players);
},
ai:{
directHit_ai:true,
skillTagFilter:function(player,tag,arg){
return get.type2(arg.card)==player.storage.riki_spwenji_respond;
},
},
}
}
},
riki_nvzhuang:{
trigger:{player:'phaseJieshuBegin'},
forced:true,
content:function(){
player.draw(player.countCards('h')==0?2:1);
},
},
riki_mengzhong:{
trigger:{player:'phaseZhunbeiBegin'},
forced:true,
derivation:'riki_chongzhen',
juexingji:true,
unique:true,
skillAnimation:true,
animationColor:'key',
filter:function(event,player){
var num=0;
player.getAllHistory('gain',function(evt){
if(evt.getParent().name=='riki_spwenji') num+=evt.cards.length;
});
return num>=3;
},
content:function(){
player.awakenSkill('riki_mengzhong');
player.removeSkill('riki_spwenji');
player.gainMaxHp();
player.recover();
player.addSkill('riki_chongzhen');
},
},
riki_chongzhen:{
trigger:{
player:"phaseUseBegin",
},
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt2('riki_chongzhen'),function(card,player,target){
return player.canCompare(target);
}).set('ai',function(target){
return -get.attitude(player,target)*(1+target.countCards('e'))/(1+target.countCards('j'));
});
'step 1'
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('riki_chongzhen',target);
player.chooseToCompare(target);
}
else{
event.finish();
}
'step 2'
if(result.bool){
var num=0;
if(target.countCards('h')) num++;
if(target.countCards('e')) num++;
if(target.countCards('j')) num++;
if(num){
player.gainPlayerCard(target,num,'hej',true).set('filterButton',function(button){
for(var i=0;i0&&game.hasPlayer(function(current){
return player.canCompare(current);
});
},
filterTarget:function(card,player,target){
return player.canCompare(target);
},
content:function(){
'step 0'
player.chooseToCompare(target);
'step 1'
if(result.bool) player.addTempSkill('yuiko_fenglun2','phaseUseEnd');
},
ai:{
order:10,
result:{target:-1},
},
},
yuiko_fenglun2:{
mod:{
cardUsable:function(){return Infinity},
targetInRange:function(){return true},
},
},
yuiko_dilve:{
enable:"chooseCard",
check:function(){
return 20;
},
filter:function(event){
return event.type=='compare'&&!event.directresult;
},
onCompare:function(player){
return game.cardsGotoOrdering(get.bottomCards()).cards;
},
group:'yuiko_dilve_gain',
subSkill:{
gain:{
trigger:{
player:['chooseToCompareAfter','compareMultipleAfter'],
target:['chooseToCompareAfter','compareMultipleAfter']
},
filter:function(event,player){
if(event.preserve) return false;
return [event.card1,event.card2].filterInD('od').length>0;
},
prompt2:function(event,player){
return '获得'+get.translation([event.card1,event.card2].filterInD('od'));
},
content:function(){
player.gain([trigger.card1,trigger.card2].filterInD('od'),'gain2','log');
}
},
},
},
doruji_feiqu:{
trigger:{
player:'useCard',
target:'useCardToTargeted',
},
forced:true,
filter:function(event,player){
return event.card.name=='sha';
},
content:function(){
if(trigger.name=='useCard') trigger.directHit.addArray(game.players);
else trigger.directHit.add(player);
},
ai:{
directHit_ai:true,
skillTagFilter:function(player,tag,arg){
return arg.card.name=='sha';
},
},
global:'doruji_feiqu_ai',
},
doruji_feiqu_ai:{
ai:{
directHit_ai:true,
skillTagFilter:function(player,tag,arg){
return arg.card.name=='sha'&&(arg.target.hasSkill('doruji_feiqu')||arg.target.hasSkill('godan_feiqu'));
},
},
},
akane_jugu:{
audio:2,
mod:{
maxHandcard:function(player,num){
return num+player.maxHp;
}
},
trigger:{global:'phaseBefore',player:'enterGame'},
forced:true,
filter:function(event,player){
return (event.name!='phase'||game.phaseNumber==0);
},
content:function(){
player.draw(player.maxHp);
}
},
akane_quanqing:{
enable:'phaseUse',
filterCard:true,
filterTarget:function(card,player,target){
return target!=player&&player.inRange(target);
},
position:'he',
check:function(card){
var val=get.value(card);
var num=card.number;
if(num>10) return 8-val;
var player=_status.event.player;
if(player.getUseValue(card,null,true)>player.getUseValue({name:'guohe'})) return 0;
if(num>6) return 6-val;
return 3-val;
},
content:function(){
'step 0'
var num=cards[0].number;
var trans=get.translation(target);
var list=['令'+trans+'摸一张牌'];
event.addIndex=0;
if(num>6){
if(target.countDiscardableCards(player,'hej')>0) list.push('弃置'+trans+'区域内的一张牌');
else event.addIndex++;
}
if(num>10) list.push('对'+trans+'造成1点伤害');
if(list.length==1) event._result={index:0};
else player.chooseControl().set('choiceList',list).set('index',list.length-1).set('ai',function(){return _status.event.index});
'step 1'
if(result.index>0) result.index+=event.addIndex;
switch(result.index){
case 0:target.draw();break;
case 1:player.discardPlayerCard(target,'hej',true);break;
case 2:target.damage('nocard');break;
}
},
ai:{
order:4,
result:{
target:function(player,target){
var card=ui.selected.cards[0];
if(card){
if(card.number>10) return get.damageEffect(target,player,target);
if(card.number>6) return lib.card.guohe.ai.result.target.apply(this,arguments);
return 1;
}
},
},
},
},
akane_yifu:{
unique:true,
global:'akane_yifu2',
zhuSkill:true,
},
akane_yifu2:{
audio:2,
enable:'phaseUse',
discard:false,
line:true,
direct:true,
clearTime:true,
delay:false,
lose:false,
prepare:function(cards,player,targets){
targets[0].logSkill('akane_yifu');
},
prompt:function(){
var player=_status.event.player;
var list=game.filterPlayer(function(target){
return target!=player&&target.hasZhuSkill('akane_yifu',player);
});
var str='将一张手牌交给'+get.translation(list);
if(list.length>1) str+='中的一人';
return str;
},
filter:function(event,player){
if(player.group!='key') return false;
if(player.countCards('h')==0) return 0;
return game.hasPlayer(function(target){
return target!=player&&target.hasZhuSkill('akane_yifu',player)&&!target.hasSkill('akane_yifu3');
});
},
filterCard:true,
log:false,
filterTarget:function(card,player,target){
return target!=player&&target.hasZhuSkill('akane_yifu',player)&&!target.hasSkill('akane_yifu3');
},
content:function(){
'step 0'
player.give(cards,target);
target.addTempSkill('akane_yifu3','phaseUseEnd');
target.draw();
'step 1'
if(target.countCards('h')>0) target.chooseCard('h',true,'交给'+get.translation(player)+'一张牌').set('ai',function(card){
return 14-get.value(card);
});
else event.finish();
'step 2'
target.give(result.cards,player);
},
ai:{
expose:0.3,
order:10,
result:{
target:5
}
}
},
akane_yifu3:{charlotte:true},
sasami_miaobian:{
derivation:['sasami_gongqing','sasami_funan','sasami_baoqiu'],
init2:function(player){
if(player.hp<=3) player.addSkill('sasami_gongqing');
if(player.hp<=2) player.addSkill('sasami_funan');
if(player.hp<=1) player.addSkill('sasami_baoqiu');
},
trigger:{player:'changeHp'},
firstDo:true,
silent:true,
content:function(){
lib.skill.sasami_miaobian.init2(player);
},
},
sasami_baoqiu:{
line:{color:[173,149,206]},
inherit:'rin_baoqiu'
},
"sasami_gongqing":{
audio:true,
trigger:{
player:["damageBegin3","damageBegin4"],
},
forced:true,
filter:function (event,player,name){
if(!event.source) return false;
var range=event.source.getAttackRange();
if(name=='damageBegin3') return range>3;
return event.num>1&&range<3;
},
content:function (){
trigger.num=event.triggername=='damageBegin4'?1:trigger.num+1;
},
ai:{
filterDamage:true,
skillTagFilter:function(player,tag,arg){
if(arg&&arg.player){
if(arg.player.hasSkillTag('jueqing',false,player)) return false;
if(arg.player.getAttackRange()<3) return true;
}
return false;
}
},
},
sasami_funan:{
audio:2,
trigger:{global:['respond','useCard']},
line:{color:[173,149,206]},
filter:function(event,player){
if(!event.respondTo) return false;
if(event.player==player) return false;
if(player!=event.respondTo[0]) return false;
if(!player.hasSkill('sasami_funan_jiexun')){
var cards=[]
if(get.itemtype(event.respondTo[1])=='card') cards.push(event.respondTo[1]);
else if(event.respondTo[1].cards) cards.addArray(event.respondTo[1].cards);
return cards.filterInD('od').length>0;
}
else return event.cards.filterInD('od').length>0;
},
logTarget:'player',
content:function(){
'step 0'
if(!player.hasSkill('sasami_funan_jiexun')){
var cards=[]
if(get.itemtype(trigger.respondTo[1])=='card') cards.push(trigger.respondTo[1]);
else if(trigger.respondTo[1].cards) cards.addArray(trigger.respondTo[1].cards);
cards=cards.filterInD('od');
trigger.player.gain(cards,'gain2','log').gaintag.add('sasami_funan');
trigger.player.addTempSkill('sasami_funan_use');
}
'step 1'
var cards=trigger.cards.filterInD('od');
player.gain(cards,'log','gain2');
},
subSkill:{
use:{
onremove:function(player){
player.removeGaintag('sasami_funan');
},
charlotte:true,
mod:{
cardEnabled2:function(card,player){
if(get.itemtype(card)=='card'&&card.hasGaintag('sasami_funan')){
return false;
}
}
}
}
}
},
rin_baoqiu:{
mod:{
attackRange:function(rin,ball){
return ball+2;
},
},
trigger:{player:'useCardToPlayered'},
forced:true,
logTarget:'target',
filter:function(event,player){
return event.card.name=='sha';
},
line:{color:[194,117,92]},
content:function(){
'step 0'
player.judge(function(){return 0});
'step 1'
var target=trigger.target;
var map=trigger.customArgs;
var id=target.playerid;
if(!map[id]) map[id]={};
if(result.color=='red'){
if(!map[id].extraDamage) map[id].extraDamage=0;
map[id].extraDamage++;
}
if(result.color=='black'){
trigger.directHit.add(target);
}
if(result.suit=='spade'||result.suit=='heart'){
var evt=trigger.getParent();
if(evt.addCount!==false){
evt.addCount=false;
player.getStat().card.sha--;
}
player.draw();
}
if(result.suit=='diamond'||result.suit=='club'){
target.addTempSkill('fengyin');
if(target.countDiscardableCards(player,'he')>0) player.discardPlayerCard(target,'he',true);
}
},
},
sunohara_chengshuang:{
trigger:{
global:'phaseBefore',
player:'enterGame',
},
group:'sunohara_chengshuang_phase',
forced:true,
filter:function(event,player){
return (event.name!='phase'||game.phaseNumber==0);
},
content:function(){
'step 0'
var evt=event.getParent('phase');
if(evt&&evt.player==player) evt.sunohara_chengshuang=true;
player.chooseControl('male','female').set('prompt','成双:请选择自己的性别');
'step 1'
var sex=result.control;
game.broadcastAll(function(player,sex){
player.sex=sex;
if(player.marks&&player.marks.sunohara_chengshuang) player.marks.sunohara_chengshuang.firstChild.innerHTML=sex=='male'?'♂':'♀';
},player,sex);
game.log(player,'将性别变更为','#g'+get.translation(sex)+'性');
},
mark:true,
intro:{
content:function(storage,player){
if(player.sex=='unknown'||player.sex=='double') return '当前性别未确定';
return '当前性别:'+get.translation(player.sex);
},
},
},
sunohara_chengshuang_phase:{
trigger:{
player:'phaseBegin',
},
filter:function(event,player){
if(event.sunohara_chengshuang) return false;
return game.phaseNumber>1;
},
prompt2:function(event,player){
if(player.sex=='unknown'||player.sex=='double') return '选择自己的性别';
return '将自己的性别变更为'+(player.sex=='male'?'女性':'男性');
},
content:function(){
'step 0'
if(player.sex=='unknown'||player.sex=='double') player.chooseControl('male','female').set('prompt','成双:请选择自己的性别');
else event._result={control:player.sex=='male'?'female':'male'};
'step 1'
var sex=result.control;
game.broadcastAll(function(player,sex){
player.sex=sex;
if(player.marks&&player.marks.sunohara_chengshuang) player.marks.sunohara_chengshuang.firstChild.innerHTML=sex=='male'?'♂':'♀';
},player,sex);
game.log(player,'将性别变更为','#g'+get.translation(sex)+'性');
},
},
sunohara_tiaoyin:{
enable:'phaseUse',
usable:1,
filterTarget:function(card,player,target){
return target!=player&&target.countGainableCards(player,'hej')>0;
},
selectCard:[1,4],
filterCard:function(card){
for(var i=0;i0) player.gainPlayerCard(target,'hej','visible');
},
contentAfter:function(){
var bool=false;
for(var i=0;i0)?1:-2;
},
}
},
},
sunohara_jianren:{
trigger:{player:'damageEnd'},
direct:true,
content:function(){
'step 0'
event.num=(!trigger.source||trigger.source.isDead()||trigger.source.differentSexFrom(player))?3:1;
player.chooseTarget(get.prompt('sunohara_jianren'),'令一名角色摸'+get.cnNumber(event.num)+'张牌。').set('ai',function(target){
var att=get.attitude(player,target);
if(att<=0) return 0;
if(target.hasSkillTag('nogain')&&target!=_status.currentPhase) return 0.1;
return att/(1+0.1*target.countCards('h'));
});
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('sunohara_jianren',target,{color:[145,149,179]});
target.draw(event.num);
}
},
},
shiina_qingshen:{
trigger:{
player:'damageEnd',
source:'damageSource',
},
filter:function(event,player){
return event.cards&&event.cards.filterInD().length>0;
},
frequent:true,
content:function(){
'step 0'
var cards=trigger.cards.filterInD('od');
player.gain(cards,'gain2','log');
event.count=cards.length;
'step 1'
var cards=player.getCards('he');
if(cards.length==0){
event.finish();
return;
}
else if(cards.length<=event.count){
event._result={bool:true,cards:cards};
}
else player.chooseCard(true,'he',event.count,'请选择要置于武将牌上的牌');
'step 2'
if(result.bool&&result.cards.length){
var cards=result.cards;
player.addToExpansion(cards,player,'give').gaintag.add('shiina_qingshen');
}
},
intro:{
content:'expansion',
markcount:'expansion',
},
mod:{
attackRange:function(from,num){
return num+from.getExpansions('shiina_qingshen').length;
},
maxHandcard:function(from,num){
return num+from.getExpansions('shiina_qingshen').length;
},
},
ai:{
notemp:true,
},
},
shiina_feiyan:{
animalList:['key_inari','key_doruji'],
trigger:{global:'phaseBegin'},
direct:true,
filter:function(event,player){
if(lib.skill.shiina_feiyan.animalList.contains(event.player.name)) return false;
return player.getExpansions('shiina_qingshen').length>0&&player.inRange(event.player);
},
content:function(){
'step 0'
player.chooseButton([get.prompt('shiina_feiyan',trigger.player),player.getExpansions('shiina_qingshen')]).set('goon',get.attitude(player,trigger.player)<0?1:-1).set('ai',function(){return _status.event.goon});
'step 1'
if(result.bool){
var cards=result.links;
player.loseToDiscardpile(cards);
event.card={name:'sha',isCard:true};
if(lib.filter.targetEnabled(event.card,player,trigger.player)){
event.card=player.useCard(event.card,trigger.player,'shiina_feiyan').card;
}
else player.logSkill('shiina_feiyan',trigger.player);
}
else event.finish();
'step 2'
if(!player.getHistory('sourceDamage',function(evt){
return event.card==evt.card;
}).length) player.draw();
},
group:'shiina_retieji',
ai:{
notemp:true,
combo:'shiina_feiyan'
},
},
shiina_retieji:{
shaRelated:true,
trigger:{player:'useCardToPlayered'},
check:function(event,player){
return get.attitude(player,event.target)<0;
},
filter:function(event,player){
return event.card.name=='sha'&&event.getParent().skill=='shiina_feiyan';
},
logTarget:'target',
content:function(){
"step 0"
player.judge(function(){return 0});
if(!trigger.target.hasSkill('fengyin')){
trigger.target.addTempSkill('fengyin');
}
"step 1"
var suit=get.suit(result.card);
var target=trigger.target;
var num=target.countCards('h','shan');
target.chooseToDiscard('请弃置一张'+get.translation(suit)+'牌,否则不能使用闪抵消此杀','he',function(card){
return get.suit(card)==_status.event.suit;
}).set('ai',function(card){
var num=_status.event.num;
if(num==0) return 0;
if(card.name=='shan') return num>1?2:0;
return 8-get.value(card);
}).set('num',num).set('suit',suit);
"step 2"
if(!result.bool){
trigger.getParent().directHit.add(trigger.target);
}
}
},
inari_baiwei:{
enable:['chooseToUse','chooseToRespond'],
hiddenCard:function(player,name){
return name!='du'&&get.type(name)=='basic'&&player.countCards('hes',{suit:'diamond'})>0;
},
filter:function(event,player){
if(event.type=='wuxie'||!player.countCards('hse',{suit:'diamond'})) return false;
for(var i=0;i0) return get.order(fakecard);
return 0;
}
return 1;
},
backup:function(links,player){
return {
selectCard:1,
filterCard:{suit:'diamond'},
popname:true,
check:function(card){
if(get.type(card)=='basic') return 6;
return 1/Math.max(0.1,get.value(card));
},
position:'hse',
viewAs:{name:links[0][2],nature:links[0][3]},
}
},
prompt:function(links,player){
return '将一张♦牌当做'+(get.translation(links[0][3])||'')+get.translation(links[0][2])+'使用或打出';
}
},
ai:{
order:function(item,player){
if(player&&_status.event.type=='phase'){
var max=0
for(var i=0;i0){
var temp=get.order({name:name});
if(temp>max) max=temp;
}
}
if(max>0) max+=0.5;
return max;
}
return 4;
},
result:{
player:1,
},
respondSha:true,
fireAttack:true,
skillTagFilter:function(player,tag){
return tag=='fireAttack'||player.countCards('he',{suit:'diamond'})>0;
},
},
group:['inari_baiwei_shan','inari_baiwei_draw'],
},
inari_baiwei_shan:{
prompt:'将一张♦牌当做闪使用或打出',
enable:['chooseToRespond','chooseToUse'],
viewAs:{name:'shan'},
selectCard:1,
filterCard:{suit:'diamond'},
popname:true,
check:function(card){
return 1/Math.max(0.1,get.value(card));
},
position:'hse',
ai:{
order:10,
result:{player:1},
respondShan:true,
skillTagFilter:function(player){
return player.countCards('hse',{suit:'diamond'})>0;
},
},
},
inari_baiwei_draw:{
trigger:{player:['useCardAfter','respondAfter']},
forced:true,
popup:false,
filter:function(event,player){
return event.skill&&event.skill.indexOf('inari_baiwei')==0;
},
content:function(){player.draw()},
},
inari_huhun:{
mod:{
suit:function(card,suit){
if(suit=='club') return 'diamond';
},
maxHandcard:function(player,num){
return num+1;
},
}
},
saya_powei:{
audio:2,
trigger:{player:'phaseAfter'},
direct:true,
locked:true,
limited:true,
unique:true,
skillAnimation:true,
animationColor:'metal',
filter:function(event,player){
return event.type!='saya_powei'&&game.hasPlayer(function(current){
return current.hp>player.hp;
});
},
content:function(){
'step 0'
player.chooseTarget(get.prompt2('saya_powei'),function(card,saya,kyousuke){
return kyousuke.hp>saya.hp;
}).set('ai',function(target){
var player=_status.event.player;
var att=get.attitude(player,target);
if(att>=-2) return 0;
if(target!=get.zhu(target)&&player.hasUnknown()) return 0;
if(target.getEquip(3)&&!player.getEquip(4)) att/=2;
if(player.hp<=1) att*=1.5;
return -att;
});
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('saya_powei',target);
player.awakenSkill('saya_powei');
game.delay(3);
var next=game.createEvent('saya_powei_loop',false,trigger);
next.playertrue=player;
next.playerfalse=target;
next.setContent(lib.skill.saya_powei.content2);
}
},
content2:function(){
'step 0'
event.count=0;
event.stat=true;
event.current=event['player'+event.stat];
game.countPlayer2(function(current){
if(current!=event.playertrue&¤t!=event.playerfalse) current.addSkill('saya_nodis');
});
event.playertrue.addSkill('saya_judge');
'step 1'
event.count++;
event.current.phase().set('type','saya_powei');
'step 2'
if(event.count==9||event.playertrue.isDead()||event.playerfalse.isDead()){
game.countPlayer2(function(current){
current.removeSkill('saya_nodis');
current.removeSkill('saya_judge');
});
}
else{
event.stat=!event.stat;
event.current=event['player'+event.stat];
event.goto(1);
}
}
},
saya_nodis:{
group:'undist',
mark:true,
intro:{content:'不计入距离和座次的计算'},
},
saya_judge:{
trigger:{player:'phaseBegin'},
forced:true,
popup:false,
filter:function(event,player){
return event.type=='saya_powei'&&player==event.getParent().playertrue;
},
content:function(){
'step 0'
player.judge(function(card){
return get.color(card)=='red'?5:0;
}).judge2=function(result){
return result.bool?true:false;
};
'step 1'
if(result.bool){
player.line(trigger.getParent().playerfalse);
trigger.getParent().playerfalse.damage();
}
},
},
saya_shouji:{
audio:2,
trigger:{player:'useCardAfter'},
filter:function(event,player){
return !player.getStat('skill').saya_shouji&&event.cards.filterInD().length>0;
},
direct:true,
content:function(){
'step 0'
var goon=function(){
var num=0;
var cards=trigger.cards.filterInD();
for(var i=0;inum;
})==0;
}();
player.chooseTarget(get.prompt2('saya_shouji'),lib.filter.notMe).set('ai',function(target){
if(!_status.event.goon) return 0;
var player=_status.event.player;
var cards=_status.event.getTrigger().cards.filterInD();
var att=get.attitude(player,target);
var num=0;
for(var i=0;i0) return 0;
if(['wugu','zhulu_card'].contains(button.link[2])) return 0;
var effect=player.getUseValue(button.link[2]);
if(effect>0) return effect;
return 0;
},
backup:function(links,player){
return {
filterCard:true,
audio:'haruka_shuangche',
selectCard:-1,
filterCard:function(){return false},
popname:true,
check:function(card){
return 6-get.value(card);
},
position:'he',
viewAs:{name:links[0][2],nature:links[0][3],isCard:true},
}
},
prompt:function(links,player){
return '请选择'+(get.translation(links[0][3])||'')+get.translation(links[0][2])+'的目标';
}
},
ai:{
order:1,
result:{
player:function(player){
var cards=player.getCards('he').sort(function(a,b){
return get.value(a)-get.value(b);
});
var num=(player.getStat('skill').haruka_shuangche||0)+1;
if(player.needsToDiscard()>=num) return 1;
if(player.hp>2) return 1;
if(cards.length>=num){
var val=0;
for(var i=0;i0;
},
content:function(){
'step 0'
player.chooseCard('he',[1,player.countCards('he')],get.prompt2('tsumugi_huilang')).set('ai',function(card){
if(get.position(card)!='h') return -1;
if(!['shan','wuxie','caochuan'].contains(get.name(card))) return 9;
return 5-get.value(card);
});
'step 1'
if(result.bool){
var cards=result.cards;
player.logSkill('tsumugi_huilang');
player.addSkill('tsumugi_huilang2');
player.addToExpansion('giveAuto',cards,player).gaintag.add('tsumugi_huilang2');
}
},
},
tsumugi_huilang2:{
charlotte:true,
marktext:'隐',
intro:{content:'隐藏于回廊之牌',markcount:'expansion'},
onremove:function(player,skill){
var cards=player.getExpansions(skill);
if(cards.length) player.loseToDiscardpile(cards);
},
trigger:{player:'phaseBegin'},
forced:true,
filter:function(event,player){
return player.getExpansions('tsumugi_huilang2').length>0;
},
content:function(){
'step 0'
var cards=player.getExpansions('tsumugi_huilang2');
event.num=cards.length;
player.gain(cards,'draw');
'step 1'
player.chooseTarget([1,num],'是否令至多'+get.cnNumber(num)+'名角色各摸一张牌?').set('ai',function(target){
return get.attitude(_status.event.player,target);
});
'step 2'
if(result.bool){
var targets=result.targets;
player.line(targets,lib.skill.tsumugi_huilang.line);
targets.sortBySeat();
game.asyncDraw(targets);
}
else event.finish();
'step 3'
game.delay();
},
},
yui_jiang:{
shaRelated:true,
audio:2,
audioname:['sp_lvmeng','re_sunben','re_sunce'],
trigger:{
player:'useCardToPlayered',
target:'useCardToTargeted',
},
filter:function(event,player){
if(!(event.card.name=='juedou'||(event.card.name=='sha'&&get.color(event.card)=='red'))) return false;
return player==event.target||event.getParent().triggeredTargets3.length==1;
},
frequent:true,
content:function(){
player.draw();
},
ai:{
effect:{
target:function(card,player,target){
if(card.name=='sha'&&get.color(card)=='red') return [1,0.6];
},
player:function(card,player,target){
if(card.name=='sha'&&get.color(card)=='red') return [1,1];
}
}
}
},
yui_lieyin:{
trigger:{player:'phaseUseBegin'},
direct:true,
locked:true,
content:function(){
'step 0'
var list=[];
if(player.storage._ichiban_no_takaramono) list.push('cancel2');
player.chooseControl.apply(player,list).set('choiceList',[
'令此阶段内的所有红色牌视为【杀】',
'令此阶段内的所有【杀】视为【决斗】'
]).set('prompt',player.storage._ichiban_no_takaramono?get.prompt('yui_lieyin'):'烈音:请选择一项').set('ai',function(){
var player=_status.event.player;
var shas=player.countCards('h','sha')
if(shas>0){
if(game.hasPlayer(function(current){
return get.attitude(player,current)<0&&player.canUse('juedou',current)&&!current.hasSha()&&get.effect(current,{name:'juedou'},player,player)>0;
})) return 1;
if(player.storage._ichiban_no_takaramono) return 'cancel2';
}
if(player.countCards('h',function(card){
return get.color(card)=='red'&&card.name!='sha'&&player.hasValueTarget(card);
})==0) return 0;
if(player.storage._ichiban_no_takaramono) return 'cancel2';
return 1;
});
'step 1'
if(result.control!='cancel2'){
player.logSkill('yui_lieyin');
player.addTempSkill('yui_lieyin'+result.index,'phaseUseEnd')
}
},
},
yui_lieyin0:{
mod:{
cardname:function(card){
if(get.color(card)=='red') return 'sha';
},
},
},
yui_lieyin1:{
mod:{
cardname:function(card){
if(card.name=='sha') return 'juedou';
},
},
},
yui_takaramono:{
trigger:{player:'phaseZhunbeiBegin'},
forced:true,
unique:true,
juexingji:true,
skillAnimation:true,
animationColor:'key',
filter:function(event,player){
var num=0;
if(player.hp<=1) num++;
if(game.dead.length>0) num++;
if(num!=1) return num>1;
var draw=0;
player.getAllHistory('gain',function(evt){
if(evt.getParent(2).name=='yui_jiang') draw+=evt.cards.length;
});
return draw>=3;
},
content:function(){
player.awakenSkill('yui_takaramono');
player.addSkill('yui_yinhang');
player.storage._ichiban_no_takaramono=true;
player.gainMaxHp();
player.recover();
},
derivation:'yui_yinhang',
},
yui_yinhang:{
trigger:{player:'changeHp'},
locked:true,
direct:true,
line:{color:[253, 153, 182]},
content:function(){
'step 0'
event.count=Math.abs(trigger.num);
'step 1'
event.count--;
player.chooseTarget([1,2],get.prompt('yui_yinhang'),'令至多两名角色各摸一张牌').set('ai',function(target){
return get.attitude(_status.event.player,target);
});
'step 2'
if(result.bool){
var targets=result.targets;
targets.sortBySeat();
player.logSkill('yui_yinhang',targets,lib.skill.yui_yinhang.line);
game.asyncDraw(targets);
}
else event.finish();
'step 3'
game.delay();
if(event.count>0) event.goto(1);
},
},
yoshino_jueyi:{
trigger:{player:'phaseUseBegin'},
direct:true,
content:function(){
'step 0'
player.chooseTarget(lib.filter.notMe,get.prompt2('yoshino_jueyi')).set('ai',function(target){
var player=_status.event.player;
if(get.damageEffect(target,player,player)<0) return 0;
var att=get.attitude(player,target);
if(att>0) return 0;
if(att==0) return 0.1;
var eff=0;
var hs=player.getCards('h');
for(var i=0;i0) eff+=eff2;
}
}
return -att/(1+eff);
});
'step 1'
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('yoshino_jueyi',target);
player.draw();
}
else event.finish();
'step 2'
player.chooseToPSS(target);
'step 3'
if(result.tie) event.goto(2);
else if(result.bool) target.damage();
else target.addTempSkill('yoshino_fail','phaseUseEnd');
},
},
yoshino_fail:{
mod:{
targetEnabled:function(card,player,target){
if(player==_status.currentPhase) return false;
},
},
},
kengo_weishang:{
locked:false,
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha'&&player.isDisabled(1)) return num+1;
},
globalFrom:function(from,to,distance){
if(from.isDisabled(4)) return distance-1;
},
globalTo:function(from,to,distance){
if(to.isDisabled(3)) return distance+1;
},
},
enable:'phaseUse',
usable:1,
filter:function(event,player){
var list=['equip1','equip2','equip3','equip4','equip5'];
for(var i=0;i0
})) return 'equip1';
if(list.contains('equip3')&&player.isEmpty('equip3')) return 'equip3';
if(list.contains('equip4')&&player.isEmpty('equip4')) return 'equip4';
if(list.contains('equip5')&&player.isEmpty('equip5')) return 'equip5';
if(list.contains('equip2')&&player.isEmpty('equip2')) return 'equip2';
return list.randomGet();
};
'step 1'
player.disableEquip(result.control);
player.draw(2);
},
group:['kengo_weishang_sha','kengo_weishang_shan'],
ai:{
order:10,
result:{player:1},
},
},
kengo_weishang_sha:{
trigger:{player:'useCardToPlayered'},
forced:true,
filter:function(event,player){
return event.card.name=='sha'&&player.isDisabled(1)&&event.target.countCards('he')>0;
},
logTarget:'target',
content:function(){
trigger.target.chooseToDiscard('he',true);
},
},
kengo_weishang_shan:{
enable:['chooseToUse','chooseToRespond'],
viewAs:{name:'shan'},
filterCard:true,
position:'hes',
prompt:'将一张牌当做闪使用或打出',
viewAsFilter:function(player){
return player.isDisabled(2)&&player.countCards('hes')>0;
},
check:function(card){
return 1/Math.max(0.1,get.value(card));
},
ai:{
respondShan:true,
skillTagFilter:function(player){
return player.isDisabled(2)&&player.countCards('he')>0;
},
},
},
kengo_guidui:{
trigger:{player:'phaseZhunbeiBegin'},
forced:true,
filter:function(event,player){
return player.countDisabled()>0;
},
content:function(){
var list=['equip1','equip2','equip3','equip4','equip5'];
for(var i=0;i0) event.goto(1);
},
},
iwasawa_mysong:{
trigger:{player:['phaseBeginStart','phaseAfter','dyingBefore']},
forced:true,
filter:function(event,player){
return event.name=='dying'||player.hp<1;
},
content:function(){
if(trigger.name=='dying') trigger.cancel();
else if(event.triggername=='phaseBeginStart') player.addTempSkill('iwasawa_fenyin');
else player.die();
},
nobracket:true,
derivation:'iwasawa_fenyin',
},
iwasawa_refenyin:{
audio:2,
audioname2:{
wufan:'refenyin_wufan',
},
trigger:{global:['loseAfter','cardsDiscardAfter','equipAfter']},
forced:true,
filter:function(event,player){
if(player!=_status.currentPhase) return false;
var cards=event.getd();
var list=[];
for(var i=0;i0;
},
content:function(){
var list=[];
var list2=[];
var cards=trigger.getd();
for(var i=0;i=0?0:1).set('ai',function(){return _status.event.choice});
'step 1'
if(result.control=='增加伤害'){
player.loseMaxHp();
trigger.num+=2;
}
else trigger.cancel();
},
ai:{
effect:{
player:function(card,player,target){
if(target&&get.attitude(player,target)>0&&get.tag(card,'damage')) return 'zeroplayertarget';
},
},
},
},
yusa_yanyi:{
enable:'phaseUse',
usable:1,
filterTarget:function(card,player,target){
return get.distance(player,target)<=player.hp;
},
selectTarget:function(){
return [1,Math.max(_status.event.player.getAttackRange())];
},
line:'thunder',
content:function(){
'step 0'
if(target.isHealthy()){
player.draw();
event.finish();
}
else{
var name=get.translation(player);
target.chooseControl().set('choiceList',[
'令'+name+'摸一张牌',
'回复1点体力,然后交给'+name+'一张牌',
]).set('ai',function(){
return 1;
});
}
'step 1'
if(result.index==0){
player.draw();
event.finish();
}
else{
target.recover();
}
'step 2'
if(target!=player&&target.countCards('he')>0){
target.chooseCard('交给'+get.translation(player)+'一张牌','he',true);
}
else event.finish();
'step 3'
target.give(result.cards,player,'giveAuto');
},
ai:{
order:10,
result:{
player:function(player,target){
return target.isHealthy()?1:0;
},
target:function(player,target){
if(target.isHealthy()) return 0;
return get.recoverEffect(target,player,target);
},
},
},
},
yusa_misa:{
charlotte:true,
trigger:{player:'useSkillAfter'},
filter:function(event,player){
return event.skill=='yusa_yanyi'&&!player.storage.dualside_over&&Array.isArray(player.storage.dualside);
},
content:function(){
player.turnOver();
},
},
misa_yusa:{
charlotte:true,
trigger:{player:'misa_yehuoAfter'},
filter:function(event,player){
return event.bool===true&&!player.storage.dualside_over&&Array.isArray(player.storage.dualside);
},
content:function(){
player.turnOver();
},
},
misa_yehuo:{
charlotte:true,
trigger:{global:'phaseDrawBegin1'},
direct:true,
locked:true,
line:{color:[236,137,52]},
filter:function(event,player){
var target=event.player;
return player.inRange(target)&&player.countCards('he')>=get.distance(player,target);
},
content:function(){
'step 0'
var next=player.chooseToDiscard('he',get.distance(player,trigger.player)||1,get.prompt2('misa_yehuo',trigger.player));
next.set('logSkill',['misa_yehuo',trigger.player,'fire']);
next.set('ai',function(card){
var val=_status.event.val;
for(var i=0;i0;
},
},
yukine_wenzhou:{
trigger:{global:'phaseUseBegin'},
direct:true,
filter:function(event,player){
return event.player.countCards('he')>0;
},
content:function(){
"step 0"
event.forceDie=true;
var ask=trigger.player.chooseCard('he',get.prompt('yukine_wenzhou'));
if(player==trigger.player){
ask.set('prompt2','选择一张牌,然后从牌堆中获得一张与此牌类型相同的牌。本回合内使用与此牌类型相同的牌时不可被其他角色响应。');
}
else ask.set('prompt2','将一张牌交给'+get.translation(player)+'然后其可以选择:交给你一张牌;或令你从牌堆中获得一张与此牌类型相同的牌,且你本回合内使用与此牌类型相同的牌时不可被响应。');
ask.set('ai',function(card){
if(get.attitude(_status.event.player,_status.event.getParent().player)>0) return 10-get.value(card);
return -1;
});
"step 1"
if(result.bool){
player.logSkill('yukine_wenzhou',trigger.player);
event.type=get.type(result.cards[0],'trick');
if(trigger.player!=player) trigger.player.give(result.cards,player,'giveAuto');
}
else event.finish();
"step 2"
if(player==trigger.player||player.countCards('he')==0){
event._result={index:1};
}
else{
player.chooseControl().set('choiceList',[
'将一张牌交给'+get.translation(trigger.player),
'令'+get.translation(trigger.player)+'从牌堆中获得一张'+get.translation(event.type)+'牌,且其本回合内使用与此牌名称相同的牌时不可被响应',
]).set('forceDie',true).set('ai',function(){
if(get.attitude(_status.event.player,_status.event.getTrigger().player)>0) return 1;
return 0;
});
}
"step 3"
event.index=result.index;
if(result.index==1){
var magic=get.cardPile2(function(card){
return get.type(card,'trick')==event.type;
});
if(magic){
trigger.player.addTempSkill('yukine_magic','phaseUseEnd');
trigger.player.storage.yukine_magic.add(magic.name);
trigger.player.gain(magic,'draw');
}
else event.finish();
}
else player.chooseCard('he',true,'选择要交给'+get.translation(trigger.player)+'的牌').set('ai',function(card){
return -get.value(card,_status.event.getTrigger().player);
});
"step 4"
if(event.index==1) game.updateRoundNumber();
else if(result.bool) player.give(result.cards,trigger.player,'giveAuto');
},
},
yukine_magic:{
trigger:{player:'useCard'},
forced:true,
popup:false,
charlotte:true,
filter:function(event,player){
return player.storage.yukine_magic&&player.storage.yukine_magic.contains(event.card.name);
},
content:function(){
trigger.directHit.addArray(game.filterPlayer(function(current){
if(player!=current) return true;
return !player.hasSkill('yukine_wenzhou');
}));
},
onremove:true,
init:function(player,skill){
if(!player.storage[skill]) player.storage[skill]=[];
},
ai:{
directHit_ai:true,
skillTagFilter:function(player,tag,arg){
return player.storage.yukine_magic&&player.storage.yukine_magic.contains(arg.card.name);
},
},
},
komari_tiankou:{
trigger:{
player:'useCard2',
target:'useCardToTarget',
},
forced:true,
filter:function(event,player,name){
if(name=='useCardToTarget'&&player==event.player) return false;
if(get.color(event.card)!='red') return false;
if(get.tag(event.card,'damage')) return false;
return ['basic','trick'].contains(get.type(event.card));
},
content:function(){
'step 0'
var info=get.info(trigger.card);
var bool=true;
if(info.multitarget||info.allowMultiple===false) bool=false;
else{
var list=game.filterPlayer(function(current){
return !trigger.targets.contains(current)&&lib.filter.targetEnabled2(trigger.card,trigger.player,current);
})
if(!list.length) bool=false;
}
if(bool) player.chooseTarget('甜口:为'+get.translation(trigger.card)+'增加一个额外目标,或点【取消】摸一张牌。',function(candy,komari,rin){
return _status.event.rin_chan.contains(rin);
}).set('rin_chan',list).set('ai',function(target){
var evt=_status.event;
return get.effect(target,evt.candy,evt.source,evt.player);
}).set('candy',trigger.card).set('',trigger.player);
else event._result={bool:false};
'step 1'
if(result.bool){
var rin=result.targets[0];
trigger.targets.push(rin);
player.line(rin,{color:[255, 224,172]});
}
else player.draw();
},
},
komari_xueshang:{
trigger:{global:'die'},
forced:true,
skillAnimation:true,
filter:function(event,player){
return player.hp>0;
},
animationColor:'metal',
content:function(){
'step 0'
player.addSkill('riki_xueshang');
var map={};
var list=[];
for(var i=1;i<=player.hp;i++){
var cn=get.cnNumber(i,true);
map[cn]=i;
list.push(cn);
}
event.map=map;
player.chooseControl(list,function(){
return '一';
}).set('prompt','血殇:请选择自己受到的伤害的点数');
'step 1'
var num=event.map[result.control]||1;
event.num=num>1?2:1;
event.list=game.filterPlayer(function(current){
return current!=player;
}).sortBySeat();
player.damage(num);
player.line(event.list,{color:[255, 224,172]});
'step 2'
if(!player.hasSkill(event.name)) return;
else{
event.list.shift().damage(num);
if(event.list.length) event.redo();
}
},
},
riki_xueshang:{
trigger:{global:'dying'},
forced:true,
popup:false,
charlotte:true,
filter:function(event,player){
return event.getParent(2).name=='komari_xueshang'&&event.getParent(2).player==player;
},
content:function(){
player.removeSkill('komari_xueshang');
player.gainMaxHp(true);
player.recover();
},
},
umi_chaofan:{
enable:'phaseUse',
usable:1,
selectCard:2,
complexCard:true,
filter:function(summer,umi){
return umi.countCards('h')>1;
},
check:function(ingredient){
return 7-get.value(ingredient);
},
filterCard:function(ingredient){
if(ui.selected.cards.length) return get.suit(ingredient)!=get.suit(ui.selected.cards[0]);
return true;
},
line:{color:[251, 193, 217]},
filterTarget:lib.filter.notMe,
content:function(){
'step 0'
player.draw();
'step 1'
if(player.hp>2) target.recover();
else if(player.hp==2) target.draw(2);
else target.damage('fire','nosource');
},
ai:{
order:2,
result:{
target:function(umi,takahara){
if(umi.hp>2&&takahara.isDamaged()) return 2.2;
if(umi.hp==2&&!takahara.hasSkillTag('nogain')) return 2;
if(umi.hp<2) return get.damageEffect(takahara,umi,umi,'fire');
},
},
},
},
umi_lunhui:{
trigger:{global:'phaseAfter'},
filter:function(summer,umi){
return summer.player!=umi&&umi.countCards('h')0;
},
check:function(event,player){
return get.attitude(player,event.player)>1;
},
logTarget:'player',
content:function(){
'step 0'
player.gain(trigger.player.getCards('j'),trigger.player,'give','bySelf');
'step 1'
if(player.hp>1) player.loseHp();
},
},
yuri_xingdong:{
audio:2,
group:'yuri_xingdong_gain',
subSkill:{
mark:{
mark:true,
marktext:'令',
intro:{
content:'跳过下个回合的判定阶段和摸牌阶段',
},
},
gain:{
trigger:{player:'phaseUseBegin'},
forced:true,
content:function(){
'step 0'
var card=get.cardPile(function(card){
return card.name=='sha'||get.type(card)=='trick';
});
if(card) player.gain(card,'gain2','log');
'step 1'
game.updateRoundNumber();
},
},
},
enable:'phaseUse',
usable:1,
locked:true,
filter:function(event,player){
return player.countCards('h',lib.skill.yuri_xingdong.filterCard);
},
filterCard:function(card){
return card.name=='sha'||get.type(card)=='trick';
},
check:function(card){return 1},
filterTarget:lib.filter.notMe,
discard:false,
lose:false,
delay:0,
content:function(){
'step 0'
player.give(cards,target);
'step 1'
if(!target.getCards('h').contains(cards[0])) event._result={bool:false};
else target.chooseUseTarget(cards[0],game.filterPlayer(function(current){
return current!=player;
}),'请使用得到的牌,或者跳过下回合的判定阶段和摸牌阶段');
'step 2'
if(result.bool) game.asyncDraw([player,target]);
else{
target.addTempSkill('yuri_xingdong_mark','phaseJudgeSkipped');
target.skip('phaseJudge');
target.skip('phaseDraw');
target.addTempSkill('zhengjing3',{player:'phaseAfter'});
event.finish();
}
'step 3'
game.delay();
},
ai:{
order:12,
result:{
target:function(player,target){
var card=ui.selected.cards[0];
if(target.hasSkill('pingkou')) return 1;
if(!card) return 0;
var info=get.info(card);
if(info.selectTarget==-1){
var eff=0;
game.countPlayer(function(current){
if(current!=player&&target.canUse(card,current)) eff+=get.effect(current,card,target,target);
});
if(eff>0||get.value(card)<3) return eff;
return 0;
}
else if(game.hasPlayer(function(current){
return current!=player&&target.canUse(card,current)&&get.effect(current,card,target,target)>0
})) return 1.5;
else if(get.value(card)<3) return -1;
return 0;
},
},
},
},
yuri_wangxi:{
trigger:{global:'dieAfter'},
direct:true,
limited:true,
mark:false,
init:function(player){
if(player.hasZhuSkill('yuri_wangxi')){
player.markSkill('yuri_wangxi');
player.storage.yuri_wangxi=false;
}
},
zhuSkill:true,
unique:true,
skillAnimation:true,
animationColor:'thunder',
filter:function(event,player){
if(get.mode()!='identity') return false;
if(!player.hasZhuSkill('yuri_wangxi')) return false;
if(event.player.isAlive()) return false;
if(event.player.identity=='mingzhong') return false;
var evt=event.getParent('yuri_xingdong');
return evt&&evt.name=='yuri_xingdong'&&evt.player==player;
},
content:function(){
'step 0'
trigger.player.chooseBool('是否发动'+get.translation(player)+'的【忘隙】?').forceDie=true;
'step 1'
if(result.bool){
player.logSkill('yuri_wangxi',trigger.player);
player.awakenSkill('yuri_wangxi');
var identity='zhong';
if(_status.mode=='purple'){
if(['rNei','bNei'].contains(player.identity)) identity=player.identity;
else if(['rZhu','rZhong','bNei'].contains(player.identity)) identity='rZhong';
else identity='bZhong';
}
game.broadcastAll(function(source,identity){
if(source.node.dieidentity){
source.node.dieidentity.innerHTML=get.translation(identity+2);
}
source.revive(2,false);
source.identity=identity;
source.setIdentity();
},trigger.player,identity);
trigger.player.changeGroup(player.group);
trigger.player.draw();
var evt=trigger.getParent('damage');
if(evt.untrigger) evt.untrigger(false,trigger.player);
game.addVideo('setIdentity',trigger.player,'zhong');
}
},
},
nk_shekong:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return player.countCards('h')>0;
},
filterCard:true,
selectCard:function(){
if(ui.selected.targets.length) return [1,ui.selected.targets[0].countCards('he')];
return [1,Infinity];
},
filterTarget:function(event,player,target){
return target!=player&&target.countCards('he')>=Math.max(1,ui.selected.cards.length);
},
check:function(card){
if(!game.hasPlayer(function(current){
return current!=_status.event.player&&get.attitude(_status.event.player,current)<0&¤t.countCards('he')>ui.selected.cards.length;
})) return 0;
return 6-get.value(card);
},
content:function(){
'step 0'
event.cardsx=cards.slice(0);
var num=get.cnNumber(cards.length);
var trans=get.translation(player);
var prompt=('弃置'+num+'张牌,然后'+trans+'摸一张牌');
if(cards.length>1) prompt+=(';或弃置一张牌,然后'+trans+'摸'+num+'张牌');
var next=target.chooseToDiscard(prompt,'he',true);
next.numx=cards.length;
next.selectCard=function(){
if(ui.selected.cards.length>1) return _status.event.numx;
return [1,_status.event.numx];
};
next.complexCard=true;
next.ai=function(card){
if(ui.selected.cards.length==0||(_status.event.player.countCards('he',function(cardxq){
return get.value(cardxq)<7;
})>=_status.event.numx)) return 7-get.value(card);
return -1;
};
'step 1'
if(result.bool){
if(result.cards.length==cards.length) player.draw();
else player.draw(cards.length);
event.cardsx.addArray(result.cards);
for(var i=0;i0;
},
content:function(){
'step 0'
var es=player.getCards('e');
event.count=es.length;
player.discard(es);
'step 1'
event.count--;
if(game.hasPlayer(function(current){
return current.countDiscardableCards(player,'ej')>0;
})){
player.chooseTarget('请选择一名角色,弃置其装备区或判定区内的一张牌。',true,function(card,player,target){
return target.countDiscardableCards(player,'ej')>0;
}).ai=function(target){
var att=get.attitude(_status.event.player,target);
if(target.countCards('j')&&att>0) return att*1.5;
return -att;
};
}
else event.finish();
'step 2'
if(result.bool&&result.targets&&result.targets.length){
var target=result.targets[0];
player.line(target,{color:[220, 90, 139]});
player.discardPlayerCard(target,'ej',true);
if(event.count) event.goto(1);
}
},
},
noname_zhuyuan:{
enable:"phaseUse",
position:"he",
selectCard:4,
complexCard:true,
charlotte:true,
prompt:"将4张花色各不同的牌交一名角色并令你与其获得【铁骑】和【激昂】直到各自回合结束",
check:function(card){
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0;
if(!ui.selected.cards.length&&card.name=='du') return 20;
var player=get.owner(card);
if(ui.selected.cards.length>=Math.max(2,player.countCards('h')-player.hp)) return 0;
if(player.hp==player.maxHp||player.countCards('h')<=1){
var players=game.filterPlayer();
for(var i=0;i=3&&
get.attitude(players[i],player)>=3){
return 11-get.value(card);
}
}
if(player.countCards('h')>player.hp) return 10-get.value(card);
if(player.countCards('h')>2) return 6-get.value(card);
return -1;
}
return 10-get.value(card);
},
filterCard:function(card,player){
var suit=get.suit(card,player);
for(var i=0;i",
intro:{
name:"小无·铁骑",
content:"你使用【杀】指定一名角色为目标后,可以进行一次判定并令该角色的非锁定技失效直到回合结束,除非该角色弃置一张与判定结果花色相同的牌,否则不能使用【闪】抵消此【杀】。",
},
},
noname_jiang:{
inherit:"jiang",
mark:true,
marktext:"",
intro:{
name:"小无·激昂",
content:"每当你使用(指定目标后)或被使用(成为目标后)一张【决斗】或红色的【杀】时,你可以摸一张牌。",
},
},
noname_duocai:{
trigger:{
global:["loseAfter","loseAsyncAfter"],
},
filter:function(event,player){
if(event.type!='discard'||event.getlx===false) return false;
var evt=event.getl(player);
var cards=event.cards.slice(0);
if(evt&&evt.cards) cards.removeArray(evt.cards);
return cards.filterInD('d').length>0&&!player.hasSkill('noname_duocai2');
},
direct:true,
charlotte:true,
content:function(){
"step 0"
if(trigger.delay==false&&player!=game.me&&!player.isOnline()) game.delay();
var evt=trigger.getl(player);
var cards=trigger.cards.slice(0);
cards.removeArray(evt.cards);
player.chooseButton([get.prompt('noname_duocai'),cards],[1,cards.length]);
"step 1"
if(result.bool){
player.logSkill('noname_duocai');
player.addTempSkill('noname_duocai2');
player.gain(result.links,'gain2');
if(result.links.length>2){
var filterTarget=function(card,player,target){
return target!=player&&target.countDiscardableCards(player,'hej')>0;
};
if(game.hasPlayer(function(current){
return filterTarget(null,player,current);
})){
player.chooseTarget('弃置一名其他角色区域内的一张牌',true,filterTarget).set('ai',function(target){
var player=_status.event.player;
return get.effect(target,{name:'guohe'},player,player);
});
}
else event.finish();
}
else{
if(result.links.length==2) player.draw();
else player.recover();
event.finish();
}
}
else event.finish();
"step 2"
if(result.bool){
var target=result.targets[0];
player.line(target,'green');
player.discardPlayerCard(target,'hej',true);
}
},
},
noname_duocai2:{charlotte:true},
nsbizhao:{
trigger:{player:'showCharacterAfter'},
forced:true,
hiddenSkill:true,
filter:function(event,player){
return event.toShow&&event.toShow.contains('ns_yanghu')&&player!=_status.currentPhase;
},
content:function(){
player.addTempSkill('nsbizhao2',{player:'phaseBeginStart'});
},
},
nsbizhao2:{
charlotte:true,
mark:true,
intro:{content:'其他角色至自己的距离+1'},
mod:{
globalTo:function(source,player,distance){
return distance+1;
},
},
},
nsqingde:{
trigger:{
player:'damageEnd',
source:'damageSource',
},
usable:1,
filter:function(event,player){
if(!event.card||!event.cards||event.player==event.source||(event.card.name!='sha'&&
get.type(event.card)!='trick')||event.cards.filterInD().length!=1) return false;
var target=lib.skill.nsqingde.logTarget(event,player);
if(player.hasSkillTag('noCompareSource')||target.hasSkillTag('noCompareTarget')) return false;
return target.countCards('h')>0;
},
logTarget:function(event,player){
if(player==event.source) return event.player;
return event.source;
},
check:function(event,player){
var target=lib.skill.nsqingde.logTarget(event,player);
return get.attitude(player,target)<=0;
},
content:function(){
'step 0'
var target=lib.skill.nsqingde.logTarget(trigger,player);
event.target=target
var next=player.chooseToCompare(target);
if(event.triggername=='damageSource') next.set('small',true);
if(!next.fixedResult) next.fixedResult={};
next.fixedResult[player.playerid]=trigger.cards.filterInD()[0];
'step 1'
if(result.tie){
event.finish();
return;
}
var i=result.bool;
if(event.triggername=='damageSource') i=!i;
event.target2=i?player:target;
if(event.triggername=='damageSource') event.goto(3);
else if(event.target2.isDamaged()) player.chooseBool('是否令'+get.translation(event.target2)+'回复1点体力?').set('ai',function(){
var evt=_status.event.getParent();
return get.attitude(evt.player,evt.target2)>0;
});
else event.finish();
'step 2'
if(result.bool) event.target2.recover();
event.finish();
'step 3'
player.chooseBool('是否令'+get.translation(event.target2)+'摸两张牌?').set('ai',function(){
var evt=_status.event.getParent();
return get.attitude(evt.player,evt.target2)>0;
});
'step 4'
if(result.bool) event.target2.draw(2);
},
ai:{
effect:{
target:function(card,player,target,current){
if(target.storage.counttrigger&&target.storage.counttrigger.nsqingde) return;
var num=get.number(card);
if(typeof num=='number'){
if(target.hasSkillTag('noCompareSource')||player.hasSkillTag('noCompareTarget')) return;
var hs=player.getCards('h');
if(card.cards) hs.removeArray(card.cards);
if(ui.selected.cards) hs.removeArray(ui.selected.cards);
if(!hs.length) return;
for(var i of hs){
if(get.number(i)>=num) return;
if(player.hasSkill('tianbian')&&get.suit(card)=='heart') return;
}
return 'zerotarget';
}
},
},
},
},
nsyidi:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return player.countCards('h')>0;
},
filterCard:true,
filterTarget:lib.filter.notMe,
discard:false,
lose:false,
delay:false,
check:function(card){
var player=_status.event.player;
if(get.type(card,player)=='basic'){
if(game.hasPlayer(function(current){
return get.attitude(current,player)>0&¤t.getUseValue(card)>player.getUseValue(card,null,true);
})) return 5+Math.random();
return 0;
}
if(game.hasPlayer(function(current){
return get.attitude(current,player)>0&&!current.hasJudge('lebu')&¤t.getUseValue(card)>player.getUseValue(card);
})) return 4.7+Math.random();
if(card.name=='wuxie'&&game.hasPlayer(function(current){
return get.attitude(current,player)>0;
})) return 5+Math.random();
return 4-get.value(card);
},
content:function(){
'step 0'
player.give(cards,target,'visible');
if(get.type(cards[0],player)!='basic'){
player.draw();
event.finish();
}
'step 1'
if(target.getCards('h').contains(cards[0])&&target.hasUseTarget(cards[0])) target.chooseUseTarget(cards[0]);
},
ai:{
order:7,
result:{
player:function(player,target){
if(!ui.selected.cards.length||get.type(ui.selected.cards[0],player)=='basic') return 0;
if(get.value(ui.selected.cards[0])<4) return 2;
return 0.5;
},
target:1,
},
},
},
nsfuzhou:{
enable:'phaseUse',
usable:2,
filter:function(event,player){
if(!player.storage.nstaiping&&player.getStat('skill').nsfuzhou) return false;
return player.countCards('he',{color:'black'})>0;
},
filterCard:{color:'black'},
filterTarget:function(card,player,target){
return !target.hasJudge('nsfuzhou_card');
},
check:function(card){
return 8-get.value(card);
},
prepare:'give',
position:'he',
discard:false,
lose:false,
delay:false,
content:function(){
'step 0'
target.addJudge({name:'nsfuzhou_card'},cards[0]);
cards[0].storage.nsfuzhou_source=player;
'step 1'
game.delayx();
},
ai:{
order:5,
result:{
target:function(player,target){
if(player.storage.nsfuzhou_draw){
if(get.attitude(player,target)>0&&player.countCards('he',function(card){
return get.color(card)=='red';
})){
return 1;
}
return 0;
}
if(player.storage.nsfuzhou_damage) return -2;
return -1.5;
},
},
},
},
nsfuzhou_num:{
charlotte:true,
onremove:true,
mod:{
maxHandcard:function(player,num){
return num+player.storage.nsfuzhou_num;
},
},
intro:{
content:function(num){
return '手牌上限'+(num<0?'':'+')+num;
},
}
},
nsguidao:{
trigger:{global:'judge'},
filter:function(event,player){
return player.countCards('hes',function(card){
if(player.storage.nstaiping||(_status.connectMode&&get.position(card)!='e')) return true;
return get.color(card)=='black';
})>0;
},
direct:true,
content:function(){
"step 0"
player.chooseCard(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+
get.translation(trigger.player.judging[0])+','+get.prompt('nsguidao'),'hes',function(card,player){
if(!player.storage.nstaiping&&get.color(card)!='black') return false;
var player=_status.event.player;
var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player);
if(mod2!='unchanged') return mod2;
var mod=game.checkMod(card,player,'unchanged','cardRespondable',player);
if(mod!='unchanged') return mod;
return true;
}).set('ai',function(card){
var trigger=_status.event.getTrigger();
var player=_status.event.player;
var judging=_status.event.judging;
var result=trigger.judge(card)-trigger.judge(judging);
var attitude=get.attitude(player,trigger.player);
if(attitude==0||result==0) return 0;
if(attitude>0){
return result;
}
else{
return -result;
}
}).set('judging',trigger.player.judging[0]);
"step 1"
if(result.bool){
player.respond(result.cards,'highlight','nsguidao','noOrdering');
}
else{
event.finish();
}
"step 2"
if(result.bool){
player.$gain2(trigger.player.judging[0]);
player.gain(trigger.player.judging[0]);
trigger.player.judging[0]=result.cards[0];
trigger.orderingCards.addArray(result.cards);
game.log(trigger.player,'的判定牌改为',result.cards[0]);
}
"step 3"
game.delay(2);
},
ai:{
rejudge:true,
tag:{
rejudge:1
}
}
},
nstaiping:{
trigger:{player:'phaseZhunbeiBegin'},
forced:true,
juexingji:true,
skillAnimation:true,
animationColor:'thunder',
filter:function(event,player){
return player.getAllHistory('sourceDamage',function(evt){
return evt.getParent().name=='nsfuzhou_card';
}).length>1||player.getAllHistory('gain',function(evt){
return evt.getParent(2).name=='nsfuzhou_card';
}).length>1;
},
content:function(){
player.awakenSkill('nstaiping');
player.storage.nstaiping=true;
if(player.getAllHistory('sourceDamage',function(evt){
return evt.getParent().name=='nsfuzhou_card';
}).length>1) player.storage.nsfuzhou_damage=true;
if(player.getAllHistory('gain',function(evt){
return evt.getParent(2).name=='nsfuzhou_card';
}).length>1) player.storage.nsfuzhou_draw=true;
},
derivation:['nsfuzhou_damage','nsfuzhou_draw'],
},
nsweiyuan:{
trigger:{player:'useCardToTargeted'},
direct:true,
filter:function(event,player){
return player!=event.target&&event.targets&&event.targets.length==1&&event.target.isAlive()
&&player.isPhaseUsing()&&!player.hasSkill('nsweiyuan2')&&game.hasPlayer(function(current){
return current!=player&¤t!=event.target;
});
},
content:function(){
'step 0'
player.chooseTarget(get.prompt2('nsweiyuan'),function(card,player,target){
return target!=player&&target!=_status.event.getTrigger().target;
}).set('ai',function(target){
return Math.max(Math.random(),get.attitude(player,target));
});
'step 1'
if(result.bool){
player.addTempSkill('nsweiyuan2','phaseUseAfter');
var target=result.targets[0];
event.target=target;
player.logSkill('nsweiyuan',target);
target.chooseCard('he','交给'+get.translation(trigger.target)+'一张牌并受到一点伤害,或令'+get.translation(player)+'摸一张牌且可以重复使用牌').set('ai',function(card){
if(_status.event.goon) return Math.random();
return 0;
}).set('goon',function(){
if(get.attitude(target,player)>0) return false;
return Math.random()>0.5;
}());
}
else event.finish();
'step 2'
if(result.bool){
target.gain(result.cards,trigger.target);
target.damage();
}
else{
player.addTempSkill('nsweiyuan_use');
player.draw();
}
},
},
nsweiyuan2:{charlotte:true},
nsweiyuan_use_backup:{},
nsweiyuan_use:{
enable:'phaseUse',
charlotte:true,
mod:{
cardUsable:function(){
if(_status.event.skill=='nsweiyuan_use_backup') return Infinity;
},
targetInRange:function(){
if(_status.event.skill=='nsweiyuan_use_backup') return true;
},
},
onChooseToUse:function(event){
if(game.online||event.type!='phase') return;
var list=[];
event.player.getHistory('useCard',function(evt){
var name=evt.card.name;
var type=get.type(name);
if(type!='basic'&&type!='trick') return;
if(name=='sha'){
var nature=evt.card.nature;
switch(nature){
case 'fire':name='huosha';break;
case 'thunder':name='leisha';break;
case 'kami':name='kamisha';break;
case 'ice':name='icesha';break;
}
}
list.add(type+'咕咕'+name);
});
event.set('nsweiyuan_list',list);
},
filter:function(event,player){
return player.countCards('h')>0&&event.nsweiyuan_list&&event.nsweiyuan_list.length>0;
},
chooseButton:{
dialog:function(event,player){
return ui.create.dialog('围援',[event.nsweiyuan_list.map(function(i){
return i.split('咕');
}),'vcard']);
},
filter:function(button,player){
return lib.filter.cardEnabled({
name:button.link[2],
nature:button.link[3],
},player);
},
check:function(button){
return _status.event.player.getUseValue({
name:button.link[2],
nature:button.link[3],
},false);
},
backup:function(links,player){
return {
popname:true,
position:'h',
filterCard:true,
ai1:function(card){
return 7-get.value(card);
},
viewAs:{
name:links[0][2],
nature:links[0][3],
},
onuse:function(links,player){
player.removeSkill('nsweiyuan_use');
},
}
},
prompt:function(links,player){
return '将一张手牌当做'+get.translation(links[0][3]||'')+get.translation(links[0][2])+'使用';
},
},
ai:{
order:1,
result:{
player:1,
},
},
},
nsjuxian:{
trigger:{player:'damageBegin2'},
filter:function(event,player){
return !player.hasSkill('nsjuxian2');
},
check:function(event,player){
if(player.countCards('h')+2>=player.maxHp) return !event.source||!event.source.countCards('he')||get.attitude(player,event.source)>0;
return true;
},
content:function(){
'step 0'
player.addSkill('nsjuxian2');
player.draw(2);
'step 1'
var target=trigger.source;
if(player.countCards('h')>=player.maxHp&&target&&target.countCards('he')){
player.line(target,'green');
target.chooseToDiscard('he',true);
}
},
},
nsjuxian2:{
trigger:{player:'phaseDrawBefore'},
forced:true,
charlotte:true,
content:function(){
player.removeSkill('nsjuxian2');
trigger.cancel();
game.log(player,'跳过了','#y摸牌阶段');
},
},
nsdiewu:{
trigger:{
player:['damageEnd','gainAfter'],
global:'loseAsyncAfter',
},
forced:true,
locked:false,
filter:function(event,player){
if(event.name!='damage') return event.getg(player).length>1;
return true;
},
content:function(){
player.addMark('nsdiewu',1);
},
intro:{
content:'mark',
},
group:['nsdiewu_sha','nsdiewu_shan','nsdiewu_draw'],
subSkill:{
sha:{
enable:'chooseToUse',
viewAs:{name:'sha',isCard:true},
prompt:'视为使用一张【杀】',
viewAsFilter:function(player){
return player.countMark('nsdiewu')>0;
},
filterCard:()=>false,
selectCard:-1,
onuse:function(links,player){
player.removeMark('nsdiewu',1);
},
ai:{
order:function(){
var player=_status.event.player;
if(!player.storage.nspojian&&player.countMark('nsdiewu')<=player.hp) return 0;
return get.order({name:'sha'})+0.1;
},
},
},
shan:{
enable:'chooseToUse',
viewAs:{name:'shan',isCard:true},
viewAsFilter:function(player){
return player.countMark('nsdiewu')>0&&!player.storage.nspojian;
},
filterCard:()=>false,
selectCard:-1,
onuse:function(links,player){
player.removeMark('nsdiewu',1);
},
ai:{
order:function(){
var player=_status.event.player;
if(player.hp>1&&player.countMark('nsdiewu')<=player.hp) return 0;
return get.order({name:'shan'})-0.2;
},
},
},
draw:{
trigger:{source:'damageEnd'},
forced:true,
popup:false,
filter:function(event,player){
var evt=event.getParent();
return evt&&evt.type=='card'&&evt.skill=='nsdiewu_sha';
},
content:function(){
player.draw();
},
},
},
ai:{
respondSha:true,
respondShan:true,
skillTagFilter:function(player,tag){
if(tag=='respondShan'&&player.storage.nspojian) return false;
return player.countMark('nsdiewu')>0;
},
},
},
nslingying:{
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha') return num+1;
},
targetInRange:function(card){
if(card.name=='sha') return true;
},
},
},
nspojian:{
trigger:{player:'phaseZhunbeiBegin'},
forced:true,
juexingji:true,
skillAnimation:true,
animationColor:'fire',
filter:function(event,player){
return player.countMark('nsdiewu')>=player.hp;
},
content:function(){
player.awakenSkill('nspojian');
player.storage.nspojian=true;
player.loseMaxHp();
player.draw(2);
player.addSkill('nsliegong');
},
derivation:'nsliegong',
},
nsliegong:{
inherit:'xinliegong',
},
nsguolie:{
trigger:{player:'phaseDrawBefore'},
check:function(event,player){
var h1=player.getUseValue({name:'sha'},false);
var h2=player.getUseValue({name:'guohe'});
return player.countCards('h',function(card){
if(get.color(card)=='red') return h1>0;
return h2>0;
})>2;
},
content:function(){
trigger.cancel();
player.addTempSkill('nsguolie2');
},
},
nsguolie2:{
mod:{
cardname:function(card,player){
var color=get.color(card,player);
if(color=='red') return 'sha';
if(color=='black') return 'guohe';
},
cardnature:function(){
return false;
},
cardUsable:function(){
return Infinity;
},
targetInRange:function(){
return true;
},
},
trigger:{player:'phaseJieshuBegin'},
forced:true,
filter:function(event,player){
var cards=[];
game.getGlobalHistory('cardMove',function(evt){
if(evt.player==player) return;
for(var i of evt.cards){
if(get.position(i,true)=='d') cards.push(i);
}
});
return cards.length>0;
},
content:function(){
var cards=[];
game.getGlobalHistory('cardMove',function(evt){
if(evt.player==player) return;
if(evt.name=='cardsDiscard'&&evt.parent.name=='orderingDiscard') return;
for(var i of evt.cards){
if(get.position(i,true)=='d') cards.push(i);
}
});
player.gain(cards,'gain2');
},
},
nslongyue:{
trigger:{global:'useCard'},
filter:function(event,player){
return get.type(event.card,'trick')=='trick'&&event.player.getHistory('useCard').indexOf(event)==0;
},
logTarget:'player',
check:function(event,player){
return get.attitude(player,event.player)>0;
},
content:function(){
trigger.player.draw();
},
ai:{
expose:0.2,
},
global:'nslongyue_ai',
},
nslongyue_ai:{
mod:{
aiOrder:function(player,card,num){
if(!player.getHistory('useCard').length&&get.type(card)=='trick'&&game.hasPlayer(function(current){
return current.hasSkill('nslongyue')&&get.attitude(player,current)>=0;
})) return num+6;
},
},
},
nszhenyin:{
trigger:{global:'judge'},
usable:1,
filter:function(event,player){
return _status.currentPhase&&_status.currentPhase.countCards('h')>0;
},
logTarget:function(){
return _status.currentPhase;
},
check:function(event,player){
var target=_status.currentPhase;
var judge=event.judge(event.player.judging[0]);
var max=0;
var hs=target.getCards('h',function(card){
var mod2=game.checkMod(card,target,'unchanged','cardEnabled2',target);
if(mod2!='unchanged') return mod2;
var mod=game.checkMod(card,target,'unchanged','cardRespondable',target);
if(mod!='unchanged') return mod;
return true;
});
for(var i of hs){
var num=event.judge(i)-judge;
if(num>max) max=num;
}
var att=get.attitude(player,target);
if(att>0) return max>0;
if(att<0) return max<=0;
return false;
},
content:function(){
"step 0"
if(!_status.currentPhase.countCards('h',function(card){
var player=_status.currentPhase;
var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player);
if(mod2!='unchanged') return mod2;
var mod=game.checkMod(card,player,'unchanged','cardRespondable',player);
if(mod!='unchanged') return mod;
return true;
})){
event.finish();
return;
};
_status.currentPhase.chooseCard(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+
get.translation(trigger.player.judging[0])+',请打出一张手牌进行改判','h',true,function(card){
var player=_status.event.player;
var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player);
if(mod2!='unchanged') return mod2;
var mod=game.checkMod(card,player,'unchanged','cardRespondable',player);
if(mod!='unchanged') return mod;
return true;
}).set('ai',function(card){
var trigger=_status.event.getTrigger();
var player=_status.event.player;
var judging=_status.event.judging;
var result=trigger.judge(card)-trigger.judge(judging);
var attitude=get.attitude(player,trigger.player);
if(attitude==0||result==0) return 0;
if(attitude>0){
return result/Math.max(0.1,get.value(card));
}
else{
return -result/Math.max(0.1,get.value(card));
}
}).set('judging',trigger.player.judging[0]);
"step 1"
if(result.bool){
_status.currentPhase.respond(result.cards,'highlight').nopopup=true;
}
else{
event.finish();
}
"step 2"
if(result.bool){
if(trigger.player.judging[0].clone){
trigger.player.judging[0].clone.classList.remove('thrownhighlight');
game.broadcast(function(card){
if(card.clone){
card.clone.classList.remove('thrownhighlight');
}
},trigger.player.judging[0]);
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
}
game.cardsDiscard(trigger.player.judging[0]);
trigger.player.judging[0]=result.cards[0];
trigger.orderingCards.addArray(result.cards);
game.log(trigger.player,'的判定牌改为',result.cards[0]);
game.delay(2);
}
},
ai:{
rejudge:true,
tag:{
rejudge:1,
}
}
},
nsxianhai:{
trigger:{global:'damageSource'},
filter:function(event,player){
return event.source&&event.source!=player&&event.source.isAlive()&&event.source==_status.currentPhase&&
(event.source.getStat('damage')||0)>(player.getLastStat('damage')||0)&&
!player.hasSkill('nsxianhai_round');
},
check:function(event,player){
return player.maxHp>1&&get.attitude(player,event.source)<-4;
},
logTarget:'source',
content:function(){
'step 0'
player.addTempSkill('nsxianhai_round','roundStart');
player.loseMaxHp();
var list=[];
for(var i=1;i<6;i++){
if(!trigger.source.isDisabled(i)) list.add('equip'+((i==3||i==4)?6:i));
}
if(list.length){
player.chooseControl(list).set('prompt','选择废除'+get.translation(trigger.source)+'的一种装备栏').set('ai',function(){
var target=_status.event.getTrigger().source;
if(list.contains('equip6')&&target.getEquip('equip3')&&target.getEquip('equip4')) return 'equip6';
if(list.contains('equip2')&&target.getEquip(2)&&get.value(target.getEquip(2),target)>0) return 'equip2';
if(list.contains('equip5')&&target.getEquip(5)&&get.value(target.getEquip(5),target)>0) return 'equip5';
return 0;
});
}
else event.goto(2);
'step 1'
if(result.control!='equip6') trigger.source.disableEquip(result.control);
else{
trigger.source.disableEquip(3);
trigger.source.disableEquip(4);
}
'step 2'
if(player.awakenedSkills.contains('nsxingchu')){
var next=game.createEvent('nsxianhai_clear');
event.next.remove(next);
event.getParent('phase').after.push(next);
next.player=player;
next.setContent(function(){
player.restoreSkill('nsxingchu');
});
}
'step 3'
if(trigger.source){
var hs=trigger.source.getCards('h','shan');
if(hs.length) trigger.source.discard(hs);
}
},
},
nsxianhai_round:{charlotte:true},
nsxingchu:{
trigger:{global:'die'},
forceDie:true,
filter:function(event,player){
return player==event.player||player==event.source;
},
limited:true,
skillAnimation:true,
animationColor:'wood',
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt2('nsxingchu')).set('ai',function(target){
return get.attitude(_status.event.player,target);
}).set('forceDie',true);
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('nsxingchu',target);
player.awakenSkill('nsxingchu');
var he=trigger.player.getCards('he');
if(he.length) target.gain(he,trigger.player,'giveAuto','bySelf');
target.gainMaxHp();
}
},
},
nsshengyan:{
trigger:{player:'judgeEnd'},
forced:true,
filter:function(event,player){
return _status.currentPhase&&_status.currentPhase.isAlive()&&(!player.storage.nsshengyan2||!player.storage.nsshengyan2.contains(event.result.suit));
},
logTarget:function(){
return _status.currentPhase;
},
content:function(){
player.addTempSkill('nsshengyan2');
if(!player.storage.nsshengyan2) player.storage.nsshengyan2=[];
_status.currentPhase.addTempSkill('nsshengyan3');
player.storage.nsshengyan2.add(trigger.result.suit);
_status.currentPhase.addMark('nsshengyan3',2,false);
},
},
nsshengyan2:{onremove:true},
nsshengyan3:{
mod:{
maxHandcard:function(player,num){
return num+player.countMark('nsshengyan3');
},
},
onremove:true,
intro:{
content:'本回合手牌上限+#',
},
marktext:'筵',
},
nsdaizhan:{
trigger:{player:'phaseZhunbeiBegin'},
direct:true,
filter:function(event,player){
return (!player.hasJudge('lebu')||!player.hasJudge('bingliang'))&&player.countCards('he',function(card){
if(_status.connectMode) return true;
return get.type(card,'trick')!='trick';
});
},
content:function(){
var next=player.chooseToUse();
next.set('norestore',true);
next.set('_backupevent','nsdaizhanx');
next.set('custom',{
add:{},
replace:{window:function(){}}
});
next.backup('nsdaizhanx');
},
},
nsdaizhanx:{
chooseButton:{
dialog:function(){
var list=['lebu','bingliang'];
var list2=[];
for(var i of list){
list2.push(['延时锦囊','',i]);
}
return ui.create.dialog(get.prompt('nsdaizhan'),[list2,'vcard'],'hidden');
},
filter:function(button,player){
return !player.hasJudge(button.link[2])
},
check:function(button){
if(button.link[2]=='lebu') return 0;
var player=_status.event.player;
var delta=player.getHandcardLimit()+player.countCards('j')*2+2-player.hp;
if(delta>=2) return 1+Math.random();
if(delta>=0&&!player.countCards('h',function(card){
return player.hasValueTarget(card);
})) return Math.random();
return 0;
},
backup:function(links,player){
return {
filterCard:function(card,player){
return get.itemtype(card)=='card'&&get.type(card,'trick')!='trick'&&player.canAddJudge({name:links[0][2],cards:[card]});
},
filterTarget:function(card,player,target){
return player==target;
},
check:function(card){
return 8-get.value(card);
},
viewAs:{name:links[0][2]},
position:'he',
precontent:function(){
player.addTempSkill('nsdaizhany');
event.result.skill='nsdaizhan';
},
ai:{
result:{
target:1,
},
},
};
},
prompt:function(links){
return '将一张牌当做'+get.translation(links[0][2])+'对自己使用';
},
},
},
nsdaizhany:{
trigger:{player:'phaseEnd'},
forced:true,
popup:false,
filter:function(event,player){
return player.countCards('h')0;
},
locked:function(skill,player){
return player&&player.storage.nsfuwei;
},
content:function(){
'step 0'
var target=(event.triggername=='damageSource'?trigger.source:trigger.player);
event.target=target;
player.choosePlayerCard(target,'hej',player.storage.nsfuwei?true:1).set('ai',function(button){
var val=get.buttonValue(button);
if(get.attitude(_status.event.player,get.owner(button.link))>0) return -val;
return val;
});
'step 1'
if(result.bool){
player.logSkill('nsjiquan',target);
player.addToExpansion(result.cards,target,'give').gaintag.add('nsjiquan_mark');
}
else event.finish();
'step 2'
game.delayx();
},
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha') return num+player.getExpansions('nsjiquan_mark').length;
},
},
},
nsjiquan_mark:{
intro:{
content:'expansion',
markcount:'expansion',
},
marktext:'威',
},
nsfuwei:{
trigger:{player:'phaseJieshuBegin'},
forced:true,
unique:true,
juexingji:true,
skillAnimation:true,
animationColor:'thunder',
filter:function(event,player){
return player.getExpansions('nsjiquan_mark').length>4;
},
content:function(){
player.awakenSkill('nsfuwei');
player.storage.nsfuwei=true;
player.addSkill('nsdiemou');
player.addSkill('nszhihuang');
player.gainMaxHp(2);
},
derivation:['nsdiemou','nszhihuang'],
},
nsdiemou:{
trigger:{player:'phaseUseBegin'},
forced:true,
filter:function(event,player){
return player.getExpansions('nsjiquan_mark').length>game.players.length;
},
content:function(){
var cards=player.getExpansions('nsjiquan_mark');
player.draw(cards.length);
player.loseMaxHp();
player.loseToDiscardpile(cards);
if(cards.length>4) player.turnOver();
},
},
nszhihuang:{
group:'nszhihuang_damage',
trigger:{global:'useCard'},
usable:1,
filter:function(event,player){
return event.player==get.zhu(player)&&player.getExpansions('nsjiquan_mark').length>0&&event.cards&&event.cards.filterInD().length>0;
},
prompt2:function(event){
return '移去一张“威”并获得'+get.translation(event.cards.filterInD());
},
check:function(event,player){
if(['equip','delay'].contains(get.type(event.card))) return get.attitude(player,event.player)<0;
return get.value(event.cards.filterInD())>0;
},
logTarget:'player',
content:function(){
'step 0'
var cards=player.getExpansions('nsjiquan_mark');
if(cards.length==1) event._result={
bool:true,
links:cards.slice(0),
}
else player.chooseButton(['选择移去一张“威”',cards],true);
'step 1'
player.loseToDiscardpile(result.links);
player.gain(trigger.cards.filterInD(),'gain2','log');
},
},
nszhihuang_damage:{
trigger:{source:'damageBegin1'},
forced:true,
filter:function(event,player){
var zhu=get.zhu(player);
return zhu&&player.countCards('h')>zhu.countCards('h')&&event.getParent().type=='card';
},
content:function(){
trigger.num++;
},
},
//2013标准包双蜀黑
junkjizhi:{
audio:'jizhi',
trigger:{player:'useCard'},
frequent:true,
filter:function(event,player){
return get.type(event.card)=='trick'&&event.card.isCard;
},
content:function(){
'step 0'
var card=get.cards()[0];
event.card=card;
game.cardsGotoOrdering(card);
player.showCards(card,get.translation(player)+'发动了【集智】');
if(get.type(card)!='basic'){
player.gain(card,'gain2');
event.finish();
}
else if(!player.countCards('h')) event.finish();
'step 1'
player.chooseCard('h','是否用一张手牌交换'+get.translation(card)+'?','若选择「取消」,则'+get.translation(card)+'将被置入弃牌堆。');
'step 2'
if(result.bool){
var card=result.cards[0];
player.$throw(card,1000);
game.log(player,'将',card,'置于牌堆顶');
player.lose(card,ui.cardPile,'visible','insert');
player.gain(event.card,'gain2');
}
},
},
junkqicai:{
mod:{
targetInRange:function(card,player,target,now){
var type=get.type(card);
if(type=='trick'||type=='delay') return true;
},
canBeDiscarded:function(card){
if(get.position(card)=='e'&&!['equip3','equip4','equip6'].contains(get.subtype(card))) return false;
},
},
},
junkrende:{
audio:'rende',
enable:'phaseUse',
usable:1,
filter:function(event,player){
return player.countCards('h')>0;
},
filterTarget:lib.filter.notMe,
filterCard:true,
selectCard:[1,Infinity],
position:'h',
discard:false,
lose:false,
delay:false,
content:function(){
'step 0'
event.num=cards.length;
event.targets=targets.slice(0);
player.give(cards,target);
if(event.num>1) player.recover();
'step 1'
if(player.countCards('h')>0&&game.hasPlayer(current=>(current!=player&&!targets.contains(current)))){
player.chooseCardTarget({
prompt:'是否继续分配剩余的手牌',
prompt2:'操作提示:请先选择要分配的手牌,然后再选择一名角色,该角色将获得你选择的所有手牌。',
filterCard:true,
selectCard:[1,Infinity],
filterTarget:function(card,player,target){
return target!=player&&!_status.event.getParent().targets.contains(target);
},
});
}
else event.finish();
'step 2'
if(result.bool){
var target=result.targets[0],cards=result.cards;
player.line(target,'green');
player.give(cards,target);
targets.add(target);
event.num+=cards.length;
if(num<2&&event.num>1) player.recover();
event.goto(1);
}
},
},
//十周年削弱版张让
junktaoluan:{
audio:'taoluan',
enable:'chooseToUse',
filter:function(event,player){
return event.type!='wuxie'&&event.type!='respondShan'&&!player.hasSkill('junktaoluan3')&&player.countCards('hes',function(card){
return !player.storage.junktaoluan2.contains(get.suit(card));
})>0;
},
init:function(player){
if(!player.storage.junktaoluan) player.storage.junktaoluan=[];
if(!player.storage.junktaoluan2) player.storage.junktaoluan2=[];
},
chooseButton:{
dialog:function(event,player){
var list=[];
for(var i=0;i0) return 0;
if(button.link[2]=='wugu') return;
var effect=player.getUseValue(button.link[2]);
if(effect>0) return effect;
return 0;
},
backup:function(links,player){
return {
filterCard:function(card,player){
return !player.storage.junktaoluan2.contains(get.suit(card));
},
audio:'taoluan',
selectCard:1,
popname:true,
check:function(card){
return 6-get.value(card);
},
position:'hse',
viewAs:{name:links[0][2],nature:links[0][3]},
onuse:function(result,player){
player.storage.junktaoluan2.add(get.suit(result.cards[0],player));
var evt=_status.event.getParent('phase');
if(evt&&evt.name=='phase'&&!evt.junktaoluan){
evt.junktaoluan=true;
var next=game.createEvent('taoluan_clear');
_status.event.next.remove(next);
evt.after.push(next);
next.player=player;
next.setContent(function(){
//player.storage.junktaoluan=[];
player.storage.junktaoluan2=[];
});
}
player.storage.junktaoluan.add(result.card.name);
},
}
},
prompt:function(links,player){
return '将一张牌当做'+(get.translation(links[0][3])||'')+get.translation(links[0][2])+'使用';
}
},
ai:{
order:4,
result:{
player:function(player){
var players=game.filterPlayer();
for(var i=0;i0){
return 1;
}
}
return 0;
}
},
threaten:1.9,
},
group:['junktaoluan2','junktaoluan4','junktaoluan5']
},
junktaoluan2:{
trigger:{player:['useCardAfter','respondAfter']},
forced:true,
popup:false,
filter:function(event,player){
return event.skill=='junktaoluan_backup'||event.skill=='junktaoluan5'||event.skill=='junktaoluan4';
},
content:function(){
'step 0'
player.chooseTarget(true,function(card,player,target){
return target!=player;
},'###滔乱###令一名其他角色选择一项:1.交给你一张与你以此法使用的牌类别不同的牌;2.你失去1点体力').set('ai',function(target){
var player=_status.event.player;
if(get.attitude(player,target)>0){
if(get.attitude(target,player)>0){
return target.countCards('h');
}
return target.countCards('h')/2;
}
return 0;
});
'step 1'
var target=result.targets[0];
event.target=target;
player.line(target,'green');
var type=get.type(trigger.card,'trick');
target.chooseCard('###滔乱###交给'+get.translation(player)+'一张不为'+get.translation(type)+'牌的牌,或令其失去1点体力且滔乱无效直到回合结束','he',num,function(card,player,target){
return get.type(card,'trick')!=_status.event.cardType;
}).set('cardType',type).set('ai',function(card){
if(_status.event.att){
return 11-get.value(card);
}
return 0;
}).set('att',get.attitude(target,player)>0);
'step 2'
if(result.bool){
target.give(result.cards,player,'visible');
}
else{
player.addTempSkill('junktaoluan3');
}
}
},
junktaoluan3:{
trigger:{player:'phaseEnd'},
forced:true,
popup:false,
content:function(){
player.loseHp();
},
},
junktaoluan4:{
audio:'taoluan',
prompt:'将一张牌当做闪使用',
enable:'chooseToUse',
filter:function(event,player){
return player.countCards('hes',function(card){
return !player.storage.junktaoluan2.contains(get.suit(card));
})&&!player.storage.junktaoluan.contains('shan')&&!player.hasSkill('junktaoluan3');
},
onuse:function(result,player){
player.storage.junktaoluan2.add(get.suit(result.cards[0],player));
var evt=_status.event.getParent('phase');
if(evt&&evt.name=='phase'&&!evt.junktaoluan){
var next=game.createEvent('taoluan_clear');
_status.event.next.remove(next);
evt.after.push(next);
evt.junktaoluan=true;
next.player=player;
next.setContent(function(){
//player.storage.junktaoluan=[];
player.storage.junktaoluan2=[];
});
}
player.storage.junktaoluan.add('shan');
},
filterCard:function(card,player){
return !player.storage.junktaoluan2.contains(get.suit(card));
},
position:'hes',
selectCard:1,
viewAs:{name:'shan'},
check:function(card){
var player=_status.event.player;
var allshown=true,players=game.filterPlayer();
for(var i=0;i0){
return 6-get.value(card);
}
}
return 0;
},
ai:{
skillTagFilter:function(player){
return player.countCards('hse')&&!player.storage.junktaoluan.contains('shan')&&!player.hasSkill('junktaoluan3');
},
threaten:1.5,
respondShan:true,
}
},
junktaoluan5:{
audio:'taoluan',
enable:'chooseToUse',
prompt:'将一张牌当做无懈可击使用',
filter:function(event,player){
return player.countCards('hes',function(card){
return !player.storage.junktaoluan2.contains(get.suit(card));
})&&(!player.storage.junktaoluan.contains('wuxie'))&&!player.hasSkill('junktaoluan3');
},
viewAsFilter:function(player){
return player.countCards('hes',function(card){
return !player.storage.junktaoluan2.contains(get.suit(card));
})&&(!player.storage.junktaoluan.contains('wuxie'))&&!player.hasSkill('junktaoluan3');
},
onuse:function(result,player){
player.storage.junktaoluan2.add(get.suit(result.cards[0],player));
var evt=_status.event.getParent('phase');
if(evt&&evt.name=='phase'&&!evt.junktaoluan){
evt.junktaoluan=true;
var next=game.createEvent('taoluan_clear');
_status.event.next.remove(next);
evt.after.push(next);
next.player=player;
next.setContent(function(){
//player.storage.junktaoluan=[];
player.storage.junktaoluan2=[];
});
}
player.storage.junktaoluan.add('wuxie');
},
filterCard:function(card,player){
return !player.storage.junktaoluan2.contains(get.suit(card));
},
position:'hse',
selectCard:1,
viewAs:{name:'wuxie'},
check:function(card){
var player=_status.event.player;
if(player.isPhaseUsing()) return 0;
var allshown=true,players=game.filterPlayer();
for(var i=0;i0){
return 6-get.value(card);
}
}
return 0;
},
},
junktaoluan_backup:{charlotte:true},
nshuaishuang:{
trigger:{player:'phaseJieshuBegin'},
forced:true,
content:function(){
'step 0'
var card=get.cardPile(function(card){
return card.name=='tao';
});
if(card){
player.gain(card,'gain2');
}
else event.finish();
'step 1'
game.updateRoundNumber();
player.loseHp();
},
},
nsfengli:{
trigger:{player:'phaseEnd'},
direct:true,
filter:function(event,player){
return player.countCards('h')>0&&game.hasPlayer(function(current){
return current!=player&&!current.hasSkill('nsfengli_use');
});
},
content:function(){
'step 0'
player.chooseTarget(get.prompt2('nsfengli'),function(card,player,target){
return target!=player&&!target.hasSkill('nsfengli_use');
}).set('ai',function(target){
return get.attitude(_status.event.player,target)/(5+target.countCards('h'));
});
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('nsfengli',target);
var cards=player.getCards('h');
player.addGaintag(cards,'nsfengli2');
player.addSkill('nsfengli2');
player.showHandcards();
target.addSkill('nsfengli_use');
target.storage.nsfengli_use=player;
}
},
group:['nsfengli_draw','nsfengli_clear'],
onremove:function(player){
player.removeSkill('nsfengli2');
},
},
nsfengli_draw:{
trigger:{
player:['loseAfter','nsfengliClear'],
global:['gainAfter','equipAfter','addJudgeAfter','loseAsyncAfter','addToExpansionAfter'],
target:'nsfengliUse',
},
direct:true,
charlotte:true,
filter:function(event,player,name){
if(name!='nsfengliUse'&&name!='nsfengliClear'){
var evt=event.getl(player);
if(!evt||!evt.gaintag_map) return false;
var bool=false;
for(var i in evt.gaintag_map){
if(evt.gaintag_map[i].contains('nsfengli2')) bool=true;break;
}
if(!bool) return false;
}
var hs=player.countCards('h');
return game.hasPlayer(function(current){
return current!=player&¤t.countCards('h')false,
selectCard:-1,
precontent:function(){
var card=lib.skill.nsfengli_use_backup.card;
var target=player.storage.nsfengli_use;
event.target=target;
player.logSkill('nsfengli',target);
delete event.result.skill;
player.showCards(card,get.translation(player)+'发动了【奉礼】');
card.removeGaintag('nsfengli2');
event.trigger('nsfengliUse');
},
};
},
ai:{
hasSha:true,
hasShan:true,
skillTagFilter:function(player,tag){
var name='s'+tag.slice(4);
return lib.skill.nsfengli_use.hiddenCard(player,name);
},
},
},
ai:{
order:8,
result:{
player:1,
},
},
},
ns_chuanshu:{
audio:["xingshuai",2],
trigger:{
global:"dying",
},
priority:8,
unique:true,
skillAnimation:true,
animationColor:"water",
filter:function (event,player){
return event.player.hp<=0&&event.player!=player;
},
check:function (event,player){
return get.attitude(player,event.player)>0;
},
logTarget:"player",
content:function (){
'step 0'
trigger.player.chooseControl('releiji','guidao').set('prompt',''+get.translation(trigger.player)+'获得一项技能');
goon=true;
if(!goon){
event.finish();
}
'step 1'
trigger.player.addSkillLog(result.control);
trigger.player.recover(1-trigger.player.hp);
trigger.player.draw(2);
trigger.player.storage.ns_chuanshu2=player;
trigger.player.addSkill('ns_chuanshu2');
player.awakenSkill('ns_chuanshu');
},
},
ns_xiandao1:{
audio:["huashen",2],
forced:true,
//noLose:true,
//locked:true,
//noRemove:true,
//noDisable:true,
priority:10,
trigger:{
global:"gameStart",
player:["phaseEnd","enterGame"],
},
//filter:function (event,player){
// return player.isAlive();
//},
content:function (){
var n=[1,2].randomGet();
if(n==1){
player.addTempSkill("releiji",{player:"phaseUseBegin"});
player.markSkill("releiji",{player:"phaseUseBegin"});
};
if(n==2){
player.addTempSkill("guidao",{player:"phaseUseBegin"});
player.markSkill("guidao",{player:"phaseUseBegin"});
};
},
},
ns_xiandao2:{
audio:["huashen",2],
forced:true,
//noLose:true,
//locked:true,
//noRemove:true,
//noDisable:true,
trigger:{
player:"damageBefore",
},
filter:function (event,player){
if(!event.nature) return false;
return true;
},
content:function (){
trigger.cancel();
//event.finish();
},
},
ns_xiandao:{
forced:true,
//noLose:true,
//locked:true,
noRemove:true,
//noDisable:true,
group:["ns_xiandao1","ns_xiandao2"],
},
ns_chuanshu2:{
audio:["songwei",2],
mark:"character",
intro:{
content:"当你造成或受到一次伤害后,$摸一张牌",
},
nopop:true,
trigger:{
source:"damageEnd",
player:"damageEnd",
},
forced:true,
popup:false,
filter:function (event,player){
return player.storage.ns_chuanshu2&&player.storage.ns_chuanshu2.isIn()&&event.num>0;
},
content:function (){
'step 0'
game.delayx();
'step 1'
var target=player.storage.ns_chuanshu2;
player.line(target,'green');
target.draw();
game.delay();
},
onremove:true,
group:"ns_chuanshu3",
},
ns_chuanshu3:{
audio:1,
trigger:{
player:"dieBegin",
},
silent:true,
onremove:true,
filter:function (event,player){
return player.storage.ns_chuanshu2&&player.storage.ns_chuanshu2.isIn();
},
content:function (){
'step 0'
game.delayx();
'step 1'
var target=player.storage.ns_chuanshu2;
player.line(target,'green');
//target.addSkill('ns_chuanshu');
target.restoreSkill('ns_chuanshu');
target.update();
},
forced:true,
popup:false,
},
ns_xiuzheng:{
audio:["xinsheng",2],
enable:"phaseUse",
usable:1,
priority:10,
filter:function (event,player){
return (ui.cardPile.childElementCount+ui.discardPile.childElementCount)>=2;
},
filterTarget:function (card,player,target){
return player!=target;
},
content:function (){
"step 0"
event.cards=get.cards(2);
player.showCards(event.cards);
"step 1"
if(get.color(event.cards[0])=='red'&&get.color(event.cards[1])=='red'){
target.damage('fire');
}
if(get.color(event.cards[0])!=get.color(event.cards[1])){
player.discardPlayerCard(target,"he",true);
}
if(get.color(event.cards[0])=='black'&&get.color(event.cards[1])=='black'){
target.damage('thunder');
}
"step 2"
if(event.cards.length){
player.gain(event.cards,'gain2');
game.delay();
}
"step 3"
player.chooseToDiscard(2,'he','请弃置两张牌',true);
},
ai:{
threaten:0.5,
order:13,
result:{
target:function (player,target){
return get.damageEffect(target,player);
},
},
},
},
nsanruo:{
unique:true,
init:function(player){
if(!player.node.handcards1.cardMod){
player.node.handcards1.cardMod={};
}
if(!player.node.handcards2.cardMod){
player.node.handcards2.cardMod={};
}
var cardMod=function(card){
if(get.info(card).multitarget) return;
if(card.name=='sha'||get.type(card)=='trick') return ['暗弱','杀或普通锦囊牌对你不可见'];
};
player.node.handcards1.cardMod.nsanruo=cardMod;
player.node.handcards2.cardMod.nsanruo=cardMod;
player.node.handcards1.classList.add('nsanruo');
player.node.handcards2.classList.add('nsanruo');
if(!ui.css.nsanruo){
ui.css.nsanruo=lib.init.sheet(
'.handcards.nsanruo>.card[data-card-type="trick"]:not(*[data-card-multitarget="1"])>*,'+
'.handcards.nsanruo>.card[data-card-name="sha"]>*{visibility:hidden !important}'
);
}
},
onremove:function(player){
player.node.handcards1.classList.remove('nsanruo');
player.node.handcards2.classList.remove('nsanruo');
delete player.node.handcards1.cardMod.nsanruo;
delete player.node.handcards2.cardMod.nsanruo;
},
ai:{
neg:true
}
},
nsxunshan:{
mod:{
selectTarget:function(card,player,range){
if(!player.hasSkill('nsanruo')) return;
if(_status.auto) return;
if(get.position(card)!='h'||get.owner(card)!=player) return;
if(get.info(card).multitarget) return;
if(card.name=='sha'||get.type(card)=='trick') range[1]=game.countPlayer();
},
// playerEnabled:function(card,player,target,current){
// if(current==false) return;
// var filter=get.info(card).modTarget;
// if(typeof filter=='boolean'&&filter) return 'forceEnable';
// if(typeof filter=='function'&&filter(card,player,target)) return 'forceEnable';
// }
// targetInRange:function(card,player){
// if(_status.auto) return;
// if(get.position(card)!='h'||get.owner(card)!=player) return;
// if(get.info(card).multitarget) return;
// if(card.name=='sha'||get.type(card)=='trick') return true;
// }
},
ai:{
combo:'nsanruo'
}
},
nskaicheng:{
enable:'phaseUse',
usable:1,
zhuSkill:true,
unique:true,
filter:function(event,player){
if(!player.hasZhuSkill('nskaicheng')) return false;
if(!player.hasCard(function(card){
if(get.info(card).multitarget) return false;
return card.name=='sha'||get.type(card)=='trick';
})){
return false;
}
return game.hasPlayer(function(current){
return current!=player&¤t.group=='qun';
});
},
filterCard:function(card){
if(get.info(card).multitarget) return false;
return card.name=='sha'||get.type(card)=='trick';
},
filterTarget:function(card,player,target){
return player!=target&&target.group=='qun';
},
lose:false,
content:function(){
'step 0'
target.chooseBool(function(){
return get.attitude(target,player)>0;
},'是否将'+get.translation(cards)+'告知'+get.translation(player));
'step 1'
if(!player.hasUseTarget(cards[0])){
if(result.bool){
player.chooseControl('确定').set('prompt','你展示的手牌为'+get.translation(cards));
}
else{
event.hidden=true;
player.chooseControl('确定').set('prompt',get.translation(target)+'拒绝告知你卡牌信息');
}
}
else{
if(result.bool){
player.chooseBool('是否使用展示的牌?','你展示的手牌为'+get.translation(cards)+'。如果你使用此牌,则在结算后摸一张牌;如果你不使用此牌,则结束出牌阶段');
}
else{
event.hidden=true;
player.chooseBool('是否使用展示的牌?',get.translation(target)+'拒绝告知你卡牌信息。如果你使用此牌,则在结算后摸一张牌;如果你不使用此牌,则结束出牌阶段');
}
}
'step 2'
if(result.bool){
player.chooseUseTarget(true,cards[0],event.hidden?'选择此牌的目标':null);
}
else{
var evt=_status.event.getParent('phaseUse');
if(evt){
evt.skipped=true;
}
event.finish();
}
'step 3'
player.draw();
},
ai:{
combo:'nsanruo'
}
},
nsjuanli:{
enable:'phaseUse',
usable:1,
filterTarget:function(card,player,target){
return target!=player&&target.countCards('h');
},
filter:function(event,player){
return player.countCards('h');
},
init:function(player){
player.storage.nsjuanli_win=[];
player.storage.nsjuanli_lose=[];
},
intro:{
content:function(storage,player){
var str='';
if(player.storage.nsjuanli_win.length){
str+=get.translation(player.storage.nsjuanli_win)+'与你距离-1直到与你下次赌牌';
}
if(player.storage.nsjuanli_lose.length){
if(str.length){
str+=';';
}
str+=get.translation(player.storage.nsjuanli_lose)+'与你距离+1直到与你下次赌牌';
}
return str;
}
},
onremove:['nsjuanli_win','nsjuanli_lose'],
content:function(){
'step 0'
player.storage.nsjuanli_win.remove(target);
player.storage.nsjuanli_lose.remove(target);
event.prompt2='赌牌的两名角色分别亮开一张手牌,若花色相同则赌牌平局,若花色不同,则依次展示牌堆顶的牌直到翻开的牌与其中一人亮出牌的花色相同,则该角色获得赌牌的胜利';
player.chooseCard('h',true).set('prompt2',event.prompt2);
'step 1'
if(result.bool){
event.card1=result.cards[0];
target.chooseCard('h',true).set('prompt2',event.prompt2);
}
else{
event.finish();
}
'step 2'
if(result.bool){
event.card2=result.cards[0];
}
else{
event.finish();
}
'step 3'
player.$compare(event.card1,event.target,event.card2);
game.delay(0,1500);
game.log(player,'亮出的牌为',event.card1);
game.log(target,'亮出的牌为',event.card2);
'step 4'
var suit1=get.suit(event.card1);
var suit2=get.suit(event.card2);
if(suit1==suit2){
game.broadcastAll(function(str){
var dialog=ui.create.dialog(str);
dialog.classList.add('center');
setTimeout(function(){
dialog.close();
},1000);
},'平局');
game.delay(2);
if(!player.storage.nsjuanli_win.length&&!player.storage.nsjuanli_lose.length){
player.unmarkSkill('nsjuanli');
}
}
else{
var cards=[];
for(var i=0;i<1000;i++){
var current=get.cards();
if(current&¤t.length){
current=current[0];
current.discard();
cards.push(current);
var suit=get.suit(current);
if(suit==suit1){
player.showCards(cards,get.translation(player)+'赌牌获胜');
player.storage.nsjuanli_win.add(target);
target.loseHp();
player.markSkill('nsjuanli');
break;
}
else if(suit==suit2){
player.showCards(cards,get.translation(target)+'赌牌获胜');
player.storage.nsjuanli_lose.add(target);
target.recover();
player.markSkill('nsjuanli');
break;
}
}
else{
break;
}
}
}
},
mod:{
globalTo:function(from,to,distance){
if(to.storage.nsjuanli_win&&to.storage.nsjuanli_win.contains(from)){
return distance-1;
}
if(to.storage.nsjuanli_lose&&to.storage.nsjuanli_lose.contains(from)){
return distance+1;
}
}
},
ai:{
order:4,
result:{
target:function(player,target){
if(target.isHealthy()){
return -1/(1+target.hp);
}
else{
return -0.3/(1+target.hp);
}
}
}
}
},
nsyuanchou:{
trigger:{target:'useCardToBefore'},
forced:true,
priority:15,
check:function(event,player){
return get.effect(event.target,event.card,event.player,player)<0;
},
filter:function(event,player){
return get.type(event.card,'trick')=='trick'&&get.distance(event.player,player)>1;
},
content:function(){
trigger.cancel();
},
ai:{
effect:{
target:function(card,player,target,current){
if(get.type(card,'trick')=='trick'&&get.distance(player,target)>1) return 'zeroplayertarget';
},
}
}
},
nsguhuo:{
trigger:{player:'useCardAfter'},
forced:true,
usable:2,
filter:function(event,player){
if(event.parent.name=='nsguhuo') return false;
if(event.card==event.cards[0]){
var type=get.type(event.card,'trick');
var names=[];
if(get.cardPile(function(card){
if(get.type(card,'trick')!=type) return false;
if(get.info(card).multitarget) return false;
if(names.contains(card.name)) return false;
if(player.hasUseTarget(card)){
return true;
}
else{
names.add(card.name);
return false;
}
})){
return true;
}
}
return true;
},
content:function(){
var type=get.type(trigger.card,'trick');
var names=[];
var card=get.cardPile(function(card){
if(get.type(card,'trick')!=type) return false;
if(get.info(card).multitarget) return false;
if(names.contains(card.name)) return false;
if(player.hasUseTarget(card)){
return true;
}
else{
names.add(card.name);
return false;
}
});
if(card){
var info=get.info(card);
var targets=game.filterPlayer(function(current){
return lib.filter.filterTarget(card,player,current);
});
if(targets.length){
targets.sort(lib.sort.seat);
var select=get.select(info.selectTarget);
if(select[0]==-1||select[1]==-1){
player.useCard(card,targets,'noai');
}
else if(targets.length>=select[0]){
var num=select[0]+Math.floor(Math.random()*(select[1]-select[0]+1));
player.useCard(card,targets.randomGets(num),'noai');
}
}
}
}
},
nsbaiyi:{
trigger:{player:'phaseDiscardBefore'},
forced:true,
filter:function(event,player){
return player.storage.nsqinxue&&player.storage.nsqinxue.length;
},
content:function(){
'step 0'
trigger.cancel();
var num=player.storage.nsqinxue.length;
player.chooseToDiscard('白衣:请弃置'+get.cnNumber(num)+'张牌','he',true,num);
'step 1'
if(result.bool&&result.cards.length){
event.goon=true;
if(result.cards.length==3){
var type=[];
for(var i=0;i=2;
},
content:function(){
player.storage.nsfuge=true;
player.insertPhase();
},
group:'nsfuge_draw',
subSkill:{
draw:{
trigger:{player:'phaseDrawBegin'},
silent:true,
filter:function(event,player){
var evt=event.getParent('phase');
return evt&&evt.skill=='nsfuge';
},
content:function(){
trigger.num+=player.maxHp-player.hp;
}
}
}
},
nsbaiming:{
trigger:{player:'useCard'},
direct:true,
filter:function(event,player){
if(player.additionalSkills.nsbaiming) return false;
return event.card&&event.card.name=='sha'&&player.storage.nsbaiming&&player.storage.nsbaiming.length>0;
},
group:'nsbaiming_clear',
init:function(player){
var check=function(list){
for(var i=0;i