优化【出其不意】ai

This commit is contained in:
157 2023-12-30 15:53:39 +08:00
parent bbe154c41a
commit 91be8bfb24
1 changed files with 23 additions and 6 deletions

View File

@ -184,12 +184,29 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 0; return 0;
}, },
result:{ result:{
target:function(player,target,cardx){ target:(player,target,card)=>{
if(player.hasSkillTag('viewHandcard',null,target,true)) return target.countCards('h',function(card){ //if(typeof card!=='object') return -2;
return get.suit(card)!=get.suit(cardx) let suit=get.suit(card),
})>0?-1.5:0; view=player.hasSkillTag('viewHandcard',null,target,true),
return -1.4; fz=0,
}, fm=0;
target.getCards('h',i=>{
if(i.isKnownBy(player)){
if(suit!==get.suit(i)){
if(view||get.is.shownCard(i)) return -2;
fz++;
fm++;
}
else if(!view&&!get.is.shownCard(i)) fm++;
}
else{
fz+=0.75;
fm++;
}
});
if(!fm) return 0;
return -2*fz/fm;
}
}, },
tag:{ tag:{
damage:1, damage:1,