TW张昭【力荐】ai小修

This commit is contained in:
mengxinzxz 2023-09-25 14:24:26 +08:00 committed by GitHub
parent 1935d8fc8b
commit b1c8b08001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -469,12 +469,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
case -1: case -1:
var num=Math.ceil(cards.length/2)+(cards.length%2==0?1:0); var num=Math.ceil(cards.length/2)+(cards.length%2==0?1:0);
if(num>1&&player.hasSkill('twchungang')) num--; if(num>1&&player.hasSkill('twchungang')) num--;
if(get.damageEffect(target,player,player)<=0||num>2||cardy.length>cardx.length) return [cardx,cardy]; if(get.damageEffect(target,player,player)<=0||num>2||cardx.length>cardy.length) return [cardx,cardy];
var num2=cardx.length-cardy.length; var num2=cardy.length-cardx.length;
num2=Math.ceil(num2/2)+(num2%2==0?1:0); num2=Math.ceil(num2/2)+(num2%2==0?1:0);
cardx.sort((a,b)=>get.value(b)-get.value(a)); cardy.sort((a,b)=>get.value(b)-get.value(a));
cardy.addArray(cardx.sort(num,cardx.length)); cardx.addArray(cardy.slice(num,cardy.length));
return [cardx.sort(0,num),cardy]; return [cardx,cardy.slice(0,num)];
break; break;
} }
}).set('cards',cards); }).set('cards',cards);