diff --git a/character/diy.js b/character/diy.js index 07f8f5005..611a41058 100644 --- a/character/diy.js +++ b/character/diy.js @@ -176,7 +176,7 @@ character.diy={ }, content:function(){ // if(player!=target) player.draw(); - var list=game.players.slice(0); + var list=game.filterPlayer(); get.sortSeat(list,target); target.useCard({name:'diaobingqianjiang'},list); }, @@ -185,12 +185,9 @@ character.diy={ result:{ player:function(player,target){ if(ai.get.attitude(player,target)<=1) return 0; - var num=0; - for(var i=0;i0){ - if(game.players[i].hp<2){ - lose--; - recover+=0.5; - } + var recover=0,lose=0,players=game.filterPlayer; + for(var i=0;i0){ + if(players[i].hp<2){ lose--; - recover++; - } - else if(ai.get.attitude(player,game.players[i])<0){ - if(game.players[i].hp<2){ - lose++; - recover-=0.5; - } - lose++; - recover--; + recover+=0.5; } + lose--; + recover++; } - else{ - if(ai.get.attitude(player,game.players[i])>0){ - lose--; - } - else if(ai.get.attitude(player,game.players[i])<0){ + else if(ai.get.attitude(player,players[i])<0){ + if(players[i].hp<2){ lose++; + recover-=0.5; } + lose++; + recover--; + } + } + else{ + if(ai.get.attitude(player,players[i])>0){ + lose--; + } + else if(ai.get.attitude(player,players[i])<0){ + lose++; } } } @@ -177,14 +175,11 @@ character.extra={ order:10, result:{ player:function(player){ - var num=0; - for(var i=0;i0?1:-1; + return game.countPlayer(function(current){ + if(current!=player){ + return get.sgn(ai.get.damageEffect(current,player,player)); } - } - return num; + }); } } } @@ -206,12 +201,11 @@ character.extra={ if(!player.storage.shenfen) return 0; var cards=player.get('h','sha'); if(cards.length){ - for(var i=0;i0&& - game.players[i].num('h','shan')){ - return 1; - } + if(game.hasPlayer(function(current){ + return (player.canUse('sha',current)&& + ai.get.effect(current,cards[0],player,player)>0&¤t.hasShan()); + })){ + return 1; } } return 0; @@ -522,19 +516,15 @@ character.extra={ trigger:{player:'damageEnd'}, check:function(event,player){ if(player.isTurnedOver()) return true; - var num=0; - for(var i=0;i0){ - num++; + if(current.num('j')&¤t!=player&&ai.get.attitude(player,current)>0){ + return true; } - if(num>=2) return true; - } - return false; + }); + return num>=2; }, content:function(){ "step 0" @@ -572,21 +562,18 @@ character.extra={ target:function(card,player,target){ if(get.tag(card,'damage')){ if(player.hasSkill('jueqing')) return [1,-2]; - if(target.hp==1) return; + if(target.hp==1) return 0.8; if(target.isTurnedOver()) return [0,3]; - var num=0; - for(var i=0;i0){ - num++; + if(current.num('j')&¤t!=player&&ai.get.attitude(player,current)>0){ + return true; } - if(num>2) return [0,1]; - if(num==2) return [0.5,1]; - } + }); + if(num>2) return [0,1]; + if(num==2) return [0.5,1]; } } } @@ -696,7 +683,7 @@ character.extra={ content:function(){ "step 0" player.chooseTarget('选择角色获得大雾标记', - [1,Math.min(game.players.length,player.storage.qixing.length)]).ai=function(target){ + [1,Math.min(game.countPlayer(),player.storage.qixing.length)]).ai=function(target){ if(target.isMin()) return 0; if(target.hasSkill('biantian2')) return 0; var att=ai.get.attitude(player,target); @@ -886,14 +873,7 @@ character.extra={ target:function(player,target){ if(target.hasSkillTag('nofire')) return 0; if(lib.config.mode=='versus') return -1; - for(var i=0;i