This commit is contained in:
parent
fda4d2d6ab
commit
7071a3883f
58
game/game.js
58
game/game.js
|
@ -11828,19 +11828,35 @@
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
out:function(skill){
|
out:function(skill){
|
||||||
if(!this.storage.out){
|
if(typeof skill=='number'){
|
||||||
this.storage.out=[];
|
this.outCount++;
|
||||||
|
}
|
||||||
|
else if(typeof skill=='string'){
|
||||||
|
this.outSkill=skill;
|
||||||
}
|
}
|
||||||
this.storage.out.add(skill);
|
|
||||||
if(!this.classList.contains('out')){
|
if(!this.classList.contains('out')){
|
||||||
this.classList.add('out');
|
this.classList.add('out');
|
||||||
game.log(this,'离开游戏');
|
game.log(this,'离开游戏');
|
||||||
}
|
}
|
||||||
|
if(!game.countPlayer()){
|
||||||
|
game.over();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
in:function(skill){
|
in:function(skill){
|
||||||
if(this.isOut()){
|
if(this.isOut()){
|
||||||
this.storage.out.remove(skill);
|
if(typeof skill=='string'){
|
||||||
if(this.storage.out.length==0){
|
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');
|
this.classList.remove('out');
|
||||||
game.log(this,'进入游戏');
|
game.log(this,'进入游戏');
|
||||||
}
|
}
|
||||||
|
@ -15930,10 +15946,10 @@
|
||||||
forced:true,
|
forced:true,
|
||||||
priority:20,
|
priority:20,
|
||||||
popup:false,
|
popup:false,
|
||||||
// filter:function(event,player){
|
|
||||||
// return player.isTurnedOver();
|
|
||||||
// },
|
|
||||||
content:function(){
|
content:function(){
|
||||||
|
for(var i=0;i<game.players.length;i++){
|
||||||
|
game.players[i].in();
|
||||||
|
}
|
||||||
if(player.isTurnedOver()){
|
if(player.isTurnedOver()){
|
||||||
trigger.untrigger();
|
trigger.untrigger();
|
||||||
trigger.finish();
|
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:{
|
_phasebegin:{
|
||||||
trigger:{player:'phaseBegin'},
|
trigger:{player:'phaseBegin'},
|
||||||
forced:true,
|
forced:true,
|
||||||
|
@ -20541,7 +20534,7 @@
|
||||||
else if(player&&player.removed&&event.name!='phaseLoop'){
|
else if(player&&player.removed&&event.name!='phaseLoop'){
|
||||||
event.finish();
|
event.finish();
|
||||||
}
|
}
|
||||||
else if(player&&player.isOut()&&event.name!='phaseLoop'){
|
else if(player&&player.isOut()&&event.name!='phaseLoop'&&!event.includeOut){
|
||||||
event.finish();
|
event.finish();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -30115,6 +30108,7 @@
|
||||||
node.marks={};
|
node.marks={};
|
||||||
node.ai={friend:[],enemy:[],neutral:[],handcards:{global:[],source:[],viewed:[]}};
|
node.ai={friend:[],enemy:[],neutral:[],handcards:{global:[],source:[],viewed:[]}};
|
||||||
node.queueCount=0;
|
node.queueCount=0;
|
||||||
|
node.outCount=0;
|
||||||
|
|
||||||
for(var i in lib.element.player){
|
for(var i in lib.element.player){
|
||||||
node[i]=lib.element.player[i];
|
node[i]=lib.element.player[i];
|
||||||
|
|
|
@ -2255,6 +2255,7 @@ mode.versus={
|
||||||
var target=event.swap(player);
|
var target=event.swap(player);
|
||||||
var swap=[],swap2=[];
|
var swap=[],swap2=[];
|
||||||
for(var i=0;i<game.players.length;i++){
|
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].classList.contains('acted')){
|
||||||
if(game.players[i].side==target.side){
|
if(game.players[i].side==target.side){
|
||||||
swap.push(game.players[i]);
|
swap.push(game.players[i]);
|
||||||
|
@ -2271,11 +2272,12 @@ mode.versus={
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
for(var i=0;i<game.players.length;i++){
|
for(var i=0;i<game.players.length;i++){
|
||||||
|
if(game.players[i].isOut()) continue;
|
||||||
game.players[i].classList.remove('acted');
|
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){
|
if(swap.length==1){
|
||||||
|
@ -2283,9 +2285,12 @@ mode.versus={
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var rand=Math.random();
|
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');
|
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;
|
var num=0;
|
||||||
if(target2.num('j')){
|
if(target2.num('j')){
|
||||||
num-=5;
|
num-=5;
|
||||||
|
@ -2339,7 +2344,7 @@ mode.versus={
|
||||||
}
|
}
|
||||||
var list=(_status.currentSide==game.me.side)?game.friend.slice(0):game.enemy.slice(0);
|
var list=(_status.currentSide==game.me.side)?game.friend.slice(0):game.enemy.slice(0);
|
||||||
for(var i=0;i<list.length;i++){
|
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--;
|
list.splice(i,1);i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2355,7 +2360,7 @@ mode.versus={
|
||||||
else{
|
else{
|
||||||
game.me.chooseTarget('选择要行动的角色',true,function(card,player,target){
|
game.me.chooseTarget('选择要行动的角色',true,function(card,player,target){
|
||||||
return (target.classList.contains('acted')==false&&target.side==game.me.side);
|
return (target.classList.contains('acted')==false&&target.side==game.me.side);
|
||||||
})
|
}).includeOut=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
Loading…
Reference in New Issue