diff --git a/character/offline.js b/character/offline.js index a70b27dc3..6d1a36b16 100644 --- a/character/offline.js +++ b/character/offline.js @@ -597,16 +597,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(event.responded||event.psshouli||event.type=='wuxie') return false; if(game.hasPlayer(function(current){ return current.getEquips(4).length>0; - })&&event.filterCard({ + })&&event.filterCard(get.autoViewAs({ name:'sha', storage:{psshouli:true}, - },player,event)) return true; + },'unsure'),player,event)) return true; if(game.hasPlayer(function(current){ return current.getEquips(3).length>0; - })&&event.filterCard({ + })&&event.filterCard(get.autoViewAs({ name:'shan', storage:{psshouli:true}, - },player,event)) return true; + },'unsure'),player,event)) return true; return false; }, delay:false, @@ -1088,7 +1088,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.countMark('pkwuku')||player.hasSkill('pkmiewu2')) return false; for(var i of lib.inpile){ var type=get.type(i); - 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; }, @@ -1098,19 +1098,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i=2){ var list=[]; - if(lib.filter.cardUsable({name:'sha'},player,event.getParent('chooseToUse'))&&game.hasPlayer(function(current){ + if(lib.filter.cardUsable({name:'sha',isCard:true},player,event.getParent('chooseToUse'))&&game.hasPlayer(function(current){ return player.canUse('sha',current); })){ list.push(['基本','','sha']); } for(var i of lib.inpile_nature){ - if(lib.filter.cardUsable({name:'sha',nature:i},player,event.getParent('chooseToUse'))&&game.hasPlayer(function(current){ - return player.canUse({name:'sha',nature:i},current); + if(lib.filter.cardUsable({name:'sha',nature:i,isCard:true},player,event.getParent('chooseToUse'))&&game.hasPlayer(function(current){ + return player.canUse({name:'sha',nature:i,isCard:true},current); })){ list.push(['基本','','sha',i]); } } - if(lib.filter.cardUsable({name:'tao'},player,event.getParent('chooseToUse'))&&game.hasPlayer(function(current){ + if(lib.filter.cardUsable({name:'tao',isCard:true},player,event.getParent('chooseToUse'))&&game.hasPlayer(function(current){ return player.canUse('tao',current); })){ list.push(['基本','','tao']); } - if(lib.filter.cardUsable({name:'jiu'},player,event.getParent('chooseToUse'))&&game.hasPlayer(function(current){ + if(lib.filter.cardUsable({name:'jiu',isCard:true},player,event.getParent('chooseToUse'))&&game.hasPlayer(function(current){ return player.canUse('jiu',current); })){ list.push(['基本','','jiu']); @@ -4183,7 +4184,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(list.length){ player.chooseButton(['是否视为使用一张基本牌?',[list,'vcard']]).set('ai',function(button){ var player=_status.event.player; - var card={name:button.link[2],nature:button.link[3]}; + var card={name:button.link[2],nature:button.link[3],isCard:true}; if(card.name=='tao'){ if(player.hp==1||(player.hp==2&&!player.hasShan())||player.needsToDiscard()){ return 5; @@ -4220,7 +4221,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } 'step 1' if(result&&result.bool&&result.links[0]){ - var card={name:result.links[0][2],nature:result.links[0][3]}; + var card={name:result.links[0][2],nature:result.links[0][3],isCard:true}; player.chooseUseTarget(card,true); } }, diff --git a/character/old.js b/character/old.js index 44f8cb78a..3da5443ee 100755 --- a/character/old.js +++ b/character/old.js @@ -528,10 +528,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.countCards('hs')) return false; for(var i of lib.inpile){ var type=get.type(i); - 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; 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; } } } @@ -541,20 +541,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dialog:function(event,player){ var list=[]; for(var i of lib.inpile){ - if(event.type!='phase') if(!event.filterCard({name:i},player,event)) continue; + if(event.type!='phase') if(!event.filterCard(get.autoViewAs({name:i},'unsure'),player,event)) continue; var type=get.type(i); if(type=='basic'||type=='trick') list.push([type,'',i]); if(i=='sha'){ - if(event.type!='phase') if(!event.filterCard({name:i,nature:j},player,event)) continue; + if(event.type!='phase') if(!event.filterCard(get.autoViewAs({name:i,nature:j},'unsure'),player,event)) continue; for(var j of lib.inpile_nature) list.push(['基本','','sha',j]); } } return ui.create.dialog('蛊惑',[list,'vcard']); }, - filter:function(button,player){ - var evt=_status.event.getParent(); - return evt.filterCard({name:button.link[2],nature:button.link[3]},player,evt); - }, check:function(button){ var player=_status.event.player; var order=Math.max(0,get.order(card)+1); diff --git a/character/refresh.js b/character/refresh.js index 500842b7c..6a2b079fa 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -8739,10 +8739,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filter:function(event,player){ var filter=event.filterCard; - if(filter({name:'sha'},player,event)&&player.countCards('hs','shan')) return true; - if(filter({name:'shan'},player,event)&&player.countCards('hs','sha')) return true; - if(filter({name:'tao'},player,event)&&player.countCards('hs','jiu')) return true; - if(filter({name:'jiu'},player,event)&&player.countCards('hs','tao')) return true; + if(filter(get.autoViewAs({name:'sha'},'unsure'),player,event)&&player.countCards('hs','shan')) return true; + if(filter(get.autoViewAs({name:'shan'},'unsure'),player,event)&&player.countCards('hs','sha')) return true; + if(filter(get.autoViewAs({name:'tao'},'unsure'),player,event)&&player.countCards('hs','jiu')) return true; + if(filter(get.autoViewAs({name:'jiu'},'unsure'),player,event)&&player.countCards('hs','tao')) return true; return false; }, ai:{ @@ -10822,10 +10822,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.countCards('hs')||player.hasSkill('reguhuo_phase')) return false; for(var i of lib.inpile){ var type=get.type(i); - 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; 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; } } } @@ -10845,7 +10845,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filter:function(button,player){ var evt=_status.event.getParent(); - return evt.filterCard({name:button.link[2],nature:button.link[3]},player,evt); + return evt.filterCard(get.autoViewAs({name:button.link[2],nature:button.link[3]},'unsure'),player,evt); }, check:function(button){ var player=_status.event.player; diff --git a/character/sb.js b/character/sb.js index 6df7a98e7..4223c5cf9 100644 --- a/character/sb.js +++ b/character/sb.js @@ -828,7 +828,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return name=='sha'&&player.countCards('hs'); }, filter:function(event,player){ - return event.filterCard({name:'sha'},player,event)||lib.inpile_nature.some(nature=>event.filterCard({name:'sha',nature:nature},player,event)); + return event.filterCard(get.autoViewAs({name:'sha'},'unsure'),player,event)||lib.inpile_nature.some(nature=>event.filterCard(get.autoViewAs({name:'sha',nature},'unsure'),player,event)); }, chooseButton:{ dialog:function(event,player){ @@ -3763,10 +3763,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!marked&&name!='sha'&&name!='shan') continue; if(get.type(name)!='basic') continue; if(player.hasCard(lib.skill.sblongdan.getFilter(name,player),'hs')){ - if(event.filterCard({name:name},player,event)) return true; + if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) return true; if(marked&&name=='sha'){ for(var nature of lib.inpile_nature){ - if(event.filterCard({name:name,nature:nature},player,event)) return true; + if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) return true; } } } @@ -3781,10 +3781,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!marked&&name!='sha'&&name!='shan') continue; if(get.type(name)!='basic') continue; if(player.hasCard(lib.skill.sblongdan.getFilter(name,player),'hs')){ - if(event.filterCard({name:name},player,event)) list.push(['基本','',name]); + if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','',name]); if(marked&&name=='sha'){ for(var nature of lib.inpile_nature){ - if(event.filterCard({name:name,nature:nature},player,event)) list.push(['基本','',name,nature]) + if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','',name,nature]) } } } diff --git a/character/shenhua.js b/character/shenhua.js index 3f37dcd8d..7372f033a 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -150,7 +150,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:'chooseToUse', filter:function(event,player){ if(!player.hasCard(card=>get.suit(card)=='club','sh')) return false; - return (event.type=='phase'||event.filterCard({name:'tiesuo'},player,event)); + return (event.type=='phase'||event.filterCard(get.autoViewAs({name:'tiesuo'},'unsure'),player,event)); }, position:'hs', filterCard:function(card,player,event){ @@ -7425,10 +7425,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.countCards('hs')) return false; for(var i of lib.inpile){ var type=get.type(i); - 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; 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; } } } @@ -7438,11 +7438,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dialog:function(event,player){ var list=[]; for(var i of lib.inpile){ - if(event.type!='phase') if(!event.filterCard({name:i},player,event)) continue; + if(event.type!='phase') if(!event.filterCard(get.autoViewAs({name:i},'unsure'),player,event)) continue; var type=get.type(i); if(type=='basic'||type=='trick') list.push([type,'',i]); if(i=='sha'){ - if(event.type!='phase') if(!event.filterCard({name:i,nature:j},player,event)) continue; + if(event.type!='phase') if(!event.filterCard(get.autoViewAs({name:i,nature:j},'unsure'),player,event)) continue; for(var j of lib.inpile_nature) list.push(['基本','','sha',j]); } } diff --git a/character/shiji.js b/character/shiji.js index 328305231..961b83722 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -5780,7 +5780,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.countMark('spwuku')||!player.countCards('hse')||player.hasSkill('spmiewu2')) return false; for(var i of lib.inpile){ var type=get.type2(i); - 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; }, @@ -5790,19 +5790,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i