废弃HTMLDivElement.prototype.animate,改为使用HTMLDivElement.prototype.addTempClass

This commit is contained in:
shijian 2023-12-30 17:08:40 +08:00
parent e235809703
commit 66c8c6cba9
24 changed files with 155 additions and 155 deletions

View File

@ -520,7 +520,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}); });
player.line(list1); player.line(list1);
for(var i=0;i<list1.length;i++){ for(var i=0;i<list1.length;i++){
list1[i].animate('target'); list1[i].addTempClass('target');
} }
setTimeout(function(){ setTimeout(function(){
var list11=list1.slice(0); var list11=list1.slice(0);

View File

@ -3391,10 +3391,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]); game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]);
for(var i=0;i<event.cards.length;i++) event.cards[i].discard(); 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; var node;
if(game.chess){ if(game.chess){
node=card.copy('thrown','center',ui.arena).animate('start'); node=card.copy('thrown','center',ui.arena).addTempClass('start');
} }
else{ else{
node=player.$throwordered(card.copy(),true); node=player.$throwordered(card.copy(),true);

View File

@ -3677,7 +3677,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 7" "step 7"
if(event.iwhile<targets.length){ if(event.iwhile<targets.length){
event.target=targets[event.iwhile]; event.target=targets[event.iwhile];
event.target.animate('target'); event.target.addTempClass('target');
event.card2=event.cardlist[event.iwhile]; event.card2=event.cardlist[event.iwhile];
event.num2=event.getNum(event.card2); event.num2=event.getNum(event.card2);
game.log(event.target,'的拼点牌为',event.card2); game.log(event.target,'的拼点牌为',event.card2);

View File

@ -4911,7 +4911,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.addSkill('xunbao2'); player.addSkill('xunbao2');
game.delay(2); 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'); ui.arena.classList.add('thrownhighlight');
game.addVideo('thrownhighlight1'); game.addVideo('thrownhighlight1');
game.addVideo('centernode',null,get.cardInfo(event.card)); game.addVideo('centernode',null,get.cardInfo(event.card));
@ -8629,7 +8629,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
if(event.list.length){ if(event.list.length){
event.current=event.list.shift(); event.current=event.list.shift();
event.current.animate('target'); event.current.addTempClass('target');
var next=event.current.chooseToRespond({name:'sha'}); var next=event.current.chooseToRespond({name:'sha'});
next.ai=function(card){ next.ai=function(card){
if(get.damageEffect(event.current,player,event.current,'thunder')>=0) return 0; if(get.damageEffect(event.current,player,event.current,'thunder')>=0) return 0;

View File

@ -6779,7 +6779,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 1" "step 1"
if(event.players.length){ if(event.players.length){
event.current=event.players.shift(); event.current=event.players.shift();
event.current.animate('target'); event.current.addTempClass('target');
player.line(event.current,'green'); player.line(event.current,'green');
if(event.current.countCards('he')&&target.isIn()){ if(event.current.countCards('he')&&target.isIn()){
event.current.chooseToDiscard({subtype:'equip1'},'he','弃置一张武器牌或让'+ event.current.chooseToDiscard({subtype:'equip1'},'he','弃置一张武器牌或让'+
@ -8790,7 +8790,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event=_status.event; event=_status.event;
} }
if(game.chess){ if(game.chess){
event.node=card.copy('thrown','center',ui.arena).animate('start'); event.node=card.copy('thrown','center',ui.arena).addTempClass('start');
} }
else{ else{
event.node=player.$throwordered(card.copy(),true); 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]; event.card=get.cards()[0];
game.broadcast(function(card){ game.broadcast(function(card){
ui.arena.classList.add('thrownhighlight'); 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.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'); ui.arena.classList.add('thrownhighlight');
game.addVideo('thrownhighlight1'); game.addVideo('thrownhighlight1');
game.addVideo('centernode',null,get.cardInfo(event.card)); game.addVideo('centernode',null,get.cardInfo(event.card));

View File

@ -5278,7 +5278,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.currented=[]; event.currented=[];
"step 1" "step 1"
event.currented.push(event.current); event.currented.push(event.current);
event.current.animate('target'); event.current.addTempClass('target');
event.current.chooseToUse('乱武使用一张杀或失去1点体力',function(card){ event.current.chooseToUse('乱武使用一张杀或失去1点体力',function(card){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.cardEnabled.apply(this,arguments) return lib.filter.cardEnabled.apply(this,arguments)

View File

@ -3333,7 +3333,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event=_status.event; event=_status.event;
} }
if(game.chess){ if(game.chess){
event.node=card.copy('thrown','center',ui.arena).animate('start'); event.node=card.copy('thrown','center',ui.arena).addTempClass('start');
} }
else{ else{
event.node=player.$throwordered(card.copy(),true); event.node=player.$throwordered(card.copy(),true);

View File

@ -5472,7 +5472,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
if(event.players.length){ if(event.players.length){
event.current=event.players.shift(); event.current=event.players.shift();
event.current.animate('target'); event.current.addTempClass('target');
player.line(event.current,'green'); player.line(event.current,'green');
if(!event.current.countCards('he')||!target.isIn()) event._result={bool:false}; if(!event.current.countCards('he')||!target.isIn()) event._result={bool:false};
else{ else{

View File

@ -9792,7 +9792,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 1" "step 1"
if(event.players.length){ if(event.players.length){
event.current=event.players.shift(); event.current=event.players.shift();
event.current.animate('target'); event.current.addTempClass('target');
player.line(event.current,'green'); player.line(event.current,'green');
if(event.current.countCards('he')&&target.isIn()){ if(event.current.countCards('he')&&target.isIn()){
event.current.chooseToDiscard({subtype:'equip1'},'he','弃置一张武器牌或让'+ event.current.chooseToDiscard({subtype:'equip1'},'he','弃置一张武器牌或让'+

View File

@ -226,14 +226,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
boss.side=true; boss.side=true;
if(!event.noslide){ if(!event.noslide){
var rect=event.current.getBoundingClientRect(); var rect=event.current.getBoundingClientRect();
boss.animate('bossing'); boss.addTempClass('bossing');
boss.node.hp.animate('start'); boss.node.hp.addTempClass('start');
boss.bossinginfo=[rect.left+rect.width/2,rect.top+rect.height/2]; boss.bossinginfo=[rect.left+rect.width/2,rect.top+rect.height/2];
boss.style.transition='all 0s'; boss.style.transition='all 0s';
boss.node.equips.style.opacity='0'; boss.node.equips.style.opacity='0';
} }
else{ else{
boss.animate('start'); boss.addTempClass('start');
} }
boss.setIdentity('zhu'); boss.setIdentity('zhu');
boss.identity='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++){ for(var i=0;i<result.links.length;i++){
var player=ui.create.player(); var player=ui.create.player();
player.getId(); player.getId();
player.init(result.links[i]).animate('start'); player.init(result.links[i]).addTempClass('start');
player.setIdentity('cai'); player.setIdentity('cai');
player.identity='cai'; player.identity='cai';
player.side=false; player.side=false;
@ -279,12 +279,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
player.getId(); player.getId();
player.init(game.bossinfo.minion[i]); player.init(game.bossinfo.minion[i]);
if(boss.bossinginfo){ if(boss.bossinginfo){
player.animate('bossing'); player.addTempClass('bossing');
player.node.hp.animate('start'); player.node.hp.addTempClass('start');
player.style.transition='all 0s'; player.style.transition='all 0s';
} }
else{ else{
player.animate('start'); player.addTempClass('start');
} }
player.setIdentity('zhong'); player.setIdentity('zhong');
player.identity='zhong'; player.identity='zhong';
@ -974,7 +974,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(game.me==player){ if(game.me==player){
game.swapControl(boss); game.swapControl(boss);
} }
game.players.push(boss.animate('zoominanim')); game.players.push(boss.addTempClass('zoominanim'));
game.arrangePlayers(); game.arrangePlayers();
if(!game.boss){ if(!game.boss){
game.boss=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 sort=lib.config.sort_card(card);
var position=sort>0?player.node.handcards1:player.node.handcards2; var position=sort>0?player.node.handcards1:player.node.handcards2;
card.fix(); card.fix();
card.animate('start'); card.addTempClass('start');
position.insertBefore(card,position.firstChild); position.insertBefore(card,position.firstChild);
} }
player.update(); player.update();
@ -1184,7 +1184,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var node=_status.event.dialog.buttons[0].parentNode; var node=_status.event.dialog.buttons[0].parentNode;
_status.event.dialog.buttons=ui.create.buttons(list.slice(0,20),'character',buttons); _status.event.dialog.buttons=ui.create.buttons(list.slice(0,20),'character',buttons);
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); 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('withbg');
event.dialogxx.classList.add('fixed'); event.dialogxx.classList.add('fixed');
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
}; };
@ -1225,11 +1225,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); ui.cheat.classList.remove('disabled');
} }
if(_status.bosschoice){ if(_status.bosschoice){
_status.bosschoice.animate('controlpressdownx',500); _status.bosschoice.addTempClass('controlpressdownx',500);
_status.bosschoice.classList.remove('disabled'); _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]); game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]);
for(var i=0;i<event.cards.length;i++) event.cards[i].discard(); 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; var node;
if(game.chess){ if(game.chess){
node=card.copy('thrown','center',ui.arena).animate('start'); node=card.copy('thrown','center',ui.arena).addTempClass('start');
} }
else{ else{
node=player.$throwordered(card.copy(),true); node=player.$throwordered(card.copy(),true);

View File

@ -1381,8 +1381,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
this.showcaseinterval=setInterval(function(){ this.showcaseinterval=setInterval(function(){
var dx,dy var dx,dy
if(num2%5==0){ if(num2%5==0){
// player.animate('target'); // player.addTempClass('target');
// player.animate('zoomin'); // player.addTempClass('zoomin');
player.classList.add('zoomin3'); player.classList.add('zoomin3');
player.hide(); player.hide();
player.style.transitionDuration='0.7s' 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; var node=_status.event.dialog.buttons[0].parentNode;
_status.event.dialog.buttons=ui.create.buttons(list,'character',buttons); _status.event.dialog.buttons=ui.create.buttons(list,'character',buttons);
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
game.check(); game.check();
@ -2966,7 +2966,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
lib.onfree.push(function(){ lib.onfree.push(function(){
event.dialogxx=ui.create.characterDialog('heightset'); event.dialogxx=ui.create.characterDialog('heightset');
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
}); });
@ -2988,7 +2988,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); ui.cheat.classList.remove('disabled');
} }
} }

View File

@ -213,7 +213,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
_status.enemyCount=_status.enemylist.length; _status.enemyCount=_status.enemylist.length;
_status.friendCount=_status.mylist.length; _status.friendCount=_status.mylist.length;
while(_status.mylist.length){ while(_status.mylist.length){
friend=ui.create.player().animate('start'); friend=ui.create.player().addTempClass('start');
friend.getId(); friend.getId();
if(!event.friendZhu){ if(!event.friendZhu){
event.friendZhu=friend; event.friendZhu=friend;
@ -244,7 +244,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
lib.posmap[friend.dataset.position]=friend; lib.posmap[friend.dataset.position]=friend;
} }
while(_status.enemylist.length){ while(_status.enemylist.length){
enemy=ui.create.player().animate('start'); enemy=ui.create.player().addTempClass('start');
enemy.getId(); enemy.getId();
enemy.init(_status.enemylist.shift()); enemy.init(_status.enemylist.shift());
enemy.side=!side; enemy.side=!side;
@ -1082,7 +1082,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
$phaseJudge:function(card){ $phaseJudge:function(card){
game.addVideo('phaseJudge',this,get.cardInfo(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; var player=this;
clone.style.opacity=0.6; clone.style.opacity=0.6;
clone.style.left=(Math.random()*100-50+ui.chessContainer.chessLeft+ui.chessContainer.offsetWidth/2-52)+'px'; 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(); var player=ui.create.player();
player.getId(); player.getId();
if(enemy=='treasure'){ if(enemy=='treasure'){
player.animate('judgestart'); player.addTempClass('judgestart');
player.side=null; player.side=null;
player.identity='neutral'; player.identity='neutral';
player.setIdentity(); player.setIdentity();
@ -1534,7 +1534,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.treasures.add(player); game.treasures.add(player);
} }
else{ else{
player.animate('start'); player.addTempClass('start');
if(enemy){ if(enemy){
if(get.mode()=='tafang'){ if(get.mode()=='tafang'){
player.side=true; player.side=true;
@ -1634,7 +1634,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
pos=y*ui.chesswidth+x; pos=y*ui.chesswidth+x;
} }
if(!lib.posmap[pos]){ 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); ui.placeChess(grid,pos);
grid.listen(ui.click.obstacle); grid.listen(ui.click.obstacle);
lib.posmap[pos]=grid; 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; ui.money.childNodes[1].innerHTML=game.data.dust;
game.changeMoney(-100); game.changeMoney(-100);
if(game.data.character.length>3&&selected.character.length){ if(game.data.character.length>3&&selected.character.length){
event.removeCharacter.animate('controlpressdownx',500); event.removeCharacter.addTempClass('controlpressdownx',500);
event.removeCharacter.classList.remove('disabled'); event.removeCharacter.classList.remove('disabled');
} }
if(game.data.money<150&&!game.data._arena){ if(game.data.money<150&&!game.data._arena){
event.enterArena.classList.add('disabled'); event.enterArena.classList.add('disabled');
} }
else{ else{
event.enterArena.animate('controlpressdownx',500); event.enterArena.addTempClass('controlpressdownx',500);
event.enterArena.classList.remove('disabled'); event.enterArena.classList.remove('disabled');
} }
if(game.data.money<100){ if(game.data.money<100){
event.addCharacter.classList.add('disabled'); event.addCharacter.classList.add('disabled');
} }
else{ else{
event.addCharacter.animate('controlpressdownx',500); event.addCharacter.addTempClass('controlpressdownx',500);
event.addCharacter.classList.remove('disabled'); event.addCharacter.classList.remove('disabled');
} }
initcapt(); initcapt();
@ -2713,11 +2713,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.data.character.remove(node.link); game.data.character.remove(node.link);
game.saveData(); game.saveData();
if(game.data.money>=100){ if(game.data.money>=100){
event.addCharacter.animate('controlpressdownx',500); event.addCharacter.addTempClass('controlpressdownx',500);
event.addCharacter.classList.remove('disabled'); event.addCharacter.classList.remove('disabled');
} }
if(game.data.money>=150){ if(game.data.money>=150){
event.enterArena.animate('controlpressdownx',500); event.enterArena.addTempClass('controlpressdownx',500);
event.enterArena.classList.remove('disabled'); event.enterArena.classList.remove('disabled');
} }
node.delete(); 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){ if(selected.character.length&&game.data.character.length>3){
event.removeCharacter.animate('controlpressdownx',500); event.removeCharacter.addTempClass('controlpressdownx',500);
event.removeCharacter.classList.remove('disabled'); event.removeCharacter.classList.remove('disabled');
} }
else{ else{
@ -2990,14 +2990,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
_status.qianfan=false; _status.qianfan=false;
event.removeCharacter.replace('遣返',qianfan); event.removeCharacter.replace('遣返',qianfan);
if(game.data.money>=100){ if(game.data.money>=100){
event.addCharacter.animate('controlpressdownx',500); event.addCharacter.addTempClass('controlpressdownx',500);
event.addCharacter.classList.remove('disabled'); event.addCharacter.classList.remove('disabled');
} }
else{ else{
event.addCharacter.classList.add('disabled'); event.addCharacter.classList.add('disabled');
} }
if(game.data.money>=150||game.data._arena){ if(game.data.money>=150||game.data._arena){
event.enterArena.animate('controlpressdownx',500); event.enterArena.addTempClass('controlpressdownx',500);
event.enterArena.classList.remove('disabled'); event.enterArena.classList.remove('disabled');
} }
else{ else{
@ -3885,7 +3885,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
else if(dialog.buttons.length<num){ else if(dialog.buttons.length<num){
for(var i=dialog.buttons.length;i<num;i++){ 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(); game.check();
} }
@ -3905,7 +3905,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var node=_status.event.dialog.buttons[0].parentNode; 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.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); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
// _status.event.dialog.close(); // _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('fullheight');
event.dialogxx.classList.add('fixed'); event.dialogxx.classList.add('fixed');
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
}; };
@ -3963,7 +3963,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); ui.cheat.classList.remove('disabled');
} }
} }
@ -5869,7 +5869,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.pause(); game.pause();
_status.imchoosing=true; _status.imchoosing=true;
for(var i=0;i<event.grids.length;i++){ for(var i=0;i<event.grids.length;i++){
event.grids[i].animate('start'); event.grids[i].addTempClass('start');
} }
event.dialog=ui.create.dialog('选择一个位置放置障碍'); event.dialog=ui.create.dialog('选择一个位置放置障碍');
} }

View File

@ -792,7 +792,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var node=dialog.buttons[0].parentNode; var node=dialog.buttons[0].parentNode;
dialog.buttons=ui.create.buttons(list,'characterx',buttons); dialog.buttons=ui.create.buttons(list,'characterx',buttons);
dialog.content.insertBefore(buttons,node); dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
game.check(); game.check();
@ -972,7 +972,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var node=_status.event.dialog.buttons[0].parentNode; var node=_status.event.dialog.buttons[0].parentNode;
_status.event.dialog.buttons=ui.create.buttons(list,'characterx',buttons); _status.event.dialog.buttons=ui.create.buttons(list,'characterx',buttons);
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
game.check(); game.check();
@ -983,7 +983,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
lib.onfree.push(function(){ lib.onfree.push(function(){
event.dialogxx=ui.create.characterDialog('heightset'); event.dialogxx=ui.create.characterDialog('heightset');
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
}); });
@ -1005,7 +1005,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); ui.cheat.classList.remove('disabled');
} }
} }

View File

@ -4514,7 +4514,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var target=targets.shift(); var target=targets.shift();
event.target=target; event.target=target;
if(target.isIn()){ if(target.isIn()){
target.animate('target'); target.addTempClass('target');
target.chooseCard('h',num,'将'+get.cnNumber(num)+'张牌置入弃牌堆或受到1点伤害').set('ai',function(card){ target.chooseCard('h',num,'将'+get.cnNumber(num)+'张牌置入弃牌堆或受到1点伤害').set('ai',function(card){
var evt=_status.event.getParent(); var evt=_status.event.getParent();
if(get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0; 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); },get.config('onlyguozhanexpand')?'expandall':undefined,get.config('onlyguozhan')?'onlypack:mode_guozhan':undefined);
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
}; };
@ -13936,7 +13936,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); 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; var node=_status.event.dialog.buttons[0].parentNode;
_status.event.dialog.buttons=ui.create.buttons(list,'character',buttons); _status.event.dialog.buttons=ui.create.buttons(list,'character',buttons);
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
game.check(); game.check();

View File

@ -1582,7 +1582,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var node=dialog.buttons[0].parentNode; var node=dialog.buttons[0].parentNode;
dialog.buttons=ui.create.buttons(list,'characterx',buttons); dialog.buttons=ui.create.buttons(list,'characterx',buttons);
dialog.content.insertBefore(buttons,node); dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
game.check(); game.check();
@ -1992,7 +1992,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var node=_status.event.dialog.buttons[0].parentNode; var node=_status.event.dialog.buttons[0].parentNode;
_status.event.dialog.buttons=ui.create.buttons(list,'characterx',buttons); _status.event.dialog.buttons=ui.create.buttons(list,'characterx',buttons);
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
game.check(); game.check();
@ -2003,7 +2003,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
lib.onfree.push(function(){ lib.onfree.push(function(){
event.dialogxx=ui.create.characterDialog('heightset'); event.dialogxx=ui.create.characterDialog('heightset');
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
}); });
@ -2025,7 +2025,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); ui.cheat.classList.remove('disabled');
} }
} }

View File

@ -934,7 +934,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
player.dataset.position=dead.dataset.position; player.dataset.position=dead.dataset.position;
player.side=dead.side; player.side=dead.side;
player.actcharacterlist=dead.actcharacterlist; player.actcharacterlist=dead.actcharacterlist;
player.animate('replaceme'); player.addTempClass('replaceme');
player.actcount=game.enemy.actcount; player.actcount=game.enemy.actcount;
player.actcount=dead.actcount; player.actcount=dead.actcount;
if(_status.double_character){ 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.dataset.position=dead.dataset.position;
player.side=dead.side; player.side=dead.side;
player.actcharacterlist=dead.actcharacterlist; player.actcharacterlist=dead.actcharacterlist;
player.animate('replaceenemy'); player.addTempClass('replaceenemy');
player.actcount=dead.actcount; player.actcount=dead.actcount;
if(_status.double_character){ if(_status.double_character){
player.init(_status.enemylist.shift(),_status.enemylist.shift()); 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; 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.buttons=ui.create.buttons(list.slice(0,get.config('battle_number')*2+5),'character',buttons);
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
@ -1510,7 +1510,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
lib.onfree.push(function(){ lib.onfree.push(function(){
event.dialogxx=ui.create.characterDialog('heightset'); event.dialogxx=ui.create.characterDialog('heightset');
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
event.dialogxx.style.height=(game.layout=='newlayout'?350:410)+'px'; 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.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); ui.cheat.classList.remove('disabled');
} }
} }

View File

@ -616,8 +616,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
ui.me.querySelector('.fakeme.avatar').show(); ui.me.querySelector('.fakeme.avatar').show();
ui.me.querySelector('.fakeme.player').show(); ui.me.querySelector('.fakeme.player').show();
ui.create.fakeme(); ui.create.fakeme();
ui.handcards1=player.node.handcards1.animate('start').fix(); ui.handcards1=player.node.handcards1.addTempClass('start').fix();
ui.handcards2=player.node.handcards2.animate('start').fix(); ui.handcards2=player.node.handcards2.addTempClass('start').fix();
ui.handcards1Container.appendChild(ui.handcards1); ui.handcards1Container.appendChild(ui.handcards1);
ui.handcards2Container.appendChild(ui.handcards2); ui.handcards2Container.appendChild(ui.handcards2);
ui.updatehl(); ui.updatehl();
@ -633,7 +633,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
for(var i=ui.chesswidth;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.addTempClass('start');
ui.placeChess(grid,i); ui.placeChess(grid,i);
event.playergrids.push(grid); 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){ for(var i in lib.tafang.map){
createScene(i); createScene(i);
} }
ui.window.appendChild(sceneview.animate('start')); ui.window.appendChild(sceneview.addTempClass('start'));
game.pause(); game.pause();
}); });
}, },

View File

@ -738,7 +738,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var node=_status.event.dialog.buttons[0].parentNode; 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.buttons=ui.create.buttons(list[game.me.identity+'list'].randomGets(8),'character',buttons);
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
game.check(); 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(lib.character[name][1]!=game.me.identity) return true;
}); });
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
}; };
@ -777,7 +777,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); 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=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.buttons[7].node.name.innerHTML=get.verticalStr('队友选择');
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
game.check(); 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(lib.character[name][1]!=game.me.identity) return true;
}); });
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
}; };
@ -1016,7 +1016,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); 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; var node=_status.event.dialog.buttons[0].parentNode;
_status.event.dialog.buttons=ui.create.buttons(list.randomGets(7),'characterx',buttons); _status.event.dialog.buttons=ui.create.buttons(list.randomGets(7),'characterx',buttons);
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
game.check(); game.check();
@ -1319,7 +1319,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
lib.onfree.push(function(){ lib.onfree.push(function(){
event.dialogxx=ui.create.characterDialog('heightset'); event.dialogxx=ui.create.characterDialog('heightset');
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
}); });
@ -1340,7 +1340,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); 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; var node=_status.event.dialog.buttons[0].parentNode;
_status.event.dialog.buttons=ui.create.buttons(list.randomGets(7),'character',buttons); _status.event.dialog.buttons=ui.create.buttons(list.randomGets(7),'character',buttons);
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
game.uncheck(); game.uncheck();
game.check(); game.check();
@ -1510,7 +1510,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
lib.onfree.push(function(){ lib.onfree.push(function(){
event.dialogxx=ui.create.characterDialog('heightset'); event.dialogxx=ui.create.characterDialog('heightset');
if(ui.cheat2){ if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500); ui.cheat2.addTempClass('controlpressdownx',500);
ui.cheat2.classList.remove('disabled'); ui.cheat2.classList.remove('disabled');
} }
}); });
@ -1531,7 +1531,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.addTempClass('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); 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; var node=_status.event.dialog.buttons[0].parentNode;
_status.event.dialog.buttons=ui.create.buttons(list.slice(0,choice),'character',buttons); _status.event.dialog.buttons=ui.create.buttons(list.slice(0,choice),'character',buttons);
_status.event.dialog.content.insertBefore(buttons,node); _status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start'); buttons.addTempClass('start');
node.remove(); node.remove();
// event.check(); // event.check();
@ -2342,7 +2342,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var buttons=dialog.querySelector('.buttons'); var buttons=dialog.querySelector('.buttons');
var button; var button;
for(i=dialog.buttons.length;i<choice;i++){ 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); dialog.buttons.push(button);
button.style.opacity=1; button.style.opacity=1;
} }
@ -3787,7 +3787,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(_status.dragged) return; if(_status.dragged) return;
if(this.link==game.me){ if(this.link==game.me){
if(!this.classList.contains('buttonclick')){ if(!this.classList.contains('buttonclick')){
this.animate('buttonclick'); this.addTempClass('buttonclick');
} }
} }
else if(_status.event.player==game.me&&!_status.auto){ else if(_status.event.player==game.me&&!_status.auto){

View File

@ -632,7 +632,7 @@ export class Game extends Uninstantable {
if (background.startsWith('db:')) uiBackground.setBackgroundDB(background.slice(3)); if (background.startsWith('db:')) uiBackground.setBackgroundDB(background.slice(3));
else if (background.startsWith('ext:')) uiBackground.setBackgroundImage(`extension/${background.slice(4)}`); else if (background.startsWith('ext:')) uiBackground.setBackgroundImage(`extension/${background.slice(4)}`);
else if (background == 'default') { else if (background == 'default') {
uiBackground.animate('start'); uiBackground.addTempClass('start');
style.backgroundImage = 'none'; style.backgroundImage = 'none';
} }
else if (background.startsWith('custom_')) { else if (background.startsWith('custom_')) {
@ -2831,14 +2831,14 @@ export class Game extends Uninstantable {
boss.setIdentity('zhong'); boss.setIdentity('zhong');
boss.identity = 'zhong'; boss.identity = 'zhong';
} }
ui.arena.appendChild(boss.animate('zoominanim')); ui.arena.appendChild(boss.addTempClass('zoominanim'));
} }
}, },
stoneSwap: function (info) { stoneSwap: function (info) {
var player = ui.create.player(); var player = ui.create.player();
player.classList.add('noidentity'); player.classList.add('noidentity');
player.dataset.position = info.position; player.dataset.position = info.position;
player.animate(info.me ? 'replaceme' : 'replaceenemy'); player.addTempClass(info.me ? 'replaceme' : 'replaceenemy');
player.actcount = info.actcount; player.actcount = info.actcount;
player.init(info.name, info.name2); player.init(info.name, info.name2);
game.players.push(player); game.players.push(player);
@ -3224,7 +3224,7 @@ export class Game extends Uninstantable {
if (player && content) { if (player && content) {
var judging = get.infoCard(content[0]); var judging = get.infoCard(content[0]);
if (game.chess) { if (game.chess) {
judging.copy('thrown', 'center', 'thrownhighlight', ui.arena).animate('start'); judging.copy('thrown', 'center', 'thrownhighlight', ui.arena).addTempClass('start');
} }
else { else {
player.$throwordered(judging.copy('thrownhighlight'), true); player.$throwordered(judging.copy('thrownhighlight'), true);
@ -3238,7 +3238,7 @@ export class Game extends Uninstantable {
} }
}, },
centernode: function (content) { 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) { judge2: function (videoId) {
for (var i = 0; i < ui.dialogs.length; i++) { for (var i = 0; i < ui.dialogs.length; i++) {
@ -3374,8 +3374,8 @@ export class Game extends Uninstantable {
game.me = player; game.me = player;
ui.me.lastChild.show(); ui.me.lastChild.show();
ui.create.fakeme(); ui.create.fakeme();
ui.handcards1 = player.node.handcards1.animate('start').fix(); ui.handcards1 = player.node.handcards1.addTempClass('start').fix();
ui.handcards2 = player.node.handcards2.animate('start').fix(); ui.handcards2 = player.node.handcards2.addTempClass('start').fix();
ui.handcards1Container.appendChild(ui.handcards1); ui.handcards1Container.appendChild(ui.handcards1);
ui.handcards2Container.appendChild(ui.handcards2); ui.handcards2Container.appendChild(ui.handcards2);
ui.updatehl(); ui.updatehl();
@ -3749,8 +3749,8 @@ export class Game extends Uninstantable {
game.me.node.handcards1.remove(); game.me.node.handcards1.remove();
game.me.node.handcards2.remove(); game.me.node.handcards2.remove();
ui.handcards1 = player.node.handcards1.animate('start').fix(); ui.handcards1 = player.node.handcards1.addTempClass('start').fix();
ui.handcards2 = player.node.handcards2.animate('start').fix(); ui.handcards2 = player.node.handcards2.addTempClass('start').fix();
ui.handcards1Container.insertBefore(ui.handcards1, ui.handcards1Container.firstChild); ui.handcards1Container.insertBefore(ui.handcards1, ui.handcards1Container.firstChild);
ui.handcards2Container.insertBefore(ui.handcards2, ui.handcards2Container.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.handcards1.remove();
game.me.node.handcards2.remove(); game.me.node.handcards2.remove();
game.me = player; game.me = player;
ui.handcards1 = player.node.handcards1.animate('start').fix(); ui.handcards1 = player.node.handcards1.addTempClass('start').fix();
ui.handcards2 = player.node.handcards2.animate('start').fix(); ui.handcards2 = player.node.handcards2.addTempClass('start').fix();
ui.handcards1Container.appendChild(ui.handcards1); ui.handcards1Container.appendChild(ui.handcards1);
ui.handcards2Container.appendChild(ui.handcards2); ui.handcards2Container.appendChild(ui.handcards2);
@ -6618,8 +6618,8 @@ export class Game extends Uninstantable {
if (current.isDead()) { if (current.isDead()) {
current.$die(); current.$die();
} }
ui.handcards1 = player.node.handcards1.animate('start').fix(); ui.handcards1 = player.node.handcards1.addTempClass('start').fix();
ui.handcards2 = player.node.handcards2.animate('start').fix(); ui.handcards2 = player.node.handcards2.addTempClass('start').fix();
ui.handcards1Container.appendChild(ui.handcards1); ui.handcards1Container.appendChild(ui.handcards1);
ui.handcards2Container.appendChild(ui.handcards2); ui.handcards2Container.appendChild(ui.handcards2);
@ -6664,8 +6664,8 @@ export class Game extends Uninstantable {
game.me.node.handcards2.remove(); game.me.node.handcards2.remove();
game.me = player; game.me = player;
ui.handcards1 = player.node.handcards1.animate('start').fix(); ui.handcards1 = player.node.handcards1.addTempClass('start').fix();
ui.handcards2 = player.node.handcards2.animate('start').fix(); ui.handcards2 = player.node.handcards2.addTempClass('start').fix();
ui.handcards1Container.insertBefore(ui.handcards1, ui.handcards1Container.firstChild); ui.handcards1Container.insertBefore(ui.handcards1, ui.handcards1Container.firstChild);
ui.handcards2Container.insertBefore(ui.handcards2, ui.handcards2Container.firstChild); ui.handcards2Container.insertBefore(ui.handcards2, ui.handcards2Container.firstChild);
ui.updatehl(); 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 = ui.create.div('.name', event.avatars[i], get.slimName(name));
event.avatars[i].nodename.style.fontFamily = lib.config.name_font; event.avatars[i].nodename.style.fontFamily = lib.config.name_font;
event.avatars[i].index = i + event.config.width; 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.nodes[event.avatars[i].index].style.display = 'none';
event.avatars[i].nodename.dataset.nature = get.groupnature(lib.character[name][1]); event.avatars[i].nodename.dataset.nature = get.groupnature(lib.character[name][1]);
lib.setIntro(event.avatars[i]); lib.setIntro(event.avatars[i]);
@ -8431,7 +8431,7 @@ export class Game extends Uninstantable {
players.forEach(value => { players.forEach(value => {
if (parseInt(value.dataset.position) >= position) value.dataset.position = parseInt(value.dataset.position) + 1; 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); if (character) player.init(character, character2);
game.players.push(player); game.players.push(player);
player.dataset.position = position; player.dataset.position = position;
@ -8445,7 +8445,7 @@ export class Game extends Uninstantable {
*/ */
static addFellow(position, character, animation) { static addFellow(position, character, animation) {
game.addVideo('addFellow', null, [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.dataset.position = position || game.players.length + game.dead.length;
player.getId(); player.getId();
if (character) player.init(character); if (character) player.init(character);
@ -8479,7 +8479,7 @@ export class Game extends Uninstantable {
game.players.push(player); game.players.push(player);
delete player.removed; delete player.removed;
player.removeAttribute('style'); player.removeAttribute('style');
player.animate('start'); player.addTempClass('start');
ui.arena.appendChild(player); ui.arena.appendChild(player);
game.arrangePlayers(); game.arrangePlayers();
return player; return player;
@ -8527,7 +8527,7 @@ export class Game extends Uninstantable {
game.players.remove(player); game.players.remove(player);
game.dead.remove(player); game.dead.remove(player);
player.delete(); 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); if (character) player2.init(character, character2);
game.players.push(player2); game.players.push(player2);
player2.dataset.position = position; player2.dataset.position = position;

View File

@ -5,22 +5,22 @@ import { Game as game } from '../game/index.js';
import { status as _status } from '../status/index.js'; import { status as _status } from '../status/index.js';
import { UI as ui } from '../ui/index.js'; import { UI as ui } from '../ui/index.js';
HTMLDivElement.prototype.animate = function (name, time) { // 废弃覆盖原型的HTMLDivElement.prototype.animate
// 兼容原先的Div.animate // 改为HTMLDivElement.prototype.addTempClass
if (Array.isArray(name) || get.objtype(name) == 'object') { HTMLDivElement.prototype.animate = function (keyframes, options) {
return Element.prototype.animate.call(this, name, time); if (typeof keyframes == 'string') {
} console.warn(this, '无名杀开发者修改的animate方法已废弃请改为使用addTempClass方法');
var that; return HTMLDivElement.prototype.addTempClass.call(this, keyframes, options);
if (get.is.mobileMe(this) && name == 'target') {
that = ui.mebg;
}
else {
that = this;
} }
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); that.classList.add(name);
setTimeout(function () { setTimeout(() => {
that.classList.remove(name); that.classList.remove(name);
}, time || 1000); }, time);
return this; return this;
}; };
HTMLDivElement.prototype.hide = function () { HTMLDivElement.prototype.hide = function () {

View File

@ -3036,7 +3036,7 @@ export const Content = {
} }
} }
else { else {
ui.control.animate('nozoom', 100); ui.control.addTempClass('nozoom', 100);
event._aiexclude.add(event.buttoned); event._aiexclude.add(event.buttoned);
} }
event.goto(0); event.goto(0);
@ -3230,7 +3230,7 @@ export const Content = {
} }
} }
else { else {
ui.control.animate('nozoom', 100); ui.control.addTempClass('nozoom', 100);
event._aiexclude.add(event.buttoned); event._aiexclude.add(event.buttoned);
} }
event.goto(0); event.goto(0);
@ -3834,7 +3834,7 @@ export const Content = {
event.cardlist.forEach((card, index) => { event.cardlist.forEach((card, index) => {
game.log(targets[index], '的拼点牌为', card); game.log(targets[index], '的拼点牌为', card);
}); });
player.animate('target'); player.addTempClass('target');
game.delay(0, 1000); game.delay(0, 1000);
'step 5'; 'step 5';
event.target = null; event.target = null;
@ -3842,7 +3842,7 @@ export const Content = {
'step 6'; 'step 6';
if (event.iwhile < targets.length) { if (event.iwhile < targets.length) {
event.target = targets[event.iwhile]; event.target = targets[event.iwhile];
event.target.animate('target'); event.target.addTempClass('target');
event.card2 = event.cardlist[event.iwhile]; event.card2 = event.cardlist[event.iwhile];
event.num2 = event.getNum(event.card2); event.num2 = event.getNum(event.card2);
//event.tempplayer.line(event.target); //event.tempplayer.line(event.target);
@ -3996,8 +3996,8 @@ export const Content = {
"step 5"; "step 5";
if (event.iwhile < targets.length) { if (event.iwhile < targets.length) {
event.target = targets[event.iwhile]; event.target = targets[event.iwhile];
event.target.animate('target'); event.target.addTempClass('target');
player.animate('target'); player.addTempClass('target');
event.card2 = event.cardlist[event.iwhile]; event.card2 = event.cardlist[event.iwhile];
event.num2 = event.getNum(event.card2); event.num2 = event.getNum(event.card2);
game.log(event.target, '的拼点牌为', event.card2); game.log(event.target, '的拼点牌为', event.card2);
@ -4746,7 +4746,7 @@ export const Content = {
} }
if (event.result.bool && event.animate !== false) { if (event.result.bool && event.animate !== false) {
for (var i = 0; i < event.result.targets.length; i++) { 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(); if (event.dialog) event.dialog.close();
@ -4806,7 +4806,7 @@ export const Content = {
event.resume(); event.resume();
if (event.result.bool && event.animate !== false) { if (event.result.bool && event.animate !== false) {
for (var i = 0; i < event.result.targets.length; i++) { 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(); if (event.dialog) event.dialog.close();
@ -6105,12 +6105,12 @@ export const Content = {
targets.sortBySeat((_status.currentPhase || player)); targets.sortBySeat((_status.currentPhase || player));
} }
if (animate) for (var i = 0; i < targets.length; i++) { if (animate) for (var i = 0; i < targets.length; i++) {
targets[i].animate('target'); targets[i].addTempClass('target');
} }
} }
else if (animate) { else if (animate) {
for (var i = 0; i < targets.length; i++) { 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 (next.target && !info.multitarget) {
if (num == 0 && targets.length > 1) { if (num == 0 && targets.length > 1) {
// var ttt=next.target; // 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 { else {
next.target.animate('target'); next.target.addTempClass('target');
} }
} }
if (!info.nodelay && num > 0) { if (!info.nodelay && num > 0) {
@ -6608,7 +6608,7 @@ export const Content = {
delete lib.tempSortSeat; delete lib.tempSortSeat;
} }
for (var i = 0; i < targets.length; i++) { for (var i = 0; i < targets.length; i++) {
targets[i].animate('target'); targets[i].addTempClass('target');
} }
} }
next.target = targets[num]; next.target = targets[num];
@ -6617,10 +6617,10 @@ export const Content = {
if (next.target && !info.multitarget) { if (next.target && !info.multitarget) {
if (num == 0 && targets.length > 1) { if (num == 0 && targets.length > 1) {
// var ttt=next.target; // 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 { else {
next.target.animate('target'); next.target.addTempClass('target');
} }
} }
if (num == 0) { if (num == 0) {
@ -8131,7 +8131,7 @@ export const Content = {
event = _status.event; event = _status.event;
} }
if (game.chess) { if (game.chess) {
event.node = card.copy('thrown', 'center', ui.arena).animate('start'); event.node = card.copy('thrown', 'center', ui.arena).addTempClass('start');
} }
else { else {
event.node = player.$throwordered(card.copy(), true); event.node = player.$throwordered(card.copy(), true);

View File

@ -28,10 +28,10 @@ export class Control extends HTMLDivElement {
else control.add(argument); else control.add(argument);
}); });
ui.controls.unshift(control); ui.controls.unshift(control);
if (nc) ui.control.animate('nozoom', 100); if (nc) ui.control.addTempClass('nozoom', 100);
if (control.childNodes.length) { if (control.childNodes.length) {
control.style.transition = 'opacity 0.5s'; control.style.transition = 'opacity 0.5s';
control.animate('controlpressdownx', 500); control.addTempClass('controlpressdownx', 500);
ui.refresh(control); ui.refresh(control);
if (!control.stayleft) control.style.transform = `translateX(-${control.offsetWidth / 2}px)`; if (!control.stayleft) control.style.transform = `translateX(-${control.offsetWidth / 2}px)`;
control.style.opacity = 1; control.style.opacity = 1;
@ -68,7 +68,7 @@ export class Control extends HTMLDivElement {
this.style.transition = ''; this.style.transition = '';
} }
else { else {
this.animate('controlpressdownx', 500); this.addTempClass('controlpressdownx', 500);
} }
ui.updatec(); ui.updatec();
return this; return this;
@ -81,7 +81,7 @@ export class Control extends HTMLDivElement {
node.addEventListener(lib.config.touchscreen ? 'touchend' : 'click', ui.click.control); node.addEventListener(lib.config.touchscreen ? 'touchend' : 'click', ui.click.control);
} }
close() { close() {
this.animate('controlpressdownx', 500); this.addTempClass('controlpressdownx', 500);
ui.controls.remove(this); ui.controls.remove(this);
this.delete(); this.delete();
@ -95,7 +95,7 @@ export class Control extends HTMLDivElement {
if (ui.skills3 == this) delete ui.skills3; if (ui.skills3 == this) delete ui.skills3;
} }
replace() { replace() {
// this.animate('controlpressdownx',500); // this.addTempClass('controlpressdownx',500);
if (this.replaceTransition === false) { if (this.replaceTransition === false) {
this.style.transitionProperty = 'none'; this.style.transitionProperty = 'none';
ui.refresh(this); ui.refresh(this);

View File

@ -3680,7 +3680,7 @@ export class Library extends Uninstantable {
right: '靠右', right: '靠右',
}, },
onclick: function (bool) { 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); game.saveConfig('show_history', bool);
if (_status.video || !_status.prepareArena) return; if (_status.video || !_status.prepareArena) return;
if (bool == 'left') { if (bool == 'left') {
@ -12444,7 +12444,7 @@ export class Library extends Uninstantable {
var pos = state.players[observe || game.onlineID].position; var pos = state.players[observe || game.onlineID].position;
for (var i in state.players) { for (var i in state.players) {
var info = state.players[i]; 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; player.dataset.position = (info.position < pos) ? info.position - pos + parseInt(state.number) : info.position - pos;
if (i == observe || i == game.onlineID) { if (i == observe || i == game.onlineID) {
game.me = player; game.me = player;

View File

@ -9295,7 +9295,7 @@ class Create extends Uninstantable {
if (!lib.config.show_replay) { if (!lib.config.show_replay) {
ui.replay.style.display = 'none'; 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.cardPile = ui.create.div('#cardPile');
ui.discardPile = ui.create.div('#discardPile'); ui.discardPile = ui.create.div('#discardPile');
ui.special = ui.create.div('#special'); ui.special = ui.create.div('#special');
@ -9504,7 +9504,7 @@ class Create extends Uninstantable {
_status.auto = true; _status.auto = true;
ui.auto.classList.add('glow'); ui.auto.classList.add('glow');
setTimeout(function () { setTimeout(function () {
var node = ui.create.pause().animate('start'); var node = ui.create.pause().addTempClass('start');
node.appendChild(ui.sidebar); node.appendChild(ui.sidebar);
node.firstChild.innerHTML = '正在测试'; node.firstChild.innerHTML = '正在测试';
node.removeEventListener('click', ui.click.resume); node.removeEventListener('click', ui.click.resume);
@ -9985,7 +9985,7 @@ class Create extends Uninstantable {
} }
if (!numberOfPlayers) numberOfPlayers = 5; if (!numberOfPlayers) numberOfPlayers = 5;
for (let ordinal = 0; ordinal < numberOfPlayers; ordinal++) { 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); game.players.push(player);
player.dataset.position = ordinal; player.dataset.position = ordinal;
} }
@ -10010,7 +10010,7 @@ class Create extends Uninstantable {
} }
static me(hasme) { static me(hasme) {
ui.mebg = ui.create.div('#mebg', ui.arena); 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.handcards1Container = ui.create.div('#handcards1', ui.me);
ui.handcards2Container = ui.create.div('#handcards2', ui.me); ui.handcards2Container = ui.create.div('#handcards2', ui.me);
ui.arena.classList.remove('nome'); ui.arena.classList.remove('nome');
@ -12527,7 +12527,7 @@ class Click extends Uninstantable {
_status.clicked = true; _status.clicked = true;
_status.tempunpop = true; _status.tempunpop = true;
this.previousSibling.hide(); 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++) { for (var i = 0; i < this.choice.length; i++) {
var choice = ui.create.div('.pointerdiv', node); var choice = ui.create.div('.pointerdiv', node);
choice.innerHTML = get.translation(this.choice[i]); choice.innerHTML = get.translation(this.choice[i]);
@ -13020,7 +13020,7 @@ class Click extends Uninstantable {
if (_status.event.type == 'phase' && ui.confirm) { if (_status.event.type == 'phase' && ui.confirm) {
ui.confirm.classList.add('removing'); ui.confirm.classList.add('removing');
} }
// ui.control.animate('nozoom',100); // ui.control.addTempClass('nozoom',100);
event.restore(); event.restore();
var cards = event.player.getCards('hej'); var cards = event.player.getCards('hej');
for (var i = 0; i < cards.length; i++) { for (var i = 0; i < cards.length; i++) {
@ -13801,7 +13801,7 @@ class Click extends Uninstantable {
game.pause2(); game.pause2();
var node = ui.create.pause(); var node = ui.create.pause();
if (!node) return; if (!node) return;
node.animate('start'); node.addTempClass('start');
ui.sidebar3.innerHTML = ''; ui.sidebar3.innerHTML = '';
if (lib.config.show_discardpile) { if (lib.config.show_discardpile) {
for (var i = 0; i < ui.discardPile.childNodes.length; i++) { for (var i = 0; i < ui.discardPile.childNodes.length; i++) {
@ -14141,7 +14141,7 @@ export class UI extends Uninstantable {
stayleft._offset += stayleft.currentLeft; stayleft._offset += stayleft.currentLeft;
if (current_offset != stayleft._offset) { if (current_offset != stayleft._offset) {
stayleft.animate('controlpressdownx', 500); stayleft.addTempClass('controlpressdownx', 500);
stayleft.style.transform = 'translateX(' + stayleft._offset + 'px)'; stayleft.style.transform = 'translateX(' + stayleft._offset + 'px)';
} }
} }
@ -14159,7 +14159,7 @@ export class UI extends Uninstantable {
if (minoffset > offset) offset = minoffset; if (minoffset > offset) offset = minoffset;
var control = controls.shift(); var control = controls.shift();
if (control._offset != offset) { if (control._offset != offset) {
control.animate('controlpressdownx', 500); control.addTempClass('controlpressdownx', 500);
control.style.transform = 'translateX(' + offset + 'px)'; control.style.transform = 'translateX(' + offset + 'px)';
control._offset = offset; control._offset = offset;
} }
@ -14171,7 +14171,7 @@ export class UI extends Uninstantable {
offset += 6; offset += 6;
} }
if (control._offset != offset) { if (control._offset != offset) {
control.animate('controlpressdownx', 500); control.addTempClass('controlpressdownx', 500);
control.style.transform = 'translateX(' + offset + 'px)'; control.style.transform = 'translateX(' + offset + 'px)';
control._offset = offset; control._offset = offset;
} }