From a1dfa520b0293fd644d555b6e5765f3f210f0753 Mon Sep 17 00:00:00 2001 From: libccy Date: Wed, 29 Mar 2017 13:29:34 +0800 Subject: [PATCH] 19 --- character/refresh.js | 16 ++++++++++++++-- game/game.js | 7 +++++-- mode/versus.js | 20 +++++++++++++++++--- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/character/refresh.js b/character/refresh.js index e4dc8c68f..239c4d136 100644 --- a/character/refresh.js +++ b/character/refresh.js @@ -643,9 +643,21 @@ character.refresh={ ai:{ effect:function(card,player,target){ if(!target.hasFriend()) return; - if(get.type(card,'trick')=='trick'&&ui.selected.targets.length==0) return [1,1]; + var type=get.type(card); + var nh=target.countCards(); + if(type=='trick'){ + if(!get.tag(card,'multitarget')||get.info(card).singleCard){ + if(get.tag(card,'damage')){ + if(nh<3||target.hp<=2) return 0.8; + } + return [1,nh]; + } + } + else if(type=='delay'){ + return [0.5,0.5]; + } }, - }, + } }, reqianxun2:{ trigger:{global:'phaseAfter'}, diff --git a/game/game.js b/game/game.js index de88c61f9..d9ae638c2 100644 --- a/game/game.js +++ b/game/game.js @@ -4363,7 +4363,7 @@ restart:true, }, four_phaseswap:{ - name:'代替队友回合内行动', + name:'代替队友行动', init:false, // frequent:true, restart:true, @@ -18465,12 +18465,15 @@ priority:100, popup:false, filter:function(event,player){ - if(_status.currentPhase!=player) return false; if(player==game.me) return false; if(event.autochoose&&event.autochoose()) return false; if(lib.filter.wuxieSwap(event)) return false; if(_status.auto) return false; if(!player.isFriendOf(game.me)) return false; + if(_status.autophasefilter&&_status.autophasefilter(event,player)){ + return true; + } + if(_status.currentPhase!=player) return false; return true; }, content:function(){ diff --git a/mode/versus.js b/mode/versus.js index 054df4243..4cbe7096c 100644 --- a/mode/versus.js +++ b/mode/versus.js @@ -1002,9 +1002,6 @@ mode.versus={ event.list.randomSort(); event.list2=list2; event.four_assign=get.config('four_assign'); - if(get.config('four_phaseswap')){ - game.addGlobalSkill('autophase'); - } if(!event.four_assign){ event.current=_status.firstAct; } @@ -1048,6 +1045,23 @@ mode.versus={ _status.ladder=true; _status.ladder_mmr=0; } + if(get.config('four_phaseswap')){ + game.addGlobalSkill('autophase'); + if(lib.config.show_handcardbutton){ + ui.versushs=ui.create.system('手牌',null,true); + lib.setPopped(ui.versushs,game.versusHoverHandcards,220); + } + ui.autophase=ui.create.system('自动切换',function(){ + this.classList.toggle('glow'); + game.save('autophase_four',!this.classList.contains('glow')); + },true); + if(!lib.storage.autophase_four){ + ui.autophase.classList.add('glow'); + } + _status.autophasefilter=function(){ + return ui.autophase.classList.contains('glow'); + } + } "step 1" if(event.current==game.me||(event.four_assign&&event.current.side==game.me.side)){ var dialog=event.xdialog;