This commit is contained in:
libccy 2015-11-13 17:12:47 +08:00
parent f3a87bed83
commit 3a0bcb42a3
4 changed files with 200 additions and 91 deletions

View File

@ -1 +1,3 @@
1.5.5 1.5.5
塔防模式
修复若干bug

View File

@ -384,11 +384,14 @@ character.refresh={
init:function(player){ init:function(player){
player.storage.reqianxun2=[]; player.storage.reqianxun2=[];
}, },
trigger:{target:'useCardToBegin',player:'judgeAfter'}, trigger:{target:'useCardToBegin',player:'judgeBefore'},
filter:function(event,player){ filter:function(event,player){
if(player.num('h')==0) return false; if(player.num('h')==0) return false;
if(event.parent.name=='phaseJudge'){ if(event.parent.name=='phaseJudge'){
return event.result.judge!=0; if(lib.skill.reqianxun.trigger.player=='judgeBefore'){
return true;
}
return event.result&&event.result.judge!=0;
} }
if(event.name=='judge') return false; if(event.name=='judge') return false;
if(event.targets&&event.targets.length>1) return false; if(event.targets&&event.targets.length>1) return false;

View File

@ -1410,6 +1410,16 @@
'12':'大', '12':'大',
} }
}, },
tafang_difficulty:{
name:'战斗难度',
init:'2',
frequent:true,
item:{
'1':'简单',
'2':'普通',
'3':'困难',
}
},
chess_leader_save:{ chess_leader_save:{
name:'选择历程', name:'选择历程',
init:'save1', init:'save1',
@ -1669,11 +1679,12 @@
'金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令<li>'+ '金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令<li>'+
'战斗中有君主出场时可招降敌将成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降无论成功还是失败都会扣除10招募令<li>'+ '战斗中有君主出场时可招降敌将成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降无论成功还是失败都会扣除10招募令<li>'+
'挑战武将会与该武将以及与其强度相近的武将进行战斗敌方人数与我方出场人数相同但不少于3。胜利后可通过招募令招募该武将<li>'+ '挑战武将会与该武将以及与其强度相近的武将进行战斗敌方人数与我方出场人数相同但不少于3。胜利后可通过招募令招募该武将<li>'+
'竞技场:<br>随机选择9名武将每次派出1〜3名武将参战。战斗中阵亡的武将不能再次上场。<br><br>战斗后武将进入疲劳状态,若立即再次出场则初始体力值-1。<br><br>战斗中本方武将行动时可召唤后援,令一名未出场的已方武将加入战斗。后援武将在战斗结束后无论存活与否均不能再次出场<br><br>当取得12场胜利或所有武将全部阵亡后结束并根据胜场数获得随机奖励'+ '竞技场:<br>随机选择9名武将每次派出1〜3名武将参战。战斗中阵亡的武将不能再次上场。<br><br>战斗后武将进入疲劳状态,若立即再次出场则初始体力值-1。<br><br>战斗中本方武将行动时可召唤后援,令一名未出场的已方武将加入战斗。后援武将在战斗结束后无论存活与否均不能再次出场<br><br>当取得12场胜利或所有武将全部阵亡后结束并根据胜场数获得随机奖励</ul>'+
'<div style="margin:10px">塔防模式</div><ul style="margin-top:0"><li>阻上敌人到达最下方的出口,坚持到给定的回合数即获得胜利<li>'+ '<div style="margin:10px">塔防模式</div><ul style="margin-top:0"><li>阻上敌人到达最下方的出口,坚持到给定的回合数即获得胜利<li>'+
'在1~10回合每轮将新增1名敌人11~20回合每轮将新增2名敌人20回合后每轮将增加3名敌人<li>'+ '每轮可获得10个行动点用来布置机关、招募武将或令武将行动。游戏难度将影响不同操作消耗的行动点数。未用完的行动点将减半并累积到下一轮<li>'+
'每轮可分配10个行动点用来布置机关、招募武将或令武将行动。未用完的行动点将减半并累积到下一轮<li>'+ '每一轮在最上方的一个随机位置增加一名敌人,若最上方已有角色,则将其下移一格<li>'+
'战场上最多出现3个相同的机关每个机关在置入战场3轮后消失。战场上最多招募10名友方角色。', '战场上最多出现3个相同的机关每个机关在置入战场3轮后消失。战场上最多招募10名友方角色。<li>'+
'敌方角色到达底部出口时游戏失败,已方角色到达底部出口,将被移出游戏',
'炉石模式':'<ul><li>游戏流程类似1v1场上有两名主将进行对抗'+ '炉石模式':'<ul><li>游戏流程类似1v1场上有两名主将进行对抗'+
'<li>主将出牌阶段的出牌数量行动值有上限先手为2后手为3装备牌不计入出牌上限<li>游戏每进行一轮,主将的出牌上限+1超过6时减至2并重新累加'+ '<li>主将出牌阶段的出牌数量行动值有上限先手为2后手为3装备牌不计入出牌上限<li>游戏每进行一轮,主将的出牌上限+1超过6时减至2并重新累加'+
'<li>牌堆中随机加入总量1/3的随从牌使用之可召唤一个随从随从出场时背面朝上。每一方在场的随从数不能超过4<li>随从于摸牌阶段摸牌基数为1随从的随从牌均视为闪装备牌均视为杀<li>'+ '<li>牌堆中随机加入总量1/3的随从牌使用之可召唤一个随从随从出场时背面朝上。每一方在场的随从数不能超过4<li>随从于摸牌阶段摸牌基数为1随从的随从牌均视为闪装备牌均视为杀<li>'+
@ -1688,7 +1699,12 @@
node._poppedfunc=func; node._poppedfunc=func;
node._poppedwidth=width; node._poppedwidth=width;
node._poppedheight=height; node._poppedheight=height;
node.addEventListener(lib.config.touchscreen?'touchstart':'mouseenter',ui.click.hoverpopped); if(lib.config.touchscreen){
node.listen(ui.click.hoverpopped);
}
else{
node.addEventListener('mouseenter',ui.click.hoverpopped);
}
}, },
placePoppedDialog:function(dialog,e){ placePoppedDialog:function(dialog,e){
if(e.touches&&e.touches[0]){ if(e.touches&&e.touches[0]){
@ -3882,11 +3898,13 @@
if(lib.config.touchscreen){ if(lib.config.touchscreen){
lib.setLongPress(this,ui.click.intro); lib.setLongPress(this,ui.click.intro);
} }
else if(lib.config.hover_all){ else{
lib.setHover(this,ui.click.hoverplayer); if(lib.config.hover_all){
} lib.setHover(this,ui.click.hoverplayer);
if(lib.config.right_info){ }
this.oncontextmenu=ui.click.rightplayer; if(lib.config.right_info){
this.oncontextmenu=ui.click.rightplayer;
}
} }
var name=get.translation(character); var name=get.translation(character);
this.node.name.innerHTML=''; this.node.name.innerHTML='';
@ -5580,11 +5598,13 @@
if(lib.config.touchscreen){ if(lib.config.touchscreen){
lib.setLongPress(node,ui.click.intro); lib.setLongPress(node,ui.click.intro);
} }
else if(lib.config.hover_all){ else{
lib.setHover(node,ui.click.hoverplayer); if(lib.config.hover_all){
} lib.setHover(node,ui.click.hoverplayer);
if(lib.config.right_info){ }
node.oncontextmenu=ui.click.rightplayer; if(lib.config.right_info){
node.oncontextmenu=ui.click.rightplayer;
}
} }
return node; return node;
}, },
@ -5625,11 +5645,13 @@
if(lib.config.touchscreen){ if(lib.config.touchscreen){
lib.setLongPress(node,ui.click.intro); lib.setLongPress(node,ui.click.intro);
} }
else if(lib.config.hover_all){ else{
lib.setHover(node,ui.click.hoverplayer); if(lib.config.hover_all){
} lib.setHover(node,ui.click.hoverplayer);
if(lib.config.right_info){ }
node.oncontextmenu=ui.click.rightplayer; if(lib.config.right_info){
node.oncontextmenu=ui.click.rightplayer;
}
} }
return node; return node;
} }
@ -8296,6 +8318,14 @@
if(player){ if(player){
player.delete(); player.delete();
delete game.playerMap[player.dataset.position]; delete game.playerMap[player.dataset.position];
game.players.remove(player);
for(var i=0;i<ui.phasequeue.length;i++){
if(ui.phasequeue[i].link==player){
ui.phasequeue[i].remove();
ui.phasequeue.splice(i,1);
break;
}
}
} }
}, },
addChessPlayer:function(content){ addChessPlayer:function(content){
@ -13146,11 +13176,13 @@
if(lib.config.touchscreen){ if(lib.config.touchscreen){
lib.setLongPress(node,ui.click.intro); lib.setLongPress(node,ui.click.intro);
} }
else if(lib.config.hover_all){ else{
lib.setHover(node,ui.click.hoverplayer); if(lib.config.hover_all){
} lib.setHover(node,ui.click.hoverplayer);
if(lib.config.right_info){ }
node.oncontextmenu=ui.click.rightplayer; if(lib.config.right_info){
node.oncontextmenu=ui.click.rightplayer;
}
} }
} }
if(infoitem[1]){ if(infoitem[1]){
@ -13319,11 +13351,13 @@
if(lib.config.touchscreen){ if(lib.config.touchscreen){
lib.setLongPress(node,ui.click.intro); lib.setLongPress(node,ui.click.intro);
} }
else if(lib.config.hover_all){ else{
lib.setHover(node,ui.click.hoverplayer); if(lib.config.hover_all){
} lib.setHover(node,ui.click.hoverplayer);
if(lib.config.right_info){ }
node.oncontextmenu=ui.click.rightplayer; if(lib.config.right_info){
node.oncontextmenu=ui.click.rightplayer;
}
} }
} }
node.storage={}; node.storage={};
@ -13550,7 +13584,9 @@
} }
uiintro.style.left=left+'px'; uiintro.style.left=left+'px';
uiintro._poppedorigin=this; uiintro._poppedorigin=this;
uiintro.addEventListener(lib.config.touchscreen?'touchend':'mouseleave',ui.click.leavehoverpopped); if(!lib.config.touchscreen){
uiintro.addEventListener('mouseleave',ui.click.leavehoverpopped);
}
}, },
leavehoverpopped:function(){ leavehoverpopped:function(){
if(_status.dragged) return; if(_status.dragged) return;
@ -15065,6 +15101,7 @@
return false; return false;
}, },
right:function(){ right:function(){
if(lib.config.touchscreen) return;
if(_status.noright){ if(_status.noright){
_status.noright=false; _status.noright=false;
return false; return false;

View File

@ -43,16 +43,18 @@ mode.chess={
for(var j=1-num+Math.abs(i);j<num-Math.abs(i);j++){ for(var j=1-num+Math.abs(i);j<num-Math.abs(i);j++){
if(this.movable(i,j)){ if(this.movable(i,j)){
var grid=ui.create.playergrid(this,i,j); var grid=ui.create.playergrid(this,i,j);
grids.push(grid); if(grid){
if(typeof move=='function'){ grids.push(grid);
grid.listen(move); if(typeof move=='function'){
} grid.listen(move);
else if(move){ }
grid.listen(ui.click.playergrid); else if(move){
ui.movegrids.push(grid); grid.listen(ui.click.playergrid);
} ui.movegrids.push(grid);
else{ }
grid.classList.add('temp'); else{
grid.classList.add('temp');
}
} }
} }
} }
@ -90,7 +92,36 @@ mode.chess={
if(get.config('chess_mode')=='tafang'&&!_status.video){ if(get.config('chess_mode')=='tafang'&&!_status.video){
if(_status.tafangend.contains(this.dataset.position)){ if(_status.tafangend.contains(this.dataset.position)){
game.over(false); if(_status.enemies.contains(this)){
game.over(false);
}
else{
this.delete();
delete lib.posmap[this];
game.players.remove(this);
_status.friends.remove(this);
this.classList.add('dead');
if(this==game.me){
if(_status.friends.length==0){
ui.fakeme.hide();
this.node.handcards1.delete();
this.node.handcards2.delete();
game.me=ui.create.player();
game.me.side=true;
}
else{
game.modeSwapPlayer(_status.friends[0]);
}
}
for(var i=0;i<ui.phasequeue.length;i++){
if(ui.phasequeue[i].link==this){
ui.phasequeue[i].remove();
ui.phasequeue.splice(i,1);
break;
}
}
game.addVideo('deleteChessPlayer',this);
}
} }
} }
return this; return this;
@ -830,7 +861,7 @@ mode.chess={
next.content=function(){ next.content=function(){
'step 0' 'step 0'
_status.turnCount++; _status.turnCount++;
ui.turnCount.innerHTML='回合'+get.cnNumber(_status.turnCount); ui.turnCount.innerHTML='回合'+get.cnNumber(_status.turnCount,true);
var dialog=ui.create.dialog('剩余行动点:'+(10+_status.remainingCount),'hidden'); var dialog=ui.create.dialog('剩余行动点:'+(10+_status.remainingCount),'hidden');
dialog.style.height='260px'; dialog.style.height='260px';
dialog.style.top='calc(50% - 140px)'; dialog.style.top='calc(50% - 140px)';
@ -840,6 +871,7 @@ mode.chess={
var list=_status.characterList.splice(0,6); var list=_status.characterList.splice(0,6);
var map={}; var map={};
map.bufang=ui.create.buttons(lib.mechlist,'character',dialog.content); map.bufang=ui.create.buttons(lib.mechlist,'character',dialog.content);
var difficulty=parseInt(get.config('tafang_difficulty'));
for(var i=0;i<map.bufang.length;i++){ for(var i=0;i<map.bufang.length;i++){
var button=map.bufang[i]; var button=map.bufang[i];
button.node.intro.classList.add('showintro'); button.node.intro.classList.add('showintro');
@ -847,12 +879,12 @@ mode.chess={
if(button.link=='chess_mech_nengliangqiu'|| if(button.link=='chess_mech_nengliangqiu'||
button.link=='chess_mech_guangmingquan'|| button.link=='chess_mech_guangmingquan'||
button.link=='chess_mech_jiguanren'){ button.link=='chess_mech_jiguanren'){
button.node.intro.innerHTML='三'; button.count=difficulty+1;
button.count=3; button.node.intro.innerHTML=get.cnNumber(button.count,true);
} }
else{ else{
button.node.intro.innerHTML='四'; button.count=difficulty+2;
button.count=4; button.node.intro.innerHTML=get.cnNumber(button.count,true);
} }
button._link='布防'; button._link='布防';
} }
@ -861,8 +893,8 @@ mode.chess={
var button=map.zhaomu[i]; var button=map.zhaomu[i];
button.node.intro.classList.add('showintro'); button.node.intro.classList.add('showintro');
button.node.intro.classList.add('tafang'); button.node.intro.classList.add('tafang');
button.node.intro.innerHTML='六'; button.count=difficulty+4;
button.count=6; button.node.intro.innerHTML=get.cnNumber(button.count,true);
button._link='招募'; button._link='招募';
} }
if(_status.friends.length){ if(_status.friends.length){
@ -871,8 +903,13 @@ mode.chess={
var button=map.xingdong[i]; var button=map.xingdong[i];
button.node.intro.classList.add('showintro'); button.node.intro.classList.add('showintro');
button.node.intro.classList.add('tafang'); button.node.intro.classList.add('tafang');
button.node.intro.innerHTML='二'; if(difficulty<2){
button.count=2; button.count=1;
}
else{
button.count=2;
}
button.node.intro.innerHTML=get.cnNumber(button.count,true);
button._link='行动'; button._link='行动';
} }
} }
@ -964,6 +1001,9 @@ mode.chess={
}); });
if(!_status.friends.length){ if(!_status.friends.length){
event.control.lastChild.style.opacity=0.5; event.control.lastChild.style.opacity=0.5;
if(_status.lastTafangCommand=='行动'){
_status.lastTafangCommand='招募';
}
} }
if(_status.friends.length>=ui.chesswidth){ if(_status.friends.length>=ui.chesswidth){
event.control.childNodes[1].style.opacity=0.5; event.control.childNodes[1].style.opacity=0.5;
@ -972,6 +1012,7 @@ mode.chess={
} }
} }
_status.imchoosing=true; _status.imchoosing=true;
ui.auto.hide();
var eventdong=function(){ var eventdong=function(){
var selected=dialog.querySelectorAll('.button.selected'); var selected=dialog.querySelectorAll('.button.selected');
event.bufang=[]; event.bufang=[];
@ -1049,7 +1090,6 @@ mode.chess={
delete event.bufang; delete event.bufang;
} }
'step 3' 'step 3'
_status.imchoosing=false;
if(event.dialog){ if(event.dialog){
event.dialog.close(); event.dialog.close();
delete event.dialog; delete event.dialog;
@ -1078,7 +1118,7 @@ mode.chess={
if(event.zhaomu.length){ if(event.zhaomu.length){
event.currentZhaomu=event.zhaomu.shift(); event.currentZhaomu=event.zhaomu.shift();
event.dialog=ui.create.dialog('选择一个位置安排【'+get.translation(event.currentZhaomu)+'】'); event.dialog=ui.create.dialog('选择一个位置安排【'+get.translation(event.currentZhaomu)+'】');
var size=ui.chesswidth*ui.chessheight; var size=ui.chesswidth*(ui.chessheight-1);
var clickGrid=function(){ var clickGrid=function(){
var player=game.addChessPlayer(event.currentZhaomu,false,4,this.dataset.position); var player=game.addChessPlayer(event.currentZhaomu,false,4,this.dataset.position);
_status.friends.push(player); _status.friends.push(player);
@ -1100,7 +1140,7 @@ mode.chess={
} }
if(!event.playergrids){ if(!event.playergrids){
event.playergrids=[] event.playergrids=[]
for(var i=0;i<size;i++){ for(var i=ui.chesswidth;i<size;i++){
if(!lib.posmap[i.toString()]){ if(!lib.posmap[i.toString()]){
var grid=ui.create.div('.player.minskin.playerblank.glow',clickGrid,ui.chess); var grid=ui.create.div('.player.minskin.playerblank.glow',clickGrid,ui.chess);
grid.animate('start'); grid.animate('start');
@ -1122,19 +1162,10 @@ mode.chess={
else{ else{
delete event.zhaomu; delete event.zhaomu;
} }
game.delay();
'step 5' 'step 5'
_status.imchoosing=false; _status.imchoosing=false;
for(var i=7;i>=0;i--){ ui.auto.show();
for(var j=0;j<ui.chesswidth;j++){
var player=lib.posmap[i*ui.chesswidth+j];
if(player&&game.players.contains(player)){
player.moveDown();
}
}
}
game.delay(); game.delay();
'step 6'
if(event.dialog){ if(event.dialog){
event.dialog.close(); event.dialog.close();
delete event.dialog; delete event.dialog;
@ -1146,6 +1177,29 @@ mode.chess={
delete event.playergrids; delete event.playergrids;
} }
delete event.currentZhaomu; delete event.currentZhaomu;
'step 6'
var shalldelay=false;
for(var i=0;i<ui.chesswidth;i++){
if(lib.posmap[i]&&game.players.contains(lib.posmap[i])){
for(var j=0;j<ui.chessheight;j++){
var pos=i+j*ui.chesswidth;
if(lib.posmap[pos]&&lib.posmap[pos].movable(0,1)){
break;
}
}
if(j<ui.chessheight){
shalldelay=true;
for(var k=j;k>=0;k--){
var pos=i+k*ui.chesswidth;
if(lib.posmap[pos]){
lib.posmap[pos].moveDown();
}
}
}
}
}
if(shalldelay) game.delay();
'step 7'
event.justadded=[]; event.justadded=[];
if(_status.characterList.length){ if(_status.characterList.length){
if(_status.enemies.length<ui.chesswidth*2){ if(_status.enemies.length<ui.chesswidth*2){
@ -1165,33 +1219,42 @@ mode.chess={
} }
game.delay(); game.delay();
} }
if(_status.turnCount>=10&&list1.length){ // var difficulty=get.config('tafang_difficulty');
var enemy=game.addChessPlayer(_status.characterList.shift(),true,4,list1.randomRemove()); // if(_status.turnCount>=10&&list1.length&&difficulty>1){
_status.enemies.push(enemy); // var enemy=game.addChessPlayer(_status.characterList.shift(),true,4,list1.randomRemove());
event.justadded.push(enemy.name); // _status.enemies.push(enemy);
} // event.justadded.push(enemy.name);
if(_status.turnCount>=20&&list1.length){ // }
var enemy=game.addChessPlayer(_status.characterList.shift(),true,4,list1.randomRemove()); // if(_status.turnCount>=20&&list1.length&&difficulty>1){
_status.enemies.push(enemy); // var enemy=game.addChessPlayer(_status.characterList.shift(),true,4,list1.randomRemove());
event.justadded.push(enemy.name); // _status.enemies.push(enemy);
} // event.justadded.push(enemy.name);
// }
// if(list1.length&&difficulty>2){
// var enemy=game.addChessPlayer(_status.characterList.shift(),true,4,list1.randomRemove());
// _status.enemies.push(enemy);
// event.justadded.push(enemy.name);
// }
} }
} }
else{ else{
game.over(true); game.over(true);
} }
'step 7' 'step 8'
if(event.xingdong.length){ if(event.xingdong.length){
event.xingdong.shift().phase(); var toact=event.xingdong.shift();
if(game.players.contains(toact)){
toact.phase();
}
event.redo(); event.redo();
} }
else{ else{
event.xingdong=_status.enemies.slice(0); event.xingdong=_status.enemies.slice(0);
} }
'step 8' 'step 9'
if(event.xingdong.length){ if(event.xingdong.length){
var enemy=event.xingdong.shift(); var enemy=event.xingdong.shift();
if(!event.justadded.contains(enemy.name)){ if(!event.justadded.contains(enemy.name)&&game.players.contains(enemy)){
enemy.phase(); enemy.phase();
} }
event.redo(); event.redo();
@ -1199,7 +1262,7 @@ mode.chess={
else{ else{
event.mechlist=game.treasures.slice(0); event.mechlist=game.treasures.slice(0);
} }
'step 9' 'step 10'
if(event.mechlist.length){ if(event.mechlist.length){
var mech=event.mechlist.shift(); var mech=event.mechlist.shift();
var info=lib.skill[mech.name+'_skill']; var info=lib.skill[mech.name+'_skill'];
@ -1225,7 +1288,7 @@ mode.chess={
} }
event.redo(); event.redo();
} }
'step 10' 'step 11'
delete event.xingdong; delete event.xingdong;
delete event.mechlist; delete event.mechlist;
if(_status.turnCount>=_status.turnTotal){ if(_status.turnCount>=_status.turnTotal){
@ -3734,9 +3797,10 @@ mode.chess={
} }
if(list.length){ if(list.length){
game.log('光明泉发动'); game.log('光明泉发动');
var target=list.randomGet(); player.line(list,'green');
target.recover(); while(list.length){
player.line(target,'green'); list.shift().recover();
}
} }
} }
}, },
@ -5335,14 +5399,19 @@ mode.chess={
chess_mech_gongchengche_skill_info:'每一轮对距离2格以内的一名随机敌方角色造成1点火焰伤害并将目标击退1格', chess_mech_gongchengche_skill_info:'每一轮对距离2格以内的一名随机敌方角色造成1点火焰伤害并将目标击退1格',
chess_mech_guangmingquan:'光明泉', chess_mech_guangmingquan:'光明泉',
chess_mech_guangmingquan_skill:'圣疗', chess_mech_guangmingquan_skill:'圣疗',
chess_mech_guangmingquan_skill_info:'每一轮令距离2格以内的一名随机友方角色回复一点体力', chess_mech_guangmingquan_skill_info:'每一轮令距离2格以内的所有友方角色各回复一点体力',
}, },
ui:{ ui:{
create:{ create:{
playergrid:function(player,x,y){ playergrid:function(player,x,y){
var pos=player.getDataPos(x,y);
if(get.config('chess_mode')=='tafang'){
if(pos<ui.chesswidth) return false;
if(pos/ui.chesswidth>=ui.chessheight-1) return false;
}
var node=ui.create.div('.player.minskin.playergrid',player.parentNode); var node=ui.create.div('.player.minskin.playergrid',player.parentNode);
node.link=player; node.link=player;
node.dataset.position=player.getDataPos(x,y); node.dataset.position=pos;
return node; return node;
}, },
fakeme:function(){ fakeme:function(){
@ -5356,10 +5425,8 @@ mode.chess={
click:{ click:{
playergrid:function(){ playergrid:function(){
if(!_status.paused) return; if(!_status.paused) return;
delete lib.posmap[this.link.dataset.position]; var pos=parseInt(this.dataset.position);
game.addVideo('moveTox',this.link,this.dataset.position); this.link.moveTo(pos%ui.chesswidth,Math.floor(pos/ui.chesswidth));
this.link.dataset.position=this.dataset.position;
lib.posmap[this.link.dataset.position]=this.link;
if(ui.movegrids){ if(ui.movegrids){
while(ui.movegrids.length){ while(ui.movegrids.length){
ui.movegrids.shift().delete(); ui.movegrids.shift().delete();