diff --git a/character/sb.js b/character/sb.js index f0d51f4ee..ac734519c 100644 --- a/character/sb.js +++ b/character/sb.js @@ -784,12 +784,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return ui.selected.targets.length==ui.selected.cards.length+1; }, check:function(card){ - let player=get.owner(card),targets=_status.event.getTempCache('sblijian','targets'); - if(!Array.isArray(targets)){ - lib.skill.sblijian.selectTargetAi(_status.event,player); - targets=_status.event.getTempCache('sblijian','targets'); - } - targets=Math.min(player.countCards('he')+1,targets.length); + let player=get.owner(card),targets=lib.skill.sblijian.selectTargetAi(_status.event,player); if(ui.selected.cards.lengthcurrent!==player),res; + let cache=_status.event.getTempCache('sblijian','targets'); + if(Array.isArray(cache)) return cache.length; + let id=[null,0],players=game.filterPlayer(current=>current!==player),temp; for(let i of players){ - res=get.attitude(event.player,i); - if(restarget[1]) target=[i,res]; - } - game.players.remove(vp); - if(target[1]<=0){ - event.putTempCache('sblijian','targets',[]); - return; - } - let targets=[],idx=-1; - do{ - idx++; - targets.push(target.concat([get.sgn(get.attitude(player,target[0]))])); - players.remove(target[0]); - target[1]=0; - for(let i of players){ - res=get.effect(i,{name:'juedou',isCard:true},targets[idx][0],event.player); - if(res>target[1]) target=[i,res]; + let target=[null,0],targets=[],vp=player.getEnemies(); + if(vp.length>1){ + let list=[game.createCard('sha'),game.createCard('shan')]; + vp=ui.create.player().init('sunce'); + vp.hp=2; + vp.skills=[]; + game.players.push(vp); + if(typeof id==='string'){ + if(id.endsWith('zhu')||id.endsWith('Zhu')) id=id.slice(0,-1)+'ong'; + vp.identity=id; + vp.showIdentity(); } - }while(target[1]>0); - if(!player.hasSkill('sbbiyue')) targets=targets.filter(i=>i[2]!==0); + else vp.side=id[0].side; + vp.directgain(list,false); + for(let i of players){ + temp=get.effect(i,{name:'juedou',isCard:true},vp,event.player)+get.effect(vp,{name:'juedou',isCard:true},i,event.player); + if(temp>=0) targets.push([i,temp]); + } + game.cardsGotoSpecial(list); + game.players.remove(vp); + } + else{ + vp=vp[0]; + for(let i of players){ + temp=get.effect(i,{name:'juedou',isCard:true},vp,event.player)+get.effect(vp,{name:'juedou',isCard:true},i,event.player); + if(temp>=0) targets.push([i,temp]); + } + } + for(let i=0;i0&&targets[i][1]<2.5*temp&&targets.length>2) targets.splice(i--,1); + else targets[i].push(temp); + } + targets.sort((a,b)=>{ + let att1=get.sgn(get.attitude(event.player,a[0])),att2=get.sgn(get.attitude(event.player,b[0])); + if(att1!==att2) return att1-att2; + return b[1]-a[1]; + }); + targets=targets.slice(0,player.countCards('he')+1); event.putTempCache('sblijian','targets',targets); + return targets.length; }, multiline:true, content:function(){ @@ -847,24 +857,36 @@ game.import('character',function(lib,game,ui,get,ai,_status){ order:7, result:{ player:function(player,target){ - if(!player.hasSkill('sbbiyue')) return 0; let targets=_status.event.getTempCache('sblijian','targets'); - if(Array.isArray(targets)) for(let i=0;i2&&!player.hasSkill('sbbiyue')) return 0; + for(let i=0;i0) return targets[i][1]/5; - return -targets[i][1]; + if(Array.isArray(targets)){ + for(let i=0;i0) return targets[i][1]/5; + return -targets[i][1]; + } } + return 0; } if(ui.selected.targets.length){ - let tars=ui.selected.targets.concat([target]); - return get.effect(target,{name:'juedou',isCard:true},tars[tars.length-2],target)+get.effect(tars[0],{name:'juedou',isCard:true},target,target); + let tars=ui.selected.targets.concat([target]).sortBySeat(); + for(let i=0;i'+''+'['+skillpinyin+']'+''+' '+skilltranslationinfo; }else{ intro2.innerHTML=''+skillname+''+skilltranslationinfo; @@ -54494,8 +54492,7 @@ var derivationname=get.translation(derivation[i]); var derivationtranslationinfo=get.skillInfoTranslation(derivation[i]); if((lib.config.show_skillnamepinyin=='showPinyin2'||lib.config.show_skillnamepinyin=='showCodeIdentifier2')&&derivationname.length<=5&&derivation[i].indexOf('_faq')==-1){ - var derivationpinyin=get.pinyin(derivationname); - if(lib.config.show_skillnamepinyin=='showCodeIdentifier2') derivationpinyin=derivation[i]; + var derivationpinyin=lib.config.show_skillnamepinyin=='showCodeIdentifier2'?derivation[i]:get.pinyin(derivationname); intro2.innerHTML+='

'+derivationname+''+''+'['+derivationpinyin+']'+''+' '+derivationtranslationinfo; }else{ intro2.innerHTML+='

'+derivationname+''+derivationtranslationinfo; diff --git a/layout/default/menu.css b/layout/default/menu.css index f53107e07..b50de7c3e 100644 --- a/layout/default/menu.css +++ b/layout/default/menu.css @@ -1019,7 +1019,7 @@ input.fileinput::-webkit-file-upload-button { } .config { - height: 25px; + /* height: 25px; */ line-height: 25px; position: relative; }