diff --git a/character/extra.js b/character/extra.js index bd169dfdc..218b5fe09 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);