offline.js ~ shiji.js chooseToUse相关技能完成修改

This commit is contained in:
Spmario233 2024-03-03 11:19:09 +08:00
parent ee4aee82aa
commit 1d9f781609
6 changed files with 49 additions and 55 deletions

View File

@ -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<lib.inpile.length;i++){
var name=lib.inpile[i];
if(name=='sha'){
if(event.filterCard({name:name},player,event)) list.push(['基本','','sha']);
for(var j of lib.inpile_nature){
if(event.filterCard({name:name,nature:j},player,event)) list.push(['基本','','sha',j]);
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','','sha']);
for(var nature of lib.inpile_nature){
if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',j]);
}
}
else if(get.type(name)=='trick'&&event.filterCard({name:name},player,event)) list.push(['锦囊','',name]);
else if(get.type(name)=='basic'&&event.filterCard({name:name},player,event)) list.push(['基本','',name]);
else if(get.type(name)=='trick'&&event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['锦囊','',name]);
else if(get.type(name)=='basic'&&event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','',name]);
}
return ui.create.dialog('灭吴',[list,'vcard']);
},
filter:function(button,player){
return _status.event.getParent().filterCard({name:button.link[2]},player,_status.event.getParent());
},
//これ 要らない(そよりん声线)
//filter:function(button,player){
// return _status.event.getParent().filterCard({name:button.link[2]},player,_status.event.getParent());
//},
check:function(button){
if(_status.event.getParent().type!='phase') return 1;
var player=_status.event.player;
@ -2173,7 +2174,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!player.countCards('hse')||player.hasSkill('pslongyin_used')) 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;
},
@ -4158,24 +4159,24 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.storage.jsprende+=cards.length;
if(player.storage.jsprende>=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);
}
},

View File

@ -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);

View File

@ -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;

View File

@ -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])
}
}
}

View File

@ -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]);
}
}

View File

@ -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<lib.inpile.length;i++){
var name=lib.inpile[i];
if(name=='sha'){
if(event.filterCard({name:name},player,event)) list.push(['基本','','sha']);
for(var j of lib.inpile_nature){
if(event.filterCard({name:name,nature:j},player,event)) list.push(['基本','','sha',j]);
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','','sha']);
for(var nature of lib.inpile_nature){
if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',j]);
}
}
else if(get.type2(name)=='trick'&&event.filterCard({name:name},player,event)) list.push(['锦囊','',name]);
else if(get.type(name)=='basic'&&event.filterCard({name:name},player,event)) list.push(['基本','',name]);
else if(get.type2(name)=='trick'&&event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['锦囊','',name]);
else if(get.type(name)=='basic'&&event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','',name]);
}
return ui.create.dialog('灭吴',[list,'vcard']);
},
filter:function(button,player){
return _status.event.getParent().filterCard({name:button.link[2]},player,_status.event.getParent());
},
check:function(button){
if(_status.event.getParent().type!='phase') return 1;
var player=_status.event.player;