修复【溃击】无法执行回血效果的bug并优化ai

This commit is contained in:
157 2024-03-04 11:49:27 +08:00
parent ea34e08d4f
commit db41fc7634
1 changed files with 47 additions and 22 deletions

View File

@ -13435,8 +13435,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.draw(); player.draw();
'step 1' 'step 1'
var next=player.chooseTarget().set('ai',function(target){ var next=player.chooseTarget().set('ai',function(target){
var player=_status.event.player; let player=_status.event.player;
return get.damageEffect(target,player,player) if(target.hasSkillTag('filterDamage',null,{
player:player
},true)) return get.damageEffect(target,player,player);
return 2*get.damageEffect(target,player,player);
}); });
if(!['identity','guozhan'].includes(get.mode())){ if(!['identity','guozhan'].includes(get.mode())){
next.set('prompt','选择一名体力值最大的敌方角色对其造成2点伤害'); next.set('prompt','选择一名体力值最大的敌方角色对其造成2点伤害');
@ -13464,9 +13467,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
result:{ result:{
target:function(player,target){ target:function(player,target){
if(!['identity','guozhan'].includes(get.mode())) return 1; let es;
var target=game.filterPlayer(i=>i!=player).sort((a,b)=>b.hp-a.hp)[0]; if(['identity','guozhan'].includes(get.mode())) es=game.hasPlayer(i=>{
return target&&get.damageEffect(target,player,player)>0?1:0; return i!=player&&!game.hasPlayer(j=>{
return player!==j&&j.hp>i.hp;
})&&get.attitude(player,i)<0;
});
else es=game.hasPlayer(i=>{
return i.isEnemyOf(player)&&!game.hasPlayer(j=>{
return j.hp>i.hp&&j.isEnemyOf(player);
})&&get.attitude(player,i)<0;
});
if(es) return 2;
return -1.5;
}, },
}, },
order:12, order:12,
@ -13475,26 +13488,38 @@ game.import('character',function(lib,game,ui,get,ai,_status){
subSkill:{ subSkill:{
dying:{ dying:{
trigger:{global:'dying'}, trigger:{global:'dying'},
forced:true,
popup:false,
filter:function(event,player){ filter:function(event,player){
var evt=event.getParent(2); let evt=event.getParent(2);
if(!evt||evt.name!='kuiji_content'||evt.player!=player) return false; return evt&&evt.name=='kuiji';
var list=game.filterPlayer(function(current){
return current.isFriendOf(player);
}).sort(function(a,b){
return a.hp-b.hp;
});
return (list.length==1||list[0].hp<list[1].hp)&&list[0].isDamaged();
}, },
locked:true,
direct:true,
content:function(){ content:function(){
var list=game.filterPlayer(function(current){ 'step 0'
return current.isFriendOf(player); var list;
}).sort(function(a,b){ if(['identity','guozhan'].includes(get.mode())) list=game.filterPlayer(current=>{
return a.hp-b.hp; return current!==trigger.player&&!game.hasPlayer(i=>{
})[0]; return trigger.player!==i&&i.hp<current.hp;
player.logSkill('kuiji',list); });
list.recover(); }).filter(i=>i.isDamaged());
else list=game.filterPlayer(current=>{
return current.isFriendOf(player)&&!game.hasPlayer(i=>{
return i.hp<current.hp&&i.isFriendOf(player);
});
}).filter(i=>i.isDamaged());
if(list.length>1) player.chooseTarget('溃击选择一名角色回复1点体力',(card,player,target)=>{
return _status.event.list.includes(target);
},true).set('list',list).set('ai',target=>{
return get.recoverEffect(target,player,_status.event.player);
});
else if(list.length) event._result={bool:true,targets:list};
else event._result={bool:false};
'step 1'
if(result.bool){
let target=result.targets[0];
player.logSkill('kuiji',target);
target.recover();
}
}, },
}, },
}, },