This commit is contained in:
libccy 2015-11-23 18:59:44 +08:00
parent e94463d1b1
commit 23518ecfac
29 changed files with 510 additions and 160 deletions

View File

@ -1 +1,2 @@
1.5.8 1.5.8
低性能模式改进

View File

@ -21,8 +21,8 @@ card.extra={
player.node.jiu=ui.create.div('.playerjiu',player.node.avatar); player.node.jiu=ui.create.div('.playerjiu',player.node.avatar);
player.node.jiu2=ui.create.div('.playerjiu',player.node.avatar2); player.node.jiu2=ui.create.div('.playerjiu',player.node.avatar2);
} }
if(card.clone&&card.clone.parentNode==ui.arena){ if(card.clone&&card.clone.parentNode==player.parentNode){
card.clone.moveTo(target).delete(); card.clone.moveDelete(target);
game.addVideo('gain2',target,get.cardsInfo([card])); game.addVideo('gain2',target,get.cardsInfo([card]));
} }
} }

View File

@ -175,8 +175,8 @@ card.qimou={
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.gain([result.player,result.target]); player.gain([result.player,result.target]);
result.player.clone.moveTo(player).delete(); result.player.clone.moveDelete(player);
result.target.clone.moveTo(player).delete(); result.target.clone.moveDelete(player);
game.addVideo('gain2',player,get.cardsInfo([result.player,result.target])); game.addVideo('gain2',player,get.cardsInfo([result.player,result.target]));
} }
else if(!result.cancelled){ else if(!result.cancelled){

View File

@ -260,8 +260,8 @@ card.swd={
if(target==_status.dying) target.recover(); if(target==_status.dying) target.recover();
else{ else{
target.addTempSkill('tianxianjiu',['phaseAfter','shaAfter']); target.addTempSkill('tianxianjiu',['phaseAfter','shaAfter']);
if(card.clone&&card.clone.parentNode==ui.arena){ if(card.clone&&card.clone.parentNode==player.parentNode){
card.clone.moveTo(target).delete(); card.clone.moveDelete(target);
game.addVideo('gain2',target,get.cardsInfo([card])); game.addVideo('gain2',target,get.cardsInfo([card]));
} }
} }

View File

@ -460,7 +460,7 @@ character.mountain={
if(result.bool){ if(result.bool){
result.card.goto(ui.special); result.card.goto(ui.special);
player.storage.tuntian.push(result.card); player.storage.tuntian.push(result.card);
result.node.moveTo(player).delete(); result.node.moveDelete(player);
game.addVideo('gain2',player,get.cardsInfo([result.node])); game.addVideo('gain2',player,get.cardsInfo([result.node]));
player.markSkill('tuntian'); player.markSkill('tuntian');
game.addVideo('storage',player,['tuntian',get.cardsInfo(player.storage.tuntian),'cards']); game.addVideo('storage',player,['tuntian',get.cardsInfo(player.storage.tuntian),'cards']);

View File

@ -555,7 +555,7 @@ character.refresh={
} }
else if(result.targets){ else if(result.targets){
result.targets[0].gain(event.card); result.targets[0].gain(event.card);
event.node.moveTo(result.targets[0]); event.node.moveDelete(result.targets[0]);
game.log(get.translation(result.targets[0])+'获得了'+get.translation(event.card)); game.log(get.translation(result.targets[0])+'获得了'+get.translation(event.card));
game.addVideo('gain2',result.targets[0],[get.cardInfo(event.node)]); game.addVideo('gain2',result.targets[0],[get.cardInfo(event.node)]);
} }
@ -563,8 +563,8 @@ character.refresh={
game.log(get.translation(player)+'展示并弃掉了'+get.translation(event.card)); game.log(get.translation(player)+'展示并弃掉了'+get.translation(event.card));
ui.discardPile.appendChild(event.card); ui.discardPile.appendChild(event.card);
game.addVideo('deletenode',player,[get.cardInfo(event.node)]); game.addVideo('deletenode',player,[get.cardInfo(event.node)]);
}
event.node.delete(); event.node.delete();
}
game.addVideo('thrownhighlight2'); game.addVideo('thrownhighlight2');
ui.arena.classList.remove('thrownhighlight'); ui.arena.classList.remove('thrownhighlight');
}, },
@ -832,6 +832,7 @@ character.refresh={
delete player.disabledSkills.retieji; delete player.disabledSkills.retieji;
player.removeSkill('retieji2'); player.removeSkill('retieji2');
}, },
audio:false,
mark:true, mark:true,
intro:{ intro:{
content:function(st,player){ content:function(st,player){

View File

@ -539,6 +539,10 @@ character.standard={
next.autochoose=lib.filter.autoRespondSha; next.autochoose=lib.filter.autoRespondSha;
next.source=player; next.source=player;
} }
else{
event.current=event.current.next;
event.redo();
}
"step 1" "step 1"
if(result.bool){ if(result.bool){
event.finish(); event.finish();
@ -597,6 +601,10 @@ character.standard={
next.source=player; next.source=player;
next.target=target; next.target=target;
} }
else{
event.current=event.current.next;
event.redo();
}
"step 1" "step 1"
if(result.bool){ if(result.bool){
event.finish(); event.finish();

View File

@ -304,7 +304,7 @@ character.xianjian={
player.$throw(result.cards); player.$throw(result.cards);
var clone=result.cards[0].clone; var clone=result.cards[0].clone;
setTimeout(function(){ setTimeout(function(){
clone.moveTo(player,'flip').delete(); clone.moveDelete(player);
game.addVideo('gain2',player,get.cardsInfo([clone])); game.addVideo('gain2',player,get.cardsInfo([clone]));
},500); },500);
player.logSkill('shuiyun'); player.logSkill('shuiyun');
@ -631,7 +631,7 @@ character.xianjian={
game.addVideo('unmarkId',player,[get.cardInfo(player.storage.shuangren),'shuangren']); game.addVideo('unmarkId',player,[get.cardInfo(player.storage.shuangren),'shuangren']);
} }
if(card.clone){ if(card.clone){
card.clone.moveTo(player,'flip').delete(); card.clone.moveDelete(player);
game.addVideo('gain2',player,get.cardsInfo([card.clone])); game.addVideo('gain2',player,get.cardsInfo([card.clone]));
player.mark(card,'shuangren'); player.mark(card,'shuangren');
game.addVideo('markId',player,[get.cardInfo(card),'shuangren']); game.addVideo('markId',player,[get.cardInfo(card),'shuangren']);

View File

@ -61,7 +61,7 @@ character.yijiang={
zhuzhi:['male','wu',4,['anguo'],['fullskin']], zhuzhi:['male','wu',4,['anguo'],['fullskin']],
quancong:['male','wu',4,['yaoming'],['fullskin']], quancong:['male','wu',4,['yaoming'],['fullskin']],
gongsunyuan:['male','qun',4,['huaiyi'],['fullskin']], gongsunyuan:['male','qun',4,['huaiyi'],['fullskin']],
guotufengji:['male','shu',3,['jigong','shifei'],['fullskin']], guotufengji:['male','qun',3,['jigong','shifei'],['fullskin']],
}, },
skill:{ skill:{
jinjiu:{ jinjiu:{
@ -218,19 +218,15 @@ character.yijiang={
ai:{ ai:{
effect:{ effect:{
player:function(card,player){ player:function(card,player){
console.log(1);
if(_status.currentPhase!=player) return; if(_status.currentPhase!=player) return;
if(card.name=='sha'&&player.num('h')<=player.hp&&!player.storage.chunlao.length){ if(card.name=='sha'&&player.num('h')<=player.hp&&!player.storage.chunlao.length){
return [0,0,0,0]; return [0,0,0,0];
} }
} }
}, },
},
group:'chunlao2',
ai:{
threaten:1.4 threaten:1.4
} },
group:'chunlao2'
}, },
chunlao2:{ chunlao2:{
trigger:{global:'dying'}, trigger:{global:'dying'},
@ -1175,7 +1171,12 @@ character.yijiang={
}, },
content:function(){ content:function(){
if(player==trigger.source){ if(player==trigger.source){
if(trigger.player.isAlive()){
game.asyncDraw([player,trigger.player]); game.asyncDraw([player,trigger.player]);
}
else{
player.draw();
}
player.storage.zhanjue++; player.storage.zhanjue++;
} }
else{ else{
@ -1232,6 +1233,10 @@ character.yijiang={
next.autochoose=lib.filter.autoRespondSha; next.autochoose=lib.filter.autoRespondSha;
next.source=player; next.source=player;
} }
else{
event.current=event.current.next;
event.redo();
}
"step 3" "step 3"
if(result.bool){ if(result.bool){
event.finish(); event.finish();
@ -1301,6 +1306,10 @@ character.yijiang={
next.source=player; next.source=player;
next.target=target; next.target=target;
} }
else{
event.current=event.current.next;
event.redo();
}
"step 1" "step 1"
if(result.bool){ if(result.bool){
event.finish(); event.finish();

View File

@ -209,6 +209,7 @@ window.config={
background_speak:true, background_speak:true,
glow_phase:true, glow_phase:true,
skin:{},
theme:'woodden', theme:'woodden',
layout:'mobile', layout:'mobile',

View File

@ -30,6 +30,17 @@
lib._onDB.push(func); lib._onDB.push(func);
} }
}, },
listenEnd:function(node){
if(!node._listeningEnd){
node._listeningEnd=true;
node.addEventListener('webkitTransitionEnd',function(){
if(node._onEndMoveDelete){
node.moveDelete(node._onEndMoveDelete);
}
node._transitionEnded=true;
});
}
},
configMenu:{ configMenu:{
general:{ general:{
name:'通用', name:'通用',
@ -56,6 +67,11 @@
}, },
unfrequent:true, unfrequent:true,
}, },
low_performance:{
name:'低性能模式',
init:false,
unfrequent:true,
},
confirm_exit:{ confirm_exit:{
name:'确认退出', name:'确认退出',
init:false, init:false,
@ -84,9 +100,9 @@
init:false, init:false,
restart:true restart:true
}, },
low_performance:{ change_skin:{
name:'低性能模式', name:'双击换肤',
init:false init:true
}, },
game_speed:{ game_speed:{
name:'游戏速度', name:'游戏速度',
@ -2237,7 +2253,7 @@
game.delayx(); game.delayx();
} }
"step 2" "step 2"
if(!player.skipList.contains('phaseUse')) player.popup('出牌阶段'); // if(!player.skipList.contains('phaseUse')) player.popup('出牌阶段');
player.phaseUse(); player.phaseUse();
"step 3" "step 3"
player.phaseDiscard() player.phaseDiscard()
@ -3235,7 +3251,7 @@
else if(info.audio){ else if(info.audio){
game.playAudio('skill',event.skill); game.playAudio('skill',event.skill);
} }
else if(lib.config.background_ogg){ else if(lib.config.background_ogg&&info.audio!==false){
game.playSkillAudio(event.skill); game.playSkillAudio(event.skill);
} }
} }
@ -3471,9 +3487,7 @@
sort=lib.config.sort_card(cards[num]); sort=lib.config.sort_card(cards[num]);
if(lib.config.reverse_sort) sort=-sort; if(lib.config.reverse_sort) sort=-sort;
cards[num].fix(); cards[num].fix();
if(!lib.config.low_performance){
cards[num].animate('start'); cards[num].animate('start');
}
if(lib.isSingleHandcard()||sort>0) frag1.appendChild(cards[num]); if(lib.isSingleHandcard()||sort>0) frag1.appendChild(cards[num]);
else frag2.appendChild(cards[num]); else frag2.appendChild(cards[num]);
@ -3544,15 +3558,10 @@
if(event.position){ if(event.position){
cards[i].goto(event.position); cards[i].goto(event.position);
} }
else{
if(lib.config.low_performance){
cards[i].remove();
}
else{ else{
cards[i].delete(); cards[i].delete();
} }
} }
}
game.addVideo('lose',player,[get.cardsInfo(hs),get.cardsInfo(es),get.cardsInfo(js)]); game.addVideo('lose',player,[get.cardsInfo(hs),get.cardsInfo(es),get.cardsInfo(js)]);
player.update(); player.update();
game.addVideo('loseAfter',player); game.addVideo('loseAfter',player);
@ -3639,7 +3648,7 @@
player.changeHp(-num,false); player.changeHp(-num,false);
if(event.animate!==false){ if(event.animate!==false){
player.$damage(source); player.$damage(source);
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
if(event.nature=='fire'){ if(event.nature=='fire'){
player.$fire(); player.$fire();
} }
@ -3691,7 +3700,7 @@
if(num>player.maxHp-player.hp) num=player.maxHp-player.hp; if(num>player.maxHp-player.hp) num=player.maxHp-player.hp;
if(num>0){ if(num>0){
player.changeHp(num,false); player.changeHp(num,false);
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
player.$damagepop(num,'wood'); player.$damagepop(num,'wood');
player.$recover(); player.$recover();
} }
@ -3880,7 +3889,7 @@
if(get.owner(card)) get.owner(card).lose(card,ui.special); if(get.owner(card)) get.owner(card).lose(card,ui.special);
if(card.clone){ if(card.clone){
card.clone.moveTo(player).delete(); card.clone.moveDelete(player);
game.addVideo('gain2',player,get.cardsInfo([card.clone])); game.addVideo('gain2',player,get.cardsInfo([card.clone]));
} }
@ -3925,7 +3934,11 @@
} }
else{ else{
player.node.judges.insertBefore(cards[0],player.node.judges.firstChild); player.node.judges.insertBefore(cards[0],player.node.judges.firstChild);
player.$gain2(cards); if(cards[0].clone&&cards[0].clone.parentNode==player.parentNode){
cards[0].clone.moveDelete(player);
game.addVideo('gain2',target,get.cardsInfo(cards));
}
// player.$gain2(cards);
if(get.itemtype(card)!='card'){ if(get.itemtype(card)!='card'){
if(typeof card=='string') cards[0].viewAs=card; if(typeof card=='string') cards[0].viewAs=card;
else cards[0].viewAs=card.name; else cards[0].viewAs=card.name;
@ -4018,17 +4031,12 @@
if(!game.minskin&&lib.isNewLayout()&&info[4].contains('fullskin')){ if(!game.minskin&&lib.isNewLayout()&&info[4].contains('fullskin')){
this.classList.remove('minskin'); this.classList.remove('minskin');
this.classList.add('fullskin'); this.classList.add('fullskin');
if(lib.fakeavatar&&lib.fakeavatar[character]){ this.node.avatar.setBackground(character,'character',null,'fullskin');
this.node.avatar.setBackground('character/fullskin/'+lib.fakeavatar[character]);
}
else{
this.node.avatar.setBackground('character/fullskin/'+character);
}
} }
else{ else{
if(info[4].contains('fullskin')){ if(info[4].contains('fullskin')){
this.classList.add('fullskin'); this.classList.add('fullskin');
this.node.avatar.setBackground('character/fullskin/'+character); this.node.avatar.setBackground(character,'character',null,'fullskin');
} }
else{ else{
this.classList.remove('fullskin'); this.classList.remove('fullskin');
@ -4076,17 +4084,12 @@
if(lib.isNewLayout()&&lib.config.only_fullskin){ if(lib.isNewLayout()&&lib.config.only_fullskin){
this.classList.add('fullskin2'); this.classList.add('fullskin2');
if(lib.fakeavatar&&lib.fakeavatar[character2]){ this.node.avatar2.setBackground(character2,'character',null,'fullskin');
this.node.avatar2.setBackground('character/fullskin/'+lib.fakeavatar[character2]);
}
else{
this.node.avatar2.setBackground('character/fullskin/'+character2);
}
} }
else{ else{
if(info2[4].contains('fullskin')){ if(info2[4].contains('fullskin')){
this.classList.add('fullskin2'); this.classList.add('fullskin2');
this.node.avatar2.setBackground('character/fullskin/'+character2); this.node.avatar2.setBackground(character2,'character',null,'fullskin');
} }
else{ else{
this.classList.remove('fullskin2'); this.classList.remove('fullskin2');
@ -5267,7 +5270,7 @@
} }
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
var sort=lib.config.sort_card(cards[i]); var sort=lib.config.sort_card(cards[i]);
if(animate!==false&&!lib.config.low_performance){ if(animate!==false){
cards[i].animate('start'); cards[i].animate('start');
} }
if(lib.isSingleHandcard()||sort>0){ if(lib.isSingleHandcard()||sort>0){
@ -5626,7 +5629,7 @@
game.playAudio('skill',name); game.playAudio('skill',name);
} }
else{ else{
if(lib.config.background_ogg){ if(lib.config.background_ogg&&info.audio!==false){
game.playSkillAudio(name); game.playSkillAudio(name);
} }
} }
@ -6060,6 +6063,10 @@
return null; return null;
}, },
$draw:function(num,init){ $draw:function(num,init){
// if(lib.config.low_performance){
// this.$gain(num,false,init);
// return;
// }
var cards,node; var cards,node;
if(get.itemtype(num)=='cards'){ if(get.itemtype(num)=='cards'){
cards=num; cards=num;
@ -6122,11 +6129,10 @@
$compare:function(card1,target,card2){ $compare:function(card1,target,card2){
game.addVideo('compare',this,[get.cardInfo(card1),target.dataset.position,get.cardInfo(card2)]); game.addVideo('compare',this,[get.cardInfo(card1),target.dataset.position,get.cardInfo(card2)]);
var player=this; var player=this;
var node1=player.$throwxy(card1, var node1=player.$throwxy2(card1,
'calc(50% - 114px)','calc(50% - 52px)' 'calc(50% - 114px)','calc(50% - 52px)','perspective(600px) rotateY(180deg)',true
); );
node1.classList.add('infohidden'); node1.classList.add('infohidden');
node1.classList.add('thrownhighlight');
node1.style.transform='perspective(600px) rotateY(180deg) translateX(0)'; node1.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
setTimeout(function(){ setTimeout(function(){
setTimeout(function(){ setTimeout(function(){
@ -6134,36 +6140,41 @@
node1.style.transform='perspective(600px) rotateY(270deg) translateX(52px)'; node1.style.transform='perspective(600px) rotateY(270deg) translateX(52px)';
var onEnd=function(){ var onEnd=function(){
node1.classList.remove('infohidden'); node1.classList.remove('infohidden');
node1.classList.add('cardflip'); node1.style.transition='all 0s';
node1.style.transform='none'; ui.refresh(node1);
node1.style.transform='perspective(600px) rotateY(-90deg) translateX(52px)';
ui.refresh(node1);
node1.style.transition=''; node1.style.transition='';
ui.refresh(node1);
node1.style.transform='';
node1.removeEventListener('webkitTransitionEnd',onEnd); node1.removeEventListener('webkitTransitionEnd',onEnd);
} }
// node1.addEventListener('transitionEnd',onEnd); // node1.addEventListener('transitionEnd',onEnd);
node1.addEventListener('webkitTransitionEnd',onEnd); node1.addEventListener('webkitTransitionEnd',onEnd);
},600); },600);
var node2=target.$throwxy2(card2,
var node2=target.$throwxy(card2, 'calc(50% + 10px)','calc(50% - 52px)','perspective(600px) rotateY(180deg)',true
'calc(50% + 10px)','calc(50% - 52px)'
); );
node2.classList.add('infohidden'); node2.classList.add('infohidden');
node2.classList.add('thrownhighlight');
node2.style.transform='perspective(600px) rotateY(180deg) translateX(0)'; node2.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
setTimeout(function(){ setTimeout(function(){
node2.style.transition='all ease-in 0.3s'; node2.style.transition='all ease-in 0.3s';
node2.style.transform='perspective(600px) rotateY(270deg) translateX(52px)'; node2.style.transform='perspective(600px) rotateY(270deg) translateX(52px)';
var onEnd=function(){ var onEnd=function(){
node2.classList.remove('infohidden'); node2.classList.remove('infohidden');
node2.classList.add('cardflip'); node2.style.transition='all 0s';
node2.style.transform='none'; ui.refresh(node2);
node2.style.transform='perspective(600px) rotateY(-90deg) translateX(52px)';
ui.refresh(node2);
node2.style.transition=''; node2.style.transition='';
ui.refresh(node2);
node2.style.transform='';
node2.removeEventListener('webkitTransitionEnd',onEnd); node2.removeEventListener('webkitTransitionEnd',onEnd);
} }
// node2.addEventListener('transitionEnd',onEnd); // node2.addEventListener('transitionEnd',onEnd);
node2.addEventListener('webkitTransitionEnd',onEnd); node2.addEventListener('webkitTransitionEnd',onEnd);
},700); },700);
},200); },200);
}, },
$throw:function(card,time,init){ $throw:function(card,time,init){
@ -6179,13 +6190,15 @@
game.addVideo('throw',this,[get.cardsInfo(card),time]); game.addVideo('throw',this,[get.cardsInfo(card),time]);
} }
if(get.itemtype(card)=='cards'){ if(get.itemtype(card)=='cards'){
var node;
for(var i=0;i<card.length;i++){ for(var i=0;i<card.length;i++){
this.$throw(card[i],time,false); node=this.$throw(card[i],time,false);
} }
return node;
} }
else{ else{
if(card==undefined||card.length==0) return; if(card==undefined||card.length==0) return;
if(lib.config.low_performance){ if(false){
var left=-52+(Math.random()<0.5?1:-1)*Math.random()*100; var left=-52+(Math.random()<0.5?1:-1)*Math.random()*100;
var top=-52+(Math.random()<0.5?1:-1)*Math.random()*80; var top=-52+(Math.random()<0.5?1:-1)*Math.random()*80;
@ -6201,9 +6214,19 @@
node.fixed=true; node.fixed=true;
setTimeout(function(){node.delete()},time); setTimeout(function(){node.delete()},time);
} }
lib.listenEnd(node);
return node;
} }
}, },
$throwordered:function(node,nosource){ $throwordered:function(){
if(lib.config.low_performance){
return this.$throwordered2.apply(this,arguments);
}
else{
return this.$throwordered1.apply(this,arguments);
}
},
$throwordered1:function(node,nosource){
node.classList.add('thrown'); node.classList.add('thrown');
node.hide(); node.hide();
node.style.transitionProperty='left,top,opacity,transform'; node.style.transitionProperty='left,top,opacity,transform';
@ -6291,10 +6314,99 @@
ui.refresh(node); ui.refresh(node);
node.style.transform=''; node.style.transform='';
node.show(); node.show();
lib.listenEnd(node);
return node;
},
$throwordered2:function(node,nosource){
node.classList.add('thrown');
node.classList.add('center');
node.hide();
node.style.transitionProperty='left,top,opacity,transform';
if(nosource){
// node.style.transform='scale(0)';
}
else{
var nx=[50,-52];
var ny=[50,-52];
nx=nx[0]*ui.arena.offsetWidth/100+nx[1];
ny=ny[0]*ui.arena.offsetHeight/100+ny[1];
var dx=this.offsetLeft+this.offsetWidth/2-52-nx;
var dy=this.offsetTop+this.offsetHeight/2-52-ny;
if(node.style.transform&&node.style.transform!='none'&&node.style.transform.indexOf('translate')==-1){
node.style.transform+=' translate('+dx+'px,'+dy+'px)';
}
else{
node.style.transform='translate('+dx+'px,'+dy+'px)';
}
}
ui.arena.appendChild(node);
ui.refresh(node);
for(var i=0;i<ui.thrown.length;i++){
if(ui.thrown[i].parentNode!=ui.arena||
ui.thrown[i].classList.contains('removing')){
ui.thrown.splice(i--,1);
}
}
ui.thrown.push(node);
var uithrowns=ui.thrown.slice(0);
var row=0;
var tops;
switch(Math.floor((ui.thrown.length-1)/4)){
case 0:
tops=[0];
break;
case 1:
tops=[-57,57];
break;
case 2:
tops=[-114,0,114];
break;
default:
tops=[-171,-57,57,171];
}
while(uithrowns.length){
var throwns=uithrowns.splice(0,Math.min(uithrowns.length,4));
switch(throwns.length){
case 1:
throwns[0]._transthrown='translate(0px,';
break;
case 2:
throwns[0]._transthrown='translate(-57px,';
throwns[1]._transthrown='translate(57px,';
break;
case 3:
throwns[0]._transthrown='translate(-114px,';
throwns[1]._transthrown='translate(0,';
throwns[2]._transthrown='translate(114px,';
break;
case 4:
throwns[0]._transthrown='translate(-171px,';
throwns[1]._transthrown='translate(-57px,';
throwns[2]._transthrown='translate(57px,';
throwns[3]._transthrown='translate(171px,';
break;
}
var top;
if(tops.length){
top=tops.shift();
}
else{
top=0;
}
for(var i=0;i<throwns.length;i++){
throwns[i].style.transform=throwns[i]._transthrown+top+'px)';
delete throwns[i]._transthrown;
}
}
node.show();
lib.listenEnd(node);
return node; return node;
}, },
$throwxy:function(card,left,top){ $throwxy:function(card,left,top){
var node=card.copy('thrown'); var node=card.copy('thrown','thrownhighlight');
node.dataset.position=this.dataset.position; node.dataset.position=this.dataset.position;
node.hide(); node.hide();
node.style.transitionProperty='left,top,opacity'; node.style.transitionProperty='left,top,opacity';
@ -6304,14 +6416,18 @@
node.show(); node.show();
node.style.left=left; node.style.left=left;
node.style.top=top; node.style.top=top;
lib.listenEnd(node);
return node; return node;
}, },
$throwxy2:function(card,left,top){ $throwxy2:function(card,left,top,trans,flipx,flipy){
var node=card.copy('thrown'); if(lib.config.mode=='chess'){
return this.$throwxy.apply(this,arguments);
}
var node=card.copy('thrown','thrownhighlight');
node.style.left=left; node.style.left=left;
node.style.top=top; node.style.top=top;
node.hide(); node.hide();
node.style.transitionProperty='left,top,opacity,transform'; // node.style.transitionProperty='left,top,opacity,transform';
var parseCalc=function(str){ var parseCalc=function(str){
var per=str.slice(str.indexOf('calc(')+5,str.indexOf('%')); var per=str.slice(str.indexOf('calc(')+5,str.indexOf('%'));
@ -6324,8 +6440,10 @@
ny=ny[0]*ui.arena.offsetHeight/100+ny[1]; ny=ny[0]*ui.arena.offsetHeight/100+ny[1];
var dx=this.offsetLeft+this.offsetWidth/2-52-nx; var dx=this.offsetLeft+this.offsetWidth/2-52-nx;
var dy=this.offsetTop+this.offsetHeight/2-52-ny; var dy=this.offsetTop+this.offsetHeight/2-52-ny;
if(node.style.transform&&node.style.transform!='none'&&node.style.transform.indexOf('translate')==-1){ if(flipx) dx=-dx;
node.style.transform+=' translate('+dx+'px,'+dy+'px)'; if(flipy) dy=-dy;
if(trans){
node.style.transform=trans+' translate('+dx+'px,'+dy+'px)';
} }
else{ else{
node.style.transform='translate('+dx+'px,'+dy+'px)'; node.style.transform='translate('+dx+'px,'+dy+'px)';
@ -6334,7 +6452,8 @@
ui.arena.appendChild(node); ui.arena.appendChild(node);
ui.refresh(node); ui.refresh(node);
node.show(); node.show();
node.style.transform=''; // node.style.transform=trans||'';
lib.listenEnd(node);
return node; return node;
}, },
$give:function(card,player,log,init){ $give:function(card,player,log,init){
@ -6402,6 +6521,7 @@
// node.dataset.position=this.dataset.position; // node.dataset.position=this.dataset.position;
node.fixed=true; node.fixed=true;
this.$throwordered(node); this.$throwordered(node);
lib.listenEnd(node);
// node.hide(); // node.hide();
// node.style.transitionProperty='left,top,opacity'; // node.style.transitionProperty='left,top,opacity';
// //
@ -6504,24 +6624,29 @@
else{ else{
var node; var node;
if(get.itemtype(card)=='card'){ if(get.itemtype(card)=='card'){
node=card.copy('thrown',false); node=this.$throwordered(card,true);
// node=card.copy('thrown',false);
} }
else{ else{
node=ui.create.div('.card.thrown'); node=this.$throwordered(ui.create.div('.card.thrown'),true);
// node=ui.create.div('.card.thrown');
node.moveTo=lib.element.card.moveTo; node.moveTo=lib.element.card.moveTo;
node.moveDelete=lib.element.card.moveDelete;
} }
node.fixed=true; // node.fixed=true;
node.style.left='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*100+'px)'; // node.style.left='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*100+'px)';
node.style.top='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*100+'px)'; // node.style.top='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*100+'px)';
node.style.transform='scale(0)'; // node.style.transform='scale(0)';
// node.hide();
// ui.arena.appendChild(node);
// ui.refresh(node);
// node.show();
// node.style.transform='';
lib.listenEnd(node);
var player=this; var player=this;
node.hide();
ui.arena.appendChild(node);
ui.refresh(node);
node.show();
node.style.transform='';
setTimeout(function(){ setTimeout(function(){
node.moveTo(player).delete(); node.moveDelete(player);
},700); },700);
} }
} }
@ -6531,9 +6656,11 @@
else if(get.itemtype(cards)!='cards') return; else if(get.itemtype(cards)!='cards') return;
var list=[],list2=[]; var list=[],list2=[];
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(cards[i].clone&&cards[i].clone.parentNode==this.parentNode&& if(cards[i].clone&&
(cards[i].clone.parentNode==this.parentNode||
cards[i].clone.parentNode==ui.arena)&&
parseFloat(getComputedStyle(cards[0].clone).opacity)>0.3){ parseFloat(getComputedStyle(cards[0].clone).opacity)>0.3){
cards[i].clone.moveTo(this).delete(); cards[i].clone.moveDelete(this);
list2.push(cards[i].clone); list2.push(cards[i].clone);
} }
else{ else{
@ -6820,11 +6947,16 @@
$phaseJudge:function(card){ $phaseJudge:function(card){
game.addVideo('phaseJudge',this,get.cardInfo(card)); game.addVideo('phaseJudge',this,get.cardInfo(card));
var player=this; var player=this;
var clone=card.copy('thrown','thrownhighlight',ui.arena).animate('judgestart'); var clone;
// var clone=card.copy('thrown','thrownhighlight',ui.arena);
if(lib.config.low_performance){
clone=player.$throw(card);
}
else{
clone=card.copy('thrown','thrownhighlight',ui.arena).animate('judgestart');
clone.style.opacity=0.6; clone.style.opacity=0.6;
clone.style.left='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*50+'px)'; clone.style.left='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*50+'px)';
clone.style.top='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*40+'px)'; clone.style.top='calc(50% - 52px '+((Math.random()-0.5<0)?'+':'-')+' '+Math.random()*40+'px)';
game.delay();
game.linexy([ game.linexy([
clone.offsetLeft+clone.offsetWidth/2, clone.offsetLeft+clone.offsetWidth/2,
clone.offsetTop+clone.offsetHeight/2, clone.offsetTop+clone.offsetHeight/2,
@ -6832,6 +6964,9 @@
player.offsetTop+player.offsetHeight/2 player.offsetTop+player.offsetHeight/2
],{opacity:0.5,dashed:true}); ],{opacity:0.5,dashed:true});
} }
game.delay();
}
}, },
card:{ card:{
init:function(card){ init:function(card){
@ -6925,13 +7060,33 @@
aiexclude:function(){ aiexclude:function(){
_status.event.aiexclude.add(this); _status.event.aiexclude.add(this);
}, },
moveDelete:function(player){
if(!this._listeningEnd||this._transitionEnded){
this.moveTo(player).delete();
}
else{
this._onEndMoveDelete=player;
}
},
moveTo:function(player,method){ moveTo:function(player,method){
this.fixed=true; this.fixed=true;
var dx,dy;
if(this.classList.contains('center')){
var nx=[50,-52];
var ny=[50,-52];
nx=nx[0]*ui.arena.offsetWidth/100+nx[1];
ny=ny[0]*ui.arena.offsetHeight/100+ny[1];
dx=player.offsetLeft+player.offsetWidth/2-52-nx;
dy=player.offsetTop+player.offsetHeight/2-52-ny;
}
else{
this.style.left=this.offsetLeft+'px'; this.style.left=this.offsetLeft+'px';
this.style.top=this.offsetTop+'px'; this.style.top=this.offsetTop+'px';
var dx=player.offsetLeft+player.offsetWidth/2-52-this.offsetLeft; dx=player.offsetLeft+player.offsetWidth/2-52-this.offsetLeft;
var dy=player.offsetTop+player.offsetHeight/2-52-this.offsetTop; dy=player.offsetTop+player.offsetHeight/2-52-this.offsetTop;
}
if(this.style.transform&&this.style.transform!='none'&&this.style.transform.indexOf('translate')==-1){ if(this.style.transform&&this.style.transform!='none'&&this.style.transform.indexOf('translate')==-1){
this.style.transform+=' translate('+dx+'px,'+dy+'px)'; this.style.transform+=' translate('+dx+'px,'+dy+'px)';
} }
@ -6976,6 +7131,7 @@
else if(typeof arguments[i]=='boolean') clone=arguments[i]; else if(typeof arguments[i]=='boolean') clone=arguments[i];
} }
node.moveTo=lib.element.card.moveTo; node.moveTo=lib.element.card.moveTo;
node.moveDelete=lib.element.card.moveDelete;
if(clone) this.clone=node; if(clone) this.clone=node;
if(position) position.appendChild(node); if(position) position.appendChild(node);
return node; return node;
@ -7320,13 +7476,7 @@
}, },
close:function(){ close:function(){
ui.controls.remove(this); ui.controls.remove(this);
if(lib.config.low_performance){
this.remove();
}
else{
this.delete(); this.delete();
}
var that=this; var that=this;
setTimeout(function(){ setTimeout(function(){
@ -8445,7 +8595,7 @@
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
for(var j=0;j<nodes.length;j++){ for(var j=0;j<nodes.length;j++){
if(cards[i][2]==nodes[j].name&&cards[i][0]==nodes[j].suit&&cards[i][1]==nodes[j].number){ if(cards[i][2]==nodes[j].name&&cards[i][0]==nodes[j].suit&&cards[i][1]==nodes[j].number){
nodes[j].moveTo(player).delete(); nodes[j].moveDelete(player);
cards.splice(i--,1); cards.splice(i--,1);
nodes.splice(j--,1); nodes.splice(j--,1);
break; break;
@ -9292,6 +9442,77 @@
} }
}, },
linexy:function(path){ linexy:function(path){
// if(lib.config.mode=='chess'){
// return game._linexy.apply(this,arguments);
// }
var from=[path[0],path[1]];
var to=[path[2],path[3]];
var total=typeof arguments[1]==='number'?arguments[1]:lib.config.duration*2;
var opacity=1;
var color=[255,255,255];
var dashed=lib.config.line_dash;
if(typeof arguments[1]=='object'){
for(var i in arguments[1]){
switch(i){
case 'opacity':opacity=arguments[1][i];break;
case 'color':color=arguments[1][i];break;
case 'dashed':dashed=arguments[1][i];break;
case 'duration':total=arguments[1][i];break;
}
}
}
else if(arguments[1]=='fire'||arguments[1]=='thunder'||arguments[1]=='green'){
color=arguments[1];
}
if(color=='fire'){
color=[255, 146, 68];
}
else if(color=='thunder'){
color=[141, 216, 255];
}
else if(color=='green'){
color=[141, 255, 216];
}
var node=ui.create.div('.linexy.hidden');
node.style.transitionDuration=(total/3000)+'s';
node.style.left=from[0]+'px';
node.style.top=from[1]+'px';
node.style.backgroundColor='rgba('+color.toString()+','+opacity+')';
var dy=to[1]-from[1];
var dx=to[0]-from[0];
var deg=Math.atan(Math.abs(dy)/Math.abs(dx))/Math.PI*180;
if(dx>=0){
if(dy<=0){
deg+=90;
}
else{
deg=90-deg;
}
}
else{
if(dy<=0){
deg=270-deg;
}
else{
deg+=270;
}
}
node.style.transform='rotate('+(-deg)+'deg) scaleY(0)';
node.style.height=get.xyDistance(from,to)+'px';
if(lib.config.mode=='chess'){
ui.chess.appendChild(node);
}
else{
ui.arena.appendChild(node);
}
ui.refresh(node);
node.show();
node.style.transform='rotate('+(-deg)+'deg) scaleY(1)';
setTimeout(function(){
node.delete();
},total/1.5);
},
_linexy:function(path){
var from=[path[0],path[1]]; var from=[path[0],path[1]];
var to=[path[2],path[3]]; var to=[path[2],path[3]];
var total=typeof arguments[1]==='number'?arguments[1]:lib.config.duration*2; var total=typeof arguments[1]==='number'?arguments[1]:lib.config.duration*2;
@ -10045,6 +10266,8 @@
if(!event.forced&&get.noSelected()) str+='c'; if(!event.forced&&get.noSelected()) str+='c';
ui.create.confirm(str); ui.create.confirm(str);
} }
}
}
if(ui.confirm&&ui.confirm.lastChild.link=='cancel'){ if(ui.confirm&&ui.confirm.lastChild.link=='cancel'){
if(_status.event.parent.name=='phaseUse'&&!_status.event.skill){ if(_status.event.parent.name=='phaseUse'&&!_status.event.skill){
ui.confirm.lastChild.innerHTML='结束'; ui.confirm.lastChild.innerHTML='结束';
@ -10054,8 +10277,6 @@
} }
} }
} }
}
}
return ok; return ok;
}, },
uncheck:function(){ uncheck:function(){
@ -11145,7 +11366,7 @@
if(nc){ if(nc){
ui.control.animate('nozoom',500); ui.control.animate('nozoom',500);
} }
if(lib.config.low_performance||ui.control.classList.contains('nozoom')){ if(ui.control.classList.contains('nozoom')){
nozoom=true; nozoom=true;
} }
if(nozoom){ if(nozoom){
@ -13619,8 +13840,8 @@
player:function(position){ player:function(position){
var node=ui.create.div('.player',position); var node=ui.create.div('.player',position);
node.node={ node.node={
avatar:ui.create.div('.avatar',node).hide(), avatar:ui.create.div('.avatar',node,ui.click.avatar).hide(),
avatar2:ui.create.div('.avatar2',node).hide(), avatar2:ui.create.div('.avatar2',node,ui.click.avatar2).hide(),
intro:ui.create.div('.intro',node), intro:ui.create.div('.intro',node),
identity:ui.create.div('.identity',node), identity:ui.create.div('.identity',node),
hp:ui.create.div('.hp',node), hp:ui.create.div('.hp',node),
@ -14573,6 +14794,84 @@
} }
game.check(); game.check();
}, },
avatar:function(){
if(!lib.config.change_skin) return;
if(this.parentNode.classList.contains('unseen')) return;
var avatar=this;
var player=this.parentNode;
if(!this._doubleClicking){
this._doubleClicking=true;
setTimeout(function(){
avatar._doubleClicking=false;
},500);
return;
}
var num=1;
if(lib.config.skin[player.name]){
num=lib.config.skin[player.name]+1;
}
var img=new Image();
img.onload=function(){
lib.config.skin[player.name]=num;
game.saveConfig('skin',lib.config.skin);
avatar.style.backgroundImage='url("'+img.src+'")';
}
img.onerror=function(){
delete lib.config.skin[player.name];
game.saveConfig('skin',lib.config.skin);
if(player.classList.contains('fullskin')){
avatar.setBackground(player.name,'character',null,'fullskin');
}
else{
avatar.setBackground(player.name,'character');
}
}
if(player.classList.contains('fullskin')){
img.src='image/character/skin/'+player.name+'/'+num+'f.jpg';
}
else{
img.src='image/character/skin/'+player.name+'/'+num+'f.jpg';
}
},
avatar2:function(){
if(!lib.config.change_skin) return;
if(this.parentNode.classList.contains('unseen2')) return;
var avatar=this;
var player=this.parentNode;
if(!this._doubleClicking){
this._doubleClicking=true;
setTimeout(function(){
avatar._doubleClicking=false;
},500);
return;
}
var num=1;
if(lib.config.skin[player.name2]){
num=lib.config.skin[player.name2]+1;
}
var img=new Image();
img.onload=function(){
lib.config.skin[player.name2]=num;
game.saveConfig('skin',lib.config.skin);
avatar.style.backgroundImage='url("'+img.src+'")';
}
img.onerror=function(){
delete lib.config.skin[player.name2];
game.saveConfig('skin',lib.config.skin);
if(player.classList.contains('fullskin2')){
avatar.setBackground(player.name2,'character',null,'fullskin');
}
else{
avatar.setBackground(player.name2,'character');
}
}
if(player.classList.contains('fullskin2')){
img.src='image/character/skin/'+player.name2+'/'+num+'f.jpg';
}
else{
img.src='image/character/skin/'+player.name2+'/'+num+'f.jpg';
}
},
player:function(){ player:function(){
return ui.click.target.apply(this,arguments); return ui.click.target.apply(this,arguments);
}, },
@ -15680,6 +15979,9 @@
evtDistance:function(e1,e2){ evtDistance:function(e1,e2){
return Math.sqrt((e1.x-e2.x)*(e1.x-e2.x)+(e1.y-e2.y)*(e1.y-e2.y)); return Math.sqrt((e1.x-e2.x)*(e1.x-e2.x)+(e1.y-e2.y)*(e1.y-e2.y));
}, },
xyDistance:function(from,to){
return Math.sqrt((from[0]-to[0])*(from[0]-to[0])+(from[1]-to[1])*(from[1]-to[1]));
},
skillLocked:function(skill){ skillLocked:function(skill){
var info=lib.skill[skill]; var info=lib.skill[skill];
if(info.locked==false) return false; if(info.locked==false) return false;
@ -17136,12 +17438,8 @@
}; };
HTMLDivElement.prototype.goto=function(position,time){ HTMLDivElement.prototype.goto=function(position,time){
if(time==undefined) time=500; if(time==undefined) time=500;
if(lib.config.low_performance){
this.remove();
}
else{
this.classList.add('removing'); this.classList.add('removing');
}
var that=this; var that=this;
this.timeout=setTimeout(function(){ this.timeout=setTimeout(function(){
position.appendChild(that); position.appendChild(that);
@ -17162,8 +17460,14 @@
ext=ext||'.jpg'; ext=ext||'.jpg';
subfolder=subfolder||'default' subfolder=subfolder||'default'
if(type){ if(type){
if(type=='character'&&lib.config.skin[name]){
src='image/character/skin/'+name+'/'+lib.config.skin[name]+
(subfolder=='fullskin'?'f':'')+ext;
}
else{
src='image/'+type+'/'+subfolder+'/'+name+ext; src='image/'+type+'/'+subfolder+'/'+name+ext;
} }
}
else{ else{
src='image/'+name+ext; src='image/'+name+ext;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -34,7 +34,14 @@ table{table-layout: fixed;}
#arena.playerfocus #chess>div:not(.playerfocus):not(.removing){ #arena.playerfocus #chess>div:not(.playerfocus):not(.removing){
opacity: 0.3 !important; opacity: 0.3 !important;
} }
.linexy{
transition-property: transform,opacity;
width: 3px;
border-radius: 4px;
z-index: 4;
box-shadow: rgba(0,0,0,0.5) 0 0 2px;
transform-origin: top center;
}
#me,#mebg{width: 100%;height: 140px;top:calc(100% - 140px);left:0;} #me,#mebg{width: 100%;height: 140px;top:calc(100% - 140px);left:0;}
#mebg{z-index:-1} #mebg{z-index:-1}
#handcards1,#handcards2{width: calc(50% - 140px);height: 127px;padding: 10px;} #handcards1,#handcards2{width: calc(50% - 140px);height: 127px;padding: 10px;}
@ -130,7 +137,9 @@ body>.background{z-index:-2}
} }
.card.cardflip{ .card.cardflip{
animation:cardflip 0.3s ease-out; animation:cardflip 0.3s ease-out;
animation-fill-mode: none;
-webkit-animation:cardflip 0.3s ease-out; -webkit-animation:cardflip 0.3s ease-out;
-webkit-animation-fill-mode:none;
} }
.player .playerjiu{ .player .playerjiu{
animation:game_start 0.5s; animation:game_start 0.5s;
@ -276,6 +285,10 @@ margin-bottom: 5px;
font-size: 20px; font-size: 20px;
letter-spacing: -2px; letter-spacing: -2px;
} }
.player>.avatar.hidden,
.player>.avatar2.hidden{
pointer-events: none !important;
}
.player>.avatar>.action:not(.freecolor){ .player>.avatar>.action:not(.freecolor){
text-shadow: black 0 0 1px, rgba(10, 155, 67, 1) 0 0 5px, rgba(10, 155, 67, 1) 0 0 10px; text-shadow: black 0 0 1px, rgba(10, 155, 67, 1) 0 0 5px, rgba(10, 155, 67, 1) 0 0 10px;
} }
@ -555,6 +568,7 @@ margin-bottom: 5px;
#arena.thrownhighlight>.card.thrown:not(.thrownhighlight){ #arena.thrownhighlight>.card.thrown:not(.thrownhighlight){
opacity: 0.5; opacity: 0.5;
transform:scale(0.95); transform:scale(0.95);
/*-webkit-filter:blur(3px);*/
} }
.card.start{ .card.start{
animation: card_start 0.5s; animation: card_start 0.5s;

View File

@ -504,7 +504,7 @@ mode.chess={
} }
}, },
$throwxy:function(card,left,top,transform){ $throwxy:function(card,left,top,transform){
var node=card.copy('thrown'); var node=card.copy('thrown','thrownhighlight');
var rect=this.getBoundingClientRect(); var rect=this.getBoundingClientRect();
node.style.left=(rect.left+8)+'px'; node.style.left=(rect.left+8)+'px';
node.style.top=(rect.top+8)+'px'; node.style.top=(rect.top+8)+'px';
@ -1280,7 +1280,7 @@ mode.chess={
next.player=mech; next.player=mech;
next.content=info.content; next.content=info.content;
mech.chessFocus(); mech.chessFocus();
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
mech.$epic2(); mech.$epic2();
} }
game.delay(); game.delay();
@ -1429,7 +1429,7 @@ mode.chess={
var name=Array.prototype.randomGet.apply(lib.treasurelist,list); var name=Array.prototype.randomGet.apply(lib.treasurelist,list);
var treasure=game.addChessPlayer(name,'treasure',0); var treasure=game.addChessPlayer(name,'treasure',0);
treasure.playerfocus(1500); treasure.playerfocus(1500);
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
setTimeout(function(){ setTimeout(function(){
treasure.$rare2(); treasure.$rare2();
},500); },500);
@ -2418,7 +2418,7 @@ mode.chess={
node.classList.add('playerflip'); node.classList.add('playerflip');
node.style.transform='none'; node.style.transform='none';
node.style.transition=''; node.style.transition='';
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
setTimeout(function(){ setTimeout(function(){
switch(game.getRarity(node.name)){ switch(game.getRarity(node.name)){
case 'rare':node.$rare();break; case 'rare':node.$rare();break;
@ -3147,7 +3147,7 @@ mode.chess={
node.classList.add('playerflip'); node.classList.add('playerflip');
node.style.transform='none'; node.style.transform='none';
node.style.transition=''; node.style.transition='';
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
setTimeout(function(){ setTimeout(function(){
switch(game.getRarity(node.name)){ switch(game.getRarity(node.name)){
case 'rare':node.$rare();break; case 'rare':node.$rare();break;
@ -3952,7 +3952,7 @@ mode.chess={
source.chessFocus(); source.chessFocus();
source.playerfocus(1000); source.playerfocus(1000);
source.line(player,'thunder'); source.line(player,'thunder');
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
setTimeout(function(){ setTimeout(function(){
source.$epic2(); source.$epic2();
},300); },300);
@ -3996,7 +3996,7 @@ mode.chess={
source.chessFocus(); source.chessFocus();
source.playerfocus(1000); source.playerfocus(1000);
source.line(player,'thunder'); source.line(player,'thunder');
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
setTimeout(function(){ setTimeout(function(){
source.$epic2(); source.$epic2();
},300); },300);
@ -4043,7 +4043,7 @@ mode.chess={
source.chessFocus(); source.chessFocus();
source.playerfocus(1000); source.playerfocus(1000);
source.line(player,'thunder'); source.line(player,'thunder');
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
setTimeout(function(){ setTimeout(function(){
source.$epic2(); source.$epic2();
},300); },300);
@ -4097,7 +4097,7 @@ mode.chess={
source.chessFocus(); source.chessFocus();
source.playerfocus(1000); source.playerfocus(1000);
source.line(player,'thunder'); source.line(player,'thunder');
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
setTimeout(function(){ setTimeout(function(){
source.$epic2(); source.$epic2();
},300); },300);
@ -4145,7 +4145,7 @@ mode.chess={
source.chessFocus(); source.chessFocus();
source.playerfocus(1000); source.playerfocus(1000);
source.line(player,'thunder'); source.line(player,'thunder');
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
setTimeout(function(){ setTimeout(function(){
source.$epic2(); source.$epic2();
},300); },300);
@ -4189,7 +4189,7 @@ mode.chess={
source.chessFocus(); source.chessFocus();
source.playerfocus(1000); source.playerfocus(1000);
source.line(player,'thunder'); source.line(player,'thunder');
if(lib.config.animation){ if(lib.config.animation&&!lib.config.low_performance){
setTimeout(function(){ setTimeout(function(){
source.$epic2(); source.$epic2();
},300); },300);

View File

@ -595,7 +595,7 @@ mode.identity={
game.zhu.setIdentity(); game.zhu.setIdentity();
game.zhu.isZhu=true; game.zhu.isZhu=true;
delete game.zhong; delete game.zhong;
if(lib.config.animation) game.zhu.$legend(); if(lib.config.animation&&!lib.config.low_performance) game.zhu.$legend();
game.delay(2); game.delay(2);
game.zhu.playerfocus(1000); game.zhu.playerfocus(1000);
} }

View File

@ -45,8 +45,9 @@ mode.versus={
if(lib.storage.single_control==undefined) game.save('single_control',true); if(lib.storage.single_control==undefined) game.save('single_control',true);
if(lib.storage.number==undefined) game.save('number',3); if(lib.storage.number==undefined) game.save('number',3);
if(lib.storage.versus_reward==undefined) game.save('versus_reward',3); if(lib.storage.versus_reward==undefined) game.save('versus_reward',3);
if(lib.storage.versus_punish==undefined) game.save('versus_punish','弃牌');
if(lib.storage.replace_number==undefined) game.save('replace_number',3); if(lib.storage.replace_number==undefined) game.save('replace_number',3);
if(lib.storage.control_all==undefined) game.save('control_all',true); // if(lib.storage.control_all==undefined) game.save('control_all',true);
switch(lib.storage.seat_order){ switch(lib.storage.seat_order){
case '交叉':lib.storage.cross_seat=true;lib.storage.random_seat=false;break; case '交叉':lib.storage.cross_seat=true;lib.storage.random_seat=false;break;
@ -54,6 +55,7 @@ mode.versus={
default:lib.storage.cross_seat=false;lib.storage.random_seat=false; default:lib.storage.cross_seat=false;lib.storage.random_seat=false;
} }
game.save('only_zhu',true); game.save('only_zhu',true);
game.save('control_all',true);
ui.create.arena(); ui.create.arena();
ui.create.cards(); ui.create.cards();
@ -125,9 +127,10 @@ mode.versus={
this.dialog.versus_noreplace_end=this.dialog.add(ui.create.switcher('versus_noreplace_end',lib.storage.noreplace_end)).querySelector('.toggle'); this.dialog.versus_noreplace_end=this.dialog.add(ui.create.switcher('versus_noreplace_end',lib.storage.noreplace_end)).querySelector('.toggle');
this.dialog.versus_assign_enemy=this.dialog.add(ui.create.switcher('versus_assign_enemy',lib.storage.assign_enemy)).querySelector('.toggle'); this.dialog.versus_assign_enemy=this.dialog.add(ui.create.switcher('versus_assign_enemy',lib.storage.assign_enemy)).querySelector('.toggle');
this.dialog.versus_single_control=this.dialog.add(ui.create.switcher('versus_single_control',lib.storage.single_control)).querySelector('.toggle'); this.dialog.versus_single_control=this.dialog.add(ui.create.switcher('versus_single_control',lib.storage.single_control)).querySelector('.toggle');
this.dialog.versus_control_all=this.dialog.add(ui.create.switcher('versus_control_all',lib.storage.control_all)).querySelector('.toggle'); // this.dialog.versus_control_all=this.dialog.add(ui.create.switcher('versus_control_all',lib.storage.control_all)).querySelector('.toggle');
this.dialog.versus_die_stop=this.dialog.add(ui.create.switcher('versus_die_stop',lib.storage.die_stop)).querySelector('.toggle'); this.dialog.versus_die_stop=this.dialog.add(ui.create.switcher('versus_die_stop',lib.storage.die_stop)).querySelector('.toggle');
this.dialog.versus_reward=this.dialog.add(ui.create.switcher('versus_reward',[0,1,2,3,4],lib.storage.versus_reward)).querySelector('.toggle'); this.dialog.versus_reward=this.dialog.add(ui.create.switcher('versus_reward',[0,1,2,3,4],lib.storage.versus_reward)).querySelector('.toggle');
this.dialog.versus_punish=this.dialog.add(ui.create.switcher('versus_punish',['弃牌','无','摸牌'],lib.storage.versus_punish)).querySelector('.toggle');
this.dialog.versus_seat_order=this.dialog.add(ui.create.switcher('seat_order',['对阵','交叉','随机'],lib.storage.seat_order)).querySelector('.toggle'); this.dialog.versus_seat_order=this.dialog.add(ui.create.switcher('seat_order',['对阵','交叉','随机'],lib.storage.seat_order)).querySelector('.toggle');
this.dialog.versus_number=this.dialog.add(ui.create.switcher('versus_number',[1,2,3],lib.storage.number)).querySelector('.toggle'); this.dialog.versus_number=this.dialog.add(ui.create.switcher('versus_number',[1,2,3],lib.storage.number)).querySelector('.toggle');
this.dialog.replace_number=this.dialog.add(ui.create.switcher('replace_number',[0,1,2,3,5,7,9,17],lib.storage.replace_number)).querySelector('.toggle'); this.dialog.replace_number=this.dialog.add(ui.create.switcher('replace_number',[0,1,2,3,5,7,9,17],lib.storage.replace_number)).querySelector('.toggle');
@ -145,12 +148,12 @@ mode.versus={
// this.dialog.versus_cross_seat.parentNode.classList.remove('disabled'); // this.dialog.versus_cross_seat.parentNode.classList.remove('disabled');
// } // }
// } // }
if(lib.storage.single_control){ // if(lib.storage.single_control){
this.dialog.versus_control_all.parentNode.classList.remove('disabled'); // this.dialog.versus_control_all.parentNode.classList.remove('disabled');
} // }
else{ // else{
this.dialog.versus_control_all.parentNode.classList.add('disabled'); // this.dialog.versus_control_all.parentNode.classList.add('disabled');
} // }
}; };
event.confirm=function(){ event.confirm=function(){
var dialog=event.dialog; var dialog=event.dialog;
@ -358,16 +361,17 @@ mode.versus={
case '随机':lib.storage.cross_seat=false;lib.storage.random_seat=true;break; case '随机':lib.storage.cross_seat=false;lib.storage.random_seat=true;break;
default:lib.storage.cross_seat=false;lib.storage.random_seat=false; default:lib.storage.cross_seat=false;lib.storage.random_seat=false;
} }
if(lib.storage.single_control){ // if(lib.storage.single_control){
dialog.versus_control_all.parentNode.classList.remove('disabled'); // dialog.versus_control_all.parentNode.classList.remove('disabled');
} // }
else{ // else{
dialog.versus_control_all.parentNode.classList.add('disabled'); // dialog.versus_control_all.parentNode.classList.add('disabled');
} // }
game.save('control_all',dialog.versus_control_all.link); // game.save('control_all',dialog.versus_control_all.link);
game.save('die_stop',dialog.versus_die_stop.link); game.save('die_stop',dialog.versus_die_stop.link);
game.save('number',dialog.versus_number.link); game.save('number',dialog.versus_number.link);
game.save('versus_reward',dialog.versus_reward.link); game.save('versus_reward',dialog.versus_reward.link);
game.save('versus_punish',dialog.versus_punish.link);
game.save('replace_number',dialog.replace_number.link); game.save('replace_number',dialog.replace_number.link);
game.save('choice',dialog.choice.link); game.save('choice',dialog.choice.link);
var count,i; var count,i;
@ -1038,6 +1042,7 @@ mode.versus={
seat_order_config:'座位排列', seat_order_config:'座位排列',
versus_control_all_config:'固定控制位置', versus_control_all_config:'固定控制位置',
versus_reward_config:'杀敌摸牌', versus_reward_config:'杀敌摸牌',
versus_punish_config:'杀死队友',
versus_number_config:'对阵人数', versus_number_config:'对阵人数',
replace_number_config:'替补人数', replace_number_config:'替补人数',
choice_config:'候选人数' choice_config:'候选人数'
@ -1121,11 +1126,18 @@ mode.versus={
else{ else{
if(source){ if(source){
if(source.side!=this.side){ if(source.side!=this.side){
if(lib.storage.versus_reward){
source.draw(lib.storage.versus_reward); source.draw(lib.storage.versus_reward);
} }
}
else{ else{
if(lib.storage.versus_punish=='弃牌'){
source.discard(source.get('he')); source.discard(source.get('he'));
} }
else if(lib.storage.versus_punish=='摸牌'&&lib.storage.versus_reward){
source.draw(lib.storage.versus_reward);
}
}
} }
else{ else{
game.delay(); game.delay();