From 1935d8fc8b4dc8de4196ed0587e88bbf075bb2f1 Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:22:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=97=8F=E7=8E=8B=E5=85=81=E3=80=90?= =?UTF-8?q?=E8=A7=A3=E6=82=AC=E3=80=91prompt=E4=BF=AE=E5=A4=8D=EF=BC=8C?= =?UTF-8?q?=E3=80=90=E9=93=AD=E6=88=92=E3=80=91bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/clan.js | 163 +++++++++++++++++++--------------------------- 1 file changed, 67 insertions(+), 96 deletions(-) diff --git a/character/clan.js b/character/clan.js index 0e5378939..5d7acd225 100644 --- a/character/clan.js +++ b/character/clan.js @@ -339,7 +339,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var storage=player.storage.clanjiexuan; var name=(storage||0)%2?'guohe':'shunshou'; var fix=player.hasSkill('clanzhongliu')&&get.position(card)!='h'?2:1; - return get.value({name:name},player)-get.value(card)+fix; + return (get.value({name:name},player)-get.value(card))*fix; }, position:'hes', filterCard:function(card,player){ @@ -347,7 +347,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return get.color(card)==((storage||0)%2?'black':'red'); }, prompt:function(){ - if(_status.event.player.storage.clanjiexuan) return '将一张黑色牌当【过河拆桥】使用'; + var storage=_status.event.player.storage.clanjiexuan; + if((storage||0)%2) return '将一张黑色牌当【过河拆桥】使用'; return '将一张红色牌当【顺手牵羊】使用'; }, skillAnimation:true, @@ -370,10 +371,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, clanmingjie:{ + init:function(player){ + player.addSkill('clanmingjie_record'); + }, + onremove:function(player){ + player.removeSkill('clanmingjie_record'); + }, audio:2, enable:'phaseUse', limited:true, - filterTarget:true, + filterTarget:function(card,player,target){ + return !player.getStorage('clanmingjie_effect').contains(target); + }, skillAnimation:true, animationColor:'thunder', content:function(){ @@ -381,8 +390,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.awakenSkill('clanmingjie'); player.addSkill('clanmingjie_effect'); player.markAuto('clanmingjie_effect',[target]); - target.addTempSkill('clanmingjie_targeted',{player:'phaseAfter'}); - target.markAuto('clanmingjie_targeted',[player]); + target.addSkill('clanmingjie_mark'); + target.markAuto('clanmingjie_mark',[player]); }, ai:{ order:10, @@ -415,138 +424,98 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, subSkill:{ effect:{ - trigger:{player:'useCard2'}, charlotte:true, + audio:'clanmingjie', + trigger:{player:'useCard2'}, filter:function(event,player){ var card=event.card; var info=get.info(card); if(info.allowMultiple==false) return false; if(event.targets&&!info.multitarget){ - if(player.getStorage('clanmingjie_effect').some(current=>{ - return current.isIn()&&!event.targets.contains(current)&&lib.filter.targetEnabled2(card,player,current); - })){ - return true; - } + return player.getStorage('clanmingjie_effect').some(current=>{ + return current.isIn()&&!event.targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&lib.filter.targetInRange(card,player,current); + }); } return false; }, - prompt:'是否发动【铭戒】?', - prompt2:function(event,player){ - var list=player.getStorage('clanmingjie_effect').filter(target=>{ - if(event.targets.contains(target)||!target.isIn()) return false; - return lib.filter.targetEnabled2(event.card,player,target); - }); - return '令'+get.translation(list)+'也成为'+get.translation(event.card)+'的目标'; - }, - logTarget:function(event,player){ - return player.getStorage('clanmingjie_effect').filter(target=>{ - if(event.targets.contains(target)||!target.isIn()) return false; - return lib.filter.targetEnabled2(event.card,player,target); - }); - }, - check:function(event,player){ - var eff=0; - var list=player.getStorage('clanmingjie_effect').filter(target=>{ - if(event.targets.contains(target)||!target.isIn()) return false; - return lib.filter.targetEnabled2(event.card,player,target); - }); - for(var i of list) eff+=get.effect(i,event.card,player,player); - return eff>0; - }, + direct:true, content:function(){ - var list=player.getStorage('clanmingjie_effect').filter(target=>{ - if(trigger.targets.contains(target)||!target.isIn()) return false; - return lib.filter.targetEnabled2(trigger.card,player,target); + 'step 0' + player.chooseTarget(get.prompt('clanmingjie_effect'),'令任意【铭戒】目标角色成为'+get.translation(trigger.card)+'的目标',function(card,player,target){ + var trigger=_status.event.getTrigger(); + if(trigger.targets.contains(target)||!target.isIn()||!player.getStorage('clanmingjie_effect').contains(target)) return false; + return lib.filter.targetEnabled2(trigger.card,player,target)&&lib.filter.targetInRange(trigger.card,player,target); + },[1,Infinity]).set('ai',function(target){ + var player=_status.event.player; + var trigger=_status.event.getTrigger(); + return get.effect(target,trigger.card,player,player); }); - if(list.length>0){ - trigger.targets.addArray(list); - game.log(list,'也成为了',trigger.card,'的目标'); + 'step 1' + if(result.bool){ + var targets=result.targets.sortBySeat(); + player.logSkill('clanmingjie_effect',targets); + trigger.targets.addArray(targets); + game.log(targets,'成为了',trigger.card,'的额外目标'); } }, - intro:{ - content:'使用牌时可以额外指定$为目标', - }, - ai:{ - effect:{ - player:function(card,player,target){ - if(_status.event.getParent('useCard',true)||_status.event.getParent('_wuxie',true)) return; - if(player.getStorage('clanmingjie_effect').contains(target)) return [1,-0.5]; - }, - }, - }, + group:'clanmingjie_targeted', + intro:{content:'使用牌时可以额外指定$为目标'}, }, targeted:{ - trigger:{ - player:'phaseEnd', - }, + charlotte:true, + trigger:{global:'phaseEnd'}, filter:function(event,player){ - return player.getStorage('clanmingjie_targeted').length; + if(!player.getStorage('clanmingjie_targeted').contains(event.player)) return false; + return event.player!=player||!player.getHistory('useSkill',evt=>evt.skill=='clanmingjie'&&evt.targets[0]==player).length; }, forced:true, popup:false, - onremove:['clanmingjie_targeted','clanmingjie_record'], - charlotte:true, - group:'clanmingjie_record', content:function(){ 'step 0' - var targets=player.getStorage('clanmingjie_targeted').slice(); - targets.sortBySeat(); - event.targets=targets; - event.targetsx=targets.slice(); - var cards=[]; - var list=player.getStorage('clanmingjie_record'); - if(list.length){ - cards.addArray(list); - } + var cards=player.getStorage('clanmingjie_record').slice(); cards=cards.filterInD('d'); if(cards.length){ event.cards=cards; } - else event.goto(6); + else event.goto(4); 'step 1' - event.target=targets.shift(); - event.cards2=cards.filterInD('d'); - 'step 2' - target.chooseButton(['铭戒:是否使用这些牌?',event.cards2]).set('filterButton',button=>{ + player.chooseButton(['铭戒:是否使用这些牌?',cards]).set('filterButton',button=>{ return _status.event.player.hasUseTarget(button.link); }).set('ai',button=>{ return _status.event.player.getUseValue(button.link); }); - 'step 3' + 'step 2' if(result.bool){ var card=result.links[0]; - event.cards2.remove(card); - target.$gain2(card,false); + event.cards.remove(card); + player.$gain2(card,false); game.delayx(); - target.chooseUseTarget(card,true); + player.chooseUseTarget(card,true); } - else event.goto(5); + else event.goto(4); + 'step 3' + if(event.cards.filter(card=>{ + return get.position(card,true)=='d'&&player.hasUseTarget(card); + }).length) event.goto(1); 'step 4' - if(event.cards2.filter(card=>{ - return get.position(card,true)=='d'&&target.hasUseTarget(card); - }).length) event.goto(2); + player.unmarkAuto('clanmingjie_effect',[trigger.player]); + trigger.player.unmarkAuto('clanmingjie_mark',[player]); 'step 5' - if(targets.length) event.goto(1); - 'step 6' - event.targetsx.forEach(target=>{ - target.unmarkAuto('clanmingjie_effect',[player]); - }); - player.removeSkill('clanmingjie_targeted'); - }, - marktext:'戒', - intro:{ - content:'已被$指定为〖铭戒〗目标', + if(!player.getStorage('clanmingjie_effect').length) player.removeSkill('clanmingjie_effect'); + if(!trigger.player.getStorage('clanmingjie_mark').length) player.removeSkill('clanmingjie_mark'); }, }, + mark:{ + charlotte:true, + marktext:'戒', + intro:{content:'已被$指定为【铭戒】目标'}, + }, record:{ + charlotte:true, trigger:{ global:['shaMiss','eventNeutralized','useCard1','phaseAfter'], }, - silent:true, - forced:true, - charlotte:true, filter:function(event,player){ - if(_status.currentPhase!=player) return false; if(event.name=='useCard'){ return get.suit(event.card)=='spade'; } @@ -554,6 +523,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(event.type!='card') return false; return true; }, + silent:true, + forced:true, content:function(){ 'step 0' if(trigger.name=='phase'){ @@ -562,10 +533,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } player.markAuto('clanmingjie_record',trigger.cards); } - } + }, } }, - //钟琰族钟琰 + //族钟琰 clanguangu:{ audio:2, enable:'phaseUse', From b1c8b08001b96526820cf63e65f919d139ee41d3 Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:24:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?TW=E5=BC=A0=E6=98=AD=E3=80=90=E5=8A=9B?= =?UTF-8?q?=E8=8D=90=E3=80=91ai=E5=B0=8F=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/tw.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/character/tw.js b/character/tw.js index 83f19b4e7..3af652556 100644 --- a/character/tw.js +++ b/character/tw.js @@ -469,12 +469,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ case -1: var num=Math.ceil(cards.length/2)+(cards.length%2==0?1:0); if(num>1&&player.hasSkill('twchungang')) num--; - if(get.damageEffect(target,player,player)<=0||num>2||cardy.length>cardx.length) return [cardx,cardy]; - var num2=cardx.length-cardy.length; + if(get.damageEffect(target,player,player)<=0||num>2||cardx.length>cardy.length) return [cardx,cardy]; + var num2=cardy.length-cardx.length; num2=Math.ceil(num2/2)+(num2%2==0?1:0); - cardx.sort((a,b)=>get.value(b)-get.value(a)); - cardy.addArray(cardx.sort(num,cardx.length)); - return [cardx.sort(0,num),cardy]; + cardy.sort((a,b)=>get.value(b)-get.value(a)); + cardx.addArray(cardy.slice(num,cardy.length)); + return [cardx,cardy.slice(0,num)]; break; } }).set('cards',cards); From 0f87c0f9c296f1dc00c3839fecf3694356ffc9a8 Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:28:40 +0800 Subject: [PATCH 3/3] Update clan.js --- character/clan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/clan.js b/character/clan.js index 5d7acd225..5df1a9cb2 100644 --- a/character/clan.js +++ b/character/clan.js @@ -465,7 +465,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ charlotte:true, trigger:{global:'phaseEnd'}, filter:function(event,player){ - if(!player.getStorage('clanmingjie_targeted').contains(event.player)) return false; + if(!player.getStorage('clanmingjie_effect').contains(event.player)) return false; return event.player!=player||!player.getHistory('useSkill',evt=>evt.skill=='clanmingjie'&&evt.targets[0]==player).length; }, forced:true,