diff --git a/game/game.js b/game/game.js index 46748b396..b38ef37fb 100644 --- a/game/game.js +++ b/game/game.js @@ -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