This commit is contained in:
libccy 2015-05-07 12:48:00 +08:00
parent 3e737bc160
commit 314a9006a9
8 changed files with 83 additions and 60 deletions

View File

@ -236,6 +236,9 @@ card.qimou={
}
"step 1"
if(targets[1].num('h')){
if(_status.auto&&targets[1]==game.me){
game.delay();
}
targets[1].chooseCard(true,event.num,'选择'+get.cnNumber(event.num)+'张手牌还给'+get.translation(targets[0])).ai=ai.get.disvalue;
}
else{

View File

@ -2196,10 +2196,7 @@ window.play={};
}
this.node.equips.dataset.number=this.num('e');
if(this==game.me){
this.node.handcards1.dataset.number=Math.min(6,this.node.handcards1.childNodes.length-
this.node.handcards1.getElementsByClassName('removing').length)-1;
this.node.handcards2.dataset.number=Math.min(6,this.node.handcards2.childNodes.length-
this.node.handcards2.getElementsByClassName('removing').length)-1;
ui.updateh();
}
if(this.updates){
for(var i=0;i<lib.element.player.updates.length;i++){
@ -5807,11 +5804,7 @@ window.play={};
ui.me.appendChild(ui.handcards1);
ui.me.appendChild(ui.handcards2);
game.me.node.handcards1.dataset.number=Math.min(6,game.me.node.handcards1.childNodes.length-
game.me.node.handcards1.getElementsByClassName('removing').length)-1;
game.me.node.handcards2.dataset.number=Math.min(6,game.me.node.handcards2.childNodes.length-
game.me.node.handcards2.getElementsByClassName('removing').length)-1;
ui.updateh(true);
}
if(game.me.isAlive()){
if(ui.auto) ui.auto.show();
@ -5838,10 +5831,7 @@ window.play={};
ui.handcards2=player.node.handcards2.animate('start').fix();
ui.me.appendChild(ui.handcards1);
ui.me.appendChild(ui.handcards2);
game.me.node.handcards1.dataset.number=Math.min(6,game.me.node.handcards1.childNodes.length-
game.me.node.handcards1.getElementsByClassName('removing').length)-1;
game.me.node.handcards2.dataset.number=Math.min(6,game.me.node.handcards2.childNodes.length-
game.me.node.handcards2.getElementsByClassName('removing').length)-1;
ui.updateh(true);
if(game.me.isAlive()){
if(ui.auto) ui.auto.show();
@ -7860,6 +7850,7 @@ window.play={};
ui.handcards2=game.me.node.handcards2;
ui.me.appendChild(ui.handcards1);
ui.me.appendChild(ui.handcards2);
ui.updateh(true);
},
card:function(position,info,noclick){
var node=ui.create.div('.card',position);
@ -9435,6 +9426,38 @@ window.play={};
if(!nodes[i].fixed) nodes[i].delete();
}
},
updatex:function(){
ui.update.apply(this,arguments);
ui.updateh(true);
},
updateh:function(compute){
if(compute){
game.me.node.handcards1._handcardsWidth=game.me.node.handcards1.offsetWidth;
game.me.node.handcards2._handcardsWidth=game.me.node.handcards2.offsetWidth;
}
ui.updatehx(game.me.node.handcards1);
ui.updatehx(game.me.node.handcards2);
},
updatehxx:function(node){
node.dataset.fold=Math.min(6,node.childElementCount-
node.getElementsByClassName('removing').length)-3;
},
updatehx:function(node){
var num=node.childElementCount-node.getElementsByClassName('removing').length;
var width=node._handcardsWidth;
if(num*78+40>=width){
node.dataset.fold=3;
}
else if(num*93+25>=width){
node.dataset.fold=2;
}
else if(num*112+6>=width){
node.dataset.fold=1;
}
else{
node.dataset.fold=0;
}
},
update:function(){
for(var i=0;i<ui.updates.length;i++){
ui.updates[i]();
@ -11208,7 +11231,7 @@ window.play={};
}
};
window.onload=function(){
document.body.onresize=ui.update;
document.body.onresize=ui.updatex;
if(lib.config.touchscreen){
document.body.addEventListener('touchstart',function(e){
this.startX=e.touches[0].clientX;

View File

@ -1,10 +1,10 @@
#me>[data-number='3']>.card:not(.selected){margin-right: -15px;}
#me>[data-number='4']>.card:not(.selected){margin-right: -30px;}
#me>[data-number='5']>.card:not(.selected){margin-right: -45px;}
#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>[data-number='3']>.card:not(.selected):hover,
#me>[data-number='4']>.card:not(.selected):hover,
#me>[data-number='5']>.card:not(.selected):hover{margin-right: 0;}
#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>div>.card:last-child{margin-right: 0 !important;}
#me>div>.card.last{margin-right: 0 !important;}

View File

@ -1,14 +1,14 @@
#me>[data-number='3']>.card:not(.selected){margin-right: -30px;-webkit-transform:perspective(1000px) rotateY(30deg);}
#me>[data-number='4']>.card:not(.selected){margin-right: -38px;-webkit-transform:perspective(1000px) rotateY(38deg);}
#me>[data-number='5']>.card:not(.selected){margin-right: -45px;-webkit-transform:perspective(1000px) rotateY(45deg);}
#me>[data-fold='1']>.card:not(.selected){margin-right: -30px;-webkit-transform:perspective(1000px) rotateY(30deg);}
#me>[data-fold='2']>.card:not(.selected){margin-right: -38px;-webkit-transform:perspective(1000px) rotateY(38deg);}
#me>[data-fold='3']>.card:not(.selected){margin-right: -45px;-webkit-transform:perspective(1000px) rotateY(45deg);}
#me>[data-number='3']>.card:not(.selected):hover,
#me>[data-number='4']>.card:not(.selected):hover,
#me>[data-number='5']>.card:not(.selected):hover{margin-right: -8px;-webkit-transform:perspective(1000px) rotateY(0);}
#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;-webkit-transform:perspective(1000px) rotateY(0);}
#me>[data-number='3']>.card.start,
#me>[data-number='4']>.card.start,
#me>[data-number='5']>.card.start{-webkit-transform:none;}
#me>[data-fold='1']>.card.start,
#me>[data-fold='2']>.card.start,
#me>[data-fold='3']>.card.start{-webkit-transform:none;}
#me>div>.card:last-child{margin-right: -8px;}
#me>div>.card.last{margin-right: -8px;}

View File

@ -69,7 +69,7 @@ body>.background{z-index:-2}
.background,.button,.avatar,.avatar2{transition-property: top,box-shadow,opacity,-webkit-transform;transition-duration:0.5s;}
.intro{width: 20px;height: 20px;}
/*--------卡牌--------*/
.card{width: 104px;height: 104px;margin-top:8px;margin-left:8px;margin-right: 8px;position: relative;overflow: hidden;}
.card{width: 104px;height: 104px;margin-top:8px;margin-left:4px;margin-right: 4px;position: relative;overflow: hidden;}
.card>.info{right: 6px;top: 9px;white-space: nowrap;}
.card>.name{top:9px;left: 6px;text-align: center;}
.card>.name2{display:none;}
@ -273,32 +273,6 @@ margin-bottom: 5px;
.linked>.count{right: 154px;}
.acted>.identity{-webkit-transform:rotate(180deg);}
/*--------位置(炉石)------*/
#arena.stone>.player.minskin[data-position='4']{top:calc(100% - 305px);left:calc(100% - 120px);}
#arena.stone>.card[data-position='4']{top:calc(100% - 297px);left:calc(100% - 112px);}
#arena.stone>.popup[data-position='4']{top:calc(100% - 340px);left:calc(100% - 112px);}
#arena.stone>.player.minskin[data-position='6']{top:calc(100% - 305px);left:calc(100% - 260px);}
#arena.stone>.card[data-position='6']{top:calc(100% - 297px);left:calc(100% - 252px);}
#arena.stone>.popup[data-position='6']{top:calc(100% - 340px);left:calc(100% - 252px);}
#arena.stone>.player.minskin[data-position='7']{top:calc(100% - 305px);left:140px;}
#arena.stone>.card[data-position='7']{top:calc(100% - 297px);left:148px;}
#arena.stone>.popup[data-position='7']{top:calc(100% - 340px);left:148px;}
#arena.stone>.player.minskin[data-position='5']{top:calc(100% - 305px);left:0;}
#arena.stone>.card[data-position='5']{top:calc(100% - 297px);left:8px;}
#arena.stone>.popup[data-position='5']{top:calc(100% - 340px);left:8px;}
#arena>.player.minskin[data-position='9']{top:30px;left:calc(100% - 120px);}
#arena.stone>.card[data-position='9']{top:38px;left:calc(100% - 112px);}
#arena.stone>.popup[data-position='9']{top:160px;left:calc(100% - 112px);}
#arena>.player.minskin[data-position='11']{top:10px;left:calc(100% - 260px);}
#arena.stone>.card[data-position='11']{top:18px;left:calc(100% - 252px);}
#arena.stone>.popup[data-position='11']{top:140px;left:calc(100% - 252px);}
#arena>.player.minskin[data-position='10']{top:10px;left:140px;}
#arena.stone>.card[data-position='10']{top:18px;left:148px;}
#arena.stone>.popup[data-position='10']{top:140px;left:148px;}
#arena>.player.minskin[data-position='8']{top:30px;left:0;}
#arena.stone>.card[data-position='8']{top:38px;left:8px;}
#arena.stone>.popup[data-position='8']{top:160px;left:8px;}
/*--------位置(8人)------*/
[data-number='8']>.player[data-position='1']{top:calc(200% / 3 - 90px);left:calc(100% - 240px);}
[data-number='8']>.player[data-position='2']{top:calc(100% / 3 - 40px);left:calc(100% - 240px);}

25
layout/mode/stone.css Normal file
View File

@ -0,0 +1,25 @@
#arena.stone>.player.minskin[data-position='4']{top:calc(100% - 305px);left:calc(100% - 120px);}
#arena.stone>.card[data-position='4']{top:calc(100% - 297px);left:calc(100% - 112px);}
#arena.stone>.popup[data-position='4']{top:calc(100% - 340px);left:calc(100% - 112px);}
#arena.stone>.player.minskin[data-position='6']{top:calc(100% - 305px);left:calc(100% - 260px);}
#arena.stone>.card[data-position='6']{top:calc(100% - 297px);left:calc(100% - 252px);}
#arena.stone>.popup[data-position='6']{top:calc(100% - 340px);left:calc(100% - 252px);}
#arena.stone>.player.minskin[data-position='7']{top:calc(100% - 305px);left:140px;}
#arena.stone>.card[data-position='7']{top:calc(100% - 297px);left:148px;}
#arena.stone>.popup[data-position='7']{top:calc(100% - 340px);left:148px;}
#arena.stone>.player.minskin[data-position='5']{top:calc(100% - 305px);left:0;}
#arena.stone>.card[data-position='5']{top:calc(100% - 297px);left:8px;}
#arena.stone>.popup[data-position='5']{top:calc(100% - 340px);left:8px;}
#arena.stone>.player.minskin[data-position='9']{top:30px;left:calc(100% - 120px);}
#arena.stone>.card[data-position='9']{top:38px;left:calc(100% - 112px);}
#arena.stone>.popup[data-position='9']{top:160px;left:calc(100% - 112px);}
#arena.stone>.player.minskin[data-position='11']{top:10px;left:calc(100% - 260px);}
#arena.stone>.card[data-position='11']{top:18px;left:calc(100% - 252px);}
#arena.stone>.popup[data-position='11']{top:140px;left:calc(100% - 252px);}
#arena.stone>.player.minskin[data-position='10']{top:10px;left:140px;}
#arena.stone>.card[data-position='10']{top:18px;left:148px;}
#arena.stone>.popup[data-position='10']{top:140px;left:148px;}
#arena.stone>.player.minskin[data-position='8']{top:30px;left:0;}
#arena.stone>.card[data-position='8']{top:38px;left:8px;}
#arena.stone>.popup[data-position='8']{top:160px;left:8px;}

View File

@ -284,6 +284,7 @@ mode.stone={
var next=game.createEvent('game',false);
next.content=function(){
"step 0"
lib.init.css('layout/mode/','stone');
game.initStone();
game.prepareArena(2);
ui.arena.classList.add('stone');

View File

@ -1011,8 +1011,5 @@ mode.versus={
},
}
},
config:{
change_choice:true,
ban_weak:true,
}
config:['change_choice','ban_weak']
}