优化部分卡牌ai
This commit is contained in:
parent
a09525f388
commit
01f1c471f4
|
@ -378,7 +378,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
if(target.hasJudge('caomu')) return 0;
|
if(target.hasJudge('caomu')) return 0;
|
||||||
return -1.5/Math.sqrt(target.countCards('h')+1);
|
return -2.7/Math.sqrt(target.countCards('h')+1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tag:{
|
tag:{
|
||||||
|
|
|
@ -498,12 +498,14 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
ai:{
|
ai:{
|
||||||
canLink:function(player,target,card){
|
canLink:function(player,target,card){
|
||||||
if(!target.isLinked()||player.hasSkill('jueqing')||target.hasSkill('gangzhi')||player.hasSkill('gangzhi')) return false;
|
if(!target.isLinked()||player.hasSkill('jueqing')||target.hasSkill('gangzhi')||player.hasSkill('gangzhi')) return false;
|
||||||
var es=target.countCards('e');
|
let es=target.getCards('e'),val=0;
|
||||||
if(!es) return true;
|
if(!es.length) return true;
|
||||||
if(target.hp>=3&&es>=2){
|
for(let i of es){
|
||||||
return true;
|
if(i.name=='baiyin'&&target.isDamaged()&&get.recoverEffect(target)) val+=get.value({name:'tao'},target);
|
||||||
|
else val-=get.value(i,target);
|
||||||
}
|
}
|
||||||
return false;
|
if(0.15*val>2*get.sgn(get.damageEffect(target,player,target,'thunder'))) return false;
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
order:6,
|
order:6,
|
||||||
value:4,
|
value:4,
|
||||||
|
|
|
@ -1977,14 +1977,18 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
result:{
|
result:{
|
||||||
ignoreStatus:true,
|
ignoreStatus:true,
|
||||||
target:function(player,target){
|
target:(player,target)=>{
|
||||||
var num=target.hp-target.countCards('h')-2;
|
if(target===_status.currentPhase&&target.skipList.includes('phaseUse')){
|
||||||
if(num>-1) return -0.01;
|
let evt=_status.event.getParent('phase');
|
||||||
if(target.hp<3) num--;
|
if(evt&&evt.phaseList.indexOf('phaseJudge')<=evt.num) return 0;
|
||||||
if(target.isTurnedOver()) num/=2;
|
}
|
||||||
var dist=get.distance(player,target,'absolute');
|
let num=target.needsToDiscard(3),cf=Math.pow(get.threaten(target,player),2);
|
||||||
|
if(!num) return -0.01*cf;
|
||||||
|
if(target.hp>2) num--;
|
||||||
|
let dist=Math.sqrt(get.distance(player,target,'absolute'));
|
||||||
if(dist<1) dist=1;
|
if(dist<1) dist=1;
|
||||||
return num/Math.sqrt(dist)*get.threaten(target,player);
|
if(target.isTurnedOver()) dist++;
|
||||||
|
return num*cf/dist;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tag:{
|
tag:{
|
||||||
|
|
Loading…
Reference in New Issue