杀ai
This commit is contained in:
parent
bd903c9d14
commit
49c09b49e7
|
@ -252,10 +252,6 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
canLink:function(player,target,card){
|
canLink:function(player,target,card){
|
||||||
if(!target.isLinked()&&!player.hasSkill('wutiesuolian_skill')) return false;
|
if(!target.isLinked()&&!player.hasSkill('wutiesuolian_skill')) return false;
|
||||||
if(target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{
|
|
||||||
target:target,
|
|
||||||
card:card,
|
|
||||||
},true)) return false;
|
|
||||||
if(player.hasSkill('jueqing')||player.hasSkill('gangzhi')||target.hasSkill('gangzhi')) return false;
|
if(player.hasSkill('jueqing')||player.hasSkill('gangzhi')||target.hasSkill('gangzhi')) return false;
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
@ -264,42 +260,77 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
value:[5,3,1],
|
value:[5,3,1],
|
||||||
},
|
},
|
||||||
order:function(item,player){
|
order:function(item,player){
|
||||||
if(player.hasSkillTag('presha',true,null,true)) return 10;
|
let res=3.2;
|
||||||
if(game.hasNature(item,'linked')){
|
if(player.hasSkillTag('presha',true,null,true)) res=10;
|
||||||
if(game.hasPlayer(function(current){
|
if(get.itemtype(player)!=='player') return res;
|
||||||
return current!=player&¤t.isLinked()&&player.canUse(item,current,null,true)&&get.effect(current,item,player,player)>0&&lib.card.sha.ai.canLink(player,current,item);
|
let uv=player.getUseValue(item,true);
|
||||||
})&&game.countPlayer(function(current){
|
if(uv<=0) return res;
|
||||||
return current.isLinked()&&get.damageEffect(current,player,player,get.nature(item))>0;
|
let ignore=get.copy(ui.selected.cards),used=player.getCardUsable('sha')-1.5,ph=player.getCards('hs');
|
||||||
})>1) return 3.1;
|
ignore.add(item);
|
||||||
return 3;
|
if(typeof item==='object'&&item.cards) ignore.addArray(item.cards);
|
||||||
|
for(let i of ph){
|
||||||
|
if(ignore.includes(i)||get.name(i)!=='sha'||!lib.filter.cardEnabled(i,player)) continue;
|
||||||
|
let usev=player.getUseValue(i,true);
|
||||||
|
if(usev<=0||used*(usev-uv)>0) continue;
|
||||||
|
if(used*(uv-usev)!==0) return res-0.15;
|
||||||
|
let na=get.natureList(uv),nb=get.natureList(usev);
|
||||||
|
if(used*(na.length-nb.length)>0) return res-0.15;
|
||||||
|
if(na.length&&na.length===nb.length&&na[0]!==nb[0]){
|
||||||
|
let natures=['thunder','fire','ice','kami'];
|
||||||
|
if(used*(natures.indexOf(na[0])-natures.indexOf(nb[0]))>0) return res-0.15;
|
||||||
|
}
|
||||||
|
if(get.number(item)>get.number(i)) return res-0.15;
|
||||||
}
|
}
|
||||||
return 3.05;
|
return res;
|
||||||
},
|
},
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target,card,isLink){
|
target:function(player,target,card,isLink){
|
||||||
var eff=function(){
|
if(target._sha_result_temp) return -1.5;
|
||||||
if(!isLink&&player.hasSkill('jiu')){
|
target._sha_result_temp=true;
|
||||||
if(!target.hasSkillTag('filterDamage',null,{
|
let basic=1,eff=-1.5,zhu=target.isZhu&&target.identityShown;
|
||||||
player:player,
|
if(!target.hasSkillTag('filterDamage',null,{
|
||||||
card:card,
|
player:player,
|
||||||
jiu:true,
|
card:card,
|
||||||
})){
|
jiu:player.hasSkill('jiu'),
|
||||||
if(get.attitude(player,target)>0){
|
})&&(player.hasSkill('jiu')||player.hasSkillTag('damageBonus',true,{
|
||||||
return -7;
|
target:target,
|
||||||
}
|
card:card
|
||||||
else{
|
}))){
|
||||||
return -4;
|
if(target.hp<2) basic=5;
|
||||||
}
|
else if(target.hp===2) basic=3;
|
||||||
}
|
else basic=2;
|
||||||
return -0.5;
|
}
|
||||||
|
else if(target.hp<2) basic*=3;
|
||||||
|
if(zhu) eff*=Math.max(1,9/target.hp/target.hp);
|
||||||
|
if(isLink){
|
||||||
|
let rate=_status.event.getTempCache('sha_result','mayShan');
|
||||||
|
delete target._sha_result_temp;
|
||||||
|
if(typeof rate==='boolean'||typeof rate==='number'){
|
||||||
|
if(!rate) return basic*eff*1.3;
|
||||||
|
if(rate>=1) return eff;
|
||||||
|
return basic*eff*(1.3-0.9*rate);
|
||||||
}
|
}
|
||||||
return -1.5;
|
return basic*eff;
|
||||||
}();
|
}
|
||||||
if(!isLink&&target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{
|
let mayShan;
|
||||||
|
if(player.hasSkillTag('directHit_ai',true,{
|
||||||
target:target,
|
target:target,
|
||||||
card:card,
|
card:card,
|
||||||
},true)) return eff/1.2;
|
},true)||game.hasNature(card,'stab')&&target.countCards('he')<2&&!target.hasSkillTag('noh')) mayShan=false;
|
||||||
return eff;
|
else{
|
||||||
|
let temp=target.getKnownCards(player);
|
||||||
|
if(temp.some(i=>{
|
||||||
|
let name=get.name(i,target);
|
||||||
|
if(name==='shan'||name==='hufu') return lib.filter.cardEnabled(i,target,'forceEnable');
|
||||||
|
return false;
|
||||||
|
})) mayShan=true;
|
||||||
|
else mayShan=1-Math.pow(0.7,(target.hasSkillTag('respondShan',true,'use',true)?1:0)+target.countCards('hs')-temp.length);
|
||||||
|
}
|
||||||
|
_status.event.putTempCache('sha_result','mayShan',mayShan);
|
||||||
|
delete target._sha_result_temp;
|
||||||
|
if(!mayShan) return basic*eff;
|
||||||
|
if(mayShan>=1) return eff;
|
||||||
|
return basic*eff*(1.3-0.9*mayShan);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
tag:{
|
tag:{
|
||||||
|
|
Loading…
Reference in New Issue