This commit is contained in:
libccy 2017-05-17 11:58:02 +08:00
parent 09311fcd7a
commit 978a773418
3 changed files with 32 additions and 24 deletions

View File

@ -12830,6 +12830,28 @@
},100); },100);
game.addVideo('smoothAvatar',this); game.addVideo('smoothAvatar',this);
}, },
changeSeat:function(position){
var player=this;
game.addVideo('changeSeat',player,position);
var rect1=player.getBoundingClientRect();
player.style.transition='all 0s';
ui.refresh(player);
player.dataset.position=position;
var rect2=player.getBoundingClientRect();
var dx=rect1.left-rect2.left;
var dy=rect1.top-rect2.top;
if((game.chess||(player.dataset.position!=0&&position!=0))&&player.classList.contains('linked')){
player.style.transform='rotate(-90deg) translate('+(-dy)+'px,'+(dx)+'px)';
}
else{
player.style.transform='translate('+(dx)+'px,'+(dy)+'px)';
}
setTimeout(function(){
player.style.transition='';
ui.refresh(player);
player.style.transform='';
},100);
},
send:function(){ send:function(){
if(!this.ws||this.ws.closed) return this; if(!this.ws||this.ws.closed) return this;
this.ws.send.apply(this.ws,arguments); this.ws.send.apply(this.ws,arguments);
@ -22663,8 +22685,8 @@
} }
}, },
changeSeat:function(player,info){ changeSeat:function(player,info){
if(player&&player.getBoundingClientRect){ if(player&&player.getBoundingClientRect&&player.changeSeat){
game.changeSeat(player,info); player.changeSeat(info);
game.playerMap={}; game.playerMap={};
var players=game.players.concat(game.dead); var players=game.players.concat(game.dead);
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
@ -25036,20 +25058,6 @@
ui.arena.classList.remove('dragging'); ui.arena.classList.remove('dragging');
_status.dragline.length=0; _status.dragline.length=0;
}, },
changeSeat:function(player,position){
game.addVideo('changeSeat',player,position);
var rect1=player.getBoundingClientRect();
player.style.transition='all 0s';
ui.refresh(player);
player.dataset.position=position;
var rect2=player.getBoundingClientRect();
player.style.transform='translate('+(rect1.left-rect2.left)+'px,'+(rect1.top-rect2.top)+'px)';
setTimeout(function(){
player.style.transition='';
ui.refresh(player);
player.style.transform='';
},100);
},
swapSeat:function(player1,player2,prompt,behind){ swapSeat:function(player1,player2,prompt,behind){
if(behind){ if(behind){
var totalPopulation=game.players.length+game.dead.length+1; var totalPopulation=game.players.length+game.dead.length+1;

View File

@ -15,11 +15,11 @@ window.noname_update={
// 'card/standard.js', // 'card/standard.js',
'character/*', 'character/*',
// 'character/rank.js', // 'character/rank.js',
// 'mode/boss.js', 'mode/boss.js',
// 'mode/versus.js', // 'mode/versus.js',
// 'mode/guozhan.js', // 'mode/guozhan.js',
// 'mode/identity.js', // 'mode/identity.js',
// 'mode/chess.js', 'mode/chess.js',
// 'mode/tafang.js', // 'mode/tafang.js',
// 'mode/guozhan.js', // 'mode/guozhan.js',
// 'mode/stone.js', // 'mode/stone.js',

View File

@ -1053,11 +1053,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.delay(); game.delay();
'step 1' 'step 1'
if(game.me!=game.boss){ if(game.me!=game.boss){
game.changeSeat(game.boss,6); game.boss.changeSeat(6);
} }
else{ else{
game.changeSeat(game.boss.nextSeat,3); game.boss.nextSeat.changeSeat(3);
game.changeSeat(game.boss.previousSeat,5); game.boss.previousSeat.changeSeat(5);
} }
game.changeBoss('boss_huoshenzhurong'); game.changeBoss('boss_huoshenzhurong');
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
@ -1223,11 +1223,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.delay(); game.delay();
'step 1' 'step 1'
if(game.me!=game.boss){ if(game.me!=game.boss){
game.changeSeat(game.boss,6); game.boss.changeSeat(6);
} }
else{ else{
game.changeSeat(game.boss.nextSeat,3); game.boss.nextSeat.changeSeat(3);
game.changeSeat(game.boss.previousSeat,5); game.boss.previousSeat.changeSeat(5);
} }
game.changeBoss('boss_mushengoumang'); game.changeBoss('boss_mushengoumang');
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){