调整【酒】ai

This commit is contained in:
157 2023-10-26 20:13:21 +08:00 committed by GitHub
parent fb1e20d29b
commit 01f08eb546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 39 additions and 46 deletions

View File

@ -99,69 +99,62 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
ai:{ ai:{
basic:{ basic:{
useful:function(card,i){ useful:(card,i)=>{
if(_status.event.player.hp>1){ if(_status.event.player.hp>1){
if(i==0) return 4; if(i===0) return 4;
return 1; return 1;
} }
if(i==0) return 7.3; if(i===0) return 7.3;
return 3; return 3;
}, },
value:function(card,player,i){ value:(card,player,i)=>{
if(player.hp>1){ if(player.hp>1){
if(i==0) return 5; if(i===0) return 5;
return 1; return 1;
} }
if(i==0) return 7.3; if(i===0) return 7.3;
return 3; return 3;
}, }
}, },
order:function(){ order:()=>{
return get.order({name:'sha'})+0.2; if(_status.event.dying) return 9;
let sha=get.order(new lib.elementVCard({name:'sha'}));
if(sha>0) return sha+0.2;
return 0;
}, },
result:{ result:{
target:function(player,target){ target:(player,target)=>{
if(target&&target.isDying()) return 2; if(target&&target.isDying()) return 2;
if(target&&!target.isPhaseUsing()) return 0; if(!target || target._jiu_temp || !target.isPhaseUsing()) return 0;
if(lib.config.mode=='stone'&&!player.isMin()){ if(!target.getCardUsable('sha') || lib.config.mode==='stone'&&!player.isMin()&&player.getActCount()+1>=player.actcount) return 0;
if(player.getActCount()+1>=player.actcount) return 0; let shas = player.getCards('hs',card=>get.name(card)==='sha'&&!ui.selected.cards.includes(card)), card;
} if(!shas.length || !target.hasSha() || shas.length>1&&(target.getCardUsable('sha')>1 || target.countCards('hs','zhuge'))) return 0;
var shas=player.getCards('h','sha'); target._jiu_temp = true;
if(shas.length>1&&(player.getCardUsable('sha')>1||player.countCards('h','zhuge'))){ shas.sort((a,b)=>get.order(b)-get.order(a));
return 0; for(let i=0; i<shas.length; i++){
} let tars = [];
shas.sort(function(a,b){ if(lib.filter.filterCard(shas[i],target)) tars = game.filterPlayer(current=>{
return get.order(b)-get.order(a); return get.attitude(target,current)<0&&target.canUse(shas[i],current,null,true)&&!current.hasSkillTag('filterDamage',null,{
}) player:target,
var card; card:shas[i],
if(shas.length){ jiu:true
for(var i=0;i<shas.length;i++){ })&&get.effect(current,shas[i],target)>0;
if(lib.filter.filterCard(shas[i],target)){ });
card=shas[i];break; if(!tars.length) continue;
} tars.sort((a,b)=>{
} return get.effect(b,shas[i],target)-get.effect(a,shas[i],target);
} });
else if(player.hasSha()&&player.needsToDiscard()){ if(!tars[0].mayHaveShan(player,'use') || target.hasSkillTag('directHit_ai',true,{
if(player.countCards('h','hufu')!=1){ target:tars[0],
card={name:'sha'}; card:shas[i]
} },true) || target.needsToDiscard()>Math.max(0,3-target.hp)){
} delete target._jiu_temp;
if(card){
if(game.hasPlayer(function(current){
return (get.attitude(target,current)<0&&
target.canUse(card,current,null,true)&&
!current.hasSkillTag('filterDamage',null,{
player:player,
card:card,
jiu:true,
})&&
get.effect(current,card,target)>0);
})){
return 1; return 1;
} }
} }
delete target._jiu_temp;
return 0; return 0;
}, }
}, },
tag:{ tag:{
save:1, save:1,