diff --git a/character/sp2.js b/character/sp2.js index 8af224d1a..7aa16d73b 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -8896,7 +8896,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.expandSkills(list2); for(var k=0;k0; }); }, filterTarget:function(card,player,target){ return target.getSkills(null,false,false).filter(function(i){ - var info=get.info(i); - return info&&info.zhuanhuanji; + return get.is.zhuanhuanji(i,current); }).length>0; }, content:function(){ 'step 0' var list=target.getSkills(null,false,false).filter(function(i){ - var info=get.info(i); - return info&&info.zhuanhuanji; + return get.is.zhuanhuanji(i,current); }); if(list.length==1){ event._result={control:list[0]}; @@ -11584,8 +11581,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ return game.hasPlayer(function(current){ return current.getSkills(null,false,false).filter(function(i){ - var info=get.info(i); - return info&&info.zhuanhuanji; + return get.is.zhuanhuanji(i,current); }).length>0; }); }, diff --git a/character/xianding.js b/character/xianding.js index 904c79a7c..61185e435 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -7936,8 +7936,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, getZhuanhuanji:function(player,bool){ var skills=player.getSkills(null,false,false).filter(function(i){ - var info=get.info(i); - return info&&!info.charlotte&&info.zhuanhuanji; + const list=get.skillCategoriesOf(i); + return !list.includes('Charlotte')&&list.includes('转换技'); }); if(!bool) return skills; if(!skills.length) return 'none'; diff --git a/noname/get/index.js b/noname/get/index.js index 5ebe6b942..cd7a089b3 100644 --- a/noname/get/index.js +++ b/noname/get/index.js @@ -281,7 +281,7 @@ export class Get extends Uninstantable { if (info.zhuSkill) list.add('主公技'); if (info.limited) list.add('限定技'); if (info.juexingji) list.add('觉醒技'); - if (info.zhuanhuanji) list.add('转换技'); + if (get.is.zhuanhuanji(skill, player)) list.add('转换技'); if (info.hiddenSkill) list.add('隐匿技'); if (info.clanSkill) list.add('宗族技'); if (info.groupSkill) list.add('势力技'); diff --git a/noname/get/is.js b/noname/get/is.js index 143bde0f1..f94ba5539 100644 --- a/noname/get/is.js +++ b/noname/get/is.js @@ -443,4 +443,18 @@ export class Is extends Uninstantable { if (info.locked) return true; return false; } + /** + * @param { string } skill + * @param { Player } player + * @returns + */ + static zhuanhuanji(skill, player) { + const info = lib.skill[skill], { zhuanhuanji } = info; + if ('zhuanhuanji2' in info) { + const { zhuanhuanji2 } = info; + if (typeof zhuanhuanji2 === 'function') return Boolean(zhuanhuanji2(skill, player)); + return Boolean(zhuanhuanji2); + } + return Boolean(zhuanhuanji); + } }