This commit is contained in:
libccy 2015-11-14 13:29:22 +08:00
parent 3a0bcb42a3
commit abeadb74af
44 changed files with 130 additions and 57 deletions

View File

@ -1,3 +1,4 @@
1.5.5
塔防模式
修复若干bug
提升性能

View File

@ -1375,12 +1375,14 @@
map.chess_obstacle.hide();
map.tafang_size.show();
map.tafang_turn.show();
map.tafang_difficulty.show();
}
else{
map.chess_treasure.show();
map.chess_obstacle.show();
map.tafang_size.hide();
map.tafang_turn.hide();
map.tafang_difficulty.hide();
}
if(config.chess_mode=='combat'||config.chess_mode=='tafang'){
map.ban_weak.show();
@ -1915,6 +1917,7 @@
game.saveConfig('totouched',true);
if(totouch){
game.saveConfig('touchscreen',true);
game.saveConfig('fold_card',false);
game.reload();
}
}
@ -5908,17 +5911,29 @@
}
if(cards){
cards=cards.slice(0);
node=cards.shift().copy('drawing','thrown');
node=cards.shift().copy('thrown');
}
else{
node=ui.create.div('.card.drawing.thrown');
node=ui.create.div('.card.thrown');
}
node.fixed=true;
node.dataset.position=this.dataset.position;
node.hide();
// node.dataset.position=this.dataset.position;
node.style.left='calc(50% - 52px)';
node.style.top='calc(50% - 52px)';
this.parentNode.appendChild(node);
node.style.transitionDuration='1s';
ui.refresh(node);
var dx=this.offsetLeft+this.offsetWidth/2-52-node.offsetLeft;
var dy=this.offsetTop+this.offsetHeight/2-52-node.offsetTop;
node.style.transform+=' translate('+dx+'px,'+dy+'px)';
node.show();
setTimeout(function(){
node.remove();
},1000);
node.style.transitionDuration='0.5s';
node.delete();
},700);
var that=this;
if(num&&num>1){
setTimeout(function(){
@ -5998,7 +6013,7 @@
if(false){
var node=this.$throwxy(card,
'calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*100+'px)',
'calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*80+'px)',true
'calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*80+'px)'
);
}
else{
@ -6011,22 +6026,9 @@
}
},
$throwordered:function(node,nosource){
if(nosource){
node.style.transform='scale(0)';
node.classList.add('center');
}
else{
node.dataset.position=this.dataset.position;
}
node.classList.add('thrown');
node.hide();
node.style.transitionProperty='left,top,opacity,transform';
ui.arena.appendChild(node);
ui.refresh(node);
if(nosource){
node.style.transform='';
}
node.show();
for(var i=0;i<ui.thrown.length;i++){
if(ui.thrown[i].parentNode!=ui.arena||
ui.thrown[i].classList.contains('removing')){
@ -6084,16 +6086,35 @@
throwns[i].style.top=top;
}
}
if(nosource){
node.style.transform='scale(0)';
node.classList.add('center');
}
else{
var parseCalc=function(str){
var per=str.slice(str.indexOf('calc(')+5,str.indexOf('%'));
var add=str.slice(str.indexOf('%')+1,str.indexOf('px')).replace(/\s/g,'');
return [parseInt(per),parseInt(add)];
}
var nx=parseCalc(node.style.left);
var ny=parseCalc(node.style.top);
nx=nx[0]*ui.arena.offsetWidth/100+nx[1];
ny=ny[0]*ui.arena.offsetHeight/100+ny[1];
var dx=this.offsetLeft+this.offsetWidth/2-52-nx;
var dy=this.offsetTop+this.offsetHeight/2-52-ny;
node.style.transform+=' translate('+dx+'px,'+dy+'px)';
}
ui.arena.appendChild(node);
ui.refresh(node);
node.style.transform='';
node.show();
return node;
},
$throwxy:function(card,left,top,transform){
$throwxy:function(card,left,top){
var node=card.copy('thrown');
node.dataset.position=this.dataset.position;
node.hide();
node.style.transitionProperty='left,top,opacity';
if(transform){
node.style.transform='rotate('+(Math.random()*16-8)+'deg)';
}
ui.arena.appendChild(node);
ui.refresh(node);
node.show();
@ -6163,7 +6184,7 @@
else{
node=ui.create.div('.card.thrown');
}
node.dataset.position=this.dataset.position;
// node.dataset.position=this.dataset.position;
node.fixed=true;
this.$throwordered(node);
// node.hide();
@ -6178,8 +6199,12 @@
// node.style.top='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*80+'px)';
setTimeout(function(){
node.removeAttribute('style');
node.dataset.position=player.dataset.position;
// node.removeAttribute('style');
// node.dataset.position=player.dataset.position;
var dx=player.offsetLeft+player.offsetWidth/2-52-node.offsetLeft;
var dy=player.offsetTop+player.offsetHeight/2-52-node.offsetTop;
node.style.transform+=' translate('+dx+'px,'+dy+'px)';
node.delete();
},700);
}
@ -6677,9 +6702,14 @@
},
moveTo:function(player,method){
this.fixed=true;
this.style.left='';
this.style.top='';
this.dataset.position=player.dataset.position;
this.style.left=this.offsetLeft+'px';
this.style.top=this.offsetTop+'px';
var dx=player.offsetLeft+player.offsetWidth/2-52-this.offsetLeft;
var dy=player.offsetTop+player.offsetHeight/2-52-this.offsetTop;
this.style.transform+=' translate('+dx+'px,'+dy+'px)';
// this.dataset.position=player.dataset.position;
if(method=='flip'){
this.style.transition='all 0.5s';
this.style.transform='rotate'+(Math.random()<0.5?'X':'Y')+'(180deg) perspective(1000px)';
@ -15160,17 +15190,25 @@
updatehx:function(node){
var num=node.childElementCount-node.getElementsByClassName('removing').length;
var width=node._handcardsWidth;
node.classList.remove('fold0');
node.classList.remove('fold1');
node.classList.remove('fold2');
node.classList.remove('fold3');
if(num*78+40>=width){
node.dataset.fold=3;
// node.dataset.fold=3;
node.classList.add('fold3');
}
else if(num*93+25>=width){
node.dataset.fold=2;
// node.dataset.fold=2;
node.classList.add('fold2');
}
else if(num*112+6>=width){
node.dataset.fold=1;
// node.dataset.fold=1;
node.classList.add('fold1');
}
else{
node.dataset.fold=0;
// node.dataset.fold=0;
node.classList.add('fold0');
}
},
update:function(){

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View File

Before

Width:  |  Height:  |  Size: 713 KiB

After

Width:  |  Height:  |  Size: 713 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -1,10 +1,10 @@
#me>[data-fold='1']>.card:not(.selected){margin-right: -15px;}
#me>[data-fold='2']>.card:not(.selected){margin-right: -30px;}
#me>[data-fold='3']>.card:not(.selected){margin-right: -45px;}
#me>.fold1>.card:not(.selected){margin-right: -15px;}
#me>.fold2>.card:not(.selected){margin-right: -30px;}
#me>.fold3>.card:not(.selected){margin-right: -45px;}
#me>[data-fold='1']>.card:not(.selected):hover,
#me>[data-fold='2']>.card:not(.selected):hover,
#me>[data-fold='3']>.card:not(.selected):hover{margin-right: 0;}
#me>.fold1>.card:not(.selected):hover,
#me>.fold2>.card:not(.selected):hover,
#me>.fold3>.card:not(.selected):hover{margin-right: 0;}
#me>div>.card:last-child{margin-right: 0 !important;}
#me>div>.card.last{margin-right: 0 !important;}

View File

@ -1,14 +1,14 @@
#me>[data-fold='1']>.card:not(.selected){margin-right: -30px;transform:perspective(1000px) rotateY(30deg);}
#me>[data-fold='2']>.card:not(.selected){margin-right: -38px;transform:perspective(1000px) rotateY(38deg);}
#me>[data-fold='3']>.card:not(.selected){margin-right: -45px;transform:perspective(1000px) rotateY(45deg);}
#me>.fold1>.card:not(.selected){margin-right: -30px;transform:perspective(1000px) rotateY(30deg);}
#me>.fold2>.card:not(.selected){margin-right: -38px;transform:perspective(1000px) rotateY(38deg);}
#me>.fold3>.card:not(.selected){margin-right: -45px;transform:perspective(1000px) rotateY(45deg);}
#me>[data-fold='1']>.card:not(.selected):hover,
#me>[data-fold='2']>.card:not(.selected):hover,
#me>[data-fold='3']>.card:not(.selected):hover{margin-right: -8px;transform:perspective(1000px) rotateY(0);}
#me>.fold1>.card:not(.selected):hover,
#me>.fold2>.card:not(.selected):hover,
#me>.fold3>.card:not(.selected):hover{margin-right: -8px;transform:perspective(1000px) rotateY(0);}
#me>[data-fold='1']>.card.start,
#me>[data-fold='2']>.card.start,
#me>[data-fold='3']>.card.start{transform:none;}
#me>.fold1>.card.start,
#me>.fold2>.card.start,
#me>.fold3>.card.start{transform:none;}
#me>div>.card:last-child{margin-right: -8px;}
#me>div>.card.last{margin-right: -8px;}

33
manifest.json Normal file
View File

@ -0,0 +1,33 @@
{
"name": "noname",
"xwalk_version": "1.5.5",
"start_url": "index.html",
"icons": [
{
"src": "image/meta/iconset/icon-256.png",
"sizes": "192x192",
"type": "image/png",
"density": "1.3"
},
{
"src": "image/meta/iconset/icon-256.png",
"sizes": "144x144",
"type": "image/png",
"density": "1.8"
},
{
"src": "image/meta/iconset/icon-256.png",
"sizes": "96x96",
"type": "image/png",
"density": "2.7"
},
{
"src": "image/meta/iconset/icon-256.png",
"sizes": "72x72",
"type": "image/png",
"density": "3.6"
}
],
"display": "fullscreen",
"orientation": "landscape"
}

View File

@ -674,10 +674,11 @@ mode.chess={
treasures:[],
obstacles:[],
getVideoName:function(){
var name=[
get.translation(game.me.name),
'战棋'+get.translation(get.config('chess_mode'))+' - '+_status.friendCount+'v'+_status.enemyCount
];
var str='战棋'+get.translation(get.config('chess_mode'))+' - '+_status.friendCount+'v'+_status.enemyCount;
if(get.config('chess_mode')=='tafang'){
str='战棋 - 塔防';
}
var name=[get.translation(game.me.name),str];
return name;
},
addChessPlayer:function(name,enemy,num,pos){

View File

@ -517,17 +517,17 @@ mode.versus={
game.enemy[i].identity='zhong';
game.enemy[i].setIdentity(!_status.color+'Zhong');
}
if(lib.storage.zhu&&!game.enemyZhu){
game.enemy[0].identity='zhu';
game.enemy[0].setIdentity(!_status.color+'Zhu');
game.enemyZhu=game.enemy[0];
}
}
game.friend[i].node.identity.dataset.color=get.translation(_status.color+'Color');
game.enemy[i].node.identity.dataset.color=get.translation(!_status.color+'Color');
// game.friend[i].node.identity.style.backgroundColor=get.translation(_status.color+'Color');
// game.enemy[i].node.identity.style.backgroundColor=get.translation(!_status.color+'Color');
}
if(lib.storage.zhu&&!game.enemyZhu){
game.enemy[0].identity='zhu';
game.enemy[0].setIdentity(!_status.color+'Zhu');
game.enemyZhu=game.enemy[0];
}
"step 2"
var num=lib.storage.number;
if(result&&result.buttons){