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'},
position:'he',
viewAs:{name:'tao'},
viewAsFilter:function(player){
return player.num('he',{suit:'heart'})>0;
},
prompt:'将一张红桃牌当桃使用',
check:function(card){return 10-ai.get.value(card)},
ai:{

View File

@ -4446,7 +4446,7 @@ card.swd={
},
ai:{
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:{

View File

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

View File

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

View File

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

View File

@ -5627,6 +5627,23 @@
window.lib=lib;
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(){
ui.arena.classList.remove('observe');
},
@ -27409,7 +27426,7 @@
if(update.version!=lib.version||dev){
var files=null;
var version=lib.version;
if(Array.isArray(update.files)&&update.update&&!dev){
if(Array.isArray(update.files)&&update.update){
var version1=version.split('.');
var version2=update.update.split('.');
for(var i=0;i<version1.length&&i<version2.length;i++){

View File

@ -1137,10 +1137,9 @@ mode.boss={
return event.name=='loseHp';
},
x3:function(player,event){
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('e')>=4) return true;
}
return false;
return game.hasPlayer(function(current){
return current!=player&&current.num('e')>=4;
});
},
x2:function(player){
return player.num('j')>=2;
@ -1192,7 +1191,7 @@ mode.boss={
event.finish();
}
'step 1'
var list=game.players.slice(0);
var list=game.filterPlayer();
list.remove(player);
list.sort(lib.sort.seat);
var list2=[];
@ -1275,21 +1274,16 @@ mode.boss={
var info=lib.card[name];
var card=game.createCard(name);
if(info.selectTarget==-1){
var targets=[];
for(var i=0;i<game.players.length;i++){
if(lib.filter.filterTarget(card,player,game.players[i])){
targets.push(game.players[i]);
}
}
var targets=game.filterPlayer(function(current){
return lib.filter.filterTarget(card,player,current);
});
if(targets.length){
targets.sort(lib.sort.seat);
// player.addTempSkill('fengqi2',{player:'useCardAfter'});
player.useCard(card,targets);
}
event.finish();
}
else if(info.notarget){
// player.addTempSkill('fengqi2',{player:'useCardAfter'});
player.useCard(card);
}
else{
@ -2087,12 +2081,9 @@ mode.boss={
boss_mojian:{
trigger:{player:'phaseUseBegin'},
content:function(){
var list=[];
for(var i=0;i<game.players.length;i++){
if(player.canUse('wanjian',game.players[i])&&game.players[i].isEnemyOf(player)){
list.push(game.players[i]);
}
}
var list=game.filterPlayer(function(current){
return player.canUse('wanjian',current)&&current.isEnemyOf(player);
});
list.sort(lib.sort.seat);
player.useCard({name:'wanjian'},list);
},
@ -2103,12 +2094,9 @@ mode.boss={
boss_yushou:{
trigger:{player:'phaseUseBegin'},
content:function(){
var list=[];
for(var i=0;i<game.players.length;i++){
if(player.canUse('nanman',game.players[i])){
list.push(game.players[i]);
}
}
var list=game.filterPlayer(function(current){
return player.canUse('nanman',current)&&current.isEnemyOf(player);
});
list.sort(lib.sort.seat);
player.useCard({name:'nanman'},list);
}
@ -2146,20 +2134,15 @@ mode.boss={
trigger:{player:'phaseEnd'},
direct:true,
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(!game.players[i].isLinked()&&player!=game.players[i]){
return true;
}
}
return game.hasPlayer(function(current){
return current!=player&&!current.isLinked();
});
},
content:function(){
"step 0"
var num=0;
for(var i=0;i<game.players.length;i++){
if(!game.players[i].isLinked()&&player!=game.players[i]){
num++;
}
}
var num=game.countPlayer(function(current){
return current!=player&&!current.isLinked();
});
player.chooseTarget(get.prompt('boss_suoming'),[1,num],function(card,player,target){
return !target.isLinked()&&player!=target;
}).ai=function(target){
@ -2328,7 +2311,7 @@ mode.boss={
}
if(!event.parent.parent.boss_minbao_logv){
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,
logv:false,
content:function(){
var targets=[];
for(var i=0;i<game.players.length;i++){
if(game.players[i].num('e')){
player.line(game.players[i],'green');
targets.push(game.players[i]);
}
}
var targets=game.filterPlayer(function(current){
return current.num('e');
});
player.line(targets,'green');
game.delay();
game.logv(player,'boss_shanbeng',targets,null,true);
}
@ -2458,19 +2438,21 @@ mode.boss={
zhanjiang:{
trigger:{player:'phaseBegin'},
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('e','qinggang')){
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i]!=player&&players[i].num('e','qinggang')){
return true;
}
}
},
content:function(){
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player){
var e=game.players[i].get('e','qinggang');
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i]!=player){
var e=players[i].get('e','qinggang');
if(e.length){
player.gain(e,game.players[i]);
game.players[i].$give(e,player);
player.gain(e,players[i]);
players[i].$give(e,player);
break;
}
}
@ -2536,9 +2518,9 @@ mode.boss={
effect:{
target:function(card,player,target,current){
if(get.tag(card,'respondShan')){
var hastarget=false;
for(var i=0;i<game.players.length;i++){
if(ai.get.attitude(target,game.players[i])<0){
var hastarget=false,players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(ai.get.attitude(target,players[i])<0){
hastarget=true;break;
}
}
@ -2587,10 +2569,9 @@ mode.boss={
forced:true,
unique:true,
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('h')) return true;
}
return false;
return game.hasPlayer(function(current){
return current!=player&&current.num('h');
});
},
content:function(){
"step 0"
@ -2701,9 +2682,10 @@ mode.boss={
event.current.chooseToUse({name:'sha'},function(card,player,target){
if(player==target) return false;
if(get.distance(player,target)<=1) return true;
for(var i=0;i<game.players.length;i++){
if(game.players[i]==player) continue;
if(get.distance(player,game.players[i])<get.distance(player,target)) return false;
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i]==player) continue;
if(get.distance(player,players[i])<get.distance(player,target)) return false;
}
return true;
})
@ -2720,9 +2702,9 @@ mode.boss={
result:{
player:function(player){
if(player.num('h','shan')) return 1;
var num=0;
for(var i=0;i<game.players.length;i++){
if(game.players[i].canUse('sha',player)&&game.players[i].num('h')>1){
var num=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].canUse('sha',player)&&players[i].num('h')>1){
num--;
}
else{
@ -3072,16 +3054,13 @@ mode.boss={
forced:true,
filter:function(event,player){
if(player.isLinked()) return true;
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&!game.players[i].isLinked()){
return true;
}
}
return false;
return game.hasPlayer(function(current){
return current!=player&&!current.isLinked();
});
},
content:function(){
"step 0"
event.targets=game.players.slice(0);
event.targets=game.filterPlayer();
event.targets.remove(player);
event.targets.sort(lib.sort.seat);
if(player.isLinked()) player.link();
@ -3144,12 +3123,9 @@ mode.boss={
forced:true,
unique:true,
filter:function(){
for(var i=0;i<game.players.length;i++){
if(game.players[i].isTurnedOver()){
return true;
}
}
return false;
return game.hasPlayer(function(current){
return current.isTurnedOver();
});
},
content:function(){
"step 0"
@ -3441,11 +3417,9 @@ mode.boss={
trigger:{player:'phaseEnd'},
direct:true,
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(game.players[i].hp<game.players[i].maxHp&&player!=game.players[i]){
return true;
}
}
return game.hasPlayer(function(current){
return current.isDamaged()&&current!=player;
});
},
content:function(){
"step 0"
@ -3522,8 +3496,9 @@ mode.boss={
if(!player.getStat().skill.qiangxi){
if(player.hasSkill('qiangxi')&&player.get('e','1')&&list.contains('xuanfeng')) return 'xuanfeng';
if(list.contains('wansha')||list.contains('qiangxi')){
for(var i=0;i<game.players.length;i++){
if(game.players[i].hp==1&&ai.get.attitude(player,game.players[i])<0){
var players=game.filterPlayer();
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('qiangxi')) return 'qiangxi';
}
@ -3546,8 +3521,9 @@ mode.boss={
if(!player.getStat().skill.qiangxi){
if(player.hasSkill('qiangxi')&&player.get('e','1')&&!player.hasSkill('xuanfeng')) return 10;
if(player.hasSkill('wansha')) return 1;
for(var i=0;i<game.players.length;i++){
if(game.players[i].hp==1&&ai.get.attitude(player,game.players[i])<0) return 10;
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].hp==1&&ai.get.attitude(player,players[i])<0) return 10;
}
}
return 1;
@ -3557,8 +3533,9 @@ mode.boss={
if(!player.getStat().skill.qiangxi){
if(player.hasSkill('qiangxi')&&player.get('e','1')&&!player.hasSkill('xuanfeng')) return 1;
if(!player.hasSkill('wansha')||!player.hasSkill('qiangxi')){
for(var i=0;i<game.players.length;i++){
if(game.players[i].hp==1&&ai.get.attitude(player,game.players[i])<0) return 1;
var players=game.filterPlayer();
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:{
trigger:{player:'phaseUseBegin'},
content:function(){
var list=[];
for(var i=0;i<game.players.length;i++){
if(player.canUse('wanjian',game.players[i])&&game.players[i].isEnemyOf(player)){
list.push(game.players[i]);
}
}
var list=game.filterPlayer(function(current){
return player.canUse('wanjian',current)&&current.isEnemyOf(player);
});
list.sort(lib.sort.seat);
player.useCard({name:'wanjian'},list);
},
@ -3035,11 +3032,9 @@ mode.versus={
direct:true,
filter:function(event,player){
if(get.suit(event.card)=='club'){
for(var i=0;i<game.players.length;i++){
if(game.players[i].isFriendOf(player)&&game.players[i].hp<game.players[i].maxHp){
return true;
}
}
return game.hasPlayer(function(current){
return current.isFriendOf(player)&&current.isDamaged();
});
}
return false;
},
@ -3079,16 +3074,13 @@ mode.versus={
trigger:{player:'phaseEnd'},
forced:true,
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(game.players[i].isEnemyOf(player)&&!game.players[i].isLinked()){
return true;
}
}
return false;
return game.hasPlayer(function(current){
return current.isEnemyOf(player)&&!current.isLinked();
});
},
content:function(){
"step 0"
event.targets=game.players.slice(0);
event.targets=game.filterPlayer();
event.targets.sort(lib.sort.seat);
"step 1"
if(event.targets.length){
@ -3125,18 +3117,16 @@ mode.versus={
trigger:{player:'phaseEnd'},
direct:true,
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(game.players[i].isFriendOf(player)&&game.players[i].isTurnedOver()){
return true;
}
}
return false;
return game.hasPlayer(function(current){
return current.isFriendOf(player)&&current.isTurnedOver();
});
},
content:function(){
"step 0"
player.chooseTarget(get.prompt('boss_huodi'),function(card,player,target){
return !target.isFriendOf(player);
}).ai=function(target){
if(target.isTurnedOver()) return 0;
return -ai.get.attitude(player,target);
};
"step 1"
@ -3221,19 +3211,15 @@ mode.versus={
trigger:{player:'phaseBegin'},
forced:true,
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(game.players[i].isEnemyOf(player)&&game.players[i].num('j')) return true;
}
return false;
return game.hasPlayer(function(current){
return current.isEnemyOf(player)&&current.num('j');
});
},
content:function(){
"step 0"
event.targets=[];
for(var i=0;i<game.players.length;i++){
if(game.players[i].isEnemyOf(player)&&game.players[i].num('j')){
event.targets.push(game.players[i]);
}
}
event.targets=game.filterPlayer(function(current){
return current.isEnemyOf(player)&&current.num('j');
});
event.targets.sort(lib.sort.seat);
player.line(event.targets,'thunder');
"step 1"
@ -3270,12 +3256,9 @@ mode.versus={
forced:true,
content:function(){
'step 0'
var targets=[];
for(var i=0;i<game.players.length;i++){
if(game.players[i].side!=player.side){
targets.push(game.players[i]);
}
}
var targets=game.filterPlayer(function(current){
return current.isEnemyOf(player);
});
targets.sort(lib.sort.seat);
event.targets=targets;
player.line(targets,'thunder');
@ -3316,9 +3299,10 @@ mode.versus={
mod:{
globalFrom:function(from,to,distance){
if(to.isEnemyOf(from)) return;
for(var i=0;i<game.players.length;i++){
if(game.players[i].hasSkill('boss_jingfan')&&
game.players[i].isFriendOf(from)&&game.players[i]!=from){
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].hasSkill('boss_jingfan')&&
players[i].isFriendOf(from)&&players[i]!=from){
return distance-1;
}
}
@ -3329,11 +3313,11 @@ mode.versus={
trigger:{player:'phaseEnd'},
check:function(event,player){
if(player.isTurnedOver()) return true;
var num=0;
for(var i=0;i<game.players.length;i++){
if(game.players[i].hp<game.players[i].maxHp&&
game.players[i].isFriendOf(player)&&ai.get.recoverEffect(game.players[i])>0){
if(game.players[i].hp==1){
var num=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].hp<players[i].maxHp&&
players[i].isFriendOf(player)&&ai.get.recoverEffect(players[i])>0){
if(players[i].hp==1){
return true;
}
num++;
@ -3346,12 +3330,9 @@ mode.versus={
'step 0'
player.turnOver();
'step 1'
var list=[];
for(var i=0;i<game.players.length;i++){
if(game.players[i].hp<game.players[i].maxHp&&game.players[i].isFriendOf(player)){
list.push(game.players[i]);
}
}
var list=game.filterPlayer(function(current){
return current.isDamaged()&&current.isFriendOf(player);
});
player.line(list,'green');
event.targets=list;
'step 2'
@ -3379,9 +3360,10 @@ mode.versus={
mod:{
globalTo:function(from,to,distance){
if(to.isFriendOf(from)) return;
for(var i=0;i<game.players.length;i++){
if(game.players[i].hasSkill('boss_zhenwei')&&
game.players[i].isFriendOf(to)&&game.players[i]!=to){
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].hasSkill('boss_zhenwei')&&
players[i].isFriendOf(to)&&players[i]!=to){
return distance+1;
}
}
@ -3394,19 +3376,17 @@ mode.versus={
forced:true,
filter:function(event,player){
if(_status.mode!='jiange') return false;
for(var i=0;i<game.players.length;i++){
if(game.players[i].type=='mech'&&game.players[i].isEnemyOf(player)){
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].type=='mech'&&players[i].isEnemyOf(player)){
return true;
}
}
},
content:function(){
var target;
for(var i=0;i<game.players.length;i++){
if(game.players[i].type=='mech'&&game.players[i].isEnemyOf(player)){
target=game.players[i];break;
}
}
var target=game.findPlayer(function(current){
return current.type=='mech'&&current.isEnemyOf(player);
});
if(target){
player.line(target,'thunder');
target.damage(2,'thunder');
@ -3429,10 +3409,10 @@ mode.versus={
trigger:{player:'phaseEnd'},
check:function(event,player){
if(player.isTurnedOver()) return true;
var num=0;
for(var i=0;i<game.players.length;i++){
if(game.players[i].isEnemyOf(player)){
var es=game.players[i].get('e');
var num=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].isEnemyOf(player)){
var es=players[i].get('e');
for(var j=0;j<es.length;j++){
switch(get.subtype(es[j])){
case 'equip1':num+=1;break;
@ -3445,8 +3425,8 @@ mode.versus={
}
}
if(_status.mode=='jiange'){
for(var i=0;i<game.players.length;i++){
if(game.players[i].isFriendOf(player)&&game.players[i].hasSkill('huodi')){
for(var i=0;i<players.length;i++){
if(players[i].isFriendOf(player)&&players[i].hasSkill('huodi')){
return num>0;
}
}
@ -3454,8 +3434,9 @@ mode.versus={
return num>=4;
},
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(game.players[i].isEnemyOf(player)&&game.players[i].num('e')){
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].isEnemyOf(player)&&players[i].num('e')){
return true;
}
}
@ -3505,22 +3486,16 @@ mode.versus={
forced:true,
filter:function(event,player){
var nh=player.num('h');
for(var i=0;i<game.players.length;i++){
if(game.players[i].isEnemyOf(player)&&game.players[i].num('h')>nh){
return true;
}
}
return false;
return game.hasPlayer(function(current){
return current.isEnemyOf(player)&&current.num('h')>nh;
});
},
content:function(){
'step 0'
var targets=[];
var nh=player.num('h');
for(var i=0;i<game.players.length;i++){
if(game.players[i].isEnemyOf(player)&&game.players[i].num('h')>nh){
targets.push(game.players[i]);
}
}
var targets=game.filterPlayer(function(current){
return current.isEnemyOf(player)&&current.num('h')>nh;
});
targets.sort(lib.sort.seat);
event.targets=targets;
'step 1'
@ -3547,27 +3522,28 @@ mode.versus={
mode:['versus'],
filter:function(event,player){
if(_status.mode!='jiange') return false;
for(var i=0;i<game.players.length;i++){
if(game.players[i].type=='mech'){
if(game.players[i].isEnemyOf(player)) return true;
if(game.players[i].hp<game.players[i].maxHp) return true;
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].type=='mech'){
if(players[i].isEnemyOf(player)) return true;
if(players[i].hp<players[i].maxHp) return true;
}
}
return false;
},
content:function(){
var enemy;
for(var i=0;i<game.players.length;i++){
if(game.players[i].type=='mech'){
if(game.players[i].isFriendOf(player)){
if(game.players[i].hp<game.players[i].maxHp){
player.line(game.players[i],'green');
game.players[i].recover();
var enemy,players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i].type=='mech'){
if(players[i].isFriendOf(player)){
if(players[i].hp<players[i].maxHp){
player.line(players[i],'green');
players[i].recover();
return;
}
}
else{
enemy=game.players[i];
enemy=players[i];
}
}
}
@ -3695,25 +3671,25 @@ mode.versus={
return -1;
});
"step 1"
var targets=[];
var targets=[],players=game.filterPlayer();
if(result.color=='red'){
game.trySkillAudio('boss_biantianx2');
for(var i=0;i<game.players.length;i++){
if(!game.players[i].isFriendOf(player)){
game.players[i].addSkill('boss_biantian3');
game.players[i].popup('kuangfeng');
targets.push(game.players[i]);
for(var i=0;i<players.length;i++){
if(!players[i].isFriendOf(player)){
players[i].addSkill('boss_biantian3');
players[i].popup('kuangfeng');
targets.push(players[i]);
}
}
player.logSkill('kuangfeng',targets,'fire');
}
else if(result.suit=='spade'){
game.trySkillAudio('boss_biantianx1');
for(var i=0;i<game.players.length;i++){
if(game.players[i].isFriendOf(player)){
game.players[i].addSkill('boss_biantian2');
game.players[i].popup('dawu');
targets.push(game.players[i]);
for(var i=0;i<players.length;i++){
if(players[i].isFriendOf(player)){
players[i].addSkill('boss_biantian2');
players[i].popup('dawu');
targets.push(players[i]);
}
}
player.logSkill('dawu',targets,'thunder');
@ -3778,20 +3754,14 @@ mode.versus={
trigger:{player:'phaseEnd'},
forced:true,
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(game.players[i].isFriendOf(player)&&game.players[i].hp<game.players[i].maxHp){
return true;
}
}
return false;
return game.hasPlayer(function(current){
return current.isFriendOf(player)&&current.isDamaged();
});
},
content:function(){
var list=[];
for(var i=0;i<game.players.length;i++){
if(game.players[i].isFriendOf(player)&&game.players[i].hp<game.players[i].maxHp){
list.push(game.players[i]);
}
}
var list=game.filterPlayer(function(current){
return current.isFriendOf(player)&&current.isDamaged();
});
if(list.length){
player.line(list,'green');
game.asyncDraw(list);