This commit is contained in:
libccy 2017-02-12 09:27:03 +08:00
parent fda4d2d6ab
commit 7071a3883f
2 changed files with 38 additions and 39 deletions

View File

@ -11828,19 +11828,35 @@
return next;
},
out:function(skill){
if(!this.storage.out){
this.storage.out=[];
if(typeof skill=='number'){
this.outCount++;
}
else if(typeof skill=='string'){
this.outSkill=skill;
}
this.storage.out.add(skill);
if(!this.classList.contains('out')){
this.classList.add('out');
game.log(this,'离开游戏');
}
if(!game.countPlayer()){
game.over();
}
},
in:function(skill){
if(this.isOut()){
this.storage.out.remove(skill);
if(this.storage.out.length==0){
if(typeof skill=='string'){
if(this.outSkill==skill){
delete this.outSkill;
}
}
else{
if(typeof skill!='number'){
skill=1;
}
this.outCount-=skill;
}
if(this.outCount<=0&&!this.outSkill){
this.outCount=0;
this.classList.remove('out');
game.log(this,'进入游戏');
}
@ -15930,10 +15946,10 @@
forced:true,
priority:20,
popup:false,
// filter:function(event,player){
// return player.isTurnedOver();
// },
content:function(){
for(var i=0;i<game.players.length;i++){
game.players[i].in();
}
if(player.isTurnedOver()){
trigger.untrigger();
trigger.finish();
@ -15945,29 +15961,6 @@
}
},
},
_out:{
trigger:{target:'useCardToBefore',player:['damageBefore','phaseBefore']},
forced:true,
popup:false,
priority:20,
filter:function(event,player){
return player.isOut();
},
content:function(){
trigger.untrigger();
trigger.finish();
},
ai:{
effect:{
target:function(card,player,target){
if(target.isOut()) return 0;
}
},
threaten:function(player,target){
if(target.isOut()) return 0;
}
}
},
_phasebegin:{
trigger:{player:'phaseBegin'},
forced:true,
@ -20541,7 +20534,7 @@
else if(player&&player.removed&&event.name!='phaseLoop'){
event.finish();
}
else if(player&&player.isOut()&&event.name!='phaseLoop'){
else if(player&&player.isOut()&&event.name!='phaseLoop'&&!event.includeOut){
event.finish();
}
else{
@ -30115,6 +30108,7 @@
node.marks={};
node.ai={friend:[],enemy:[],neutral:[],handcards:{global:[],source:[],viewed:[]}};
node.queueCount=0;
node.outCount=0;
for(var i in lib.element.player){
node[i]=lib.element.player[i];

View File

@ -2255,6 +2255,7 @@ mode.versus={
var target=event.swap(player);
var swap=[],swap2=[];
for(var i=0;i<game.players.length;i++){
if(game.players[i].isOut()) continue;
if(!game.players[i].classList.contains('acted')){
if(game.players[i].side==target.side){
swap.push(game.players[i]);
@ -2271,11 +2272,12 @@ mode.versus={
}
else{
for(var i=0;i<game.players.length;i++){
if(game.players[i].isOut()) continue;
game.players[i].classList.remove('acted');
if(game.players[i].side==target.side){
swap.push(game.players[i]);
}
}
event.redo();
game.delay();
return;
}
}
if(swap.length==1){
@ -2283,9 +2285,12 @@ mode.versus={
}
else{
var rand=Math.random();
target.chooseTarget('选择行动的角色',true,function(card,player,target2){
var next=target.chooseTarget('选择行动的角色',true,function(card,player,target2){
return target2.side==target.side&&!target2.classList.contains('acted');
}).ai=function(target2){
});
next._triggered=null;
next.includeOut=true;
next.ai=function(target2){
var num=0;
if(target2.num('j')){
num-=5;
@ -2339,7 +2344,7 @@ mode.versus={
}
var list=(_status.currentSide==game.me.side)?game.friend.slice(0):game.enemy.slice(0);
for(var i=0;i<list.length;i++){
if(list[i].classList.contains('acted')){
if(list[i].classList.contains('acted')||list[i].isOut()){
list.splice(i,1);i--;
}
}
@ -2355,7 +2360,7 @@ mode.versus={
else{
game.me.chooseTarget('选择要行动的角色',true,function(card,player,target){
return (target.classList.contains('acted')==false&&target.side==game.me.side);
})
}).includeOut=true;
}
}
else{