战棋模式改进

This commit is contained in:
libccy 2015-09-30 15:24:45 +08:00
parent b604b39e4d
commit d50db52f9a
4 changed files with 43 additions and 6 deletions

View File

@ -4259,16 +4259,46 @@
if(list.length) this.$draw(list); if(list.length) this.$draw(list);
}, },
$fire:function(){ $fire:function(){
game.animate.flame(this.offsetLeft+this.offsetWidth/2, var left,top;
this.offsetTop+this.offsetHeight-20,700,'fire'); if(lib.config.mode=='chess'){
var rect=this.getBoundingClientRect();
left=rect.left;
top=rect.top;
}
else{
left=this.offsetLeft;
top=this.offsetTop;
}
game.animate.flame(left+this.offsetWidth/2,
top+this.offsetHeight-20,700,'fire');
}, },
$thunder:function(){ $thunder:function(){
game.animate.flame(this.offsetLeft+this.offsetWidth/2, var left,top;
this.offsetTop+this.offsetHeight-30,700,'thunder'); if(lib.config.mode=='chess'){
var rect=this.getBoundingClientRect();
left=rect.left;
top=rect.top;
}
else{
left=this.offsetLeft;
top=this.offsetTop;
}
game.animate.flame(left+this.offsetWidth/2,
top+this.offsetHeight-30,700,'thunder');
}, },
$recover:function(){ $recover:function(){
game.animate.flame(this.offsetLeft+this.offsetWidth/2, var left,top;
this.offsetTop+this.offsetHeight-30,700,'recover'); if(lib.config.mode=='chess'){
var rect=this.getBoundingClientRect();
left=rect.left;
top=rect.top;
}
else{
left=this.offsetLeft;
top=this.offsetTop;
}
game.animate.flame(left+this.offsetWidth/2,
top+this.offsetHeight-30,700,'recover');
}, },
$damagepop:function(num,nature){ $damagepop:function(num,nature){
if(typeof num=='number'){ if(typeof num=='number'){

View File

@ -217,6 +217,7 @@ margin-bottom: 5px;
width: 100%; width: 100%;
text-align: center; text-align: center;
top:calc(50% - 36px); top:calc(50% - 36px);
left:0;
opacity: 0; opacity: 0;
-webkit-transform:scale(0.7); -webkit-transform:scale(0.7);
} }

View File

@ -28,6 +28,11 @@
#arena .card.thrown{ #arena .card.thrown{
z-index:4; z-index:4;
} }
#canvas2{
position: absolute;
z-index: 10;
pointer-events: none;
}
#handcards1{ #handcards1{
height:120px; height:120px;

View File

@ -624,6 +624,7 @@ mode.chess={
ui.chessContainer.style.WebkitOverflowScrolling='touch'; ui.chessContainer.style.WebkitOverflowScrolling='touch';
ui.chess=ui.create.div('#chess',ui.chessContainer); ui.chess=ui.create.div('#chess',ui.chessContainer);
ui.canvas2=document.createElement('canvas'); ui.canvas2=document.createElement('canvas');
ui.canvas2.id='canvas2';
ui.chess.appendChild(ui.canvas2); ui.chess.appendChild(ui.canvas2);
ui.ctx2=ui.canvas2.getContext('2d'); ui.ctx2=ui.canvas2.getContext('2d');
game.me=ui.create.player(); game.me=ui.create.player();