This commit is contained in:
libccy 2017-02-12 17:02:32 +08:00
parent b3ebae064f
commit a5af682a11
1 changed files with 163 additions and 261 deletions

View File

@ -161,12 +161,12 @@ character.swd={
check:function(event,player){ check:function(event,player){
if(ai.get.attitude(player,event.player)>=0) return 0; if(ai.get.attitude(player,event.player)>=0) return 0;
if(player.hasUnknown()) return 0; if(player.hasUnknown()) return 0;
var num=0; var num=0,players=game.filterPlayer();
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(game.players[i]!=player&& if(players[i]!=player&&
game.players[i]!=event.player&& players[i]!=event.player&&
get.distance(event.player,game.players[i])<=1){ get.distance(event.player,players[i])<=1){
var eff=ai.get.damageEffect(game.players[i],player,player,'fire'); var eff=ai.get.damageEffect(players[i],player,player,'fire');
if(eff>0){ if(eff>0){
num++; num++;
} }
@ -183,11 +183,12 @@ character.swd={
player.storage.shenyan=true; player.storage.shenyan=true;
player.awakenSkill('shenyan'); player.awakenSkill('shenyan');
player.storage.shenyan2=[]; player.storage.shenyan2=[];
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i]!=player&& for(var i=0;i<players.length;i++){
game.players[i]!=trigger.player&& if(players[i]!=player&&
get.distance(trigger.player,game.players[i])<=1){ players[i]!=trigger.player&&
player.storage.shenyan2.push(game.players[i]); get.distance(trigger.player,players[i])<=1){
player.storage.shenyan2.push(players[i]);
} }
} }
player.storage.shenyan2.sort(lib.sort.seat); player.storage.shenyan2.sort(lib.sort.seat);
@ -429,12 +430,9 @@ character.swd={
'step 0' 'step 0'
player.awakenSkill('hxunzhi'); player.awakenSkill('hxunzhi');
player.storage.hxunzhi=true; player.storage.hxunzhi=true;
var targets=[]; var targets=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return player.canUse('wanjian',current);
if(player.canUse({name:'wanjian'},game.players[i])){ });
targets.push(game.players[i]);
}
}
targets.sort(lib.sort.seat); targets.sort(lib.sort.seat);
player.useCard({name:'wanjian'},targets); player.useCard({name:'wanjian'},targets);
'step 1' 'step 1'
@ -758,10 +756,11 @@ character.swd={
target:function(player,target){ target:function(player,target){
if(player.hp==1) return 1; if(player.hp==1) return 1;
var num=0; var num=0;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(ai.get.attitude(player,game.players[i])>2){ for(var i=0;i<players.length;i++){
if(game.players[i].hp==1) return 1; if(ai.get.attitude(player,players[i])>2){
if(game.players[i].hp==2) num++; if(players[i].hp==1) return 1;
if(players[i].hp==2) num++;
} }
} }
if(player.hasUnknown()) return 0; if(player.hasUnknown()) return 0;
@ -1003,11 +1002,9 @@ character.swd={
target:function(player,target){ target:function(player,target){
if(game.phaseNumber<game.players.length) return 0; if(game.phaseNumber<game.players.length) return 0;
if(game.phaseNumber<game.players.length*2&&player.hp==player.maxHp) return 0; if(game.phaseNumber<game.players.length*2&&player.hp==player.maxHp) return 0;
if(player.hasUnknown()) return 0;
switch(lib.config.mode){ switch(lib.config.mode){
case 'identity':{ case 'identity':{
for(var i=0;i<game.players.length;i++){
if(game.players[i].ai.shown==0) return 0;
}
switch(player.identity){ switch(player.identity){
case 'zhu':{ case 'zhu':{
if(ai.get.situation()>=0) return 0; if(ai.get.situation()>=0) return 0;
@ -1115,20 +1112,16 @@ character.swd={
forced:true, forced:true,
logv:false, logv:false,
check:function(event,player){ check:function(event,player){
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(ai.get.attitude(player,game.players[i])>2&&game.players[i].num('h')==1){ return ai.get.attitude(player,current)>2&&current.num('h')==1
return true; });
}
}
return false;
}, },
filter:function(event,player){ filter:function(event,player){
if(event.source==player) return false; if(event.source==player) return false;
if(get.distance(player,event.player)>1) return false; if(get.distance(player,event.player)>1) return false;
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i].num('h')) return true; return current.num('h');
} });
return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -1354,9 +1347,10 @@ character.swd={
player:function(player){ player:function(player){
if(player.num('h','juedou')) return 1; if(player.num('h','juedou')) return 1;
if(player.num('h','sha')==0) return 0; if(player.num('h','sha')==0) return 0;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(player.canUse('sha',game.players[i])&& for(var i=0;i<players.length;i++){
ai.get.effect(game.players[i],{name:'sha'},player,player)>0){ if(player.canUse('sha',players[i])&&
ai.get.effect(players[i],{name:'sha'},player,player)>0){
return 1; return 1;
} }
} }
@ -1558,24 +1552,26 @@ character.swd={
usable:1, usable:1,
filterCard:{color:'red'}, filterCard:{color:'red'},
filter:function(){ filter:function(){
var min=game.players[0].hp; var players=game.filterPlayer();
for(var i=0;i<game.players.length;i++){ var min=players[0].hp;
min=Math.min(min,game.players[i].hp); for(var i=0;i<players.length;i++){
min=Math.min(min,players[i].hp);
} }
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(game.players[i].hp==min&&game.players[i].hp<game.players[i].maxHp) return true; if(players[i].hp==min&&players[i].hp<players[i].maxHp) return true;
} }
return false; return false;
}, },
prompt:function(){ prompt:function(){
var players=game.filterPlayer();
var targets=[]; var targets=[];
var min=game.players[0].hp; var min=players[0].hp;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
min=Math.min(min,game.players[i].hp); min=Math.min(min,players[i].hp);
} }
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(game.players[i].hp==min&&game.players[i].hp<game.players[i].maxHp){ if(players[i].hp==min&&players[i].hp<players[i].maxHp){
targets.push(game.players[i]); targets.push(players[i]);
} }
} }
return '令'+get.translation(targets)+'回复一点体力'; return '令'+get.translation(targets)+'回复一点体力';
@ -1584,11 +1580,7 @@ character.swd={
return 8-ai.get.value(card); return 8-ai.get.value(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target.hp==target.maxHp) return false; return target.isDamaged()&&target.isLowestHp();
for(var i=0;i<game.players.length;i++){
if(game.players[i].hp<target.hp) return false;
}
return true;
}, },
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
@ -1600,14 +1592,15 @@ character.swd={
threaten:1.4, threaten:1.4,
result:{ result:{
player:function(player,target){ player:function(player,target){
var players=game.filterPlayer();
var num=0; var num=0;
var min=game.players[0].hp; var min=players[0].hp;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
min=Math.min(min,game.players[i].hp); min=Math.min(min,players[i].hp);
} }
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(game.players[i].hp==min&&game.players[i].hp<game.players[i].maxHp){ if(players[i].hp==min&&players[i].hp<players[i].maxHp){
num+=ai.get.recoverEffect(game.players[i],player,player); num+=ai.get.recoverEffect(players[i],player,player);
} }
} }
return num; return num;
@ -1719,14 +1712,9 @@ character.swd={
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(player.num('he')==0) return false; if(player.num('he')==0) return false;
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i]!=player&& return (current!=player&&get.distance(player,current,'attack')<=1&&player.hp<=current.hp);
get.distance(player,game.players[i],'attack')<=1&& });
player.hp<=game.players[i].hp){
return true;
}
}
return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -1957,12 +1945,9 @@ character.swd={
filter:function(event,player){ filter:function(event,player){
if(player==_status.currentPhase) return false; if(player==_status.currentPhase) return false;
if(get.itemtype(event.cards)!='cards') return false; if(get.itemtype(event.cards)!='cards') return false;
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(get.distance(player,game.players[i],'attack')>1&&player!=game.players[i]){ return get.distance(player,current,'attack')>1&&player!=current;
return true; });
}
}
return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -1984,6 +1969,11 @@ character.swd={
mingzhi:false, mingzhi:false,
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(!game.hasPlayer(function(current){
return get.distance(player,current,'attack')>1&&player!=current&&ai.get.attitude(player,current)>=0;
})){
return;
}
if(get.type(card)=='equip'&&player==target){ if(get.type(card)=='equip'&&player==target){
var distance=get.info(card).distance; var distance=get.info(card).distance;
if(distance){ if(distance){
@ -2062,9 +2052,10 @@ character.swd={
return 0; return 0;
} }
var num=0; var num=0;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
var att=ai.get.attitude(player,game.players[i]); for(var i=0;i<players.length;i++){
var del=game.players[i].maxHp-game.players[i].hp; var att=ai.get.attitude(player,players[i]);
var del=players[i].maxHp-players[i].hp;
if(att>0){ if(att>0){
num+=del; num+=del;
} }
@ -2438,12 +2429,9 @@ character.swd={
}, },
content:function(){ content:function(){
"step 0" "step 0"
var enemy=0; var enemy=game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current!=player&&ai.get.damageEffect(current,player,player)>0;
if(game.players[i]!=player&&ai.get.damageEffect(game.players[i],player,player)>0){ });
enemy++;
}
}
var next=player.chooseCardTarget({ var next=player.chooseCardTarget({
position:'he', position:'he',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
@ -2718,13 +2706,9 @@ character.swd={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(){ filter:function(){
var num=0 return game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.get('e','1');
if(game.players[i].get('e','1')){ })>=1;
num++;
}
}
return num>=1;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&!target.isTurnedOver(); return player!=target&&!target.isTurnedOver();
@ -2733,9 +2717,10 @@ character.swd={
"step 0" "step 0"
event.targets=[]; event.targets=[];
event.num=0; event.num=0;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i].get('e','1')){ for(var i=0;i<players.length;i++){
event.targets.push(game.players[i]); if(players[i].get('e','1')){
event.targets.push(players[i]);
} }
} }
event.targets.sort(lib.sort.seat); event.targets.sort(lib.sort.seat);
@ -2757,12 +2742,9 @@ character.swd={
ai:{ ai:{
result:{ result:{
target:function(player,target){ target:function(player,target){
var num=0 var num=game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.get('e','1');
if(game.players[i].get('e','1')){ });
num++;
}
}
if(target.hp==1&&num<3){ if(target.hp==1&&num<3){
return (num-3)/1.5; return (num-3)/1.5;
} }
@ -5280,13 +5262,17 @@ character.swd={
if(event.responded) return false; if(event.responded) return false;
if(!player.num('he')) return false; if(!player.num('he')) return false;
if(event.filterCard({name:'shan'})){ if(event.filterCard({name:'shan'})){
for(var i=0;i<game.players.length;i++){ if(game.hasPlayer(function(current){
if(game.players[i]!=player&&game.players[i].get('e','2')) return true; return current!=player&&current.get('e','2');
})){
return true;
} }
} }
if(event.filterCard({name:'sha'})){ if(event.filterCard({name:'sha'})){
for(var i=0;i<game.players.length;i++){ if(game.hasPlayer(function(current){
if(game.players[i]!=player&&game.players[i].get('e','1')) return true; return current!=player&&current.get('e','1');
})){
return true;
} }
} }
return false; return false;
@ -5295,14 +5281,15 @@ character.swd={
content:function(){ content:function(){
"step 0" "step 0"
var list=[]; var list=[];
var players=game.filterPlayer();
if(trigger.filterCard({name:'shan'})){ if(trigger.filterCard({name:'shan'})){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(game.players[i]!=player&&game.players[i].get('e','2')) list.push(game.players[i].get('e','2')); if(players[i]!=player&&players[i].get('e','2')) list.push(players[i].get('e','2'));
} }
} }
if(trigger.filterCard({name:'sha'})){ if(trigger.filterCard({name:'sha'})){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(game.players[i]!=player&&game.players[i].get('e','1')) list.push(game.players[i].get('e','1')); if(players[i]!=player&&players[i].get('e','1')) list.push(players[i].get('e','1'));
} }
} }
var dialog=ui.create.dialog('神工',list); var dialog=ui.create.dialog('神工',list);
@ -5336,21 +5323,21 @@ character.swd={
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(target.num('he')<=1) return; var he=target.num('he');
if(!he) return 1.5;
if(he<=1) return;
if(get.tag(card,'respondShan')){ if(get.tag(card,'respondShan')){
for(var i=0;i<game.players.length;i++){ if(game.hasPlayer(function(current){
if(game.players[i].get('e','2')){ return current!=target&&current.get('e','2')&&ai.get.attitude(target,current)<=0;
if(ai.get.attitude(player,game.players[i])>0) return 0.6/player.num('he'); })){
return; return 0.6/he;
}
} }
} }
if(get.tag(card,'respondSha')){ if(get.tag(card,'respondSha')){
for(var i=0;i<game.players.length;i++){ if(game.hasPlayer(function(current){
if(game.players[i].get('e','1')){ return current!=target&&current.get('e','2')&&ai.get.attitude(target,current)<=0;
if(ai.get.attitude(player,game.players[i])>0) return 0.6/player.num('he'); })){
return; return 0.6/he;
}
} }
} }
} }
@ -5441,7 +5428,7 @@ character.swd={
trigger:{player:['useCard','respondAfter']}, trigger:{player:['useCard','respondAfter']},
direct:true, direct:true,
filter:function(event){ filter:function(event){
return game.players.length>2&&event.card&&event.card.name=='sha'; return game.countPlayer()>2&&event.card&&event.card.name=='sha';
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -5494,13 +5481,14 @@ character.swd={
'step 0' 'step 0'
player.storage.jingjie=true; player.storage.jingjie=true;
player.unmarkSkill('jingjie'); player.unmarkSkill('jingjie');
for(var i=0;i<game.players.length;i++){ event.targets=game.filterPlayer();
game.players[i].discard(game.players[i].get('hej'))._triggered=null; for(var i=0;i<event.targets.length;i++){
event.targets[i].discard(event.targets[i].get('hej'))._triggered=null;
} }
'step 1' 'step 1'
for(var i=0;i<game.players.length;i++){ for(var i=0;i<event.targets.length;i++){
game.players[i].directgain(get.cards(2)); event.targets[i].directgain(get.cards(2));
game.players[i].$draw(2); event.targets[i].$draw(2);
} }
}, },
@ -5509,18 +5497,18 @@ character.swd={
order:1, order:1,
result:{ result:{
player:function(player){ player:function(player){
var num=0; var num=0,players=game.filterPlayer();
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
var att=ai.get.attitude(player,game.players[i]); var att=ai.get.attitude(player,players[i]);
if(att>0){ if(att>0){
num-=game.players[i].num('he')-2; num-=players[i].num('he')-2;
} }
else if(att<0){ else if(att<0){
num+=game.players[i].num('he')-2; num+=players[i].num('he')-2;
} }
} }
if(player.hp==1) return num-1; if(player.hp==1) return num-1;
return num-game.players.length/2; return num-players.length/2;
} }
} }
} }
@ -6345,16 +6333,6 @@ character.swd={
if(target.num('he')==1) return -1.5; if(target.num('he')==1) return -1.5;
return -1; return -1;
} }
// player:function(player){
// var num=0;
// for(var i=0;i<game.players.length;i++){
// if(game.players[i]!=player){
// if(ai.get.attitude(player,game.players[i])>0) num--;
// else num++;
// }
// }
// return num;
// }
}, },
} }
}, },
@ -6644,10 +6622,11 @@ character.swd={
var cards; var cards;
var att; var att;
var filter={color:get.color(player.get('h')[0])=='red'?'black':'red'}; var filter={color:get.color(player.get('h')[0])=='red'?'black':'red'};
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
att=ai.get.attitude(player,game.players[i]); for(var i=0;i<players.length;i++){
att=ai.get.attitude(player,players[i]);
cards=game.players[i].get('e',filter); cards=players[i].get('e',filter);
if(att>0){ if(att>0){
ainum-=cards.length; ainum-=cards.length;
} }
@ -6656,7 +6635,7 @@ character.swd={
} }
todiscard=todiscard.concat(cards); todiscard=todiscard.concat(cards);
cards=game.players[i].get('j',filter); cards=players[i].get('j',filter);
if(att>0){ if(att>0){
ainum+=cards.length; ainum+=cards.length;
} }
@ -6826,10 +6805,9 @@ character.swd={
usable:1, usable:1,
selectTarget:-1, selectTarget:-1,
filter:function(){ filter:function(){
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i].num('j')) return true; return current.num('j');
} });
return false;
}, },
line:'fire', line:'fire',
content:function(){ content:function(){
@ -6950,17 +6928,17 @@ character.swd={
direct:true, direct:true,
filter:function(event){ filter:function(event){
if(event.card) return true; if(event.card) return true;
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i].num('j')) return true; return current.num('j');
} });
return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
var list=[]; var list=[];
if(trigger.card) list.push(trigger.card); if(trigger.card) list.push(trigger.card);
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
list=list.concat(game.players[i].get('j')); for(var i=0;i<players.length;i++){
list=list.concat(players[i].get('j'));
} }
var dialog=ui.create.dialog(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+get.translation(trigger.player.judging[0])+ var dialog=ui.create.dialog(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+get.translation(trigger.player.judging[0])+
''+get.prompt('tianlun'),list,'hidden'); ''+get.prompt('tianlun'),list,'hidden');
@ -6999,59 +6977,6 @@ character.swd={
} }
} }
}, },
hlongyin:{
enable:'phaseUse',
usable:1,
filterCard:function(card,player){
if(get.number(card)%game.players.length==0) return false;
for(var i=0;i<game.players.length;i++){
if(get.distance(player,game.players[i],'absolute')==get.number(card)%game.players.length){
break;
}
}
if(!game.players[i]) return false;
if(game.players[i].num('e')==0) return false;
for(var i=0;i<ui.selected.cards.length;i++){
if(get.number(card)%game.players.length==
get.number(ui.selected.cards[i])%game.players.length) return false;
if(get.color(card)!=get.color(ui.selected.cards[i])) return false;
}
return true;
},
complexCard:true,
selectCard:[1,Infinity],
filterTarget:function(card,player,target){
if(player==target) return false;
if(target.num('ej')==0) return false;
for(var i=0;i<ui.selected.cards.length;i++){
if(get.number(ui.selected.cards[i])%game.players.length==
get.distance(player,target,'absolute')) return true;
}
return false;
},
selectTarget:-1,
content:function(){
"step 0"
if(target.num('e')){
player.choosePlayerCard(target,true,'e');
}
"step 1"
try{
target.discard(1,result.buttons[0].link);
}
catch(e){}
if(target==targets[targets.length-1]) player.draw(targets.length);
},
check:function(card){
return 8-ai.get.value(card);
},
ai:{
order:10,
result:{
target:-1
}
}
},
lanzhi_old:{ lanzhi_old:{
trigger:{source:'damageBefore'}, trigger:{source:'damageBefore'},
logTarget:'player', logTarget:'player',
@ -7071,30 +6996,22 @@ character.swd={
trigger:{player:'useCard'}, trigger:{player:'useCard'},
filter:function(event,player){ filter:function(event,player){
if(get.suit(event.card)=='club'){ if(get.suit(event.card)=='club'){
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i].hp<game.players[i].maxHp&&game.players[i].hp<=player.hp){ return current.hp<=player.hp&&current.isDamaged();
return true; });
}
}
} }
return false; return false;
}, },
prompt:function(event,player){ prompt:function(event,player){
var list=[]; var list=game.hasPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.hp<=player.hp&&current.isDamaged();
if(game.players[i].hp<game.players[i].maxHp&&game.players[i].hp<=player.hp){ });
list.push(game.players[i]);
}
}
return get.prompt('lanzhi',list); return get.prompt('lanzhi',list);
}, },
check:function(event,player){ check:function(event,player){
var list=[]; var list=game.hasPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.hp<=player.hp&&current.isDamaged();
if(game.players[i].hp<game.players[i].maxHp&&game.players[i].hp<=player.hp){ });
list.push(game.players[i]);
}
}
var num=0; var num=0;
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
var eff=ai.get.recoverEffect(list[i],player,player); var eff=ai.get.recoverEffect(list[i],player,player);
@ -7109,12 +7026,9 @@ character.swd={
}, },
content:function(){ content:function(){
"step 0" "step 0"
var list=[]; var list=game.hasPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.hp<=player.hp&&current.isDamaged();
if(game.players[i].hp<game.players[i].maxHp&&game.players[i].hp<=player.hp){ });
list.push(game.players[i]);
}
}
player.line(list,'green'); player.line(list,'green');
list.sort(lib.sort.seat); list.sort(lib.sort.seat);
event.list=list; event.list=list;
@ -7721,13 +7635,9 @@ character.swd={
target:function(card,player,target){ target:function(card,player,target){
if(!get.tag(card,'damage')) return; if(!get.tag(card,'damage')) return;
if(target.hasSkill('yinguo')) return; if(target.hasSkill('yinguo')) return;
var source=null; var source=game.findPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.hasSkill('yinguo');
if(game.players[i].hasSkill('yinguo')){ });
source=game.players[i];
break;
}
}
if(source&&source.num('he')){ if(source&&source.num('he')){
if(ai.get.attitude(source,player)<0&&ai.get.attitude(source,target)>0){ if(ai.get.attitude(source,player)<0&&ai.get.attitude(source,target)>0){
return [0,0,0,-1]; return [0,0,0,-1];
@ -7818,20 +7728,15 @@ character.swd={
xianyin:{ xianyin:{
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i].num('j')&&game.players[i]!=player) return true; return current.num('j')&&current!=player;
} });
return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
event.targets=[]; event.targets=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.num('j')&&current!=player;
if(game.players[i].num('j')&&game.players[i]!=player){ });
// game.players[i].gain(game.players[i].get('j'),'gain2');
event.targets.add(game.players[i]);
}
}
event.targets.sort(lib.sort.seat); event.targets.sort(lib.sort.seat);
"step 1" "step 1"
if(event.targets.length){ if(event.targets.length){
@ -7861,11 +7766,11 @@ character.swd={
order:9, order:9,
result:{ result:{
player:function(player){ player:function(player){
var num=0; var num=0,players=game.filterPlayer();
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(game.players[i]!=player&&game.players[i].num('j')){ if(players[i]!=player&&players[i].num('j')){
if(ai.get.attitude(player,game.players[i])>=0&& if(ai.get.attitude(player,players[i])>=0&&
ai.get.attitude(game.players[i],player)>=0){ ai.get.attitude(players[i],player)>=0){
num++; num++;
} }
else{ else{
@ -8368,12 +8273,9 @@ character.swd={
content:function(){ content:function(){
"step 0" "step 0"
target.damage('fire'); target.damage('fire');
event.targets=[]; event.targets=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return get.distance(target,current)<=1;
if(get.distance(target,game.players[i])<=1){ });
event.targets.push(game.players[i]);
}
}
get.sortSeat(event.targets,event.target); get.sortSeat(event.targets,event.target);
event.targets.unshift(player); event.targets.unshift(player);
"step 1" "step 1"
@ -8444,9 +8346,9 @@ character.swd={
effect:{ effect:{
target:function(card,player){ target:function(card,player){
if(get.subtype(card)=='equip1'){ if(get.subtype(card)=='equip1'){
var num=0; var num=0,players=game.filterPlayer();
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(player,game.players[i])<0){ if(ai.get.attitude(player,players[i])<0){
num++; num++;
if(num>1) return [0,0,0,0]; if(num>1) return [0,0,0,0];
} }