This commit is contained in:
libccy 2017-02-12 21:50:32 +08:00
parent 55e910d12c
commit c476ae2558
8 changed files with 257 additions and 260 deletions

View File

@ -1009,6 +1009,9 @@ card.gujian={
filterCard:{suit:'heart'}, filterCard:{suit:'heart'},
position:'he', position:'he',
viewAs:{name:'tao'}, viewAs:{name:'tao'},
viewAsFilter:function(player){
return player.num('he',{suit:'heart'})>0;
},
prompt:'将一张红桃牌当桃使用', prompt:'将一张红桃牌当桃使用',
check:function(card){return 10-ai.get.value(card)}, check:function(card){return 10-ai.get.value(card)},
ai:{ ai:{

View File

@ -4446,7 +4446,7 @@ card.swd={
}, },
ai:{ ai:{
effect:function(card,player,target){ effect:function(card,player,target){
if(get.tag(card,'damage')) return [1,0.5]; if(get.tag(card,'damage')&&!target.hujia) return [1,0.5];
} }
}, },
intro:{ intro:{

View File

@ -1588,7 +1588,7 @@ character.hearth={
player.chooseToUse(); player.chooseToUse();
'step 2' 'step 2'
if(result.bool){ if(result.bool){
event.goto(1); player.chooseToUse();
} }
} }
}, },
@ -2995,7 +2995,11 @@ character.hearth={
'step 0' 'step 0'
player.loseHp(); player.loseHp();
'step 1' 'step 1'
event.target=game.players.randomGet(player); event.target=game.filterPlayer().randomGet(player);
if(!event.target){
event.finish();
return;
}
player.line(event.target,'fire'); player.line(event.target,'fire');
game.delayx(); game.delayx();
'step 2' 'step 2'
@ -5641,7 +5645,7 @@ character.hearth={
maoxian2:'冒险', maoxian2:'冒险',
maoxian_info:'出牌阶段限两次,你可以从三个随机技能中选择一个作为你的技能', maoxian_info:'出牌阶段限两次,你可以从三个随机技能中选择一个作为你的技能',
tanmi:'探秘', tanmi:'探秘',
tanmi_info:'在一名其他角色的结束阶段,若你没有手牌,你可以摸两张牌并可以使用摸到的牌', tanmi_info:'在一名其他角色的结束阶段,若你没有手牌,你可以摸两张牌并可以使用两张牌',
yiwen:'轶闻', yiwen:'轶闻',
yiwen_info:'锁定技,每当其他角色于回合内首次使用卡牌指定你为惟一目标,你获得一张此牌的复制', yiwen_info:'锁定技,每当其他角色于回合内首次使用卡牌指定你为惟一目标,你获得一张此牌的复制',
tanbao_old:'探宝', tanbao_old:'探宝',

View File

@ -18,6 +18,7 @@ window.characterRank={
'hs_medivh', 'hs_medivh',
], ],
ap:[ ap:[
'pal_lixiaoyao',
'swd_huanyuanzhi', 'swd_huanyuanzhi',
'pal_xiahoujinxuan', 'pal_xiahoujinxuan',
'swd_huiyan', 'swd_huiyan',
@ -362,7 +363,6 @@ window.characterRank={
'hs_anomalus', 'hs_anomalus',
'mifuren', 'mifuren',
'hanba', 'hanba',
'pal_lixiaoyao',
'sunjian', 'sunjian',
'pangtong', 'pangtong',
'caochun', 'caochun',

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
character.xianjian={ character.xianjian={
character:{ character:{
pal_lixiaoyao:['male','qun',4,['xiaoyao','yujian']], pal_lixiaoyao:['male','qun',4,['tianjian','yufeng']],
pal_zhaoliner:['female','wei',3,['huimeng','tianshe']], pal_zhaoliner:['female','wei',3,['huimeng','tianshe']],
pal_linyueru:['female','wei',3,['guiyuan','qijian']], pal_linyueru:['female','wei',3,['guiyuan','qijian']],
@ -62,8 +62,28 @@ character.xianjian={
player.getStat().card.sha--; player.getStat().card.sha--;
} }
}, },
fenshi:{ yufeng:{
trigger:{player:'loseEnd'},
frequent:true,
usable:2,
filter:function(event,player){
for(var i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return player.num('h')<2;
}
return false;
},
content:function(){
player.draw(2-player.num('h'));
},
ai:{
noh:true,
skillTagFilter:function(player,tag){
var nh=player.num('h');
if(tag=='noh'&&(nh>2||nh==0)){
return false;
}
}
}
}, },
feixia:{ feixia:{
enable:'phaseUse', enable:'phaseUse',
@ -137,14 +157,28 @@ character.xianjian={
expose:0.2, expose:0.2,
} }
}, },
yujian:{ tianjian:{
enable:'phaseUse', enable:'phaseUse',
viewAs:{name:'wanjian'}, viewAs:{name:'wanjian'},
filterCard:{name:'sha'}, filterCard:{name:'sha'},
filter:function(event,player){ filter:function(event,player){
return player.num('h','sha')>0; return player.num('h','sha')>0;
}, },
usable:1 usable:1,
group:'tianjian_discard',
subSkill:{
discard:{
trigger:{source:'damageEnd'},
forced:true,
filter:function(event){
return event.parent.skill=='tianjian'&&event.player.num('he');
},
popup:false,
content:function(){
trigger.player.discard(trigger.player.get('he').randomGet());
}
}
}
}, },
feng:{ feng:{
unique:true, unique:true,
@ -756,13 +790,9 @@ character.xianjian={
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
if(event.targets.length!=1) return false; if(event.targets.length!=1) return false;
var target=event.targets[0]; var target=event.targets[0];
var players; var players=game.filterPlayer(function(current){
if(get.mode()=='chess'){ return get.distance(target,current,'pure')==1;
players=target.getNeighbours(); });
}
else{
players=[target.next,target.previous];
}
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(player!=players[i]&&target!=players[i]&&player.canUse('sha',players[i],false)){ if(player!=players[i]&&target!=players[i]&&player.canUse('sha',players[i],false)){
return true; return true;
@ -773,13 +803,9 @@ character.xianjian={
prompt:function(event,player){ prompt:function(event,player){
var targets=[]; var targets=[];
var target=event.targets[0]; var target=event.targets[0];
var players; var players=game.filterPlayer(function(current){
if(get.mode()=='chess'){ return get.distance(target,current,'pure')==1;
players=target.getNeighbours(); });
}
else{
players=[target.next,target.previous];
}
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(player!=players[i]&&target!=players[i]&&player.canUse('sha',players[i],false)){ if(player!=players[i]&&target!=players[i]&&player.canUse('sha',players[i],false)){
targets.push(players[i]); targets.push(players[i]);
@ -790,13 +816,9 @@ character.xianjian={
check:function(event,player){ check:function(event,player){
var target=event.targets[0]; var target=event.targets[0];
var num=0; var num=0;
var players; var players=game.filterPlayer(function(current){
if(get.mode()=='chess'){ return get.distance(target,current,'pure')==1;
players=target.getNeighbours(); });
}
else{
players=[target.next,target.previous];
}
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(player!=players[i]&&target!=players[i]&&player.canUse('sha',players[i],false)){ if(player!=players[i]&&target!=players[i]&&player.canUse('sha',players[i],false)){
num+=ai.get.effect(players[i],{name:'sha'},player,player); num+=ai.get.effect(players[i],{name:'sha'},player,player);
@ -807,13 +829,9 @@ character.xianjian={
content:function(){ content:function(){
"step 0" "step 0"
var target=trigger.targets[0]; var target=trigger.targets[0];
var players; var players=game.filterPlayer(function(current){
if(get.mode()=='chess'){ return get.distance(target,current,'pure')==1;
players=target.getNeighbours(); });
}
else{
players=[target.next,target.previous];
}
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(player!=players[i]&&target!=players[i]&&player.canUse('sha',players[i],false)){ if(player!=players[i]&&target!=players[i]&&player.canUse('sha',players[i],false)){
trigger.targets.push(players[i]); trigger.targets.push(players[i]);
@ -2246,20 +2264,17 @@ character.xianjian={
threaten:1.5 threaten:1.5
} }
}, },
xiaoyao:{ tuoqiao:{
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(event.player==player) return false; if(event.player==player) return false;
if(event.cards&&event.cards.length==1){ return player.num('h')>0;
return player.num('h',{suit:get.suit(event.cards[0])})>0;
}
return false;
}, },
trigger:{target:'useCardToBefore'}, trigger:{target:'useCardToBefore'},
content:function(){ content:function(){
"step 0" "step 0"
var next=player.chooseToDiscard('逍遥:是否弃置一张牌使'+get.translation(trigger.card)+'失效?',{suit:get.suit(trigger.cards[0])}); var next=player.chooseToDiscard(get.prompt('tuoqiao'));
next.logSkill='xiaoyao'; next.logSkill='tuoqiao';
next.ai=function(card){ next.ai=function(card){
if(ai.get.effect(player,trigger.card,trigger.player,player)<0){ if(ai.get.effect(player,trigger.card,trigger.player,player)<0){
return 7-ai.get.value(card); return 7-ai.get.value(card);
@ -2268,12 +2283,21 @@ character.xianjian={
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.judge(function(card){
return get.suit(card)=='heart'?-1:1;
});
}
else{
event.finish();
}
"step 2"
if(result.suit!='heart'){
trigger.untrigger(); trigger.untrigger();
trigger.finish(); trigger.finish();
} }
} }
}, },
tuoqiao:{ tuoqiao_old:{
filter:function(event,player){ filter:function(event,player){
return game.players.length>3&&(event.player==player.next||event.player==player.previous); return game.players.length>3&&(event.player==player.next||event.player==player.previous);
}, },
@ -2304,7 +2328,7 @@ character.xianjian={
} }
} }
}, },
yujian_old:{ tianjian_old:{
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
changeSeat:true, changeSeat:true,
@ -2439,7 +2463,7 @@ character.xianjian={
zhangmu:'障目', zhangmu:'障目',
zhangmu_info:'每回合限一次,当你需要使用或打出一张闪时,你可以展示一张闪,视为使用或打出了此闪', zhangmu_info:'每回合限一次,当你需要使用或打出一张闪时,你可以展示一张闪,视为使用或打出了此闪',
feizhua:'飞爪', feizhua:'飞爪',
feizhua_info:'当你使用一张杀时,你可以将目标两侧的角色追加为额外目标', feizhua_info:'当你使用一张杀时,你可以将与目标相邻的角色追加为额外目标',
leiyu:'雷狱', leiyu:'雷狱',
leiyu_info:'结束阶段,你可以弃置一张黑色牌,视为对本回合内所有成为过你的卡牌目标的角色使用一张惊雷闪', leiyu_info:'结束阶段,你可以弃置一张黑色牌,视为对本回合内所有成为过你的卡牌目标的角色使用一张惊雷闪',
lingxue:'灵血', lingxue:'灵血',
@ -2524,11 +2548,13 @@ character.xianjian={
tannang:'探囊', tannang:'探囊',
tannang_info:'出牌阶段限一次,你可以将一张梅花手牌当顺手牵羊使用;你的顺手牵羊无距离限制', tannang_info:'出牌阶段限一次,你可以将一张梅花手牌当顺手牵羊使用;你的顺手牵羊无距离限制',
tuoqiao:'脱壳', tuoqiao:'脱壳',
tuoqiao_info:'每当你成为身边角色的卡牌的目标,你可以将座位后移一位,然后取消之', tuoqiao_info:'当你成为其他角色卡牌的目标时,你可以弃置一张手牌并进行一次判定,若不为红桃,则取消之',
xiaoyao:'逍遥', xiaoyao:'逍遥',
xiaoyao_info:'每当你成为其他角色的卡牌目标,你可以弃置一张与之花色相同的手牌取消之', xiaoyao_info:'每当你成为其他角色的卡牌目标,你可以弃置一张与之花色相同的手牌取消之',
yujian:'御剑', tianjian:'天剑',
yujian_info:'出牌阶段限一次,你可以将一张杀当作万箭齐发使用', tianjian_info:'出牌阶段限一次,你可以将一张杀当作万箭齐发使用,受到伤害的角色随机弃置一张牌',
yufeng:'御风',
yufeng_info:'当你失去手牌后若手牌数少于2可将手牌数补至2每回合最多发动两次',
huimeng:'回梦', huimeng:'回梦',
huimeng_info:'每当你回复一点体力,可以摸两张牌', huimeng_info:'每当你回复一点体力,可以摸两张牌',
tianshe:'天蛇', tianshe:'天蛇',

View File

@ -5627,6 +5627,23 @@
window.lib=lib; window.lib=lib;
window._status=_status; window._status=_status;
}, },
cfg:function(){
var mode=lib.config.all.mode.slice(0);
mode.remove('connect');
mode.remove('brawl');
var banned=['yxs_luzhishen','xuhuang','zhenji','shen_guanyu','zhurong',
'daqiao','lingcao','liuzan','lusu','luxun','yanwen'];
var bannedcards=['zengbin','toulianghuanzhu','huoshan','hongshui'];
for(var i=0;i<mode.length;i++){
game.saveConfig(mode[i]+'_banned',banned);
game.saveConfig(mode[i]+'_bannedcards',bannedcards);
}
game.saveConfig('tao_enemy',true);
game.saveConfig('layout','long2');
game.saveConfig('background_music','music_off');
game.saveConfig('background_audio',false);
game.saveConfig('background_ogg',false);
},
o:function(){ o:function(){
ui.arena.classList.remove('observe'); ui.arena.classList.remove('observe');
}, },
@ -27409,7 +27426,7 @@
if(update.version!=lib.version||dev){ if(update.version!=lib.version||dev){
var files=null; var files=null;
var version=lib.version; var version=lib.version;
if(Array.isArray(update.files)&&update.update&&!dev){ if(Array.isArray(update.files)&&update.update){
var version1=version.split('.'); var version1=version.split('.');
var version2=update.update.split('.'); var version2=update.update.split('.');
for(var i=0;i<version1.length&&i<version2.length;i++){ for(var i=0;i<version1.length&&i<version2.length;i++){

View File

@ -1137,10 +1137,9 @@ mode.boss={
return event.name=='loseHp'; return event.name=='loseHp';
}, },
x3:function(player,event){ x3:function(player,event){
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i]!=player&&game.players[i].num('e')>=4) return true; return current!=player&&current.num('e')>=4;
} });
return false;
}, },
x2:function(player){ x2:function(player){
return player.num('j')>=2; return player.num('j')>=2;
@ -1192,7 +1191,7 @@ mode.boss={
event.finish(); event.finish();
} }
'step 1' 'step 1'
var list=game.players.slice(0); var list=game.filterPlayer();
list.remove(player); list.remove(player);
list.sort(lib.sort.seat); list.sort(lib.sort.seat);
var list2=[]; var list2=[];
@ -1275,21 +1274,16 @@ mode.boss={
var info=lib.card[name]; var info=lib.card[name];
var card=game.createCard(name); var card=game.createCard(name);
if(info.selectTarget==-1){ if(info.selectTarget==-1){
var targets=[]; var targets=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return lib.filter.filterTarget(card,player,current);
if(lib.filter.filterTarget(card,player,game.players[i])){ });
targets.push(game.players[i]);
}
}
if(targets.length){ if(targets.length){
targets.sort(lib.sort.seat); targets.sort(lib.sort.seat);
// player.addTempSkill('fengqi2',{player:'useCardAfter'});
player.useCard(card,targets); player.useCard(card,targets);
} }
event.finish(); event.finish();
} }
else if(info.notarget){ else if(info.notarget){
// player.addTempSkill('fengqi2',{player:'useCardAfter'});
player.useCard(card); player.useCard(card);
} }
else{ else{
@ -2087,12 +2081,9 @@ mode.boss={
boss_mojian:{ boss_mojian:{
trigger:{player:'phaseUseBegin'}, trigger:{player:'phaseUseBegin'},
content:function(){ content:function(){
var list=[]; var list=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return player.canUse('wanjian',current)&&current.isEnemyOf(player);
if(player.canUse('wanjian',game.players[i])&&game.players[i].isEnemyOf(player)){ });
list.push(game.players[i]);
}
}
list.sort(lib.sort.seat); list.sort(lib.sort.seat);
player.useCard({name:'wanjian'},list); player.useCard({name:'wanjian'},list);
}, },
@ -2103,12 +2094,9 @@ mode.boss={
boss_yushou:{ boss_yushou:{
trigger:{player:'phaseUseBegin'}, trigger:{player:'phaseUseBegin'},
content:function(){ content:function(){
var list=[]; var list=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return player.canUse('nanman',current)&&current.isEnemyOf(player);
if(player.canUse('nanman',game.players[i])){ });
list.push(game.players[i]);
}
}
list.sort(lib.sort.seat); list.sort(lib.sort.seat);
player.useCard({name:'nanman'},list); player.useCard({name:'nanman'},list);
} }
@ -2146,20 +2134,15 @@ mode.boss={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
direct:true, direct:true,
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].isLinked()&&player!=game.players[i]){ return current!=player&&!current.isLinked();
return true; });
}
}
}, },
content:function(){ content:function(){
"step 0" "step 0"
var num=0; var num=game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current!=player&&!current.isLinked();
if(!game.players[i].isLinked()&&player!=game.players[i]){ });
num++;
}
}
player.chooseTarget(get.prompt('boss_suoming'),[1,num],function(card,player,target){ player.chooseTarget(get.prompt('boss_suoming'),[1,num],function(card,player,target){
return !target.isLinked()&&player!=target; return !target.isLinked()&&player!=target;
}).ai=function(target){ }).ai=function(target){
@ -2328,7 +2311,7 @@ mode.boss={
} }
if(!event.parent.parent.boss_minbao_logv){ if(!event.parent.parent.boss_minbao_logv){
event.parent.parent.boss_minbao_logv=true; event.parent.parent.boss_minbao_logv=true;
game.logv(trigger.player,'boss_minbao',game.players.slice(0),event.parent.parent); game.logv(trigger.player,'boss_minbao',game.filterPlayer(),event.parent.parent);
} }
} }
}, },
@ -2385,13 +2368,10 @@ mode.boss={
forced:true, forced:true,
logv:false, logv:false,
content:function(){ content:function(){
var targets=[]; var targets=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.num('e');
if(game.players[i].num('e')){ });
player.line(game.players[i],'green'); player.line(targets,'green');
targets.push(game.players[i]);
}
}
game.delay(); game.delay();
game.logv(player,'boss_shanbeng',targets,null,true); game.logv(player,'boss_shanbeng',targets,null,true);
} }
@ -2458,19 +2438,21 @@ mode.boss={
zhanjiang:{ zhanjiang:{
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i]!=player&&game.players[i].num('e','qinggang')){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&players[i].num('e','qinggang')){
return true; return true;
} }
} }
}, },
content:function(){ content:function(){
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++){
var e=game.players[i].get('e','qinggang'); if(players[i]!=player){
var e=players[i].get('e','qinggang');
if(e.length){ if(e.length){
player.gain(e,game.players[i]); player.gain(e,players[i]);
game.players[i].$give(e,player); players[i].$give(e,player);
break; break;
} }
} }
@ -2536,9 +2518,9 @@ mode.boss={
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(get.tag(card,'respondShan')){ if(get.tag(card,'respondShan')){
var hastarget=false; var hastarget=false,players=game.filterPlayer();
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(target,game.players[i])<0){ if(ai.get.attitude(target,players[i])<0){
hastarget=true;break; hastarget=true;break;
} }
} }
@ -2587,10 +2569,9 @@ mode.boss={
forced:true, forced:true,
unique:true, unique:true,
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]!=player&&game.players[i].num('h')) return true; return current!=player&&current.num('h');
} });
return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -2701,9 +2682,10 @@ mode.boss={
event.current.chooseToUse({name:'sha'},function(card,player,target){ event.current.chooseToUse({name:'sha'},function(card,player,target){
if(player==target) return false; if(player==target) return false;
if(get.distance(player,target)<=1) return true; if(get.distance(player,target)<=1) return true;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i]==player) continue; for(var i=0;i<players.length;i++){
if(get.distance(player,game.players[i])<get.distance(player,target)) return false; if(players[i]==player) continue;
if(get.distance(player,players[i])<get.distance(player,target)) return false;
} }
return true; return true;
}) })
@ -2720,9 +2702,9 @@ mode.boss={
result:{ result:{
player:function(player){ player:function(player){
if(player.num('h','shan')) return 1; if(player.num('h','shan')) return 1;
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].canUse('sha',player)&&game.players[i].num('h')>1){ if(players[i].canUse('sha',player)&&players[i].num('h')>1){
num--; num--;
} }
else{ else{
@ -3072,16 +3054,13 @@ mode.boss={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(player.isLinked()) return true; if(player.isLinked()) return true;
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i]!=player&&!game.players[i].isLinked()){ return current!=player&&!current.isLinked();
return true; });
}
}
return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
event.targets=game.players.slice(0); event.targets=game.filterPlayer();
event.targets.remove(player); event.targets.remove(player);
event.targets.sort(lib.sort.seat); event.targets.sort(lib.sort.seat);
if(player.isLinked()) player.link(); if(player.isLinked()) player.link();
@ -3144,12 +3123,9 @@ mode.boss={
forced:true, forced:true,
unique:true, unique:true,
filter:function(){ filter:function(){
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i].isTurnedOver()){ return current.isTurnedOver();
return true; });
}
}
return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -3441,11 +3417,9 @@ mode.boss={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
direct:true, direct:true,
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].hp<game.players[i].maxHp&&player!=game.players[i]){ return current.isDamaged()&&current!=player;
return true; });
}
}
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -3522,8 +3496,9 @@ mode.boss={
if(!player.getStat().skill.qiangxi){ if(!player.getStat().skill.qiangxi){
if(player.hasSkill('qiangxi')&&player.get('e','1')&&list.contains('xuanfeng')) return 'xuanfeng'; if(player.hasSkill('qiangxi')&&player.get('e','1')&&list.contains('xuanfeng')) return 'xuanfeng';
if(list.contains('wansha')||list.contains('qiangxi')){ if(list.contains('wansha')||list.contains('qiangxi')){
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i].hp==1&&ai.get.attitude(player,game.players[i])<0){ for(var i=0;i<players.length;i++){
if(players[i].hp==1&&ai.get.attitude(player,players[i])<0){
if(list.contains('wansha')) return 'wansha'; if(list.contains('wansha')) return 'wansha';
if(list.contains('qiangxi')) return 'qiangxi'; if(list.contains('qiangxi')) return 'qiangxi';
} }
@ -3546,8 +3521,9 @@ mode.boss={
if(!player.getStat().skill.qiangxi){ if(!player.getStat().skill.qiangxi){
if(player.hasSkill('qiangxi')&&player.get('e','1')&&!player.hasSkill('xuanfeng')) return 10; if(player.hasSkill('qiangxi')&&player.get('e','1')&&!player.hasSkill('xuanfeng')) return 10;
if(player.hasSkill('wansha')) return 1; if(player.hasSkill('wansha')) return 1;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i].hp==1&&ai.get.attitude(player,game.players[i])<0) return 10; for(var i=0;i<players.length;i++){
if(players[i].hp==1&&ai.get.attitude(player,players[i])<0) return 10;
} }
} }
return 1; return 1;
@ -3557,8 +3533,9 @@ mode.boss={
if(!player.getStat().skill.qiangxi){ if(!player.getStat().skill.qiangxi){
if(player.hasSkill('qiangxi')&&player.get('e','1')&&!player.hasSkill('xuanfeng')) return 1; if(player.hasSkill('qiangxi')&&player.get('e','1')&&!player.hasSkill('xuanfeng')) return 1;
if(!player.hasSkill('wansha')||!player.hasSkill('qiangxi')){ if(!player.hasSkill('wansha')||!player.hasSkill('qiangxi')){
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i].hp==1&&ai.get.attitude(player,game.players[i])<0) return 1; for(var i=0;i<players.length;i++){
if(players[i].hp==1&&ai.get.attitude(player,players[i])<0) return 1;
} }
} }
} }

View File

@ -3016,12 +3016,9 @@ mode.versus={
boss_mojianjg:{ boss_mojianjg:{
trigger:{player:'phaseUseBegin'}, trigger:{player:'phaseUseBegin'},
content:function(){ content:function(){
var list=[]; var list=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return player.canUse('wanjian',current)&&current.isEnemyOf(player);
if(player.canUse('wanjian',game.players[i])&&game.players[i].isEnemyOf(player)){ });
list.push(game.players[i]);
}
}
list.sort(lib.sort.seat); list.sort(lib.sort.seat);
player.useCard({name:'wanjian'},list); player.useCard({name:'wanjian'},list);
}, },
@ -3035,11 +3032,9 @@ mode.versus={
direct:true, direct:true,
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].isFriendOf(player)&&game.players[i].hp<game.players[i].maxHp){ return current.isFriendOf(player)&&current.isDamaged();
return true; });
}
}
} }
return false; return false;
}, },
@ -3079,16 +3074,13 @@ mode.versus={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
forced:true, forced:true,
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].isEnemyOf(player)&&!game.players[i].isLinked()){ return current.isEnemyOf(player)&&!current.isLinked();
return true; });
}
}
return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
event.targets=game.players.slice(0); event.targets=game.filterPlayer();
event.targets.sort(lib.sort.seat); event.targets.sort(lib.sort.seat);
"step 1" "step 1"
if(event.targets.length){ if(event.targets.length){
@ -3125,18 +3117,16 @@ mode.versus={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
direct:true, direct:true,
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].isFriendOf(player)&&game.players[i].isTurnedOver()){ return current.isFriendOf(player)&&current.isTurnedOver();
return true; });
}
}
return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt('boss_huodi'),function(card,player,target){ player.chooseTarget(get.prompt('boss_huodi'),function(card,player,target){
return !target.isFriendOf(player); return !target.isFriendOf(player);
}).ai=function(target){ }).ai=function(target){
if(target.isTurnedOver()) return 0;
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
}; };
"step 1" "step 1"
@ -3221,19 +3211,15 @@ mode.versus={
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
forced:true, forced:true,
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].isEnemyOf(player)&&game.players[i].num('j')) return true; return current.isEnemyOf(player)&&current.num('j');
} });
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.isEnemyOf(player)&&current.num('j');
if(game.players[i].isEnemyOf(player)&&game.players[i].num('j')){ });
event.targets.push(game.players[i]);
}
}
event.targets.sort(lib.sort.seat); event.targets.sort(lib.sort.seat);
player.line(event.targets,'thunder'); player.line(event.targets,'thunder');
"step 1" "step 1"
@ -3270,12 +3256,9 @@ mode.versus={
forced:true, forced:true,
content:function(){ content:function(){
'step 0' 'step 0'
var targets=[]; var targets=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.isEnemyOf(player);
if(game.players[i].side!=player.side){ });
targets.push(game.players[i]);
}
}
targets.sort(lib.sort.seat); targets.sort(lib.sort.seat);
event.targets=targets; event.targets=targets;
player.line(targets,'thunder'); player.line(targets,'thunder');
@ -3316,9 +3299,10 @@ mode.versus={
mod:{ mod:{
globalFrom:function(from,to,distance){ globalFrom:function(from,to,distance){
if(to.isEnemyOf(from)) return; if(to.isEnemyOf(from)) return;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i].hasSkill('boss_jingfan')&& for(var i=0;i<players.length;i++){
game.players[i].isFriendOf(from)&&game.players[i]!=from){ if(players[i].hasSkill('boss_jingfan')&&
players[i].isFriendOf(from)&&players[i]!=from){
return distance-1; return distance-1;
} }
} }
@ -3329,11 +3313,11 @@ mode.versus={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
check:function(event,player){ check:function(event,player){
if(player.isTurnedOver()) return true; if(player.isTurnedOver()) return true;
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].hp<game.players[i].maxHp&& if(players[i].hp<players[i].maxHp&&
game.players[i].isFriendOf(player)&&ai.get.recoverEffect(game.players[i])>0){ players[i].isFriendOf(player)&&ai.get.recoverEffect(players[i])>0){
if(game.players[i].hp==1){ if(players[i].hp==1){
return true; return true;
} }
num++; num++;
@ -3346,12 +3330,9 @@ mode.versus={
'step 0' 'step 0'
player.turnOver(); player.turnOver();
'step 1' 'step 1'
var list=[]; var list=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.isDamaged()&&current.isFriendOf(player);
if(game.players[i].hp<game.players[i].maxHp&&game.players[i].isFriendOf(player)){ });
list.push(game.players[i]);
}
}
player.line(list,'green'); player.line(list,'green');
event.targets=list; event.targets=list;
'step 2' 'step 2'
@ -3379,9 +3360,10 @@ mode.versus={
mod:{ mod:{
globalTo:function(from,to,distance){ globalTo:function(from,to,distance){
if(to.isFriendOf(from)) return; if(to.isFriendOf(from)) return;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i].hasSkill('boss_zhenwei')&& for(var i=0;i<players.length;i++){
game.players[i].isFriendOf(to)&&game.players[i]!=to){ if(players[i].hasSkill('boss_zhenwei')&&
players[i].isFriendOf(to)&&players[i]!=to){
return distance+1; return distance+1;
} }
} }
@ -3394,19 +3376,17 @@ mode.versus={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(_status.mode!='jiange') return false; if(_status.mode!='jiange') return false;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i].type=='mech'&&game.players[i].isEnemyOf(player)){ for(var i=0;i<players.length;i++){
if(players[i].type=='mech'&&players[i].isEnemyOf(player)){
return true; return true;
} }
} }
}, },
content:function(){ content:function(){
var target; var target=game.findPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.type=='mech'&&current.isEnemyOf(player);
if(game.players[i].type=='mech'&&game.players[i].isEnemyOf(player)){ });
target=game.players[i];break;
}
}
if(target){ if(target){
player.line(target,'thunder'); player.line(target,'thunder');
target.damage(2,'thunder'); target.damage(2,'thunder');
@ -3429,10 +3409,10 @@ mode.versus={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
check:function(event,player){ check:function(event,player){
if(player.isTurnedOver()) return true; if(player.isTurnedOver()) return true;
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].isEnemyOf(player)){ if(players[i].isEnemyOf(player)){
var es=game.players[i].get('e'); var es=players[i].get('e');
for(var j=0;j<es.length;j++){ for(var j=0;j<es.length;j++){
switch(get.subtype(es[j])){ switch(get.subtype(es[j])){
case 'equip1':num+=1;break; case 'equip1':num+=1;break;
@ -3445,8 +3425,8 @@ mode.versus={
} }
} }
if(_status.mode=='jiange'){ if(_status.mode=='jiange'){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(game.players[i].isFriendOf(player)&&game.players[i].hasSkill('huodi')){ if(players[i].isFriendOf(player)&&players[i].hasSkill('huodi')){
return num>0; return num>0;
} }
} }
@ -3454,8 +3434,9 @@ mode.versus={
return num>=4; return num>=4;
}, },
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i].isEnemyOf(player)&&game.players[i].num('e')){ for(var i=0;i<players.length;i++){
if(players[i].isEnemyOf(player)&&players[i].num('e')){
return true; return true;
} }
} }
@ -3505,22 +3486,16 @@ mode.versus={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
var nh=player.num('h'); var nh=player.num('h');
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i].isEnemyOf(player)&&game.players[i].num('h')>nh){ return current.isEnemyOf(player)&&current.num('h')>nh;
return true; });
}
}
return false;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var targets=[];
var nh=player.num('h'); var nh=player.num('h');
for(var i=0;i<game.players.length;i++){ var targets=game.filterPlayer(function(current){
if(game.players[i].isEnemyOf(player)&&game.players[i].num('h')>nh){ return current.isEnemyOf(player)&&current.num('h')>nh;
targets.push(game.players[i]); });
}
}
targets.sort(lib.sort.seat); targets.sort(lib.sort.seat);
event.targets=targets; event.targets=targets;
'step 1' 'step 1'
@ -3547,27 +3522,28 @@ mode.versus={
mode:['versus'], mode:['versus'],
filter:function(event,player){ filter:function(event,player){
if(_status.mode!='jiange') return false; if(_status.mode!='jiange') return false;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(game.players[i].type=='mech'){ for(var i=0;i<players.length;i++){
if(game.players[i].isEnemyOf(player)) return true; if(players[i].type=='mech'){
if(game.players[i].hp<game.players[i].maxHp) return true; if(players[i].isEnemyOf(player)) return true;
if(players[i].hp<players[i].maxHp) return true;
} }
} }
return false; return false;
}, },
content:function(){ content:function(){
var enemy; var enemy,players=game.filterPlayer();
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(game.players[i].type=='mech'){ if(players[i].type=='mech'){
if(game.players[i].isFriendOf(player)){ if(players[i].isFriendOf(player)){
if(game.players[i].hp<game.players[i].maxHp){ if(players[i].hp<players[i].maxHp){
player.line(game.players[i],'green'); player.line(players[i],'green');
game.players[i].recover(); players[i].recover();
return; return;
} }
} }
else{ else{
enemy=game.players[i]; enemy=players[i];
} }
} }
} }
@ -3695,25 +3671,25 @@ mode.versus={
return -1; return -1;
}); });
"step 1" "step 1"
var targets=[]; var targets=[],players=game.filterPlayer();
if(result.color=='red'){ if(result.color=='red'){
game.trySkillAudio('boss_biantianx2'); game.trySkillAudio('boss_biantianx2');
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(!game.players[i].isFriendOf(player)){ if(!players[i].isFriendOf(player)){
game.players[i].addSkill('boss_biantian3'); players[i].addSkill('boss_biantian3');
game.players[i].popup('kuangfeng'); players[i].popup('kuangfeng');
targets.push(game.players[i]); targets.push(players[i]);
} }
} }
player.logSkill('kuangfeng',targets,'fire'); player.logSkill('kuangfeng',targets,'fire');
} }
else if(result.suit=='spade'){ else if(result.suit=='spade'){
game.trySkillAudio('boss_biantianx1'); game.trySkillAudio('boss_biantianx1');
for(var i=0;i<game.players.length;i++){ for(var i=0;i<players.length;i++){
if(game.players[i].isFriendOf(player)){ if(players[i].isFriendOf(player)){
game.players[i].addSkill('boss_biantian2'); players[i].addSkill('boss_biantian2');
game.players[i].popup('dawu'); players[i].popup('dawu');
targets.push(game.players[i]); targets.push(players[i]);
} }
} }
player.logSkill('dawu',targets,'thunder'); player.logSkill('dawu',targets,'thunder');
@ -3778,20 +3754,14 @@ mode.versus={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
forced:true, forced:true,
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].isFriendOf(player)&&game.players[i].hp<game.players[i].maxHp){ return current.isFriendOf(player)&&current.isDamaged();
return true; });
}
}
return false;
}, },
content:function(){ content:function(){
var list=[]; var list=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.isFriendOf(player)&&current.isDamaged();
if(game.players[i].isFriendOf(player)&&game.players[i].hp<game.players[i].maxHp){ });
list.push(game.players[i]);
}
}
if(list.length){ if(list.length){
player.line(list,'green'); player.line(list,'green');
game.asyncDraw(list); game.asyncDraw(list);