From 8c0b782fe1eb3f79fcf9379637663bd0967d1e68 Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Thu, 26 Oct 2023 23:33:08 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=90=E7=99=BE?= =?UTF-8?q?=E5=87=BA=E3=80=91filter=E4=B8=ADstr=E5=92=8Ccontent=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E4=B8=8D=E5=90=8C=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/clan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/clan.js b/character/clan.js index 7ea0ea235..bff00bcbd 100644 --- a/character/clan.js +++ b/character/clan.js @@ -41,7 +41,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(player.getStorage('clanbaichu').contains(event.card.name)) return true; if(get.suit(event.card)=='none') return false; - var str=(get.suit(event.card)+'、'+get.type2(event.card)); + var str=(get.suit(event.card)+'+'+get.type2(event.card)); if(!player.getStorage('clanbaichu').contains(str)) return true; return !player.hasSkill('qice'); }, From e7799ed3f5b565ac7aa60e1c9abe66ec323fedd1 Mon Sep 17 00:00:00 2001 From: copcap Date: Fri, 27 Oct 2023 03:07:26 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`ui.create.identityCard`?= =?UTF-8?q?=E5=9C=A8=E8=A7=A6=E5=B1=8F=E6=A8=A1=E5=BC=8F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/extra.js | 10 +++++----- game/game.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/character/extra.js b/character/extra.js index 7cf7f75de..59de042ed 100755 --- a/character/extra.js +++ b/character/extra.js @@ -145,7 +145,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).join('、')}`, }, $createButton:function(item,type,position,noclick,node){ - node=ui.create.identityCard(item,position,null,noclick); + node=ui.create.identityCard(item,position,noclick); node.link=item; return node; }, @@ -176,7 +176,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ [list,function(item,type,position,noclick,node){ return lib.skill.jxlianpo.$createButton(item,type,position,noclick,node); }], - ]) + ],true); 'step 1' var choice=result.links[0],mark=`jxlianpo_mark_${choice}`; player.when({global:'roundStart'}) @@ -192,13 +192,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }); player.addMark(mark,1,false); - var videoId=lib.status.videoId++; + event.videoId=lib.status.videoId++; var createDialog=function(player,identity,id){ var dialog=ui.create.dialog(`${get.translation(player)}展示了“${get.translation(identity+'2')}”的身份牌
`,'forcebutton'); dialog.videoId=id; ui.create.spinningIdentityCard(identity,dialog); }; - game.broadcastAll(createDialog,player,choice,videoId); + game.broadcastAll(createDialog,player,choice,event.videoId); var color=''; if(choice=='zhong') color='#y'; else if(choice=='fan') color='#g'; @@ -206,7 +206,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.log(player,'展示了',`${color}${get.translation(choice+'2')}`,'的身份牌'); game.delay(3); 'step 2' - game.broadcastAll('closeDialog',videoId); + game.broadcastAll('closeDialog',event.videoId); } }, global:{ diff --git a/game/game.js b/game/game.js index feb9d4766..00a191d1d 100644 --- a/game/game.js +++ b/game/game.js @@ -43336,8 +43336,8 @@ }, create:{ //创建身份牌实例 - identityCard:function(identity,position,info,noclick){ - const card=ui.create.card(position,info,noclick); + identityCard:function(identity,position,noclick){ + const card=ui.create.card(position,'noclick',noclick); card.classList.add('button'); card._customintro=uiintro=>uiintro.add(`${get.translation(`${identity}${2}`)}的身份牌`); const fileName=`image/card/identity_${identity}.jpg`; From 4eb5e758e8f2e14eea574ef1748bcf97d79324a9 Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:25:28 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=97=A0=E5=8E=9F?= =?UTF-8?q?=E7=94=BB=E6=AD=A6=E5=B0=86=E6=9D=A5=E6=95=8F=E3=80=81=E8=B0=8B?= =?UTF-8?q?=E5=B0=8F=E4=B9=94=E3=80=81=E8=B0=8B=E5=8D=A2=E6=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/mobile.js | 147 +++++++++++++------------------------------- character/sb.js | 4 +- 2 files changed, 46 insertions(+), 105 deletions(-) diff --git a/character/mobile.js b/character/mobile.js index e4205681b..90ea71d1e 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -32,7 +32,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ baoxin:['male','qun',4,['mutao','yimou'],['character:tw_baoxin','die_audio:tw_baoxin']], jiangji:['male','wei',3,['twjichou','jilun'],['character:tw_jiangji','die_audio:tw_jiangji']], liwei:['male','shu',4,['jiaohua'],['character:tw_liwei','die:tw_liwei']], - laimin:['male','shu',3,['laishou','luanqun']], + laimin:['male','shu',3,['laishou','luanqun'],['unseen']], yj_zhoubuyi:['male','wei',3,['mbhuiyao','mbquesong']], xin_guozhao:['female','wei',3,['yichong','wufei']], xin_zhangyi:['male','shu',4,['xinwurong','shizhi']], @@ -970,95 +970,32 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, enable:'phaseUse', usable:1, - // filterTarget:lib.filter.notMe, + filterTarget:lib.filter.notMe, content:function(){ - 'step 0' player.damage('nosource'); - 'step 1' - if(game.countPlayer()<2) event.finish(); - if(game.countPlayer()==2) event._result={bool:true,targets:[game.findPlayer(i=>i!=player),player]}; - else player.chooseTarget(`慧夭:请选择两名角色`,`令不为你的第一名角色视为对第二名角色造成过1点伤害。`,(card,player,target)=>{ - if(!ui.selected.targets.length) return player!=target; - return true; - },2,true).set('multitarget',true).set('targetprompt',['伤害来源','受伤角色']).set('ai',target=>{ - return target==get.event('aiTargets')[ui.selected.targets.length]?10:0; - }).set('aiTargets',lib.skill.mbhuiyao.getUnrealDamageTargets(player,[game.filterPlayer(i=>i!=player),game.filterPlayer()],true)); - 'step 2' - if(result.bool){ - var targets=result.targets; - player.line2(targets,'green'); - game.delaye(); - targets[1].damage(targets[0],'unreal'); - } - }, - getUnrealDamageTargets:(player,lists,forced)=>{ - const targets=[null,null]; - let sourceList,targetList; - if(lists.length==2&&lists.every(l=>Array.isArray(l))){ - sourceList=lists[0]; targetList=lists[1]; - } - else{ - sourceList=lists.slice(); targetList=lists.slice(); - } - const list=targetList.map(current=>{ - const _hp=current.hp,_maxhp=current.maxHp; - current.hp=100; current.maxHp=100; - const att=-get.sgnAttitude(player,current); - let val=get.damageEffect(current,player,current)*att; - current.getSkills(null,false,false).forEach(skill=>{ - const info=get.info(skill); - if(info&&info.ai&&(info.ai.maixie||info.ai.maixie_hp||info.ai.maixie_defend)) val=Math[val>0?'max':'min'](val>0?0.1:-0.1,val+2*att); - }); - const eff=100/val+15; - current.hp=_hp; current.maxHp=_maxhp; - return [current,eff]; - }).sort((a,b)=>b[1]-a[1])[0]; - if(list[1]<0&&!forced) return targets; - const targetx=list[0]; - targets[1]=targetx; - const list2=sourceList.filter(i=>i!=targetx).map(current=>{ - const _hp=targetx.hp,_maxhp=targetx.maxHp; - targetx.hp=100; targetx.maxHp=100; - const att=-get.sgnAttitude(player,current); - const eff=get.damageEffect(targetx,current,current)*att; - targetx.hp=_hp; targetx.maxHp=_maxhp; - return [current,eff]; - }).sort((a,b)=>b[1]-a[1])[0]; - if(!list2) return targets; - targets[0]=list2[0]; - return targets; + target.damage('unreal'); }, ai:{ order:6, result:{ - player:function(player){ - if(player.getHp()+player.countCards('hs',card=>player.canSaveCard(card,player))<=1) return 0; - var limit=25; - var quesong=player.hasSkill('mbquesong')&&!player.getStat().damaged; - if(quesong){ - limit-=7.5; + target:function(player,target){ + if(player.getHp()+player.countCards('hs',card=>player.canSaveCard(card,player))<1) return 0; + var _hp=target.hp,_maxhp=target.maxHp; + target.hp=10; target.maxHp=10; + var att=-get.sgnAttitude(player,target); + var val=get.damageEffect(target,player,target)*att; + target.getSkills(null,false,false).forEach(skill=>{ + var info=get.info(skill); + if(info&&info.ai&&(info.ai.maixie||info.ai.maixie_hp||info.ai.maixie_defend)) val=Math[val>0?'max':'min'](val>0?0.1:-0.1,val+2*att); + }); + var eff=100/val; + target.hp=_hp; target.maxHp=_maxhp; + var limit=17.5; + if(player.hasSkill('mbquesong')){ + if(!player.getStat().damaged) limit+=7.5; } - if(quesong&&game.hasPlayer(target=>{ - var att=get.attitude(player,target); - if(att<0) return false; - return att*Math.sqrt(Math.max(1,[1,2,3,4].reduce((p,c)=>p+target.countEmptySlot(c),0)))>=10||target.getHp()<=2; - })) return 1; - if(!quesong&&game.hasPlayer(target=>{ - if(target==player) return false; - var _hp=target.hp,_maxhp=target.maxHp; - target.hp=100; target.maxHp=100; - var att=-get.sgnAttitude(player,target); - var val=get.damageEffect(target,player,target)*att; - target.getSkills(null,false,false).forEach(skill=>{ - var info=get.info(skill); - if(info&&info.ai&&(info.ai.maixie||info.ai.maixie_hp||info.ai.maixie_defend)) val=Math[val>0?'max':'min'](val>0?0.1:-0.1,val+2*att); - }); - var eff=100/val; - target.hp=_hp; target.maxHp=_maxhp; - if(eff{ var player=_status.event.player; if(get.attitude(player,target)<=0) return 0; - var len=Math.max(1,[1,2,3,4].reduce((p,c)=>p+target.countEmptySlot(c),0)),hp=target.getHp(); + var len=[1,2,3,4,5].reduce((p,c)=>p+target.countEmptySlot(c),0);hp=target.getHp(); return len+target.isTurnedOver()*2+1.5*Math.min(4,target.getDamagedHp())/(hp+1); }); 'step 1' @@ -1083,17 +1020,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var target=result.targets[0]; event.target=target; player.logSkill('mbquesong',target); - var len=Math.max(1,[1,2,3,4].reduce((p,c)=>p+target.countEmptySlot(c),0)),hp=target.getHp(); - if(hp==0||target.countCards('h')p+target.countEmptySlot(c),0);hp=target.getHp(); + var forced=false; + if(len==0) forced=true; + if(hp==0||target.countCards('h'){ - if(!get.event('goon')) return 0; + var str=`${forced?'请':'是否'}弃置${get.cnNumber(hp)}张手牌并回复1点体力${forced?'':'?或点击“取消”摸'+get.cnNumber(len)+'张牌并复原武将牌'}。`; + target.chooseToDiscard(get.translation(player)+'对你发动了【雀颂】',str,forced,'h',hp).set('ai',card=>{ + if(!_status.event.goon) return 0; return 6-get.value(card); }).set('goon',function(){ var _hp=hp+target.isTurnedOver()*1.5; - if(_hp+player.countCards('hs',card=>get.tag(card,'recover'))<=2-len/4) return true; - return len<=_hp; + if(forced||_hp+player.countCards('hs',card=>get.tag(card,'recover'))<=2-len/4) return true; + return len>_hp; }()); } } @@ -1104,12 +1046,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.finish(); } else{ - target.draw(Math.max(1,[1,2,3,4].reduce((p,c)=>p+target.countEmptySlot(c),0))); + target.draw([1,2,3,4,5].reduce((p,c)=>p+target.countEmptySlot(c),0)); } 'step 3' - target.link(false); + player.link(false); 'step 4' - target.turnOver(false); + player.turnOver(false); }, ai:{ expose:0.2, @@ -11287,11 +11229,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' player.chooseTarget(get.prompt('zhongzuo'),'令一名角色摸两张牌。若其已受伤,则你摸一张牌。').set('ai',function(target){ - if(target.hasSkillTag('nogain')) return target.isDamaged()?0:1; - let att=get.attitude(_status.event.player,target); - if(att<=0) return 0; - if(target.isDamaged()) return 1+att/5; - return att/5; + if(target.hasSkillTag('nogain')&&target!=_status.currentPhase) return target.isDamaged()?0:1; + var att=get.attitude(_status.event.player,target); + if(target.isDamaged()) att=att*1.2; + return att; }); 'step 1' if(result.bool){ @@ -12605,7 +12546,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 3' if(result.bool){ trigger.player.gain(event.card,'give',player,'bySelf'); - player.chooseBool('是否对'+get.translation(trigger.player)+'造成1点伤害?').ai=function(){ + player.chooseBool('是否对'+get.translation(trigger.player)+'造成一点伤害?').ai=function(){ return get.damageEffect(trigger.player,player,player)>0 }; } @@ -12951,7 +12892,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.ingame=game.hasPlayer(function(current){ return ['re_xushu','xin_xushu','xushu','dc_xushu'].contains(current.name)||['re_xushu','xin_xushu','xushu','dc_xushu'].contains(current.name2); })?true:false; - var prompt='请选择一名角色,令其回复1点体力并摸一张牌'; + var prompt='请选择一名角色,令其回复一点体力并摸一张牌'; prompt+=event.ingame?',然后你摸一张牌。':'。'; player.chooseTarget(prompt).set('ai',function(target){ var player=_status.event.player; @@ -15510,9 +15451,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ yj_zhoubuyi:'☆周不疑', yj_zhoubuyi_prefix:'☆', mbhuiyao:'慧夭', - mbhuiyao_info:'出牌阶段限一次。你可以受到1点无来源伤害,然后你选择一名其他角色,令其视为对另一名角色造成过1点伤害。', + mbhuiyao_info:'出牌阶段限一次。你可以受到1点无来源伤害,视为对一名其他角色造成过1点伤害。', mbquesong:'雀颂', - mbquesong_info:'一名角色的结束阶段,若你于本回合受到过伤害,你可以令一名角色选择一项:1.摸等同于其装备区中非宝物栏中空栏的数量的牌并复原武将牌(至少摸一张牌);2.弃置等同于其体力值的手牌并回复1点体力。', + mbquesong_info:'一名角色的结束阶段,若你于本回合受到过伤害,你可以令一名角色选择一项:1.摸等同于其装备区中空栏的数量的牌并复原武将牌;2.弃置等同于其体力值的手牌并回复1点体力。', xin_yuanshao:'手杀界袁绍', xin_yuanshao_prefix:'手杀界', re_baosanniang:'手杀鲍三娘', diff --git a/character/sb.js b/character/sb.js index 757988dee..dae7a25e7 100644 --- a/character/sb.js +++ b/character/sb.js @@ -38,8 +38,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sb_liubiao:['male','qun',3,['sbzishou','sbzongshi']], sb_zhurong:['female','shu',4,['sblieren','sbjuxiang']], sb_menghuo:['male','shu',4,['sbhuoshou','sbzaiqi']], - sb_yl_luzhi:['male','qun',3,['nzry_mingren','sbzhenliang']], - sb_xiaoqiao:['female','wu',3,['sbtianxiang','xinhongyan']], + sb_yl_luzhi:['male','qun',3,['nzry_mingren','sbzhenliang'],['unseen']], + sb_xiaoqiao:['female','wu',3,['sbtianxiang','xinhongyan'],['unseen']], }, characterSort:{ sb:{ From c0292bf7affad44958ee9207d973f93665a3960d Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:27:26 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=97=8F=E8=8D=80=E6=94=B8=20=E3=80=90?= =?UTF-8?q?=E7=99=BE=E5=87=BA=E3=80=91=E8=B0=83=E6=95=B4=E4=B8=BA=E7=BA=BF?= =?UTF-8?q?=E4=B8=8A=E5=AE=9E=E6=93=8D=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/clan.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/character/clan.js b/character/clan.js index bff00bcbd..1ed2f5e98 100644 --- a/character/clan.js +++ b/character/clan.js @@ -48,9 +48,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, content:function(){ 'step 0' - if(player.getStorage('clanbaichu').contains(trigger.card.name)){ - event.draw=true; - } if(get.suit(trigger.card)!='none'){ var str=(get.suit(trigger.card)+'+'+get.type2(trigger.card)); if(player.getStorage('clanbaichu').contains(str)){ @@ -68,6 +65,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var dialog=['请选择【百出】记录的普通锦囊牌牌名',[list,'vcard']]; player.chooseButton(dialog,true).set('ai',function(button){ var player=_status.event.player,name=button.link[2]; + if(name==_status.event.getTrigger().card.name) return 1919810; if(name=='wuxie') return 114514; return get.effect(player,{name:name},player,player)*(1+player.countCards('hs',name)); }); @@ -85,7 +83,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.delayx(); } 'step 2' - if(event.draw) player.chooseDrawRecover(true); + if(player.getStorage('clanbaichu').contains(trigger.card.name)) player.chooseDrawRecover(true); }, intro:{ markcount:()=>0, From 269753a5af0ec38710695d1645fb5976d3e00b0d Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Fri, 27 Oct 2023 15:53:24 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=97=8F=E7=8E=8B=E6=B2=A6=E3=80=90?= =?UTF-8?q?=E6=B1=82=E5=BF=83=E3=80=91=E5=8D=B0=E5=B1=9E=E6=80=A7=E3=80=90?= =?UTF-8?q?=E6=9D=80=E3=80=91=E9=94=99=E8=AF=AFbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/clan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/clan.js b/character/clan.js index 1ed2f5e98..69a0d1bff 100644 --- a/character/clan.js +++ b/character/clan.js @@ -231,7 +231,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.bool){ var card={ name:result.links[0][2], - nature:result.links[0][2], + nature:result.links[0][3], }; player.useCard(card,target,false); }