From 50dc78de67618b45dbe01239edeb80c10ab28266 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Mon, 5 Jun 2023 20:28:32 +0800 Subject: [PATCH] final hit --- character/diy.js | 5 +-- character/rank.js | 7 ++++ character/refresh.js | 8 ++-- character/shenhua.js | 5 +-- character/sp.js | 2 + character/sp2.js | 94 ++++++++++++++++++++++--------------------- character/tw.js | 52 +++++++++--------------- character/yijiang.js | 3 +- character/yingbian.js | 45 +++++++++++++-------- game/game.js | 8 ++-- 10 files changed, 116 insertions(+), 113 deletions(-) diff --git a/character/diy.js b/character/diy.js index 7eb4d7158..ff2224b24 100755 --- a/character/diy.js +++ b/character/diy.js @@ -75,7 +75,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ db_key_liyingxia:['female','shu',3,['liyingxia_sanli','liyingxia_zhenjun','liyingxia_wumai'],['doublegroup:shu:key']], key_erika:['female','key','3/3/2',['erika_shisong','erika_yousheng']], key_satomi:['female','key',3,['satomi_luodao','satomi_daohai']], - key_iriya:['female','key',3,['iriya_yinji','iriya_haozhi']], + key_iriya:['female','key',3,['iriya_yinji','iriya_haozhi'],['unseen']], key_kud:['female','key',3,['kud_qiaoshou','kud_buhui']], key_misuzu:['female','key',3,['misuzu_hengzhou','misuzu_nongyin','misuzu_zhongxing']], @@ -8799,8 +8799,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:'phaseUse', discard:false, line:true, - direct:true, - clearTime:true, + log:false, delay:false, lose:false, prepare:function(cards,player,targets){ diff --git a/character/rank.js b/character/rank.js index c02419813..06c78f4ec 100644 --- a/character/rank.js +++ b/character/rank.js @@ -43,6 +43,7 @@ window.noname_character_rank={ 'noname', 'sb_machao', 'dc_zhouxuān', + 'key_iriya', ], ap:[ 'gjqt_aruan', @@ -296,6 +297,7 @@ window.noname_character_rank={ 'zhanghua', 'zerong', 'wangguan', + 'duanqiaoxiao', 'key_misuzu', 'key_sunohara', 'key_umi', @@ -908,6 +910,8 @@ window.noname_character_rank={ 'xia_zhaoe', 'zhangkai', 'sunhong', + 'zhangjinyun', + 'dc_mengda', ], b:[ 'diy_feishi', @@ -1619,6 +1623,7 @@ window.noname_character_rank={ 'tw_jiangji', 'tw_niufudongxie', 'tw_shen_lvmeng', + 'zhangjinyun', 'key_tomoya', 'key_masato', 'key_shiorimiyuki', @@ -1843,6 +1848,7 @@ window.noname_character_rank={ 'mengjie', 'dc_ruiji', 'xia_zhaoe', + 'duanqiaoxiao', 'key_kano', 'key_haruko', 'key_akiko', @@ -1876,6 +1882,7 @@ window.noname_character_rank={ 'key_yukito', 'key_kotomi', 'db_key_liyingxia', + 'key_iriya', ], rare:[ 'pal_shenqishuang', diff --git a/character/refresh.js b/character/refresh.js index becea47f5..a671265e1 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -3912,8 +3912,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ lose:false, delay:false, line:true, - direct:true, - clearTime:true, prepare:function(cards,player,targets){ targets[0].logSkill('xinhuangtian'); }, @@ -4554,7 +4552,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ threaten:0.8, effect:{ target:function(card,player,target){ - if(get.tag(card,'damage')){ + if(get.tag(card,'damage')&&!target.storage.xinzili){ if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; if(!target.hasFriend()) return; if(target.hp>=4) return [0.5,get.tag(card,'damage')*2]; @@ -5338,7 +5336,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(event.card.name!='sha'||event.card.nature!='fire') return false; return game.hasPlayer(function(current){ - return !event.targets.contains(current)&&player.canUse(event.card,current); + return !event.targets.contains(current)&&lib.filter.targetEnabled(event.card,player,current)&&lib.filter.targetInRange(event.card,player,current); }); }, direct:true, @@ -13536,7 +13534,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, trigger:{source:'damageEnd'}, locked:true, - direct:true, + forced:true, filter:function(event,player){ if(event.name=='chooseToUse') return player.hasCard(card=>get.suit(card)=='spade','hs'); return event.card&&event.card.name=='sha'&&event.getParent(2).jiu==true&&!player.hasSkill('oljiuchi_air'); diff --git a/character/shenhua.js b/character/shenhua.js index 6bd6f20ea..d88b507d4 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -3886,8 +3886,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filterTarget:function(card,player,target){ return target.hasZhuSkill('zhiba',player)&&player.canCompare(target); }, - direct:true, - clearTime:true, + log:false, prepare:function(cards,player,targets){ targets[0].logSkill('zhiba'); }, @@ -7356,8 +7355,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ lose:false, delay:false, line:true, - direct:true, - clearTime:true, prepare:function(cards,player,targets){ targets[0].logSkill('huangtian'); }, diff --git a/character/sp.js b/character/sp.js index 50bcd6f89..21f94a707 100755 --- a/character/sp.js +++ b/character/sp.js @@ -13,6 +13,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_huben:["caohong","xiahouba","zhugeke","zumao","wenpin","litong","mazhong","heqi","quyi","luzhi","zangba","yuejin","dingfeng","wuyan","ol_zhuling","tianyu","huojun",'zhaoyǎn','dengzhong','ol_furong','macheng','ol_zhangyì','ol_zhujun','maxiumatie'], sp_liesi:['mizhu','weizi','ol_liuba'], sp_default:["sp_diaochan","sp_zhaoyun","sp_sunshangxiang","sp_caoren","sp_jiangwei","sp_machao","sp_caiwenji","jsp_guanyu","jsp_huangyueying","sp_pangde","sp_jiaxu","yuanshu",'sp_zhangliao','sp_ol_zhanghe','sp_menghuo'], + sp_waitforsort:['sunhong','luoxian','ol_huban','wangguan'], sp_qifu:["caoying",'panshu',"caochun","yuantanyuanshang",'caoshuang','wolongfengchu','guansuo','baosanniang','fengfangnv','jin_zhouchu'], sp_wanglang:['wanglang'], sp_tongque:["sp_fuwan","sp_fuhuanghou","sp_jiben"], @@ -22887,6 +22888,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_guozhan:"国战", sp_guozhan2:"国战移植", sp_others:"其他", + sp_waitforsort:'等待分包', sp_single:'新1v1', }, }; diff --git a/character/sp2.js b/character/sp2.js index 05c60dc5d..73e5354f2 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -437,47 +437,49 @@ game.import('character',function(lib,game,ui,get,ai,_status){ onremove:function(player){ player.removeSkill('dcjijiao_machi'); }, - filter:function(event,player){ - var cardsx=Array.from(ui.discardPile.childNodes); - var history=_status.globalHistory; - for(var i=0;iget.type(i)=='trick'&&cardsx.contains(i))) return true; - } + onChooseToUse:function(event){ + if(event.dcjijiao==undefined&&!game.online){ + var bool=lib.skill.dcjijiao.getCards(event.player,true); + event.set('dcjijiao',bool); } - return false; + }, + filter:function(event,player){ + return event.dcjijiao; }, filterTarget:true, + getCards:function(player,bool){ + var cards=Array.from(ui.discardPile.childNodes); + var gains=cards.slice(0); + var history=game.getAllGlobalHistory('cardMove',function(evt){ + if(evt.name=='lose') return evt.position==ui.discardPile; + return evt.name=='cardsDiscard'; + }); + for(var i=history.length-1;i>=0;i--){ + var evt=history[i]; + var cards2=evt.cards.filter(function(card){ + return cards.contains(card); + }); + if(cards2.length){ + if(!lib.skill.dcjijiao.isUse(evt,player)){ + gains.removeArray(cards2); + } + cards.removeArray(cards2); + } + if(!cards.length) break; + } + if(bool) return gains.some(card=>get.type2(card,false)=='trick'); + return gains.filter(card=>get.type2(card,false)=='trick'); + }, + isUse:function(event,player){ + if(event.name!='cardsDiscard') return (event.type=='discard'&&event.player==player); + var evtx=event.getParent(); + if(evtx.name!='orderingDiscard') return false; + var evt2=(evtx.relatedEvent||evtx.getParent()); + return (evt2.name=='useCard'&&evt2.player==player); + }, content:function(){ player.awakenSkill('dcjijiao'); - var cardsx=Array.from(ui.discardPile.childNodes); - var cards=[]; - game.getAllGlobalHistory('cardMove',evt=>{ - var cards2=[]; - if(evt.type=='discard') cards2=evt.getl(player).cards2; - else{ - var evtx=evt.getParent(); - if(evtx.name!='orderingDiscard') return; - var evtx2=evtx.relatedEvent||evtx.getParent(); - if(evtx2&&evtx2.name=='useCard'){ - if(!evt.getd) return; - cards2=evt.getd(player); - } - } - cards.addArray(cards2.filter(i=>get.type(i)=='trick'&&cardsx.contains(i))); - }); + var cards=lib.skill.dcjijiao.getCards(player); if(cards.length){ target.gain(cards,'gain2').gaintag.add('dcjijiao'); target.addSkill('dcjijiao_nowuxie'); @@ -513,9 +515,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ popup:false, trigger:{global:'phaseAfter'}, content:function(){ - player.restoreSkill('dcjijiao'); - game.log(player,'重置了','#g【继椒】'); - player.removeSkill('dcjijiao_machi'); + if(player.awakenedSkills.contains('dcjijiao')){ + player.restoreSkill('dcjijiao'); + game.log(player,'重置了','#g【继椒】'); + //player.removeSkill('dcjijiao_machi'); + } player.removeSkill('dcjijiao_risutoa'); } }, @@ -539,7 +543,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger.nowuxie=true; }, onremove:function(player){ - player.removeGaintag('kousheng'); + player.removeGaintag('dcjijiao'); }, } } @@ -586,8 +590,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var color=event.judgeResult.color; var player=event.getParent(2).player; var cards=event.getParent(2).cardsx; - for(var card of cards){ - if(get.color(card)==color){ + for(var cardx of cards){ + if(get.color(cardx)==color){ if(get.position(card,true)=='o') player.gain(card,'gain2'); return; } @@ -5689,11 +5693,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ intro:{ content:'limited' }, - direct:true, content:function(){ 'step 0' player.awakenSkill('dcyongdi'); - player.logSkill('dcyongdi',target); + //player.logSkill('dcyongdi',target); if(!game.hasPlayer(current=>current.maxHp=0;i--){ + for(var i=history.length-2;i>=0;i--){ for(var j=0;j{ + onChooseToUse:function(event){ + if(!game.online){ + var num=1; + game.countPlayer2(current=>{ var history=current.actionHistory; - for(var i=history.length-1;i>=0;i--){ - for(var evt of history[i].useSkill){ - if(evt.skill=='twluannian_global') num++; + for(var i=history.length-1;i>=0;i--){ + for(var evt of history[i].useSkill){ + if(evt.skill=='twluannian_global') num++; + } + if(history[i].isRound) break; } - } - }); - return player.group=='qun'&&player.countCards('he')>=num&&game.hasPlayer(function(current){ + }); + event.set('twluannian_num',num); + } + }, + filter:function(event,player){ + if(!event.twluannian_num) return false; + return player.group=='qun'&&player.countCards('he')>=event.twluannian_num&&game.hasPlayer(function(current){ var target=current.storage.twxiongzheng_target; return target&&target.isIn()&¤t!=player&¤t.hasZhuSkill('twluannian',player) }) @@ -1799,31 +1805,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ position:'he', prompt:function(){ var player=_status.event.player; - var num=1; - game.countPlayer2(current=>{ - var history=current.actionHistory; - for(var i=history.length-1;i>=0;i--){ - for(var evt of history[i].useSkill){ - if(evt.skill=='twluannian_global') num++; - } - } - }); + var num=_status.event.twluannian_num var list=game.filterPlayer(function(current){ return current.hasZhuSkill('twluannian',player); }).map(i=>i.storage.twxiongzheng_target).sortBySeat(); return '弃置'+get.cnNumber(num)+'张牌,对'+get.translation(list)+(list.length>1?'中的一人':'')+'造成1点伤害'; }, selectCard:function(){ - var num=1; - game.countPlayer2(current=>{ - var history=current.actionHistory; - for(var i=history.length-1;i>=0;i--){ - for(var evt of history[i].useSkill){ - if(evt.skill=='twluannian_global') num++; - } - } - }); - return num; + return _status.event.twluannian_num; }, complexSelect:true, complexCard:true, @@ -10264,12 +10253,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ usable:1, mahouSkill:true, filter:function(event,player){ - return !player.hasSkill('twzhouzu_mahou') + return !player.hasSkill('twzhouzu_mahou'); }, filterTarget:function(card,player,target){ return player!=target; }, - direct:true, line:false, delay:false, content:function(){ diff --git a/character/yijiang.js b/character/yijiang.js index e1412a56d..fa792cbc3 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -4357,7 +4357,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return current.hasSkill('wengua'); }); }, - direct:true, + log:false, delay:false, filterCard:true, discard:false, @@ -13073,7 +13073,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return false; }, forceaudio:true, - direct:true, prompt:'弃置一名有【逆】的角色的两张【逆】,然后视为对包含其在内的角色使用【杀】。', delay:false, log:false, diff --git a/character/yingbian.js b/character/yingbian.js index cad77da5b..d74a3bab0 100644 --- a/character/yingbian.js +++ b/character/yingbian.js @@ -819,29 +819,41 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:'qimei', charlotte:true, forced:true, + popup:false, trigger:{global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','loseAfter','gainAfter','addToExpansionAfter']}, - logTarget:function(event,player){ - return player.storage.qimei_draw; - }, usable:1, filter:function(event,player){ var target=player.storage.qimei_draw; if(!target||!target.isIn()) return false; - if(event.name!='gain'||(event.player!=player&&event.player!=target)){ - var evt1=event.getl(player); - if(!evt1||!evt1.hs||!evt1.hs.length){ - var evt2=event.getl(target); - if(!evt2||!evt2.hs||!evt2.hs.length) return false; - } - } - return player.countCards('h')==target.countCards('h'); + if(player.countCards('h')!=target.countCards('h')) return false; + var hasChange=function(event,player){ + var gain=0,lose=0; + if(event.getg) gain=event.getg(player).length; + if(event.getl) lose=event.getl(player).hs.length; + return gain!=lose; + }; + return hasChange(event,player)||hasChange(event,target); }, content:function(){ + 'step 0' if(trigger.delay===false) game.delayx(); - var evt1=trigger.getl(player); - if((trigger.name=='gain'&&player==trigger.player)||(evt1&&evt1.hs&&evt1.hs.length)) player.storage.qimei_draw.draw(); - var evt2=trigger.getl(player.storage.qimei_draw); - if((trigger.name=='gain'&&player==player.storage.qimei_draw)||evt2&&evt2.hs&&evt2.hs.length) player.draw(); + 'step 1' + var target=player.storage.qimei_draw; + player.logSkill('qimei_draw',target); + var drawer=[]; + var hasChange=function(event,player){ + var gain=0,lose=0; + if(event.getg) gain=event.getg(player).length; + if(event.getl) lose=event.getl(player).hs.length; + return gain!=lose; + }; + if(hasChange(trigger,player)) drawer.push(target); + if(hasChange(trigger,target)) drawer.push(player); + if(drawer.length==1) drawer[0].draw(); + else{ + game.asyncDraw(drawer.sortBySeat()); + game.delayex(); + } }, group:'qimei_hp', onremove:true, @@ -2633,8 +2645,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ lose:false, delay:false, line:true, - direct:true, - clearTime:true, + log:false, prepare:function(cards,player,targets){ targets[0].logSkill('ruilve'); }, diff --git a/game/game.js b/game/game.js index 4035894b1..774d556b1 100644 --- a/game/game.js +++ b/game/game.js @@ -12682,7 +12682,7 @@ if(game.modeSwapPlayer&&!_status.auto&&player.isUnderControl()&&!lib.filter.wuxieSwap(event)){ game.modeSwapPlayer(player); } - var skills=player.getSkills(true); + var skills=player.getSkills('invisible').concat(lib.skill.global); game.expandSkills(skills); for(var i=0;i