diff --git a/character/clan.js b/character/clan.js index e2a99cc9b..0a660d7a2 100644 --- a/character/clan.js +++ b/character/clan.js @@ -662,6 +662,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, clanmingjie:{ init:function(player){ + var skill='clanmingjie_'+player.playerid; + if(!lib.skill[skill]){ + lib.skill[skill]={ + charlotte:true, + mark:true, + marktext:'戒', + intro:{content:'已被$指定为【铭戒】目标'}, + }; + lib.translate[skill]='铭戒'; + lib.translate[skill+'_bg']='戒'; + } player.addSkill('clanmingjie_record'); }, onremove:function(player){ @@ -671,23 +682,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:'phaseUse', limited:true, filterTarget:function(card,player,target){ - return !player.getStorage('clanmingjie_effect').contains(target); + return !target.hasSkill('clanmingjie_'+player.playerid); }, skillAnimation:true, animationColor:'thunder', content:function(){ - 'step 0' player.awakenSkill('clanmingjie'); player.addSkill('clanmingjie_effect'); - player.markAuto('clanmingjie_effect',[target]); - target.addSkill('clanmingjie_mark'); - target.markAuto('clanmingjie_mark',[player]); + var skill='clanmingjie_'+player.playerid; + target.addTempSkill(skill,{player:'phaseAfter'}); + target.storage[skill]=player; }, ai:{ order:10, result:{ target:function(player,target){ - if(player.getStorage('clanmingjie_effect').contains(target)) return 0; if(player.hasSkill('clanzhongliu')||player.hp==1){ if(!player.hasCard(card=>{ var info=get.info(card); @@ -710,7 +719,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } return get.sgnAttitude(player,target); }, - } + }, }, subSkill:{ effect:{ @@ -722,8 +731,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var info=get.info(card); if(info.allowMultiple==false) return false; if(event.targets&&!info.multitarget){ - 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 game.filterPlayer().some(current=>{ + if(!current.hasSkill('clanmingjie_'+player.playerid)) return false; + return !event.targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&lib.filter.targetInRange(card,player,current); }); } return false; @@ -733,7 +743,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ '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; + if(trigger.targets.contains(target)||!target.isIn()||!target.hasSkill('clanmingjie_'+player.playerid)) 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; @@ -749,14 +759,31 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, group:'clanmingjie_targeted', - intro:{content:'使用牌时可以额外指定$为目标'}, }, targeted:{ charlotte:true, trigger:{global:'phaseEnd'}, filter:function(event,player){ - 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; + var cards=player.getStorage('clanmingjie_record').slice(); + cards=cards.filterInD('d'); + if(!cards.length) return false; + var history=player.getHistory('useSkill',evt=>evt.skill=='clanmingjie'); + if(history.length){ + var targets=history.reduce((list,evt)=>list.addArray(evt.targets),[]); + if(event.player!=player&&targets.includes(event.player)) return true; + } + if(player.actionHistory.length>=2){ + for(var i=player.actionHistory.length-2;i>=0;i--){ + if(!player.actionHistory[i].isMe) continue; + var history2=player.actionHistory[i].useSkill.filter(evt=>evt.skill=='clanmingjie'); + if(history2.length){ + var targets2=history2.reduce((list,evt)=>list.addArray(evt.targets),[]); + if(targets2.includes(event.player)) return true; + } + break; + } + } + return false; }, forced:true, popup:false, @@ -764,10 +791,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' var cards=player.getStorage('clanmingjie_record').slice(); cards=cards.filterInD('d'); - if(cards.length){ - event.cards=cards; - } - else event.goto(4); + event.cards=cards; 'step 1' player.chooseButton(['铭戒:是否使用这些牌?',cards]).set('filterButton',button=>{ return _status.event.player.hasUseTarget(button.link); @@ -782,24 +806,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.delayx(); player.chooseUseTarget(card,true); } - else event.goto(4); + else event.finish(); 'step 3' if(event.cards.filter(card=>{ return get.position(card,true)=='d'&&player.hasUseTarget(card); }).length) event.goto(1); - 'step 4' - player.unmarkAuto('clanmingjie_effect',[trigger.player]); - trigger.player.unmarkAuto('clanmingjie_mark',[player]); - 'step 5' - 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:{ @@ -2634,7 +2647,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ clanjiexuan:'解悬', clanjiexuan_info:'限定技,转换技。阴:你可以将一张红色牌当【顺手牵羊】使用;阳:你可以将一张黑色牌当【过河拆桥】使用。', clanmingjie:'铭戒', - clanmingjie_info:'限定技。出牌阶段,你可以选择一名角色,然后直到其下回合结束时,当你使用牌时你可以指定其为额外目标。然后其下回合结束时,你可以使用本回合使用过的黑桃牌和被抵消过的牌。', + clanmingjie_info:'限定技。出牌阶段,你可以选择一名角色,然后你获得此下效果:①你使用牌时你可以指定其为额外目标直到其下个回合结束。②其下个回合结束时(若该角色为你则改为你的下下个回合结束时),你可以使用本回合使用过的黑桃牌和被抵消过的牌。', clan_wanghun:'族王浑', clanfuxun:'抚循', clanfuxun_info:'出牌阶段限一次。你可以获得或交给一名其他角色一张手牌,然后若其手牌数与你相等且于此阶段仅以此法获得或失去过牌,你可以将一张牌当任意基本牌使用。', diff --git a/character/gujian.js b/character/gujian.js index 55264de28..311284c64 100644 --- a/character/gujian.js +++ b/character/gujian.js @@ -803,7 +803,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ silent:true, content:function(){ player.exitSubPlayer(true); - game.createTrigger('phaseAfter','lianjing',player,trigger); + if(lib.filter.filterTrigger(trigger,player,'phaseAfter','lianjing')) game.createTrigger('phaseAfter','lianjing',player,trigger); } } }, diff --git a/character/hearth.js b/character/hearth.js index 9c6db8dc4..442b1ca0e 100644 --- a/character/hearth.js +++ b/character/hearth.js @@ -8203,7 +8203,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ hs:get.cards(4) }); player.callSubPlayer(player.storage.huanfeng_end); - // game.createTrigger('phaseBegin','shengdun',player,trigger); + // if(lib.filter.filterTrigger(trigger,player,'phaseBegin','shengdun')) game.createTrigger('phaseBegin','shengdun',player,trigger); }, // group:'huanfeng_end', subSkill:{ diff --git a/character/jsrg.js b/character/jsrg.js index 9294a7aa5..628d6cc20 100644 --- a/character/jsrg.js +++ b/character/jsrg.js @@ -3130,7 +3130,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var keys=['filterTarget','selectTarget','ai2']; for(var key of keys) delete next[key]; for(var i in trigger){ - if(!next.hasOwnProperty(i)) next[i]=trigger[i]; + if(!(i in next)) next[i]=trigger[i]; } next.filterTargetx=trigger.filterTarget||(()=>false); next.filterTarget=function(card,player,target){ @@ -3732,7 +3732,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(list.length>0) continue; var info=get.info(skill); if(info&&(!info.unique||info.gainable)){ - lib.skill.rehuashen.createAudio(name,skill,'jsrg_xushao'); + // lib.skill.rehuashen.createAudio(name,skill,'jsrg_xushao'); skills.add(skill); } } @@ -3744,6 +3744,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addSkillBlocker('sbyingmen'); game.log(player,'将','#y'+get.translation(characters),'加入了','#g“访客”'); game.broadcastAll(function(player,characters){ + player.tempname.addArray(characters); player.$draw(characters.map(function(name){ var cardname='huashen_card_'+name; lib.card[cardname]={ @@ -3764,6 +3765,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var characters2=player.getStorage('sbyingmen').slice(0); characters2.removeArray(characters); skills.removeArray(lib.skill.sbyingmen.getSkills(characters2,player)); + game.broadcastAll((player,characters)=>player.tempname.removeArray(characters),player,characters); player.unmarkAuto('sbyingmen',characters); _status.characterlist.addArray(characters); player.removeInvisibleSkill(skills); diff --git a/character/refresh.js b/character/refresh.js index 1727b10e3..cea5266d4 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -20,6 +20,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, connect:true, character:{ + ol_jianyong:['male','shu',3,['olqiaoshui','jyzongshi'],['unseen']], ol_lingtong:['male','wu',4,['olxuanfeng'],['die_audio:re_lingtong','unseen']], re_xushu:['male','shu',4,['zhuhai','qianxin']], re_lidian:['male','wei',3,['xunxun','xinwangxi']], @@ -170,6 +171,32 @@ game.import('character',function(lib,game,ui,get,ai,_status){ re_guohuai:['xiahouyuan','zhanghe'], }, skill:{ + //界简雍 + olqiaoshui:{ + audio:2, + inherit:'reqiaoshui', + filter:function(event,player){ + return player.countCards('h')>0&&!player.hasSkill('olqiaoshui_used'); + }, + content:function(){ + 'step 0' + player.chooseToCompare(target); + 'step 1' + if(result.bool) player.addTempSkill('qiaoshui3',{player:'phaseUseAfter'}); + else{ + player.addTempSkill('qiaoshui2'); + player.addTempSkill('olqiaoshui_used'); + } + }, + subSkill:{ + used:{ + charlotte:true, + mark:true, + marktext:'', + intro:{content:'被迫闭嘴'}, + }, + }, + }, //界凌统 olxuanfeng:{ audio:'xuanfeng', @@ -10620,10 +10647,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } if(event.control=='弃置化身') return; if(player.storage.rehuashen.current!=event.card){ + const old=player.storage.rehuashen.current; player.storage.rehuashen.current=event.card; - game.broadcastAll(function(player,sex){ - player.sex=sex; - },player,lib.character[event.card][0]); + game.broadcastAll(function(player,character,old){ + player.tempname.remove(old); + player.tempname.add(character); + player.sex=lib.character[event.card][0]; + },player,event.card,old); game.log(player,'将性别变为了','#y'+get.translation(lib.character[event.card][0])+'性'); player.changeGroup(lib.character[event.card][1]); } @@ -10636,7 +10666,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.popup(link); player.syncStorage('rehuashen'); player.updateMarks('rehuashen'); - lib.skill.rehuashen.createAudio(event.card,link,'re_zuoci'); + // lib.skill.rehuashen.createAudio(event.card,link,'re_zuoci'); } }, init:function(player,skill){ @@ -10752,42 +10782,42 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } return node; }, - createAudio:(character,skillx,name)=>{ - var skills=game.expandSkills([skillx]); - skills=skills.filter(skill=>get.info(skill)); - if(!skills.length) return; - var skillss=skills.filter(skill=>get.info(skill).derivation); - if(skillss.length){ - skillss.forEach(skill=>{ - var derivationSkill=get.info(skill).derivation; - skills[Array.isArray(derivationSkill)?'addArray':'add'](derivationSkill); - }); - } - skills.forEach(skill=>{ - var info=lib.skill[skill]; - if(info){ - if(!info.audioname2) info.audioname2={}; - if(info.audioname&&info.audioname.includes(character)){ - if(info.audio){ - if(typeof info.audio=='string') skill=info.audio; - if(Array.isArray(info.audio)) skill=info.audio[0]; - } - if(!lib.skill[skill+'_'+character]) lib.skill[skill+'_'+character]={audio:2}; - info.audioname2[name]=(skill+'_'+character); - } - else if(info.audioname2[character]){ - info.audioname2[name]=info.audioname2[character]; - } - else{ - if(info.audio){ - if(typeof info.audio=='string') skill=info.audio; - if(Array.isArray(info.audio)) skill=info.audio[0]; - } - info.audioname2[name]=skill; - } - } - }); - }, + // createAudio:(character,skillx,name)=>{ + // var skills=game.expandSkills([skillx]); + // skills=skills.filter(skill=>get.info(skill)); + // if(!skills.length) return; + // var skillss=skills.filter(skill=>get.info(skill).derivation); + // if(skillss.length){ + // skillss.forEach(skill=>{ + // var derivationSkill=get.info(skill).derivation; + // skills[Array.isArray(derivationSkill)?'addArray':'add'](derivationSkill); + // }); + // } + // skills.forEach(skill=>{ + // var info=lib.skill[skill]; + // if(info){ + // if(!info.audioname2) info.audioname2={}; + // if(info.audioname&&info.audioname.includes(character)){ + // if(info.audio){ + // if(typeof info.audio=='string') skill=info.audio; + // if(Array.isArray(info.audio)) skill=info.audio[0]; + // } + // if(!lib.skill[skill+'_'+character]) lib.skill[skill+'_'+character]={audio:2}; + // info.audioname2[name]=(skill+'_'+character); + // } + // else if(info.audioname2[character]){ + // info.audioname2[name]=info.audioname2[character]; + // } + // else{ + // if(info.audio){ + // if(typeof info.audio=='string') skill=info.audio; + // if(Array.isArray(info.audio)) skill=info.audio[0]; + // } + // info.audioname2[name]=skill; + // } + // } + // }); + // }, mark:true, intro:{ onunmark:function(storage,player){ @@ -13882,7 +13912,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player:["changeHp"], }, audio:2, - audioname:{gongsunzan:'yicong'}, + audioname2:{gongsunzan:'yicong'}, forced:true, filter:function(event,player){ return get.sgn(player.hp-2.5)!=get.sgn(player.hp-2.5-event.num); @@ -15612,6 +15642,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ re_lidian_prefix:'界', re_xushu:'界徐庶', re_xushu_prefix:'界', + ol_jianyong:'OL界简雍', + ol_jianyong_prefix:'OL界', + olqiaoshui:'巧说', + olqiaoshui_info:'出牌阶段,你可与一名其他角色拼点。若你赢,你使用的下一张基本牌或普通锦囊牌可以额外指定任意一名其他角色为目标或减少指定一个目标;若你没赢,此技能于本回合失效且本回合你不能使用锦囊牌。', refresh_standard:'界限突破·标', refresh_feng:'界限突破·风', diff --git a/character/shenhua.js b/character/shenhua.js index 2175b92f6..4113463b9 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -4412,9 +4412,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!event.logged) player.logSkill('huashen'); var skill=map.skill,character=map.character; if(character!=player.storage.huashen.current){ + const old=player.storage.huashen.current; player.storage.huashen.current=character; player.markSkill('huashen'); - game.broadcastAll(function(character,player){ + game.broadcastAll(function(player,character,old){ + player.tempname.remove(old); + player.tempname.add(character); player.sex=lib.character[character][0]; //player.group=lib.character[character][1]; //player.node.name.dataset.nature=get.groupnature(player.group); @@ -4434,7 +4437,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ },50); },200); } - },character,player); + },player,character,old); game.log(player,'将性别变为了','#y'+get.translation(lib.character[character][0])+'性'); player.changeGroup(lib.character[character][1]); } @@ -4446,7 +4449,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.popup(skill); player.syncStorage('huashen'); player.updateMarks('huashen'); - lib.skill.rehuashen.createAudio(character,skill,'zuoci'); + // lib.skill.rehuashen.createAudio(character,skill,'zuoci'); } } } diff --git a/character/sp.js b/character/sp.js index 0dbf0d90d..f9224f2e3 100755 --- a/character/sp.js +++ b/character/sp.js @@ -703,6 +703,38 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, skill:{ + //OL飞扬 + olfeiyang:{ + trigger:{player:'phaseZhunbeiBegin'}, + filter:function(event,player){ + return player.countCards('he',card=>{ + if(_status.connectMode&&get.position(card)=='h') return true; + return lib.filter.cardDiscardable(card,player); + })>=3&&player.countCards('j'); + }, + direct:true, + //limited:true, + //skillAnimation:true, + //animationColor:'orange', + content:function(){ + 'step 0' + player.chooseToDiscard(get.prompt2('olfeiyang'),'he',3).set('ai',function(card){ + var player=_status.event.player; + if(player.hasCard(function(card){ + return get.effect(player,{ + name:card.viewAs||card.name, + cards:[card], + },player,player)<0; + },'j')) return 6-get.value(card); + return 0; + }).set('logSkill','olfeiyang'); + 'step 1' + if(result.bool){ + //player.awakenSkill('olfeiyang'); + player.discardPlayerCard(player,'j',true); + } + }, + }, //李婉 ollianju:{ audio:2, @@ -8092,7 +8124,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, enable:'chooseToUse', hiddenCard:function(player,name){ - if(get.type(name)=='basic'&&lib.inpile.contains(name)&&!player.getStorage('yilie_count').contains(name)){ + if(get.type(name)=='basic'&&lib.inpile.contains(name)&&!player.getStorage('yilie_count').includes(name)){ var hs=player.getCards('hs'); if(hs.length<2) return false; var bool=false,map={}; @@ -8123,7 +8155,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } if(!bool) return false; for(var name of lib.inpile){ - if(get.type(name)!='basic'||list.contains(name)) continue; + if(get.type(name)!='basic'||list.includes(name)) continue; var card={name:name}; if(event.filterCard(card,player,event)) return true; if(name=='sha'){ @@ -8138,10 +8170,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ chooseButton:{ dialog:function(event,player){ var list=[]; - var storage=player.storage.yilie_count; + var storage=player.getStorage('yilie_count'); for(var i of lib.inpile){ - if(get.type(i)!='basic') continue; - if(storage&&storage.contains(i)) continue; + if(get.type(i)!='basic'||storage.includes(i)) continue; var card={name:i,isCard:true}; if(event.filterCard(card,player,event)) list.push(['基本','',i]); if(i=='sha'){ @@ -8154,25 +8185,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return ui.create.dialog('义烈',[list,'vcard'],'hidden') }, check:function(button){ - let player=_status.event.player,hs=player.getCards('h',card=>{ - return get.name(card)!==button.link[2]&&(!button.link[3]||get.hasNature(card,button.link[3])); - }),bool=false,map={}; - for(let i of hs){ - let color=get.color(i); - if(!map[color]) map[color]=true; - else{ - bool=true; - break; + var player=_status.event.player; + var evt=_status.event.getParent(); + var name=button.link[2],card={name:name,nature:button.link[3]}; + if(name=='shan') return 2; + if(evt.type=='dying'){ + if(get.attitude(player,evt.dying)<2) return 0; + if(name=='jiu') return 2.1; + return 1.9; + } + if(evt.type=='phase'){ + if(button.link[2]=='jiu'){ + if(player.getUseValue({name:'jiu'})<=0) return 0; + var cards=player.getCards('hs',cardx=>get.value(cardx)<8); + cards.sort((a,b)=>get.value(a)-get.value(b)); + if(cards.some(cardx=>get.name(cardx)=='sha'&&!cards.slice(0,2).includes(cardx))) return player.getUseValue({name:'jiu'}); + return 0; } + return player.getUseValue(card)/4; } - if(!bool) return 0; - if(button.link[2]=='shan') return 3; - if(button.link[2]=='jiu'){ - if(player.getUseValue({name:'jiu'})<=0) return 0; - if(player.countCards('h','sha')) return player.getUseValue({name:'jiu'}); - return 0; - } - return player.getUseValue({name:button.link[2],nature:button.link[3]})/4; + return 1; }, backup:function(links,player){ return { @@ -8187,10 +8219,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, position:'hs', complexCard:true, - check:(card)=>{ - if(get.name(card)===lib.skill.yilie_backup.viewAs.name&&(!lib.skill.yilie_backup.viewAs.nature||game.hasNature(card,lib.skill.yilie_backup.viewAs.nature))) return -1; - return 8-get.value(card); - }, + check:(card)=>8-get.value(card), popname:true, viewAs:{ name:links[0][2], @@ -8211,12 +8240,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, ai:{ order:function(item,player){ - return 2.6; + if(player&&_status.event.type=='phase'){ + var add=false,max=0; + var names=lib.inpile.filter(name=>get.type(name)=='basic'&&!player.getStorage('yilie_count').includes(name)); + if(names.includes('sha')) add=true; + names=names.map(namex=>{return {name:namex}}); + if(add) lib.inpile_nature.forEach(nature=>names.push({name:'sha',nature:nature})); + names.forEach(card=>{ + if(player.getUseValue(card)>0){ + var temp=get.order(card); + if(card.name=='jiu'){ + var cards=player.getCards('hs',cardx=>get.value(cardx)<8); + cards.sort((a,b)=>get.value(a)-get.value(b)); + if(!cards.some(cardx=>get.name(cardx)=='sha'&&!cards.slice(0,2).includes(cardx))) temp=0; + } + if(temp>max) max=temp; + } + }); + if(max>0) max-=0.001; + return max; + } + return 0.5; }, respondShan:true, respondSha:true, fireAttack:true, - skillTagFilter:function(player,tag){ + skillTagFilter:function(player,tag,arg){ + if(arg=='respond') return false; var hs=player.getCards('hs'); if(hs.length<2) return false; var bool=false,map={}; @@ -26628,6 +26678,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ oldhuxiao_info:'锁定技,当你使用的【杀】被【闪】抵消后,你令此【杀】不计入使用次数。', oldwuji:'武继', oldwuji_info:'觉醒技,结束阶段,若你本回合造成了3点或更多伤害,你加1点体力上限并回复1点体力,并失去技能〖虎啸〗。', + olfeiyang:'飞扬', + //olfeiyang_info:'限定技。准备阶段,你可以弃置两张牌,然后弃置判定区的一张牌。', + olfeiyang_info:'准备阶段,你可以弃置三张牌,然后弃置判定区的一张牌。', sp_tianji:'天极·皇室宗亲', diff --git a/character/sp2.js b/character/sp2.js index e02ed2e54..fd190e554 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -8366,7 +8366,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addTempSkill(result.control); player.storage.pingjian_check[result.control]=(trigger.name=='damage'?trigger:'phaseJieshu'); var name=event.list.find(name=>lib.character[name][3].includes(result.control)); - if(name) lib.skill.rehuashen.createAudio(name,result.control,'xushao'); + // if(name) lib.skill.rehuashen.createAudio(name,result.control,'xushao'); + if(name) game.broadcastAll((player,name)=>player.tempname.add(name),player,name); }, group:'pingjian_use', phaseUse_special:[], @@ -8454,7 +8455,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addTempSkill(result.control); player.storage.pingjian_check[result.control]='phaseUse'; var name=event.list.find(name=>lib.character[name][3].includes(result.control)); - if(name) lib.skill.rehuashen.createAudio(name,result.control,'xushao'); + // if(name) lib.skill.rehuashen.createAudio(name,result.control,'xushao'); + if(name) game.broadcastAll((player,name)=>player.tempname.add(name),player,name); }, ai:{order:12,result:{player:1}}, }, @@ -8473,6 +8475,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ var skill=trigger.sourceSkill||trigger.skill; player.removeSkill(skill); + const names=player.tempname&&player.tempname.filter(i=>lib.character[i][3].includes(skill)); + if(names) game.broadcastAll((player,names)=>player.tempname.removeArray(names),player,names); delete player.storage.pingjian_check[skill]; }, group:'pingjian_check2', @@ -8495,6 +8499,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return player.storage.pingjian_check[skill]==trigger; }); player.removeSkill(skills); + const names=player.tempname&&player.tempname.filter(i=>skills.some(skill=>lib.character[i][3].includes(skill))); + if(names) game.broadcastAll((player,names)=>player.tempname.removeArray(names),player,names); for(var skill of skills) delete player.storage.pingjian_check[skill]; }, }, diff --git a/character/xianjian.js b/character/xianjian.js index 29824d23c..b3d6a1a44 100644 --- a/character/xianjian.js +++ b/character/xianjian.js @@ -100,7 +100,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.draw(3); player.addSkill('shuiyun'); 'step 1' - game.createTrigger('phaseEnd','shuiyun',player,trigger); + if(lib.filter.filterTrigger(trigger,player,'phaseEnd','shuiyun')) game.createTrigger('phaseEnd','shuiyun',player,trigger); }, }, shenwu:{ diff --git a/character/yijiang.js b/character/yijiang.js index 9d7841886..e890f60a6 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -5114,7 +5114,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, jyzongshi:{ audio:2, - audioname:['re_jianyong'], + audioname:['re_jianyong','ol_jianyong'], trigger:{player:['chooseToCompareAfter','compareMultipleAfter'],target:['chooseToCompareAfter','compareMultipleAfter']}, filter:function(event,player){ if(event.preserve) return false; @@ -10272,6 +10272,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audioname2:{ re_jianyong:'reqiaoshui', xin_jianyong:'xinqiaoshui', + ol_jianyong:'olqiaoshui', }, trigger:{player:'useCard2'}, filter:function(event,player){ @@ -13910,7 +13911,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ masu:['xin_masu','re_masu','masu'], xusheng:['xusheng','xin_xusheng','re_xusheng','old_xusheng'], wuguotai:['wuguotai','xin_wuguotai','re_wuguotai'], - lingtong:['lingtong','xin_lingtong','re_lingtong','old_lingtong'], + lingtong:['lingtong','xin_lingtong','ol_lingtong','re_lingtong','old_lingtong'], gaoshun:['gaoshun','xin_gaoshun','re_gaoshun','old_gaoshun'], zhonghui:['zhonghui','xin_zhonghui','re_zhonghui','old_zhonghui','pe_zhonghui'], wangyi:['wangyi','re_wangyi','old_wangyi'], @@ -13925,7 +13926,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ manchong:['manchong','re_manchong'], caochong:['caochong','re_caochong','old_caochong'], guohuai:['guohuai','re_guohuai','xin_guohuai','tw_guohuai','ol_guohuai'], - jianyong:['jianyong','re_jianyong','xin_jianyong'], + jianyong:['jianyong','ol_jianyong','re_jianyong','xin_jianyong'], panzhangmazhong:['panzhangmazhong','re_panzhangmazhong','xin_panzhangmazhong'], yufan:['yufan','xin_yufan','re_yufan'], zhuran:['zhuran','re_zhuran','xin_zhuran','old_zhuran'], diff --git a/character/yingbian.js b/character/yingbian.js index 03d5af096..0d9bfa30c 100644 --- a/character/yingbian.js +++ b/character/yingbian.js @@ -31,7 +31,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ characterSort:{ yingbian:{ yingbian_pack1:['jin_simayi','jin_zhangchunhua','ol_lisu','simazhou','cheliji','ol_huaxin'], - yingbian_pack2:['jin_simashi','jin_xiahouhui','zhanghuyuechen','shibao','jin_yanghuiyu'], + yingbian_pack2:['jin_simashi','jin_xiahouhui','zhanghuyuechen','shibao','jin_yanghuiyu','chengjichengcui'], yingbian_pack3:['jin_simazhao','jin_wangyuanji','duyu','weiguan','xuangongzhu'], yingbian_pack4:['zhongyan','xinchang','jin_jiachong','wangxiang'], yingbian_pack5:['yangyan','yangzhi'], diff --git a/game/game.js b/game/game.js index 085ff696f..1a58faa54 100644 --- a/game/game.js +++ b/game/game.js @@ -181,7 +181,7 @@ new Promise(resolve=>{ extensions:[], extensionPack:{}, cardType:{}, - hook:{globaltrigger:{},globalskill:{}}, + hook:{globalskill:{}}, //函数钩子 hooks:{ // 本体势力的颜色 @@ -417,7 +417,7 @@ new Promise(resolve=>{ // TODO: handle the error. reject(new Error()); break; - case "receiving": + case "receiving":{ /** * @type {PromiseResolve} */ @@ -427,6 +427,7 @@ new Promise(resolve=>{ this.status = "active"; resolve(); break ; + } case "active": this.status = "sending"; this._buffer = [value, resolve]; @@ -447,7 +448,7 @@ new Promise(resolve=>{ // TODO: handle the error. reject(new Error()); break; - case "sending": + case "sending":{ /** * @type {[T, PromiseResolve]} */ @@ -457,6 +458,7 @@ new Promise(resolve=>{ this.status = "active"; buffer[1](); break ; + } case "active": this.status = "receiving"; this._buffer = resolve; @@ -6267,6 +6269,12 @@ new Promise(resolve=>{ frequent:true, intro:'最后行动的角色起始手牌数+1' }, + connect_olfeiyang_four:{ + name:'四号位获得【飞扬】', + init:true, + frequent:true, + intro:'最后行动的角色获得技能【飞扬】(准备阶段,你可以弃置三张牌,然后弃置判定区的一张牌)', + }, connect_choice_num:{ name:'侯选武将数', init:'20', @@ -6370,12 +6378,14 @@ new Promise(resolve=>{ } if(config.versus_mode=='two'){ map.replace_handcard_two.show(); + map.olfeiyang_four.show(); map.replace_character_two.show(); map.two_assign.show(); map.two_phaseswap.show(); } else{ map.replace_handcard_two.hide(); + map.olfeiyang_four.hide(); map.replace_character_two.hide(); map.two_assign.hide(); map.two_phaseswap.hide(); @@ -6550,6 +6560,12 @@ new Promise(resolve=>{ frequent:true, intro:'最后行动的角色起始手牌+1' }, + olfeiyang_four:{ + name:'四号位获得【飞扬】', + init:true, + frequent:true, + intro:'最后行动的角色获得技能【飞扬】(准备阶段,你可以弃置三张牌,然后弃置判定区的一张牌)', + }, replace_character_two:{ name:'替补模式', init:false, @@ -14798,270 +14814,142 @@ new Promise(resolve=>{ }, arrangeTrigger:function(){ 'step 0' - event.filter1=function(info){ - if(info[1].isDead()&&!lib.skill[info[0]].forceDie) return false; - if(info[1].isOut()&&!lib.skill[info[0]].forceOut) return false; - return lib.filter.filterTrigger(trigger,info[1],event.triggername,info[0]); - } - event.filter2=function(info2){ - var info=lib.skill[info2[0]]; - if(!lib.translate[info2[0]]||info.silent) return false; - return true; - } - event.filter3=function(info,info2){ - return event.filter2(info2)&&event.filter1(info2)&&info2[1]==info[1]&&info[2]==info2[2]&&(lib.skill.global.contains(info2[0])||info[1].hasSkill(info2[0],true)); - } + event.noDirectUse=info=>!lib.skill[info.skill].silent&&lib.translate[info.skill];//是否触发同顺序选择 'step 1' - if(trigger.filterStop&&trigger.filterStop()){ - event.finish(); - } - else if(event.list.length){ - var info=event.list.shift(); - game.createTrigger(event.triggername,info[0],info[1],trigger); - event.redo(); - } + if(event.doing&&event.doing.todoList.length) return; + if(event.doingList.length) return event.doing=event.doingList.shift(); + event.finish(); 'step 2' - if(!event.map.length){ - if(event.list2.length){ - var info=event.list2.shift(); - game.createTrigger(event.triggername,info[0],info[1],trigger); - event.redo(); - } - else{ - if(trigger._triggering==this){ - delete trigger._triggering; - } - event.finish(); - return; - } + if(trigger.filterStop&&trigger.filterStop()) return event.finish(); + const current=event.doing.todoList.find(info=>lib.filter.filterTrigger(trigger,info.player,event.triggername,info.skill)); + if(!current){ + event.doing.todoList=[]; + return event.goto(1); } - event.doing=event.map.shift(); + event.doing.todoList=event.doing.todoList.filter(i=>i.priority<=current.priority); + event.num=event.doing.todoList.indexOf(current); + if(!event.noDirectUse(current)) return event.goto(5); + event.choice=event.doing.todoList.filter(info=>{ + if(!lib.filter.filterTrigger(trigger,info.player,event.triggername,info.skill)) return false; + if(!event.noDirectUse(info)) return false; + if(current.skill!=info.skill) return false; + if(current.player!=info.player) return false; + return lib.skill.global.includes(info.skill)||current.player.hasSkill(info.skill,true); + }); + if(event.choice.length<2) event.goto(5); 'step 3' - event.num=0; - var bool=false; - var list=event.doing.list; - for(var i=0;ipriority){ - event.doing.list.splice(i--,1); - event.num--; - } - } - event.choice=[]; - if(event.numi.skill)); + next.set('prompt','选择下一个触发的技能'); + next.set('forceDie',true); + next.set('arrangeSkill',true); + next.set('includeOut',true); 'step 4' - var controls=[]; - event.current=event.choice[0][1] - for(var i=0;iinfo.skill==result.control&&info.player==event.choice[0].player); 'step 5' - if(result.control){ - for(var i=0;i