Merge pull request #429 from libccy/PR-Branch

v1.10.2.1
This commit is contained in:
Spmario233 2023-09-30 02:15:41 +08:00 committed by GitHub
commit b5a16af388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 481 additions and 324 deletions

BIN
audio/die/dc_xujing.mp3 Normal file

Binary file not shown.

BIN
audio/die/wu_luxun.mp3 Normal file

Binary file not shown.

BIN
audio/die/yue_zhoufei.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dccaixia1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dccaixia2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dclingkong1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dclingkong2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcruxian1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcruxian2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcshangyu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcshangyu2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcxianshu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcxianshu2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcxiongmu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcxiongmu2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dczhangcai1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dczhangcai2.mp3 Normal file

Binary file not shown.

View File

@ -381,7 +381,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
trigger:{player:'equipAfter'}, trigger:{player:'equipAfter'},
forced:true, forced:true,
equipSkill: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:()=>{ content:()=>{
player.chooseToDiscard(true,card=>card!=_status.event.getTrigger().card,'he'); player.chooseToDiscard(true,card=>card!=_status.event.getTrigger().card,'he');
}, },

View File

@ -624,19 +624,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2, audio:2,
trigger:{player:'useCardAfter'}, trigger:{player:'useCardAfter'},
filter:function(event,player){ filter:function(event,player){
if(event.skill=='dccuixin') return false; if(!event._dccuixin||get.type(event.card,false)=='delay'||get.type(event.card,false)=='equip') return false;
if(event.targets.length==0) return false;
if(get.type(event.card,false)=='delay'||get.type(event.card,false)=='equip') return false;
var card={ var card={
name:event.card.name, name:event.card.name,
nature:event.card.nature, nature:event.card.nature,
isCard:true, isCard:true,
} },list=event._dccuixin;
for(var target of event.targets){ for(var target of list){
var targetx; var targetx=player[target]();
if(target==player.getNext()) targetx=player.getPrevious();
else if(target==player.getPrevious()) targetx=player.getNext();
else continue;
if(lib.filter.targetEnabled2(card,targetx,player)) return true; if(lib.filter.targetEnabled2(card,targetx,player)) return true;
} }
return false; return false;
@ -650,21 +645,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
isCard:true, isCard:true,
}; };
event.card=card; event.card=card;
var list=trigger.targets.filter(target=>{ var list=[];
var targetx; trigger._dccuixin.forEach(target=>{
if(target==player.getNext()) targetx=player.getPrevious(); var targetx=player[target]();
else if(target==player.getPrevious()) targetx=player.getNext(); if(lib.filter.targetEnabled2(card,targetx,player)) list.add(targetx);
else return false;
if(lib.filter.targetEnabled2(card,targetx,player)) return true;
}).map(target=>{
return target==player.getPrevious()?player.getNext():player.getPrevious();
}); });
if(list.length==1){ if(list.length==1){
event.target=list[0]; 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{ 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); return (target==player.getNext()||target==player.getPrevious())&&lib.filter.targetEnabled2(_status.event.getParent().card,target,player);
}).set('ai',function(target){ }).set('ai',function(target){
var player=_status.event.player; 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'); 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:{ twshelie:{
@ -2828,7 +2841,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
tspowei:{ tspowei:{
audio:3, audio:3,
dutySkill:true, dutySkill:true,
locked:true,
derivation:'shenzhu', derivation:'shenzhu',
group:['tspowei_init','tspowei_move','tspowei_achieve','tspowei_fail','tspowei_use','tspowei_remove'], group:['tspowei_init','tspowei_move','tspowei_achieve','tspowei_fail','tspowei_use','tspowei_remove'],
subSkill:{ 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()); return 10*Math.sqrt(Math.max(0.01,get.threaten(target)))/(3.5-draw)+dis/(2*game.countPlayer());
} }
else{ else{
if(target.isTurnedOver()) return -att-draw; if(target.isTurnedOver()) return att-draw;
if(draw>=5) return -1; if(draw>=5) return -1;
if(current&&target.getSeatNum()<=current.getSeatNum()) return -att+draw/3; 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; 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:'奇径',
dcqijing_info:'觉醒技。一名角色的回合结束后若你的三个副区域标签均被激活则你减1点体力上限将座位移动至一名其他角色的上家之后获得〖摧心〗和一个额外回合。', dcqijing_info:'觉醒技。一名角色的回合结束后若你的三个副区域标签均被激活则你减1点体力上限将座位移动至一名其他角色的上家之后获得〖摧心〗和一个额外回合。',
dccuixin:'摧心', dccuixin:'摧心',
dccuixin_info:'当你不因此技能使用的基本牌或普通锦囊牌结算结束后,若此牌的目标包含你的上家或下家,则你可以视为对下家或上家再使用一张牌名和元素相同的牌。', dccuixin_info:'当你不因此技能使用的基本牌或普通锦囊牌结算结束后,若此牌的目标于你使用此牌指定第一个目标时包含你的上家或下家,则你可以视为对下家或上家再使用一张牌名和元素相同的牌。',
shen_dianwei:'神典韦', shen_dianwei:'神典韦',
juanjia:'捐甲', juanjia:'捐甲',
juanjia_info:'锁定技。游戏开始时,你废除一个防具栏,然后获得一个额外的武器栏。', juanjia_info:'锁定技。游戏开始时,你废除一个防具栏,然后获得一个额外的武器栏。',

View File

@ -2619,15 +2619,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var cards=result.cards,targets=result.targets; var cards=result.cards,targets=result.targets;
event.cards=cards; event.cards=cards;
var cardx=get.autoViewAs({name:'sha'},cards); var next=player.useCard({name:'sha'},cards,targets,false,'dcsaowei');
event.cardx=cardx; player.when('useCardAfter')
player.useCard(cardx,cards,targets,false,'dcsaowei'); .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');
}, },
}, },
//向朗 //向朗

View File

@ -711,6 +711,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},'hs'); },'hs');
}, },
groupSkill:true, groupSkill:true,
locked:false,
viewAs:{ viewAs:{
name:'sha', name:'sha',
storage:{jsrgxianzhu:true}, storage:{jsrgxianzhu:true},
@ -2367,7 +2368,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true, direct:true,
content:function(){ content:function(){
'step 0' '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(ui.selected.cards.length>=_status.event.max) return 0;
if(_status.event.goon) return 4.5-get.value(card); if(_status.event.goon) return 4.5-get.value(card);
return 0; return 0;

View File

@ -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()); return 10*Math.sqrt(Math.max(0.01,get.threaten(target)))/(3.5-draw)+dis/(2*game.countPlayer());
} }
else{ else{
if(target.isTurnedOver()) return -att-draw; if(target.isTurnedOver()) return att-draw;
if(draw>=5) return -1; if(draw>=5) return -1;
if(current&&target.getSeatNum()<=current.getSeatNum()) return -att+draw/3; 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; return (4.25-draw)*10*Math.sqrt(Math.max(0.01,get.threaten(target)))+2*game.countPlayer()/dis;

View File

@ -2229,8 +2229,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
selectCard:-1, selectCard:-1,
log:false, log:false,
precontent:function(){ precontent:function(){
'step 0'
player.logSkill('dbzhuifeng'); player.logSkill('dbzhuifeng');
player.loseHp(); player.loseHp();
event.forceDie=true;
'step 1'
//特殊处理
if(player.isDead()){
player.useResult(event.result,event.getParent())
}
}, },
ai:{ ai:{
order:function(){ order:function(){

View File

@ -137,7 +137,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var piles=['cardPile','discardPile']; var piles=['cardPile','discardPile'];
for(var pile of piles){ for(var pile of piles){
for(var i=0;i<ui[pile].childNodes.length;i++){ for(var i=0;i<ui[pile].childNodes.length;i++){
var card=ui.cardPile.childNodes[i]; var card=ui[pile].childNodes[i];
var number=get.number(card,false); var number=get.number(card,false);
if(!list.contains(card)&&number==8){ if(!list.contains(card)&&number==8){
list.push(card); list.push(card);
@ -153,7 +153,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(player.hasSkillTag('jueqing')) return; if(target.countCards('h')>=target.getHp()||player.hasSkillTag('jueqing')) return;
if(player._dcxiongmu_temp) return; if(player._dcxiongmu_temp) return;
if(_status.event.getParent('useCard',true)||_status.event.getParent('_wuxie',true)) return; if(_status.event.getParent('useCard',true)||_status.event.getParent('_wuxie',true)) return;
if(get.tag(card,'damage')){ if(get.tag(card,'damage')){
@ -200,7 +200,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
minus:{ minus:{
trigger:{player:'damageBegin4'}, trigger:{player:'damageBegin4'},
filter:function(event,player){ filter:function(event,player){
return game.getGlobalHistory('everything',evt=>{ return player.countCards('h')<player.hp&&game.getGlobalHistory('everything',evt=>{
return evt.name=='damage'&&evt.player==player; return evt.name=='damage'&&evt.player==player;
},event).indexOf(event)==0; },event).indexOf(event)==0;
}, },
@ -308,7 +308,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
'step 1' 'step 1'
if(get.owner(card)==player&&get.position(card)=='h'&&game.hasPlayer(current=>current!=player)){ 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(); else event.finish();
'step 2' 'step 2'
@ -316,8 +316,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0]; var target=result.targets[0];
player.line(target); player.line(target);
player.give(card,target).gaintag.add('dcshangyu_tag'); player.give(card,target).gaintag.add('dcshangyu_tag');
player.addSkill('dcshangyu_effect');
} }
player.addSkill('dcshangyu_effect');
}, },
subSkill:{ subSkill:{
effect:{ effect:{
@ -425,7 +425,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true, direct:true,
content:function(){ content:function(){
'step 0' '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',()=>{ player.chooseControl(choices,'cancel2').set('prompt',get.prompt('dccaixia')).set('prompt2','你可以摸至多'+get.cnNumber(choices.length)+'张牌,但是你此后需要再使用等量的牌才可再发动本技能。').set('ai',()=>{
return _status.event.choice; return _status.event.choice;
}).set('choice',function(){ }).set('choice',function(){
@ -3799,7 +3799,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return 0; return 0;
} }
var num=ui.selected.buttons.filter(i=>get.owner(i.link)==target).length; 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' 'step 1'
if(result.bool){ if(result.bool){
@ -12652,9 +12656,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dc_xujing:'许靖', dc_xujing:'许靖',
dcshangyu:'赏誉', dcshangyu:'赏誉',
dcshangyu_tag:'赏誉', dcshangyu_tag:'赏誉',
dcshangyu_info:'锁定技。游戏开始时,你获得一张【杀】并记录之,然后将此牌交给一名角色,你获得如下效果1.当一名角色使用此牌造成伤害后你与其各摸一张牌2.当此牌进入弃牌堆后,你将此牌交给一名本回合未以此法得到过此牌的角色。', dcshangyu_info:'锁定技。游戏开始时,你获得一张【杀】并记录之,并可以将此牌交给一名角色。然后你获得如下效果1.当一名角色使用此牌造成伤害后你与其各摸一张牌2.当此牌进入弃牌堆后,你将此牌交给一名本回合未以此法得到过此牌的角色。',
dccaixia:'才瑕', dccaixia:'才瑕',
dccaixia_info:'当你造成或受到伤害后若你没有“瑕”你可以摸至多X张牌并获得X枚“瑕”然后当你使用牌时移去1枚“瑕”X为场上角色数且至多为5。', dccaixia_info:'当你造成或受到伤害后若你没有“瑕”你可以摸至多X张牌并获得X枚“瑕”然后当你使用牌时移去1枚“瑕”X为本局游戏总角色数且至多为5。',
wu_luxun:'武陆逊', wu_luxun:'武陆逊',
dcxiongmu:'雄幕', dcxiongmu:'雄幕',
dcxiongmu_tag:'雄幕', dcxiongmu_tag:'雄幕',

View File

@ -484,12 +484,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}()); }());
'step 1' 'step 1'
var guessedNum=result.index; var guessedNum=result.index;
var type=get.type2(trigger.card,trigger.player);
player.chat('我猜'+get.cnNumber(guessedNum)+'张'); player.chat('我猜'+get.cnNumber(guessedNum)+'张');
game.log(player,'猜测',trigger.player,'有',get.cnNumber(guessedNum)+'张'+get.translation(type)+'牌'); game.log(player,'猜测',trigger.player,'有',get.cnNumber(guessedNum)+'张'+get.translation(type)+'牌');
event.guessedNum=guessedNum; event.guessedNum=guessedNum;
game.delay(); game.delay();
'step 2' 'step 2'
var type=get.type2(trigger.card,trigger.player);
var count=trigger.player.countCards('h',card=>get.type2(card)==type); var count=trigger.player.countCards('h',card=>get.type2(card)==type);
var guessedNum=event.guessedNum; var guessedNum=event.guessedNum;
if(count==guessedNum){ if(count==guessedNum){

View File

@ -1,5 +1,5 @@
window.noname_asset_list=[ window.noname_asset_list=[
'v1.10.2', 'v1.10.2.1',
/*audio start*/ /*audio start*/
'audio/background/aozhan_chaoming.mp3', 'audio/background/aozhan_chaoming.mp3',
'audio/background/aozhan_online.mp3', 'audio/background/aozhan_online.mp3',
@ -288,6 +288,7 @@ window.noname_asset_list=[
'audio/die/dc_wangchang.mp3', 'audio/die/dc_wangchang.mp3',
'audio/die/dc_wangjun.mp3', 'audio/die/dc_wangjun.mp3',
'audio/die/dc_wangyun.mp3', 'audio/die/dc_wangyun.mp3',
'audio/die/dc_xujing.mp3',
'audio/die/dc_xushu.mp3', 'audio/die/dc_xushu.mp3',
'audio/die/dc_yangbiao.mp3', 'audio/die/dc_yangbiao.mp3',
'audio/die/dc_yanghu.mp3', 'audio/die/dc_yanghu.mp3',
@ -1005,6 +1006,7 @@ window.noname_asset_list=[
'audio/die/wis_xuyou.mp3', 'audio/die/wis_xuyou.mp3',
'audio/die/wis_zhangzhao.mp3', 'audio/die/wis_zhangzhao.mp3',
'audio/die/wolongfengchu.mp3', 'audio/die/wolongfengchu.mp3',
'audio/die/wu_luxun.mp3',
'audio/die/wu_zhugeliang.mp3', 'audio/die/wu_zhugeliang.mp3',
'audio/die/wu_zhutiexiong.mp3', 'audio/die/wu_zhutiexiong.mp3',
'audio/die/wuanguo.mp3', 'audio/die/wuanguo.mp3',
@ -1133,6 +1135,7 @@ window.noname_asset_list=[
'audio/die/yuantanyuanshang.mp3', 'audio/die/yuantanyuanshang.mp3',
'audio/die/yuantanyuanxiyuanshang.mp3', 'audio/die/yuantanyuanxiyuanshang.mp3',
'audio/die/yue_caiwenji.mp3', 'audio/die/yue_caiwenji.mp3',
'audio/die/yue_zhoufei.mp3',
'audio/die/yuechen.mp3', 'audio/die/yuechen.mp3',
'audio/die/yuejin.mp3', 'audio/die/yuejin.mp3',
'audio/die/yuejiu.mp3', 'audio/die/yuejiu.mp3',
@ -1751,6 +1754,8 @@ window.noname_asset_list=[
'audio/skill/dcbihuo2.mp3', 'audio/skill/dcbihuo2.mp3',
'audio/skill/dcbingji1.mp3', 'audio/skill/dcbingji1.mp3',
'audio/skill/dcbingji2.mp3', 'audio/skill/dcbingji2.mp3',
'audio/skill/dccaixia1.mp3',
'audio/skill/dccaixia2.mp3',
'audio/skill/dccaizhuang1.mp3', 'audio/skill/dccaizhuang1.mp3',
'audio/skill/dccaizhuang2.mp3', 'audio/skill/dccaizhuang2.mp3',
'audio/skill/dccansi1.mp3', 'audio/skill/dccansi1.mp3',
@ -1907,6 +1912,8 @@ window.noname_asset_list=[
'audio/skill/dcligong2.mp3', 'audio/skill/dcligong2.mp3',
'audio/skill/dclingfang1.mp3', 'audio/skill/dclingfang1.mp3',
'audio/skill/dclingfang2.mp3', 'audio/skill/dclingfang2.mp3',
'audio/skill/dclingkong1.mp3',
'audio/skill/dclingkong2.mp3',
'audio/skill/dclingyin1.mp3', 'audio/skill/dclingyin1.mp3',
'audio/skill/dclingyin2.mp3', 'audio/skill/dclingyin2.mp3',
'audio/skill/dclingyue1.mp3', 'audio/skill/dclingyue1.mp3',
@ -1983,10 +1990,14 @@ window.noname_asset_list=[
'audio/skill/dcrihui2.mp3', 'audio/skill/dcrihui2.mp3',
'audio/skill/dcruizhan1.mp3', 'audio/skill/dcruizhan1.mp3',
'audio/skill/dcruizhan2.mp3', 'audio/skill/dcruizhan2.mp3',
'audio/skill/dcruxian1.mp3',
'audio/skill/dcruxian2.mp3',
'audio/skill/dcruyi1.mp3', 'audio/skill/dcruyi1.mp3',
'audio/skill/dcruyi2.mp3', 'audio/skill/dcruyi2.mp3',
'audio/skill/dcsaowei1.mp3', 'audio/skill/dcsaowei1.mp3',
'audio/skill/dcsaowei2.mp3', 'audio/skill/dcsaowei2.mp3',
'audio/skill/dcshangyu1.mp3',
'audio/skill/dcshangyu2.mp3',
'audio/skill/dcshibei1.mp3', 'audio/skill/dcshibei1.mp3',
'audio/skill/dcshibei2.mp3', 'audio/skill/dcshibei2.mp3',
'audio/skill/dcshiji1.mp3', 'audio/skill/dcshiji1.mp3',
@ -2061,6 +2072,8 @@ window.noname_asset_list=[
'audio/skill/dcxiangshu2.mp3', 'audio/skill/dcxiangshu2.mp3',
'audio/skill/dcxianjin1.mp3', 'audio/skill/dcxianjin1.mp3',
'audio/skill/dcxianjin2.mp3', 'audio/skill/dcxianjin2.mp3',
'audio/skill/dcxianshu1.mp3',
'audio/skill/dcxianshu2.mp3',
'audio/skill/dcxianzhu1.mp3', 'audio/skill/dcxianzhu1.mp3',
'audio/skill/dcxianzhu2.mp3', 'audio/skill/dcxianzhu2.mp3',
'audio/skill/dcxiaojuan1.mp3', 'audio/skill/dcxiaojuan1.mp3',
@ -2071,6 +2084,8 @@ window.noname_asset_list=[
'audio/skill/dcxieshou2.mp3', 'audio/skill/dcxieshou2.mp3',
'audio/skill/dcxinyou1.mp3', 'audio/skill/dcxinyou1.mp3',
'audio/skill/dcxinyou2.mp3', 'audio/skill/dcxinyou2.mp3',
'audio/skill/dcxiongmu1.mp3',
'audio/skill/dcxiongmu2.mp3',
'audio/skill/dcxiuwen1.mp3', 'audio/skill/dcxiuwen1.mp3',
'audio/skill/dcxiuwen2.mp3', 'audio/skill/dcxiuwen2.mp3',
'audio/skill/dcxuewei1.mp3', 'audio/skill/dcxuewei1.mp3',
@ -2107,6 +2122,8 @@ window.noname_asset_list=[
'audio/skill/dcyuguan2.mp3', 'audio/skill/dcyuguan2.mp3',
'audio/skill/dczecai1.mp3', 'audio/skill/dczecai1.mp3',
'audio/skill/dczecai2.mp3', 'audio/skill/dczecai2.mp3',
'audio/skill/dczhangcai1.mp3',
'audio/skill/dczhangcai2.mp3',
'audio/skill/dczhanmeng1.mp3', 'audio/skill/dczhanmeng1.mp3',
'audio/skill/dczhanmeng2.mp3', 'audio/skill/dczhanmeng2.mp3',
'audio/skill/dczhanyi1.mp3', 'audio/skill/dczhanyi1.mp3',

View File

@ -3856,6 +3856,18 @@
} }
} }
}, },
show_sex:{
name:'显示角色性别',
intro:'在角色的右键菜单中显示角色性别',
init:true,
unfrequent:true
},
show_group:{
name:'显示角色势力',
intro:'在角色的右键菜单中显示角色势力',
init:true,
unfrequent:true
},
show_replay:{ show_replay:{
name:'显示重来按钮', name:'显示重来按钮',
init:false, init:false,
@ -4026,8 +4038,9 @@
unfrequent:true, unfrequent:true,
item:{ item:{
doNotShow:'不显示', doNotShow:'不显示',
showPinyin:'显示拼音', showPinyin:'拼音(样式一)',
showCodeIdentifier:'显示代码ID' showCodeIdentifier:'代码ID(样式一)',
showPinyin2:'拼音(样式二)',
}, },
visualMenu:(node,link,name)=>{ visualMenu:(node,link,name)=>{
node.classList.add('button','character'); node.classList.add('button','character');
@ -4039,7 +4052,7 @@
style.display='flex'; style.display='flex';
style.height='60px'; style.height='60px';
style.justifyContent='center'; style.justifyContent='center';
style.width='150px'; style.width='200px';
const firstChild=node.firstChild; const firstChild=node.firstChild;
firstChild.removeAttribute('class'); firstChild.removeAttribute('class');
firstChild.style.position='initial'; firstChild.style.position='initial';
@ -13766,13 +13779,11 @@
lib.onphase[i](); lib.onphase[i]();
} }
player.phase(); player.phase();
event.player=player.next;
"step 2" "step 2"
if(!game.players.contains(event.player.next)){ if(!game.players.contains(event.player.next)){
event.player=game.findNext(event.player.next); event.player=game.findNext(event.player.next);
} }
else{
event.player=event.player.next;
}
event.goto(1); event.goto(1);
}, },
loadPackage:function(){ loadPackage:function(){
@ -28952,29 +28963,37 @@
if(Array.isArray(card)){ if(Array.isArray(card)){
if(card[2]=='huosha'){ if(card[2]=='huosha'){
card[2]='sha'; card[2]='sha';
card[3]=['fire']; card[3]='fire';
} }
else if(card[2]=='leisha'){ else if(card[2]=='leisha'){
card[2]='sha'; card[2]='sha';
card[3]=['thunder']; card[3]='thunder';
} }
// else if(card[2]=='kamisha'){ // else if(card[2]=='kamisha'){
// card[2]='sha'; // card[2]='sha';
// card[3]=['kami']; // card[3]='kami';
// } // }
// else if(card[2]=='icesha'){ // else if(card[2]=='icesha'){
// card[2]='sha'; // card[2]='sha';
// card[3]=['ice']; // card[3]='ice';
// } // }
else if(card[2]=='cisha'){ else if(card[2]=='cisha'){
card[2]='sha'; card[2]='sha';
card[3]=['stab']; card[3]='stab';
} }
else if(card[2].length>3){ else if(card[2].length>3){
let prefix=card[2].slice(0,card[2].lastIndexOf('sha')); 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[2]='sha';
card[3]=[prefix]; card[3]=get.nature(natureList);
} }
} }
} }
@ -40940,14 +40959,19 @@
} }
//创建ul列表 //创建ul列表
const createMenu=function(pos,self,List,click){ const createMenu=function(pos,self,List,click){
if (self&&self.createMenu) return false; if(!self||self==window) return;
const parent=self.parentNode; const parent=self.parentNode;
if (parent){ if (parent){
for(let i=0;i<parent.childElementCount;i++){ for(let i=0;i<parent.childElementCount;i++){
const node=parent.childNodes[i]; const node=parent.childNodes[i];
node!=self&&node.createMenu&&closeMenu.call(node); if(node!=self&&node.createMenu) closeMenu.call(node);
} }
} }
if(self.createMenu){
createList.add(self.createMenu);
ui.window.appendChild(self.createMenu);
return self.createMenu;
}
const editor=container.editor; const editor=container.editor;
if(!editor) return false; if(!editor) return false;
self.style.background='#08f'; self.style.background='#08f';
@ -40959,7 +40983,8 @@
height:'20em', height:'20em',
width:pos.width*4/game.documentZoom+'px', width:pos.width*4/game.documentZoom+'px',
//'font-family':'shousha', //'font-family':'shousha',
'font-size':20/game.documentZoom+'px', 'font-size':(lib.config.codeMirror_fontSize?lib.config.codeMirror_fontSize.slice(0,-2):16)/game.documentZoom+'px',
}); });
const theme=editor.options.theme; const theme=editor.options.theme;
lib.setScroll(ul); lib.setScroll(ul);
@ -41003,7 +41028,7 @@
}; };
} }
} }
createList.push(ul); createList.add(ul);
ui.window.appendChild(ul); ui.window.appendChild(ul);
return ul; return ul;
}; };
@ -41013,7 +41038,8 @@
if(!ul) return false; if(!ul) return false;
if(ul.parentNode) ul.parentNode.removeChild(ul); if(ul.parentNode) ul.parentNode.removeChild(ul);
this.style.background=''; this.style.background='';
delete this.createMenu; //创建后不用删除了,除非以后要动态加载。
//delete this.createMenu;
createList.remove(ul); createList.remove(ul);
return ul; return ul;
}; };
@ -41026,46 +41052,79 @@
}); });
const saveConfig=ui.create.div('.editbutton','保存',editorpage,saveInput); const saveConfig=ui.create.div('.editbutton','保存',editorpage,saveInput);
const theme=ui.create.div('.editbutton','主题',editorpage,function(){ const theme=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); return closeMenu.call(this);
} }
//主题列表
const list=['mdn-like','mbo'];
//正在使用的主题
const active=container.editor.options.theme;
//排个序
list.remove(active).splice(0,0,active);
//this //this
const self=this; const self=this;
//元素位置 if(!this.createMenu){
const pos=this.getBoundingClientRect(); //主题列表
//点击事件 const list=['mdn-like','mbo'];
const click=function(e){ //正在使用的主题
const theme=this.innerHTML; const active=container.editor.options.theme;
container.editor.setOption("theme",theme); //排个序
setTimeout(()=>container.editor.refresh(),0); list.remove(active).splice(0,0,active);
game.saveConfig('codeMirror_theme', theme); //元素位置
closeMenu.call(self); const pos=self.getBoundingClientRect();
}; //点击事件
const ul=createMenu(pos,self,list,click); const click=function(e){
this.createMenu=ul; 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(){ 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); return closeMenu.call(this);
} }
const self=this; const self=this;
const pos=this.getBoundingClientRect(); if(!this.createMenu){
const list=['撤销 Ctrl+Z', '恢复撤销 Ctrl+Y']; const pos=this.getBoundingClientRect();
const click=function(e){ const list=['撤销 Ctrl+Z', '恢复撤销 Ctrl+Y'];
const num=this.innerHTML.indexOf("Ctrl"); const click=function(e){
const inner=this.innerHTML.slice(num).replace("+", "-"); const num=this.innerHTML.indexOf("Ctrl");
container.editor.execCommand(container.editor.options.extraKeys[inner]); const inner=this.innerHTML.slice(num).replace("+", "-");
setTimeout(()=>container.editor.refresh(),0); container.editor.execCommand(container.editor.options.extraKeys[inner]);
closeMenu.call(self); setTimeout(()=>container.editor.refresh(),0);
}; closeMenu.call(self);
const ul=createMenu(pos,self,list,click); };
this.createMenu=ul; 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); const editor=ui.create.div(editorpage);
return editor; return editor;
@ -46822,7 +46881,7 @@
} }
var loading=ui.create.div('.loading.config.toggle','载入中...',page); var loading=ui.create.div('.loading.config.toggle','载入中...',page);
var loaded=function(list){ var loaded=function(){
var list=[]; var list=[];
var extension=window.extension; var extension=window.extension;
for(var i in extension){ for(var i in extension){
@ -46836,8 +46895,9 @@
var node=ui.create.div('.videonode.menubutton.extension.large',page,clickExtension); var node=ui.create.div('.videonode.menubutton.extension.large',page,clickExtension);
ui.create.div('.caption',list[i].name,node); ui.create.div('.caption',list[i].name,node);
ui.create.div('.text.author','作者:'+list[i].author+'<span>('+list[i].size+')</span>',node); ui.create.div('.text.author','作者:'+list[i].author+'<span>('+list[i].size+')</span>',node);
ui.create.div('.text','更新日期:'+list[i].date,node);
ui.create.div('.text',list[i].intro,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(game.download){
if(list[i].netdisk){ if(list[i].netdisk){
var linknode=ui.create.div('.text',node); var linknode=ui.create.div('.text',node);
@ -46858,7 +46918,7 @@
},linknode).link=list[i].forum; },linknode).link=list[i].forum;
} }
download.listen(downloadExtension); download.listen(downloadExtension);
if(lib.config.extensions.contains(list[i].name)){ if(lib.config.extensions.includes(list[i].name)){
download.classList.remove('active'); download.classList.remove('active');
if(lib.extensionPack[list[i].name]&&lib.extensionPack[list[i].name].version==list[i].version){ if(lib.extensionPack[list[i].name]&&lib.extensionPack[list[i].name].version==list[i].version){
download.classList.add('transparent2'); download.classList.add('transparent2');
@ -46896,10 +46956,10 @@
window.extension={}; window.extension={};
fetch(`${extensionURL}catalog.js`,{ fetch(`${extensionURL}catalog.js`,{
referrerPolicy:'no-referrer' referrerPolicy:'no-referrer'
}).then(value=>value.text()).then(eval).catch(reason=>{ }).then(value=>value.text()).then(eval).then(loaded).catch(reason=>{
console.log(reason); console.log(reason);
delete window.extension; delete window.extension;
loading.innerHTML='连接失败'; loading.innerHTML='连接失败:'+(reason instanceof Error?reason.message:String(reason));
}); });
}; };
if(_thisUpdate) node.update(); if(_thisUpdate) node.update();
@ -47828,7 +47888,7 @@
var nodeturnover=ui.create.div('.menubutton','翻面',row1,clickrow1); var nodeturnover=ui.create.div('.menubutton','翻面',row1,clickrow1);
var noderevive=ui.create.div('.menubutton','复活',row1,clickrow1); var noderevive=ui.create.div('.menubutton','复活',row1,clickrow1);
var nodereplace=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'); nodereplace.classList.add('unselectable');
} }
@ -54097,61 +54157,135 @@
else if(lib.config.favouriteCharacter.contains(name)){ else if(lib.config.favouriteCharacter.contains(name)){
fav.classList.add('active'); 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'); if(lib.config.show_characternamepinyin=='showPinyin2'||lib.config.show_skillnamepinyin=='showPinyin2'){
span.style.fontWeight='bold'; var intro=ui.create.div('.characterintro',get.characterIntro(name),uiintro);
const nameInfo=get.character(name),exInfo=nameInfo[4],characterName=exInfo&&exInfo.includes('ruby')?lib.translate[name]:get.rawName(name); if(lib.config.show_characternamepinyin=='showPinyin2'){
span.innerHTML=characterName; var charactername=get.rawName(name);
const ruby=document.createElement('ruby'); var characterpinyin=get.pinyin(charactername);
ruby.appendChild(span); var nameinfo=get.character(name);
const leftParenthesisRP=document.createElement('rp'); var charactersex=get.translation(nameinfo[0]);
leftParenthesisRP.textContent=''; const charactergroups=get.is.double(name,true);
ruby.appendChild(leftParenthesisRP); let charactergroup;
const rt=document.createElement('rt'); if(charactergroups) charactergroup=charactergroups.map(i=>get.translation(i)).join('/')
rt.innerHTML=showCharacterNamePinyin=='showCodeIdentifier'?name:lib.translate[`${name}_rt`]||get.pinyin(characterName).join(' '); else charactergroup=get.translation(nameinfo[1]);
ruby.appendChild(rt); var characterhp=nameinfo[2];
const rightParenthesisRP=document.createElement('rp'); var characterintroinfo=get.characterIntro(name);
rightParenthesisRP.textContent=''; var spacemark=' | ';
ruby.appendChild(rightParenthesisRP); if(charactername.length>3) spacemark='<span style="font-size:7px">'+' '+'</span>'+'|'+'<span style="font-size:7px">'+' '+'</span>';
characterIntroTable.appendChild(ruby); intro.innerHTML='<span style="font-weight:bold;margin-right:5px">'+charactername+'</span>'+'<span style="font-size:14px;font-family:SimHei,STHeiti,sans-serif">'+'['+characterpinyin+']'+'</span>'+spacemark+charactersex+spacemark+charactergroup+spacemark+characterhp+'<span style="line-height:2"></span>'+'<br>'+characterintroinfo;
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)=>{ var intro2=ui.create.div('.characterintro.intro2',uiintro);
const imageName=`sex_${characterSex}`,information=lib.card[imageName]; var list=get.character(name,3)||[];
if(!information) resolve(`${lib.assetURL}image/card/${imageName}.png`); var skills=ui.create.div('.characterskill',uiintro);
const image=information.image; if(lib.config.touchscreen){
if(!image) resolve(`${lib.assetURL}image/card/${imageName}.png`); lib.setScroll(intro);
else if(image.indexOf('db:')==0) game.getDB('image',image.slice(3)).then(resolve,reject); lib.setScroll(intro2);
else if(image.indexOf('ext:')==0) resolve(`${lib.assetURL}${image.replace(/^ext:/,'extension/')}`); lib.setScroll(skills);
else resolve(`${lib.assetURL}${image}`); }
}).then(source=>new Promise((resolve,reject)=>{
const image=new Image(); if(lib.config.mousewheel){
image.onload=()=>resolve(image); skills.onmousewheel=ui.click.mousewheel;
image.onerror=reject; }
image.src=source; var clickSkill=function(e){
})).then(image=>characterSexDiv.appendChild(image)).catch(()=>characterSexDiv.innerHTML=get.translation(characterSex)); while(intro2.firstChild){
const characterGroupDiv=ui.create.div('.character-group',characterIntroTable),characterGroups=get.is.double(name,true); intro2.removeChild(intro2.lastChild);
if(characterGroups) Promise.all(characterGroups.map(characterGroup=>new Promise((resolve,reject)=>{ }
const imageName=`group_${characterGroup}`,information=lib.card[imageName]; var current=this.parentNode.querySelector('.active');
if(!information) resolve(`${lib.assetURL}image/card/${imageName}.png`); if(current){
const image=information.image; current.classList.remove('active');
if(!image) resolve(`${lib.assetURL}image/card/${imageName}.png`); }
else if(image.indexOf('db:')==0) game.getDB('image',image.slice(3)).then(resolve,reject); this.classList.add('active');
else if(image.indexOf('ext:')==0) resolve(`${lib.assetURL}${image.replace(/^ext:/,'extension/')}`); var skillname=get.translation(this.link);
else resolve(`${lib.assetURL}${image}`); var skilltranslationinfo=get.skillInfoTranslation(this.link);
}).then(source=>new Promise((resolve,reject)=>{ if(lib.config.show_skillnamepinyin=='showPinyin2'&&skillname!='阵亡'){
const image=new Image(); var skillpinyin=get.pinyin(skillname);
image.onload=()=>resolve(image); intro2.innerHTML='<span style="font-weight:bold;margin-right:5px">'+skillname+'</span>'+'<span style="font-size:14px;font-family:SimHei,STHeiti,sans-serif">'+'['+skillpinyin+']'+'</span>'+' '+skilltranslationinfo;
image.onerror=reject; }else{
image.src=source; intro2.innerHTML='<span style="font-weight:bold;margin-right:5px">'+skillname+'</span>'+skilltranslationinfo;
})))).then(images=>{ }
let documentFragment=document.createDocumentFragment(); var info=get.info(this.link);
images.forEach(documentFragment.appendChild,documentFragment); var skill=this.link;
characterGroupDiv.appendChild(documentFragment); var playername=this.linkname;
}).catch(()=>characterGroupDiv.innerHTML=characterGroups.map(characterGroup=>get.translation(characterGroup)).join('/')); var skillnode=this;
else{ if(info.derivation){
const characterGroup=nameInfo[1]; var derivation=info.derivation;
if(typeof derivation=='string'){
derivation=[derivation];
}
for(var i=0;i<derivation.length;i++){
var derivationname=get.translation(derivation[i]);
var derivationtranslationinfo=get.skillInfoTranslation(derivation[i]);
if(lib.config.show_skillnamepinyin=='showPinyin2'&&derivationname.length<=5&&derivation[i].indexOf('_faq')==-1){
var derivationpinyin=get.pinyin(derivationname);
intro2.innerHTML+='<br><br><span style="font-weight:bold;margin-right:5px">'+derivationname+'</span>'+'<span style="font-size:14px;font-family:SimHei,STHeiti,sans-serif">'+'['+derivationpinyin+']'+'</span>'+' '+derivationtranslationinfo;
}else{
intro2.innerHTML+='<br><br><span style="font-weight:bold;margin-right:5px">'+derivationname+'</span>'+derivationtranslationinfo;
}
}
}
if(info.alter){
intro2.innerHTML+='<br><br><div class="hrefnode skillversion"></div>';
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)=>{ 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]; const imageName=`group_${characterGroup}`,information=lib.card[imageName];
if(!information) resolve(`${lib.assetURL}image/card/${imageName}.png`); if(!information) resolve(`${lib.assetURL}image/card/${imageName}.png`);
const image=information.image; const image=information.image;
@ -54164,136 +54298,158 @@
image.onload=()=>resolve(image); image.onload=()=>resolve(image);
image.onerror=reject; image.onerror=reject;
image.src=source; image.src=source;
})).then(image=>characterGroupDiv.appendChild(image)).catch(()=>characterGroupDiv.innerHTML=get.translation(characterGroup)); })))).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 hpDiv=ui.create.div('.hp',characterIntroTable),nameInfoHP=nameInfo[2],infoHP=get.infoHp(nameInfoHP); const htmlParser=document.createElement('body');
hpDiv.dataset.condition=infoHP<4?'mid':'high'; htmlParser.innerHTML=get.characterIntro(name);
ui.create.div(hpDiv); Array.from(htmlParser.childNodes).forEach(value=>introduction.appendChild(value));
const hpTextDiv=ui.create.div('.text',hpDiv),infoMaxHP=get.infoMaxHp(nameInfoHP); const introduction2=ui.create.div('.characterintro.intro2',uiintro);
hpTextDiv.innerHTML=infoHP==infoMaxHP?`×${infoHP}`:`×${infoHP}/${infoMaxHP}`; var list=get.character(name,3)||[];
const infoShield=get.infoHujia(nameInfoHP); var skills=ui.create.div('.characterskill',uiintro);
if(infoShield){ if(lib.config.touchscreen){
ui.create.div('.shield',hpDiv); lib.setScroll(introduction);
const shieldTextDiv=ui.create.div('.text',hpDiv); lib.setScroll(introduction2);
shieldTextDiv.innerHTML=`×${infoShield}`; lib.setScroll(skills);
} }
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){ if(lib.config.mousewheel){
skills.onmousewheel=ui.click.mousewheel; skills.onmousewheel=ui.click.mousewheel;
}
var clickSkill=function(e){
while(introduction2.firstChild){
introduction2.removeChild(introduction2.lastChild);
} }
var current=this.parentNode.querySelector('.active'); var clickSkill=function(e){
if(current){ while(introduction2.firstChild){
current.classList.remove('active'); introduction2.removeChild(introduction2.lastChild);
} }
this.classList.add('active'); var current=this.parentNode.querySelector('.active');
const skillNameSpan=document.createElement('span'),skillNameSpanStyle=skillNameSpan.style; if(current){
skillNameSpanStyle.fontWeight='bold'; current.classList.remove('active');
const link=this.link,skillName=get.translation(link); }
skillNameSpan.innerHTML=skillName; this.classList.add('active');
const showSkillNamePinyin=lib.config.show_skillnamepinyin; const skillNameSpan=document.createElement('span'),skillNameSpanStyle=skillNameSpan.style;
if(showSkillNamePinyin!='doNotShow'&&skillName!='阵亡'){ skillNameSpanStyle.fontWeight='bold';
const ruby=document.createElement('ruby'); const link=this.link,skillName=get.translation(link);
ruby.appendChild(skillNameSpan); skillNameSpan.innerHTML=skillName;
const leftParenthesisRP=document.createElement('rp'); const showSkillNamePinyin=lib.config.show_skillnamepinyin;
leftParenthesisRP.textContent=''; if(showSkillNamePinyin!='doNotShow'&&skillName!='阵亡'){
ruby.appendChild(leftParenthesisRP); const ruby=document.createElement('ruby');
const rt=document.createElement('rt'); ruby.appendChild(skillNameSpan);
rt.innerHTML=showSkillNamePinyin=='showCodeIdentifier'?link:lib.translate[`${link}_rt`]||get.pinyin(skillName).join(' '); const leftParenthesisRP=document.createElement('rp');
ruby.appendChild(rt); leftParenthesisRP.textContent='';
const rightParenthesisRP=document.createElement('rp'); ruby.appendChild(leftParenthesisRP);
rightParenthesisRP.textContent=''; const rt=document.createElement('rt');
ruby.appendChild(rightParenthesisRP); rt.innerHTML=showSkillNamePinyin=='showCodeIdentifier'?link:lib.translate[`${link}_rt`]||get.pinyin(skillName).join(' ');
const div=ui.create.div(introduction2); ruby.appendChild(rt);
div.style.marginRight='5px'; const rightParenthesisRP=document.createElement('rp');
div.appendChild(ruby); rightParenthesisRP.textContent='';
} ruby.appendChild(rightParenthesisRP);
else{ const div=ui.create.div(introduction2);
skillNameSpanStyle.marginRight='5px'; div.style.marginRight='5px';
introduction2.appendChild(skillNameSpan); div.appendChild(ruby);
}
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(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='切换至新版';
} }
else{ else{
skillversionnode.innerHTML='切换至旧版'; skillNameSpanStyle.marginRight='5px';
introduction2.appendChild(skillNameSpan);
} }
skillversionnode.listen(function(){ 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(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)){ if(lib.config.vintageSkills.contains(skill)){
lib.config.vintageSkills.remove(skill); skillversionnode.innerHTML='切换至新版';
lib.translate[skill+'_info']=lib.translate[skill+'_info_alter'];
} }
else{ else{
lib.config.vintageSkills.push(skill); skillversionnode.innerHTML='切换至旧版';
lib.translate[skill+'_info']=lib.translate[skill+'_info_origin'];
} }
game.saveConfig('vintageSkills',lib.config.vintageSkills); skillversionnode.listen(function(){
clickSkill.call(skillnode,'init'); 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; var initskill=false;
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
if(!get.info(list[i])||get.info(list[i]).nopop) continue; if(!get.info(list[i])||get.info(list[i]).nopop) continue;
@ -58198,9 +58354,9 @@
} }
let capt=get.translation(node.name); let capt=get.translation(node.name);
const characterInfo=get.character(node.name),sex=node.sex||characterInfo[0]; const characterInfo=get.character(node.name),sex=node.sex||characterInfo[0];
if(sex) capt+=`&nbsp;&nbsp;${sex=='none'?'无':get.translation(sex)}`; if(sex&&lib.config.show_sex) capt+=`&nbsp;&nbsp;${sex=='none'?'无':get.translation(sex)}`;
const group=lib.group.includes(node.group)?node.group:characterInfo[1]; const group=lib.group.includes(node.group)?node.group:characterInfo[1];
if(group) capt+=`&nbsp;&nbsp;${get.translation(group)}`; if(group&&lib.config.show_group) capt+=`&nbsp;&nbsp;${get.translation(group)}`;
uiintro.add(capt); uiintro.add(capt);
if(lib.characterTitle[node.name]){ if(lib.characterTitle[node.name]){
@ -58909,9 +59065,9 @@
let capt=get.translation(character); let capt=get.translation(character);
if(characterInfo){ if(characterInfo){
const infoSex=characterInfo[0]; const infoSex=characterInfo[0];
if(infoSex) capt+=`&nbsp;&nbsp;${infoSex=='none'?'无':lib.translate[infoSex]}`; if(infoSex&&lib.config.show_sex) capt+=`&nbsp;&nbsp;${infoSex=='none'?'无':lib.translate[infoSex]}`;
const infoGroup=characterInfo[1]; const infoGroup=characterInfo[1];
if(infoGroup){ if(infoGroup&&lib.config.show_group){
const group=get.is.double(character,true); const group=get.is.double(character,true);
if(group) capt+=`&nbsp;&nbsp;${group.map(value=>get.translation(value)).join('/')}`; if(group) capt+=`&nbsp;&nbsp;${group.map(value=>get.translation(value)).join('/')}`;
else capt+=`&nbsp;&nbsp;${lib.translate[infoGroup]}`; else capt+=`&nbsp;&nbsp;${lib.translate[infoGroup]}`;

View File

@ -1,6 +1,6 @@
window.noname_update={ window.noname_update={
version:'1.10.2', version:'1.10.2.1',
update:'1.10.1.0.1', update:'1.10.2',
changeLog:[ changeLog:[
'整合@rintim @mengxinzxz @lieren2023 @PZ157 @Tipx-L @kuangshen04 @nonameShijian @copcap的Pull Request', '整合@rintim @mengxinzxz @lieren2023 @PZ157 @Tipx-L @kuangshen04 @nonameShijian @copcap的Pull Request',
'新武将界钟繇、武陆逊、界文聘、许靖、孟优、陈式、费曜、孙礼、夏侯楙、OL陆郁生、☆周不疑、', '新武将界钟繇、武陆逊、界文聘、许靖、孟优、陈式、费曜、孙礼、夏侯楙、OL陆郁生、☆周不疑、',
@ -11,63 +11,18 @@ window.noname_update={
'其他技能修改与bug修复', '其他技能修改与bug修复',
], ],
files:[ files:[
'card/extra.js',
'card/guozhan.js',
'card/standard.js',
'card/swd.js',
'card/yingbian.js', 'card/yingbian.js',
'card/yongjian.js',
'character/clan.js',
'character/collab.js',
'character/ddd.js',
'character/diy.js',
'character/extra.js', 'character/extra.js',
'character/huicui.js', 'character/huicui.js',
'character/jsrg.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/shenhua.js',
'character/shiji.js', 'character/shiji.js',
'character/sp.js',
'character/sp2.js',
'character/standard.js',
'character/swd.js',
'character/tw.js',
'character/xianding.js', 'character/xianding.js',
'character/xianjian.js',
'character/xinghuoliaoyuan.js',
'character/yijiang.js', 'character/yijiang.js',
'character/yingbian.js',
'character/zhuogui.js',
'game/codemirror.js',
'game/config.js',
'game/game.js', 'game/game.js',
'game/source.js', 'mode/doudizhu.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/guozhan.js', 'mode/guozhan.js',
'mode/versus.js', 'mode/identity.js',
'mode/single.js',
] ]
}; };

View File

@ -154,6 +154,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.zhu.showGiveup(); game.zhu.showGiveup();
}, },
game:{ game:{
canReplaceViewpoint:()=>true,
recommendDizhu:[ recommendDizhu:[
're_guojia','re_huanggai','re_lvbu','re_guanyu','re_sunquan','re_xusheng','re_wuyi','re_sunben', 're_guojia','re_huanggai','re_lvbu','re_guanyu','re_sunquan','re_xusheng','re_wuyi','re_sunben',
'xuyou','zhangchunhua','caochong','zhangsong','zhongyao','wangyi', 'xuyou','zhangchunhua','caochong','zhangsong','zhongyao','wangyi',

View File

@ -13259,6 +13259,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
}, },
game:{ game:{
canReplaceViewpoint:()=>true,
showYexings:function(){ showYexings:function(){
if(_status.showYexings) return; if(_status.showYexings) return;
_status.showYexings=true; _status.showYexings=true;

View File

@ -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.phaseLoop(_status.firstAct2||game.zhong||game.zhu||_status.firstAct||game.me);
}, },
game:{ game:{
canReplaceViewpoint:()=>true,
getState:function(){ getState:function(){
var state={}; var state={};
for(var i in lib.playerOL){ for(var i in lib.playerOL){

View File

@ -250,6 +250,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.phaseLoop(game.zhu); game.phaseLoop(game.zhu);
}, },
game:{ game:{
canReplaceViewpoint:()=>true,
addRecord:function(bool){ addRecord:function(bool){
if(typeof bool=='boolean'){ if(typeof bool=='boolean'){
var mode=_status.mode; var mode=_status.mode;