优化【水淹七军】ai
This commit is contained in:
parent
d376cb853d
commit
98babe6447
|
@ -474,12 +474,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else target.chooseControl('discard_card','take_damage',function(event,player){
|
else target.chooseControl('discard_card','take_damage',function(event,player){
|
||||||
if(get.damageEffect(player,event.player,player,'thunder')>=0){
|
let eff=get.damageEffect(player,event.player,player,'thunder');
|
||||||
return 'take_damage';
|
if(eff>0) return 'take_damage';
|
||||||
}
|
if(player.hasSkillTag('noe')) return 'discard_card';
|
||||||
if(player.hp>=3&&player.countCards('e')>=2){
|
if(!eff) return 'take_damage';
|
||||||
return 'take_damage';
|
if(player.isDamaged()&&player.hasCard((card)=>get.name(card)=='baiyin'&&get.recoverEffect(player,player,_status.event.player)>0,'e')) return 'discard_card';
|
||||||
}
|
if(player.hasCard((card)=>get.value(card,player)<=0,'e')&&!player.hasCard((card)=>get.value(card,player)>Math.max(7,12-player.hp),'e')) return 'discard_card';
|
||||||
|
if(player.hp>2&&player.countCards('e')>2||player.hp>1&&player.countCards('e')>3) return 'take_damage';
|
||||||
return 'discard_card';
|
return 'discard_card';
|
||||||
}).set('prompt','水淹七军').set('prompt2','请选择一项:⒈弃置装备区里的所有牌;⒉受到'+get.translation(player)+'造成的1点雷电伤害。');
|
}).set('prompt','水淹七军').set('prompt2','请选择一项:⒈弃置装备区里的所有牌;⒉受到'+get.translation(player)+'造成的1点雷电伤害。');
|
||||||
'step 1'
|
'step 1'
|
||||||
|
@ -534,12 +535,14 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target,card,isLink){
|
target:function(player,target,card,isLink){
|
||||||
if(isLink) return -1.5;
|
let es=target.getCards('e'), eff=2*get.sgn(get.damageEffect(target,player,target,'thunder'));
|
||||||
var es=target.getCards('e');
|
if(isLink || !es.length) return eff;
|
||||||
if(!es.length) return -1.5;
|
let val=0;
|
||||||
var val=0;
|
for(let i of es){
|
||||||
for(var i of es) val+=get.value(i,target);
|
if(i.name=='baiyin'&&target.isDamaged()&&get.recoverEffect(target)) val+=6;
|
||||||
return -Math.min(1.5,val/5);
|
else val-=get.value(i,target);
|
||||||
|
}
|
||||||
|
return Math.max(eff,0.15*val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue