From f153d166978e19e086449aa49ad796dada485759 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Thu, 1 Feb 2024 15:25:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sp2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/character/sp2.js b/character/sp2.js index 62ca507f5..7e505547d 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -193,13 +193,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ const cards=player.getCards('h',cardx=>card!=cardx&&get.suit(card,player)==get.suit(cardx,player)); let targets=game.filterPlayer(target=>player.canUse(card,target)&&get.effect(target,card,player,player)>0); const max=range[1],max2=Math.min(cards.length,targets.length); - if(max>=max2) return 0; + if(max>max2) return 0; targets=targets.sort((a,b)=>get.effect(b,card,player,player)-get.effect(a,card,player,player)).slice(0,max2); const sum=targets.reduce((num,target)=>num+get.effect(target,card,player,player),0); if(max==-1){ if(game.filterPlayer(target=>{ return player.canUse(card,target); - }).reduce((num,target)=>num+get.effect(target,card,player,player),0)>=sum) return 0; + }).reduce((num,target)=>num+get.effect(target,card,player,player),0)>sum) return 0; } return sum; },