界全琮【邀名】ai修复

This commit is contained in:
mengxinzxz 2023-10-07 12:29:55 +08:00 committed by GitHub
parent 5af7096471
commit cde9c3ee00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 21 deletions

View File

@ -2420,13 +2420,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var player=_status.event.player;
var target=_status.event.target;
var controls=_status.event.controls.slice();
controls.sort(function(a,b){
return [
get.effect(target,{name:'wuzhong'},player,player)/2,
get.effect(target,{name:'guohe_copy2'},player,player),
get.effect(target,{name:'kaihua'},player,player),
][['摸牌','弃牌','制衡'].indexOf(b)-['摸牌','弃牌','制衡'].indexOf(a)];
});
var map={
'摸牌':get.effect(target,{name:'wuzhong'},player,player)/2,
'弃牌':get.effect(target,{name:'guohe_copy2'},player,player),
'制衡':get.effect(target,{name:'kaihua'},player,player),
};
controls.sort((a,b)=>map[b]-map[a]);
return controls[0];
}).set('target',target);
}
@ -12567,17 +12566,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
usable:1,
audio:'qice_backup',
filter:function(event,player){
const hs=player.getCards('h');
var hs=player.getCards('h');
if(!hs.length) return false;
if(hs.some(card=>{
const mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player);
return (mod2===false)
})) return false;
return lib.inpile.some(name=>{
if(get.type(name)!='trick') return false;
const card=get.autoViewAs({name},hs);
return event.filterCard(card,player,event);
});
for(var i=0;i<hs.length;i++){
var mod2=game.checkMod(hs[i],player,'unchanged','cardEnabled2',player);
if(mod2===false) return false;
}
return true;
},
chooseButton:{
dialog:function(player){
@ -12588,10 +12583,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return ui.create.dialog(get.translation('qice'),[list,'vcard']);
},
filter:function(button,player){
const event=_status.event.getParent(),card=get.autoViewAs({
name:button.link[2],
},player.getCards('h'));
return event.filterCard(card,player,event);
return lib.filter.filterCard({name:button.link[2]},player,_status.event.getParent());
},
check:function(button){
var player=_status.event.player;