fix 刘协主公技

This commit is contained in:
Spmario233 2023-10-01 21:38:11 +08:00
parent 71ba5c07b4
commit c3cb1cd4d0
2 changed files with 23 additions and 18 deletions

View File

@ -728,30 +728,35 @@ game.import('character',function(lib,game,ui,get,ai,_status){
global:'twzhuiting_global', global:'twzhuiting_global',
subSkill:{ subSkill:{
global:{ global:{
hiddenCard:function(player,name){ hiddenWuxie:function(player,info){
if(name!='wuxie'||!lib.inpile.contains('wuxie')) return false; if(player.group!='wei'&&player.group!='qun') return false;
if(!['wei','qun'].contains(player.group)) return false; const target=info.target,card=info.card;
return game.hasPlayer(target=>target!=player&&target.hasZhuSkill('twzhuiting')); if(!target||target==player||!target.hasZhuSkill('twzhuiting')) return false;
if(_status.connectMode&&player.countCards('hs')>0) return true;
const color=get.color(card,false);
if(color=='none') return false;
return player.hasCard(card=>get.color(card)==color,'hes');
}, },
audio:'twzhuiting', audio:'twzhuiting',
forceaudio:true, forceaudio:true,
enable:'chooseToUse', enable:'chooseToUse',
filter:function(event,player){ filter:function(event,player){
if(!['wei','qun'].contains(player.group)) return false; if(event.type!='wuxie'||player.group!='wei'&&player.group!='qun') return false;
if(!event.filterCard({name:'wuxie'},player,event)||!lib.inpile.contains('wuxie')) return false; const info=event.info_map,target=info.target,card=info.card;
var target=event.getParent(4)[event.getParent(4).name=='phaseJudge'?'player':'target']; if(!target||target==player||!target.hasZhuSkill('twzhuiting')) return false;
var cardx=event.getParent(4).card; const color=get.color(card,false);
return target&&cardx&&target!=player&&target.hasZhuSkill('twzhuiting')&&player.countCards('hes',card=>get.color(card,player)==get.color(cardx)); if(color=='none') return false;
return player.hasCard(card=>get.color(card)==color,'hes');
}, },
filterCard:function(card,player){ filterCard:function(card){
var event=_status.event; const info=_status.event.info_map;
return get.color(card,player)==get.color(event.getParent(4).card); return info&&get.color(card)==get.color(info.card,false);
}, },
viewAs:{name:'wuxie'}, viewAs:{name:'wuxie'},
position:'hes', position:'hes',
prompt:function(){ prompt:function(){
var event=_status.event; const info=_status.event.info_map;
return '将一张'+get.translation(get.color(event.getParent(4).card))+'牌当作【无懈可击】对'+get.translation(event.getParent(4)[event.getParent(4).name=='phaseJudge'?'player':'target'])+'使用'; return '将一张'+get.translation(get.color(info.card))+'牌当作【无懈可击】对'+get.translation(info.target)+'使用';
}, },
check:function(card){ check:function(card){
return 8-get.value(card); return 8-get.value(card);

View File

@ -27495,13 +27495,13 @@
game.expandSkills(skills); game.expandSkills(skills);
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
var ifo=get.info(skills[i]); var ifo=get.info(skills[i]);
if(ifo.viewAs&&typeof ifo.viewAs!='function'&&ifo.viewAs.name=='wuxie'){ if(ifo.hiddenWuxie&&info){
if(!ifo.viewAsFilter||ifo.viewAsFilter(this)){ if(typeof ifo.hiddenWuxie=='function'&&ifo.hiddenWuxie(this,info)){
return true; return true;
} }
} }
else if(ifo.hiddenWuxie&&info){ else if(ifo.viewAs&&typeof ifo.viewAs!='function'&&ifo.viewAs.name=='wuxie'){
if(typeof ifo.hiddenWuxie=='function'&&ifo.hiddenWuxie(this,info)){ if(!ifo.viewAsFilter||ifo.viewAsFilter(this)){
return true; return true;
} }
} }