From 648c9854e1ba0494fe2ffb7bba6d6ecdced0069e Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Mon, 11 Mar 2024 00:00:42 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E4=BC=98=E5=8C=96changeSkin=E6=8D=A2?= =?UTF-8?q?=E8=82=A4=E7=9A=84=E6=B5=81=E7=95=85=E6=84=9F=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0changeSkin=E7=9A=84=E5=BD=95=E5=83=8F=E5=9B=9E?= =?UTF-8?q?=E6=94=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/game/index.js | 12 ++++++++++++ noname/library/element/player.js | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/noname/game/index.js b/noname/game/index.js index f0ffc7fdf..1cf3137a4 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -2721,6 +2721,18 @@ export class Game extends Uninstantable { } } }, + changeSkin: function (player, map) { + if (!player || !map) return; + player.tempname.remove(map.from); + player.tempname.add(map.to); + player.skin[name] = map.to; + const goon = (!lib.character[map.to]); + if (goon) lib.character[map.to] = ['', '', 0, [], (map.list.find(i => i[0] == map.to) || [map.to, []])[1]]; + player.smoothAvatar(map.avatar2); + player.node['avatar' + map.name.slice(4)].setBackground(map.to, 'character'); + player.node['avatar' + map.name.slice(4)].show(); + if (goon) delete lib.character[map.to]; + }, skill: function (player, content) { if (typeof content == 'string') { if (lib.skill[content]) lib.skill[content].video(player); diff --git a/noname/library/element/player.js b/noname/library/element/player.js index 9b223b5ea..566a75fcf 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -2335,16 +2335,25 @@ export class Player extends HTMLDivElement { if ((get.character(this[i], 3) || []).includes(skill)) { const name = (i == 'name2' ? 'name2' : 'name'); if (this.skin[name] != character) { - game.broadcastAll((player, name, character, list) => { - player.tempname.remove(player.skin[name]); + const origin = this.skin[name]; + game.broadcastAll((player, name, character, list, origin) => { + player.tempname.remove(origin); player.tempname.add(character); player.skin[name] = character; const goon = (!lib.character[character]); if (goon) lib.character[character] = ['', '', 0, [], (list.find(i => i[0] == character) || [character, []])[1]]; + player.smoothAvatar(name == 'name2'); player.node['avatar' + name.slice(4)].setBackground(character, 'character'); player.node['avatar' + name.slice(4)].show(); if (goon) delete lib.character[character]; - }, this, name, character, list); + }, this, name, character, list, origin); + game.addVideo('changeSkin', this, { + from: origin, + to: character, + name: name, + list: list, + avatar2: name == 'name2', + }); } } } From 0ef71f490586d251f1fc26683971486fcb30e26c Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Mon, 11 Mar 2024 00:05:37 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B9=90=E5=A4=A7?= =?UTF-8?q?=E4=B9=94=E3=80=90=E5=A7=8A=E5=B8=8C=E3=80=91=E5=BD=95=E5=83=8F?= =?UTF-8?q?=E5=9B=9E=E6=94=BEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/character/huicui.js b/character/huicui.js index 0b8c2f5d8..b09d28b71 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -1200,22 +1200,24 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dczixi:{ init(){ game.addGlobalSkill('dczixi_judge'); - game.broadcastAll((list)=>{ - list.forEach(name=>{ - const namex='dczixi_'+name; - if(!lib.card[namex]){ - lib.card[namex]={ - type:'special_delay', - fullskin:true, - noEffect:true, - wuxieable:false, - }; - lib.card[namex].cardimage=name; - lib.translate[namex]=lib.translate[name]+'·姊希'; - lib.translate[namex+'_info']='由【姊希】技能创造的无效果【'+lib.translate[name]+'】'; - } - }); - },lib.skill.dczixi.zixiList); + game.broadcastAll(()=>lib.skill.dczixi.video()); + }, + video(){ + const list=lib.skill.dczixi.zixiList; + for(const name of list){ + const namex='dczixi_'+name; + if(!lib.card[namex]){ + lib.card[namex]={ + type:'special_delay', + fullskin:true, + noEffect:true, + wuxieable:false, + }; + lib.card[namex].cardimage=name; + lib.translate[namex]=lib.translate[name]+'·姊希'; + lib.translate[namex+'_info']='由【姊希】技能创造的无效果【'+lib.translate[name]+'】'; + } + } }, audio:2, trigger:{player:['phaseUseBegin','phaseUseEnd']}, @@ -1229,6 +1231,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ zixiList:['lebu','bingliang','shandian'], direct:true, async content(event,trigger,player){ + game.addVideo('skill',player,['dczixi',[]]); const names=lib.skill.dczixi.zixiList.filter(name=>{ return player.countCards('h',card=>{ return card.hasGaintag('dcqiqin_tag')&&game.hasPlayer(target=>target.canAddJudge(get.autoViewAs({name:'dczixi_'+name},[card]))); From 85f24a559efab0a10fd7e63007143f74af023f26 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Mon, 11 Mar 2024 12:00:51 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E8=B0=8B=E5=8F=B8=E9=A9=AC=E6=87=BFaudio?= =?UTF-8?q?name=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/xianding.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/character/xianding.js b/character/xianding.js index 1309d0f4d..ef1e5a1ce 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -181,8 +181,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, subSkill:{ true:{ - audio:'dcsbquanmou', charlotte:true, + audio:'dcsbquanmou', + audioname:['dc_sb_simayi_shadow'], trigger:{source:'damageSource'}, forced:true, popup:false, @@ -239,8 +240,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, false:{ - audio:'dcsbquanmou', charlotte:true, + audio:'dcsbquanmou', + audioname:['dc_sb_simayi_shadow'], trigger:{source:'damageBegin2'}, forced:true, filter(event,player){ @@ -288,6 +290,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, dcsbpingliao:{ audio:2, + audioname:['dc_sb_simayi_shadow'], trigger:{player:'useCard0'}, forced:true, filter(event,player){ From fbf9bdd22bb5083152f25d234ee1c524cd7d3eea Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Mon, 11 Mar 2024 12:03:30 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E6=9B=B9=E7=88=BD=E3=80=90=E6=B8=90?= =?UTF-8?q?=E4=B8=93=E3=80=91=E9=87=8D=E9=93=B8=E9=A1=B9bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/character/huicui.js b/character/huicui.js index b09d28b71..36533b97c 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -200,6 +200,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 1; }, async content(player,num=1){ + if(!player.hasCard(lib.filter.cardRecastable,'he')) return; const {result:{bool,cards}}=await player.chooseCard('重铸'+num+'张牌','he',num,lib.filter.cardRecastable,true).set('ai',lib.skill.zhiheng.check); if(bool) await player.recast(cards); }, @@ -304,9 +305,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.getStorage('dcjianzhuan').includes(i)) choices.push(i); } if(choices.length){ - const choice=choices.randomGet(); - for(let i=1;i<=3;i++){ - await info[choice].content(player,1); + for(const choice of choices){ + for(let i=1;i<=3;i++){ + await info[choice].content(player,1); + } } } await player.gainMaxHp(2); From dfadffa300f6654ae2ad877b547848918a5bce31 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Mon, 11 Mar 2024 12:37:43 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=9B=B9=E8=82=87=E3=80=90=E5=A4=8D?= =?UTF-8?q?=E7=BA=82=E3=80=91bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/tw.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/character/tw.js b/character/tw.js index 349eb7bf4..c85198830 100644 --- a/character/tw.js +++ b/character/tw.js @@ -11541,13 +11541,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filterTarget:function(card,player,target){ return target.getSkills(null,false,false).filter(function(i){ - return get.is.zhuanhuanji(i,current); + return get.is.zhuanhuanji(i,target); }).length>0; }, content:function(){ 'step 0' var list=target.getSkills(null,false,false).filter(function(i){ - return get.is.zhuanhuanji(i,current); + return get.is.zhuanhuanji(i,target); }); if(list.length==1){ event._result={control:list[0]}; From 3c3b7ed951bb8bba331336ddb0e29fa1397842f3 Mon Sep 17 00:00:00 2001 From: lieren2023 <131325076+lieren2023@users.noreply.github.com> Date: Mon, 11 Mar 2024 13:28:08 +0800 Subject: [PATCH 06/11] minor fix --- character/sb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/sb.js b/character/sb.js index 039f17ab1..2216f8ac4 100644 --- a/character/sb.js +++ b/character/sb.js @@ -55,7 +55,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sb_tong:['liucheng','sp_yangwan','sb_xiahoushi','sb_zhangfei','sb_zhaoyun','sb_sunce','sb_zhurong','sb_xiaoqiao'], sb_yu:['sb_yujin','sb_lvmeng','sb_huangzhong','sb_huanggai','sb_zhouyu','sb_caoren','sb_ganning','sb_yl_luzhi','sb_huangyueying'], sb_neng:['sb_huaxiong','sb_sunshangxiang','sb_jiangwei','sb_yuanshao','sb_menghuo','sb_guanyu'], - sb_waitforsort:['sb_xunyu'], + sb_waitforsort:['sb_xunyu','sb_xiahoudun','sb_gaoshun'], } }, characterSubstitute:{ From 548a1d3cc039f44ecbbdd3ff0f31b9198262068d Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Mon, 11 Mar 2024 15:46:30 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=AE=98=E6=B8=A1=E4=B9=8B=E6=88=98?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=85=81=E8=AE=B8=E5=90=8C=E5=90=8D=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/shenhua.js | 6 +- character/shiji.js | 4 +- character/sp.js | 2 +- character/sp2.js | 2 +- character/standard.js | 2 +- character/yijiang.js | 3 +- character/yingbian.js | 1 + mode/versus.js | 195 +++++++++++++++++++++++++++++++----------- 8 files changed, 156 insertions(+), 59 deletions(-) diff --git a/character/shenhua.js b/character/shenhua.js index c42bdf4c1..36189d345 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -7716,7 +7716,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, characterReplace:{ - caoren:['caoren','old_caoren','sb_caoren','new_caoren'], + caoren:['caoren','old_caoren','sb_caoren','new_caoren','star_caoren'], sp_caoren:['sp_caoren','jsp_caoren'], xiahouyuan:['re_xiahouyuan','ol_xiahouyuan','xiahouyuan'], huangzhong:['re_huangzhong','ol_huangzhong','sb_huangzhong','huangzhong','jsrg_huangzhong'], @@ -7731,7 +7731,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ pangtong:['pangtong','ol_pangtong','re_pangtong','sb_pangtong'], re_jsp_pangtong:['re_jsp_pangtong','jsrg_pangtong','sp_pangtong'], taishici:['taishici','re_taishici','ol_sb_taishici'], - re_yuanshao:['re_yuanshao','ol_yuanshao','xin_yuanshao','ol_sb_yuanshao','sb_yuanshao'], + re_yuanshao:['re_yuanshao','ol_yuanshao','xin_yuanshao','ol_sb_yuanshao','star_yuanshao','sb_yuanshao'], pangde:['re_pangde','ol_pangde','pangde'], yanwen:['yanwen','ol_yanwen','re_yanwen'], caopi:['caopi','re_caopi','ps_caopi','sb_caopi'], @@ -7740,7 +7740,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ zhurong:['zhurong','ol_zhurong','re_zhurong','sb_zhurong'], sunjian:['sunjian','ol_sunjian','re_sunjian','tw_ol_sunjian'], jiaxu:['jiaxu','re_jiaxu','ns_jiaxu','ps_jiaxu'], - dongzhuo:['dongzhuo','ol_dongzhuo','re_dongzhuo','sp_dongzhuo','yj_dongzhuo'], + dongzhuo:['dongzhuo','ol_dongzhuo','re_dongzhuo','star_dongzhuo','sp_dongzhuo','yj_dongzhuo'], dengai:['dengai','ol_dengai','re_dengai'], sp_ol_zhanghe:['sp_ol_zhanghe','yj_zhanghe','sp_zhanghe','jsrg_zhanghe'], jiangwei:['jiangwei','ol_jiangwei','re_jiangwei','ol_sb_jiangwei','sb_jiangwei','jsrg_jiangwei'], diff --git a/character/shiji.js b/character/shiji.js index 4ce0c0283..47b6d9d65 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -6510,7 +6510,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ characterReplace:{ wangcan:['wangcan','sp_wangcan','tw_wangcan'], sunshao:['sunshao','sp_sunshao'], - xunchen:['xunchen','re_xunchen','sp_xunchen','tw_xunchen'], + xunchen:['xunchen','re_xunchen','sp_xunchen','tw_xunchen','clan_xunchen'], xinpi:['xinpi','sp_xinpi'], duyu:['duyu','dc_duyu','sp_duyu','pk_sp_duyu'], zhangwen:['zhangwen','sp_zhangwen'], @@ -6524,7 +6524,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ liuzhang:['liuzhang','tw_liuzhang'], chenzhen:['sp_chenzhen','tw_chenzhen'], feiyi:['ol_feiyi','feiyi','tw_feiyi'], - wangling:['dc_wangling','wangling','tw_wangling'], + wangling:['dc_wangling','wangling','tw_wangling','clan_wangling'], qiaogong:['qiaogong','tw_qiaogong'], sp_chendong:['sp_chendong','tw_chendong','chendong'], sp_jiangqing:['sp_jiangqing','tw_jiangqing','jiangqing'], diff --git a/character/sp.js b/character/sp.js index 92cbbdf70..2dc31a682 100755 --- a/character/sp.js +++ b/character/sp.js @@ -26373,7 +26373,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sunluyu:['sunluyu','re_sunluyu','mb_sunluyu'], jin_simazhao:['jin_simazhao','simazhao','sp_simazhao'], jin_wangyuanji:['jin_wangyuanji','wangyuanji','sp_wangyuanji'], - wangyun:['wangyun','dc_wangyun','re_wangyun','jsrg_wangyun','old_wangyun','pe_wangyun'], + wangyun:['clan_wangyun','wangyun','dc_wangyun','re_wangyun','jsrg_wangyun','old_wangyun','pe_wangyun'], zhangliang:['xin_zhangliang','re_zhangliang','zhangliang'], lingju:['lingju','old_lingju'], guansuo:['guansuo','dc_guansuo'], diff --git a/character/sp2.js b/character/sp2.js index 7aa16d73b..dd103b080 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -11053,7 +11053,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ jin_simashi:['dc_simashi','jin_simashi','simashi'], jin_yanghuiyu:['jin_yanghuiyu','yanghuiyu'], taoqian:['re_taoqian','taoqian'], - sp_liubei:['jsrg_liubei','sp_liubei'], + jsp_liubei:['jsrg_liubei','jsp_liubei'], dongcheng:['re_dongcheng','dongcheng'], hucheer:['re_hucheer','hucheer','tw_hucheer'], nanhualaoxian:['re_nanhualaoxian','nanhualaoxian','jsrg_nanhualaoxian'], diff --git a/character/standard.js b/character/standard.js index fc91939dc..8fb6434ae 100755 --- a/character/standard.js +++ b/character/standard.js @@ -2360,7 +2360,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ diaochan:['diaochan','re_diaochan','sb_diaochan'], huatuo:['huatuo','re_huatuo','old_huatuo'], huaxiong:['huaxiong','re_huaxiong','old_huaxiong','sb_huaxiong','ol_huaxiong'], - yuanshu:['yuanshu','re_yuanshu','yl_yuanshu','old_yuanshu','ol_yuanshu'], + yuanshu:['yuanshu','re_yuanshu','yl_yuanshu','old_yuanshu','ol_yuanshu','star_yuanshu'], gongsunzan:['gongsunzan','re_gongsunzan','dc_gongsunzan','xin_gongsunzan'], re_lidian:['re_lidian','old_re_lidian','junk_lidian'], }, diff --git a/character/yijiang.js b/character/yijiang.js index 5a0d64b22..1e92a3e56 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -13961,7 +13961,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sundeng:['sundeng','re_sundeng','ns_sundeng'], caiyong:['caiyong','re_caiyong'], chengong:['chengong','re_chengong','sb_chengong'], - xunyou:['xunyou','re_xunyou'], + xunyou:['xunyou','re_xunyou','clan_xunyou'], xuezong:['xuezong','tw_xuezong'], huanghao:['huanghao','dc_huanghao','old_huanghao'], caorui:['caorui','re_caorui','old_caorui'], @@ -13970,6 +13970,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ zhangsong:['zhangsong','re_zhangsong'], zhongyao:['zhongyao','re_zhongyao'], liwan:['ol_liwan','liwan'], + wuxian:['wuxian','clan_wuxian'], }, translate:{ old_huaxiong:'将华雄', diff --git a/character/yingbian.js b/character/yingbian.js index aa215d04b..ec35c88ca 100644 --- a/character/yingbian.js +++ b/character/yingbian.js @@ -3776,6 +3776,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ jiachong:['dc_jiachong','jin_jiachong','jiachong'], yangyan:['yangyan','old_yangyan'], yangzhi:['yangzhi','old_yangzhi'], + zhongyan:['zhongyan','clan_zhongyan'], }, translate:{ jin_zhangchunhua:'晋张春华', diff --git a/mode/versus.js b/mode/versus.js index 7cb58103d..55dddb6b9 100644 --- a/mode/versus.js +++ b/mode/versus.js @@ -2617,7 +2617,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ var evt=evt_list[0],character=evt_list[1]; game.addGlobalSkill(evt); - var func=function(map,evt){ + var func=function(map,evt,character){ for(var i in map){ var player=lib.playerOL[i]; if(player){ @@ -2631,20 +2631,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } } } - game.falseZhu.init('re_caocao'); - game.trueZhu.init('ol_sb_yuanshao'); - game.trueZhu.hp++; - game.trueZhu.maxHp++; - game.falseZhu.hp++; - game.falseZhu.maxHp++; - game.trueZhu.update(); - game.falseZhu.update(); ui.arena.classList.add('choose-character'); if(evt=='shishengshibai'){ ui.guanduInfo=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo); ui.guanduInfo.innerHTML='十胜十败(0)'; } - const showGuanduEvent=function(evt){ + const showGuanduEvent=function(evt,character){ if(ui['GuanduEvent_'+evt]) return; ui['GuanduEvent_'+evt]=ui.create.system(get.translation(evt),null,true); lib.setPopped(ui['GuanduEvent_'+evt],function(){ @@ -2660,10 +2652,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ for(const i in lib.playerOL){ const target=lib.playerOL[i]; if(target==game.me){ - showGuanduEvent(evt); + showGuanduEvent(evt,character); } else if(target.isOnline2()){ - target.send(showGuanduEvent,evt); + target.send(showGuanduEvent,evt,character); } } if(lib.config.background_speak) game.playAudio('skill',evt); @@ -2674,26 +2666,94 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ dialog.close(); },5000) }; - game.broadcastAll(func,map,evt); + game.broadcastAll(func,map,evt,character); _status.firstAct=game.falseZhu; game.delay(0,5000); "step 1" - event.falseList=['ol_xiahouyuan','litong','zangba','manchong','xunyu','re_guojia','re_zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){ - if(!Array.isArray(lib.character[name])) return false; - lib.character[name][1]='wei'; - return true; + game.falseZhu.chooseButtonOL([ + [game.falseZhu,[ + '请选择武将', + [['caocao'],'characterx'], + ],true], + [game.trueZhu,[ + '请选择武将', + [['re_yuanshao'],'characterx'], + ],true] + ],function(player,result){ + if(game.online||player==game.me){ + player.init(result.links[0]); + } + }) + "step 2" + game.broadcastAll(function(result){ + for(var i in result){ + if(!lib.playerOL[i].name){ + lib.playerOL[i].init(result[i].links[0]); + } + lib.playerOL[i].hp++; + lib.playerOL[i].maxHp++; + lib.playerOL[i].update(); + } + },result); + "step 3" + event.falseList=['xiahouyuan','litong','zangba','manchong','xunyu','guojia','zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){ + if(lib.characterReplace[name]){ + let goon = false; + for(let i of lib.characterReplace[name]){ + if(lib.character[i]){ + lib.character[i][1] = 'wei'; + goon = true; + } + } + return goon; + } + else if(lib.character[name]){ + lib.character[name][1] = 'wei'; + return true; + } + return false; }); - event.trueList=['xinping','hanmeng','gaogan','yuantanyuanshang','lvkuanglvxiang','xinpi','xunchen','sp_zhanghe','chenlin','re_liubei','yj_jushou','guotufengji','gaolan','sp_xuyou','tianfeng','chunyuqiong','sp_shenpei'].filter(function(name){ - if(!Array.isArray(lib.character[name])) return false; - lib.character[name][1]='qun'; - return true; + event.trueList=['xinping','hanmeng','gaogan','yuantanyuanshang','lvkuanglvxiang','xinpi','xunchen','sp_ol_zhanghe','chenlin','jsp_liubei','yj_jushou','guotufengji','gaolan','xuyou','tianfeng','chunyuqiong','shenpei'].filter(function(name){ + if(lib.characterReplace[name]){ + let goon = false; + for(let i of lib.characterReplace[name]){ + if(lib.character[i]){ + lib.character[i][1] = 'qun'; + goon = true; + } + } + return goon; + } + else if(lib.character[name]){ + lib.character[name][1] = 'qun'; + return true; + } + return false; }); game.broadcast(function(list1,list2){ - while(list1.length){ - lib.character[list1.shift()][1]='wei'; + for(let name of list1){ + if(lib.characterReplace[name]){ + for(let i of lib.characterReplace[name]){ + if(lib.character[i]){ + lib.character[i][1] = 'wei'; + } + } + } + else if(lib.character[name]){ + lib.character[name][1] = 'wei'; + } } - while(list2.length){ - lib.character[list2.shift()][1]='qun'; + for(let name of list2){ + if(lib.characterReplace[name]){ + for(let i of lib.characterReplace[name]){ + if(lib.character[i]){ + lib.character[i][1] = 'qun'; + } + } + } + else if(lib.character[name]){ + lib.character[name][1] = 'qun'; + } } },event.falseList,event.trueList); event.map={}; @@ -2702,7 +2762,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(current.identity=='zhong'){ var choice=event[current.side+'List'].randomRemove(2); event.map[current.playerid]=choice; - list.push([current,['请选择武将',[choice,'character']],true]); + list.push([current,['请选择武将',[choice,'characterx']],true]); } }); game.me.chooseButtonOL(list,function(player,result){ @@ -2710,16 +2770,16 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player.init(result.links[0]); } }); - "step 2" + "step 4" for(var i in result){ if(result[i]=='ai'){ - result[i]=event.map[i].randomGet(); + result[i]=event.map[i].randomRemove(1)[0]; } else result[i]=result[i].links[0]; } game.broadcastAll(function(result){ for(var i in result){ - lib.playerOL[i].init(result[i]); + if(!lib.playerOL[i].name) lib.playerOL[i].init(result[i]); } setTimeout(function(){ ui.arena.classList.remove('choose-character'); @@ -2733,14 +2793,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ 'step 0' lib.init.onfree(); ui.arena.classList.add('choose-character'); - game.falseZhu.init('re_caocao'); - game.trueZhu.init('ol_sb_yuanshao'); - game.trueZhu.hp++; - game.trueZhu.maxHp++; - game.falseZhu.hp++; - game.falseZhu.maxHp++; - game.trueZhu.update(); - game.falseZhu.update(); var evt_list=[['huoshaowuchao','chunyuqiong'],['liangcaokuifa','sp_xuyou'],['zhanyanliangzhuwenchou','jsp_guanyu'],['shishengshibai','re_guojia'],['xutuhuanjin','yj_jushou'],['liangjunxiangchi','yj_jushou'],['jianshoudaiyuan','tianfeng'],['yiruoshengqiang','re_caocao'],['shichongerjiao','sp_xuyou']].randomGet(); var evt=evt_list[0],character=evt_list[1]; game.addGlobalSkill(evt); @@ -2767,25 +2819,68 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ },evt); game.me.chooseControl('ok').set('dialog',['###本局特殊事件:'+get.translation(evt)+'###'+get.translation(evt+'_info'),[[character],'character']]); 'step 1' - event.falseList=['ol_xiahouyuan','litong','zangba','manchong','xunyu','re_guojia','re_zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){ - if(!Array.isArray(lib.character[name])) return false; - lib.character[name][1]='wei'; - return true; - }); - event.trueList=['xinping','hanmeng','gaogan','yuantanyuanshang','lvkuanglvxiang','xinpi','xunchen','sp_zhanghe','chenlin','re_liubei','yj_jushou','guotufengji','gaolan','sp_xuyou','tianfeng','chunyuqiong','sp_shenpei'].filter(function(name){ - if(!Array.isArray(lib.character[name])) return false; - lib.character[name][1]='qun'; - return true; - }); + game.falseZhu.chooseButton(['请选择你的武将牌',[['caocao'],'characterx']],true); 'step 2' + event.falseZhu_choice = result.links[0]; + game.trueZhu.chooseButton(['请选择你的武将牌',[['re_yuanshao'],'characterx']],true); + 'step 3' + event.trueZhu_choice = result.links[0]; + game.falseZhu.init(event.falseZhu_choice); + game.trueZhu.init(event.trueZhu_choice); + game.trueZhu.hp++; + game.trueZhu.maxHp++; + game.falseZhu.hp++; + game.falseZhu.maxHp++; + game.trueZhu.update(); + game.falseZhu.update(); + 'step 4' + event.falseList=['xiahouyuan','litong','zangba','manchong','xunyu','guojia','zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){ + if(lib.characterReplace[name]){ + let goon = false; + for(let i of lib.characterReplace[name]){ + if(lib.character[i]){ + lib.character[i][1] = 'wei'; + goon = true; + } + } + return goon; + } + else if(lib.character[name]){ + lib.character[name][1] = 'wei'; + return true; + } + return false; + }); + event.trueList=['xinping','hanmeng','gaogan','yuantanyuanshang','lvkuanglvxiang','xinpi','xunchen','sp_ol_zhanghe','chenlin','jsp_liubei','yj_jushou','guotufengji','gaolan','xuyou','tianfeng','chunyuqiong','shenpei'].filter(function(name){ + if(lib.characterReplace[name]){ + let goon = false; + for(let i of lib.characterReplace[name]){ + if(lib.character[i]){ + lib.character[i][1] = 'qun'; + goon = true; + } + } + return goon; + } + else if(lib.character[name]){ + lib.character[name][1] = 'qun'; + return true; + } + return false; + }); + 'step 5' if(game.me.identity!='zhu'){ event.choose_me=true; - game.me.chooseButton(['请选择你的武将牌',[event[game.me.side+'List'].randomRemove(2),'character']],true); + game.me.chooseButton(['请选择你的武将牌',[event[game.me.side+'List'].randomRemove(2),'characterx']],true); } - 'step 3' + 'step 6' if(event.choose_me) game.me.init(result.links[0]); game.countPlayer(function(current){ - if(current!=game.me&¤t.identity=='zhong') current.init(event[current.side+'List'].randomRemove(2)[0]); + if(current!=game.me&¤t.identity=='zhong'){ + let choice = event[current.side+'List'].randomRemove(2)[0]; + if(lib.characterReplace[choice]) choice = lib.characterReplace[choice].randomGet(); + current.init(choice); + } }); setTimeout(function(){ ui.arena.classList.remove('choose-character'); From 8ab97514bf5838d5ccb4ec3fc0b26886bc6e1338 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Mon, 11 Mar 2024 16:06:53 +0800 Subject: [PATCH 08/11] bugfix --- mode/versus.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mode/versus.js b/mode/versus.js index 55dddb6b9..ae04b2d6c 100644 --- a/mode/versus.js +++ b/mode/versus.js @@ -4908,11 +4908,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ prompt: '将【杀】当作【闪】,或将【闪】当作的【杀】使用或打出,然后你的下个弃牌阶段的手牌上限-1', viewAs: function(cards, player) { var name = false; - switch (get.name(cards[0], player)) { - case 'sha': name = 'shan'; break; - case 'shan': name = 'sha'; break; + if(cards.length){ + switch (get.name(cards[0], player)) { + case 'sha': name = 'shan'; break; + case 'shan': name = 'sha'; break; + } + if (name) return { name: name }; } - if (name) return { name: name }; return null; }, onuse: function(links, player) { From 8290a9841b2dc29947cf6418d989534da3f5fb52 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Mon, 11 Mar 2024 16:52:18 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9D=9C=E9=A2=84?= =?UTF-8?q?=E7=81=AD=E5=90=B4bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/offline.js | 2 +- character/shiji.js | 8 ++++---- noname/library/index.js | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/character/offline.js b/character/offline.js index 74a84574e..2d2d67eeb 100644 --- a/character/offline.js +++ b/character/offline.js @@ -1100,7 +1100,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(name=='sha'){ if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','','sha']); for(var nature of lib.inpile_nature){ - if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',j]); + if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',nature]); } } else if(get.type(name)=='trick'&&event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['锦囊','',name]); diff --git a/character/shiji.js b/character/shiji.js index 47b6d9d65..0a652bb99 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -5790,13 +5790,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i Date: Mon, 11 Mar 2024 16:56:34 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=91=A8=E4=B8=8D?= =?UTF-8?q?=E7=96=91AI=E6=9C=AA=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/xianding.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/character/xianding.js b/character/xianding.js index ef1e5a1ce..6556d1c28 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -3369,8 +3369,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(['equip','delay'].includes(get.type(card))&&player.hasValueTarget(card)&&choices.includes('场上')) return '场上'; var val=get.value(card); var next=_status.currentPhase; - if(trigger.name=='damage') next=next.getNext(); - if(get.attitude(player,next)>0&&val>=6||get.attitude(player,next)<0&&val<=4.5) return '牌堆顶'; + if(next){ + if(trigger.name=='damage') next=next.getNext(); + if(get.attitude(player,next)>0&&val>=6||get.attitude(player,next)<0&&val<=4.5) return '牌堆顶'; + } return '牌堆底'; }()); } From dce51012248a4bb62c0b603a525de15d4f3d12e2 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Mon, 11 Mar 2024 16:58:24 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E9=A3=8E=E5=BD=B1=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/xianding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/xianding.js b/character/xianding.js index 6556d1c28..6c15fffc7 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -14724,7 +14724,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dclingfang:'凌芳', dclingfang_info:'锁定技。准备阶段,或当其他角色使用黑色牌结算结束后,若你是此牌的目标,或你使用黑色牌结算结束后,若你不是此牌目标,你获得1枚“绞”。', dcfengying:'风影', - dcfengying_info:'①一名角色的回合开始时,你记录弃牌堆中所有黑色基本牌或黑色普通锦囊牌的牌名。②每回合每种牌名各限一次。你可以将一张点数不大于“绞”数的手牌当做任意一张〖风影①〗记录中的牌使用。', + dcfengying_info:'①一名角色的回合开始时,你记录弃牌堆中所有黑色基本牌或黑色普通锦囊牌的牌名。②每回合每种牌名各限一次。你可以将一张点数不大于“绞”数的手牌当做任意一张〖风影①〗记录中的牌使用(无距离和次数限制)。', dcshouze:'受责', dcshouze_info:'锁定技。结束阶段,若你有“绞”,你弃1枚“绞”,随机获得弃牌堆中的一张黑色牌,失去1点体力。', chengbing:'程秉',