优化【文和乱武】ai

This commit is contained in:
157 2023-12-27 08:53:29 +08:00
parent b40817bc68
commit a81c5c5c9f
1 changed files with 14 additions and 1 deletions

View File

@ -225,7 +225,20 @@ game.import('card',function(lib,game,ui,get,ai,_status){
player.chooseControl().set('prompt','文和乱武:请选择一项').set('choiceList',[
'令'+str+'弃置两张类型不同的手牌',
'弃置'+str+'的一张手牌',
]);
]).set('ai',()=>{
let target=_status.event.getParent().target,hs=target.getCards('h'),type=[];
if(hs.length<2) return 0;
hs.forEach(i=>{
type.add(get.type2(i,target));
});
if(target.identity!=='qun'){
if(type.length>1) return 0;
return 1;
}
if(type.length<2||target.hp<3) return 1;
if(hs.length===2) return 0;
return 1;
});
'step 2'
if(result.index==0){
var list=[],hs=target.getCards('h');