This commit is contained in:
libccy 2017-02-12 09:47:39 +08:00
parent 7071a3883f
commit 3793cf2305
1 changed files with 16 additions and 18 deletions

View File

@ -1616,15 +1616,9 @@ mode.chess={
next.player=player; next.player=player;
next.setContent(function(){ next.setContent(function(){
"step 0" "step 0"
var passed=false; if(!game.hasPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.side==player.side&&!current.classList.contains('acted');
if(!game.players[i].classList.contains('acted')){ })){
if(game.players[i].side==player.side){
passed=true;break;
}
}
}
if(!passed){
var num1=0; var num1=0;
var next=null; var next=null;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
@ -1654,9 +1648,11 @@ mode.chess={
nevt.ai=function(target){ nevt.ai=function(target){
return Math.max(1,10-target.num('h')); return Math.max(1,10-target.num('h'));
}; };
nevt.includeOut=true;
nevt.chessForceAll=true; nevt.chessForceAll=true;
} }
else{ else{
game.delay();
event.goto(2); event.goto(2);
} }
} }
@ -1668,7 +1664,6 @@ mode.chess={
game.asyncDraw(result.targets); game.asyncDraw(result.targets);
} }
"step 2" "step 2"
var players=[];
if(player.side==game.me.side){ if(player.side==game.me.side){
player=game.me; player=game.me;
} }
@ -1679,18 +1674,15 @@ mode.chess={
} }
} }
} }
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer(function(current){
if(game.players[i].side==player.side){ return player.side==current.side&&!current.classList.contains('acted');
if(!game.players[i].classList.contains('acted')){ });
players.push(game.players[i]);
}
}
}
if(players.length>1){ if(players.length>1){
var nevt=player.chooseTarget('选择下一个行动的角色',function(card,player,target){ var nevt=player.chooseTarget('选择下一个行动的角色',function(card,player,target){
return target.side==player.side&&!target.classList.contains('acted'); return target.side==player.side&&!target.classList.contains('acted');
},true); },true);
nevt.chessForceAll=true; nevt.chessForceAll=true;
nevt.includeOut=true;
nevt.ai=function(target){ nevt.ai=function(target){
var nj=target.num('j'); var nj=target.num('j');
if(nj){ if(nj){
@ -1699,9 +1691,15 @@ mode.chess={
return Math.max(0,10-target.hp); return Math.max(0,10-target.hp);
} }
} }
else{ else if(players.length){
event.decided=players[0]; event.decided=players[0];
} }
else{
event.player=game.findPlayer(function(current){
return current.side!=player.side;
});
event.goto(0);
}
"step 3" "step 3"
if(event.decided){ if(event.decided){
event.decided.phase(); event.decided.phase();