diff --git a/character/rank.js b/character/rank.js index 6f3e6e7db..d617ba494 100644 --- a/character/rank.js +++ b/character/rank.js @@ -662,6 +662,7 @@ window.noname_character_rank={ 'jsrg_simayi', 'jsrg_zhaoyun', 'jsrg_zhangxuan', + 'sb_xunyu', ], bp:[ 'xin_huojun', diff --git a/character/sb.js b/character/sb.js index 047218b96..684725b7a 100644 --- a/character/sb.js +++ b/character/sb.js @@ -5,6 +5,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ name:'sb', connect:true, character:{ + sb_xunyu:['male','wei',3,['sbquhu','sbjieming']], sb_caopi:['male','wei',3,['sbxingshang','sbfangzhu','sbsongwei'],['zhu']], sb_guanyu:['male','shu',4,['sbwusheng','sbyijue']], sb_huangyueying:['female','shu',3,['sbjizhi','sbqicai']], @@ -56,6 +57,360 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, skill:{ + //荀彧 + sbquhu:{ + audio:2, + enable:'phaseUse', + usable:1, + filter(event,player){ + return game.countPlayer(current=>lib.skill.sbquhu.filterTarget(null,player,current))>1; + }, + filterTarget(card,player,target){ + return player!=target&&target.countCards('he'); + }, + selectTarget:2, + multitarget:true, + multiline:true, + async content(event,trigger,player){ + const targets=[player].addArray(event.targets); + targets.sortBySeat(); + const {result}=await player.chooseCardOL(targets,'he',[1,Infinity],true,'驱虎:请将任意张牌扣置于武将牌上').set('ai',card=>{ + const player=get.event().getParent(2).player; + let value=5; + if(get.player()==player) value-=0.5; + return value-get.useful(card); + }); + const lose_list=[]; + const map=new Map(); + let myCards; + let minLength=Infinity; + for(let i=0;imyCards.length; + const sortedList=lose_list.filter(list=>list[0]!=player).sort((a,b)=>{ + return 1000*(b[1].length-a[1].length)+(get.distance(player,a[0],'absolute')-get.distance(player,b[0],'absolute')); + }); + const mostPlayer=sortedList[0][0],secondPlayer=sortedList[1][0]; + await new Promise(resolve=>{ + game.broadcastAll(lose_list=>{ + lose_list.forEach(list=>list[0].prompt(`${get.cnNumber(list[1].length)}张`,'wood')); + },lose_list); + setTimeout(()=>{ + game.broadcastAll(lose_list=>{ + lose_list.forEach(list=>list[0].unprompt()); + },lose_list); + resolve(); + },2000/(lib.config.speed=='vvfast'?3:1)); + }); + if(isMin){ + await mostPlayer.gain(myCards,'give',player); + await game.asyncDelay(); + const gain_list=lose_list.filter(list=>list[0]!=player); + game.loseAsync({ + gain_list, + animate:'draw', + }).setContent('gaincardMultiple'); + } + else{ + mostPlayer.line(secondPlayer,'thunder'); + await secondPlayer.damage(mostPlayer); + await game.asyncDelay(); + await mostPlayer.gain(myCards,'give',player); + await game.asyncDelay(); + await game.loseAsync({ + lose_list:sortedList, + }).setContent(()=>{ + for(var i=0;i{ + player.$addToExpansion(cards,null,event.gaintag); + for(var i of event.gaintag) player.markSkill(i); + game.resume(); + },get.delayx(500,500),player,cards); + } + else if(event.animate=='gain'){ + player.$gain(cards,false); + game.pause(); + setTimeout((player,cards)=>{ + player.$addToExpansion(cards,null,event.gaintag); + for(var i of event.gaintag) player.markSkill(i); + game.resume(); + },get.delayx(700,700),player,cards); + } + else if(event.animate=='gain2'||event.animate=='draw2'){ + var gain2t=300; + if(player.$gain2(cards)&&player==game.me){ + gain2t=500; + } + game.pause(); + setTimeout((player,cards)=>{ + player.$addToExpansion(cards,null,event.gaintag); + for(var i of event.gaintag) player.markSkill(i); + game.resume(); + },get.delayx(gain2t,gain2t),player,cards); + } + else if(event.animate=='give'||event.animate=='giveAuto'){ + var evtmap=event.losing_map; + var entries=Object.entries(evtmap).map(entry=>[entry[0],entry[1][0]]); + var getOwner=(card)=>{ + var entry=entries.find(entry=>entry[1].includes(card)); + if(entry) return (_status.connectMode?lib.playerOL:game.playerMap)[entry[0]]; + return null; + }; + var gainmap={}; + for(var cardx of cards){ + var owner=getOwner(cardx); + if(owner){ + var id=owner.playerid; + if(!gainmap[id]) gainmap[id]=[]; + gainmap[id].push(cardx); + } + } + if(event.animate=='give'){ + for(var i in gainmap){ + var source=(_status.connectMode?lib.playerOL:game.playerMap)[i]; + source.$give(evtmap[i][0],player,false); + if(event.log) game.log(player,'将',evtmap[i][0],'置于了武将牌上'); + } + } + else{ + for(var i in gainmap){ + var source=(_status.connectMode?lib.playerOL:game.playerMap)[i]; + if(evtmap[i][1].length){ + source.$giveAuto(evtmap[i][1],player,false); + if(event.log) game.log(player,'将',get.cnNumber(evtmap[i][1].length),'张牌置于了武将牌上'); + } + if(evtmap[i][2].length){ + source.$give(evtmap[i][2],player,false); + if(event.log) game.log(player,'将',evtmap[i][2],'置于了武将牌上'); + } + } + } + game.pause(); + setTimeout((player,cards)=>{ + player.$addToExpansion(cards,null,event.gaintag); + for(var i of event.gaintag) player.markSkill(i); + game.resume(); + },get.delayx(500,500),player,cards); + } + else if(typeof event.animate=='function'){ + var time=event.animate(event); + game.pause(); + setTimeout((player,cards)=>{ + player.$addToExpansion(cards,null,event.gaintag); + for(var i of event.gaintag) player.markSkill(i); + game.resume(); + },get.delayx(time,time),player,cards); + } + else{ + player.$addToExpansion(cards,null,event.gaintag); + for(var i of event.gaintag) player.markSkill(i); + event.finish(); + } + } + "step 3"; + game.delayx(); + if(event.updatePile) game.updateRoundNumber(); + }, + intro:{ + markcount:'expansion', + mark(dialog,storage,player){ + const cards=player.getExpansions('sbquhu'); + if(player.isUnderControl(true)) dialog.addAuto(cards); + else return '共有'+get.cnNumber(cards.length)+'张牌'; + }, + }, + ai:{ + order:3.5, + result:{ + target(player,target){ + let sgn=1,preAtt=0; + if(ui.selected.targets.length){ + const selected=ui.selected.targets[0]; + preAtt=get.attitude(player,selected); + if(preAtt>0) sgn=-1; + } + let eff=0.4*target.countCards('h',card=>{ + return 5-get.useful(card); + })-1; + if(get.attitude(player,target)>0&&sgn<0||get.attitude(player,target)<0&&preAtt<0) eff=-Math.abs(eff); + return eff; + }, + } + } + }, + sbjieming:{ + audio:2, + trigger:{ + player:'damageEnd', + }, + direct:true, + async content(event,trigger,player){ + let num=Math.max(1,player.getDamagedHp()); + const {result:{bool,targets}}=await player.chooseTarget(get.prompt('sbjieming'),`令一名角色摸三张牌,然后其可以弃置任意张牌。若其弃置的牌数小于${get.cnNumber(num)}张,你失去1点体力。`).set('ai',target=>{ + if(get.event('nope')) return 0; + const player=get.player(),att=get.attitude(player,target); + if(att>2){ + const num=Math.sqrt(Math.min(5,Math.max(1,target.countCards('he',card=>get.value(card)<5.5)))); + return num*att; + } + return att/3; + }).set('nope',(player.getHp()+player.countCards('hs',card=>player.canSaveCard(card,player))<=1)&&num>3); + if(!bool) return; + const target=targets[0]; + 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=>{ + if(get.event('nope')) return 0; + if(ui.selected.cards.length>=get.event('num')) return 0; + return 5.5-get.value(card); + }).set('nope',get.attitude(target,player)*get.effect(player,{name:'losehp'},player,target)>=0).set('num',num); + if(!bool2||cards.length1){ + if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; + if(!target.hasFriend()) return; + let max=0; + const num=Math.max(1,player.getDamagedHp()); + if(num>3) return 2; + const players=game.filterPlayer(); + for(const current of players){ + if(get.attitude(target,current)>0){ + max=Math.max(current.countCards('he'),max); + } + } + switch(max){ + case 0:return 2; + case 1:return 1.5; + case 2:return [1,2]; + default:return [0,max]; + } + } + if((card.name=='tao'||card.name=='caoyao')&& + target.hp>1&&target.countCards('h')<=target.hp) return [0,0]; + }, + }, + }, + }, //曹丕 sbxingshang:{ audio:2, @@ -6371,6 +6726,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sbfangzhu_info:'出牌阶段限一次,你可以:1.移去2个“颂”标记,令一名其他角色的非Charlotte技能失效直到其回合结束;2.移去2个“颂”标记,令一名其他角色不能响应除其以外的角色使用的牌直到其回合结束;3.移去3个“颂”标记,令一名其他角色将武将牌翻面;4.移去3个“颂”标记,令一名其他角色只能使用你选择的一种类型的牌直到其回合结束。', sbsongwei:'颂威', sbsongwei_info:'主公技。①出牌阶段开始时,你获得Y个“颂”标记(Y为场上其他魏势力角色数)。②每局游戏限一次,出牌阶段,你可以令一名其他魏势力角色失去所有武将牌的技能。', + sb_xunyu:'谋荀彧', + sb_xunyu_prefix:'谋', + sbquhu:'驱虎', + sbquhu_info:'出牌阶段限一次。你可以选择两名有牌的其他角色,你与这些角色同时将任意张牌扣置于武将牌上。若你以此法扣置的牌唯一最少,则扣置牌最多的其他角色获得你扣置的牌,且这些角色获得各自扣置的牌;否则这两名角色中扣置牌较多的角色对较少的角色造成1点伤害,获得你扣置的牌,然后这些角色将各自扣置的牌置入弃牌堆(若这两名角色扣置的牌数相同,视为与你逆时针最近座次的角色扣置牌较多)。', + sbjieming:'节命', + sbjieming_info:'当你受到伤害后,你可以令一名角色摸三张牌,然后其可以弃置任意张牌。若其弃置的牌数小于X,你失去1点体力(X为你已损失的体力值,至少为1)。', sb_zhi:'谋攻篇·知', sb_shi:'谋攻篇·识', diff --git a/character/shenhua.js b/character/shenhua.js index c7af7b7b5..dc2054c5a 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -7722,7 +7722,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ yuji:['xin_yuji','re_yuji','yuji'], zhangjiao:['sp_zhangjiao','re_zhangjiao','sb_zhangjiao','zhangjiao'], dianwei:['dianwei','ol_dianwei','re_dianwei'], - xunyu:['xunyu','ol_xunyu','re_xunyu'], + xunyu:['xunyu','ol_xunyu','re_xunyu','sb_xunyu'], sp_zhugeliang:['sp_zhugeliang','ol_sp_zhugeliang','re_sp_zhugeliang','sb_sp_zhugeliang'], pangtong:['pangtong','ol_pangtong','re_pangtong','sb_pangtong'], re_jsp_pangtong:['re_jsp_pangtong','jsrg_pangtong','sp_pangtong'],