diff --git a/audio/die/dc_xujing.mp3 b/audio/die/dc_xujing.mp3 new file mode 100644 index 0000000000..44fcbf682a Binary files /dev/null and b/audio/die/dc_xujing.mp3 differ diff --git a/audio/die/wu_luxun.mp3 b/audio/die/wu_luxun.mp3 new file mode 100644 index 0000000000..554f125260 Binary files /dev/null and b/audio/die/wu_luxun.mp3 differ diff --git a/audio/die/yue_zhoufei.mp3 b/audio/die/yue_zhoufei.mp3 new file mode 100644 index 0000000000..d31a5f4ec7 Binary files /dev/null and b/audio/die/yue_zhoufei.mp3 differ diff --git a/audio/skill/dccaixia1.mp3 b/audio/skill/dccaixia1.mp3 new file mode 100644 index 0000000000..90b2577a79 Binary files /dev/null and b/audio/skill/dccaixia1.mp3 differ diff --git a/audio/skill/dccaixia2.mp3 b/audio/skill/dccaixia2.mp3 new file mode 100644 index 0000000000..bccd8973f8 Binary files /dev/null and b/audio/skill/dccaixia2.mp3 differ diff --git a/audio/skill/dclingkong1.mp3 b/audio/skill/dclingkong1.mp3 new file mode 100644 index 0000000000..1934d98954 Binary files /dev/null and b/audio/skill/dclingkong1.mp3 differ diff --git a/audio/skill/dclingkong2.mp3 b/audio/skill/dclingkong2.mp3 new file mode 100644 index 0000000000..67f3e5b3a6 Binary files /dev/null and b/audio/skill/dclingkong2.mp3 differ diff --git a/audio/skill/dcruxian1.mp3 b/audio/skill/dcruxian1.mp3 new file mode 100644 index 0000000000..6dd9839680 Binary files /dev/null and b/audio/skill/dcruxian1.mp3 differ diff --git a/audio/skill/dcruxian2.mp3 b/audio/skill/dcruxian2.mp3 new file mode 100644 index 0000000000..44b59ff7fe Binary files /dev/null and b/audio/skill/dcruxian2.mp3 differ diff --git a/audio/skill/dcshangyu1.mp3 b/audio/skill/dcshangyu1.mp3 new file mode 100644 index 0000000000..5f2b066e5a Binary files /dev/null and b/audio/skill/dcshangyu1.mp3 differ diff --git a/audio/skill/dcshangyu2.mp3 b/audio/skill/dcshangyu2.mp3 new file mode 100644 index 0000000000..c712d2c740 Binary files /dev/null and b/audio/skill/dcshangyu2.mp3 differ diff --git a/audio/skill/dcxianshu1.mp3 b/audio/skill/dcxianshu1.mp3 new file mode 100644 index 0000000000..a611d6b122 Binary files /dev/null and b/audio/skill/dcxianshu1.mp3 differ diff --git a/audio/skill/dcxianshu2.mp3 b/audio/skill/dcxianshu2.mp3 new file mode 100644 index 0000000000..e02bfb67fa Binary files /dev/null and b/audio/skill/dcxianshu2.mp3 differ diff --git a/audio/skill/dcxiongmu1.mp3 b/audio/skill/dcxiongmu1.mp3 new file mode 100644 index 0000000000..45237e1456 Binary files /dev/null and b/audio/skill/dcxiongmu1.mp3 differ diff --git a/audio/skill/dcxiongmu2.mp3 b/audio/skill/dcxiongmu2.mp3 new file mode 100644 index 0000000000..a1d1e0e22c Binary files /dev/null and b/audio/skill/dcxiongmu2.mp3 differ diff --git a/audio/skill/dczhangcai1.mp3 b/audio/skill/dczhangcai1.mp3 new file mode 100644 index 0000000000..df3b5196f6 Binary files /dev/null and b/audio/skill/dczhangcai1.mp3 differ diff --git a/audio/skill/dczhangcai2.mp3 b/audio/skill/dczhangcai2.mp3 new file mode 100644 index 0000000000..19efb4c34a Binary files /dev/null and b/audio/skill/dczhangcai2.mp3 differ diff --git a/card/yingbian.js b/card/yingbian.js index e956f3fa4f..79eb641032 100644 --- a/card/yingbian.js +++ b/card/yingbian.js @@ -381,7 +381,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ trigger:{player:'equipAfter'}, forced:true, equipSkill:true, - filter:(event,player)=>event.card.name=='tianjitu'&&player.hasCard(card=>card!=event.card), + filter:(event,player)=>event.card.name=='tianjitu'&&player.hasCard(card=>card!=event.card,'he'), content:()=>{ player.chooseToDiscard(true,card=>card!=_status.event.getTrigger().card,'he'); }, diff --git a/character/extra.js b/character/extra.js index e6069fdc94..b2952f99fb 100755 --- a/character/extra.js +++ b/character/extra.js @@ -624,19 +624,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{player:'useCardAfter'}, filter:function(event,player){ - if(event.skill=='dccuixin') return false; - if(event.targets.length==0) return false; - if(get.type(event.card,false)=='delay'||get.type(event.card,false)=='equip') return false; + if(!event._dccuixin||get.type(event.card,false)=='delay'||get.type(event.card,false)=='equip') return false; var card={ name:event.card.name, nature:event.card.nature, isCard:true, - } - for(var target of event.targets){ - var targetx; - if(target==player.getNext()) targetx=player.getPrevious(); - else if(target==player.getPrevious()) targetx=player.getNext(); - else continue; + },list=event._dccuixin; + for(var target of list){ + var targetx=player[target](); if(lib.filter.targetEnabled2(card,targetx,player)) return true; } return false; @@ -650,21 +645,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ isCard:true, }; event.card=card; - var list=trigger.targets.filter(target=>{ - var targetx; - if(target==player.getNext()) targetx=player.getPrevious(); - else if(target==player.getPrevious()) targetx=player.getNext(); - else return false; - if(lib.filter.targetEnabled2(card,targetx,player)) return true; - }).map(target=>{ - return target==player.getPrevious()?player.getNext():player.getPrevious(); + var list=[]; + trigger._dccuixin.forEach(target=>{ + var targetx=player[target](); + if(lib.filter.targetEnabled2(card,targetx,player)) list.add(targetx); }); if(list.length==1){ event.target=list[0]; - player.chooseBool('摧心:是否再视为对'+get.translation(list[0])+'使用'+get.translation(card)+'?').set('goon',get.effect(list[0],card,player,player)>0).set('ai',()=>_status.event.goon); + player.chooseBool('摧心:是否视为对'+get.translation(list[0])+'使用'+get.translation(card)+'?').set('goon',get.effect(list[0],card,player,player)>0).set('ai',()=>_status.event.goon); } else{ - player.chooseTarget('摧心:是否再视为对上家或下家使用'+get.translation(card)+'?','操作提示:从上家或下家中选择一名角色作为使用目标',function(card,player,target){ + player.chooseTarget('摧心:是否视为对上家或下家使用'+get.translation(card)+'?','操作提示:从上家或下家中选择一名角色作为使用目标',function(card,player,target){ return (target==player.getNext()||target==player.getPrevious())&&lib.filter.targetEnabled2(_status.event.getParent().card,target,player); }).set('ai',function(target){ var player=_status.event.player; @@ -677,6 +668,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.useCard(card,target,false,'dccuixin'); } }, + group:'dccuixin_silent', + subSkill:{ + silent:{ + trigger:{player:'useCardToPlayered'}, + silent:true, + forced:true, + popup:false, + firstDo:true, + charlotte:true, + filter:function(event,player){ + if(!event.isFirstTarget||event.getParent().skill=='dccuixin') return false; + if(event.targets.length==0) return false; + return event.targets.includes(player.getNext())||event.targets.includes(player.getPrevious()); + }, + content:function(){ + var list=[]; + if(trigger.targets.includes(player.getNext())) list.push('getPrevious'); + if(trigger.targets.includes(player.getPrevious())) list.push('getNext'); + trigger.getParent()._dccuixin=list; + } + }, + }, }, //海外神吕蒙 twshelie:{ @@ -2828,7 +2841,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ tspowei:{ audio:3, dutySkill:true, - locked:true, derivation:'shenzhu', group:['tspowei_init','tspowei_move','tspowei_achieve','tspowei_fail','tspowei_use','tspowei_remove'], subSkill:{ @@ -4813,7 +4825,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 10*Math.sqrt(Math.max(0.01,get.threaten(target)))/(3.5-draw)+dis/(2*game.countPlayer()); } else{ - if(target.isTurnedOver()) return -att-draw; + if(target.isTurnedOver()) return att-draw; if(draw>=5) return -1; if(current&&target.getSeatNum()<=current.getSeatNum()) return -att+draw/3; return (4.25-draw)*10*Math.sqrt(Math.max(0.01,get.threaten(target)))+2*game.countPlayer()/dis; @@ -7364,7 +7376,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcqijing:'奇径', dcqijing_info:'觉醒技。一名角色的回合结束后,若你的三个副区域标签均被激活,则你减1点体力上限,将座位移动至一名其他角色的上家之后,获得〖摧心〗和一个额外回合。', dccuixin:'摧心', - dccuixin_info:'当你不因此技能使用的基本牌或普通锦囊牌结算结束后,若此牌的目标包含你的上家或下家,则你可以视为对下家或上家再使用一张牌名和元素相同的牌。', + dccuixin_info:'当你不因此技能使用的基本牌或普通锦囊牌结算结束后,若此牌的目标于你使用此牌指定第一个目标时包含你的上家或下家,则你可以视为对下家或上家再使用一张牌名和元素相同的牌。', shen_dianwei:'神典韦', juanjia:'捐甲', juanjia_info:'锁定技。游戏开始时,你废除一个防具栏,然后获得一个额外的武器栏。', diff --git a/character/huicui.js b/character/huicui.js index 6dbd9710df..9ff80eb216 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -2619,15 +2619,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.bool){ var cards=result.cards,targets=result.targets; event.cards=cards; - var cardx=get.autoViewAs({name:'sha'},cards); - event.cardx=cardx; - player.useCard(cardx,cards,targets,false,'dcsaowei'); + var next=player.useCard({name:'sha'},cards,targets,false,'dcsaowei'); + player.when('useCardAfter') + .filter(event=>event==next) + .then(()=>{ + if(player.hasHistory('sourceDamage',evt=>evt.card==trigger.card)){ + var cards=trigger.cards.filterInD(); + if(cards.length>0) player.gain(cards,'gain2'); + } + }) } - else event.finish(); - 'step 2' - if(player.getHistory('sourceDamage',function(evt){ - return evt.card==event.cardx; - }).length&&cards.filterInD().length) player.gain(cards.filterInD(),'gain2'); }, }, //向朗 diff --git a/character/jsrg.js b/character/jsrg.js index 6f4592ad8e..82f260b8a5 100644 --- a/character/jsrg.js +++ b/character/jsrg.js @@ -711,6 +711,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ },'hs'); }, groupSkill:true, + locked:false, viewAs:{ name:'sha', storage:{jsrgxianzhu:true}, @@ -2367,7 +2368,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, content:function(){ 'step 0' - player.chooseToDiscard(get.prompt('jsrgjuelie',trigger.target),'当你使用【杀】指定一名角色为目标后,你可以弃置任意张牌,然后弃置其等量的牌',[1,Infinity],'he').set('ai',card=>{ + player.chooseToDiscard(get.prompt('jsrgjuelie',trigger.target),'当你使用【杀】指定一名角色为目标后,你可以弃置任意张牌,然后弃置其等量的牌,然后若你的手牌数或体力值最小,此【杀】对其的伤害基数+1。',[1,Infinity],'he').set('ai',card=>{ if(ui.selected.cards.length>=_status.event.max) return 0; if(_status.event.goon) return 4.5-get.value(card); return 0; diff --git a/character/shenhua.js b/character/shenhua.js index a41844a167..3f08d8c85a 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -4700,7 +4700,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 10*Math.sqrt(Math.max(0.01,get.threaten(target)))/(3.5-draw)+dis/(2*game.countPlayer()); } else{ - if(target.isTurnedOver()) return -att-draw; + if(target.isTurnedOver()) return att-draw; if(draw>=5) return -1; if(current&&target.getSeatNum()<=current.getSeatNum()) return -att+draw/3; return (4.25-draw)*10*Math.sqrt(Math.max(0.01,get.threaten(target)))+2*game.countPlayer()/dis; diff --git a/character/shiji.js b/character/shiji.js index 4ea096396c..a4024ff045 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -2229,8 +2229,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ selectCard:-1, log:false, precontent:function(){ + 'step 0' player.logSkill('dbzhuifeng'); player.loseHp(); + event.forceDie=true; + 'step 1' + //特殊处理 + if(player.isDead()){ + player.useResult(event.result,event.getParent()) + } }, ai:{ order:function(){ diff --git a/character/xianding.js b/character/xianding.js index 35837a4b90..a8c362c072 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -137,7 +137,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var piles=['cardPile','discardPile']; for(var pile of piles){ for(var i=0;i=target.getHp()||player.hasSkillTag('jueqing')) return; if(player._dcxiongmu_temp) return; if(_status.event.getParent('useCard',true)||_status.event.getParent('_wuxie',true)) return; if(get.tag(card,'damage')){ @@ -200,7 +200,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ minus:{ trigger:{player:'damageBegin4'}, filter:function(event,player){ - return game.getGlobalHistory('everything',evt=>{ + return player.countCards('h'){ return evt.name=='damage'&&evt.player==player; },event).indexOf(event)==0; }, @@ -308,7 +308,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } 'step 1' if(get.owner(card)==player&&get.position(card)=='h'&&game.hasPlayer(current=>current!=player)){ - player.chooseTarget(`赏誉:将${get.translation(card)}交给一名角色`,lib.filter.notMe,true); + player.chooseTarget(`是否将${get.translation(card)}交给一名其他角色?`,lib.filter.notMe); } else event.finish(); 'step 2' @@ -316,8 +316,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var target=result.targets[0]; player.line(target); player.give(card,target).gaintag.add('dcshangyu_tag'); - player.addSkill('dcshangyu_effect'); } + player.addSkill('dcshangyu_effect'); }, subSkill:{ effect:{ @@ -425,7 +425,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, content:function(){ 'step 0' - var choices=Array.from({length:Math.min(5,game.countPlayer())}).map((_,i)=>get.cnNumber(i+1,true)); + var choices=Array.from({length:Math.min(5,game.players.length+game.dead.length)}).map((_,i)=>get.cnNumber(i+1,true)); player.chooseControl(choices,'cancel2').set('prompt',get.prompt('dccaixia')).set('prompt2','你可以摸至多'+get.cnNumber(choices.length)+'张牌,但是你此后需要再使用等量的牌才可再发动本技能。').set('ai',()=>{ return _status.event.choice; }).set('choice',function(){ @@ -3799,7 +3799,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 0; } var num=ui.selected.buttons.filter(i=>get.owner(i.link)==target).length; - return -(get.position(card)!='h'?get.value(card,target):(4.5+Math.random()-0.2*(num>2?1:0)))*get.attitude(player,target); + var val=get.buttonValue(button); + if(num>2) val/=Math.sqrt(num); + if(get.attitude(player,owner)>0) return -val; + return val; + //return -(get.position(card)!='h'?get.value(card,target):(4.5+Math.random()-0.2*(num>2?1:0)))*get.attitude(player,target); }); 'step 1' if(result.bool){ @@ -12652,9 +12656,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dc_xujing:'许靖', dcshangyu:'赏誉', dcshangyu_tag:'赏誉', - dcshangyu_info:'锁定技。游戏开始时,你获得一张【杀】并记录之,然后将此牌交给一名角色,你获得如下效果:1.当一名角色使用此牌造成伤害后,你与其各摸一张牌;2.当此牌进入弃牌堆后,你将此牌交给一名本回合未以此法得到过此牌的角色。', + dcshangyu_info:'锁定技。游戏开始时,你获得一张【杀】并记录之,并可以将此牌交给一名角色。然后你获得如下效果:1.当一名角色使用此牌造成伤害后,你与其各摸一张牌;2.当此牌进入弃牌堆后,你将此牌交给一名本回合未以此法得到过此牌的角色。', dccaixia:'才瑕', - dccaixia_info:'当你造成或受到伤害后,若你没有“瑕”,你可以摸至多X张牌并获得X枚“瑕”,然后当你使用牌时,移去1枚“瑕”(X为场上角色数且至多为5)。', + dccaixia_info:'当你造成或受到伤害后,若你没有“瑕”,你可以摸至多X张牌并获得X枚“瑕”,然后当你使用牌时,移去1枚“瑕”(X为本局游戏总角色数且至多为5)。', wu_luxun:'武陆逊', dcxiongmu:'雄幕', dcxiongmu_tag:'雄幕', diff --git a/character/yijiang.js b/character/yijiang.js index 76404d57fa..d1506b4ff1 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -484,12 +484,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }()); 'step 1' var guessedNum=result.index; - var type=get.type2(trigger.card,trigger.player); player.chat('我猜'+get.cnNumber(guessedNum)+'张'); game.log(player,'猜测',trigger.player,'有',get.cnNumber(guessedNum)+'张'+get.translation(type)+'牌'); event.guessedNum=guessedNum; game.delay(); 'step 2' + var type=get.type2(trigger.card,trigger.player); var count=trigger.player.countCards('h',card=>get.type2(card)==type); var guessedNum=event.guessedNum; if(count==guessedNum){ diff --git a/game/asset.js b/game/asset.js index 03ebb0ef22..7e02a273f0 100644 --- a/game/asset.js +++ b/game/asset.js @@ -1,5 +1,5 @@ window.noname_asset_list=[ - 'v1.10.2', + 'v1.10.2.1', /*audio start*/ 'audio/background/aozhan_chaoming.mp3', 'audio/background/aozhan_online.mp3', @@ -288,6 +288,7 @@ window.noname_asset_list=[ 'audio/die/dc_wangchang.mp3', 'audio/die/dc_wangjun.mp3', 'audio/die/dc_wangyun.mp3', + 'audio/die/dc_xujing.mp3', 'audio/die/dc_xushu.mp3', 'audio/die/dc_yangbiao.mp3', 'audio/die/dc_yanghu.mp3', @@ -1005,6 +1006,7 @@ window.noname_asset_list=[ 'audio/die/wis_xuyou.mp3', 'audio/die/wis_zhangzhao.mp3', 'audio/die/wolongfengchu.mp3', + 'audio/die/wu_luxun.mp3', 'audio/die/wu_zhugeliang.mp3', 'audio/die/wu_zhutiexiong.mp3', 'audio/die/wuanguo.mp3', @@ -1133,6 +1135,7 @@ window.noname_asset_list=[ 'audio/die/yuantanyuanshang.mp3', 'audio/die/yuantanyuanxiyuanshang.mp3', 'audio/die/yue_caiwenji.mp3', + 'audio/die/yue_zhoufei.mp3', 'audio/die/yuechen.mp3', 'audio/die/yuejin.mp3', 'audio/die/yuejiu.mp3', @@ -1751,6 +1754,8 @@ window.noname_asset_list=[ 'audio/skill/dcbihuo2.mp3', 'audio/skill/dcbingji1.mp3', 'audio/skill/dcbingji2.mp3', + 'audio/skill/dccaixia1.mp3', + 'audio/skill/dccaixia2.mp3', 'audio/skill/dccaizhuang1.mp3', 'audio/skill/dccaizhuang2.mp3', 'audio/skill/dccansi1.mp3', @@ -1907,6 +1912,8 @@ window.noname_asset_list=[ 'audio/skill/dcligong2.mp3', 'audio/skill/dclingfang1.mp3', 'audio/skill/dclingfang2.mp3', + 'audio/skill/dclingkong1.mp3', + 'audio/skill/dclingkong2.mp3', 'audio/skill/dclingyin1.mp3', 'audio/skill/dclingyin2.mp3', 'audio/skill/dclingyue1.mp3', @@ -1983,10 +1990,14 @@ window.noname_asset_list=[ 'audio/skill/dcrihui2.mp3', 'audio/skill/dcruizhan1.mp3', 'audio/skill/dcruizhan2.mp3', + 'audio/skill/dcruxian1.mp3', + 'audio/skill/dcruxian2.mp3', 'audio/skill/dcruyi1.mp3', 'audio/skill/dcruyi2.mp3', 'audio/skill/dcsaowei1.mp3', 'audio/skill/dcsaowei2.mp3', + 'audio/skill/dcshangyu1.mp3', + 'audio/skill/dcshangyu2.mp3', 'audio/skill/dcshibei1.mp3', 'audio/skill/dcshibei2.mp3', 'audio/skill/dcshiji1.mp3', @@ -2061,6 +2072,8 @@ window.noname_asset_list=[ 'audio/skill/dcxiangshu2.mp3', 'audio/skill/dcxianjin1.mp3', 'audio/skill/dcxianjin2.mp3', + 'audio/skill/dcxianshu1.mp3', + 'audio/skill/dcxianshu2.mp3', 'audio/skill/dcxianzhu1.mp3', 'audio/skill/dcxianzhu2.mp3', 'audio/skill/dcxiaojuan1.mp3', @@ -2071,6 +2084,8 @@ window.noname_asset_list=[ 'audio/skill/dcxieshou2.mp3', 'audio/skill/dcxinyou1.mp3', 'audio/skill/dcxinyou2.mp3', + 'audio/skill/dcxiongmu1.mp3', + 'audio/skill/dcxiongmu2.mp3', 'audio/skill/dcxiuwen1.mp3', 'audio/skill/dcxiuwen2.mp3', 'audio/skill/dcxuewei1.mp3', @@ -2107,6 +2122,8 @@ window.noname_asset_list=[ 'audio/skill/dcyuguan2.mp3', 'audio/skill/dczecai1.mp3', 'audio/skill/dczecai2.mp3', + 'audio/skill/dczhangcai1.mp3', + 'audio/skill/dczhangcai2.mp3', 'audio/skill/dczhanmeng1.mp3', 'audio/skill/dczhanmeng2.mp3', 'audio/skill/dczhanyi1.mp3', diff --git a/game/game.js b/game/game.js index e13eb5c2a9..4c3ce75fe1 100644 --- a/game/game.js +++ b/game/game.js @@ -3856,6 +3856,18 @@ } } }, + show_sex:{ + name:'显示角色性别', + intro:'在角色的右键菜单中显示角色性别', + init:true, + unfrequent:true + }, + show_group:{ + name:'显示角色势力', + intro:'在角色的右键菜单中显示角色势力', + init:true, + unfrequent:true + }, show_replay:{ name:'显示重来按钮', init:false, @@ -4026,8 +4038,9 @@ unfrequent:true, item:{ doNotShow:'不显示', - showPinyin:'显示拼音', - showCodeIdentifier:'显示代码ID' + showPinyin:'拼音(样式一)', + showCodeIdentifier:'代码ID(样式一)', + showPinyin2:'拼音(样式二)', }, visualMenu:(node,link,name)=>{ node.classList.add('button','character'); @@ -4039,7 +4052,7 @@ style.display='flex'; style.height='60px'; style.justifyContent='center'; - style.width='150px'; + style.width='200px'; const firstChild=node.firstChild; firstChild.removeAttribute('class'); firstChild.style.position='initial'; @@ -13766,13 +13779,11 @@ lib.onphase[i](); } player.phase(); + event.player=player.next; "step 2" if(!game.players.contains(event.player.next)){ event.player=game.findNext(event.player.next); } - else{ - event.player=event.player.next; - } event.goto(1); }, loadPackage:function(){ @@ -28952,29 +28963,37 @@ if(Array.isArray(card)){ if(card[2]=='huosha'){ card[2]='sha'; - card[3]=['fire']; + card[3]='fire'; } else if(card[2]=='leisha'){ card[2]='sha'; - card[3]=['thunder']; + card[3]='thunder'; } // else if(card[2]=='kamisha'){ // card[2]='sha'; - // card[3]=['kami']; + // card[3]='kami'; // } // else if(card[2]=='icesha'){ // card[2]='sha'; - // card[3]=['ice']; + // card[3]='ice'; // } else if(card[2]=='cisha'){ card[2]='sha'; - card[3]=['stab']; + card[3]='stab'; } else if(card[2].length>3){ let prefix=card[2].slice(0,card[2].lastIndexOf('sha')); - if(prefix.length+3==card[2].length){ + if(lib.nature.has(prefix)){ + if(prefix.length+3==card[2].length){ + card[2]='sha'; + card[3]=prefix; + } + } + if(card[2].indexOf('sha_')==0){ + let suffix=card[2].slice(4); + let natureList=suffix.split('_'); card[2]='sha'; - card[3]=[prefix]; + card[3]=get.nature(natureList); } } } @@ -40940,14 +40959,19 @@ } //创建ul列表 const createMenu=function(pos,self,List,click){ - if (self&&self.createMenu) return false; + if(!self||self==window) return; const parent=self.parentNode; if (parent){ for(let i=0;icontainer.editor.refresh(),0); - game.saveConfig('codeMirror_theme', theme); - closeMenu.call(self); - }; - const ul=createMenu(pos,self,list,click); - this.createMenu=ul; + if(!this.createMenu){ + //主题列表 + const list=['mdn-like','mbo']; + //正在使用的主题 + const active=container.editor.options.theme; + //排个序 + list.remove(active).splice(0,0,active); + //元素位置 + const pos=self.getBoundingClientRect(); + //点击事件 + const click=function(e){ + const theme=this.innerHTML; + container.editor.setOption("theme",theme); + setTimeout(()=>container.editor.refresh(),0); + game.saveConfig('codeMirror_theme',theme); + closeMenu.call(self); + }; + const ul=createMenu(pos,self,list,click); + self.createMenu=ul; + }else{ + createMenu(null,self); + } }); const edit=ui.create.div('.editbutton','编辑',editorpage,function(){ - if(this&&this.createMenu){ + if(!this||this==window) return; + if(this.createMenu&&this.createMenu.parentNode){ return closeMenu.call(this); } const self=this; - const pos=this.getBoundingClientRect(); - const list=['撤销 Ctrl+Z', '恢复撤销 Ctrl+Y']; - const click=function(e){ - const num=this.innerHTML.indexOf("Ctrl"); - const inner=this.innerHTML.slice(num).replace("+", "-"); - container.editor.execCommand(container.editor.options.extraKeys[inner]); - setTimeout(()=>container.editor.refresh(),0); - closeMenu.call(self); - }; - const ul=createMenu(pos,self,list,click); - this.createMenu=ul; + if(!this.createMenu){ + const pos=this.getBoundingClientRect(); + const list=['撤销 Ctrl+Z', '恢复撤销 Ctrl+Y']; + const click=function(e){ + const num=this.innerHTML.indexOf("Ctrl"); + const inner=this.innerHTML.slice(num).replace("+", "-"); + container.editor.execCommand(container.editor.options.extraKeys[inner]); + setTimeout(()=>container.editor.refresh(),0); + closeMenu.call(self); + }; + const ul=createMenu(pos,self,list,click); + this.createMenu=ul; + }else{ + createMenu(null,self); + } + }); + const fontSize=ui.create.div('.editbutton','字号',editorpage,function(){ + if(!this||this==window) return; + if(this.createMenu&&this.createMenu.parentNode){ + return closeMenu.call(this); + } + const self=this; + if(!this.createMenu){ + const pos=this.getBoundingClientRect(); + const list=['16px','18px','20px','22px','24px','26px']; + const click=function(e){ + const size=this.innerHTML; + container.style.fontSize=size.slice(0,-2)/game.documentZoom+'px'; + Array.from(self.parentElement.children).map(v=>v.createMenu).filter(Boolean).forEach(v=>{v.style.fontSize=size.slice(0,-2)/game.documentZoom+'px'}); + container.listenTransition(()=>container.editor.refresh()); + game.saveConfig('codeMirror_fontSize',size); + closeMenu.call(self); + }; + const ul=createMenu(pos,self,list,click); + this.createMenu=ul; + }else{ + createMenu(null,self); + } }); const editor=ui.create.div(editorpage); return editor; @@ -46822,7 +46881,7 @@ } var loading=ui.create.div('.loading.config.toggle','载入中...',page); - var loaded=function(list){ + var loaded=function(){ var list=[]; var extension=window.extension; for(var i in extension){ @@ -46836,8 +46895,9 @@ var node=ui.create.div('.videonode.menubutton.extension.large',page,clickExtension); ui.create.div('.caption',list[i].name,node); ui.create.div('.text.author','作者:'+list[i].author+'('+list[i].size+')',node); + ui.create.div('.text','更新日期:'+list[i].date,node); ui.create.div('.text',list[i].intro,node); - var download=ui.create.div('.menubutton.text.active','下载扩展',node.firstChild); + var download=ui.create.div('.menubutton.text.active','下载扩展',node.firstChild,{'zIndex':'5'}); if(game.download){ if(list[i].netdisk){ var linknode=ui.create.div('.text',node); @@ -46858,7 +46918,7 @@ },linknode).link=list[i].forum; } download.listen(downloadExtension); - if(lib.config.extensions.contains(list[i].name)){ + if(lib.config.extensions.includes(list[i].name)){ download.classList.remove('active'); if(lib.extensionPack[list[i].name]&&lib.extensionPack[list[i].name].version==list[i].version){ download.classList.add('transparent2'); @@ -46896,10 +46956,10 @@ window.extension={}; fetch(`${extensionURL}catalog.js`,{ referrerPolicy:'no-referrer' - }).then(value=>value.text()).then(eval).catch(reason=>{ + }).then(value=>value.text()).then(eval).then(loaded).catch(reason=>{ console.log(reason); delete window.extension; - loading.innerHTML='连接失败'; + loading.innerHTML='连接失败:'+(reason instanceof Error?reason.message:String(reason)); }); }; if(_thisUpdate) node.update(); @@ -47828,7 +47888,7 @@ var nodeturnover=ui.create.div('.menubutton','翻面',row1,clickrow1); var noderevive=ui.create.div('.menubutton','复活',row1,clickrow1); var nodereplace=ui.create.div('.menubutton','换人',row1,clickrow1); - if(lib.config.mode!='identity'&&lib.config.mode!='guozhan'&&lib.config.mode!='doudizhu'){ + if(!game.canReplaceViewpoint||!game.canReplaceViewpoint()){ nodereplace.classList.add('unselectable'); } @@ -54097,61 +54157,135 @@ else if(lib.config.favouriteCharacter.contains(name)){ fav.classList.add('active'); } - const introduction=ui.create.div('.characterintro',uiintro),showCharacterNamePinyin=lib.config.show_characternamepinyin; - if(showCharacterNamePinyin!='doNotShow'){ - const characterIntroTable=ui.create.div('.character-intro-table',introduction),span=document.createElement('span'); - span.style.fontWeight='bold'; - const nameInfo=get.character(name),exInfo=nameInfo[4],characterName=exInfo&&exInfo.includes('ruby')?lib.translate[name]:get.rawName(name); - span.innerHTML=characterName; - const ruby=document.createElement('ruby'); - ruby.appendChild(span); - const leftParenthesisRP=document.createElement('rp'); - leftParenthesisRP.textContent='('; - ruby.appendChild(leftParenthesisRP); - const rt=document.createElement('rt'); - rt.innerHTML=showCharacterNamePinyin=='showCodeIdentifier'?name:lib.translate[`${name}_rt`]||get.pinyin(characterName).join(' '); - ruby.appendChild(rt); - const rightParenthesisRP=document.createElement('rp'); - rightParenthesisRP.textContent=')'; - ruby.appendChild(rightParenthesisRP); - characterIntroTable.appendChild(ruby); - const characterSexDiv=ui.create.div('.character-sex',characterIntroTable),exInfoSex=exInfo&&exInfo.find(value=>value.indexOf('sex:')==0),characterSex=exInfoSex?exInfoSex.split(':').pop():nameInfo[0]; - new Promise((resolve,reject)=>{ - const imageName=`sex_${characterSex}`,information=lib.card[imageName]; - if(!information) resolve(`${lib.assetURL}image/card/${imageName}.png`); - const image=information.image; - if(!image) resolve(`${lib.assetURL}image/card/${imageName}.png`); - else if(image.indexOf('db:')==0) game.getDB('image',image.slice(3)).then(resolve,reject); - else if(image.indexOf('ext:')==0) resolve(`${lib.assetURL}${image.replace(/^ext:/,'extension/')}`); - else resolve(`${lib.assetURL}${image}`); - }).then(source=>new Promise((resolve,reject)=>{ - const image=new Image(); - image.onload=()=>resolve(image); - image.onerror=reject; - image.src=source; - })).then(image=>characterSexDiv.appendChild(image)).catch(()=>characterSexDiv.innerHTML=get.translation(characterSex)); - const characterGroupDiv=ui.create.div('.character-group',characterIntroTable),characterGroups=get.is.double(name,true); - if(characterGroups) Promise.all(characterGroups.map(characterGroup=>new Promise((resolve,reject)=>{ - const imageName=`group_${characterGroup}`,information=lib.card[imageName]; - if(!information) resolve(`${lib.assetURL}image/card/${imageName}.png`); - const image=information.image; - if(!image) resolve(`${lib.assetURL}image/card/${imageName}.png`); - else if(image.indexOf('db:')==0) game.getDB('image',image.slice(3)).then(resolve,reject); - else if(image.indexOf('ext:')==0) resolve(`${lib.assetURL}${image.replace(/^ext:/,'extension/')}`); - else resolve(`${lib.assetURL}${image}`); - }).then(source=>new Promise((resolve,reject)=>{ - const image=new Image(); - image.onload=()=>resolve(image); - image.onerror=reject; - image.src=source; - })))).then(images=>{ - let documentFragment=document.createDocumentFragment(); - images.forEach(documentFragment.appendChild,documentFragment); - characterGroupDiv.appendChild(documentFragment); - }).catch(()=>characterGroupDiv.innerHTML=characterGroups.map(characterGroup=>get.translation(characterGroup)).join('/')); - else{ - const characterGroup=nameInfo[1]; + + // 样式二 + if(lib.config.show_characternamepinyin=='showPinyin2'||lib.config.show_skillnamepinyin=='showPinyin2'){ + var intro=ui.create.div('.characterintro',get.characterIntro(name),uiintro); + if(lib.config.show_characternamepinyin=='showPinyin2'){ + var charactername=get.rawName(name); + var characterpinyin=get.pinyin(charactername); + var nameinfo=get.character(name); + var charactersex=get.translation(nameinfo[0]); + const charactergroups=get.is.double(name,true); + let charactergroup; + if(charactergroups) charactergroup=charactergroups.map(i=>get.translation(i)).join('/') + else charactergroup=get.translation(nameinfo[1]); + var characterhp=nameinfo[2]; + var characterintroinfo=get.characterIntro(name); + var spacemark=' | '; + if(charactername.length>3) spacemark=''+' '+''+'|'+''+' '+''; + intro.innerHTML=''+charactername+''+''+'['+characterpinyin+']'+''+spacemark+charactersex+spacemark+charactergroup+spacemark+characterhp+''+'
'+characterintroinfo; + } + var intro2=ui.create.div('.characterintro.intro2',uiintro); + var list=get.character(name,3)||[]; + var skills=ui.create.div('.characterskill',uiintro); + if(lib.config.touchscreen){ + lib.setScroll(intro); + lib.setScroll(intro2); + lib.setScroll(skills); + } + + if(lib.config.mousewheel){ + skills.onmousewheel=ui.click.mousewheel; + } + var clickSkill=function(e){ + while(intro2.firstChild){ + intro2.removeChild(intro2.lastChild); + } + var current=this.parentNode.querySelector('.active'); + if(current){ + current.classList.remove('active'); + } + this.classList.add('active'); + var skillname=get.translation(this.link); + var skilltranslationinfo=get.skillInfoTranslation(this.link); + if(lib.config.show_skillnamepinyin=='showPinyin2'&&skillname!='阵亡'){ + var skillpinyin=get.pinyin(skillname); + intro2.innerHTML=''+skillname+''+''+'['+skillpinyin+']'+''+' '+skilltranslationinfo; + }else{ + intro2.innerHTML=''+skillname+''+skilltranslationinfo; + } + var info=get.info(this.link); + var skill=this.link; + var playername=this.linkname; + var skillnode=this; + if(info.derivation){ + var derivation=info.derivation; + if(typeof derivation=='string'){ + derivation=[derivation]; + } + for(var i=0;i'+''+'['+derivationpinyin+']'+''+' '+derivationtranslationinfo; + }else{ + intro2.innerHTML+='

'+derivationname+''+derivationtranslationinfo; + } + } + } + if(info.alter){ + intro2.innerHTML+='

'; + var skillversionnode=intro2.querySelector('.hrefnode.skillversion'); + if(lib.config.vintageSkills.contains(skill)){ + skillversionnode.innerHTML='切换至新版'; + } + else{ + skillversionnode.innerHTML='切换至旧版'; + } + skillversionnode.listen(function(){ + if(lib.config.vintageSkills.contains(skill)){ + lib.config.vintageSkills.remove(skill); + lib.translate[skill+'_info']=lib.translate[skill+'_info_alter']; + } + else{ + lib.config.vintageSkills.push(skill); + lib.translate[skill+'_info']=lib.translate[skill+'_info_origin']; + } + game.saveConfig('vintageSkills',lib.config.vintageSkills); + clickSkill.call(skillnode,'init'); + }); + } + if(e!=='init') game.trySkillAudio(this.link,playername); + } + }else{ + // 样式一 + const introduction=ui.create.div('.characterintro',uiintro),showCharacterNamePinyin=lib.config.show_characternamepinyin; + if(showCharacterNamePinyin!='doNotShow'){ + const characterIntroTable=ui.create.div('.character-intro-table',introduction),span=document.createElement('span'); + span.style.fontWeight='bold'; + const nameInfo=get.character(name),exInfo=nameInfo[4],characterName=exInfo&&exInfo.includes('ruby')?lib.translate[name]:get.rawName(name); + span.innerHTML=characterName; + const ruby=document.createElement('ruby'); + ruby.appendChild(span); + const leftParenthesisRP=document.createElement('rp'); + leftParenthesisRP.textContent='('; + ruby.appendChild(leftParenthesisRP); + const rt=document.createElement('rt'); + rt.innerHTML=showCharacterNamePinyin=='showCodeIdentifier'?name:lib.translate[`${name}_rt`]||get.pinyin(characterName).join(' '); + ruby.appendChild(rt); + const rightParenthesisRP=document.createElement('rp'); + rightParenthesisRP.textContent=')'; + ruby.appendChild(rightParenthesisRP); + characterIntroTable.appendChild(ruby); + const characterSexDiv=ui.create.div('.character-sex',characterIntroTable),exInfoSex=exInfo&&exInfo.find(value=>value.indexOf('sex:')==0),characterSex=exInfoSex?exInfoSex.split(':').pop():nameInfo[0]; new Promise((resolve,reject)=>{ + const imageName=`sex_${characterSex}`,information=lib.card[imageName]; + if(!information) resolve(`${lib.assetURL}image/card/${imageName}.png`); + const image=information.image; + if(!image) resolve(`${lib.assetURL}image/card/${imageName}.png`); + else if(image.indexOf('db:')==0) game.getDB('image',image.slice(3)).then(resolve,reject); + else if(image.indexOf('ext:')==0) resolve(`${lib.assetURL}${image.replace(/^ext:/,'extension/')}`); + else resolve(`${lib.assetURL}${image}`); + }).then(source=>new Promise((resolve,reject)=>{ + const image=new Image(); + image.onload=()=>resolve(image); + image.onerror=reject; + image.src=source; + })).then(image=>characterSexDiv.appendChild(image)).catch(()=>characterSexDiv.innerHTML=get.translation(characterSex)); + const characterGroupDiv=ui.create.div('.character-group',characterIntroTable),characterGroups=get.is.double(name,true); + if(characterGroups) Promise.all(characterGroups.map(characterGroup=>new Promise((resolve,reject)=>{ const imageName=`group_${characterGroup}`,information=lib.card[imageName]; if(!information) resolve(`${lib.assetURL}image/card/${imageName}.png`); const image=information.image; @@ -54164,136 +54298,158 @@ image.onload=()=>resolve(image); image.onerror=reject; image.src=source; - })).then(image=>characterGroupDiv.appendChild(image)).catch(()=>characterGroupDiv.innerHTML=get.translation(characterGroup)); - } - const hpDiv=ui.create.div('.hp',characterIntroTable),nameInfoHP=nameInfo[2],infoHP=get.infoHp(nameInfoHP); - hpDiv.dataset.condition=infoHP<4?'mid':'high'; - ui.create.div(hpDiv); - const hpTextDiv=ui.create.div('.text',hpDiv),infoMaxHP=get.infoMaxHp(nameInfoHP); - hpTextDiv.innerHTML=infoHP==infoMaxHP?`×${infoHP}`:`×${infoHP}/${infoMaxHP}`; - const infoShield=get.infoHujia(nameInfoHP); - if(infoShield){ - ui.create.div('.shield',hpDiv); - const shieldTextDiv=ui.create.div('.text',hpDiv); - shieldTextDiv.innerHTML=`×${infoShield}`; - } - introduction.appendChild(document.createElement('hr')); - } - const htmlParser=document.createElement('body'); - htmlParser.innerHTML=get.characterIntro(name); - Array.from(htmlParser.childNodes).forEach(value=>introduction.appendChild(value)); - const introduction2=ui.create.div('.characterintro.intro2',uiintro); - var list=get.character(name,3)||[]; - var skills=ui.create.div('.characterskill',uiintro); - if(lib.config.touchscreen){ - lib.setScroll(introduction); - lib.setScroll(introduction2); - lib.setScroll(skills); - } - - if(lib.config.mousewheel){ - skills.onmousewheel=ui.click.mousewheel; - } - var clickSkill=function(e){ - while(introduction2.firstChild){ - introduction2.removeChild(introduction2.lastChild); - } - var current=this.parentNode.querySelector('.active'); - if(current){ - current.classList.remove('active'); + })))).then(images=>{ + let documentFragment=document.createDocumentFragment(); + images.forEach(documentFragment.appendChild,documentFragment); + characterGroupDiv.appendChild(documentFragment); + }).catch(()=>characterGroupDiv.innerHTML=characterGroups.map(characterGroup=>get.translation(characterGroup)).join('/')); + else{ + const characterGroup=nameInfo[1]; + new Promise((resolve,reject)=>{ + const imageName=`group_${characterGroup}`,information=lib.card[imageName]; + if(!information) resolve(`${lib.assetURL}image/card/${imageName}.png`); + const image=information.image; + if(!image) resolve(`${lib.assetURL}image/card/${imageName}.png`); + else if(image.indexOf('db:')==0) game.getDB('image',image.slice(3)).then(resolve,reject); + else if(image.indexOf('ext:')==0) resolve(`${lib.assetURL}${image.replace(/^ext:/,'extension/')}`); + else resolve(`${lib.assetURL}${image}`); + }).then(source=>new Promise((resolve,reject)=>{ + const image=new Image(); + image.onload=()=>resolve(image); + image.onerror=reject; + image.src=source; + })).then(image=>characterGroupDiv.appendChild(image)).catch(()=>characterGroupDiv.innerHTML=get.translation(characterGroup)); + } + const hpDiv=ui.create.div('.hp',characterIntroTable),nameInfoHP=nameInfo[2],infoHP=get.infoHp(nameInfoHP); + hpDiv.dataset.condition=infoHP<4?'mid':'high'; + ui.create.div(hpDiv); + const hpTextDiv=ui.create.div('.text',hpDiv),infoMaxHP=get.infoMaxHp(nameInfoHP); + hpTextDiv.innerHTML=infoHP==infoMaxHP?`×${infoHP}`:`×${infoHP}/${infoMaxHP}`; + const infoShield=get.infoHujia(nameInfoHP); + if(infoShield){ + ui.create.div('.shield',hpDiv); + const shieldTextDiv=ui.create.div('.text',hpDiv); + shieldTextDiv.innerHTML=`×${infoShield}`; + } + introduction.appendChild(document.createElement('hr')); + } + const htmlParser=document.createElement('body'); + htmlParser.innerHTML=get.characterIntro(name); + Array.from(htmlParser.childNodes).forEach(value=>introduction.appendChild(value)); + const introduction2=ui.create.div('.characterintro.intro2',uiintro); + var list=get.character(name,3)||[]; + var skills=ui.create.div('.characterskill',uiintro); + if(lib.config.touchscreen){ + lib.setScroll(introduction); + lib.setScroll(introduction2); + lib.setScroll(skills); } - this.classList.add('active'); - const skillNameSpan=document.createElement('span'),skillNameSpanStyle=skillNameSpan.style; - skillNameSpanStyle.fontWeight='bold'; - const link=this.link,skillName=get.translation(link); - skillNameSpan.innerHTML=skillName; - const showSkillNamePinyin=lib.config.show_skillnamepinyin; - if(showSkillNamePinyin!='doNotShow'&&skillName!='阵亡'){ - const ruby=document.createElement('ruby'); - ruby.appendChild(skillNameSpan); - const leftParenthesisRP=document.createElement('rp'); - leftParenthesisRP.textContent='('; - ruby.appendChild(leftParenthesisRP); - const rt=document.createElement('rt'); - rt.innerHTML=showSkillNamePinyin=='showCodeIdentifier'?link:lib.translate[`${link}_rt`]||get.pinyin(skillName).join(' '); - ruby.appendChild(rt); - const rightParenthesisRP=document.createElement('rp'); - rightParenthesisRP.textContent=')'; - ruby.appendChild(rightParenthesisRP); - const div=ui.create.div(introduction2); - div.style.marginRight='5px'; - div.appendChild(ruby); - } - else{ - skillNameSpanStyle.marginRight='5px'; - introduction2.appendChild(skillNameSpan); - } - htmlParser.innerHTML=get.skillInfoTranslation(this.link); - Array.from(htmlParser.childNodes).forEach(childNode=>introduction2.appendChild(childNode)); - var info=get.info(this.link); - var skill=this.link; - var playername=this.linkname; - var skillnode=this; - let derivations=info.derivation; - if(derivations){ - if(typeof derivations=='string') derivations=[derivations]; - derivations.forEach(derivation=>{ - introduction2.appendChild(document.createElement('br')); - introduction2.appendChild(document.createElement('br')); - const derivationNameSpan=document.createElement('span'),derivationNameSpanStyle=derivationNameSpan.style; - derivationNameSpanStyle.fontWeight='bold'; - const derivationName=get.translation(derivation); - derivationNameSpan.innerHTML=derivationName; - if(showSkillNamePinyin!='doNotShow'&&derivationName.length<=5&&derivation.indexOf('_faq')==-1){ - const ruby=document.createElement('ruby'); - ruby.appendChild(derivationNameSpan); - const leftParenthesisRP=document.createElement('rp'); - leftParenthesisRP.textContent='('; - ruby.appendChild(leftParenthesisRP); - const rt=document.createElement('rt'); - rt.innerHTML=showSkillNamePinyin=='showCodeIdentifier'?derivation:lib.translate[`${derivation}_rt`]||get.pinyin(derivationName).join(' '); - ruby.appendChild(rt); - const rightParenthesisRP=document.createElement('rp'); - rightParenthesisRP.textContent=')'; - ruby.appendChild(rightParenthesisRP); - const div=ui.create.div(introduction2); - div.style.marginRight='5px'; - div.appendChild(ruby); - } - else{ - derivationNameSpanStyle.marginRight='5px'; - introduction2.appendChild(derivationNameSpan); - } - htmlParser.innerHTML=get.skillInfoTranslation(derivation); - Array.from(htmlParser.childNodes).forEach(childNode=>introduction2.appendChild(childNode)); - }); + + if(lib.config.mousewheel){ + skills.onmousewheel=ui.click.mousewheel; } - if(info.alter){ - introduction2.appendChild(document.createElement('br')); - introduction2.appendChild(document.createElement('br')); - ui.create.div('.hrefnode.skillversion',introduction2); - var skillversionnode=introduction2.querySelector('.hrefnode.skillversion'); - if(lib.config.vintageSkills.contains(skill)){ - skillversionnode.innerHTML='切换至新版'; + var clickSkill=function(e){ + while(introduction2.firstChild){ + introduction2.removeChild(introduction2.lastChild); } - else{ - skillversionnode.innerHTML='切换至旧版'; + var current=this.parentNode.querySelector('.active'); + if(current){ + current.classList.remove('active'); + } + this.classList.add('active'); + const skillNameSpan=document.createElement('span'),skillNameSpanStyle=skillNameSpan.style; + skillNameSpanStyle.fontWeight='bold'; + const link=this.link,skillName=get.translation(link); + skillNameSpan.innerHTML=skillName; + const showSkillNamePinyin=lib.config.show_skillnamepinyin; + if(showSkillNamePinyin!='doNotShow'&&skillName!='阵亡'){ + const ruby=document.createElement('ruby'); + ruby.appendChild(skillNameSpan); + const leftParenthesisRP=document.createElement('rp'); + leftParenthesisRP.textContent='('; + ruby.appendChild(leftParenthesisRP); + const rt=document.createElement('rt'); + rt.innerHTML=showSkillNamePinyin=='showCodeIdentifier'?link:lib.translate[`${link}_rt`]||get.pinyin(skillName).join(' '); + ruby.appendChild(rt); + const rightParenthesisRP=document.createElement('rp'); + rightParenthesisRP.textContent=')'; + ruby.appendChild(rightParenthesisRP); + const div=ui.create.div(introduction2); + div.style.marginRight='5px'; + div.appendChild(ruby); + } + else{ + skillNameSpanStyle.marginRight='5px'; + introduction2.appendChild(skillNameSpan); + } + htmlParser.innerHTML=get.skillInfoTranslation(this.link); + Array.from(htmlParser.childNodes).forEach(childNode=>introduction2.appendChild(childNode)); + var info=get.info(this.link); + var skill=this.link; + var playername=this.linkname; + var skillnode=this; + let derivations=info.derivation; + if(derivations){ + if(typeof derivations=='string') derivations=[derivations]; + derivations.forEach(derivation=>{ + introduction2.appendChild(document.createElement('br')); + introduction2.appendChild(document.createElement('br')); + const derivationNameSpan=document.createElement('span'),derivationNameSpanStyle=derivationNameSpan.style; + derivationNameSpanStyle.fontWeight='bold'; + const derivationName=get.translation(derivation); + derivationNameSpan.innerHTML=derivationName; + if(showSkillNamePinyin!='doNotShow'&&derivationName.length<=5&&derivation.indexOf('_faq')==-1){ + const ruby=document.createElement('ruby'); + ruby.appendChild(derivationNameSpan); + const leftParenthesisRP=document.createElement('rp'); + leftParenthesisRP.textContent='('; + ruby.appendChild(leftParenthesisRP); + const rt=document.createElement('rt'); + rt.innerHTML=showSkillNamePinyin=='showCodeIdentifier'?derivation:lib.translate[`${derivation}_rt`]||get.pinyin(derivationName).join(' '); + ruby.appendChild(rt); + const rightParenthesisRP=document.createElement('rp'); + rightParenthesisRP.textContent=')'; + ruby.appendChild(rightParenthesisRP); + const div=ui.create.div(introduction2); + div.style.marginRight='5px'; + div.appendChild(ruby); + } + else{ + derivationNameSpanStyle.marginRight='5px'; + introduction2.appendChild(derivationNameSpan); + } + htmlParser.innerHTML=get.skillInfoTranslation(derivation); + Array.from(htmlParser.childNodes).forEach(childNode=>introduction2.appendChild(childNode)); + }); } - skillversionnode.listen(function(){ + if(info.alter){ + introduction2.appendChild(document.createElement('br')); + introduction2.appendChild(document.createElement('br')); + ui.create.div('.hrefnode.skillversion',introduction2); + var skillversionnode=introduction2.querySelector('.hrefnode.skillversion'); if(lib.config.vintageSkills.contains(skill)){ - lib.config.vintageSkills.remove(skill); - lib.translate[skill+'_info']=lib.translate[skill+'_info_alter']; + skillversionnode.innerHTML='切换至新版'; } else{ - lib.config.vintageSkills.push(skill); - lib.translate[skill+'_info']=lib.translate[skill+'_info_origin']; + skillversionnode.innerHTML='切换至旧版'; } - game.saveConfig('vintageSkills',lib.config.vintageSkills); - clickSkill.call(skillnode,'init'); - }); + skillversionnode.listen(function(){ + if(lib.config.vintageSkills.contains(skill)){ + lib.config.vintageSkills.remove(skill); + lib.translate[skill+'_info']=lib.translate[skill+'_info_alter']; + } + else{ + lib.config.vintageSkills.push(skill); + lib.translate[skill+'_info']=lib.translate[skill+'_info_origin']; + } + game.saveConfig('vintageSkills',lib.config.vintageSkills); + clickSkill.call(skillnode,'init'); + }); + } + if(e!=='init') game.trySkillAudio(this.link,playername); } - if(e!=='init') game.trySkillAudio(this.link,playername); } + var initskill=false; for(var i=0;iget.translation(value)).join('/')}`; else capt+=`  ${lib.translate[infoGroup]}`; diff --git a/game/update.js b/game/update.js index 22579a4634..c17ea8f1dd 100644 --- a/game/update.js +++ b/game/update.js @@ -1,6 +1,6 @@ window.noname_update={ - version:'1.10.2', - update:'1.10.1.0.1', + version:'1.10.2.1', + update:'1.10.2', changeLog:[ '整合@rintim @mengxinzxz @lieren2023 @PZ157 @Tipx-L @kuangshen04 @nonameShijian @copcap的Pull Request', '新武将:界钟繇、武陆逊、界文聘、许靖、孟优、陈式、费曜、孙礼、夏侯楙、OL陆郁生、☆周不疑、', @@ -11,63 +11,18 @@ window.noname_update={ '其他技能修改与bug修复', ], files:[ - 'card/extra.js', - 'card/guozhan.js', - 'card/standard.js', - 'card/swd.js', 'card/yingbian.js', - 'card/yongjian.js', - 'character/clan.js', - 'character/collab.js', - 'character/ddd.js', - 'character/diy.js', 'character/extra.js', 'character/huicui.js', 'character/jsrg.js', - 'character/mobile.js', - 'character/offline.js', - 'character/old.js', - 'character/ow.js', - 'character/rank.js', - 'character/refresh.js', - 'character/sb.js', 'character/shenhua.js', 'character/shiji.js', - 'character/sp.js', - 'character/sp2.js', - 'character/standard.js', - 'character/swd.js', - 'character/tw.js', 'character/xianding.js', - 'character/xianjian.js', - 'character/xinghuoliaoyuan.js', 'character/yijiang.js', - 'character/yingbian.js', - 'character/zhuogui.js', - 'game/codemirror.js', - 'game/config.js', 'game/game.js', - 'game/source.js', - 'game/pinyinjs.js', - 'image/flappybird/BG.png', - 'image/flappybird/botpipe.png', - 'image/flappybird/gameclear.png', - 'image/flappybird/gameover.png', - 'image/flappybird/getready.png', - 'image/flappybird/ground.png', - 'image/flappybird/toppipe.png', - 'image/flappybird/bird/b0.png', - 'image/flappybird/bird/b1.png', - 'image/flappybird/bird/b2.png', - 'image/flappybird/ground/g0.png', - 'image/flappybird/ground/g1.png', - 'image/flappybird/tap/t0.png', - 'image/flappybird/tap/t1.png', - 'layout/default/codemirror.css', - 'layout/default/layout.css', - 'layout/default/menu.css', - 'mode/boss.js', + 'mode/doudizhu.js', 'mode/guozhan.js', - 'mode/versus.js', + 'mode/identity.js', + 'mode/single.js', ] }; diff --git a/mode/doudizhu.js b/mode/doudizhu.js index 5a74cb4186..9a8a6c1256 100644 --- a/mode/doudizhu.js +++ b/mode/doudizhu.js @@ -154,6 +154,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.zhu.showGiveup(); }, game:{ + canReplaceViewpoint:()=>true, recommendDizhu:[ 're_guojia','re_huanggai','re_lvbu','re_guanyu','re_sunquan','re_xusheng','re_wuyi','re_sunben', 'xuyou','zhangchunhua','caochong','zhangsong','zhongyao','wangyi', diff --git a/mode/guozhan.js b/mode/guozhan.js index c8e3413960..8a177350f8 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -13259,6 +13259,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, game:{ + canReplaceViewpoint:()=>true, showYexings:function(){ if(_status.showYexings) return; _status.showYexings=true; diff --git a/mode/identity.js b/mode/identity.js index 9601787839..30d72fcacd 100644 --- a/mode/identity.js +++ b/mode/identity.js @@ -304,6 +304,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.phaseLoop(_status.firstAct2||game.zhong||game.zhu||_status.firstAct||game.me); }, game:{ + canReplaceViewpoint:()=>true, getState:function(){ var state={}; for(var i in lib.playerOL){ diff --git a/mode/single.js b/mode/single.js index 825e82f793..7d37dff5ee 100644 --- a/mode/single.js +++ b/mode/single.js @@ -250,6 +250,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.phaseLoop(game.zhu); }, game:{ + canReplaceViewpoint:()=>true, addRecord:function(bool){ if(typeof bool=='boolean'){ var mode=_status.mode;