From e963654b04b3aa9e7f5bd414d023516d2642625d Mon Sep 17 00:00:00 2001 From: copcap Date: Mon, 29 Jan 2024 21:32:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A5=9E=E9=B2=81=E8=82=83=E6=9B=B4=E6=96=B0&b?= =?UTF-8?q?ugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/extra.js | 29 +++++++++++++++++------------ character/sb.js | 4 ++-- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/character/extra.js b/character/extra.js index 4181a436d..9873a9667 100755 --- a/character/extra.js +++ b/character/extra.js @@ -100,20 +100,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter(event,player){ const num=player.countCards('he'); return game.hasPlayer(current=>{ + if(current==player) return false; const total=current.countCards('ej'); - return total>0&&num>=total; + return total>0&&num>total; }); }, filterCard:true, - selectCard:[1,Infinity], + selectCard(){ + return [1,Math.max(...game.filterPlayer(i=>i!=get.player()).map(i=>i.countCards('ej')))+1]; + }, check(card){ return 7-get.value(card); }, filterTarget(card,player,target){ - return ui.selected.cards.length==target.countCards('ej')&&player!=target; + const num=target.countCards('ej'); + if(!num) return false; + return ui.selected.cards.length==num+1&&player!=target; }, filterOk(){ - return ui.selected.cards.length==ui.selected.targets[0].countCards('ej'); + return ui.selected.cards.length==ui.selected.targets[0].countCards('ej')+1; }, position:'he', lose:false, @@ -130,7 +135,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ result:{ target(player,target){ let eff=0; - if(ui.selected.cards.length) eff-=ui.selected.cards.map(card=>get.value(card)).reduce((p,c)=>p+c,0); + if(ui.selected.cards.length) eff=ui.selected.cards.map(card=>get.value(card)).reduce((p,c)=>p+c,0); + if(player.hasSkill('zhimeng')) eff*=1+get.sgnAttitude(player,target)*0.15; const es=target.getCards('e'),js=target.getCards('j'); es.forEach(card=>{ eff-=get.value(card,target); @@ -245,7 +251,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ const {result}=await next; if(!result.bool) return; player.logSkill('tamo'); - console.log(result.moved) const resultList=result.moved[0].map(info=>{ return parseInt(info.split('|')[0]); }); @@ -253,11 +258,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ const cmp=(a,b)=>{ return resultList.indexOf(a)-resultList.indexOf(b); } - for(let i of toSortPlayers){ - for(let j of toSortPlayers){ - if(cmp(i.getSeatNum(),j.getSeatNum())<0){ - toSwapList.push([i,j]); - [i,j]=[j,i]; + for(let i=0;ilib.skill.sbquhu.filterTarget(null,player,current))>1; }, filterTarget(card,player,target){ - return player!=target&&target.countCards('he'); + return player!=target&&target.countCards('he')>0; }, selectTarget:2, multitarget:true, @@ -374,7 +374,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.logSkill('sbjieming',target); await target.draw(3); num=Math.max(1,player.getDamagedHp()); - const {result:{bool:bool2,cards}}=await target.chooseToDiscard('节命:是否弃置任意张牌?',`若你本次弃置的牌数小于${get.cnNumber(num)}张,${get.translation(player)}失去1点体力。`,[1,Infinity]).set('ai',card=>{ + const {result:{bool:bool2,cards}}=await target.chooseToDiscard('节命:是否弃置任意张牌?',`若你本次弃置的牌数小于${get.cnNumber(num)}张,${get.translation(player)}失去1点体力。`,[1,Infinity],'he').set('ai',card=>{ if(get.event('nope')) return 0; if(ui.selected.cards.length>=get.event('num')) return 0; return 5.5-get.value(card);