diff --git a/card/zhenfa.js b/card/zhenfa.js index c5aacab65..9321746e5 100644 --- a/card/zhenfa.js +++ b/card/zhenfa.js @@ -25,18 +25,33 @@ card.zhenfa={ type:'zhenfa', chongzhu:true, enable:function(card,player){ - if(player.identity=='unknown') return false; - return player.next.identity==player.identity||player.previous.identity==player.identity; + if(player.inline()) return true; + if(player.identity=='unknown'||player.identity=='ye') return false; + return game.hasPlayer(function(current){ + return current!=player&¤t.isFriendOf(player); + }); }, filterTarget:function(card,player,target){ - if(player==target) return player.inline(); - return player.inline(target); + if(player.inline()) return player.inline(target); + if(!player.getNext()) return false; + var list=game.filterPlayer(function(current){ + return current!=player&¤t.isFriendOf(player); + }); + list.sort(function(a,b){ + return get.distance(player,a,'absolute')-get.distance(player,b,'absolute'); + }); + return target==list[0]; }, selectTarget:-1, multitarget:true, multiline:true, content:function(){ - game.asyncDraw(targets); + if(targets.length==1){ + game.swapSeat(targets[0],game.me.getNext(),true,true); + } + else{ + game.asyncDraw(targets); + } }, mode:['guozhan'], ai:{ @@ -149,33 +164,31 @@ card.zhenfa={ type:'zhenfa', chongzhu:true, enable:function(card,player){ - if(player.identity=='unknown'||player.identity=='ye') return false; - return (get.population(player.identity)>1) + return player.siege()||player.sieged(); }, filterTarget:function(card,player,target){ - return target.identity==player.identity; + return target==player; }, - multitarget:true, selectTarget:-1, content:function(){ - lib.temp=targets[0]; - targets.sort(lib.sort.seat); - var rest=game.players.slice(0); - rest.remove(targets); - rest.sort(function(a,b){ - if(a.identity=='unknown') return 1; - else return -1; - }) - lib.temp={}; - if(targets.length>rest.length+1) targets.length=rest.length+1; - for(var i=1;i0; + }, + }, + yizhi:{ + init:function(player){ + if(player.checkViceSkill('yizhi')){ + player.removeMaxHp(); + } + }, + inherit:'guanxing', + filter:function(event,player){ + return !player.hasSkill('guanxing'); + } + }, gzshangyi:{ audio:'shangyi', enable:'phaseUse', @@ -1308,7 +1329,16 @@ mode.guozhan={ else{ event.current.showCharacter(1); } - event.goto(num); + if(event.current.identity=='ye'||num!=1){ + if(event.dir){ + event.dir=false; + event.current=player; + event.goto(num); + } + } + else{ + event.goto(num); + } } else if(event.dir){ event.dir=false; @@ -2009,6 +2039,7 @@ mode.guozhan={ } } for(var j=0;j