添加get.is.zhuanhuanji

This commit is contained in:
copcap 2024-03-10 17:55:04 +08:00
parent 61edbb76eb
commit 54cd98468e
No known key found for this signature in database
GPG Key ID: 30E7AB6699451AEE
5 changed files with 25 additions and 13 deletions

View File

@ -8896,7 +8896,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.expandSkills(list2);
for(var k=0;k<list2.length;k++){
var info=lib.skill[list2[k]];
if(!info||!info.trigger||!info.trigger.player||info.silent||info.limited||info.juexingji||info.zhuanhuanji||info.hiddenSkill||info.dutySkill||(info.zhuSkill&&!player.isZhu2())) continue;
if(get.is.zhuanhuanji(list2[k],player)) continue;
if(!info||!info.trigger||!info.trigger.player||info.silent||info.limited||info.juexingji||info.hiddenSkill||info.dutySkill||(info.zhuSkill&&!player.isZhu2())) continue;
if(info.trigger.player==name2||Array.isArray(info.trigger.player)&&info.trigger.player.includes(name2)){
if(info.ai&&(info.ai.combo||info.ai.notemp||info.ai.neg)) continue;
if(info.init) continue;
@ -8976,7 +8977,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.expandSkills(list2);
for(var k=0;k<list2.length;k++){
var info=lib.skill[list2[k]];
if(!info||!info.enable||info.charlotte||info.limited||info.juexingji||info.zhuanhuanji||info.hiddenSkill||info.dutySkill||(info.zhuSkill&&!player.isZhu2())) continue;
if(get.is.zhuanhuanji(list2[k],player)) continue;
if(!info||!info.enable||info.charlotte||info.limited||info.juexingji||info.hiddenSkill||info.dutySkill||(info.zhuSkill&&!player.isZhu2())) continue;
if((info.enable=='phaseUse'||(Array.isArray(info.enable)&&info.enable.includes('phaseUse')))||(info.enable=='chooseToUse'||(Array.isArray(info.enable)&&info.enable.includes('chooseToUse')))){
if(info.ai&&(info.ai.combo||info.ai.notemp||info.ai.neg)) continue;
if(info.init||info.onChooseToUse) continue;

View File

@ -11535,22 +11535,19 @@ 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;
});
},
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;
});
},

View File

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

View File

@ -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('势力技');

View File

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