This commit is contained in:
libccy 2015-12-07 19:15:35 +08:00
parent 13a3de54c8
commit b67e325674
20 changed files with 437 additions and 136 deletions

View File

@ -22,6 +22,13 @@ card.refresh={
usable:1, usable:1,
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
var player=_status.event.player;
var nh=player.num('h');
if(nh<=player.hp){
if(nh<3) return 0;
if(nh==3) return 5-ai.get.value(card);
return 7-ai.get.value(card);
}
return 10-ai.get.useful(card); return 10-ai.get.useful(card);
}, },
discard:false, discard:false,

View File

@ -757,7 +757,7 @@ card.standard={
basic:{ basic:{
order:5, order:5,
useful:1, useful:1,
value:4 value:4.5
}, },
result:{ result:{
target:-1.5, target:-1.5,
@ -1303,8 +1303,9 @@ card.standard={
event.state=true; event.state=true;
event.card=trigger.card; event.card=trigger.card;
"step 1" "step 1"
if((ui.wuxie.classList.contains('glow')||(ui.tempnowuxie&& if((ui.wuxie.classList.contains('glow')||
ui.tempnowuxie.classList.contains('glow')))&&!_status.auto){ (ui.tempnowuxie&&ui.tempnowuxie.classList.contains('glow')&&
event.state))&&!_status.auto){
if(event.current==game.me||event.current.isUnderControl()){ if(event.current==game.me||event.current.isUnderControl()){
event._result={bool:false}; event._result={bool:false};
return; return;
@ -1378,7 +1379,7 @@ card.standard={
}); });
if(nevt.isMine()&&!trigger.multitarget){ if(nevt.isMine()&&!trigger.multitarget){
if(trigger.targets.length>1&&!ui.tempnowuxie){ if(trigger.targets.length>1&&!ui.tempnowuxie){
ui.tempnowuxie=ui.create.control('本轮不无懈',ui.click.tempnowuxie); ui.tempnowuxie=ui.create.control('不无懈'+get.translation(trigger.card.name),ui.click.tempnowuxie);
ui.tempnowuxie._origin=trigger.parent; ui.tempnowuxie._origin=trigger.parent;
} }
} }

View File

@ -228,7 +228,7 @@ character.mountain={
event.finish(); event.finish();
} }
else{ else{
var next=player.chooseToDiscard('是否发动巧变过判定阶段?'); var next=player.chooseToDiscard('是否发动巧变过判定阶段?');
next.ai=ai.get.unuseful2; next.ai=ai.get.unuseful2;
next.logSkill='qiaobian'; next.logSkill='qiaobian';
} }
@ -276,7 +276,7 @@ character.mountain={
}, },
selectTarget:[0,2], selectTarget:[0,2],
filterCard:true, filterCard:true,
prompt:'是否发动巧变过摸牌阶段?' prompt:'是否发动巧变过摸牌阶段?'
}); });
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -378,7 +378,7 @@ character.mountain={
}, },
selectTarget:2, selectTarget:2,
filterCard:true, filterCard:true,
prompt:'是否发动巧变过出牌阶段?', prompt:'是否发动巧变过出牌阶段?',
targetprompt:['被移走','移动目标'] targetprompt:['被移走','移动目标']
}); });
"step 1" "step 1"
@ -438,7 +438,7 @@ character.mountain={
content:function(){ content:function(){
"step 0" "step 0"
var discard=player.num('h')>player.hp; var discard=player.num('h')>player.hp;
var next=player.chooseToDiscard('是否发动巧变过弃牌阶段?'); var next=player.chooseToDiscard('是否发动巧变过弃牌阶段?');
next.logSkill='qiaobian'; next.logSkill='qiaobian';
next.ai=function(card){ next.ai=function(card){
if(discard){ if(discard){

View File

@ -3326,7 +3326,7 @@ character.sp={
simalang:'司马朗', simalang:'司马朗',
zhangliang:'张梁', zhangliang:'张梁',
tianfeng:'田丰', tianfeng:'田丰',
sp_pangtong:'庞统', sp_pangtong:'sp庞统',
maliang:'马良', maliang:'马良',
sp_caoren:'sp曹仁', sp_caoren:'sp曹仁',
yuejin:'乐进', yuejin:'乐进',

View File

@ -5333,7 +5333,7 @@ character.yijiang={
fuhuanghou:'伏皇后', fuhuanghou:'伏皇后',
caifuren:'蔡夫人', caifuren:'蔡夫人',
zhonghui:'钟会', zhonghui:'钟会',
old_zhonghui:'钟', old_zhonghui:'钟士季',
sunluban:'孙鲁班', sunluban:'孙鲁班',
chenqun:'陈群', chenqun:'陈群',
zhangsong:'张松', zhangsong:'张松',

View File

@ -59,6 +59,7 @@
if(window.inSplash) return; if(window.inSplash) return;
if(confirm('游戏似乎未正常载入,是否重置游戏?')){ if(confirm('游戏似乎未正常载入,是否重置游戏?')){
localStorage.clear(); localStorage.clear();
if(indexedDB) indexedDB.deleteDatabase('noname_0.9_data');
window.location.reload(); window.location.reload();
} }
},5000); },5000);

View File

@ -24,7 +24,9 @@
'boss配音', 'boss配音',
'隐藏模式、武将、卡牌包', '隐藏模式、武将、卡牌包',
'开始界面', '开始界面',
'自定义武将' '中间显示历史记录',
'左滑/右滑手势',
'自定义武将',
], ],
configprefix:'noname_0.9_', configprefix:'noname_0.9_',
updates:[], updates:[],
@ -180,7 +182,8 @@
system:'显示按钮', system:'显示按钮',
menu:'打开菜单', menu:'打开菜单',
pause:'切换暂停', pause:'切换暂停',
auto:'切换托管' auto:'切换托管',
off:'关闭',
} }
}, },
swipe_up:{ swipe_up:{
@ -191,7 +194,32 @@
system:'显示按钮', system:'显示按钮',
menu:'打开菜单', menu:'打开菜单',
pause:'切换暂停', pause:'切换暂停',
auto:'切换托管' auto:'切换托管',
off:'关闭',
}
},
swipe_left:{
name:'左划操作',
init:'off',
unfrequent:true,
item:{
system:'显示按钮',
menu:'打开菜单',
pause:'切换暂停',
auto:'切换托管',
off:'关闭',
}
},
swipe_right:{
name:'右划操作',
init:'off',
unfrequent:true,
item:{
system:'显示按钮',
menu:'打开菜单',
pause:'切换暂停',
auto:'切换托管',
off:'关闭',
} }
}, },
show_splash:{ show_splash:{
@ -291,10 +319,14 @@
if(config.swipe){ if(config.swipe){
map.swipe_up.show(); map.swipe_up.show();
map.swipe_down.show(); map.swipe_down.show();
map.swipe_left.show();
map.swipe_right.show();
} }
else{ else{
map.swipe_up.hide(); map.swipe_up.hide();
map.swipe_down.hide(); map.swipe_down.hide();
map.swipe_left.hide();
map.swipe_right.hide();
} }
} }
else{ else{
@ -313,6 +345,8 @@
map.swipe.hide(); map.swipe.hide();
map.swipe_up.hide(); map.swipe_up.hide();
map.swipe_down.hide(); map.swipe_down.hide();
map.swipe_left.hide();
map.swipe_right.hide();
} }
if(lib.config.enable_drag){ if(lib.config.enable_drag){
if(lib.config.touchscreen){ if(lib.config.touchscreen){
@ -554,6 +588,28 @@
}, },
unfrequent:true, unfrequent:true,
}, },
show_log:{
name:'显示历史记录',
init:'off',
unfrequent:true,
item:{
off:'关闭',
left:'靠左',
center:'居中',
right:'靠右',
},
onclick:function(bool){
game.saveConfig('show_log',bool);
if(lib.config.show_log!='off'){
ui.arenalog.style.display='';
ui.arenalog.dataset.position=bool;
}
else{
ui.arenalog.style.display='none';
ui.arenalog.innerHTML='';
}
}
},
glow_phase:{ glow_phase:{
name:'当前回合角色高亮', name:'当前回合角色高亮',
unfrequent:true, unfrequent:true,
@ -606,12 +662,6 @@
init:false, init:false,
unfrequent:true, unfrequent:true,
}, },
// only_fullskin:{
// name:'隐藏无全身皮肤武将',
// init:true,
// unfrequent:true,
// restart:true,
// },
hide_card_image:{ hide_card_image:{
name:'隐藏卡牌背景', name:'隐藏卡牌背景',
init:false, init:false,
@ -2506,11 +2556,12 @@
game.getDB('character',null,function(list){ game.getDB('character',null,function(list){
for(var i in list){ for(var i in list){
if(!list[i][4]) list[i][4]=[]; if(!list[i][4]) list[i][4]=[];
for(var j=0;j<list[i][3].length;j++){ // for(var j=0;j<list[i][3].length;j++){
if(!lib.skill[list[i][3][j]]){ // if(!lib.skill[list[i][3][j]]){
list[i][3].splice(j--,1); // alert(list[i][3][j]);
} // list[i][3].splice(j--,1);
} // }
// }
lib.character[i]=list[i]; lib.character[i]=list[i];
lib.customCharacters.push(i); lib.customCharacters.push(i);
lib.setTranslate(i); lib.setTranslate(i);
@ -2557,6 +2608,23 @@
} }
} }
}); });
var scripts=document.head.querySelectorAll('script');
for(var i=0;i<scripts.length;i++){
if(scripts[i].src&&scripts[i].src.indexOf('game/game.js')!=-1){
if(scripts[i].src.indexOf('ipad')!=-1){
window.isIpad=true;
}
else if(scripts[i].src.indexOf('iphone')!=-1){
var metas=document.head.querySelectorAll('meta');
for(var i=0;i<metas.length;i++){
if(metas[i].name=='viewport'){
metas[i].content="user-scalable=no, initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, width=device-width, height=device-height";
}
}
}
}
}
}, },
css:function(path,file,before){ css:function(path,file,before){
var style = document.createElement("link"); var style = document.createElement("link");
@ -2850,6 +2918,10 @@
if(result.bool){ if(result.bool){
event.goto(0); event.goto(0);
} }
if(ui.tempnowuxie){
ui.tempnowuxie.close();
delete ui.tempnowuxie;
}
}, },
phaseDiscard:function(){ phaseDiscard:function(){
"step 0" "step 0"
@ -6801,7 +6873,17 @@
var node1=player.$throwxy2(card1, var node1=player.$throwxy2(card1,
'calc(50% - 114px)','calc(50% - 52px)','perspective(600px) rotateY(180deg)',true 'calc(50% - 114px)','calc(50% - 52px)','perspective(600px) rotateY(180deg)',true
); );
if(lib.config.cardback_style!='default'){
node1.style.transitionProperty='none';
ui.refresh(node1);
node1.classList.add('infohidden'); node1.classList.add('infohidden');
ui.refresh(node1);
node1.style.transitionProperty='';
}
else{
node1.classList.add('infohidden');
}
node1.style.transform='perspective(600px) rotateY(180deg) translateX(0)'; node1.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
var onEnd01=function(){ var onEnd01=function(){
node1.removeEventListener('webkitTransitionEnd',onEnd01); node1.removeEventListener('webkitTransitionEnd',onEnd01);
@ -6827,7 +6909,16 @@
var node2=target.$throwxy2(card2, var node2=target.$throwxy2(card2,
'calc(50% + 10px)','calc(50% - 52px)','perspective(600px) rotateY(180deg)',true 'calc(50% + 10px)','calc(50% - 52px)','perspective(600px) rotateY(180deg)',true
); );
if(lib.config.cardback_style!='default'){
node2.style.transitionProperty='none';
ui.refresh(node2);
node2.classList.add('infohidden'); node2.classList.add('infohidden');
ui.refresh(node2);
node2.style.transitionProperty='';
}
else{
node2.classList.add('infohidden');
}
node2.style.transform='perspective(600px) rotateY(180deg) translateX(0)'; node2.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
var onEnd02=function(){ var onEnd02=function(){
node2.removeEventListener('webkitTransitionEnd',onEnd02); node2.removeEventListener('webkitTransitionEnd',onEnd02);
@ -8658,6 +8749,19 @@
content:function(){ content:function(){
trigger.player.classList.remove('linked'); trigger.player.classList.remove('linked');
} }
},
_lianhuan4:{
trigger:{global:'dieAfter'},
priority:-10,
forced:true,
popup:false,
filter:function(event,player){
return event.player.classList.contains('dead')&&event.parent.parent.name!='damage';
},
content:function(){
window.x=event;
trigger.player.classList.remove('linked');
}
} }
}, },
character:{}, character:{},
@ -8812,7 +8916,7 @@
downloadLink.click(); downloadLink.click();
}, },
exportCharacters:function(packname,list){ exportCharacters:function(packname,list,callback){
var zipReady=function(){ var zipReady=function(){
var zip=new JSZip(); var zip=new JSZip();
var imageLoaded=0; var imageLoaded=0;
@ -8831,6 +8935,10 @@
downloadLink.href = window.URL.createObjectURL(blob); downloadLink.href = window.URL.createObjectURL(blob);
downloadLink.click(); downloadLink.click();
if(typeof callback=='function'){
callback(character);
}
}; };
for(var i=0;i<lib.customCharacters.length;i++){ for(var i=0;i<lib.customCharacters.length;i++){
var name=lib.customCharacters[i]; var name=lib.customCharacters[i];
@ -11576,6 +11684,12 @@
ui.sidebar.insertBefore(node,ui.sidebar.firstChild); ui.sidebar.insertBefore(node,ui.sidebar.firstChild);
game.addVideo('log',null,str); game.addVideo('log',null,str);
if(lib.config.title) document.title=str; if(lib.config.title) document.title=str;
if(lib.config.show_log!='off'&&lib.config.mode!='chess'){
ui.arenalog.insertBefore(node.cloneNode(true),ui.arenalog.firstChild);
while(ui.arenalog.childNodes.length&&ui.arenalog.scrollHeight>ui.arenalog.offsetHeight){
ui.arenalog.lastChild.remove();
}
}
}, },
putDB:function(type,id,item,callback){ putDB:function(type,id,item,callback){
if(!lib.db) return item; if(!lib.db) return item;
@ -12524,6 +12638,10 @@
arena:function(){ arena:function(){
var i,j; var i,j;
ui.window=ui.create.div('#window.hidden',document.body); ui.window=ui.create.div('#window.hidden',document.body);
if(window.isIpad){
ui.window.classList.add('ipad');
delete window.isIpad;
}
ui.refresh(ui.window); ui.refresh(ui.window);
setTimeout(function(){ setTimeout(function(){
ui.window.show(); ui.window.show();
@ -12560,6 +12678,11 @@
ui.backgroundMusic.addEventListener('ended',game.playBackgroundMusic); ui.backgroundMusic.addEventListener('ended',game.playBackgroundMusic);
ui.window.appendChild(ui.backgroundMusic); ui.window.appendChild(ui.backgroundMusic);
ui.arenalog=ui.create.div('#arenalog',ui.arena);
if(lib.config.show_log=='off'){
ui.arenalog.style.display='none';
}
ui.roundmenu=ui.create.div('#roundmenu.roundarenabutton.menubutton.round',ui.arena); ui.roundmenu=ui.create.div('#roundmenu.roundarenabutton.menubutton.round',ui.arena);
ui.roundmenu._position=[180,210]; ui.roundmenu._position=[180,210];
ui.create.div(ui.roundmenu); ui.create.div(ui.roundmenu);
@ -13332,23 +13455,24 @@
} }
} }
else{ else{
cfgnode.classList.add('auto-hide'); // cfgnode.classList.add('auto-hide');
hiddenNodes.push(cfgnode); hiddenNodes.push(cfgnode);
} }
} }
var expanded=false; var expanded=false;
if(hiddenNodes.length){ if(hiddenNodes.length){
ui.create.div('.config.more','更多 <div>&gt;</div>',page,function(){ // ui.create.div('.config.more','更多 <div>&gt;</div>',page,function(){
if(expanded){ // if(expanded){
this.classList.remove('on'); // this.classList.remove('on');
this.parentNode.classList.remove('expanded'); // this.parentNode.classList.remove('expanded');
} // }
else{ // else{
this.classList.add('on'); // this.classList.add('on');
this.parentNode.classList.add('expanded'); // this.parentNode.classList.add('expanded');
} // }
expanded=!expanded; // expanded=!expanded;
}); // });
page.classList.add('morenodes');
for(var k=0;k<hiddenNodes.length;k++){ for(var k=0;k<hiddenNodes.length;k++){
page.appendChild(hiddenNodes[k]); page.appendChild(hiddenNodes[k]);
} }
@ -13475,6 +13599,27 @@
} }
page.classList.add('menu-buttons'); page.classList.add('menu-buttons');
if(lib.config.customCharacterPack[mode]){ if(lib.config.customCharacterPack[mode]){
ui.create.div('.config.more','编辑武将包',page,function(){
if(this.innerHTML=='编辑武将包'){
this.innerHTML='确认编辑';
var that=this;
setTimeout(function(){
that.innerHTML='编辑武将包';
},1000);
}
else{
var pack=lib.config.customCharacterPack[mode];
delete lib.config.customCharacterPack[mode];
game.saveConfig('customCharacterPack',lib.config.customCharacterPack);
page.remove();
node.remove();
lib.recreateCustomCharacters();
var active=ui.customCharacter;
active.classList.add('active');
rightPane.appendChild(active.link);
}
});
ui.create.div('.config.more','删除武将包',page,function(){ ui.create.div('.config.more','删除武将包',page,function(){
if(this.innerHTML=='删除武将包'){ if(this.innerHTML=='删除武将包'){
this.innerHTML='确认删除'; this.innerHTML='确认删除';
@ -13490,15 +13635,18 @@
page.remove(); page.remove();
node.remove(); node.remove();
for(var i=0;i<pack.character.length;i++){ for(var i=0;i<pack.character.length;i++){
lib.customCharacters.remove(pack.character[i]);
delete lib.character[pack.character[i]];
game.deleteDB('character',pack.character[i]); game.deleteDB('character',pack.character[i]);
game.deleteDB('image','character:'+pack.character[i]); game.deleteDB('image','character:'+pack.character[i]);
lib.config.banned.remove(pack.character[i])
} }
game.saveConfig('banned',lib.config.banned);
for(var i=0;i<pack.skill.length;i++){ for(var i=0;i<pack.skill.length;i++){
game.deleteDB('skill',pack.skill[i]); game.deleteDB('skill',pack.skill[i]);
} }
} }
game.saveConfig('hiddenCharacterPack',lib.config.hiddenCharacterPack); }).style.marginTop='5px';
});
} }
else if(mode.indexOf('mode_')!=0){ else if(mode.indexOf('mode_')!=0){
ui.create.div('.config.more','隐藏武将包',page,function(){ ui.create.div('.config.more','隐藏武将包',page,function(){
@ -13534,6 +13682,7 @@
lib.onDB(function(){ lib.onDB(function(){
var page=ui.create.div('.menu-buttons'); var page=ui.create.div('.menu-buttons');
var node=ui.create.div('.menubutton.large','自定义',clickMode); var node=ui.create.div('.menubutton.large','自定义',clickMode);
ui.customCharacter=node;
start.firstChild.insertBefore(node,start.firstChild.querySelector('.lefttext')); start.firstChild.insertBefore(node,start.firstChild.querySelector('.lefttext'));
node.link=page; node.link=page;
node.mode='custom'; node.mode='custom';
@ -13565,13 +13714,20 @@
newCharacter.querySelector('.new_hp').value=info[2]; newCharacter.querySelector('.new_hp').value=info[2];
sexes.value=info[0]; sexes.value=info[0];
groups.value=info[1]; groups.value=info[1];
if(info[4]){
for(var i=0;i<options.childNodes.length-1;i++){
if(info[4].contains(options.childNodes[i].lastChild.name)){
options.childNodes[i].lastChild.checked=true;
}
}
}
var skills=info[3]; var skills=info[3];
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
var node=ui.create.div(skillList.firstChild); var node=ui.create.div(skillList.firstChild);
node.skill=skills[i]; node.skill=skills[i];
ui.create.div('',lib.translate[skills[i]],node,editnode); ui.create.div('',lib.translate[skills[i]],node,editnode);
ui.create.div('','×',node,delnode); ui.create.div('','×',node,deletenode);
if(lib.skill[skills[i]].createInfo){ if(lib.skill[skills[i]].createInfo){
node.createInfo=lib.skill[skills[i]].createInfo; node.createInfo=lib.skill[skills[i]].createInfo;
} }
@ -13608,7 +13764,7 @@
var createButton=function(name){ var createButton=function(name){
var button=ui.create.button(name,'character'); var button=ui.create.button(name,'character');
button.listen(clickButton); button.listen(clickButton);
page.classList.add('noclick'); button.classList.add('noclick');
page.insertBefore(button,page.firstChild); page.insertBefore(button,page.firstChild);
} }
@ -13623,8 +13779,14 @@
createModeConfig(i,start.firstChild,node); createModeConfig(i,start.firstChild,node);
} }
for(var i=0;i<lib.customCharacters.length;i++){ for(var i=0;i<lib.customCharacters.length;i++){
if(!lib.checkCharacterName(lib.customCharacters[i])) var clname=lib.customCharacters[i];
createButton(lib.customCharacters[i]); for(var j=0;j<lib.character[clname][3].length;j++){
if(!lib.skill[lib.character[clname][3][j]]){
lib.character[clname][3].splice(j--,1);
}
}
if(!lib.checkCharacterName(clname))
createButton(clname);
} }
} }
if(_status.characterLoaded){ if(_status.characterLoaded){
@ -13633,6 +13795,23 @@
else{ else{
lib.onCharacterLoad=cl; lib.onCharacterLoad=cl;
} }
lib.recreateCustomCharacters=function(){
var buttons=page.querySelectorAll('.button.character');
var list=[];
for(var i=0;i<buttons.length;i++){
list.push(buttons[i]);
}
for(var i=0;i<list.length;i++){
list[i].remove();
}
for(var i=0;i<lib.customCharacters.length;i++){
if(!lib.checkCharacterName(lib.customCharacters[i]))
createButton(lib.customCharacters[i]);
}
resetEditor();
resetImport();
resetExport();
}
var importCharacter; var importCharacter;
var toggle3=ui.create.div('.config.more','导入武将包 <div>&gt;</div>',page,function(){ var toggle3=ui.create.div('.config.more','导入武将包 <div>&gt;</div>',page,function(){
@ -13700,7 +13879,7 @@
var namej=lib.config.customCharacterPack[name].character[j]; var namej=lib.config.customCharacterPack[name].character[j];
lib.characterPack[name][namej]=lib.character[namej]; lib.characterPack[name][namej]=lib.character[namej];
} }
createModeConfig(name,start.firstChild,node); clickMode.call(createModeConfig(name,start.firstChild,node));
},500); },500);
delete game.importedPack; delete game.importedPack;
@ -13765,7 +13944,29 @@
for(var i=0;i<list2.length;i++){ for(var i=0;i<list2.length;i++){
list2[i].classList.remove('selected'); list2[i].classList.remove('selected');
} }
if(name) game.exportCharacters(name,list.length?list:null); if(name) game.exportCharacters(name,list.length?list:null,function(result){
game.import('character',result);
for(var i in result.character){
var buttons=page.querySelectorAll('.button.character');
for(var j=0;j<buttons.length;j++){
if(buttons[j].link==i){
buttons[j].remove();
break;
}
}
}
lib.characterPack[name]={};
lib.translate[name+'_character_config']=name;
for(var j=0;j<lib.config.customCharacterPack[name].character.length;j++){
var namej=lib.config.customCharacterPack[name].character[j];
lib.characterPack[name][namej]=lib.character[namej];
}
clickMode.call(createModeConfig(name,start.firstChild,node));
resetExport();
delete game.importedPack;
});
} }
var newCharacter; var newCharacter;
@ -13842,10 +14043,11 @@
['wu','吴'], ['wu','吴'],
['qun','群'], ['qun','群'],
],null,ui.create.div('.indent','势力:',newCharacter)); ],null,ui.create.div('.indent','势力:',newCharacter));
var options=ui.create.div('.add_skill.options','<span>主公<input type="checkbox" name="zhu"></span><span>BOSS<input type="checkbox" name="boss"></span><span>AI禁选<input type="checkbox" name="forbidai"></span><br>',newCharacter);
var addSkill=ui.create.div('.add_skill','添加技能<br>',newCharacter); var addSkill=ui.create.div('.add_skill','添加技能<br>',newCharacter);
var list=[]; var list=[];
for(var i in lib.character){ for(var i in lib.character){
if(lib.character[i][3].length); if(!lib.customCharacters.contains(i)&&lib.character[i][3].length);
list.push([i,lib.translate[i]]); list.push([i,lib.translate[i]]);
} }
list.sort(function(a,b){ list.sort(function(a,b){
@ -13881,7 +14083,7 @@
var addSkillButton=document.createElement('button'); var addSkillButton=document.createElement('button');
addSkillButton.innerHTML='添加'; addSkillButton.innerHTML='添加';
addSkill.appendChild(addSkillButton); addSkill.appendChild(addSkillButton);
var delnode=function(){ var deletenode=function(){
this.parentNode.remove(); this.parentNode.remove();
} }
var editnode=function(){ var editnode=function(){
@ -13889,7 +14091,7 @@
if(info){ if(info){
createSkill.lastChild.classList.remove('hidden'); createSkill.lastChild.classList.remove('hidden');
createSkill.firstChild.innerHTML='创建技能'; createSkill.firstChild.innerHTML='创建技能';
skillList.style.top='410px'; skillList.style.top='435px';
createSkill.lastChild.querySelector('.skillname').value=info.name; createSkill.lastChild.querySelector('.skillname').value=info.name;
createSkill.lastChild.querySelector('.skilldescription').value=info.description; createSkill.lastChild.querySelector('.skilldescription').value=info.description;
@ -13903,7 +14105,7 @@
var node=ui.create.div(skillList.firstChild); var node=ui.create.div(skillList.firstChild);
node.skill=skillopt.value; node.skill=skillopt.value;
ui.create.div('',lib.translate[skillopt.value],node,editnode); ui.create.div('',lib.translate[skillopt.value],node,editnode);
ui.create.div('','×',node,delnode); ui.create.div('','×',node,deletenode);
if(lib.skill[skillopt.value].createInfo){ if(lib.skill[skillopt.value].createInfo){
node.createInfo=lib.skill[skillopt.value].createInfo; node.createInfo=lib.skill[skillopt.value].createInfo;
} }
@ -13918,7 +14120,7 @@
} }
else{ else{
this.innerHTML='创建技能'; this.innerHTML='创建技能';
skillList.style.top='410px'; skillList.style.top='435px';
} }
}); });
var newSkill=document.createElement('textarea'); var newSkill=document.createElement('textarea');
@ -13926,9 +14128,10 @@
createSkill.lastChild.innerHTML+='<br>'; createSkill.lastChild.innerHTML+='<br>';
ui.create.div('','技能名称:<input class="skillname" type="text">',createSkill.lastChild); ui.create.div('','技能名称:<input class="skillname" type="text">',createSkill.lastChild);
createSkill.lastChild.innerHTML+='<br>'; createSkill.lastChild.innerHTML+='<br>';
ui.create.div('','技能描述:<input class="skilldescription" type="text"><br><button>确定</button>',createSkill.lastChild); ui.create.div('','技能描述:<input class="skilldescription" type="text"><br><button>确定</button><button>取消</button>',createSkill.lastChild);
createSkill.lastChild.lastChild.lastChild.style.marginTop='5px'; createSkill.lastChild.lastChild.lastChild.previousSibling.style.marginTop='5px';
createSkill.lastChild.lastChild.lastChild.onclick=function(){ createSkill.lastChild.lastChild.lastChild.previousSibling.style.marginRight='3px';
createSkill.lastChild.lastChild.lastChild.previousSibling.onclick=function(){
var node; var node;
var name=createSkill.lastChild.querySelector('.skillname').value; var name=createSkill.lastChild.querySelector('.skillname').value;
var description=createSkill.lastChild.querySelector('.skilldescription').value; var description=createSkill.lastChild.querySelector('.skilldescription').value;
@ -13951,14 +14154,30 @@
name2=name2.slice(name2.indexOf(':')+1); name2=name2.slice(name2.indexOf(':')+1);
} }
ui.create.div('',name2,node,editnode); ui.create.div('',name2,node,editnode);
ui.create.div('','×',node,delnode); ui.create.div('','×',node,deletenode);
} }
node.createInfo={ node.createInfo={
name:name, name:name,
description:description, description:description,
content:content content:content
} }
createSkill.lastChild.querySelector('.skillname').value='';
createSkill.lastChild.querySelector('.skilldescription').value='';
createSkill.lastChild.querySelector('textarea').value='';
createSkill.lastChild.classList.add('hidden');
createSkill.firstChild.innerHTML='创建技能...';
skillList.style.top='';
} }
createSkill.lastChild.lastChild.lastChild.onclick=function(){
createSkill.lastChild.querySelector('.skillname').value='';
createSkill.lastChild.querySelector('.skilldescription').value='';
createSkill.lastChild.querySelector('textarea').value='';
createSkill.lastChild.classList.add('hidden');
createSkill.firstChild.innerHTML='创建技能...';
skillList.style.top='';
};
var skillList=ui.create.div('.skill_list',newCharacter); var skillList=ui.create.div('.skill_list',newCharacter);
ui.create.div(skillList); ui.create.div(skillList);
ui.create.div('.menubutton.large','创建武将',ui.create.div(skillList),function(){ ui.create.div('.menubutton.large','创建武将',ui.create.div(skillList),function(){
@ -13975,7 +14194,8 @@
game.putDB('image','character:'+name,image); game.putDB('image','character:'+name,image);
} }
for(var i=0;i<skillList.firstChild.childNodes.length;i++){ for(var i=0;i<skillList.firstChild.childNodes.length;i++){
if(lib.checkSkillName(skillList.firstChild.childNodes[i].skill)) continue; if(skillList.firstChild.childNodes[i].createInfo&&
lib.checkSkillName(skillList.firstChild.childNodes[i].skill)) continue;
skills.add(skillList.firstChild.childNodes[i].skill); skills.add(skillList.firstChild.childNodes[i].skill);
var info=skillList.firstChild.childNodes[i].createInfo; var info=skillList.firstChild.childNodes[i].createInfo;
if(info){ if(info){
@ -13992,7 +14212,16 @@
game.putDB('skill',info.name,info); game.putDB('skill',info.name,info);
} }
} }
var charinfo=[sexes.value,groups.value,hp,skills,[]]; var tags=[];
for(var i=0;i<options.childNodes.length-1;i++){
if(options.childNodes[i].lastChild.checked){
tags.push(options.childNodes[i].lastChild.name);
}
}
if(tags.contains('boss')){
tags.add('bossallowed');
}
var charinfo=[sexes.value,groups.value,hp,skills,tags];
game.putDB('character',name,charinfo); game.putDB('character',name,charinfo);
lib.character[name]=charinfo; lib.character[name]=charinfo;
lib.customCharacters.add(name); lib.customCharacters.add(name);
@ -15241,9 +15470,9 @@
case 'system': case 'system':
if((_status.removinground&&lib.config.touchscreen)|| if((_status.removinground&&lib.config.touchscreen)||
ui.system2.classList.contains('shown')){ ui.system2.classList.contains('shown')){
// _status.removinground=false; _status.removinground=false;
// game.pause2(); game.pause2();
// ui.click.configMenu(); ui.click.configMenu();
ui.system1.classList.remove('shown'); ui.system1.classList.remove('shown');
ui.system2.classList.remove('shown'); ui.system2.classList.remove('shown');
} }
@ -15787,73 +16016,54 @@
if(get.currentTime()-_status._swipeorigin.time<500){ if(get.currentTime()-_status._swipeorigin.time<500){
var dx=_status._swipeorigin.touches.clientX-_status._swipeorigin.clientX; var dx=_status._swipeorigin.touches.clientX-_status._swipeorigin.clientX;
var dy=_status._swipeorigin.touches.clientY-_status._swipeorigin.clientY; var dy=_status._swipeorigin.touches.clientY-_status._swipeorigin.clientY;
var goswipe=function(action){
switch(action){
case 'system':
if(ui.system2.classList.contains('shown')||
lib.config.layout!='phone'){
game.pause2();
ui.click.configMenu();
ui.system1.classList.remove('shown');
ui.system2.classList.remove('shown');
}
else{
ui.system1.classList.add('shown');
ui.system2.classList.add('shown');
}
break;
case 'menu':
game.pause2();
ui.click.configMenu();
ui.system1.classList.remove('shown');
ui.system2.classList.remove('shown');
break;
case 'pause':
ui.click.pause();
break;
case 'auto':
ui.click.auto();
if(!ui.system1.classList.contains('shown')){
ui.system1.classList.add('shown');
}
break;
}
}
if(Math.abs(dx)<100){ if(Math.abs(dx)<100){
if(dy<-200){ if(dy<-200){
switch(lib.config.swipe_up){ goswipe(lib.config.swipe_up);
case 'system':
if(ui.system2.classList.contains('shown')||
lib.config.layout!='phone'){
game.pause2();
ui.click.configMenu();
ui.system1.classList.remove('shown');
ui.system2.classList.remove('shown');
}
else{
ui.system1.classList.add('shown');
ui.system2.classList.add('shown');
}
break;
case 'menu':
game.pause2();
ui.click.configMenu();
ui.system1.classList.remove('shown');
ui.system2.classList.remove('shown');
break;
case 'pause':
ui.click.pause();
break;
case 'auto':
ui.click.auto();
if(!ui.system1.classList.contains('shown')){
ui.system1.classList.add('shown');
}
break;
}
} }
else if(dy>200){ else if(dy>200){
switch(lib.config.swipe_down){ goswipe(lib.config.swipe_down);
case 'system':
if(ui.system2.classList.contains('shown')||
lib.config.layout!='phone'){
game.pause2();
ui.click.configMenu();
ui.system1.classList.remove('shown');
ui.system2.classList.remove('shown');
}
else{
ui.system1.classList.add('shown');
ui.system2.classList.add('shown');
}
break;
case 'menu':
game.pause2();
ui.click.configMenu();
ui.system1.classList.remove('shown');
ui.system2.classList.remove('shown');
break;
case 'pause':
ui.click.pause();
break;
case 'auto':
ui.click.auto();
if(!ui.system1.classList.contains('shown')){
ui.system1.classList.add('shown');
}
break;
} }
} }
else if(Math.abs(dy)<100){
if(dx<-200){
goswipe(lib.config.swipe_left);
}
else if(dx>200){
goswipe(lib.config.swipe_right);
}
} }
} }
} }
var tmpflag=false; var tmpflag=false;

View File

@ -12,7 +12,18 @@ body{
div{display: inline-block;position: absolute;transition: all 0.5s;} div{display: inline-block;position: absolute;transition: all 0.5s;}
table{table-layout: fixed;} table{table-layout: fixed;}
/*--------场景--------*/ /*--------场景--------*/
#window{width: 100%;height: 100%;top: 0;left: 0;transition-property:opacity;overflow:hidden} #window{
width: 100%;
height: 100%;
top: 0px;
left: 0;
transition-property:opacity;
overflow:hidden
}
#window.ipad{
width: calc(100% - 15px);
top: 15px;
}
#window>.tutorial_tap{ #window>.tutorial_tap{
width:30px; width:30px;
height:30px; height:30px;
@ -76,6 +87,40 @@ table{table-layout: fixed;}
#arena[data-global_font='huangcao'] #control{ #arena[data-global_font='huangcao'] #control{
font-family:'STHeiti','SimHei','Microsoft JhengHei','Microsoft YaHei','WenQuanYi Micro Hei',Helvetica,Arial,sans-serif font-family:'STHeiti','SimHei','Microsoft JhengHei','Microsoft YaHei','WenQuanYi Micro Hei',Helvetica,Arial,sans-serif
} }
#arena.chess>#arenalog{
display: none !important;
}
#arenalog{
width: calc(50% - 210px);
height: calc(100% - 370px);
left: calc(50% + 60px);
top:200px;
overflow: hidden;
}
#arena:not(.oldlayout)>#arenalog[data-position="center"]{
left: calc(25% + 105px);
}
#arena:not(.oldlayout)>#arenalog[data-position="left"]{
left: 150px;
}
#arena.oldlayout>#arenalog{
top:160px;
width: calc(50% - 300px);
height: calc(100% - 325px);
}
#arena.oldlayout>#arenalog[data-position="center"]{
left: calc(25% + 150px);
}
#arena.oldlayout>#arenalog[data-position="left"]{
left: 240px;
}
#arenalog>div{
position: relative;
display: block;
width: calc(100% - 20px);
left:20px;
}
/*#arena[data-font_size='14']{ /*#arena[data-font_size='14']{
font-size:14px; font-size:14px;
} }
@ -545,9 +590,13 @@ margin-bottom: 5px;
opacity: 0; opacity: 0;
transform:scale(0.7); transform:scale(0.7);
} }
.player[data-position='0']>.damage.dieidentity{ .player[data-position='0']>.damage.dieidentity,
.player:not(.dead)>.damage.dieidentity{
opacity: 0 !important opacity: 0 !important
} }
.player>.damage.dieidentity{
transition-property: opacity;
}
.player>.cardeffect{ .player>.cardeffect{
font-family: 'huangcao','xinwei'; font-family: 'huangcao','xinwei';
font-size:108px; font-size:108px;

View File

@ -224,6 +224,9 @@
.menu.main>.menu-content>div>.right.pane>.expanded{ .menu.main>.menu-content>div>.right.pane>.expanded{
padding-bottom:80px; padding-bottom:80px;
} }
.menu.main>.menu-content>div>.right.pane>.morenodes{
padding-bottom:10px;
}
.menu.main>.menu-content>div>.right.pane>div>.config{ .menu.main>.menu-content>div>.right.pane>div>.config{
left:2px; left:2px;
margin-top:10px; margin-top:10px;
@ -441,12 +444,18 @@
.menu-buttons>.new_character>.add_skill{ .menu-buttons>.new_character>.add_skill{
position: absolute; position: absolute;
left: 12px; left: 12px;
top:145px; top:170px;
text-align: left; text-align: left;
line-height: 20px; line-height: 20px;
} }
.menu-buttons>.new_character>.add_skill.options{
top:145px;
}
.menu-buttons>.new_character>.add_skill.options>span{
margin-right: 10px;
}
.menu-buttons>.new_character>.add_skill.create{ .menu-buttons>.new_character>.add_skill.create{
top: 195px; top: 220px;
} }
.menu-buttons>.new_character>.add_skill.create>div{ .menu-buttons>.new_character>.add_skill.create>div{
position: relative; position: relative;
@ -470,7 +479,7 @@
.menu-buttons>.new_character>.skill_list{ .menu-buttons>.new_character>.skill_list{
position: absolute; position: absolute;
left: 12px; left: 12px;
top: 215px; top: 240px;
text-align: left; text-align: left;
height: auto; height: auto;
width: calc(100% - 20px); width: calc(100% - 20px);

View File

@ -110,7 +110,7 @@ mode.boss={
var list=[]; var list=[];
for(var i in lib.character){ for(var i in lib.character){
var info=lib.character[i]; var info=lib.character[i];
if(info[4].contains('boss')){ if(info[4].contains('boss')&&!lib.config.banned.contains(i)){
var cfg=i+'_bossconfig'; var cfg=i+'_bossconfig';
if(get.config(cfg)==undefined){ if(get.config(cfg)==undefined){
game.saveConfig(cfg,true,true); game.saveConfig(cfg,true,true);
@ -347,7 +347,7 @@ mode.boss={
} }
player.update(); player.update();
if(player.storage.boss_chongzheng>=game.bossinfo.chongzheng){ if(player.storage.boss_chongzheng>=game.bossinfo.chongzheng){
player.revive(); player.revive(player.hp);
} }
} }
@ -422,6 +422,7 @@ mode.boss={
if(lib.character[i][4].contains('minskin')) continue; if(lib.character[i][4].contains('minskin')) continue;
if(lib.character[i][4].contains('boss')) continue; if(lib.character[i][4].contains('boss')) continue;
if(lib.character[i][4].contains('hiddenboss')) continue; if(lib.character[i][4].contains('hiddenboss')) continue;
if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue;
if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidall.contains(i)) continue; if(lib.config.forbidall.contains(i)) continue;
if(lib.config.forbidboss.contains(i)) continue; if(lib.config.forbidboss.contains(i)) continue;

View File

@ -1931,6 +1931,7 @@ mode.chess={
for(i in lib.character){ for(i in lib.character){
if(i.indexOf('treasure_')==0) continue; if(i.indexOf('treasure_')==0) continue;
if(i.indexOf('chess_mech_')==0) continue; if(i.indexOf('chess_mech_')==0) continue;
if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue;
if(lib.character[i][4].contains('minskin')) continue; if(lib.character[i][4].contains('minskin')) continue;
if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidall.contains(i)) continue; if(lib.config.forbidall.contains(i)) continue;
@ -3477,6 +3478,7 @@ mode.chess={
for(i in lib.character){ for(i in lib.character){
if(i.indexOf('treasure_')==0) continue; if(i.indexOf('treasure_')==0) continue;
if(i.indexOf('chess_mech_')==0) continue; if(i.indexOf('chess_mech_')==0) continue;
if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue;
if(lib.character[i][4].contains('minskin')) continue; if(lib.character[i][4].contains('minskin')) continue;
if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidall.contains(i)) continue; if(lib.config.forbidall.contains(i)) continue;

View File

@ -247,6 +247,7 @@ mode.guozhan={
var i; var i;
event.list=[]; event.list=[];
for(i in lib.character){ for(i in lib.character){
if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue;
if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidall.contains(i)) continue; if(lib.config.forbidall.contains(i)) continue;
if(lib.config.forbiddouble.contains(i)) continue; if(lib.config.forbiddouble.contains(i)) continue;

View File

@ -608,6 +608,7 @@ mode.identity={
game.zhu.isZhu=(game.zhu.identity=='zhu'); game.zhu.isZhu=(game.zhu.identity=='zhu');
game.me.setIdentity(); game.me.setIdentity();
for(i in lib.character){ for(i in lib.character){
if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue;
if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidall.contains(i)) continue; if(lib.config.forbidall.contains(i)) continue;
if(lib.config.banned.contains(i)) continue; if(lib.config.banned.contains(i)) continue;
@ -802,9 +803,21 @@ mode.identity={
game.delay(2); game.delay(2);
game.zhu.playerfocus(1000); game.zhu.playerfocus(1000);
} }
if(!this.node.dieidentity){
var node=ui.create.div('.damage.dieidentity',get.translation(this.identity+'2'),this); var node=ui.create.div('.damage.dieidentity',get.translation(this.identity+'2'),this);
ui.refresh(node); ui.refresh(node);
node.style.opacity=1; node.style.opacity=1;
this.node.dieidentity=node;
}
var trans=this.style.transform;
if(trans){
if(trans.indexOf('rotateY')!=-1){
this.node.dieidentity.style.transform='rotateY(180deg)';
}
if(trans.indexOf('rotateX')!=-1){
this.node.dieidentity.style.transform='rotateX(180deg)';
}
}
}, },
logAi:function(targets,card){ logAi:function(targets,card){
if(this.ai.shown==1) return; if(this.ai.shown==1) return;
@ -1018,6 +1031,9 @@ mode.identity={
if(player.skills.contains('benghuai')&&php>4){ if(player.skills.contains('benghuai')&&php>4){
php=4; php=4;
} }
else if(php>6){
php=6;
}
j=player.get('h').length+player.get('e').length*1.5+php*2; j=player.get('h').length+player.get('e').length*1.5+php*2;
if(player.identity=='zhu'){ if(player.identity=='zhu'){
zhuzhong+=j*1.2+5; zhuzhong+=j*1.2+5;

View File

@ -478,6 +478,7 @@ mode.stone={
var list=[]; var list=[];
event.list=list; event.list=list;
for(i in lib.character){ for(i in lib.character){
if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue;
if(lib.character[i][4]&&lib.character[i][4].contains('minskin')) continue; if(lib.character[i][4]&&lib.character[i][4].contains('minskin')) continue;
if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidall.contains(i)) continue; if(lib.config.forbidall.contains(i)) continue;

View File

@ -189,6 +189,7 @@ mode.versus={
if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidversus.contains(i)) continue; if(lib.config.forbidversus.contains(i)) continue;
if(lib.config.banned.contains(i)) continue; if(lib.config.banned.contains(i)) continue;
if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue;
if(get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue; if(get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue;
if(get.config('ban_weak')&&lib.config.forbidall.contains(i)) continue; if(get.config('ban_weak')&&lib.config.forbidall.contains(i)) continue;
if(get.config('ban_weak')&&(lib.rank.c.contains(i)||lib.rank.d.contains(i))) continue; if(get.config('ban_weak')&&(lib.rank.c.contains(i)||lib.rank.d.contains(i))) continue;

View File

@ -13,6 +13,8 @@ play.character={
if(lib.config.forbidai.contains(i)) continue; if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidall.contains(i)) continue; if(lib.config.forbidall.contains(i)) continue;
if(lib.config.banned.contains(i)) continue; if(lib.config.banned.contains(i)) continue;
if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue;
if(lib.character[i][4]&&lib.character[i][4].contains('boss')) continue;
if(!get.config('double_character')&&get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue; if(!get.config('double_character')&&get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue;
if(get.config('double_character')&&lib.config.forbiddouble.contains(i)) continue; if(get.config('double_character')&&lib.config.forbiddouble.contains(i)) continue;
list.push(i); list.push(i);

View File

@ -70,7 +70,7 @@ body{
); );
}*/ }*/
.card:empty{ .card:empty,.card.infohidden{
background: url('../style/cardback/image/official.png'); background: url('../style/cardback/image/official.png');
background-size: cover; background-size: cover;
} }

View File

@ -1,4 +1,4 @@
.card:empty{ .card:empty,.card.infohidden{
color:rgb(77, 60, 51); color:rgb(77, 60, 51);
text-shadow:none; text-shadow:none;
background: url('../../music/wood3.png'); background: url('../../music/wood3.png');

View File

@ -1,4 +1,4 @@
.card:empty{ .card:empty,.card.infohidden{
background: url('image/official.png'); background: url('image/official.png');
background-size: cover; background-size: cover;
} }

View File

@ -1,4 +1,4 @@
.card:empty{ .card:empty,.card.infohidden{
color:rgb(77, 60, 51); color:rgb(77, 60, 51);
text-shadow:none; text-shadow:none;
background: url('../../woodden/wood.jpg'); background: url('../../woodden/wood.jpg');