diff --git a/character/huicui.js b/character/huicui.js index 3fa5db8b7..5fb1e9b76 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); @@ -1200,22 +1202,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 +1233,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]))); 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/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:{ diff --git a/character/shenhua.js b/character/shenhua.js index 7ef5dd7b3..ce9de3cae 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -7727,7 +7727,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'], @@ -7742,7 +7742,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'], @@ -7751,7 +7751,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 c813260fc..1a0f5c79f 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -5793,13 +5793,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i0; }, 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]}; diff --git a/character/xianding.js b/character/xianding.js index 649933d1e..a477aae91 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){ @@ -3366,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 '牌堆底'; }()); } @@ -14722,7 +14727,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:'程秉', diff --git a/character/yijiang.js b/character/yijiang.js index 1ba732af3..e8caad897 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -13973,7 +13973,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'], @@ -13982,6 +13982,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..ae04b2d6c 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'); @@ -4813,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) { 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 e1c33630a..dcb3861f4 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', + }); } } } diff --git a/noname/library/index.js b/noname/library/index.js index 4373427e8..cbe050fd0 100644 --- a/noname/library/index.js +++ b/noname/library/index.js @@ -6118,9 +6118,12 @@ export class Library extends Uninstantable { } if (config.connect_versus_mode == '2v2' || config.connect_versus_mode == '3v3') { map.connect_replace_handcard.show(); + if(config.connect_versus_mode == '2v2') map.connect_olfeiyang_four.show(); + else map.connect_olfeiyang_four.hide(); } else { map.connect_replace_handcard.hide(); + map.connect_olfeiyang_four.hide(); } }, connect_versus_mode: {