废弃HTMLDivElement.prototype.animate,改为使用HTMLDivElement.prototype.addTempClass
This commit is contained in:
parent
e235809703
commit
66c8c6cba9
|
@ -520,7 +520,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
});
|
||||
player.line(list1);
|
||||
for(var i=0;i<list1.length;i++){
|
||||
list1[i].animate('target');
|
||||
list1[i].addTempClass('target');
|
||||
}
|
||||
setTimeout(function(){
|
||||
var list11=list1.slice(0);
|
||||
|
|
|
@ -3391,10 +3391,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
|
||||
game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]);
|
||||
for(var i=0;i<event.cards.length;i++) event.cards[i].discard();
|
||||
// var node=card.copy('thrown','center',ui.arena).animate('start');
|
||||
// var node=card.copy('thrown','center',ui.arena).addTempClass('start');
|
||||
var node;
|
||||
if(game.chess){
|
||||
node=card.copy('thrown','center',ui.arena).animate('start');
|
||||
node=card.copy('thrown','center',ui.arena).addTempClass('start');
|
||||
}
|
||||
else{
|
||||
node=player.$throwordered(card.copy(),true);
|
||||
|
|
|
@ -3677,7 +3677,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
"step 7"
|
||||
if(event.iwhile<targets.length){
|
||||
event.target=targets[event.iwhile];
|
||||
event.target.animate('target');
|
||||
event.target.addTempClass('target');
|
||||
event.card2=event.cardlist[event.iwhile];
|
||||
event.num2=event.getNum(event.card2);
|
||||
game.log(event.target,'的拼点牌为',event.card2);
|
||||
|
|
|
@ -4911,7 +4911,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
player.addSkill('xunbao2');
|
||||
game.delay(2);
|
||||
|
||||
event.node=event.card.copy('thrown','center','thrownhighlight',ui.arena).animate('start');
|
||||
event.node=event.card.copy('thrown','center','thrownhighlight',ui.arena).addTempClass('start');
|
||||
ui.arena.classList.add('thrownhighlight');
|
||||
game.addVideo('thrownhighlight1');
|
||||
game.addVideo('centernode',null,get.cardInfo(event.card));
|
||||
|
@ -8629,7 +8629,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
'step 1'
|
||||
if(event.list.length){
|
||||
event.current=event.list.shift();
|
||||
event.current.animate('target');
|
||||
event.current.addTempClass('target');
|
||||
var next=event.current.chooseToRespond({name:'sha'});
|
||||
next.ai=function(card){
|
||||
if(get.damageEffect(event.current,player,event.current,'thunder')>=0) return 0;
|
||||
|
|
|
@ -6779,7 +6779,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
"step 1"
|
||||
if(event.players.length){
|
||||
event.current=event.players.shift();
|
||||
event.current.animate('target');
|
||||
event.current.addTempClass('target');
|
||||
player.line(event.current,'green');
|
||||
if(event.current.countCards('he')&&target.isIn()){
|
||||
event.current.chooseToDiscard({subtype:'equip1'},'he','弃置一张武器牌或让'+
|
||||
|
@ -8790,7 +8790,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
event=_status.event;
|
||||
}
|
||||
if(game.chess){
|
||||
event.node=card.copy('thrown','center',ui.arena).animate('start');
|
||||
event.node=card.copy('thrown','center',ui.arena).addTempClass('start');
|
||||
}
|
||||
else{
|
||||
event.node=player.$throwordered(card.copy(),true);
|
||||
|
@ -13446,9 +13446,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
event.card=get.cards()[0];
|
||||
game.broadcast(function(card){
|
||||
ui.arena.classList.add('thrownhighlight');
|
||||
card.copy('thrown','center','thrownhighlight',ui.arena).animate('start');
|
||||
card.copy('thrown','center','thrownhighlight',ui.arena).addTempClass('start');
|
||||
},event.card);
|
||||
event.node=event.card.copy('thrown','center','thrownhighlight',ui.arena).animate('start');
|
||||
event.node=event.card.copy('thrown','center','thrownhighlight',ui.arena).addTempClass('start');
|
||||
ui.arena.classList.add('thrownhighlight');
|
||||
game.addVideo('thrownhighlight1');
|
||||
game.addVideo('centernode',null,get.cardInfo(event.card));
|
||||
|
|
|
@ -5278,7 +5278,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
event.currented=[];
|
||||
"step 1"
|
||||
event.currented.push(event.current);
|
||||
event.current.animate('target');
|
||||
event.current.addTempClass('target');
|
||||
event.current.chooseToUse('乱武:使用一张杀或失去1点体力',function(card){
|
||||
if(get.name(card)!='sha') return false;
|
||||
return lib.filter.cardEnabled.apply(this,arguments)
|
||||
|
|
|
@ -3333,7 +3333,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
event=_status.event;
|
||||
}
|
||||
if(game.chess){
|
||||
event.node=card.copy('thrown','center',ui.arena).animate('start');
|
||||
event.node=card.copy('thrown','center',ui.arena).addTempClass('start');
|
||||
}
|
||||
else{
|
||||
event.node=player.$throwordered(card.copy(),true);
|
||||
|
|
|
@ -5472,7 +5472,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
'step 1'
|
||||
if(event.players.length){
|
||||
event.current=event.players.shift();
|
||||
event.current.animate('target');
|
||||
event.current.addTempClass('target');
|
||||
player.line(event.current,'green');
|
||||
if(!event.current.countCards('he')||!target.isIn()) event._result={bool:false};
|
||||
else{
|
||||
|
|
|
@ -9792,7 +9792,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
"step 1"
|
||||
if(event.players.length){
|
||||
event.current=event.players.shift();
|
||||
event.current.animate('target');
|
||||
event.current.addTempClass('target');
|
||||
player.line(event.current,'green');
|
||||
if(event.current.countCards('he')&&target.isIn()){
|
||||
event.current.chooseToDiscard({subtype:'equip1'},'he','弃置一张武器牌或让'+
|
||||
|
|
30
mode/boss.js
30
mode/boss.js
|
@ -226,14 +226,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
boss.side=true;
|
||||
if(!event.noslide){
|
||||
var rect=event.current.getBoundingClientRect();
|
||||
boss.animate('bossing');
|
||||
boss.node.hp.animate('start');
|
||||
boss.addTempClass('bossing');
|
||||
boss.node.hp.addTempClass('start');
|
||||
boss.bossinginfo=[rect.left+rect.width/2,rect.top+rect.height/2];
|
||||
boss.style.transition='all 0s';
|
||||
boss.node.equips.style.opacity='0';
|
||||
}
|
||||
else{
|
||||
boss.animate('start');
|
||||
boss.addTempClass('start');
|
||||
}
|
||||
boss.setIdentity('zhu');
|
||||
boss.identity='zhu';
|
||||
|
@ -244,7 +244,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
for(var i=0;i<result.links.length;i++){
|
||||
var player=ui.create.player();
|
||||
player.getId();
|
||||
player.init(result.links[i]).animate('start');
|
||||
player.init(result.links[i]).addTempClass('start');
|
||||
player.setIdentity('cai');
|
||||
player.identity='cai';
|
||||
player.side=false;
|
||||
|
@ -279,12 +279,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
player.getId();
|
||||
player.init(game.bossinfo.minion[i]);
|
||||
if(boss.bossinginfo){
|
||||
player.animate('bossing');
|
||||
player.node.hp.animate('start');
|
||||
player.addTempClass('bossing');
|
||||
player.node.hp.addTempClass('start');
|
||||
player.style.transition='all 0s';
|
||||
}
|
||||
else{
|
||||
player.animate('start');
|
||||
player.addTempClass('start');
|
||||
}
|
||||
player.setIdentity('zhong');
|
||||
player.identity='zhong';
|
||||
|
@ -974,7 +974,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
if(game.me==player){
|
||||
game.swapControl(boss);
|
||||
}
|
||||
game.players.push(boss.animate('zoominanim'));
|
||||
game.players.push(boss.addTempClass('zoominanim'));
|
||||
game.arrangePlayers();
|
||||
if(!game.boss){
|
||||
game.boss=boss;
|
||||
|
@ -1034,7 +1034,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var sort=lib.config.sort_card(card);
|
||||
var position=sort>0?player.node.handcards1:player.node.handcards2;
|
||||
card.fix();
|
||||
card.animate('start');
|
||||
card.addTempClass('start');
|
||||
position.insertBefore(card,position.firstChild);
|
||||
}
|
||||
player.update();
|
||||
|
@ -1184,7 +1184,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list.slice(0,20),'character',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
|
||||
game.uncheck();
|
||||
|
@ -1201,7 +1201,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
event.dialogxx.classList.add('withbg');
|
||||
event.dialogxx.classList.add('fixed');
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
};
|
||||
|
@ -1225,11 +1225,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
if(_status.bosschoice){
|
||||
_status.bosschoice.animate('controlpressdownx',500);
|
||||
_status.bosschoice.addTempClass('controlpressdownx',500);
|
||||
_status.bosschoice.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
@ -6462,10 +6462,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
|
||||
game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]);
|
||||
for(var i=0;i<event.cards.length;i++) event.cards[i].discard();
|
||||
// var node=card.copy('thrown','center',ui.arena).animate('start');
|
||||
// var node=card.copy('thrown','center',ui.arena).addTempClass('start');
|
||||
var node;
|
||||
if(game.chess){
|
||||
node=card.copy('thrown','center',ui.arena).animate('start');
|
||||
node=card.copy('thrown','center',ui.arena).addTempClass('start');
|
||||
}
|
||||
else{
|
||||
node=player.$throwordered(card.copy(),true);
|
||||
|
|
|
@ -1381,8 +1381,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
this.showcaseinterval=setInterval(function(){
|
||||
var dx,dy
|
||||
if(num2%5==0){
|
||||
// player.animate('target');
|
||||
// player.animate('zoomin');
|
||||
// player.addTempClass('target');
|
||||
// player.addTempClass('zoomin');
|
||||
player.classList.add('zoomin3');
|
||||
player.hide();
|
||||
player.style.transitionDuration='0.7s'
|
||||
|
@ -2955,7 +2955,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list,'character',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
|
@ -2966,7 +2966,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
lib.onfree.push(function(){
|
||||
event.dialogxx=ui.create.characterDialog('heightset');
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
});
|
||||
|
@ -2988,7 +2988,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
_status.enemyCount=_status.enemylist.length;
|
||||
_status.friendCount=_status.mylist.length;
|
||||
while(_status.mylist.length){
|
||||
friend=ui.create.player().animate('start');
|
||||
friend=ui.create.player().addTempClass('start');
|
||||
friend.getId();
|
||||
if(!event.friendZhu){
|
||||
event.friendZhu=friend;
|
||||
|
@ -244,7 +244,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
lib.posmap[friend.dataset.position]=friend;
|
||||
}
|
||||
while(_status.enemylist.length){
|
||||
enemy=ui.create.player().animate('start');
|
||||
enemy=ui.create.player().addTempClass('start');
|
||||
enemy.getId();
|
||||
enemy.init(_status.enemylist.shift());
|
||||
enemy.side=!side;
|
||||
|
@ -1082,7 +1082,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
$phaseJudge:function(card){
|
||||
game.addVideo('phaseJudge',this,get.cardInfo(card));
|
||||
var clone=card.copy('thrown',this.parentNode).animate('judgestart');
|
||||
var clone=card.copy('thrown',this.parentNode).addTempClass('judgestart');
|
||||
var player=this;
|
||||
clone.style.opacity=0.6;
|
||||
clone.style.left=(Math.random()*100-50+ui.chessContainer.chessLeft+ui.chessContainer.offsetWidth/2-52)+'px';
|
||||
|
@ -1523,7 +1523,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var player=ui.create.player();
|
||||
player.getId();
|
||||
if(enemy=='treasure'){
|
||||
player.animate('judgestart');
|
||||
player.addTempClass('judgestart');
|
||||
player.side=null;
|
||||
player.identity='neutral';
|
||||
player.setIdentity();
|
||||
|
@ -1534,7 +1534,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.treasures.add(player);
|
||||
}
|
||||
else{
|
||||
player.animate('start');
|
||||
player.addTempClass('start');
|
||||
if(enemy){
|
||||
if(get.mode()=='tafang'){
|
||||
player.side=true;
|
||||
|
@ -1634,7 +1634,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
pos=y*ui.chesswidth+x;
|
||||
}
|
||||
if(!lib.posmap[pos]){
|
||||
var grid=ui.create.div('.player.minskin.obstacle',ui.chess).animate('start');
|
||||
var grid=ui.create.div('.player.minskin.obstacle',ui.chess).addTempClass('start');
|
||||
ui.placeChess(grid,pos);
|
||||
grid.listen(ui.click.obstacle);
|
||||
lib.posmap[pos]=grid;
|
||||
|
@ -2626,21 +2626,21 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
ui.money.childNodes[1].innerHTML=game.data.dust;
|
||||
game.changeMoney(-100);
|
||||
if(game.data.character.length>3&&selected.character.length){
|
||||
event.removeCharacter.animate('controlpressdownx',500);
|
||||
event.removeCharacter.addTempClass('controlpressdownx',500);
|
||||
event.removeCharacter.classList.remove('disabled');
|
||||
}
|
||||
if(game.data.money<150&&!game.data._arena){
|
||||
event.enterArena.classList.add('disabled');
|
||||
}
|
||||
else{
|
||||
event.enterArena.animate('controlpressdownx',500);
|
||||
event.enterArena.addTempClass('controlpressdownx',500);
|
||||
event.enterArena.classList.remove('disabled');
|
||||
}
|
||||
if(game.data.money<100){
|
||||
event.addCharacter.classList.add('disabled');
|
||||
}
|
||||
else{
|
||||
event.addCharacter.animate('controlpressdownx',500);
|
||||
event.addCharacter.addTempClass('controlpressdownx',500);
|
||||
event.addCharacter.classList.remove('disabled');
|
||||
}
|
||||
initcapt();
|
||||
|
@ -2713,11 +2713,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.data.character.remove(node.link);
|
||||
game.saveData();
|
||||
if(game.data.money>=100){
|
||||
event.addCharacter.animate('controlpressdownx',500);
|
||||
event.addCharacter.addTempClass('controlpressdownx',500);
|
||||
event.addCharacter.classList.remove('disabled');
|
||||
}
|
||||
if(game.data.money>=150){
|
||||
event.enterArena.animate('controlpressdownx',500);
|
||||
event.enterArena.addTempClass('controlpressdownx',500);
|
||||
event.enterArena.classList.remove('disabled');
|
||||
}
|
||||
node.delete();
|
||||
|
@ -2952,7 +2952,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
if(selected.character.length&&game.data.character.length>3){
|
||||
event.removeCharacter.animate('controlpressdownx',500);
|
||||
event.removeCharacter.addTempClass('controlpressdownx',500);
|
||||
event.removeCharacter.classList.remove('disabled');
|
||||
}
|
||||
else{
|
||||
|
@ -2990,14 +2990,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
_status.qianfan=false;
|
||||
event.removeCharacter.replace('遣返',qianfan);
|
||||
if(game.data.money>=100){
|
||||
event.addCharacter.animate('controlpressdownx',500);
|
||||
event.addCharacter.addTempClass('controlpressdownx',500);
|
||||
event.addCharacter.classList.remove('disabled');
|
||||
}
|
||||
else{
|
||||
event.addCharacter.classList.add('disabled');
|
||||
}
|
||||
if(game.data.money>=150||game.data._arena){
|
||||
event.enterArena.animate('controlpressdownx',500);
|
||||
event.enterArena.addTempClass('controlpressdownx',500);
|
||||
event.enterArena.classList.remove('disabled');
|
||||
}
|
||||
else{
|
||||
|
@ -3885,7 +3885,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
else if(dialog.buttons.length<num){
|
||||
for(var i=dialog.buttons.length;i<num;i++){
|
||||
dialog.buttons.push(ui.create.button(list[i],'character',dialog.buttons[0].parentNode).animate('zoom'))
|
||||
dialog.buttons.push(ui.create.button(list[i],'character',dialog.buttons[0].parentNode).addTempClass('zoom'))
|
||||
}
|
||||
game.check();
|
||||
}
|
||||
|
@ -3905,7 +3905,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list.slice(0,parseInt(get.config('battle_number'))*4+parseInt(get.config('replace_number'))+5),'character',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
|
||||
// _status.event.dialog.close();
|
||||
|
@ -3940,7 +3940,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
event.dialogxx.classList.add('fullheight');
|
||||
event.dialogxx.classList.add('fixed');
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
};
|
||||
|
@ -3963,7 +3963,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
@ -5869,7 +5869,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.pause();
|
||||
_status.imchoosing=true;
|
||||
for(var i=0;i<event.grids.length;i++){
|
||||
event.grids[i].animate('start');
|
||||
event.grids[i].addTempClass('start');
|
||||
}
|
||||
event.dialog=ui.create.dialog('选择一个位置放置障碍');
|
||||
}
|
||||
|
|
|
@ -792,7 +792,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=dialog.buttons[0].parentNode;
|
||||
dialog.buttons=ui.create.buttons(list,'characterx',buttons);
|
||||
dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
|
@ -972,7 +972,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list,'characterx',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
|
@ -983,7 +983,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
lib.onfree.push(function(){
|
||||
event.dialogxx=ui.create.characterDialog('heightset');
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
});
|
||||
|
@ -1005,7 +1005,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4514,7 +4514,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var target=targets.shift();
|
||||
event.target=target;
|
||||
if(target.isIn()){
|
||||
target.animate('target');
|
||||
target.addTempClass('target');
|
||||
target.chooseCard('h',num,'将'+get.cnNumber(num)+'张牌置入弃牌堆,或受到1点伤害').set('ai',function(card){
|
||||
var evt=_status.event.getParent();
|
||||
if(get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0;
|
||||
|
@ -13913,7 +13913,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},get.config('onlyguozhanexpand')?'expandall':undefined,get.config('onlyguozhan')?'onlypack:mode_guozhan':undefined);
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
};
|
||||
|
@ -13936,7 +13936,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
@ -13977,7 +13977,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list,'character',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
|
|
|
@ -1582,7 +1582,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=dialog.buttons[0].parentNode;
|
||||
dialog.buttons=ui.create.buttons(list,'characterx',buttons);
|
||||
dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
|
@ -1992,7 +1992,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list,'characterx',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
|
@ -2003,7 +2003,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
lib.onfree.push(function(){
|
||||
event.dialogxx=ui.create.characterDialog('heightset');
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
});
|
||||
|
@ -2025,7 +2025,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -934,7 +934,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
player.dataset.position=dead.dataset.position;
|
||||
player.side=dead.side;
|
||||
player.actcharacterlist=dead.actcharacterlist;
|
||||
player.animate('replaceme');
|
||||
player.addTempClass('replaceme');
|
||||
player.actcount=game.enemy.actcount;
|
||||
player.actcount=dead.actcount;
|
||||
if(_status.double_character){
|
||||
|
@ -994,7 +994,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
player.dataset.position=dead.dataset.position;
|
||||
player.side=dead.side;
|
||||
player.actcharacterlist=dead.actcharacterlist;
|
||||
player.animate('replaceenemy');
|
||||
player.addTempClass('replaceenemy');
|
||||
player.actcount=dead.actcount;
|
||||
if(_status.double_character){
|
||||
player.init(_status.enemylist.shift(),_status.enemylist.shift());
|
||||
|
@ -1495,7 +1495,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list.slice(0,get.config('battle_number')*2+5),'character',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
|
||||
game.uncheck();
|
||||
|
@ -1510,7 +1510,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
lib.onfree.push(function(){
|
||||
event.dialogxx=ui.create.characterDialog('heightset');
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
event.dialogxx.style.height=(game.layout=='newlayout'?350:410)+'px';
|
||||
|
@ -1533,7 +1533,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -616,8 +616,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
ui.me.querySelector('.fakeme.avatar').show();
|
||||
ui.me.querySelector('.fakeme.player').show();
|
||||
ui.create.fakeme();
|
||||
ui.handcards1=player.node.handcards1.animate('start').fix();
|
||||
ui.handcards2=player.node.handcards2.animate('start').fix();
|
||||
ui.handcards1=player.node.handcards1.addTempClass('start').fix();
|
||||
ui.handcards2=player.node.handcards2.addTempClass('start').fix();
|
||||
ui.handcards1Container.appendChild(ui.handcards1);
|
||||
ui.handcards2Container.appendChild(ui.handcards2);
|
||||
ui.updatehl();
|
||||
|
@ -633,7 +633,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
for(var i=ui.chesswidth;i<size;i++){
|
||||
if(!lib.posmap[i.toString()]){
|
||||
var grid=ui.create.div('.player.minskin.playerblank.glow',clickGrid,ui.chess);
|
||||
grid.animate('start');
|
||||
grid.addTempClass('start');
|
||||
ui.placeChess(grid,i);
|
||||
event.playergrids.push(grid);
|
||||
}
|
||||
|
@ -925,7 +925,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
for(var i in lib.tafang.map){
|
||||
createScene(i);
|
||||
}
|
||||
ui.window.appendChild(sceneview.animate('start'));
|
||||
ui.window.appendChild(sceneview.addTempClass('start'));
|
||||
game.pause();
|
||||
});
|
||||
},
|
||||
|
|
|
@ -738,7 +738,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list[game.me.identity+'list'].randomGets(8),'character',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
|
@ -754,7 +754,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
if(lib.character[name][1]!=game.me.identity) return true;
|
||||
});
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
};
|
||||
|
@ -777,7 +777,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
@ -980,7 +980,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
_status.event.dialog.buttons=ui.create.buttons(list[game.me.identity].randomGets(7).concat([event.friendChoice]),'character',buttons);
|
||||
_status.event.dialog.buttons[7].node.name.innerHTML=get.verticalStr('队友选择');
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
|
@ -993,7 +993,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
if(lib.character[name][1]!=game.me.identity) return true;
|
||||
});
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
};
|
||||
|
@ -1016,7 +1016,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
@ -1308,7 +1308,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list.randomGets(7),'characterx',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
|
@ -1319,7 +1319,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
lib.onfree.push(function(){
|
||||
event.dialogxx=ui.create.characterDialog('heightset');
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
});
|
||||
|
@ -1340,7 +1340,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
@ -1499,7 +1499,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list.randomGets(7),'character',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
|
@ -1510,7 +1510,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
lib.onfree.push(function(){
|
||||
event.dialogxx=ui.create.characterDialog('heightset');
|
||||
if(ui.cheat2){
|
||||
ui.cheat2.animate('controlpressdownx',500);
|
||||
ui.cheat2.addTempClass('controlpressdownx',500);
|
||||
ui.cheat2.classList.remove('disabled');
|
||||
}
|
||||
});
|
||||
|
@ -1531,7 +1531,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.addTempClass('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
}
|
||||
|
@ -2184,7 +2184,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var node=_status.event.dialog.buttons[0].parentNode;
|
||||
_status.event.dialog.buttons=ui.create.buttons(list.slice(0,choice),'character',buttons);
|
||||
_status.event.dialog.content.insertBefore(buttons,node);
|
||||
buttons.animate('start');
|
||||
buttons.addTempClass('start');
|
||||
node.remove();
|
||||
|
||||
// event.check();
|
||||
|
@ -2342,7 +2342,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
var buttons=dialog.querySelector('.buttons');
|
||||
var button;
|
||||
for(i=dialog.buttons.length;i<choice;i++){
|
||||
button=ui.create.button(list[i],'character',buttons).animate('zoom')
|
||||
button=ui.create.button(list[i],'character',buttons).addTempClass('zoom')
|
||||
dialog.buttons.push(button);
|
||||
button.style.opacity=1;
|
||||
}
|
||||
|
@ -3787,7 +3787,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
if(_status.dragged) return;
|
||||
if(this.link==game.me){
|
||||
if(!this.classList.contains('buttonclick')){
|
||||
this.animate('buttonclick');
|
||||
this.addTempClass('buttonclick');
|
||||
}
|
||||
}
|
||||
else if(_status.event.player==game.me&&!_status.auto){
|
||||
|
|
|
@ -632,7 +632,7 @@ export class Game extends Uninstantable {
|
|||
if (background.startsWith('db:')) uiBackground.setBackgroundDB(background.slice(3));
|
||||
else if (background.startsWith('ext:')) uiBackground.setBackgroundImage(`extension/${background.slice(4)}`);
|
||||
else if (background == 'default') {
|
||||
uiBackground.animate('start');
|
||||
uiBackground.addTempClass('start');
|
||||
style.backgroundImage = 'none';
|
||||
}
|
||||
else if (background.startsWith('custom_')) {
|
||||
|
@ -2831,14 +2831,14 @@ export class Game extends Uninstantable {
|
|||
boss.setIdentity('zhong');
|
||||
boss.identity = 'zhong';
|
||||
}
|
||||
ui.arena.appendChild(boss.animate('zoominanim'));
|
||||
ui.arena.appendChild(boss.addTempClass('zoominanim'));
|
||||
}
|
||||
},
|
||||
stoneSwap: function (info) {
|
||||
var player = ui.create.player();
|
||||
player.classList.add('noidentity');
|
||||
player.dataset.position = info.position;
|
||||
player.animate(info.me ? 'replaceme' : 'replaceenemy');
|
||||
player.addTempClass(info.me ? 'replaceme' : 'replaceenemy');
|
||||
player.actcount = info.actcount;
|
||||
player.init(info.name, info.name2);
|
||||
game.players.push(player);
|
||||
|
@ -3224,7 +3224,7 @@ export class Game extends Uninstantable {
|
|||
if (player && content) {
|
||||
var judging = get.infoCard(content[0]);
|
||||
if (game.chess) {
|
||||
judging.copy('thrown', 'center', 'thrownhighlight', ui.arena).animate('start');
|
||||
judging.copy('thrown', 'center', 'thrownhighlight', ui.arena).addTempClass('start');
|
||||
}
|
||||
else {
|
||||
player.$throwordered(judging.copy('thrownhighlight'), true);
|
||||
|
@ -3238,7 +3238,7 @@ export class Game extends Uninstantable {
|
|||
}
|
||||
},
|
||||
centernode: function (content) {
|
||||
get.infoCard(content).copy('thrown', 'center', 'thrownhighlight', ui.arena).animate('start');
|
||||
get.infoCard(content).copy('thrown', 'center', 'thrownhighlight', ui.arena).addTempClass('start');
|
||||
},
|
||||
judge2: function (videoId) {
|
||||
for (var i = 0; i < ui.dialogs.length; i++) {
|
||||
|
@ -3374,8 +3374,8 @@ export class Game extends Uninstantable {
|
|||
game.me = player;
|
||||
ui.me.lastChild.show();
|
||||
ui.create.fakeme();
|
||||
ui.handcards1 = player.node.handcards1.animate('start').fix();
|
||||
ui.handcards2 = player.node.handcards2.animate('start').fix();
|
||||
ui.handcards1 = player.node.handcards1.addTempClass('start').fix();
|
||||
ui.handcards2 = player.node.handcards2.addTempClass('start').fix();
|
||||
ui.handcards1Container.appendChild(ui.handcards1);
|
||||
ui.handcards2Container.appendChild(ui.handcards2);
|
||||
ui.updatehl();
|
||||
|
@ -3749,8 +3749,8 @@ export class Game extends Uninstantable {
|
|||
game.me.node.handcards1.remove();
|
||||
game.me.node.handcards2.remove();
|
||||
|
||||
ui.handcards1 = player.node.handcards1.animate('start').fix();
|
||||
ui.handcards2 = player.node.handcards2.animate('start').fix();
|
||||
ui.handcards1 = player.node.handcards1.addTempClass('start').fix();
|
||||
ui.handcards2 = player.node.handcards2.addTempClass('start').fix();
|
||||
ui.handcards1Container.insertBefore(ui.handcards1, ui.handcards1Container.firstChild);
|
||||
ui.handcards2Container.insertBefore(ui.handcards2, ui.handcards2Container.firstChild);
|
||||
|
||||
|
@ -3786,8 +3786,8 @@ export class Game extends Uninstantable {
|
|||
game.me.node.handcards1.remove();
|
||||
game.me.node.handcards2.remove();
|
||||
game.me = player;
|
||||
ui.handcards1 = player.node.handcards1.animate('start').fix();
|
||||
ui.handcards2 = player.node.handcards2.animate('start').fix();
|
||||
ui.handcards1 = player.node.handcards1.addTempClass('start').fix();
|
||||
ui.handcards2 = player.node.handcards2.addTempClass('start').fix();
|
||||
ui.handcards1Container.appendChild(ui.handcards1);
|
||||
ui.handcards2Container.appendChild(ui.handcards2);
|
||||
|
||||
|
@ -6618,8 +6618,8 @@ export class Game extends Uninstantable {
|
|||
if (current.isDead()) {
|
||||
current.$die();
|
||||
}
|
||||
ui.handcards1 = player.node.handcards1.animate('start').fix();
|
||||
ui.handcards2 = player.node.handcards2.animate('start').fix();
|
||||
ui.handcards1 = player.node.handcards1.addTempClass('start').fix();
|
||||
ui.handcards2 = player.node.handcards2.addTempClass('start').fix();
|
||||
ui.handcards1Container.appendChild(ui.handcards1);
|
||||
ui.handcards2Container.appendChild(ui.handcards2);
|
||||
|
||||
|
@ -6664,8 +6664,8 @@ export class Game extends Uninstantable {
|
|||
game.me.node.handcards2.remove();
|
||||
|
||||
game.me = player;
|
||||
ui.handcards1 = player.node.handcards1.animate('start').fix();
|
||||
ui.handcards2 = player.node.handcards2.animate('start').fix();
|
||||
ui.handcards1 = player.node.handcards1.addTempClass('start').fix();
|
||||
ui.handcards2 = player.node.handcards2.addTempClass('start').fix();
|
||||
ui.handcards1Container.insertBefore(ui.handcards1, ui.handcards1Container.firstChild);
|
||||
ui.handcards2Container.insertBefore(ui.handcards2, ui.handcards2Container.firstChild);
|
||||
ui.updatehl();
|
||||
|
@ -7340,7 +7340,7 @@ export class Game extends Uninstantable {
|
|||
event.avatars[i].nodename = ui.create.div('.name', event.avatars[i], get.slimName(name));
|
||||
event.avatars[i].nodename.style.fontFamily = lib.config.name_font;
|
||||
event.avatars[i].index = i + event.config.width;
|
||||
event.avatars[i].animate('start');
|
||||
event.avatars[i].addTempClass('start');
|
||||
event.nodes[event.avatars[i].index].style.display = 'none';
|
||||
event.avatars[i].nodename.dataset.nature = get.groupnature(lib.character[name][1]);
|
||||
lib.setIntro(event.avatars[i]);
|
||||
|
@ -8431,7 +8431,7 @@ export class Game extends Uninstantable {
|
|||
players.forEach(value => {
|
||||
if (parseInt(value.dataset.position) >= position) value.dataset.position = parseInt(value.dataset.position) + 1;
|
||||
});
|
||||
const player = ui.create.player(ui.arena).animate('start');
|
||||
const player = ui.create.player(ui.arena).addTempClass('start');
|
||||
if (character) player.init(character, character2);
|
||||
game.players.push(player);
|
||||
player.dataset.position = position;
|
||||
|
@ -8445,7 +8445,7 @@ export class Game extends Uninstantable {
|
|||
*/
|
||||
static addFellow(position, character, animation) {
|
||||
game.addVideo('addFellow', null, [position, character, animation]);
|
||||
const player = ui.create.player(ui.arena).animate(animation || 'start');
|
||||
const player = ui.create.player(ui.arena).addTempClass(animation || 'start');
|
||||
player.dataset.position = position || game.players.length + game.dead.length;
|
||||
player.getId();
|
||||
if (character) player.init(character);
|
||||
|
@ -8479,7 +8479,7 @@ export class Game extends Uninstantable {
|
|||
game.players.push(player);
|
||||
delete player.removed;
|
||||
player.removeAttribute('style');
|
||||
player.animate('start');
|
||||
player.addTempClass('start');
|
||||
ui.arena.appendChild(player);
|
||||
game.arrangePlayers();
|
||||
return player;
|
||||
|
@ -8527,7 +8527,7 @@ export class Game extends Uninstantable {
|
|||
game.players.remove(player);
|
||||
game.dead.remove(player);
|
||||
player.delete();
|
||||
const player2 = ui.create.player(ui.arena).animate('start');
|
||||
const player2 = ui.create.player(ui.arena).addTempClass('start');
|
||||
if (character) player2.init(character, character2);
|
||||
game.players.push(player2);
|
||||
player2.dataset.position = position;
|
||||
|
|
|
@ -5,22 +5,22 @@ import { Game as game } from '../game/index.js';
|
|||
import { status as _status } from '../status/index.js';
|
||||
import { UI as ui } from '../ui/index.js';
|
||||
|
||||
HTMLDivElement.prototype.animate = function (name, time) {
|
||||
// 兼容原先的Div.animate
|
||||
if (Array.isArray(name) || get.objtype(name) == 'object') {
|
||||
return Element.prototype.animate.call(this, name, time);
|
||||
}
|
||||
var that;
|
||||
if (get.is.mobileMe(this) && name == 'target') {
|
||||
that = ui.mebg;
|
||||
}
|
||||
else {
|
||||
that = this;
|
||||
// 废弃覆盖原型的HTMLDivElement.prototype.animate
|
||||
// 改为HTMLDivElement.prototype.addTempClass
|
||||
HTMLDivElement.prototype.animate = function (keyframes, options) {
|
||||
if (typeof keyframes == 'string') {
|
||||
console.warn(this, '无名杀开发者修改的animate方法已废弃,请改为使用addTempClass方法');
|
||||
return HTMLDivElement.prototype.addTempClass.call(this, keyframes, options);
|
||||
}
|
||||
else return HTMLElement.prototype.animate.call(this, keyframes, options);
|
||||
};
|
||||
|
||||
HTMLDivElement.prototype.addTempClass = function (name, time = 1000) {
|
||||
let that = get.is.mobileMe(this) && name == 'target' ? ui.mebg : this;
|
||||
that.classList.add(name);
|
||||
setTimeout(function () {
|
||||
setTimeout(() => {
|
||||
that.classList.remove(name);
|
||||
}, time || 1000);
|
||||
}, time);
|
||||
return this;
|
||||
};
|
||||
HTMLDivElement.prototype.hide = function () {
|
||||
|
|
|
@ -3036,7 +3036,7 @@ export const Content = {
|
|||
}
|
||||
}
|
||||
else {
|
||||
ui.control.animate('nozoom', 100);
|
||||
ui.control.addTempClass('nozoom', 100);
|
||||
event._aiexclude.add(event.buttoned);
|
||||
}
|
||||
event.goto(0);
|
||||
|
@ -3230,7 +3230,7 @@ export const Content = {
|
|||
}
|
||||
}
|
||||
else {
|
||||
ui.control.animate('nozoom', 100);
|
||||
ui.control.addTempClass('nozoom', 100);
|
||||
event._aiexclude.add(event.buttoned);
|
||||
}
|
||||
event.goto(0);
|
||||
|
@ -3834,7 +3834,7 @@ export const Content = {
|
|||
event.cardlist.forEach((card, index) => {
|
||||
game.log(targets[index], '的拼点牌为', card);
|
||||
});
|
||||
player.animate('target');
|
||||
player.addTempClass('target');
|
||||
game.delay(0, 1000);
|
||||
'step 5';
|
||||
event.target = null;
|
||||
|
@ -3842,7 +3842,7 @@ export const Content = {
|
|||
'step 6';
|
||||
if (event.iwhile < targets.length) {
|
||||
event.target = targets[event.iwhile];
|
||||
event.target.animate('target');
|
||||
event.target.addTempClass('target');
|
||||
event.card2 = event.cardlist[event.iwhile];
|
||||
event.num2 = event.getNum(event.card2);
|
||||
//event.tempplayer.line(event.target);
|
||||
|
@ -3996,8 +3996,8 @@ export const Content = {
|
|||
"step 5";
|
||||
if (event.iwhile < targets.length) {
|
||||
event.target = targets[event.iwhile];
|
||||
event.target.animate('target');
|
||||
player.animate('target');
|
||||
event.target.addTempClass('target');
|
||||
player.addTempClass('target');
|
||||
event.card2 = event.cardlist[event.iwhile];
|
||||
event.num2 = event.getNum(event.card2);
|
||||
game.log(event.target, '的拼点牌为', event.card2);
|
||||
|
@ -4746,7 +4746,7 @@ export const Content = {
|
|||
}
|
||||
if (event.result.bool && event.animate !== false) {
|
||||
for (var i = 0; i < event.result.targets.length; i++) {
|
||||
event.result.targets[i].animate('target');
|
||||
event.result.targets[i].addTempClass('target');
|
||||
}
|
||||
}
|
||||
if (event.dialog) event.dialog.close();
|
||||
|
@ -4806,7 +4806,7 @@ export const Content = {
|
|||
event.resume();
|
||||
if (event.result.bool && event.animate !== false) {
|
||||
for (var i = 0; i < event.result.targets.length; i++) {
|
||||
event.result.targets[i].animate('target');
|
||||
event.result.targets[i].addTempClass('target');
|
||||
}
|
||||
}
|
||||
if (event.dialog) event.dialog.close();
|
||||
|
@ -6105,12 +6105,12 @@ export const Content = {
|
|||
targets.sortBySeat((_status.currentPhase || player));
|
||||
}
|
||||
if (animate) for (var i = 0; i < targets.length; i++) {
|
||||
targets[i].animate('target');
|
||||
targets[i].addTempClass('target');
|
||||
}
|
||||
}
|
||||
else if (animate) {
|
||||
for (var i = 0; i < targets.length; i++) {
|
||||
targets[i].animate('target');
|
||||
targets[i].addTempClass('target');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6329,10 +6329,10 @@ export const Content = {
|
|||
if (next.target && !info.multitarget) {
|
||||
if (num == 0 && targets.length > 1) {
|
||||
// var ttt=next.target;
|
||||
// setTimeout(function(){ttt.animate('target');},0.5*lib.config.duration);
|
||||
// setTimeout(function(){ttt.addTempClass('target');},0.5*lib.config.duration);
|
||||
}
|
||||
else {
|
||||
next.target.animate('target');
|
||||
next.target.addTempClass('target');
|
||||
}
|
||||
}
|
||||
if (!info.nodelay && num > 0) {
|
||||
|
@ -6608,7 +6608,7 @@ export const Content = {
|
|||
delete lib.tempSortSeat;
|
||||
}
|
||||
for (var i = 0; i < targets.length; i++) {
|
||||
targets[i].animate('target');
|
||||
targets[i].addTempClass('target');
|
||||
}
|
||||
}
|
||||
next.target = targets[num];
|
||||
|
@ -6617,10 +6617,10 @@ export const Content = {
|
|||
if (next.target && !info.multitarget) {
|
||||
if (num == 0 && targets.length > 1) {
|
||||
// var ttt=next.target;
|
||||
// setTimeout(function(){ttt.animate('target');},0.5*lib.config.duration);
|
||||
// setTimeout(function(){ttt.addTempClass('target');},0.5*lib.config.duration);
|
||||
}
|
||||
else {
|
||||
next.target.animate('target');
|
||||
next.target.addTempClass('target');
|
||||
}
|
||||
}
|
||||
if (num == 0) {
|
||||
|
@ -8131,7 +8131,7 @@ export const Content = {
|
|||
event = _status.event;
|
||||
}
|
||||
if (game.chess) {
|
||||
event.node = card.copy('thrown', 'center', ui.arena).animate('start');
|
||||
event.node = card.copy('thrown', 'center', ui.arena).addTempClass('start');
|
||||
}
|
||||
else {
|
||||
event.node = player.$throwordered(card.copy(), true);
|
||||
|
|
|
@ -28,10 +28,10 @@ export class Control extends HTMLDivElement {
|
|||
else control.add(argument);
|
||||
});
|
||||
ui.controls.unshift(control);
|
||||
if (nc) ui.control.animate('nozoom', 100);
|
||||
if (nc) ui.control.addTempClass('nozoom', 100);
|
||||
if (control.childNodes.length) {
|
||||
control.style.transition = 'opacity 0.5s';
|
||||
control.animate('controlpressdownx', 500);
|
||||
control.addTempClass('controlpressdownx', 500);
|
||||
ui.refresh(control);
|
||||
if (!control.stayleft) control.style.transform = `translateX(-${control.offsetWidth / 2}px)`;
|
||||
control.style.opacity = 1;
|
||||
|
@ -68,7 +68,7 @@ export class Control extends HTMLDivElement {
|
|||
this.style.transition = '';
|
||||
}
|
||||
else {
|
||||
this.animate('controlpressdownx', 500);
|
||||
this.addTempClass('controlpressdownx', 500);
|
||||
}
|
||||
ui.updatec();
|
||||
return this;
|
||||
|
@ -81,7 +81,7 @@ export class Control extends HTMLDivElement {
|
|||
node.addEventListener(lib.config.touchscreen ? 'touchend' : 'click', ui.click.control);
|
||||
}
|
||||
close() {
|
||||
this.animate('controlpressdownx', 500);
|
||||
this.addTempClass('controlpressdownx', 500);
|
||||
|
||||
ui.controls.remove(this);
|
||||
this.delete();
|
||||
|
@ -95,7 +95,7 @@ export class Control extends HTMLDivElement {
|
|||
if (ui.skills3 == this) delete ui.skills3;
|
||||
}
|
||||
replace() {
|
||||
// this.animate('controlpressdownx',500);
|
||||
// this.addTempClass('controlpressdownx',500);
|
||||
if (this.replaceTransition === false) {
|
||||
this.style.transitionProperty = 'none';
|
||||
ui.refresh(this);
|
||||
|
|
|
@ -3680,7 +3680,7 @@ export class Library extends Uninstantable {
|
|||
right: '靠右',
|
||||
},
|
||||
onclick: function (bool) {
|
||||
if (lib.config.show_history == 'right') ui.window.animate('rightbar2');
|
||||
if (lib.config.show_history == 'right') ui.window.addTempClass('rightbar2');
|
||||
game.saveConfig('show_history', bool);
|
||||
if (_status.video || !_status.prepareArena) return;
|
||||
if (bool == 'left') {
|
||||
|
@ -12444,7 +12444,7 @@ export class Library extends Uninstantable {
|
|||
var pos = state.players[observe || game.onlineID].position;
|
||||
for (var i in state.players) {
|
||||
var info = state.players[i];
|
||||
var player = ui.create.player(ui.arena).animate('start');
|
||||
var player = ui.create.player(ui.arena).addTempClass('start');
|
||||
player.dataset.position = (info.position < pos) ? info.position - pos + parseInt(state.number) : info.position - pos;
|
||||
if (i == observe || i == game.onlineID) {
|
||||
game.me = player;
|
||||
|
|
|
@ -9295,7 +9295,7 @@ class Create extends Uninstantable {
|
|||
if (!lib.config.show_replay) {
|
||||
ui.replay.style.display = 'none';
|
||||
}
|
||||
ui.control = ui.create.div('#control', ui.arena).animate('nozoom');
|
||||
ui.control = ui.create.div('#control', ui.arena).addTempClass('nozoom');
|
||||
ui.cardPile = ui.create.div('#cardPile');
|
||||
ui.discardPile = ui.create.div('#discardPile');
|
||||
ui.special = ui.create.div('#special');
|
||||
|
@ -9504,7 +9504,7 @@ class Create extends Uninstantable {
|
|||
_status.auto = true;
|
||||
ui.auto.classList.add('glow');
|
||||
setTimeout(function () {
|
||||
var node = ui.create.pause().animate('start');
|
||||
var node = ui.create.pause().addTempClass('start');
|
||||
node.appendChild(ui.sidebar);
|
||||
node.firstChild.innerHTML = '正在测试';
|
||||
node.removeEventListener('click', ui.click.resume);
|
||||
|
@ -9985,7 +9985,7 @@ class Create extends Uninstantable {
|
|||
}
|
||||
if (!numberOfPlayers) numberOfPlayers = 5;
|
||||
for (let ordinal = 0; ordinal < numberOfPlayers; ordinal++) {
|
||||
const player = ui.create.player().animate('start');
|
||||
const player = ui.create.player().addTempClass('start');
|
||||
game.players.push(player);
|
||||
player.dataset.position = ordinal;
|
||||
}
|
||||
|
@ -10010,7 +10010,7 @@ class Create extends Uninstantable {
|
|||
}
|
||||
static me(hasme) {
|
||||
ui.mebg = ui.create.div('#mebg', ui.arena);
|
||||
ui.me = ui.create.div('#me', ui.arena).animate('start');
|
||||
ui.me = ui.create.div('#me', ui.arena).addTempClass('start');
|
||||
ui.handcards1Container = ui.create.div('#handcards1', ui.me);
|
||||
ui.handcards2Container = ui.create.div('#handcards2', ui.me);
|
||||
ui.arena.classList.remove('nome');
|
||||
|
@ -12527,7 +12527,7 @@ class Click extends Uninstantable {
|
|||
_status.clicked = true;
|
||||
_status.tempunpop = true;
|
||||
this.previousSibling.hide();
|
||||
var node = ui.create.div('.switcher', this.parentNode).animate('start');
|
||||
var node = ui.create.div('.switcher', this.parentNode).addTempClass('start');
|
||||
for (var i = 0; i < this.choice.length; i++) {
|
||||
var choice = ui.create.div('.pointerdiv', node);
|
||||
choice.innerHTML = get.translation(this.choice[i]);
|
||||
|
@ -13020,7 +13020,7 @@ class Click extends Uninstantable {
|
|||
if (_status.event.type == 'phase' && ui.confirm) {
|
||||
ui.confirm.classList.add('removing');
|
||||
}
|
||||
// ui.control.animate('nozoom',100);
|
||||
// ui.control.addTempClass('nozoom',100);
|
||||
event.restore();
|
||||
var cards = event.player.getCards('hej');
|
||||
for (var i = 0; i < cards.length; i++) {
|
||||
|
@ -13801,7 +13801,7 @@ class Click extends Uninstantable {
|
|||
game.pause2();
|
||||
var node = ui.create.pause();
|
||||
if (!node) return;
|
||||
node.animate('start');
|
||||
node.addTempClass('start');
|
||||
ui.sidebar3.innerHTML = '';
|
||||
if (lib.config.show_discardpile) {
|
||||
for (var i = 0; i < ui.discardPile.childNodes.length; i++) {
|
||||
|
@ -14141,7 +14141,7 @@ export class UI extends Uninstantable {
|
|||
stayleft._offset += stayleft.currentLeft;
|
||||
|
||||
if (current_offset != stayleft._offset) {
|
||||
stayleft.animate('controlpressdownx', 500);
|
||||
stayleft.addTempClass('controlpressdownx', 500);
|
||||
stayleft.style.transform = 'translateX(' + stayleft._offset + 'px)';
|
||||
}
|
||||
}
|
||||
|
@ -14159,7 +14159,7 @@ export class UI extends Uninstantable {
|
|||
if (minoffset > offset) offset = minoffset;
|
||||
var control = controls.shift();
|
||||
if (control._offset != offset) {
|
||||
control.animate('controlpressdownx', 500);
|
||||
control.addTempClass('controlpressdownx', 500);
|
||||
control.style.transform = 'translateX(' + offset + 'px)';
|
||||
control._offset = offset;
|
||||
}
|
||||
|
@ -14171,7 +14171,7 @@ export class UI extends Uninstantable {
|
|||
offset += 6;
|
||||
}
|
||||
if (control._offset != offset) {
|
||||
control.animate('controlpressdownx', 500);
|
||||
control.addTempClass('controlpressdownx', 500);
|
||||
control.style.transform = 'translateX(' + offset + 'px)';
|
||||
control._offset = offset;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue