From db27b14f0530f7e4428de60d1607539f974056fc Mon Sep 17 00:00:00 2001 From: libccy Date: Mon, 4 Apr 2016 20:52:33 +0800 Subject: [PATCH] wuxie --- card/refresh.js | 1 - card/standard.js | 186 ++++++++++++++--------------------------------- game/update.js | 1 + 3 files changed, 57 insertions(+), 131 deletions(-) diff --git a/card/refresh.js b/card/refresh.js index 919c43425..aa2422f7c 100755 --- a/card/refresh.js +++ b/card/refresh.js @@ -87,7 +87,6 @@ card.refresh={ return !target.isMin()&&player!=target&&!target.get('e','5'); }); next.set('ai',function(target){ - console.log(_status.event.choice); return target==_status.event.choice?1:-1; }); next.set('choice',choice); diff --git a/card/standard.js b/card/standard.js index f5927bf37..1896abafa 100755 --- a/card/standard.js +++ b/card/standard.js @@ -1379,31 +1379,8 @@ card.standard={ event.source=trigger.player; event.state=true; event.card=trigger.card; - event.blacklist=[]; event._global_waiting=true; - 'step 1' - var list=[],list2=[]; - for(var i=0;i0?'生效':'失效')+',是否无懈?'; - var next=game.me.chooseToUse({ + var next=player.chooseToUse({ filterCard:function(card,player){ if(card.name!='wuxie') return false; var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.get('s')); @@ -1471,49 +1448,51 @@ card.standard={ next.nouse=true; } }; - var aix=function(player){ - var source=event.source; - var card=event.card; - var state=event.state?1:-1; - var target=event.target; - var targets=event.targets; - if(event.triggername=='phaseJudge'){ - var info=lib.card[card.viewAs||card.name]; - if(info&&info.ai&&info.ai.wuxie){ - var aiii=info.ai.wuxie(source,card,source,player,state); - if(typeof aiii=='number') return aiii; - } - if(Math.abs(ai.get.attitude(player,source))<3) return 0; - if(source.skills.contains('guanxing')) return 0; - if(card.name!='lebu'&&card.name!='bingliang'){ - if(source!=player){ - return 0; - } - } - var eff=ai.get.effect(source,card,source,source); - if(eff>=0) return 0; - return state*ai.get.attitude(player,source); + 'step 1' + var list=[]; + event.list=list; + event.id=get.id(); + for(var i=0;i0){ - list2.push(list[i]); + event.send(list[i],event.state,event.triggername=='phaseJudge',event.card,event.source,event.target,event.targets,event.id); + list.splice(i--,1); } } if(!withme){ - if(!withol){ - event.aionly=true; - } - event.goto(3); + event.goto(6); } if(_status.connectMode){ if(withme||withol){ @@ -1564,83 +1540,34 @@ card.standard={ } } event.withol=withol; - if(list2.length){ - event.aichoice=list2.randomGet(); - event.wuxietimeout=setTimeout(function(){ - if(!event.wuxieresult){ - event.wuxieresult=event.aichoice; - event.wuxieresult2='ai'; - game.broadcast('cancel',event.id); - if(_status.event.id==event.id&&_status.event.name=='chooseToUse'&&_status.paused){ - ui.click.cancel(); - if(ui.confirm) ui.confirm.close(); - } - if(event.aionly){ - game.resume(); - } - } - },event.aionly?200:(Math.random()*5000+3000)); - } - else{ - event.aionly=false; - } - 'step 2' + 'step 5' if(result&&result.bool&&!event.wuxieresult){ - clearTimeout(event.wuxietimeout); game.broadcast('cancel',event.id); event.wuxieresult=game.me; event.wuxieresult2=result; } - 'step 3' + 'step 6' if(event.withol&&!event.resultOL){ game.pause(); } - else if(event.aionly){ - game.pause(); - } - 'step 4' - clearTimeout(event.wuxietimeout); + 'step 7' for(var i=0;i