collab.js ~ mobile.js chooseToUse相关技能完成修改
This commit is contained in:
parent
c6817e5095
commit
ee4aee82aa
|
@ -101,10 +101,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
filter(event,player){
|
||||
var filter=event.filterCard;
|
||||
if(filter({name:'sha',nature:'fire'},player,event)&&player.countCards('hes',{suit:'diamond'})) return true;
|
||||
if(filter({name:'shan'},player,event)&&player.countCards('hes',{suit:'club'})) return true;
|
||||
if(filter({name:'tao'},player,event)&&player.countCards('hes',{suit:'heart'})) return true;
|
||||
if(filter({name:'wuxie'},player,event)&&player.countCards('hes',{suit:'spade'})) return true;
|
||||
if(filter(get.autoViewAs({name:'sha',nature:'fire'},'unsure'),player,event)&&player.countCards('hes',{suit:'diamond'})) return true;
|
||||
if(filter(get.autoViewAs({name:'shan'},'unsure'),player,event)&&player.countCards('hes',{suit:'club'})) return true;
|
||||
if(filter(get.autoViewAs({name:'tao'},'unsure'),player,event)&&player.countCards('hes',{suit:'heart'})) return true;
|
||||
if(filter(get.autoViewAs({name:'wuxie'},'unsure'),player,event)&&player.countCards('hes',{suit:'spade'})) return true;
|
||||
return false;
|
||||
},
|
||||
usable:20,
|
||||
|
|
|
@ -2385,8 +2385,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
else wuxie=true;
|
||||
}
|
||||
}
|
||||
if(shan&&event.filterCard({name:'shan'},player,event)) return true;
|
||||
if(wuxie&&event.filterCard({name:'wuxie'},player,event)) return true;
|
||||
if(shan&&event.filterCard(get.autoViewAs({name:'shan'},'unsure'),player,event)) return true;
|
||||
if(wuxie&&event.filterCard(get.autoViewAs({name:'wuxie'},'unsure'),player,event)) return true;
|
||||
return false;
|
||||
},
|
||||
hiddenCard (player,name){
|
||||
|
|
|
@ -1909,6 +1909,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(!Array.isArray(list)||typeof num!='number'||list.length<=num) return false;
|
||||
var card=get.copy(list[num]);
|
||||
delete card.isCard;
|
||||
card=get.autoViewAs(card,'unsure');
|
||||
if(event.filterCard(card,player,event)) return true;
|
||||
return false;
|
||||
},
|
||||
|
@ -2266,10 +2267,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
for(var i of lib.inpile){
|
||||
var type=lib.skill.nsxingyun.getSixiang(i);
|
||||
if(!type||list.includes(type)) continue;
|
||||
if(event.filterCard({name:i},player,event)) return true;
|
||||
if(event.filterCard(get.autoViewAs({name:i},'unsure'),player,event)) return true;
|
||||
if(i=='sha'){
|
||||
for(var j of lib.inpile_nature){
|
||||
if(event.filterCard({name:i,nature:j},player,event)) return true;
|
||||
if(event.filterCard(get.autoViewAs({name:i,nature:j},'unsure'),player,event)) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9508,7 +9509,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(event.type=='wuxie'||!player.countCards('hse',{suit:'diamond'})) return false;
|
||||
for(var i=0;i<lib.inpile.length;i++){
|
||||
var name=lib.inpile[i];
|
||||
if(name!='du'&&name!='shan'&&get.type(name)=='basic'&&event.filterCard({name:name},player,event)) return true;
|
||||
if(name!='du'&&name!='shan'&&get.type(name)=='basic'&&event.filterCard(get.autoViewAs({name:name},'unsure'),player,event)) return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
|
|
@ -2511,16 +2511,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(event.responded||event.shouli||event.type=='wuxie') return false;
|
||||
if(game.hasPlayer(function(current){
|
||||
return current.getCards('e',card=>get.is.attackingMount(card)).length>0;
|
||||
})&&event.filterCard({
|
||||
})&&event.filterCard(get.autoViewAs({
|
||||
name:'sha',
|
||||
storage:{shouli:true},
|
||||
},player,event)) return true;
|
||||
},'unsure'),player,event)) return true;
|
||||
if(game.hasPlayer(function(current){
|
||||
return current.getCards('e',card=>get.is.defendingMount(card)).length>0;
|
||||
})&&event.filterCard({
|
||||
})&&event.filterCard(get.autoViewAs({
|
||||
name:'shan',
|
||||
storage:{shouli:true},
|
||||
},player,event)) return true;
|
||||
},'unsure'),player,event)) return true;
|
||||
return false;
|
||||
},
|
||||
delay:false,
|
||||
|
@ -6890,13 +6890,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
//获取当前时机的卡牌选择限制
|
||||
var filter=event.filterCard;
|
||||
//如果当前时机能够使用/打出火杀并且角色有方片 那么可以发动技能
|
||||
if(filter({name:'sha',nature:'fire'},player,event)&&player.countCards('hes',{suit:'diamond'})) return true;
|
||||
if(filter(get.autoViewAs({name:'sha',nature:'fire'},'unsure'),player,event)&&player.countCards('hes',{suit:'diamond'})) return true;
|
||||
//如果当前时机能够使用/打出闪并且角色有梅花 那么可以发动技能
|
||||
if(filter({name:'shan'},player,event)&&player.countCards('hes',{suit:'club'})) return true;
|
||||
if(filter(get.autoViewAs({name:'shan'},'unsure'),player,event)&&player.countCards('hes',{suit:'club'})) return true;
|
||||
//如果当前时机能够使用/打出桃并且角色有红桃 那么可以发动技能
|
||||
if(filter({name:'tao'},player,event)&&player.countCards('hes',{suit:'heart'})) return true;
|
||||
if(filter(get.autoViewAs({name:'tao'},'unsure'),player,event)&&player.countCards('hes',{suit:'heart'})) return true;
|
||||
//如果当前时机能够使用/打出无懈可击并且角色有黑桃 那么可以发动技能
|
||||
if(filter({name:'wuxie'},player,event)&&player.countCards('hes',{suit:'spade'})) return true;
|
||||
if(filter(get.autoViewAs({name:'wuxie'},'unsure'),player,event)&&player.countCards('hes',{suit:'spade'})) return true;
|
||||
return false;
|
||||
},
|
||||
ai:{
|
||||
|
@ -7029,10 +7029,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
filter(event,player){
|
||||
var filter=event.filterCard;
|
||||
if(filter({name:'sha',nature:'fire'},player,event)&&player.countCards('hs',{suit:'diamond'})) return true;
|
||||
if(filter({name:'shan'},player,event)&&player.countCards('hs',{suit:'club'})) return true;
|
||||
if(filter({name:'tao'},player,event)&&player.countCards('hs',{suit:'heart'})) return true;
|
||||
if(filter({name:'wuxie'},player,event)&&player.countCards('hs',{suit:'spade'})) return true;
|
||||
if(filter(get.autoViewAs({name:'sha',nature:'fire'},'unsure'),player,event)&&player.countCards('hs',{suit:'diamond'})) return true;
|
||||
if(filter(get.autoViewAs({name:'shan'},'unsure'),player,event)&&player.countCards('hs',{suit:'club'})) return true;
|
||||
if(filter(get.autoViewAs({name:'tao'},'unsure'),player,event)&&player.countCards('hs',{suit:'heart'})) return true;
|
||||
if(filter(get.autoViewAs({name:'wuxie'},'unsure'),player,event)&&player.countCards('hs',{suit:'spade'})) return true;
|
||||
return false;
|
||||
},
|
||||
precontent(){
|
||||
|
|
|
@ -8885,7 +8885,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(!player.hasCard((card)=>(get.type(card)!='basic'),'ehs')) return false;
|
||||
for(var i of list){
|
||||
var type=get.type2(i,false);
|
||||
if((type=='basic'||type=='trick')&&event.filterCard({name:i},player,event)) return true;
|
||||
if((type=='basic'||type=='trick')&&event.filterCard(get.autoViewAs({name:i},'unsure'),player,event)) return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
@ -8896,7 +8896,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var list2=[];
|
||||
for(var i of list){
|
||||
var type=get.type2(i,false);
|
||||
if((type=='basic'||type=='trick')&&event.filterCard({name:i},player,event)) list2.push([type,'',i]);
|
||||
if((type=='basic'||type=='trick')&&event.filterCard(get.autoViewAs({name:i},'unsure'),player,event)) list2.push([type,'',i]);
|
||||
}
|
||||
return ui.create.dialog('浮萍',[list2,'vcard']);
|
||||
},
|
||||
|
@ -8912,7 +8912,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
popname:true,
|
||||
viewAs:{
|
||||
name:links[0][2],
|
||||
isCard:true,
|
||||
},
|
||||
check:function(card){
|
||||
return 8-get.value(card);
|
||||
|
|
|
@ -235,7 +235,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
enable:'chooseToUse',
|
||||
filter:function(event,player){
|
||||
for(const name of ['wuxie','huogong']){
|
||||
if(event.filterCard({name},player,event)) return true;
|
||||
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
@ -246,7 +246,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
viewAs:function(cards,player){
|
||||
const event=get.event(),filter=event._backup.filterCard;
|
||||
for(const name of ['wuxie','huogong']){
|
||||
if(filter({name},player,event)) return {name};
|
||||
if(filter(get.autoViewAs({name},'unsure'),player,event)) return {name};
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
@ -810,14 +810,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
})) return false;
|
||||
return get.inpileVCardList(info=>{
|
||||
if(info[0]!='basic') return false;
|
||||
return event.filterCard({name:info[2],nature:info[3]},player,event);
|
||||
return event.filterCard(get.autoViewAs({name:info[2],nature:info[3]},'unsure'),player,event);
|
||||
}).length;
|
||||
},
|
||||
chooseButton:{
|
||||
dialog(event,player){
|
||||
const vcards=get.inpileVCardList(info=>{
|
||||
if(info[0]!='basic') return false;
|
||||
return event.filterCard({name:info[2],nature:info[3]},player,event);
|
||||
return event.filterCard(get.autoViewAs({name:info[2],nature:info[3]},'unsure'),player,event);
|
||||
});
|
||||
return ui.create.dialog('镇胆',[vcards,'vcard']);
|
||||
},
|
||||
|
@ -1277,14 +1277,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
})) return false;
|
||||
return get.inpileVCardList(info=>{
|
||||
if(info[0]!='basic') return false;
|
||||
return event.filterCard({name:info[2],nature:info[3]},player,event);
|
||||
return event.filterCard(get.autoViewAs({name:info[2],nature:info[3]},'unsure'),player,event);
|
||||
}).length;
|
||||
},
|
||||
chooseButton:{
|
||||
dialog:function(event,player){
|
||||
const vcards=get.inpileVCardList(info=>{
|
||||
if(info[0]!='basic') return false;
|
||||
return event.filterCard({name:info[2],nature:info[3]},player,event);
|
||||
return event.filterCard(get.autoViewAs({name:info[2],nature:info[3]},'unsure'),player,event);
|
||||
});
|
||||
return ui.create.dialog('惊惧',[vcards,'vcard'],'hidden');
|
||||
},
|
||||
|
@ -4759,11 +4759,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
for(var name of lib.inpile){
|
||||
if(get.type2(name)!='basic') continue;
|
||||
var card={name:name};
|
||||
if(event.filterCard(card,player,event)) return true;
|
||||
if(event.filterCard(get.autoViewAs(card,'unsure'),player,event)) return true;
|
||||
if(name=='sha'){
|
||||
for(var nature of lib.inpile_nature){
|
||||
card.nature=nature;
|
||||
if(event.filterCard(card,player,event)) return true;
|
||||
if(event.filterCard(get.autoViewAs(card,'unsure'),player,event)) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4775,19 +4775,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var list=[];
|
||||
for(var name of lib.inpile){
|
||||
if(name=='sha'){
|
||||
if(event.filterCard({name:name},player,event)) list.push(['基本','','sha']);
|
||||
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','','sha']);
|
||||
for(var nature of lib.inpile_nature){
|
||||
if(event.filterCard({name:name,nature:nature},player,event)) list.push(['基本','','sha',nature]);
|
||||
if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',nature]);
|
||||
}
|
||||
}
|
||||
else if(get.type(name)=='basic'&&event.filterCard({name:name},player,event)) list.push(['基本','',name]);
|
||||
else if(get.type(name)=='basic'&&event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','',name]);
|
||||
}
|
||||
var dialog=ui.create.dialog('念恩',[list,'vcard']);
|
||||
dialog.direct=true;
|
||||
return dialog;
|
||||
},
|
||||
filter:function(button,player){
|
||||
return _status.event.getParent().filterCard({name:button.link[2],nature:button.link[3]},player,_status.event.getParent());
|
||||
return _status.event.getParent().filterCard(get.autoViewAs({name:button.link[2],nature:button.link[3]},'unsure'),player,_status.event.getParent());
|
||||
},
|
||||
check:function(button){
|
||||
if(_status.event.getParent().type!='phase') return 1;
|
||||
|
@ -5035,7 +5035,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
for(var name of lib.inpile){
|
||||
if(get.type(name)!='basic') continue;
|
||||
if(player.getStorage('jsrgjixiang_used').includes(name)) continue;
|
||||
var card={name:name};
|
||||
var card={name:name,isCard:true};
|
||||
if(event.filterCard(card,event.player,event)) return true;
|
||||
if(name=='sha'){
|
||||
for(var nature of lib.inpile_nature){
|
||||
|
|
|
@ -3222,10 +3222,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
filter:function(event,player){
|
||||
var filter=event.filterCard;
|
||||
if(filter({name:'sha',nature:'fire'},player,event)&&player.countCards('hes',{suit:'diamond'})) return true;
|
||||
if(filter({name:'shan'},player,event)&&player.countCards('hes',{suit:'club'})) return true;
|
||||
if(filter({name:'tao'},player,event)&&player.countCards('hes',{suit:'heart'})) return true;
|
||||
if(filter({name:'wuxie'},player,event)&&player.countCards('hes',{suit:'spade'})) return true;
|
||||
if(filter(get.autoViewAs({name:'sha',nature:'fire'},'unsure'),player,event)&&player.countCards('hes',{suit:'diamond'})) return true;
|
||||
if(filter(get.autoViewAs({name:'shan'},'unsure'),player,event)&&player.countCards('hes',{suit:'club'})) return true;
|
||||
if(filter(get.autoViewAs({name:'tao'},'unsure'),player,event)&&player.countCards('hes',{suit:'heart'})) return true;
|
||||
if(filter(get.autoViewAs({name:'wuxie'},'unsure'),player,event)&&player.countCards('hes',{suit:'spade'})) return true;
|
||||
return false;
|
||||
},
|
||||
precontent:function(){
|
||||
|
@ -3399,10 +3399,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
filter:function(event,player){
|
||||
var filter=event.filterCard;
|
||||
if(filter({name:'sha',nature:'fire'},player,event)&&player.countCards('hes',{suit:'diamond'})) return true;
|
||||
if(filter({name:'shan'},player,event)&&player.countCards('hes',{suit:'club'})) return true;
|
||||
if(filter({name:'tao'},player,event)&&player.countCards('hes',{suit:'heart'})) return true;
|
||||
if(filter({name:'wuxie'},player,event)&&player.countCards('hes',{suit:'spade'})) return true;
|
||||
if(filter(get.autoViewAs({name:'sha',nature:'fire'},'unsure'),player,event)&&player.countCards('hes',{suit:'diamond'})) return true;
|
||||
if(filter(get.autoViewAs({name:'shan'},'unsure'),player,event)&&player.countCards('hes',{suit:'club'})) return true;
|
||||
if(filter(get.autoViewAs({name:'tao'},'unsure'),player,event)&&player.countCards('hes',{suit:'heart'})) return true;
|
||||
if(filter(get.autoViewAs({name:'wuxie'},'unsure'),player,event)&&player.countCards('hes',{suit:'spade'})) return true;
|
||||
return false;
|
||||
},
|
||||
precontent:function(){
|
||||
|
@ -6634,19 +6634,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
audio:2,
|
||||
enable:['chooseToUse','chooseToRespond'],
|
||||
filter:function(event,player){
|
||||
return player.getExpansions('jibing').length>0&&(event.filterCard({name:'sha'},player,event)||event.filterCard({name:'shan'},player,event));
|
||||
return player.getExpansions('jibing').length>0&&(event.filterCard(get.autoViewAs({name:'sha'},'unsure'),player,event)||event.filterCard(get.autoViewAs({name:'shan'},'unsure'),player,event));
|
||||
},
|
||||
chooseButton:{
|
||||
dialog:function(event,player){
|
||||
var dialog=ui.create.dialog('集兵','hidden');
|
||||
if(event.filterCard({name:'sha'},player,event)&&event.filterCard({name:'shan'},player,event)){
|
||||
if(event.filterCard(get.autoViewAs({name:'sha'},'unsure'),player,event)&&event.filterCard(get.autoViewAs({name:'shan'},'unsure'),player,event)){
|
||||
dialog._chooseButton=2;
|
||||
var list=['sha','shan'];
|
||||
dialog.add([list.map(i=>{
|
||||
return [i,get.translation(i)];
|
||||
}),'tdnodes']);
|
||||
}
|
||||
else dialog._cardName=event.filterCard({name:'sha'},player,event)?'sha':'shan';
|
||||
else dialog._cardName=event.filterCard(get.autoViewAs({name:'sha'},'unsure'),player,event)?'sha':'shan';
|
||||
dialog.add(player.getExpansions('jibing'));
|
||||
return dialog;
|
||||
},
|
||||
|
@ -13279,7 +13279,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},'hs')) return false;
|
||||
for(var name of lib.inpile){
|
||||
if(get.type(name)!='basic') continue;
|
||||
if(event.filterCard({name:name},player,event)) return true;
|
||||
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
@ -13288,7 +13288,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var list=[];
|
||||
for(var name of lib.inpile){
|
||||
if(get.type(name)!='basic') continue;
|
||||
if(event.filterCard({name:name},player,event)) list.push(['基本','',name]);
|
||||
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','',name]);
|
||||
if(name!='sha') continue;
|
||||
for(var j of lib.inpile_nature){
|
||||
if(event.filterCard({name:name,nature:j},player,event)) list.push(['基本','','sha',j]);
|
||||
|
@ -14298,10 +14298,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},'hs')) return false;
|
||||
for(var name of lib.inpile){
|
||||
if(get.type(name)!='basic') continue;
|
||||
if(event.filterCard({name:name},player,event)) return true;
|
||||
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) return true;
|
||||
if(name=='sha'){
|
||||
for(var nature of lib.inpile_nature){
|
||||
if(event.filterCard({name:'sha',nature:nature},player,event)) return true;
|
||||
if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14312,12 +14312,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var list=[];
|
||||
for(var name of lib.inpile){
|
||||
if(get.type(name)!='basic') continue;
|
||||
if(event.filterCard({name:name},player,event)){
|
||||
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)){
|
||||
list.push(['基本','',name]);
|
||||
}
|
||||
if(name=='sha'){
|
||||
for(var nature of lib.inpile_nature){
|
||||
if(event.filterCard({name:name,nature:nature},player,event)) list.push(['基本','','sha',nature]);
|
||||
if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',nature]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ export class VCard {
|
|||
if (!this.nature) this.nature = get.nature(this);
|
||||
}
|
||||
}
|
||||
else if(numberOrCards === 'unsure') {
|
||||
else if(numberOrCards === 'unsure' && !this.isCard) {
|
||||
if(!this.suit) this.suit = 'unsure';
|
||||
if(!this.color) this.color = 'unsure';
|
||||
if(!this.number) this.number = 'unsure';
|
||||
|
|
Loading…
Reference in New Issue