This commit is contained in:
libccy 2016-08-09 00:49:54 +08:00
parent 39d148567c
commit 137c375d13
1 changed files with 49 additions and 22 deletions

View File

@ -5169,6 +5169,21 @@
if(!game.online) player.discard(event.result.cards);
if(event.dialog&&event.dialog.close) event.dialog.close();
},
chooseToCompareMultiple:function(){
if(player.num('h')==0){
event.result={cancelled:true,bool:false}
event.finish();
return;
}
for(var i=0;i<targets.length;i++){
if(targets[i].num('h')==0){
event.result={cancelled:true,bool:false}
event.finish();
return;
}
}
game.log(player,'对',target,'发起拼点');
},
chooseToCompare:function(){
"step 0"
if(player.num('h')==0||target.num('h')==0){
@ -8349,6 +8364,17 @@
chooseToCompare:function(target,check){
var next=game.createEvent('chooseToCompare');
next.player=this;
if(Array.isArray(target)){
next.targets=target;
if(check) next.ai=check;
else next.ai=function(card){
var addi=(ai.get.value(card)>=8&&get.type(card)!='equip')?-10:0;
if(card.name=='du') addi+=5;
return get.number(card)-ai.get.value(card)/2+addi;
}
next.content=lib.element.playerproto.chooseToCompareMultiple;
}
else{
next.target=target;
if(check) next.ai=check;
else next.ai=function(card){
@ -8371,6 +8397,7 @@
}
}
next.content=lib.element.playerproto.chooseToCompare;
}
next._args=Array.from(arguments);
return next;
},