diff --git a/card/extra.js b/card/extra.js index 45e9753b7..c4eb3b3b5 100644 --- a/card/extra.js +++ b/card/extra.js @@ -327,8 +327,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return (lib.filter.judge(card,player,target)&&player!=target); }, judge:function(card){ - if(get.suit(card)=='club') return 0; - return -3; + if(get.suit(card)=='club') return 1; + return -2; }, judge2:function(result){ if(result.bool==false) return true; diff --git a/card/guozhan.js b/card/guozhan.js index 46c2b6ded..c1611fdb5 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -523,7 +523,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, ai:{ canLink:function(player,target,card){ - if(player.hasSkill('jueqing')||target.hasSkill('gangzhi')||target.hasSkill('gangzhi')) return false; + if(!target.isLinked()||player.hasSkill('jueqing')||target.hasSkill('gangzhi')||target.hasSkill('gangzhi')) return false; var es=target.countCards('e'); if(!es) return true; if(target.hp>=3&&es>=2){ diff --git a/card/standard.js b/card/standard.js index e4826567f..e6680e06d 100644 --- a/card/standard.js +++ b/card/standard.js @@ -1709,8 +1709,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return (lib.filter.judge(card,player,target)&&player!=target); }, judge:function(card){ - if(get.suit(card)=='heart') return 0; - return -3; + if(get.suit(card)=='heart') return 1; + return -2; }, judge2:function(result){ if(result.bool==false) return true; @@ -1759,8 +1759,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, selectTarget:[-1,-1], judge:function(card){ - if(get.suit(card)=='spade'&&get.number(card)>1&&get.number(card)<10) return -6; - return 0; + if(get.suit(card)=='spade'&&get.number(card)>1&&get.number(card)<10) return -5; + return 1; }, judge2:function(result){ if(result.bool==false) return true; diff --git a/character/diy.js b/character/diy.js index c1e00d365..61a749154 100755 --- a/character/diy.js +++ b/character/diy.js @@ -165,7 +165,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ old_jiakui:['male','wei',4,['tongqu','xinwanlan']], ol_guohuai:['male','wei',3,['rejingce']], junk_zhangrang:['male','qun',3,['junktaoluan']], - junk_simayi:['male','jin',3,['buchen','smyyingshi','xiongzhi','xinquanbian'],['hiddenSkill']], }, characterFilter:{ key_jojiro:function(mode){ @@ -198,7 +197,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ diy_default:["diy_feishi","diy_liuyan","diy_yuji","diy_caiwenji","diy_lukang","diy_zhenji","diy_liufu","diy_xizhenxihong","diy_liuzan","diy_zaozhirenjun","diy_yangyi","diy_tianyu"], 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"], - diy_trashbin:['old_jiakui','ol_guohuai','junk_zhangrang','junk_simayi'], + diy_trashbin:['old_jiakui','ol_guohuai','junk_zhangrang'], }, }, characterIntro:{ @@ -3042,77 +3041,30 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' event.num=game.countGroup(); player.markAuto('shiroha_yuzhao',game.cardsGotoSpecial(get.cards(event.num)).cards); - if(window.decadeUI&&!_status.connectMode) event.goto(3); 'step 1' - player.chooseButton(['将'+get.cnNumber(num)+'张牌置于牌堆顶(先选择的在上)',player.getStorage('shiroha_yuzhao')],true,num).set('ai',function(button){ - var player=_status.event.player; - var next=_status.event.getTrigger().player; - var att=get.attitude(player,next); - var card=button.link; - var judge=next.getCards('j')[ui.selected.buttons.length]; - if(judge){ - return get.judge(judge)(card)*att; - } - return get.value(card)*att; + 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.storage.shiroha_yuzhao], + ['牌堆顶'], + ]); + next.set('processAI',function(list){ + var cards=list[0][1],cards2=cards.randomRemove(_status.event.num); + return [cards,cards2]; }); 'step 2' - player.unmarkAuto('shiroha_yuzhao',result.links); - while(result.links.length){ - ui.cardPile.insertBefore(result.links.pop().fix(),ui.cardPile.firstChild); - } - game.updateRoundNumber(); - event.finish(); - 'step 3' - '短鸽自己八成不会写,我先写好算了'; - var cards=player.getStorage('shiroha_yuzhao'); - var yuzhao=decadeUI.content.chooseGuanXing(player,cards,cards.length,null,num); - yuzhao.caption='【预兆】'; - yuzhao.header1='预兆'; - yuzhao.header2='牌堆顶'; - yuzhao.tip='将'+num+'张牌置于牌堆顶
'+yuzhao.tip; - yuzhao.callback=function(){ - return this.cards[1].length==num; - }; - event.switchToAuto=function(){ - var cheats=[]; - var cards=yuzhao.cards[0].slice(0); - var stopped=false; - - var next=trigger.player; - var hasFriend=get.attitude(player,next)>0; - - var judges=next.node.judges.childNodes; - if(judges.length>0) cheats=decadeUI.get.cheatJudgeCards(cards,judges,hasFriend); - if(hasFriend){ - cards=cards.sort(function(b,a){ - return get.value(b,next)-get.value(a,next); - }); - } - else{ - cards.sort(function(a,b){ - return get.value(b,next)-get.value(a,next); - }); - } - cards=cheats.concat(cards); - var time=500; - var gainNum=num; - for(var i=cards.length-1;i>=0;i--){ - setTimeout(function(card,index,finished,moveDown){ - yuzhao.move(card,index,moveDown?1:0); - if(finished) yuzhao.finishTime(1000); - },time,cards[i],i,i==0,gainNum>0); - time += 500; - gainNum--; - } - }; - if(!event.isMine()){ - event.switchToAuto(); - } - 'step 4' - var cards=event.cards2; - if(event.result&&event.result.bool){ + if(result&&result.bool){ + var cards=result.moved[1]; player.unmarkAuto('shiroha_yuzhao',cards); - var first=ui.cardPile.firstChild; while(cards.length){ ui.cardPile.insertBefore(cards.pop().fix(),ui.cardPile.firstChild); } @@ -15932,11 +15884,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ns_caimao:'蔡瑁', nsdingzhou:'定州', nsdingzhou_info:'出牌阶段限一次,你可以选择一名区域内有牌的其他角色。你随机获得其区域内的一张牌,然后摸一张牌。若你以此法获得了两张颜色不同的牌,则你失去1点体力。', - junk_simayi:'止息司马懿', ol_guohuai_ab:'郭淮', junk_zhangrang_ab:'张让', old_jiakui_ab:'贾逵', - junk_simayi_ab:'司马懿', diy_tieba:'吧友设计', diy_default:'常规', diy_noname:'无名专属', diff --git a/character/extra.js b/character/extra.js index 05f98df17..fdb871633 100755 --- a/character/extra.js +++ b/character/extra.js @@ -2977,49 +2977,39 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ "step 0" - player.storage.qixing=game.cardsGotoSpecial(get.cards(7)).cards; - player.markSkill('qixing'); - game.addVideo('storage',player,['qixing',get.cardsInfo(player.storage.qixing),'cards']); + player.markAuto('qixing',game.cardsGotoSpecial(get.cards(7)).cards); "step 1" - player.chooseCard('选择任意张手牌与“星”交换',[1,Math.min(player.countCards('h'),player.storage.qixing.length)]).set('promptx',[player.storage.qixing]).ai=function(card){ - var val=get.value(card); - if(val<0) return 10; - if(player.skipList.contains('phaseUse')){ - return val; - } - return -val; - }; + var cards=player.getStorage('qixing'); + if(!cards.length||!player.countCards('h')){ + event.finish(); + return; + } + var next=player.chooseToMove('七星:是否交换“星”和手牌?'); + next.set('list',[ + [get.translation(player)+'(你)的星',cards], + ['手牌区',player.getCards('h')], + ]); + next.set('filterMove',function(from,to){ + return typeof to!='number'; + }); + next.set('processAI',function(list){ + var player=_status.event.player,cards=list[0][1].concat(list[1][1]).sort(function(a,b){ + return get.useful(a)-get.useful(b); + }),cards2=cards.splice(0,player.storage.qixing.length); + return [cards2,cards]; + }); "step 2" if(result.bool){ - player.logSkill('qixing'); - player.lose(result.cards,ui.special,'toStorage'); - player.storage.qixing=player.storage.qixing.concat(result.cards); - player.syncStorage('qixing'); - event.num=result.cards.length; - } - else{ - event.finish(); - } - "step 3" - player.chooseCardButton(player.storage.qixing,'选择'+event.num+'张牌作为手牌',event.num,true).ai=function(button){ - var val=get.value(button.link); - if(val<0) return -10; - if(player.skipList.contains('phaseUse')){ - return -val; - } - return val; - } - if(player==game.me&&!event.isMine()){ - game.delay(0.5); - } - "step 4" - player.gain(result.links,'fromStorage'); - for(var i=0;inum2) player.chooseToDiscard('h',true,num1-num2); - else player.drawTo(Math.min(4,num2)); + else player.drawTo(Math.min(num1+4,num2)); }, }, //陈武董袭 @@ -3287,35 +3287,47 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, mjweipo_effect:{ audio:'mjweipo', - enable:'chooseToUse', - hiddenCard:function(player,name){ - return name==player.storage.mjweipo_effect&&player.countCards('h','sha')>0; - }, - viewAs:function(cards,player){ - return {name:player.storage.mjweipo_effect}; - }, + enable:'phaseUse', filter:function(event,player){ - return player.countCards('hs','sha')>0&&event.filterCard({name:player.storage.mjweipo_effect},player,event); + return player.countCards('h','sha')>0; }, prompt:function(){ - return '将一张杀当做'+get.translation(_status.event.player.storage.mjweipo_effect)+'使用'; + return '弃置一张【杀】并获得一张'+get.translation(_status.event.player.storage.mjweipo_effect); }, filterCard:{name:'sha'}, check:function(card){ return 6-get.value(card); }, - position:'hs', + position:'h', popname:true, - onuse:function(links,player){ + content:function(){ + var name=player.storage.mjweipo_effect,card=false; + if(name=='binglinchengxiax'){ + if(!_status.binglinchengxiax){ + _status.binglinchengxiax=[ + ['spade',7], + ['club',7], + ['club',13], + ]; + game.broadcastAll(function(){lib.inpile.add('binglinchengxiax')}); + } + if(_status.binglinchengxiax.length){ + var info=_status.binglinchengxiax.randomRemove(); + card=game.createCard2('binglinchengxiax',info[0],info[1]); + } + } + if(!card) card=get.cardPile(name); + if(card) player.gain(card,'gain2'); player.removeSkill('mjweipo_effect'); }, ai:{ order:7, + result:{player:1}, }, - group:'mjweipo_remove', mark:true, marktext:'迫', - intro:{content:'可将【杀】当做【$】使用'}, + intro:{content:'可弃置一张【杀】并获得【$】'}, + group:'mjweipo_remove', }, mjweipo_remove:{ trigger:{global:['phaseBegin','die']}, @@ -11226,7 +11238,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ threaten:0.7, }, }, - "xinfu_shangjian":{ + xinfu_shangjian:{ trigger:{ global:"phaseJieshuBegin", }, @@ -11238,6 +11250,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); return num>0&&num<=player.hp }, + locked:true, frequent:true, content:function(){ 'step 0' @@ -13034,7 +13047,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ shenpei:['shenpei','sp_shenpei'], wangcan:['wangcan','sp_wangcan'], sunshao:['sp_sunshao','sunshao'], - xunchen:['xunchen','sp_xunchen'], + xunchen:['re_xunchen','xunchen','sp_xunchen'], xinpi:['xinpi','sp_xinpi'], duyu:['duyu','sp_duyu'], zhangwen:['sp_zhangwen','zhangwen'], @@ -13084,7 +13097,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "qc_mingzhe":"明哲", "qc_mingzhe_info":"", "xinfu_shangjian":"尚俭", - "xinfu_shangjian_info":"一名角色的结束阶段开始时,若你于此回合内失去了X张或更少的牌,则你可以摸等量的牌。(X为你的体力值)", + "xinfu_shangjian_info":"锁定技。一名角色的结束阶段开始时,若你于此回合内失去了X张或更少的牌,则你可以摸等量的牌(X为你的体力值)。", "rw_bagua_skill":"先天八卦阵", "rw_bagua_skill_info":"当你需要使用或打出一张【闪】时,你可以进行判定,若判定结果不为黑桃,视为你使用或打出了一张【闪】。", "rw_baiyin_skill":"照月狮子盔", @@ -13586,7 +13599,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ mjweipo:'危迫', mjweipo_effect:'危迫', mjweipo_remove:'危迫', - mjweipo_info:'出牌阶段限一次。你可以选择一个智囊或【兵临城下】,令一名没有〖危迫〗效果的角色获得如下一次性效果直到你下回合开始:其可以将一张【杀】当做你选择的牌使用。', + mjweipo_info:'出牌阶段限一次。你可以选择一个智囊或【兵临城下】,令一名没有〖危迫〗效果的角色获得如下一次性效果直到你下回合开始:其可于出牌阶段弃置一张【杀】,并获得一张你选择的牌。', mjchenshi:'陈势', mjchenshi_player:'陈势', mjchenshi_target:'陈势', @@ -13697,7 +13710,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ qingjue_info:'每轮限一次。当有其他角色A使用牌指定另一名体力值小于A且不处于濒死状态的其他角色B为目标时,你可以摸一张牌,然后与A拼点。若你赢,你取消此目标。若你没赢,你将此牌的目标改为自己。', fengjie:'奉节', fengjie2:'奉节', - fengjie_info:'锁定技,准备阶段开始时,你选择一名其他角色并获得如下效果直到你下回合开始:一名角色的结束阶段开始时,你将手牌摸至(至多摸至四张)或弃置至与其体力值相等。', + fengjie_info:'锁定技,准备阶段开始时,你选择一名其他角色并获得如下效果直到你下回合开始:一名角色的结束阶段开始时,你将手牌摸至(至多摸四张)或弃置至与其体力值相等。', sp_zongyu:'手杀宗预', zhibian:'直辩', zhibian_info:'准备阶段,你可以和一名其他角色拼点。若你赢,你可选择:①将其装备区/判定区内的一张牌移动到你的对应区域。②回复1点体力。③背水:跳过下个摸牌阶段,然后依次执行上述所有选项;若你没赢,你失去1点体力。', diff --git a/character/old.js b/character/old.js index 4dee97699..9ee77b663 100755 --- a/character/old.js +++ b/character/old.js @@ -7,17 +7,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){ old_standard:['ol_yuanshu'], old_shenhua:["yuji","zhangjiao","old_zhugezhan","old_guanqiujian","xiahouyuan","weiyan","xiaoqiao","pangde"], old_refresh:["old_zhangfei","old_huatuo","old_zhaoyun","ol_huaxiong"], - old_yijiang1:["masu","xushu","yujin","xin_yujin","old_xusheng","old_lingtong","fazheng"], + old_yijiang1:["masu","xushu","xin_yujin","old_xusheng","old_lingtong","fazheng"], old_yijiang2:["old_zhonghui"], old_yijiang3:["liru","old_zhuran","old_fuhuanghou","old_caochong"], old_yijiang4:["old_caozhen","old_chenqun","old_zhuhuan"], old_yijiang5:["old_caoxiu","old_quancong","old_zhuzhi"], old_yijiang67:["ol_zhangrang","ol_liuyu"], old_sp:["old_lingju","old_maliang","old_machao","zhangliang","jsp_caoren","ol_guansuo","old_zhangxingcai","old_huangfusong","ol_maliang","old_wangyun"], + old_yingbian:['junk_simayi'], old_mobile:["old_caochun","old_majun"], }, }, character:{ + junk_simayi:['male','jin',3,['buchen','smyyingshi','xiongzhi','quanbian'],['hiddenSkill']], fazheng:['male','shu',3,['enyuan','xuanhuo']], ol_yuanshu:['male','qun',4,['wangzun','tongji']], pangde:['male','qun',4,['mashu','mengjin']], @@ -42,7 +44,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ masu:['male','shu',3,['xinzhan','huilei']], xushu:['male','shu',3,['wuyan','jujian']], liru:['male','qun',3,['juece','mieji','fencheng']], - yujin:['male','wei',4,['yizhong']], xin_yujin:['male','wei',4,['jieyue']], //lusu:['male','wu',3,['haoshi','dimeng']], //yuanshao:['male','qun',4,['luanji','xueyi'],['zhu']], @@ -791,6 +792,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ oldxuanfeng_info:'每当你失去一次装备区里的牌时,你可以执行下列两项中的一项:1.视为对任意一名其他角色使用一张【杀】(此【杀】不计入每回合的使用限制);2.对与你距离1以内的一名其他角色造成一点伤害', ol_yuanshu:'旧袁术', fazheng:'旧法正', + junk_simayi:'旧晋司马懿', + junk_simayi_ab:'司马懿', old_standard:'标准包', old_shenhua:'神话再临', diff --git a/character/rank.js b/character/rank.js index 7d03e1afa..7ab5b17ed 100644 --- a/character/rank.js +++ b/character/rank.js @@ -258,6 +258,7 @@ window.noname_character_rank={ 'ol_wangrong', 're_nanhualaoxian', 'fuqian', + 'liuyong', 'key_misuzu', 'key_sunohara', 'key_umi', @@ -407,7 +408,7 @@ window.noname_character_rank={ 'shen_zhenji', 'shen_simayi', 'xushao', - 're_yujin', + 'tw_yujin', 'xurong', 'beimihu', 'guanlu', @@ -485,6 +486,7 @@ window.noname_character_rank={ 'ol_yujin', 'ol_huaxin', 'qiaozhou', + 're_xunchen', ], bp:[ 'chess_diaochan', @@ -711,6 +713,7 @@ window.noname_character_rank={ 'yuanhuan', 'zhouyi', 'yangzhi', + 'wanniangongzhu', ], b:[ 'diy_feishi', @@ -911,6 +914,8 @@ window.noname_character_rank={ 'yangyan', 'zuofen', 're_kanze', + 'tongyuan', + 'zhangning', ], bm:[ 'diy_xizhenxihong', @@ -1667,7 +1672,7 @@ window.noname_character_rank={ 're_caiwenji', 're_caozhi', 'yujin_yujin', - 're_yujin', + 'tw_yujin', 'gaoshun', 're_zhonghui', 'old_madai', @@ -1765,6 +1770,11 @@ window.noname_character_rank={ 'yangyan', 'yangzhi', 'zuofen', + 'liuyong', + 'zhangning', + 'wanniangongzhu', + 're_xunchen', + 'tongyuan', ], junk:[ 'sunshao', diff --git a/character/refresh.js b/character/refresh.js index 4ca9bbd9b..c2c1bbde9 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -7353,26 +7353,29 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ "step 0" - if(player.isUnderControl()){ - game.swapPlayerAuto(player); - } var num=game.countPlayer()<4?3:5; var cards=get.cards(num); - event.cards=cards; - var switchToAuto=function(){ - _status.imchoosing=false; - if(event.dialog) event.dialog.close(); - if(event.control) event.control.close(); + 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 target=(_status.event.getTrigger().name=='phaseZhunbei')?player:player.next; + var att=get.sgn(get.attitude(player,target)); var top=[]; - var judges=player.getCards('j'); + var judges=target.getCards('j'); var stopped=false; - if(!player.hasWuxie()){ + if(player!=target||!target.hasWuxie()){ for(var i=0;i0)) break; top.unshift(cards.shift()); } } bottom=cards; - for(var i=0;i=2) return false; + return true; + }); + next.set('filterOk',function(moved){ + return moved[1].length==2; + }); + next.set('processAI',function(list){ + var cards=list[0][1].slice(0).sort(function(a,b){ + return get.value(b)-get.value(a); + }); + return [cards,cards.splice(2)]; + }) + 'step 1' + var top=result.moved[0]; + var bottom=result.moved[1]; + top.reverse(); + for(var i=0;i「征荣」牌',player.storage.zhengrong,'
手牌区
',player.getCards('h')]; - var next=player.chooseButton(dialog); - next.set('filterButton',function(button){ - var ss=_status.event.player.storage.zhengrong; - var hs=_status.event.player.getCards('h'); - var sn=0; - var hn=0; - var ub=ui.selected.buttons; - for(var i=0;i=hs.length&&ss.contains(button.link)||hn>=ss.length&&hs.contains(button.link)); - }); - next.set('selectButton',function(){ - if(ui.selected.buttons.length==0) return 2; - var ss=_status.event.player.storage.zhengrong; - var hs=_status.event.player.getCards('h'); - var sn=0; - var hn=0; - var ub=ui.selected.buttons; - for(var i=0;i=2; @@ -542,9 +523,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, prompt:function(event,player){ var num=3; - if(player.getHistory('lose',function(evt){ + if(player.hasHistory('lose',function(evt){ return evt.type=='discard'; - }).length) num--; + })) num--; if(!player.isMinHandcard()) num--; if(!player.getStat('damage')) num--; return get.prompt('xinfu_zuilun')+'(可获得'+get.cnNumber(num)+'张牌)' @@ -553,34 +534,64 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' event.num=0; event.cards=get.cards(3); - if(player.getHistory('lose',function(evt){ + game.cardsGotoOrdering(cards); + if(player.hasHistory('lose',function(evt){ return evt.type=='discard'; - }).length) event.num++; + })) event.num++; if(!player.isMinHandcard()) event.num++; if(!player.getStat('damage')) event.num++; 'step 1' if(event.num==0){ player.gain(event.cards,'draw'); event.finish(); - }else{ - var prompt; - if(event.num==3) prompt="罪论:请按顺序将卡牌置于牌堆顶(先选择的在上)"; - else prompt="罪论:请按顺序将"+get.cnNumber(event.num)+"张卡牌置于牌堆顶(先选择的在上),然后获得其余的牌。"; - player.chooseCardButton(event.num,true,event.cards,prompt).set('ai',function(button){ - var player=_status.event.player; - var next=player.getNext(); - var att=get.attitude(player,next); - var card=button.link; - var judge=next.getCards('j')[ui.selected.buttons.length]; - if(judge){ - return get.judge(judge)(card)*att; + } + else{ + var prompt='罪论:将'+get.cnNumber(num)+'牌置于牌堆顶'; + if(num<3) prompt+='并获得其余的牌'; + var next=player.chooseToMove(prompt,true); + if(num<3){ + next.set('list',[ + ['牌堆顶',cards], + ['获得'], + ]); + next.set('filterMove',function(from,to,moved){ + if(to==1&&moved[0].length<=_status.event.num) return false; + return true; + }); + next.set('filterOk',function(moved){ + return moved[0].length==_status.event.num; + }); + } + else{ + next.set('list',[ + ['牌堆顶',cards], + ]); + } + next.set('num',num); + next.set('processAI',function(list){ + var check=function(card){ + var player=_status.event.player; + var next=player.next; + var att=get.attitude(player,next); + var judge=next.getCards('j')[tops.length]; + if(judge){ + return get.judge(judge)(card)*att; + } + return next.getUseValue(card)*att; } - return next.getUseValue(card)*att; + var cards=list[0][1].slice(0),tops=[]; + while(tops.length<_status.event.num){ + list.sort(function(a,b){ + return check(b)-check(a); + }); + tops.push(cards.shift()); + } + return [tops,cards]; }); } 'step 2' if(result.bool){ - var list=result.links.slice(0); + var list=result.moved[0]; var num=list.length-1; for(var i=0;i1){ - player.chooseButton(true,event.cards.length,['按顺序将卡牌置于牌堆顶(先选择的在上)',event.cards]).set('ai',function(button){ - var value=get.value(button.link); - if(_status.event.reverse) return value; - return -value; - }).set('reverse',((_status.currentPhase&&_status.currentPhase.next)?get.attitude(player,_status.currentPhase.next)>0:false)) + var next=player.chooseToMove('恃才:将牌按顺序置于牌堆顶'); + next.set('list',[['牌堆顶',event.cards]]); + next.set('reverse',((_status.currentPhase&&_status.currentPhase.next)?get.attitude(player,_status.currentPhase.next)>0:false)); + next.set('processAI',function(list){ + var cards=list[0][1].slice(0); + cards.sort(function(a,b){ + return (_status.event.reverse?1:-1)*(get.value(b)-get.value(a)); + }); + return [cards]; + }); } "step 1" - if(result.bool&&result.links&&result.links.length) cards=result.links.slice(0); + if(result.bool&&result.moved&&result.moved[0].length) cards=result.moved[0].slice(0); while(cards.length){ var card=cards.pop(); if(get.position(card,true)=='o'){ diff --git a/character/sp.js b/character/sp.js index 6476624b3..6468aca39 100755 --- a/character/sp.js +++ b/character/sp.js @@ -14873,25 +14873,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i0)) break; top.unshift(cards.shift()); } } bottom=cards; - for(var i=0;i0){ + if(!target.hasMark('zhenge_effect')) att*=1.5; + if(!game.hasPlayer(function(current){ + return get.distance(target,current,'attack')>2; + })){ + var usf=Math.max.apply(Math,function(current){ + if(target.canUse('sha',current,false)) return get.effect(current,{name:'sha'},target,player); + return 0; + }); + return att+usf; + } + return att; + } + return 0; + }); + 'step 1' + if(result.bool){ + var target=result.targets[0]; + event.target=target; + player.logSkill('zhenge',target); + target.addSkill('zhenge_effect'); + if(target.countMark('zhenge_effect')<5) target.addMark('zhenge_effect',1,false); + if(!game.hasPlayer(function(current){ + return current!=target&&!target.inRange(current); + })){ + player.chooseTarget('是否令'+get.translation(target)+'视为对另一名角色使用【杀】?',function(card,player,target){ + return _status.event.source.canUse('sha',target); + }).set('source',target).set('ai',function(target){ + var evt=_status.event; + return get.effect(target,{name:'sha'},evt.source,evt.player); + }); + } + else{ + game.delayx(); + event.finish(); + } + } + else event.finish(); + 'step 2' + if(result.bool){ + target.useCard({name:'sha',isCard:true},result.targets[0],false); + } + 'step 3' + game.delayx(); + }, + subSkill:{ + effect:{ + charlotte:true, + onremove:true, + mod:{ + attackFrom:function(player,target,num){ + return num-player.countMark('zhenge_effect'); + }, + }, + intro:{content:'攻击范围+#'}, + }, + }, + }, + xinghan:{ + audio:2, + init:function(player){ + player.addSkill('xinghan_count'); + }, + onremove:function(player){ + player.removeSkill('xinghan_count'); + }, + trigger:{global:'damageSource'}, + forced:true, + filter:function(event,player){ + return event.card&&event.card==player.storage.xinghan_temp&&event.source&&event.source.hasMark('zhenge_effect'); + }, + logTarget:'source', + content:function(){ + player.draw(player.isMaxHandcard(true)?1:Math.min(5,trigger.source.getAttackRange())); + }, + subSkill:{ + count:{ + trigger:{global:'useCard1'}, + forced:true, + charlotte:true, + popup:false, + firstDo:true, + filter:function(event,player){ + return event.card.name=='sha'&&!game.hasPlayer2(function(current){ + return current.hasHistory('useCard',function(evt){ + return evt!=event&&evt.card.name=='sha'; + }) + }); + }, + content:function(){ + player.addTempSkill('xinghan_temp'); + player.storage.xinghan_temp=trigger.card; + }, + }, + temp:{onremove:true}, + }, + ai:{combo:'zhenge'}, + }, + //荀谌 + refenglve:{ + audio:2, + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.countCards('h')>0&&!player.hasSkillTag('noCompareSource')&&game.hasPlayer(function(current){ + return current!=player&¤t.countCards('h')>0&&!current.hasSkillTag('noCompareTarget'); + }); + }, + filterTarget:function(card,player,target){ + return target!=player&&target.countCards('h')>0&&!target.hasSkillTag('noCompareTarget'); + }, + content:function(){ + 'step 0' + player.chooseToCompare(target); + 'step 1' + if(result.bool){ + if(!target.countCards('hej')) event.finish(); + else{ + event.giver=target; + event.gainner=player; + target.choosePlayerCard(target,true,'hej',2,'交给'+get.translation(player)+'两张牌'); + } + } + else if(result.tie){ + delete player.getStat('skill').refenglve; + event.finish(); + } + else{ + if(!player.countCards('he')) event.finish(); + else{ + event.giver=player; + event.gainner=target; + player.chooseCard(true,'he','交给'+get.translation(target)+'一张牌'); + } + } + 'step 2' + if(result.bool) event.gainner.gain(result.cards,event.giver,'giveAuto'); + }, + ai:{ + order:8, + result:{ + target:function(player,target){ + if(!player.hasCard(function(card){ + if(get.position(card)!="h") return false; + var val=get.value(card); + if(val<0) return true; + if(val<=5){ + return card.number>=11; + } + if(val<=6){ + return card.number>=13; + } + return false; + })) return 0; + return -Math.sqrt(1+target.countCards('he'))/(1+target.countCards('j')); + }, + }, + }, + }, + anyong:{ + audio:2, + trigger:{global:'damageSource'}, + direct:true, + filter:function(event,player){ + return event.source&&event.source==_status.currentPhase&&event.num==1&& + event.player!=event.source&&event.player.isIn()&&player.countCards('h')>0&& + event.source.getHistory('sourceDamage',function(evt){ + return evt.player!=event.source; + }).indexOf(event)==0; + }, + content:function(){ + 'step 0' + player.chooseToDiscard('he',get.prompt('anyong',trigger.player),'弃置一张牌并对其造成1点伤害').set('goon',get.damageEffect(trigger.player,player,player)>0).set('ai',function(card){ + if(_status.event.goon) return 7-get.value(card); + return 0; + }).logSkill=['anyong',trigger.player]; + 'step 1' + if(result.bool) trigger.player.damage(); + }, + }, + //张宁 + tianze:{ + audio:2, + trigger:{global:'useCardAfter'}, + direct:true, + filter:function(event,player){ + return player!=event.player&&event.player.isIn()&&get.suit(event.card)=='spade'&&event.player.hasHistory('lose',function(evt){ + return evt&&evt.hs.length&&evt.getParent()==event; + })&&event.player.isPhaseUsing()&&!player.hasSkill('tianze_block'); + }, + content:function(){ + 'step 0' + player.addTempSkill('tianze_block'); + if(!player.hasCard(function(card){ + if(_status.connectMode&&get.position(card)=='h') return true; + return get.color(card,player)=='black'; + },'he')) event.finish(); + else player.chooseToDiscard('he',function(card,player){ + return get.color(card,player)=='black'; + },get.prompt('tianze',trigger.player),'弃置一张黑色牌并对其造成1点伤害').set('ai',function(card){ + if(!_status.event.goon) return 0; + return 8-get.value(card); + }).set('goon',get.damageEffect(trigger.player,player,player)>0).logSkill=['tianze',trigger.player]; + 'step 1' + if(result.bool) trigger.player.damage(); + }, + group:'tianze_draw', + subSkill:{ + block:{charlotte:true}, + draw:{ + trigger:{global:'judgeEnd'}, + forced:true, + locked:false, + filter:function(event,player){ + return event.player!=player&&event.result&&event.result.suit=='spade'; + }, + content:function(){ + player.draw(); + }, + }, + }, + }, + difa:{ + trigger:{player:'gainAfter'}, + filter:function(event,player){ + if(player!=_status.currentPhase||event.getParent().name!='draw') return false; + var hs=player.getCards('h'); + if(!hs.length) return false; + for(var i of event.cards){ + if(hs.contains(i)&&get.suit(i,hs)=='heart'&&lib.filter.cardDiscardable(i,player,'difa')) return true; + } + return false; + }, + check:()=>false, + content:function(){ + 'step 0' + var hs=player.getCards('h'),cards=trigger.cards.filter(function(i){ + return (hs.contains(i)&&get.suit(i,hs)=='heart'&&lib.filter.cardDiscardable(i,player,'difa')); + }); + if(!cards.length) event.finish(); + else{ + event.cards=cards; + player.discard(cards); + } + 'step 1' + var list=lib.inpile.filter(function(i){ + return get.type2(i,false)=='trick'; + }); + if(!list.length) event.finish(); + else player.chooseButton(['选择获得一种锦囊牌',[list.map((i)=>['锦囊','',i]),'vcard']],true); + 'step 2' + var card=get.cardPile(function(i){ + return i.name==result.links[0][2]&&!event.cards.contains(i); + }); + if(card) player.gain(card,'gain2'); + }, + }, + //刘永 + zhuning:{ + audio:2, + enable:'phaseUse', + usable:2, + filter:function(event,player){ + if(!player.countCards('he')) return false; + return (!player.getStat('skill').zhuning||player.hasSkill('zhuning_double')); + }, + filterCard:true, + filterTarget:lib.filter.notMe, + selectCard:[1,Infinity], + delay:false, + lose:false, + discard:false, + 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(1,player.countCards('h')-player.hp)) return 0; + return 10-get.value(card); + }, + content:function(){ + 'step 0' + target.gain(cards,player,'giveAuto').gaintag.add('fengxiang_tag'); + 'step 1' + var list=[]; + for(var name of lib.inpile){ + var type=get.type(name); + if(type!='basic'&&type!='trick') continue; + var card={name:name,isCard:true}; + if(get.tag(card,'damage')>0&&player.hasUseTarget(card)){ + list.push([type,'',name]); + } + if(name=='sha'){ + for(var i of lib.inpile_nature){ + card.nature=i; + if(player.hasUseTarget(card)) list.push([type,'',name,i]); + } + } + } + if(list.length){ + player.chooseButton(['是否视为使用一张伤害牌?',[list,'vcard']]).set('ai',function(button){ + return _status.event.player.getUseValue({name:button.link[2]}); + }); + } + else event.finish(); + 'step 2' + if(result.bool){ + player.chooseUseTarget({name:result.links[0][2],nature:result.links[0][3],isCard:true},true,false); + } + else event.finish(); + 'step 3' + if(!player.hasHistory('sourceDamage',function(evt){ + if(!evt.card) return false; + var evtx=evt.getParent('useCard'); + return evtx.card==evt.card&&evtx.getParent(2)==event; + })) player.addTempSkill('zhuning_double'); + }, + subSkill:{ + double:{}, + }, + ai:{ + fireAttack:true, + order:4, + result:{ + target:function(player,target){ + if(target.hasSkillTag('nogain')) return 0; + if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ + if(target.hasSkillTag('nodu')) return 0; + return -10; + } + if(target.hasJudge('lebu')) return 0; + var nh=target.countCards('h'); + var np=player.countCards('h'); + if(player.hp==player.maxHp||player.storage.rerende<0||player.countCards('h')<=1){ + if(nh>=np-1&&np<=player.hp&&!target.hasSkill('haoshi')) return 0; + } + return Math.max(1,5-nh); + } + }, + } + }, + fengxiang:{ + getMax:function(event){ + var max=0,max2=null,players=game.filterPlayer(); + for(var current of players){ + var num=0,cards=current.getCards('h',function(card){ + return card.hasGaintag('fengxiang_tag'); + }); + if(event){ + if(event.name=='gain'&&event.gaintag.contains('fengxiang_tag')) cards.removeArray(event.cards); + var evt=event.getl(current); + if(evt&&evt.gaintag_map){ + for(var i in evt.gaintag_map){ + if(evt.gaintag_map[i].contains('fengxiang_tag')) num++; + } + } + } + num+=cards.length; + if(num>max){ + max=num; + max2=current; + } + else if(num==max) max2=null; + } + return max2; + }, + audio:2, + trigger:{player:'damageEnd'}, + forced:true, + filter:function(event,player){ + var target=lib.skill.fengxiang.getMax(); + return !target||target.isDamaged(); + }, + logTarget:function(event,player){ + return lib.skill.fengxiang.getMax()||player; + }, + content:function(){ + var target=lib.skill.fengxiang.getMax(); + if(target) target.recover(); + else player.draw(); + }, + group:'fengxiang_draw', + subSkill:{ + draw:{ + trigger:{ + global:['equipAfter','addJudgeAfter','loseAfter','gainAfter','loseAsyncAfter'], + }, + forced:true, + filter:function(event,player){ + if(event.name=='lose'&&event.getlx===false) return false; + return lib.skill.fengxiang.getMax()!=lib.skill.fengxiang.getMax(event); + }, + content:function(){ + if(trigger.delay===false) game.delayx(); + player.draw(); + }, + }, + }, + }, + //童渊 + chaofeng:{ + audio:2, + trigger:{source:'damageBegin1'}, + direct:true, + filter:function(event,player){ + return player.isPhaseUsing()&&!player.hasSkill('chaofeng2'); + }, + content:function(){ + 'step 0' + var str='弃置一张牌并摸一张牌',num,suit; + if(trigger.card){ + num=get.number(trigger.card); + suit=get.suit(trigger.card); + if(lib.suit.contains(suit)) str+=';若弃置'+get.translation(suit)+'牌则改为摸两张牌'; + if(typeof num=='number') str+=';若弃置点数为'+get.strNumber(num)+'的牌则伤害+1'; + } + var next=player.chooseToDiscard('he',get.prompt('chaofeng',trigger.player),str); + next.set('ai',function(card){ + var player=_status.event.player,suit=_status.event.suit,number=_status.event.number; + var val=4-get.value(card); + if(get.suit(card,player)==suit) val+=3; + if(get.number(card,player)==number) val+=4; + return val; + }); + next.logSkill=['chaofeng',trigger.player]; + if(lib.suit.contains(suit)){ + event.suit=suit; + next.set('suit',suit); + } + if(typeof num=='number'){ + event.number=num; + next.set('number',num); + } + 'step 1' + if(result.bool){ + player.addTempSkill('chaofeng2','phaseUseEnd'); + var card=result.cards[0]; + player.draw((event.suit&&get.suit(card,player)==event.suit)?2:1); + if(event.number&&get.number(card,player)==event.number) trigger.num++; + } + }, + }, + chaofeng2:{}, + chuanshu:{ + audio:2, + trigger:{player:'phaseZhunbeiBegin'}, + direct:true, + juexingji:true, + filter:function(event,player){ + return player.isMinHp(); + }, + skillAnimation:true, + animationColor:'gray', + content:function(){ + 'step 0' + player.chooseTarget(lib.filter.notMe,get.prompt('chuanshu'),'令一名其他角色获得〖朝凤〗').set('ai',function(target){ + return get.attitude(_status.event.player,target) + }); + 'step 1' + if(result.bool){ + var target=result.targets[0]; + player.awakenSkill('chuanshu'); + player.logSkill('chuanshu',target); + target.addSkillLog('chaofeng'); + } + else event.finish(); + 'step 2' + player.loseMaxHp(); + 'step 3' + for(var i of lib.skill.chuanshu.derivation) player.addSkillLog(i); + }, + group:'chuanshu_die', + derivation:['ollongdan','drlt_congjian','chuanyun'], + subSkill:{ + die:{ + trigger:{player:'die'}, + direct:true, + forceDie:true, + content:function(){ + 'step 0' + player.chooseTarget(lib.filter.notMe,'是否令一名其他角色获得〖朝凤〗?').set('forceDie',true).set('ai',function(target){ + return get.attitude(_status.event.player,target) + }); + 'step 1' + if(result.bool){ + player.awakenSkill('chuanshu'); + var target=result.targets[0]; + player.logSkill('chuanshu',target); + target.addSkillLog('chaofeng'); + } + }, + }, + }, + }, + chuanyun:{ + audio:2, + trigger:{player:'useCardToPlayered'}, + shaRelated:true, + filter:function(event,player){ + return event.card.name=='sha'&&event.target.countCards('e')>0; + }, + logTarget:'target', + content:function(){ + var target=trigger.target;card=target.getCards('e').randomGet(); + if(card) target.discard(card); + }, + }, //阚泽 rekuanshi:{ audio:'kuanshi', @@ -1126,10 +1646,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var card=target.getEquip(2); if(card) hs.push(card); player.gain(hs,target,'give'); - event.num=(player.hasMark('tongyuan_tao')?1:hs.length); + event.num=(player.hasMark('zhtongyuan_tao')?1:hs.length); } else{ - if(player.hasMark('tongyuan_wuxie')) player.draw(); + if(player.hasMark('zhtongyuan_wuxie')) player.draw(); else if(player.countCards('h')) player.chooseToDiscard('h',true); event.finish(); } @@ -1145,7 +1665,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ order:4, result:{ player:function(player,target){ - if(!target.countCards('h','shan')) return player.hasMark('tongyuan_wuxie')?1:-1; + if(!target.countCards('h','shan')) return player.hasMark('zhtongyuan_wuxie')?1:-1; return 0; }, target:function(player,target){ @@ -1160,16 +1680,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, }, - tongyuan:{ - audio:2, + tongyuan:{audio:2}, + zhtongyuan:{ + audio:'tongyuan', trigger:{player:'useCard'}, forced:true, filter:function(event,player){ - return (event.card.name=='tao'||event.card.name=='wuxie')&&((player!=_status.currentPhase&&!player.hasMark('tongyuan_'+event.card.name))||(player.hasMark('tongyuan_tao')&&player.hasMark('tongyuan_wuxie'))); + return (event.card.name=='tao'||event.card.name=='wuxie')&&((player!=_status.currentPhase&&!player.hasMark('zhtongyuan_'+event.card.name))||(player.hasMark('zhtongyuan_tao')&&player.hasMark('zhtongyuan_wuxie'))); }, content:function(){ - if(!player.hasMark('tongyuan_'+trigger.card.name)){ - player.addMark('tongyuan_'+trigger.card.name,1,false); + if(!player.hasMark('zhtongyuan_'+trigger.card.name)){ + player.addMark('zhtongyuan_'+trigger.card.name,1,false); game.log(player,'修改了技能','#g【摧坚】'); } else{ @@ -1442,7 +1963,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ preHidden:true, filter:function(event,player){ var color=get.color(event.card); - if(player==event.player||event.player.isDead()||(get.mode()=='guozhan'&&color!='black')) return false; + if(player==event.player||event.player.isDead()||color=='none'||(get.mode()=='guozhan'&&color!='black')) return false; var type=get.type(event.card); return type=='basic'||type=='trick'; }, @@ -2800,7 +3321,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return evt.getParent()==event&&!player.getHistory('sourceDamage',function(evt2){ return evt.card==evt2.card; }).length; - }).length) player.skip('phaseUse'); + }).length){ + player.skip('phaseUse'); + player.skip('phaseDiscard'); + } player.removeSkill('mouni2'); }, }, @@ -2970,25 +3494,38 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var cards=get.bottomCards(3); event.cards2=cards; game.cardsGotoOrdering(cards); - var dialog=['兴作:将三张牌置于牌堆底(先选择的在上)','
牌堆底
',cards]; - var hs=player.getCards('h'); + var next=player.chooseToMove('兴作:将三张牌置于牌堆底'); + var list=[['牌堆底',cards]],hs=player.getCards('h'); if(hs.length){ - dialog.push('
你的手牌
'); - dialog.push(hs); + list.push(['手牌',hs]); + next.set('filterMove',function(from,to){ + return typeof to!='number'; + }); } - player.chooseButton(dialog,3,true).set('ai',function(button){ - var player=_status.event.player,allcards=player.getCards('h').concat(_status.event.getParent().cards2); - if(button.link.name=='sha'&&allcards.filter(function(card){ - return card.name=='sha'&&!ui.selected.buttons.filter(function(button){ - return button.link==card; - }).length; - }).length>player.getCardUsable({name:'sha'})) return 10; - return -player.getUseValue(button.link,player); - }); + next.set('list',list); + next.set('processAI',function(list){ + var allcards=list[0][1].concat(list[1][1]),canchoose=allcards.slice(0),cards=[]; + var player=_status.event.player; + var getv=function(button){ + if(button.name=='sha'&&allcards.filter(function(card){ + return card.name=='sha'&&!cards.filter(function(){ + return button==card; + }).length; + }).length>player.getCardUsable({name:'sha'})) return 10; + return -player.getUseValue(button,player); + }; + while(cards.length<3){ + canchoose.sort(function(a,b){ + return getv(b)-getv(a); + }); + cards.push(canchoose.shift()); + } + return [cards,canchoose]; + }) 'step 1' if(result.bool){ event.forceDie=true; - var cards=result.links; + var cards=result.moved[0]; event.cards=cards; player.storage.xingzuo2=cards; var hs=player.getCards('h'); @@ -3200,13 +3737,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return false; } return game.hasPlayer(function(current){ - return current.maxHp>player.maxHp; + return current!=player; }); }, content:function(){ 'step 0' player.chooseTarget(get.prompt2('reyirang'),function(card,player,target){ - return target.maxHp>player.maxHp; + return target!=player; }).set('ai',function(target){ return (get.attitude(_status.event.player,target)-2)*target.maxHp; }); @@ -3218,7 +3755,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var target=result.targets[0]; player.logSkill('reyirang',target); target.gain(cards,player,'give'); - player.gainMaxHp(target.maxHp-player.maxHp,true); + if(target.maxHp>player.maxHp) player.gainMaxHp(target.maxHp-player.maxHp,true); player.recover(cards.length); } } @@ -4714,7 +5251,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, xianshuai:{ audio:2, - trigger:{global:'damageEnd'}, + trigger:{global:'damageSource'}, forced:true, filter:function(event,player){ return event.source&&event.source.isAlive()&&!player.hasSkill('xianshuai2'); @@ -4728,7 +5265,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, }, - xianshuai2:{}, + xianshuai2:{charlotte:true}, shiyuan:{ audio:2, trigger:{target:'useCardToTargeted'}, @@ -7898,12 +8435,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.storage.olxingshen=0; player.unmarkSkill('olxingshen'); } + num=Math.min(10,num); event.cards=get.cards(num); + game.cardsGotoOrdering(event.cards); player.showCards(event.cards); "step 1" event.getedResult=lib.skill.yanjiao.getResult(cards); if(!event.getedResult.length){ - game.cardsDiscard(cards); player.addTempSkill('yanjiao2'); event.finish(); } @@ -7913,8 +8451,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }; "step 3" if(result.control=="手动分配"){ - event.map=[cards,[],[]]; - _status.noclearcountdown=true; event.goto(8); } else if(!_status.connectMode){ @@ -7940,9 +8476,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ choiceList.buttons.add(next.firstChild); } event.choiceList=choiceList; - target.chooseButton(choiceList,true,function(button){ - return true; - }); + target.chooseButton(choiceList,true); } "step 4" if(result.bool&&result.links) event.index=result.links[0]; @@ -7959,125 +8493,46 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 7" target.gain(event.togain[result.index],'gain2'); player.gain(event.togain[1-result.index],'gain2'); - if(event.togain[2].length){ - game.cardsDiscard(event.togain[2]); - if(event.togain[2].length>1) player.addTempSkill('yanjiao2'); - } + if(event.togain[2].length>1) player.addTempSkill('yanjiao2'); event.finish(); "step 8" - event.videoId=lib.status.videoId++; - var dialogx=['严教:选择要移动的牌']; - var name=["未分配","第一组","第二组"]; - for(var i=0;i0){ - dialogx.push('
'+name[i]+'
'); - dialogx.push(event.map[i]) - } - } - if(target.isOnline2()){ - target.send(function(dialogx,id){ - ui.create.dialog.apply(null,dialogx).videoId=id; - },dialogx,event.videoId); - } - event.dialog=ui.create.dialog.apply(null,dialogx); - event.dialog.videoId=event.videoId; - if(target!=game.me||_status.auto){ - event.dialog.style.display='none'; - } - var next=target.chooseButton(); - next.set('selectButton',function(){ - if(!_status.event.map[1].length||!_status.event.map[2].length) return 1; + var next=target.chooseToMove('严教:分出点数相等的两组牌'); + next.set('chooseTime',(cards.length*4).toString()); + next.set('list',[ + ['未分配',cards,function(list){ + var num=0; + for(var i of list) num+=i.number; + return '未分配(点数和'+num+')'; + }], + ['第一组',[],function(list){ + var num=0; + for(var i of list) num+=i.number; + return '第一组(点数和'+num+')'; + }], + ['第二组',[],function(list){ + var num=0; + for(var i of list) num+=i.number; + return '第二组(点数和'+num+')'; + }], + ]); + next.set('filterOk',function(moved){ var num1=0; - for(var i=0;i<_status.event.map[1].length;i++){ - num1+=_status.event.map[1][i].number; - } + for(var i of moved[1]) num1+=i.number; + if(num1==0) return false; var num2=0; - for(var j=0;j<_status.event.map[2].length;j++){ - num2+=_status.event.map[2][j].number; - } - return (num1==num2?[0,1]:1); - }); - next.set('map',event.map); - next.set('dialog',event.videoId); - next.set('ai',function(){return -1}); - next.set('forceAuto',true); + for(var i of moved[2]) num2+=i.number; + return num1==num2; + }) + next.set('processAI',()=>false); "step 9" if(result.bool){ - if(!result.links.length){ - if(target.isOnline2()){ - target.send('closeDialog',event.videoId); - } - event.dialog.close(); - delete _status.noclearcountdown; - if(!_status.noclearcountdown){ - game.stopCountChoose(); - } - event.togain=[event.map[1],event.map[2],event.map[0]]; - target.showCards(event.togain[0],get.translation(target)+'分出的第一份牌'); - event.goto(5); - } - else{ - event.card=result.links[0]; - var controls=["取消分组","移动到第一组","移动到第二组"]; - for(var i=0;i=2) return false; + return true; + }); + next.set('filterOk',function(moved){ + return moved[1].length==2; + }); + next.set('processAI',function(list){ + var cards=list[0][1].slice(0).sort(function(a,b){ + return get.value(b)-get.value(a); + }); + return [cards,cards.splice(2)]; + }) + 'step 1' + var top=result.moved[0]; + var bottom=result.moved[1]; + top.reverse(); + for(var i=0;i刘备称汉中王时,糜芳为南郡太守,但受到关羽的轻慢。后来,因未完成供给军资的任务而被关羽责骂,心中不安。吕蒙袭取荆州时,将已经投降的傅士仁展示给糜芳,麋芳于是选择投降,导致关羽兵败被杀。此后,在吴国担任将军,并且为吴征伐。', + tongyuan:'童渊,字雄付,武术名家,与并州李彦是结拜兄弟,两人均师承义父玉真子,两人分别娶了河北颜家的两位大小姐颜云、颜雨。童飞之父,有张任、张绣为入室弟子,晚年收赵云为关门弟子,传其毕生所学。其成名技为“百鸟朝凤枪”。童渊是南方苏州评话三国中的原创人物,在历史中以及《三国演义》中并不存在。', + liuyong:'刘永,字公寿,涿郡涿县(今河北涿州)人,三国时期蜀汉昭烈帝刘备之子,蜀汉后主刘禅之弟。章武元年(221年)六月,封鲁王。建兴八年(230年),改封甘陵王。咸熙元年(264年),蜀汉灭亡,刘永被迁往洛阳,被任命为奉车都尉,封乡侯。', + zhangning:'张宁,东汉末年大贤良师张角的女儿。自幼学习太平道法,掌握天地法则。', + wanniangongzhu:'刘氏(生卒年不详),河南郡雒阳县(今河南省洛阳市)人,汉灵帝刘宏之女,汉少帝刘辩与汉献帝刘协的姐妹,封万年公主。', }, characterTitle:{ wulan:'#b对决限定武将', @@ -10729,7 +11205,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return '当你于'+(player.hasSkill('yaner_zhiren')?'一':'你的')+'回合内使用第一张非转化牌时,你可依次执行以下选项中的前X项:①卜算X。②可弃置场上的一张装备牌和延时锦囊牌。③回复1点体力。④摸三张牌。(X为此牌的名称的字数)'; }, cuijian:function(player){ - return '出牌阶段限一次,你可以选择一名有手牌的其他角色。若其手牌中:有【闪】,其将装备区内的防具牌和所有【闪】交给你,然后你交给其'+(player.hasMark('tongyuan_tao')?'一张':'等量的')+'牌;没有【闪】,你'+(player.hasMark('tongyuan_wuxie')?'摸一张':'弃置一张手')+'牌。'; + return '出牌阶段限一次,你可以选择一名有手牌的其他角色。若其手牌中:有【闪】,其将装备区内的防具牌和所有【闪】交给你,然后你交给其'+(player.hasMark('zhtongyuan_tao')?'一张':'等量的')+'牌;没有【闪】,你'+(player.hasMark('zhtongyuan_wuxie')?'摸一张':'弃置一张手')+'牌。'; }, }, perfectPair:{ @@ -10920,7 +11396,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_zhanghe:'SP张郃', yuanlve:'远略', yuanlve_info:'出牌阶段限一次,你可以将一张非装备牌交给一名角色,然后该角色可以使用该牌并令你摸一张牌。', - xunchen:'荀谌', + xunchen:'OL荀谌', fenglve:'锋略', fenglve2:'锋略', fenglve_info:'出牌阶段开始时,你可以与一名角色拼点,若你赢,该角色将其区域内的各一张牌交给你;若你没赢,你交给其一张牌。当你的单人拼点结算后,你可以令对方获得你拼点的牌。', @@ -11163,7 +11639,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ csyizheng2:'翊正', csyizheng_info:'结束阶段开始时,你可以选择一名其他角色。你的下回合开始前,当该角色造成伤害或回复体力时,若其体力上限小于你,则你减1点体力上限,且令此伤害值/回复值+1。', reyirang:'揖让', - reyirang_info:'出牌阶段开始时,你可以将所有非基本牌交给一名体力上限大于你的其他角色,然后调整体力上限至与该角色相同并回复X点体力(X为你以此法交给其的牌数)。', + reyirang_info:'出牌阶段开始时,你可以将所有非基本牌交给一名其他角色。若其体力上限大于你,则你将体力上限调整至与其相同。然后你回复X点体力(X为你以此法交给其的牌数)。', xiahoujie:'夏侯杰', liedan:'裂胆', liedan_info:'锁定技,其他角色的准备阶段开始时,若X大于0,则你摸X张牌。若X等于3,则你加1点体力上限。若X为0,则你失去1点体力并获得一枚“裂”(X为你的手牌数,体力值,装备区牌数中大于其的数量)。准备阶段,若“裂”数大于4,则你死亡。', @@ -11183,7 +11659,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ lxzhuixi_info:'锁定技,当你造成伤害或受到伤害时,若受伤角色的翻面状态和伤害来源的翻面状态不同,则此伤害+1。', zhangmiao:'张邈', mouni:'谋逆', - mouni_info:'准备阶段,你可对一名其他角色依次使用你手牌中所有的【杀】(若其进入了濒死状态,则终止此流程)。然后若这些【杀】中有未造成伤害的【杀】,则你跳过本回合的出牌阶段。', + mouni_info:'准备阶段,你可对一名其他角色依次使用你手牌中所有的【杀】(若其进入了濒死状态,则终止此流程)。然后若这些【杀】中有未造成伤害的【杀】,则你跳过本回合的出牌阶段和弃牌阶段。', zongfan:'纵反', zongfan_info:'觉醒技,结束阶段,若你本回合内因〖谋逆〗使用过【杀】且未跳过本回合的出牌阶段,则你将任意张牌交给一名其他角色,然后加X点体力上限并回复X点体力(X为你以此法给出的牌数)。最后失去〖谋逆〗并获得〖战孤〗。', zhangu:'战孤', @@ -11271,8 +11747,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ zhanghu:'张虎', cuijian:'摧坚', cuijian_info:'出牌阶段限一次,你可以选择一名有手牌的其他角色。若其手牌中:有【闪】,其将装备区内的防具牌和所有【闪】交给你,然后你交给其等量的牌;没有【闪】,你弃置一张手牌。', - tongyuan:'同援', - tongyuan_info:'锁定技。①当你于回合外使用【无懈可击】时,你将〖摧坚〗中的“弃置一张手牌”改为“摸一张牌”;②当你于回合外使用【桃】时,你将〖摧坚〗中的“等量的牌”改为“一张牌”。③当你使用【无懈可击】/【桃】时,若你已发动过〖摧坚①〗和〖摧坚②〗,则此牌不可被响应/回复值+1。', + zhtongyuan:'同援', + zhtongyuan_info:'锁定技。①当你于回合外使用【无懈可击】时,你将〖摧坚〗中的“弃置一张手牌”改为“摸一张牌”;②当你于回合外使用【桃】时,你将〖摧坚〗中的“等量的牌”改为“一张牌”。③当你使用【无懈可击】/【桃】时,若你已发动过〖摧坚①〗和〖摧坚②〗,则此牌不可被响应/回复值+1。', dufuren:'杜夫人', yise:'异色', yise_info:'其他角色获得你的牌后,若这些牌中:有红色牌,你可令其回复1点体力;有黑色牌,其下次受到【杀】造成的伤害时,此伤害+1。', @@ -11321,6 +11797,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_mifangfushiren:'糜芳傅士仁', mffengshi:'锋势', mffengshi_info:'当你使用牌指定唯一目标后,或成为其他角色使用牌的唯一目标后,若此牌使用者的手牌数大于此牌目标的手牌数,则此牌的使用者可令你弃置自己和对方的各一张牌,并令此牌的伤害值+1。', + tongyuan:'童渊', + chaofeng:'朝凤', + chaofeng_info:'出牌阶段限一次。当你造成伤害时,你可以弃置一张牌,然后摸一张牌。若此伤害的渠道为牌且你弃置的牌:与此牌花色相同,则你改为摸两张牌;与此牌点数相同,则此伤害+1。', + chuanshu:'传术', + chuanshu_info:'限定技。准备阶段,若你的体力值为全场最少,或当你死亡时,你可令一名其他角色获得〖朝凤〗。然后若你存活,则你获得〖龙胆〗、〖从谏〗和〖穿云〗。', + chuanyun:'穿云', + chuanyun_info:'当你使用【杀】指定目标后,你可令目标角色随机弃置其装备区内的一张牌。', + liuyong:'刘永', + zhuning:'诛佞', + zhuning_info:'出牌阶段限一次。你可将任意张牌交给一名其他角色(称为“隙”),然后可视为使用一张具有伤害标签的基本牌/锦囊牌(不计入次数限制)。若你以此法使用的牌未造成伤害,则你将〖诛佞〗于本回合内改为“限两次”。', + fengxiang:'封乡', + fengxiang_info:'锁定技。①当你受到伤害后,若场上:存在“隙”唯一最多的角色,则其回复1点体力;不存在,则你摸一张牌。②当有角色的手牌移动后,若场上“隙”最多的角色因此发生变化,则你摸一张牌。', + fengxiang_tag:'隙', + zhangning:'张宁', + tianze:'天则', + tianze_info:'①每回合限触发一次。其他角色于其出牌阶段内使用♠手牌结算结束后,你可以弃置一张黑色牌,并对其造成1点伤害。②其他角色的判定生效后,若结果为♠,则你摸一张牌。', + difa:'地法', + difa_info:'当你于回合内因摸牌而获得♥牌时,你可以弃置之。然后你选择一个锦囊牌的牌名,并从牌堆中获得一张此牌名的牌。', + re_xunchen:'荀谌', + refenglve:'锋略', + refenglve_info:'出牌阶段限一次,你可以和一名其他角色进行拼点。若你赢,其将区域内的两张牌交给你;若平局,则你令此技能于本阶段内的发动次数上限+1;若你输,你交给其一张牌。', + anyong:'暗涌', + anyong_info:'当一名角色于其回合内第一次对其他角色造成伤害后,若伤害值为1,则你可弃置一张牌,并对受伤角色造成1点伤害。', + wanniangongzhu:'万年公主', + zhenge:'枕戈', + zhenge_info:'准备阶段,你可以选择一名角色。该角色本局游戏的攻击范围+1(至多+5)。然后若所有其他角色都在该角色的攻击范围内,则你可以令其视为对另一名角色使用一张【杀】。', + xinghan:'兴汉', + xinghan_info:'锁定技,每回合的第一张【杀】造成伤害后,若此【杀】的使用者成为过〖枕戈〗的目标,则你摸一张牌。若你的手牌数不是全场唯一最多的,则改为摸X张牌(X为该角色的攻击范围且最多为5)。', sp_whlw:"文和乱武", sp_zlzy:"逐鹿中原", @@ -11337,6 +11841,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_qihuan:'戚宦之争', sp_zhongyuan:'中原狼烟', sp_binglin:'兵临城下', + sp_yinyu:'隐玉包', + sp_zhilan:'芝兰包', sp_decade:'其他新服武将', }, }; diff --git a/character/standard.js b/character/standard.js index 2daf3c9f0..ffdeff464 100755 --- a/character/standard.js +++ b/character/standard.js @@ -1062,225 +1062,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } }, - xinguanxing:{ - audio:'guanxing', - // alter:true, - trigger:{player:['phaseZhunbeiBegin','phaseJieshuBegin']}, - frequent:true, - filter:function(event,player,name){ - if(name=='phaseJieshuBegin'){ - return player.hasSkill('xinguanxing_on'); - } - return true; - }, - content:function(){ - 'step 0' - if(get.is.altered('xinguanxing')){ - event.num=game.countPlayer()<4?3:5; - } - else{ - event.num=Math.min(5,game.countPlayer()); - } - event.cards=get.cards(event.num); - event.chosen=[]; - event.num1=0; - event.num2=0; - event.bottom=-1; - 'step 1' - var js=player.getCards('j'); - var pos; - var choice=-1; - var getval=function(card,pos){ - if(js[pos]){ - return (get.judge(js[pos]))(card); - } - else if(event.triggername=='phaseJieshuBegin'&&get.attitude(player,player.getNext())<=0){ - return 11.5-get.value(card,player); - } - else{ - return get.value(card,player); - } - }; - event.discard=false; - var minval=6; - for(pos=0;posmax){ - choice=j; - max=current; - } - } - if(event.bottom<0){ - if(!js[pos]){ - if(max=0&&event.bottom<=pos){ - choice=pos; - event.discard=true;break; - } - if(choice!=-1){ - break; - } - } - player.chooseCardButton('观星:选择要移动的牌',event.cards).set('filterButton',function(button){ - return !_status.event.chosen.contains(button.link); - }).set('chosen',event.chosen).set('ai',function(button){ - return button.link==_status.event.choice?1:0; - }).set('choice',event.cards[choice]); - event.pos=pos; - 'step 2' - if(result.bool){ - var card=result.links[0]; - var index=event.cards.indexOf(card); - event.card=card; - event.chosen.push(card); - event.cards.remove(event.card); - var controlai=event.pos||0; - if(event.discard){ - controlai=event.cards.length+1; - } - var buttons=event.cards.slice(0); - player.chooseControl(function(){ - return _status.event.controlai; - }).set('controlai',controlai).set('sortcard',buttons).set('tosort',card); - } - else{ - event.goto(4); - } - 'step 3' - if(typeof result.index=='number'){ - if(result.index>event.cards.length){ - ui.cardPile.appendChild(event.card); - event.num2++; - } - else{ - event.cards.splice(result.index,0,event.card); - } - event.num--; - if(event.num>0){ - event.goto(1); - } - } - 'step 4' - while(event.cards.length){ - ui.cardPile.insertBefore(event.cards.pop(),ui.cardPile.firstChild); - event.num1++; - } - var js=player.getCards('j'); - if(js.length==1){ - if((get.judge(js[0]))(ui.cardPile.firstChild)<0){ - player.addTempSkill('guanxing_fail'); - } - } - player.popup(get.cnNumber(event.num1)+'上'+get.cnNumber(event.num2)+'下'); - game.log(player,'将','#y'+get.cnNumber(event.num1)+'张牌','置于牌堆顶,','#y'+get.cnNumber(event.num2)+'张牌','置于牌堆底'); - if(event.triggername=='phaseZhunbeiBegin'&&get.is.altered('xinguanxing')&&event.num1==0){ - player.addTempSkill('xinguanxing_on'); - } - }, - subSkill:{ - on:{} - } - }, - guanxing_oldnew:{ - audio:2, - audioname:['jiangwei'], - trigger:{player:'phaseZhunbeiBegin'}, - frequent:true, - content:function(){ - 'step 0' - event.num=Math.min(5,game.countPlayer()); - if(event.name!='yizhi'&&player.hasSkill('yizhi')) event.num=5; - event.cards=get.cards(event.num); - event.chosen=[]; - event.num1=0; - event.num2=0; - 'step 1' - var js=player.getCards('j'); - var pos; - var choice=-1; - var getval=function(card,pos){ - if(js[pos]){ - return (get.judge(js[pos]))(card); - } - else{ - return get.value(card); - } - }; - for(pos=0;posmax){ - choice=j; - max=current; - } - } - if(choice!=-1){ - break; - } - } - player.chooseCardButton('观星:选择要移动的牌',event.cards).set('filterButton',function(button){ - return !_status.event.chosen.contains(button.link); - }).set('chosen',event.chosen).set('ai',function(button){ - return button.link==_status.event.choice?1:0; - }).set('choice',event.cards[choice]); - event.pos=pos; - 'step 2' - if(result.bool){ - var card=result.links[0]; - var index=event.cards.indexOf(card); - event.card=card; - event.chosen.push(card); - event.cards.remove(event.card); - var buttons=event.cards.slice(0); - player.chooseControl(function(){ - return _status.event.controlai; - }).set('controlai',event.pos||0).set('sortcard',buttons).set('tosort',card); - } - else{ - event.goto(4); - } - 'step 3' - if(typeof result.index=='number'){ - if(result.index>event.cards.length){ - ui.cardPile.appendChild(event.card); - event.num2++; - } - else{ - event.cards.splice(result.index,0,event.card); - } - event.num--; - if(event.num>0){ - event.goto(1); - } - } - 'step 4' - while(event.cards.length){ - ui.cardPile.insertBefore(event.cards.pop(),ui.cardPile.firstChild); - event.num1++; - } - var js=player.getCards('j'); - if(js.length==1){ - if((get.judge(js[0]))(ui.cardPile.firstChild)<0){ - player.addTempSkill('guanxing_fail'); - } - } - player.popup(get.cnNumber(event.num1)+'上'+get.cnNumber(event.num2)+'下'); - game.log(player,'将','#y'+get.cnNumber(event.num1)+'张牌','置于牌堆顶,','#y'+get.cnNumber(event.num2)+'张牌','置于牌堆底'); - }, - ai:{ - guanxing:true - } - }, guanxing_fail:{}, guanxing:{ audio:2, @@ -1290,19 +1071,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ preHidden:true, content:function(){ "step 0" - if(player.isUnderControl()){ - game.swapPlayerAuto(player); - } var num=Math.min(5,game.countPlayer()); if(player.hasSkill('yizhi')&&player.hasSkill('guanxing')){ num=5; } var cards=get.cards(num); - event.cards=cards; - var switchToAuto=function(){ - _status.imchoosing=false; - if(event.dialog) event.dialog.close(); - if(event.control) event.control.close(); + 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; @@ -1331,149 +1113,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } bottom=cards; - for(var i=0;i0; + }, + content:function(){ + 'step 0' + player.chooseCardTarget({ + filterCard:true, + filterTarget:lib.filter.notMe, + position:'he', + prompt:get.prompt2('xinzhenjun'), + ai1:function(card){ + var player=_status.event.player; + if(card.name=='sha'&&get.color(card)=='red'){ + for(var i=0;i0&¤t.hasValueTarget(card)) return 7; + } + return 0; + } + return 7-get.value(card); + }, + ai2:function(target){ + var player=_status.event.player; + var card=ui.selected.cards[0]; + var att=get.attitude(player,target); + if(get.value(card)<0) return -att*2; + if(target.countCards('h',{name:'sha',color:'red'})||target.hasSkill('wusheng')||target.hasSkill('new_rewusheng')||target.hasSkill('wushen')||(card.name=='sha'&&get.color(card)=='red'&&target.hasValueTarget(card))) return att*2; + var eff=0; + game.countPlayer(function(current){ + if(target!=current&&get.distance(target,current,'attack')>1) return; + var eff2=get.damageEffect(current,player,player); + if(eff2>eff) eff=eff2; + }); + if(att>0&&eff>0) eff+=2*att; + return eff; + }, + }); + 'step 1' + if(result.bool){ + var target=result.targets[0]; + event.target=target; + player.logSkill('xinzhenjun',target); + target.gain(result.cards,player,'giveAuto') + } + else event.finish(); + 'step 2' + target.chooseToUse({ + filterCard:function(card){ + return get.name(card)=='sha'&&get.color(card)!='black'&&lib.filter.cardEnabled.apply(this,arguments); + }, + prompt:'请使用一张不为黑色的【杀】,否则'+get.translation(player)+'可以对你或你攻击范围内的一名其他角色造成1点伤害', + }); + 'step 3' + if(result.bool){ + var num=1; + game.countPlayer2(function(current){ + current.getHistory('damage',function(evt){ + if(evt.getParent(evt.notLink()?4:8)==event) num+=evt.num; + }); + }); + player.draw(num); + event.finish(); + } + else{ + player.chooseTarget('是否对'+get.translation(target)+'或其攻击范围内的一名角色造成1点伤害?',function(card,player,target){ + return target==_status.event.targetx||_status.event.targetx.inRange(target); + }).set('targetx',event.target).ai=function(target){ + var player=_status.event.player; + return get.damageEffect(target,player,player) + }; + } + 'step 4' + if(result.bool){ + player.line(result.targets); + result.targets[0].damage('nocard'); + } + }, + }, twmoukui:{ trigger:{player:'useCardToPlayered'}, direct:true, @@ -1643,6 +1728,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ tw_fuwan:'TW伏完', twmoukui:'谋溃', twmoukui_info:'当你使用【杀】指定目标后,你可以选择一项:①摸一张牌;②弃置该角色的一张牌;③背水:若此【杀】未因造成伤害而令该角色进入过濒死状态,则该角色弃置你的一张牌。', + tw_yujin:'SP于禁', + xinzhenjun:'镇军', + xinzhenjun_info:'出牌阶段开始时,你可以将一张牌交给一名其他角色,令其选择是否使用一张不为黑色的【杀】。若其选择是,则你于此【杀】结算完成后摸1+X张牌(X为此【杀】造成的伤害总点数)。若其选择否,则你对其或其攻击范围内的一名其他角色造成1点伤害。', tw_mobile:'移动版', tw_yijiang:'一将成名TW', tw_english:'英文版', diff --git a/character/yijiang.js b/character/yijiang.js index 91e5149b7..e647ac62e 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -6,7 +6,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ //connectBanned:['qinmi'], characterSort:{ yijiang:{ - yijiang_2011:['caozhi','re_yujin','zhangchunhua','xin_fazheng','xin_masu','xin_xushu','xusheng','lingtong','wuguotai','chengong','gaoshun'], + yijiang_2011:['caozhi','yujin','zhangchunhua','xin_fazheng','xin_masu','xin_xushu','xusheng','lingtong','wuguotai','chengong','gaoshun'], yijiang_2012:['old_wangyi','xunyou','zhonghui','madai','liaohua','old_guanzhang','bulianshi','handang','chengpu','liubiao','old_huaxiong','caozhang'], yijiang_2013:['manchong','guohuai','caochong','guanping','liufeng','jianyong','yufan','panzhangmazhong','zhuran','xin_liru','fuhuanghou'], yijiang_2014:['hanhaoshihuan','chenqun','caozhen','zhangsong','wuyi','zhoucang','zhuhuan','guyong','sunluban','yj_jushou','caifuren'], @@ -96,7 +96,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ old_huaxiong:['male','qun',6,['shiyong']], - re_yujin:["male","wei",4,["xinzhenjun"],[]], + yujin:["male","wei",4,["yizhong"],[]], }, characterIntro:{ caozhi:'字子建,沛国谯人,三国曹魏著名文学家,建安文学代表人物。魏武帝曹操之子,魏文帝曹丕之弟,生前曾为陈王,去世后谥号“思”,因此又称陈思王。南朝宋文学家谢灵运更有“天下才有一石,曹子建独占八斗”的评价。王士祯尝论汉魏以来二千年间诗家堪称“仙才”者,曹植、李白、苏轼三人耳。', @@ -912,106 +912,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, }, - xinzhenjun:{ - audio:'jieyue', - trigger:{ - player:'phaseUseBegin' - }, - direct:true, - filter:function(event,player){ - return player.countCards('he')>0; - }, - content:function(){ - 'step 0' - player.chooseCardTarget({ - filterCard:true, - filterTarget:lib.filter.notMe, - position:'he', - prompt:get.prompt2('xinzhenjun'), - ai1:function(card){ - var player=_status.event.player; - if(card.name=='sha'&&get.color(card)=='red'){ - for(var i=0;i0&¤t.hasValueTarget(card)) return 7; - } - return 0; - } - return 7-get.value(card); - }, - ai2:function(target){ - var player=_status.event.player; - var card=ui.selected.cards[0]; - var att=get.attitude(player,target); - if(get.value(card)<0) return -att*2; - if(target.countCards('h',{name:'sha',color:'red'})||target.hasSkill('wusheng')||target.hasSkill('new_rewusheng')||target.hasSkill('wushen')||(card.name=='sha'&&get.color(card)=='red'&&target.hasValueTarget(card))) return att*2; - var eff=0; - game.countPlayer(function(current){ - if(target!=current&&get.distance(target,current,'attack')>1) return; - var eff2=get.damageEffect(current,player,player); - if(eff2>eff) eff=eff2; - }); - if(att>0&&eff>0) eff+=2*att; - return eff; - }, - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - event.target=target; - player.logSkill('xinzhenjun',target); - target.gain(result.cards,player,'giveAuto') - } - else event.finish(); - 'step 2' - target.chooseToUse({ - filterCard:function(card){ - return get.name(card)=='sha'&&get.color(card)!='black'&&lib.filter.cardEnabled.apply(this,arguments); - }, - prompt:'请使用一张不为黑色的【杀】,否则'+get.translation(player)+'可以对你或你攻击范围内的一名其他角色造成1点伤害', - }); - 'step 3' - if(result.bool){ - var num=1; - game.countPlayer2(function(current){ - current.getHistory('damage',function(evt){ - if(evt.getParent(evt.notLink()?4:8)==event) num+=evt.num; - }); - }); - player.draw(num); - event.finish(); - } - else{ - player.chooseTarget('是否对'+get.translation(target)+'或其攻击范围内的一名角色造成1点伤害?',function(card,player,target){ - return target==_status.event.targetx||_status.event.targetx.inRange(target); - }).set('targetx',event.target).ai=function(target){ - var player=_status.event.player; - return get.damageEffect(target,player,player) - }; - } - 'step 4' - if(result.bool){ - player.line(result.targets); - result.targets[0].damage('nocard'); - } - }, - //group:['xinzhenjun_damage'], - subSkill:{ - damage:{ - trigger:{global:'damage'}, - forced:true, - silent:true, - popup:false, - filter:function(event,player){ - var evt=event.getParent(event.notLink()?4:8); - return evt&&evt.name=='xinzhenjun'&&evt.player==player; - }, - content:function(){ - player.draw(trigger.num); - }, - }, - }, - }, xinfuli:{ audio:2, skillAnimation:true, @@ -2858,9 +2758,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseDrawAfter'}, direct:true, filter:function(event,player){ - return player.storage.bizhuan&&player.storage.bizhuan.length; + return player.storage.bizhuan&&player.storage.bizhuan.length&&player.countCards('he')>0; }, - locked:false, content:function(){ "step 0" var four=false; @@ -2876,122 +2775,78 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } } - var suits2=[]; - if(four){ - suits2=['club','spade','heart','diamond']; - for(var i=0;i1){ - if(val<=0) return 0.01; - return val; - } - else{ - return 0; - } - } - } - else{ - if(val<0) return -10; - if(_status.event.player.skipList.contains('phaseUse')){ - return -val; - } - return val; - } - }).set('four',event.four).set('suits2',suits2).set('nofour',event.nofour); - if(player==game.me&&!event.isMine()){ - game.delay(0.5); - } - "step 3" - player.gain(result.links,'fromStorage'); - for(var i=0;i0){ event.finish(); } - "step 5" + "step 3" event.cards=player.storage.bizhuan.slice(0); player.storage.bizhuan.length=0; player.unmarkSkill('bizhuan'); - "step 6" + "step 4" if(event.cards.length>1){ player.chooseCardButton('将所有“书”交给任意名其他角色',true,event.cards,[1,event.cards.length]).set('ai',function(button){ if(ui.selected.buttons.length==0) return 1; @@ -3004,7 +2859,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else{ event.finish(); } - "step 7" + "step 5" if(result.bool){ for(var i=0;i0; + })) + for(var i=0;i0; }); - "step 1" - if(result&&result.bool&&result.links&&result.links.length){ - var cards=result.links.slice(0); - while(cards.length){ - ui.cardPile.insertBefore(cards.pop(),ui.cardPile.firstChild); + next.set('processAI',function(list){ + var cards=list[0][1].slice(0),cards2=cards.filter(function(i){ + return get.type(i,false)=='equip'; + }),cards3; + if(cards2.length){ + cards3=cards2.randomGet(); } - player.logSkill(event.name); + else cards3=cards.randomGet(); + return [[],[cards3]]; + }) + 'step 1' + if(result.bool){ + var cards=result.moved[1]; + game.log(player,'将',cards,'置于了牌堆顶'); + while(cards.length) ui.cardPile.insertBefore(cards.pop().fix(),ui.cardPile.firstChild) } }, }, @@ -12254,7 +12132,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ characterReplace:{ caozhi:['re_caozhi','caozhi'], zhangchunhua:['re_zhangchunhua','zhangchunhua','mini_zhangchunhua'], - yujin:['yujin_yujin','re_yujin','ol_yujin','xin_yujin','yujin'], + yujin:['yujin_yujin','ol_yujin','xin_yujin','yujin'], xushu:['re_xushu','xin_xushu','xushu'], fazheng:['re_fazheng','xin_fazheng','fazheng'], masu:['xin_masu','re_masu','masu'], @@ -12314,7 +12192,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xunyou:'荀攸', liubiao:'刘表', zhuran:'朱然', - yujin:'毅重于禁', + yujin:'于禁', masu:'旧马谡', xin_masu:'马谡', xin_fazheng:'法正', @@ -12393,8 +12271,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "zhenjun_info":"准备阶段,你可以弃置一名手牌数多于体力值的角色的X张牌(X为其手牌数和体力值之差),然后选择一项:1.你弃置等同于其中非装备牌数量的牌;2.其摸等量的牌。", rezhenjun:"镇军", rezhenjun_info:"准备阶段,你可以弃置一名角色的X张牌(X为其手牌数和体力值之差且至少为1),然后选择一项:1.你弃置X张牌;2.其摸X张牌。(X为其弃置的牌中非装备牌的数量)", - xinzhenjun:'镇军', - xinzhenjun_info:'出牌阶段开始时,你可以将一张牌交给一名其他角色,令其选择是否使用一张不为黑色的【杀】。若其选择是,则你于此【杀】结算完成后摸1+X张牌(X为此【杀】造成的伤害总点数)。若其选择否,则你对其或其攻击范围内的一名其他角色造成1点伤害。', fenli:'奋励', fenli_info:'若你的手牌数为全场最多,你可以跳过摸牌阶段;若你的体力值为全场最多,你可以跳过出牌阶段;若你的装备区里有牌且数量为全场最多,你可以跳过弃牌阶段。', pingkou:'平寇', diff --git a/character/yingbian.js b/character/yingbian.js index 86bc2df81..a32a3ceaf 100644 --- a/character/yingbian.js +++ b/character/yingbian.js @@ -15,7 +15,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ jin_yanghuiyu:['female','jin',3,['huirong','ciwei','caiyuan'],['hiddenSkill']], shibao:['male','jin',4,['zhuosheng']], jin_zhangchunhua:['female','jin',3,['huishi','qingleng','xuanmu'],['hiddenSkill']], - jin_simayi:['male','jin',3,['buchen','smyyingshi','xiongzhi','quanbian'],['hiddenSkill']], + jin_simayi:['male','jin',3,['buchen','smyyingshi','xiongzhi','xinquanbian'],['hiddenSkill']], jin_wangyuanji:['female','jin',3,['shiren','yanxi'],['hiddenSkill']], jin_simazhao:['male','jin',3,['tuishi','xinchoufa','zhaoran','chengwu'],['zhu','hiddenSkill']], jin_xiahouhui:['female','jin',3,['baoqie','jyishi','shiduo'],['hiddenSkill']], @@ -1484,25 +1484,51 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' var cards=get.cards(Math.min(5,player.maxHp)); - event.cards=cards; + game.cardsGotoOrdering(cards); var suit=get.suit(trigger.card); - player.chooseButton(['权变:获得一张不为'+get.translation(suit)+'花色的牌',cards]).set('suit',suit).set('filterButton',function(button){ - return get.suit(button)!=_status.event.suit; + var next=player.chooseToMove('权变:获得一张不为'+get.translation(suit)+'花色的牌并排列其他牌'); + next.set('suit',suit); + next.set('list',[ + ['牌堆顶',cards], + ['获得'], + ]) + next.set('filterMove',function(from,to,moved){ + var suit=_status.event.suit; + if(moved[0].contains(from.link)){ + if(typeof to=='number'){ + if(to==1){ + if(moved[1].length) return false; + return get.suit(from.link,false)!=suit; + } + return true; + } + if(moved[1].contains(to.link)) return get.suit(from.link,false)!=suit; + return true; + } + else{ + if(typeof to=='number') return true; + return get.suit(to.link,false)!=suit; + } + }); + next.set('processAI',function(list){ + var cards=list[0][1].slice(0).sort(function(a,b){ + return get.value(b)-get.value(a); + }),gains=[]; + for(var i of cards){ + if(get.suit(i,false)!=_status.event.suit){ + cards.remove(i); + gains.push(i); + break; + } + } + return [cards,gains]; }); 'step 1' if(result.bool){ - var card=result.links[0]; - cards.remove(card); - player.gain(card,'gain2','log'); - if(!cards.length) event.finish(); - } - 'step 2' - player.chooseCardButton(cards.length,true,cards,'按顺序将卡牌置于牌堆顶(先选择的在上)'); - 'step 3' - if(result.bool){ - var list=result.links.slice(0); - while(list.length){ - ui.cardPile.insertBefore(list.pop(),ui.cardPile.firstChild); + var list=result.moved; + if(list[1].length) player.gain(list[1],'gain2'); + while(list[0].length){ + ui.cardPile.insertBefore(list[0].pop(),ui.cardPile.firstChild); } game.updateRoundNumber(); } @@ -2379,21 +2405,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' trigger.changeToZero(); - event.cards=game.cardsGotoOrdering(get.cards(ui.cardPile.childElementCount%10)).cards; - var num=Math.ceil(event.cards.length/2); - var str='按顺序将卡牌置于牌堆底'; - if(event.cards.length>num) str='按顺序将'+get.cnNumber(num)+'张牌置于牌堆底,然后获得其余的牌'; - player.chooseButton([str,'
(先选择的在上)
',event.cards],true,num).set('ai',function(card){ - return -get.value(card); + var cards=game.cardsGotoOrdering(get.cards(ui.cardPile.childElementCount%10)).cards; + var num=Math.ceil(cards.length/2); + var next=player.chooseToMove('慧识:将'+get.cnNumber(num)+'张牌置于牌堆底并获得其余的牌',true); + next.set('list',[ + ['牌堆顶的展示牌',cards], + ['牌堆底'], + ]); + next.set('filterMove',function(from,to,moved){ + if(moved[0].contains(from)&&to==1) return moved[1].length<_status.event.num; + return true; + }); + next.set('filterOk',function(moved){ + return moved[1].length==_status.event.num; + }); + next.set('num',num); + next.set('processAI',function(list){ + var cards=list[0][1].slice(0).sort(function(a,b){ + return get.value(b)-get.useful(a); + }); + return [cards,cards.splice(cards.length-_status.event.num)]; }); 'step 1' - for(var i of result.links){ - cards.remove(i); - i.fix(); - ui.cardPile.appendChild(i); + if(result.bool){ + var list=result.moved; + if(list[0].length) player.gain(list[0],'gain2'); + while(list[1].length) ui.cardPile.appendChild(list[1].shift().fix()); } - game.updateRoundNumber(); - if(cards.length) player.gain(cards,'gain2','log'); }, }, qingleng:{ diff --git a/game/asset.js b/game/asset.js index ab6d9a66d..e6a6257ac 100644 --- a/game/asset.js +++ b/game/asset.js @@ -1,5 +1,5 @@ window.noname_asset_list=[ - 'v1.9.110.10.1', + 'v1.9.111', 'audio/background/aozhan_chaoming.mp3', 'audio/background/aozhan_online.mp3', 'audio/background/aozhan_rewrite.mp3', @@ -4639,6 +4639,13 @@ window.noname_asset_list=[ 'image/character/yangyan.jpg', 'image/character/yangzhi.jpg', 'image/character/zuofen.jpg', + 'image/character/re_kanze.jpg', + 'image/character/liuyong.jpg', + 'image/character/re_xunchen.jpg', + 'image/character/tongyuan.jpg', + 'image/character/tw_yujin.jpg', + 'image/character/wanniangongzhu.jpg', + 'image/character/zhangning.jpg', 'image/character/baiwuchang.jpg', 'image/character/baosanniang.jpg', diff --git a/game/game.js b/game/game.js index 97ff360a3..78a88c570 100644 --- a/game/game.js +++ b/game/game.js @@ -7398,7 +7398,7 @@ str+='\n-------------'; str+='\n'+line; str+='\n'+column; - if(err&&err.stack) str+='\n'+err.stack; + if(err&&err.stack) str+='\n'+decodeURI(err.stack); alert(str); window.ea=Array.from(arguments); window.em=msg; @@ -7408,7 +7408,7 @@ game.print(msg); game.print(line); game.print(column); - game.print(err.stack); + game.print(decodeURI(err.stack)); if(!lib.config.errstop){ _status.withError=true; game.loop(); @@ -10369,6 +10369,137 @@ emptyEvent:function(){ event.trigger(event.name); }, + chooseToMove:function(){ + 'step 0' + if(event.chooseTime&&_status.connectMode&&!game.online){ + event.time=lib.configOL.choose_timeout; + game.broadcastAll(function(time){ + lib.configOL.choose_timeout=time; + },event.chooseTime); + } + if(event.isMine()){ + var list=event.list,filterMove=event.filterMove,filterOk=event.filterOk; + _status.imchoosing=true; + var event=_status.event; + event.settleed=false; + event.dialog=ui.create.dialog(event.prompt||'请选择要操作的牌','hidden','forcebutton'); + event.switchToAuto=function(){ + if(!filterOk(event.moved)){ + if(!event.forced) event._result={bool:false}; + else event._result='ai'; + } + else{ + event._result={ + bool:true, + moved:event.moved, + }; + } + event.dialog.close(); + if(ui.confirm) ui.confirm.close(); + game.resume(); + _status.imchoosing=false; + }; + event.dialog.classList.add('scroll1'); + event.dialog.classList.add('scroll2'); + event.dialog.classList.add('fullwidth'); + + event.moved=[]; + var buttonss=[]; + event.buttonss=buttonss; + var updateButtons=function(){ + for(var i of buttonss){ + event.moved[i._link]=get.links(Array.from(i.childNodes)); + if(i.textPrompt) i.previousSibling.innerHTML=('
'+i.textPrompt(event.moved[i._link])+'
'); + } + if(filterOk(event.moved)){ + ui.create.confirm('o'); + } + else{ + if(!event.forced) ui.create.confirm('c'); + else if(ui.confirm) ui.confirm.close(); + } + }; + var clickButtons=function(){ + if(!ui.selected.guanxing_button) return; + if(ui.selected.guanxing_button.parentNode==this) return; + if(!filterMove(ui.selected.guanxing_button,this._link,event.moved)) return; + ui.selected.guanxing_button.classList.remove('glow2'); + this.appendChild(ui.selected.guanxing_button); + delete ui.selected.guanxing_button; + updateButtons(); + }; + + for(var i=0;i'+list[i][0]+''); + var buttons=ui.create.div('.buttons',event.dialog.content,clickButtons); + buttonss.push(buttons); + buttons.classList.add('popup'); + buttons.classList.add('guanxing'); + buttons._link=i; + if(list[i][1]){ + ui.create.buttons(list[i][1],'card',buttons); + } + if(list[i][2]) buttons.textPrompt=list[i][2]; + } + event.dialog.open(); + updateButtons(); + + event.custom.replace.button=function(button){ + if(!ui.selected.guanxing_button){ + ui.selected.guanxing_button=button; + button.classList.add('glow2'); + return; + } + if(ui.selected.guanxing_button==button){ + button.classList.remove('glow2'); + delete ui.selected.guanxing_button; + return; + } + if(!filterMove(button,ui.selected.guanxing_button,event.moved)) return; + var par1=ui.selected.guanxing_button.parentNode,ind1=ui.selected.guanxing_button.nextSibling,par2=button.parentNode,ind2=button.nextSibling; + ui.selected.guanxing_button.classList.remove('glow2'); + par1.insertBefore(button,ind1); + par2.insertBefore(ui.selected.guanxing_button,ind2); + delete ui.selected.guanxing_button; + updateButtons(); + } + event.custom.replace.confirm=function(bool){ + if(bool) event._result={ + bool:true, + moved:event.moved, + }; + else event._result={bool:false}; + event.dialog.close(); + if(ui.confirm) ui.confirm.close(); + game.resume(); + _status.imchoosing=false; + }; + + game.pause(); + game.countChoose(); + event.choosing=true; + } + else if(event.isOnline()){ + event.send(); + } + else{ + event.result='ai'; + } + "step 1" + if(event.time) game.broadcastAll(function(time){ + lib.configOL.choose_timeout=time; + },event.time); + var result=event.result||result; + if((!result||result=='ai'||(event.forced&&!result.bool))&&event.processAI){ + var moved=event.processAI(event.list); + if(moved) result={ + bool:true, + moved:moved, + } + else result={bool:false}; + } + event.result=result; + }, showCharacter:function(){ 'step 0' event.trigger('showCharacterEnd'); @@ -11287,7 +11418,7 @@ } event.filter2=function(info2){ var info=lib.skill[info2[0]]; - if(!lib.translate[info2[0]]||info.popup===false||info.silent) return false; + if(!lib.translate[info2[0]]||info.silent) return false; return true; } event.filter3=function(info,info2){ @@ -12433,9 +12564,9 @@ } game.pause(); if(range[1]>1&&typeof event.selectCard!='function'){ - event.promptdiscard=ui.create.control('提示',function(){ + event.promptdiscard=ui.create.control('AI代选',function(){ ai.basic.chooseCard(event.ai); - if(_status.event.custom.add.card){ + if(_status.event.custom&&_status.event.custom.add.card){ _status.event.custom.add.card(); } for(var i=0;i=8&&get.type(card)!='equip')?-10:0; - if(card.name=='du') addi+=5; + if(card.name=='du') addi-=5; if(player==event.player){ if(get.attitude(player,to)>0&&event.small){ return -getn(card)-get.value(card)/2+addi; @@ -18877,6 +18917,7 @@ } next.setContent('chooseToCompare'); } + next.forceDie=true; next._args=Array.from(arguments); return next; }, @@ -26398,7 +26439,7 @@ firstDo:true, trigger:{player:['playercontrol','chooseToUseBegin','chooseToRespondBegin','chooseToDiscardBegin','chooseToCompareBegin', 'chooseButtonBegin','chooseCardBegin','chooseTargetBegin','chooseCardTargetBegin','chooseControlBegin', - 'chooseBoolBegin','choosePlayerCardBegin','discardPlayerCardBegin','gainPlayerCardBegin']}, + 'chooseBoolBegin','choosePlayerCardBegin','discardPlayerCardBegin','gainPlayerCardBegin','chooseToMoveBegin']}, forced:true, priority:100, forceDie:true, @@ -47500,7 +47541,7 @@ game.resume2(); } else if((_status.event.isMine()||_status.event.forceMine)&&!dialogtouched){ - if(_status.event.custom.replace.window){ + if(_status.event.custom&&_status.event.custom.replace.window){ _status.event.custom.replace.window(); } else{ @@ -47609,7 +47650,7 @@ if(_status.justdragged) return; _status.clicked=true; var custom=_status.event.custom; - if(custom.replace.button){ + if(custom&&custom.replace.button){ custom.replace.button(this); return; } @@ -47658,7 +47699,7 @@ return; } var custom=_status.event.custom; - if(custom.replace.card){ + if(custom&&custom.replace.card){ custom.replace.card(this); return; } @@ -47837,7 +47878,7 @@ } _status.clicked=true; var custom=_status.event.custom; - if(custom.replace.target){ + if(custom&&custom.replace.target){ custom.replace.target(this,e); return; } @@ -48000,7 +48041,7 @@ }, ok:function(node){ var event=_status.event; - if(event.custom.replace.confirm){ + if(event.custom&&event.custom.replace.confirm){ event.custom.replace.confirm(true);return; } event.result={ @@ -48623,15 +48664,16 @@ } }, pause:function(){ - if(_status.paused2) return; - if(_status.nopause) return; + if(_status.paused2||_status.pausing||_status.nopause) return; if(!_status.video){ if(ui.pause.classList.contains('hidden')) return; if(!_status.gameStarted) return; } ui.system.hide(); game.pause2(); - var node=ui.create.pause().animate('start'); + var node=ui.create.pause(); + if(!node) return; + node.animate('start'); ui.sidebar3.innerHTML=''; if(lib.config.show_discardpile){ for(var i=0;i.card>.info>span, .button.card.button>.intro { top: 69px; } +.buttons.guanxing { + min-height: 110px; + width: 90%; +} .buttons.smallzoom { display: block; zoom: 0.65 @@ -1463,10 +1467,10 @@ div:not(.handcards)>.card>.info>span, margin-left: 0px; margin-right: 0px; } -.buttons.scrollbuttons .button:first-child{ +.buttons.scrollbuttons:not(.popup) .button:first-child{ margin-left: 12px; } -.buttons.scrollbuttons .button:last-child{ +.buttons.scrollbuttons:not(.popup) .button:last-child{ margin-right: 12px; } /*.buttons.smallzoom .card.button>.name, diff --git a/mode/guozhan.js b/mode/guozhan.js index 455b0e605..efdff9acd 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -269,7 +269,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ '3':[ 'gz_simayi','gz_luxun','gz_wuguotai', 'gz_caiwenji','gz_shibao','gz_xuyou', - 'gz_zhugeke', + 'gz_zhugeke','gz_re_nanhualaoxian','gz_zhouyi', ], '2':[ 'gz_re_lusu','gz_zhangzhang', @@ -298,7 +298,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ 'gz_lingtong','gz_sunshangxiang','gz_sunce', 'gz_re_yuanshao','gz_yuanshu','gz_hetaihou', 'gz_jin_simashi','gz_sp_duyu','gz_shibao', - 'gz_gongsunyuan','gz_panjun', + 'gz_gongsunyuan','gz_panjun','gz_re_nanhualaoxian', ], '6':[ 'gz_zhenji','gz_guojia','gz_yujin', @@ -306,7 +306,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ 'gz_zhouyu','gz_lingcao','gz_daqiao','gz_dingfeng', 'gz_yuji','gz_caiwenji','gz_diaochan','gz_zuoci', 'gz_key_ushio','gz_jin_simazhao','gz_dongzhao', - 'gz_liuba', + 'gz_liuba','gz_zhouyi','gz_re_xunchen', ], '5':[ 'gz_zhangliao','gz_caocao','gz_xuhuang', @@ -360,8 +360,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ guozhan_single:['gz_re_xushu','gz_yanbaihu','gz_wujing','gz_dongzhao','gz_huangzu','gz_zhugeke','gz_liuba','gz_zhuling'], guozhan_double:['gz_tangzi','gz_liuqi','gz_mengda','gz_mifangfushiren','gz_zhanglu','gz_shixie','gz_xuyou','gz_xiahouba','gz_panjun','gz_xf_sufei','gz_wenqin','gz_pengyang'], guozhan_yexinjia:['gz_zhonghui','gz_simazhao','gz_gongsunyuan','gz_sunchen'], - guozhan_zongheng:['gz_huaxin','gz_luyusheng','gz_zongyu','gz_miheng','gz_fengxi','gz_dengzhi'], - guozhan_others:["gz_lingcao","gz_lifeng","gz_beimihu","gz_jianggan","gz_key_ushio","gz_sp_duyu"], + guozhan_zongheng:['gz_huaxin','gz_luyusheng','gz_zongyu','gz_miheng','gz_fengxi','gz_dengzhi','gz_re_xunchen'], + guozhan_others:["gz_lingcao","gz_lifeng","gz_beimihu","gz_jianggan","gz_key_ushio","gz_sp_duyu","gz_re_nanhualaoxian","gz_zhouyi"], } }, characterPack:{ @@ -512,6 +512,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ gz_miheng:['male','qun',3,['gzrekuangcai','gzshejian'],['gzskin']], gz_fengxi:['male','wu',3,['yusui','boyan']], gz_dengzhi:['male','shu',3,['gzjianliang','gzweimeng'],['gzskin']], + gz_re_nanhualaoxian:['male','qun',4,['gzgongxiu','gzjinghe']], + gz_zhouyi:['female','wu',3,['gzzhukou','gzduannian','gzlianyou']], + gz_re_xunchen:['male','qun',3,['gzfenglve','gzanyong']], gz_cuimao:['male','wei',3,['gzzhengbi','gzfengying'],[]], gz_yujin:['male','wei',4,['gzjieyue'],['gzskin']], @@ -541,6 +544,358 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } }, skill:{ + //荀谌 + gzfenglve:{ + audio:'refenglve', + derivation:'gzfenglve_zongheng', + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.countCards('h')>0&&!player.hasSkillTag('noCompareSource')&&game.hasPlayer(function(current){ + return current!=player&¤t.countCards('h')>0&&!current.hasSkillTag('noCompareTarget'); + }); + }, + filterTarget:function(card,player,target){ + return target!=player&&target.countCards('h')>0&&!target.hasSkillTag('noCompareTarget'); + }, + content:function(){ + 'step 0' + player.chooseToCompare(target); + 'step 1' + if(result.bool){ + if(!target.countCards('hej')) event.goto(3); + else{ + event.giver=target; + event.gainner=player; + target.choosePlayerCard(target,true,'hej',2,'交给'+get.translation(player)+'两张牌'); + } + } + else if(result.tie){ + event.goto(3); + } + else{ + if(!player.countCards('he')) event.goto(3); + else{ + event.giver=player; + event.gainner=target; + player.chooseCard(true,'he','交给'+get.translation(target)+'一张牌'); + } + } + 'step 2' + if(result.bool) event.gainner.gain(result.cards,event.giver,'giveAuto'); + 'step 3' + if(target.isIn()) player.chooseBool('纵横:是否令'+get.translation(target)+'获得【锋略】?').set('ai',function(){ + var evt=_status.event.getParent(); + return get.attitude(evt.player,evt.target)>0; + }); + else event.finish(); + 'step 4' + if(result.bool){ + target.addTempSkill('gzfenglve_zongheng',{player:'phaseEnd'}); + game.log(player,'发起了','#y纵横',',令',target,'获得了技能','#g【锋略】'); + } + }, + ai:{ + order:8, + result:{ + target:function(player,target){ + if(!player.hasCard(function(card){ + if(get.position(card)!="h") return false; + var val=get.value(card); + if(val<0) return true; + if(val<=5){ + return card.number>=10; + } + if(val<=6){ + return card.number>=13; + } + return false; + })) return 0; + return -Math.sqrt(1+target.countCards('he'))/(1+target.countCards('j')); + }, + }, + }, + }, + gzfenglve_zongheng:{ + inherit:'gzfenglve', + content:function(){ + 'step 0' + player.chooseToCompare(target); + 'step 1' + if(result.bool){ + if(!target.countCards('hej')) event.finish(); + else{ + event.giver=target; + event.gainner=player; + target.choosePlayerCard(target,true,'hej','交给'+get.translation(player)+'一张牌'); + } + } + else if(result.tie){ + event.finish(); + } + else{ + if(!player.countCards('he')) event.finish(); + else{ + event.giver=player; + event.gainner=target; + player.chooseCard(true,'he',2,'交给'+get.translation(target)+'两张牌'); + } + } + 'step 2' + if(result.bool) event.gainner.gain(result.cards,event.giver,'giveAuto'); + }, + ai:{ + order:8, + result:{ + target:function(player,target){ + if(!player.hasCard(function(card){ + if(get.position(card)!="h") return false; + var val=get.value(card); + if(val<0) return true; + if(val<=5){ + return card.number>=12; + } + if(val<=6){ + return card.number>=13; + } + return false; + })) return 0; + return -Math.sqrt(1+target.countCards('he'))/(1+target.countCards('j')); + }, + }, + }, + }, + gzanyong:{ + audio:'anyong', + trigger:{global:'damageBegin1'}, + usable:1, + filter:function(event,player){ + return event.source&&event.player!=event.source&& + event.source.isFriendOf(player)&&event.player.isIn(); + }, + check:function(event,player){ + if(event.player.hasSkillTag('filterDamage',null,{ + player:event.source, + card:event.card, + })) return false; + if(event.player.isUnseen()) return true; + if(event.player.hp>event.num&&event.player.hp<=event.num*2) return player.hp>1||trigger.player.isUnseen(2); + return false; + }, + logTarget:'player', + preHidden:true, + content:function(){ + trigger.num*=2; + if(!trigger.player.isUnseen(2)){ + player.loseHp(); + player.removeSkill('gzanyong'); + } + else if(!trigger.player.isUnseen()){ + player.chooseToDiscard('h',2,true); + } + }, + }, + //周夷 + gzzhukou:{ + audio:'zhukou', + trigger:{source:'damageSource'}, + preHidden:true, + filter:function(event,player){ + if(!player.getHistory('useCard').length) return false; + var evt=event.getParent('phaseUse'); + if(!evt||!evt.player) return false; + return player.getHistory('sourceDamage',function(evtx){ + return evtx.getParent('phaseUse')==evt; + }).indexOf(event)==0; + }, + frequent:true, + content:function(){ + player.draw(player.getHistory('useCard').length); + }, + }, + gzduannian:{ + audio:2, + trigger:{player:'phaseUseEnd'}, + preHidden:true, + filter:function(event,player){ + return player.countCards('h')>0&&!player.hasCard(function(card){ + return !lib.filter.cardDiscardable(card,player,'gzduannian'); + },'h'); + }, + check:function(card){ + return player.countCards('h',function(card){ + return get.value(card)>=6; + })<=Math.max(1,player.countCards('h')/2); + }, + content:function(){ + var cards=player.getCards('h',function(card){ + return lib.filter.cardDiscardable(card,player,'gzduannian'); + }); + if(cards.length){ + player.discard(cards); + player.draw(cards.length); + } + }, + }, + gzlianyou:{ + trigger:{player:'die'}, + direct:true, + forceDie:true, + content:function(){ + 'step 0' + player.chooseTarget(lib.filter.notMe,get.prompt('gzlianyou'),'令一名其他角色获得〖兴火〗').set('forceDie',true).set('ai',function(target){ + return 10+(get.attitude(_status.event.player,target)*target.hasSkillTag('fireAttack',null,null,true)?2:1) + }); + 'step 1' + if(result.bool){ + var target=result.targets[0]; + player.logSkill('gzlianyou',target); + target.addSkillLog('gzxinghuo'); + game.delayx(); + } + }, + derivation:'gzxinghuo', + }, + gzxinghuo:{ + trigger:{player:'damageBegin1'}, + forced:true, + filter:function(event){ + return event.nature=='fire'; + }, + content:function(){ + trigger.num++; + }, + }, + //南华老仙 + gzgongxiu:{ + trigger:{player:'phaseDrawBegin2'}, + preHidden:true, + filter:function(event,player){ + return !event.numFixed&&event.num>0&&player.maxHp>0; + }, + content:function(){ + trigger.num--; + player.addTempSkill('gzgongxiu2','phaseUseAfter'); + }, + }, + gzgongxiu2:{ + trigger:{player:'phaseDrawEnd'}, + forced:true, + charlotte:true, + popup:false, + content:function(){ + 'step 0' + var str='令至多'+get.cnNumber(player.maxHp)+'名角色'; + if(typeof player.storage.gzgongxiu!='number'){ + player.chooseControl().set('choiceList',[ + str+'各摸一张牌', + str+'各弃置一张牌', + ]); + } + else event._result={index:1-player.storage.gzgongxiu}; + 'step 1' + var num=result.index; + event.index=num; + player.storage.gzgongxiu=num; + player.chooseTarget(true,[1,player.maxHp],'选择至多'+get.cnNumber(player.maxHp)+'名角色各'+(num?'弃置':'摸')+'一张牌').set('goon',event.index?-1:1).set('ai',function(target){ + var evt=_status.event; + return evt.goon*get.attitude(evt.player,target); + }); + 'step 2' + if(result.bool){ + var targets=result.targets.sortBySeat(); + player.line(targets,'green'); + if(event.index==0) game.asyncDraw(targets); + else{ + for(var i of targets) i.chooseToDiscard('he',true); + event.finish(); + } + } + 'step 3' + game.delayx(); + }, + }, + gzjinghe:{ + enable:'phaseUse', + filter:function(event,player){ + return player.maxHp>0&&player.countCards('h')>0&&!player.hasSkill('gzjinghe_clear'); + }, + selectCard:function(){ + var max=_status.event.player.maxHp; + if(ui.selected.targets.length) return [ui.selected.targets.length,max]; + return [1,max]; + }, + selectTarget:function(){ + return ui.selected.cards.length; + }, + filterTarget:function(card,player,target){ + return !target.isUnseen(); + }, + filterCard:function(card){ + if(ui.selected.cards.length){ + var name=get.name(card); + for(var i of ui.selected.cards){ + if(get.name(i)==name) return false; + } + } + return true; + }, + position:'h', + check:function(card){ + var player=_status.event.player; + if(game.countPlayer(function(current){ + return get.attitude(player,current)>0&&!current.isUnseen(); + })>ui.selected.cards.length) return get.position(card)=='e'?2:1; + return 0; + }, + complexCard:true, + discard:false, + lose:false, + delay:false, + multitarget:true, + multiline:true, + content:function(){ + 'step 0' + player.showCards(cards,get.translation(player)+'发动了【经合】'); + event.skills=lib.skill.gzjinghe.derivation.randomGets(targets.length); + player.addTempSkill('gzjinghe_clear',{player:'phaseBegin'}); + event.targets.sortBySeat(); + event.num=0; + 'step 1' + event.target=targets[num]; + event.num++; + event.target.chooseControl(event.skills,'cancel2').set('choiceList',event.skills.map(function(i){ + return '
【'+get.translation(lib.translate[i+'_ab']||get.translation(i).slice(0,2))+'】
'+get.skillInfoTranslation(i,player)+'
'; + })).set('displayIndex',false).set('prompt','选择获得一个技能'); + 'step 2' + var skill=result.control; + if(skill!='cancel2'){ + event.skills.remove(skill); + target.addAdditionalSkill('gzjinghe_'+player.playerid,skill); + target.popup(skill); + game.log(target,'获得了技能','#g【'+get.translation(skill)+'】'); + } + if(event.numevent.num; - // }, audio:2, filter:function(event,player){ return get.population('qun')>0; @@ -8239,12 +8585,20 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(player.hasSkill('huangjintianbingfu')){ num+=player.storage.huangjintianbingfu.length; } - player.chooseCardButton(num,true,get.cards(num),'按顺序将卡牌置于牌堆顶(先选择的在上)').set('ai',function(button){ - return get.value(button.link); - }); + var cards=get.cards(num); + game.cardsGotoOrdering(cards); + var next=player.chooseToMove('悟心:将卡牌以任意顺序置于牌堆顶'); + next.set('list',[['牌堆顶',cards]]); + next.set('processAI',function(list){ + var cards=list[0][1].slice(0); + cards.sort(function(a,b){ + return get.value(b)-get.value(a); + }); + return [cards]; + }) 'step 1' if(result.bool){ - var list=result.links.slice(0); + var list=result.moved[0].slice(0); while(list.length){ ui.cardPile.insertBefore(list.pop(),ui.cardPile.firstChild); } @@ -10699,6 +11053,25 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ liuba:'刘巴', pengyang:'彭羕', sunchen:'孙綝', + gz_dengzhi:'邓芝', + gzfenglve:'锋略', + gzfenglve_info:'出牌阶段限一次,你可以和一名其他角色进行拼点。若你赢,其将区域内的两张牌交给你;若你输,你交给其一张牌。', + gzfenglve_zongheng:'锋略·纵横', + gzfenglve_zongheng_info:'出牌阶段限一次,你可以和一名其他角色进行拼点。若你赢,其将区域内的一张牌交给你;若你输,你交给其两张牌。', + gzanyong:'暗涌', + gzanyong_info:'每回合限一次。当己方角色对其他角色造成伤害时,你可令伤害值翻倍。然后若受伤角色:武将牌均明置,则你失去1点体力并失去〖暗涌〗;有一张明置的武将牌,则你弃置两张手牌。', + gzzhukou:'逐寇', + gzzhukou_info:'当你于一名角色的出牌阶段第一次造成伤害后,你可以摸X张牌(X为本回合你已使用的牌数且至多为5)。', + gzduannian:'断念', + gzduannian_info:'出牌阶段结束时,若你有手牌你可以弃置所有手牌,然后将手牌摸至体力上限。', + gzlianyou:'莲佑', + gzlianyou_info:'你死亡时,可以选择一名其他角色。该角色获得技能“兴火”。', + gzxinghuo:'兴火', + gzxinghuo_info:'锁定技,你造成的火焰伤害+1。', + gzgongxiu:'共修', + gzgongxiu_info:'摸牌阶段,你可以少摸一张牌,然后选择一个与上次不同的选项:①令至多X名角色各摸一张牌。②令至多X名角色各弃置一张牌。(X为你的体力上限)', + gzjinghe:'经合', + gzjinghe_info:'出牌阶段限一次,你可以展示至多X张牌名各不相同的手牌(X为你的体力上限),并选择等量有明置武将牌的角色。然后每名角色可以从“写满技能的天书”中选择并获得一个技能直到你的下回合开始。', gzshilu:'嗜戮', gzshilu_info:'①一名角色死亡时,你可以将其所有武将牌置于你的武将牌上,称为“戮”,若杀死其的角色是你,则你从剩余的武将牌堆随机额外获得两张“戮”。②准备阶段,你可以弃置至多X张牌,然后摸等量的牌(X为“戮”数)。', gzxiongnve:'凶虐',