优化袁姬【蒙斥】【芳妒】【节行】ai

This commit is contained in:
157 2023-09-23 15:37:04 +08:00 committed by GitHub
parent 68d810506a
commit 5d2d8f5433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 71 additions and 38 deletions

View File

@ -4563,14 +4563,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(get.itemtype(player)!='player'||player._dcmengchi_aiChecking||target.getStat('gain')) return;
if(card.name=='tiesuo'&&!target.isLinked()) return 0;
if(player.hasSkillTag('jueqing',false,target)) return; if(player.hasSkillTag('jueqing',false,target)) return;
if(target.getStat('gain')) return; if(!get.tag(card,'damage')||get.tag(card,'natureDamage')) return;
if(get.tag(card,'natureDamage')) return; if(target.hp<=1) return 0.75;
if(target.hp==1) return 0.75; if(!target.hasSkillTag('filterDamage',null,{
if(card.name=='sha'&&!player.hasSkill('jiu')||target.hasSkillTag('filterDamage',null,{
player:player, player:player,
card:card, card:card
})) return [1,Math.min(1.5,0.75+0.25*target.hp)]; })&&player.hasSkillTag('damageBonus',false,{
target:target,
card:card
})){
if(target.hp>2) return 0.5;
return 0.75;
}
if(get.attitude(player,target)>0) return [0,0];
var sha=player.getCardUsable({name:'sha'});
player._dcmengchi_aiChecking=true;
var num=player.countCards('h',function(card){
if(get.name(card)=='sha'){
if(sha==0) return false;
else sha--;
}
return player.canUse(card,target)&&get.effect(target,card,player,player)>0;
});
delete player._dcmengchi_aiChecking;
if(player.hasSkillTag('damage')) num++;
if(num<2) return [0,0];
}, },
}, },
}, },
@ -4612,44 +4632,35 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(!get.tag(card,'damage')) return; if(player._dcfangdu_aiChecking||target==_status.currentPhase) return;
if(player.hasSkillTag('jueqing',false,target)) return; if(!get.tag(card,'damage')||player.hasSkillTag('jueqing',false,target)) return;
if(target==_status.currentPhase) return;
if(player._dcfangdu_aiChecking) return;
if(_status.event.getParent('useCard',true)||_status.event.getParent('_wuxie',true)) return; if(_status.event.getParent('useCard',true)||_status.event.getParent('_wuxie',true)) return;
if(!get.tag(card,'natureDamage')){ if(!get.tag(card,'natureDamage')){
if(target.hasHistory('damage',evt=>!evt.nature)){ if(target.hasHistory('damage',evt=>!evt.nature)) return 1.5;
return [1,-2]; else if(target.hp<=1||player.hasSkillTag('damageBonus',false,{
} target:target,
card:card
})&&!target.hasSkillTag('filterDamage',null,{
player:player,
card:card
})) return 0.75;
else{ else{
if(get.attitude(player,target)>0){ if(get.attitude(player,target)>0) return [0,0];
if(target.hasSkill('dcjiexing')) return [0,0.2]; var sha=player.getCardUsable({name:'sha'});
} player._dcfangdu_aiChecking=true;
if(get.attitude(player,target)<0&&!player.hasSkillTag('damageBonus')){ var num=player.countCards('h',function(card){
var sha=player.getCardUsable({name:'sha'}); if(get.name(card)=='sha'){
player._dcfangdu_aiChecking=true; if(sha==0) return false;
var num=player.countCards('h',function(card){ else sha--;
if(get.name(card)=='sha'){
if(sha==0){
return false;
}
else{
sha--;
}
}
return player.canUse(card,target)&&get.effect(target,card,player,player)>0;
});
delete player._dcfangdu_aiChecking;
if(player.hasSkillTag('damage')){
num++;
} }
if(num<2){ return player.canUse(card,target)&&get.effect(target,card,player,player)>0;
return [0,0.8]; });
} delete player._dcfangdu_aiChecking;
} if(player.hasSkillTag('damage')) num++;
if(num<2) return [0,0];
} }
} }
if(!target.hasHistory('damage',evt=>evt.nature)&&player.countCards('h')>1&&get.tag(card,'natureDamage')) return [1,1]; if(get.tag(card,'natureDamage')&&!target.hasHistory('damage',evt=>evt.nature)&&player.countCards('he')>1) return [1,1,1,-1];
} }
} }
} }
@ -4685,6 +4696,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.removeGaintag('dcjiexing'); player.removeGaintag('dcjiexing');
}, },
} }
},
ai:{
effect:{
target:function(card,player,target){
if(get.tag(card,'recover')) return [1,1];
if(get.tag(card,'damage')){
var draw=0.9;
if(target.hasSkill('dcmengchi')&&target.getStat('gain')) draw=1.8;
if(target.hp<=1||card.name=='sha'&&player.hasSkill('jiu')||get.itemtype(player)=='player'&&!target.hasSkillTag('filterDamage',null,{
player:player,
card:card
})&&player.hasSkillTag('damageBonus',false,{
target:target,
card:card
})){
if(target.hp>2) return [1,draw];
return;
}
return [1,draw];
}
}
}
} }
}, },
//朱建平 //朱建平