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
低性能模式改进

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,6 +30,17 @@
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:{
general:{
name:'通用',
@ -56,6 +67,11 @@
},
unfrequent:true,
},
low_performance:{
name:'低性能模式',
init:false,
unfrequent:true,
},
confirm_exit:{
name:'确认退出',
init:false,
@ -84,9 +100,9 @@
init:false,
restart:true
},
low_performance:{
name:'低性能模式',
init:false
change_skin:{
name:'双击换肤',
init:true
},
game_speed:{
name:'游戏速度',
@ -2237,7 +2253,7 @@
game.delayx();
}
"step 2"
if(!player.skipList.contains('phaseUse')) player.popup('出牌阶段');
// if(!player.skipList.contains('phaseUse')) player.popup('出牌阶段');
player.phaseUse();
"step 3"
player.phaseDiscard()
@ -3235,7 +3251,7 @@
else if(info.audio){
game.playAudio('skill',event.skill);
}
else if(lib.config.background_ogg){
else if(lib.config.background_ogg&&info.audio!==false){
game.playSkillAudio(event.skill);
}
}
@ -3471,9 +3487,7 @@
sort=lib.config.sort_card(cards[num]);
if(lib.config.reverse_sort) sort=-sort;
cards[num].fix();
if(!lib.config.low_performance){
cards[num].animate('start');
}
if(lib.isSingleHandcard()||sort>0) frag1.appendChild(cards[num]);
else frag2.appendChild(cards[num]);
@ -3544,15 +3558,10 @@
if(event.position){
cards[i].goto(event.position);
}
else{
if(lib.config.low_performance){
cards[i].remove();
}
else{
cards[i].delete();
}
}
}
game.addVideo('lose',player,[get.cardsInfo(hs),get.cardsInfo(es),get.cardsInfo(js)]);
player.update();
game.addVideo('loseAfter',player);
@ -3639,7 +3648,7 @@
player.changeHp(-num,false);
if(event.animate!==false){
player.$damage(source);
if(lib.config.animation){
if(lib.config.animation&&!lib.config.low_performance){
if(event.nature=='fire'){
player.$fire();
}
@ -3691,7 +3700,7 @@
if(num>player.maxHp-player.hp) num=player.maxHp-player.hp;
if(num>0){
player.changeHp(num,false);
if(lib.config.animation){
if(lib.config.animation&&!lib.config.low_performance){
player.$damagepop(num,'wood');
player.$recover();
}
@ -3880,7 +3889,7 @@
if(get.owner(card)) get.owner(card).lose(card,ui.special);
if(card.clone){
card.clone.moveTo(player).delete();
card.clone.moveDelete(player);
game.addVideo('gain2',player,get.cardsInfo([card.clone]));
}
@ -3925,7 +3934,11 @@
}
else{
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(typeof card=='string') cards[0].viewAs=card;
else cards[0].viewAs=card.name;
@ -4018,17 +4031,12 @@
if(!game.minskin&&lib.isNewLayout()&&info[4].contains('fullskin')){
this.classList.remove('minskin');
this.classList.add('fullskin');
if(lib.fakeavatar&&lib.fakeavatar[character]){
this.node.avatar.setBackground('character/fullskin/'+lib.fakeavatar[character]);
}
else{
this.node.avatar.setBackground('character/fullskin/'+character);
}
this.node.avatar.setBackground(character,'character',null,'fullskin');
}
else{
if(info[4].contains('fullskin')){
this.classList.add('fullskin');
this.node.avatar.setBackground('character/fullskin/'+character);
this.node.avatar.setBackground(character,'character',null,'fullskin');
}
else{
this.classList.remove('fullskin');
@ -4076,17 +4084,12 @@
if(lib.isNewLayout()&&lib.config.only_fullskin){
this.classList.add('fullskin2');
if(lib.fakeavatar&&lib.fakeavatar[character2]){
this.node.avatar2.setBackground('character/fullskin/'+lib.fakeavatar[character2]);
}
else{
this.node.avatar2.setBackground('character/fullskin/'+character2);
}
this.node.avatar2.setBackground(character2,'character',null,'fullskin');
}
else{
if(info2[4].contains('fullskin')){
this.classList.add('fullskin2');
this.node.avatar2.setBackground('character/fullskin/'+character2);
this.node.avatar2.setBackground(character2,'character',null,'fullskin');
}
else{
this.classList.remove('fullskin2');
@ -5267,7 +5270,7 @@
}
for(var i=0;i<cards.length;i++){
var sort=lib.config.sort_card(cards[i]);
if(animate!==false&&!lib.config.low_performance){
if(animate!==false){
cards[i].animate('start');
}
if(lib.isSingleHandcard()||sort>0){
@ -5626,7 +5629,7 @@
game.playAudio('skill',name);
}
else{
if(lib.config.background_ogg){
if(lib.config.background_ogg&&info.audio!==false){
game.playSkillAudio(name);
}
}
@ -6060,6 +6063,10 @@
return null;
},
$draw:function(num,init){
// if(lib.config.low_performance){
// this.$gain(num,false,init);
// return;
// }
var cards,node;
if(get.itemtype(num)=='cards'){
cards=num;
@ -6122,11 +6129,10 @@
$compare:function(card1,target,card2){
game.addVideo('compare',this,[get.cardInfo(card1),target.dataset.position,get.cardInfo(card2)]);
var player=this;
var node1=player.$throwxy(card1,
'calc(50% - 114px)','calc(50% - 52px)'
var node1=player.$throwxy2(card1,
'calc(50% - 114px)','calc(50% - 52px)','perspective(600px) rotateY(180deg)',true
);
node1.classList.add('infohidden');
node1.classList.add('thrownhighlight');
node1.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
setTimeout(function(){
setTimeout(function(){
@ -6134,36 +6140,41 @@
node1.style.transform='perspective(600px) rotateY(270deg) translateX(52px)';
var onEnd=function(){
node1.classList.remove('infohidden');
node1.classList.add('cardflip');
node1.style.transform='none';
node1.style.transition='all 0s';
ui.refresh(node1);
node1.style.transform='perspective(600px) rotateY(-90deg) translateX(52px)';
ui.refresh(node1);
node1.style.transition='';
ui.refresh(node1);
node1.style.transform='';
node1.removeEventListener('webkitTransitionEnd',onEnd);
}
// node1.addEventListener('transitionEnd',onEnd);
node1.addEventListener('webkitTransitionEnd',onEnd);
},600);
var node2=target.$throwxy(card2,
'calc(50% + 10px)','calc(50% - 52px)'
var node2=target.$throwxy2(card2,
'calc(50% + 10px)','calc(50% - 52px)','perspective(600px) rotateY(180deg)',true
);
node2.classList.add('infohidden');
node2.classList.add('thrownhighlight');
node2.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
setTimeout(function(){
node2.style.transition='all ease-in 0.3s';
node2.style.transform='perspective(600px) rotateY(270deg) translateX(52px)';
var onEnd=function(){
node2.classList.remove('infohidden');
node2.classList.add('cardflip');
node2.style.transform='none';
node2.style.transition='all 0s';
ui.refresh(node2);
node2.style.transform='perspective(600px) rotateY(-90deg) translateX(52px)';
ui.refresh(node2);
node2.style.transition='';
ui.refresh(node2);
node2.style.transform='';
node2.removeEventListener('webkitTransitionEnd',onEnd);
}
// node2.addEventListener('transitionEnd',onEnd);
node2.addEventListener('webkitTransitionEnd',onEnd);
},700);
},200);
},
$throw:function(card,time,init){
@ -6179,13 +6190,15 @@
game.addVideo('throw',this,[get.cardsInfo(card),time]);
}
if(get.itemtype(card)=='cards'){
var node;
for(var i=0;i<card.length;i++){
this.$throw(card[i],time,false);
node=this.$throw(card[i],time,false);
}
return node;
}
else{
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 top=-52+(Math.random()<0.5?1:-1)*Math.random()*80;
@ -6201,9 +6214,19 @@
node.fixed=true;
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.hide();
node.style.transitionProperty='left,top,opacity,transform';
@ -6291,10 +6314,99 @@
ui.refresh(node);
node.style.transform='';
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;
},
$throwxy:function(card,left,top){
var node=card.copy('thrown');
var node=card.copy('thrown','thrownhighlight');
node.dataset.position=this.dataset.position;
node.hide();
node.style.transitionProperty='left,top,opacity';
@ -6304,14 +6416,18 @@
node.show();
node.style.left=left;
node.style.top=top;
lib.listenEnd(node);
return node;
},
$throwxy2:function(card,left,top){
var node=card.copy('thrown');
$throwxy2:function(card,left,top,trans,flipx,flipy){
if(lib.config.mode=='chess'){
return this.$throwxy.apply(this,arguments);
}
var node=card.copy('thrown','thrownhighlight');
node.style.left=left;
node.style.top=top;
node.hide();
node.style.transitionProperty='left,top,opacity,transform';
// node.style.transitionProperty='left,top,opacity,transform';
var parseCalc=function(str){
var per=str.slice(str.indexOf('calc(')+5,str.indexOf('%'));
@ -6324,8 +6440,10 @@
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)';
if(flipx) dx=-dx;
if(flipy) dy=-dy;
if(trans){
node.style.transform=trans+' translate('+dx+'px,'+dy+'px)';
}
else{
node.style.transform='translate('+dx+'px,'+dy+'px)';
@ -6334,7 +6452,8 @@
ui.arena.appendChild(node);
ui.refresh(node);
node.show();
node.style.transform='';
// node.style.transform=trans||'';
lib.listenEnd(node);
return node;
},
$give:function(card,player,log,init){
@ -6402,6 +6521,7 @@
// node.dataset.position=this.dataset.position;
node.fixed=true;
this.$throwordered(node);
lib.listenEnd(node);
// node.hide();
// node.style.transitionProperty='left,top,opacity';
//
@ -6504,24 +6624,29 @@
else{
var node;
if(get.itemtype(card)=='card'){
node=card.copy('thrown',false);
node=this.$throwordered(card,true);
// node=card.copy('thrown',false);
}
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.moveDelete=lib.element.card.moveDelete;
}
node.fixed=true;
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.transform='scale(0)';
// node.fixed=true;
// 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.transform='scale(0)';
// node.hide();
// ui.arena.appendChild(node);
// ui.refresh(node);
// node.show();
// node.style.transform='';
lib.listenEnd(node);
var player=this;
node.hide();
ui.arena.appendChild(node);
ui.refresh(node);
node.show();
node.style.transform='';
setTimeout(function(){
node.moveTo(player).delete();
node.moveDelete(player);
},700);
}
}
@ -6531,9 +6656,11 @@
else if(get.itemtype(cards)!='cards') return;
var list=[],list2=[];
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){
cards[i].clone.moveTo(this).delete();
cards[i].clone.moveDelete(this);
list2.push(cards[i].clone);
}
else{
@ -6820,11 +6947,16 @@
$phaseJudge:function(card){
game.addVideo('phaseJudge',this,get.cardInfo(card));
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.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)';
game.delay();
game.linexy([
clone.offsetLeft+clone.offsetWidth/2,
clone.offsetTop+clone.offsetHeight/2,
@ -6832,6 +6964,9 @@
player.offsetTop+player.offsetHeight/2
],{opacity:0.5,dashed:true});
}
game.delay();
}
},
card:{
init:function(card){
@ -6925,13 +7060,33 @@
aiexclude:function(){
_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){
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.top=this.offsetTop+'px';
var dx=player.offsetLeft+player.offsetWidth/2-52-this.offsetLeft;
var dy=player.offsetTop+player.offsetHeight/2-52-this.offsetTop;
dx=player.offsetLeft+player.offsetWidth/2-52-this.offsetLeft;
dy=player.offsetTop+player.offsetHeight/2-52-this.offsetTop;
}
if(this.style.transform&&this.style.transform!='none'&&this.style.transform.indexOf('translate')==-1){
this.style.transform+=' translate('+dx+'px,'+dy+'px)';
}
@ -6976,6 +7131,7 @@
else if(typeof arguments[i]=='boolean') clone=arguments[i];
}
node.moveTo=lib.element.card.moveTo;
node.moveDelete=lib.element.card.moveDelete;
if(clone) this.clone=node;
if(position) position.appendChild(node);
return node;
@ -7320,13 +7476,7 @@
},
close:function(){
ui.controls.remove(this);
if(lib.config.low_performance){
this.remove();
}
else{
this.delete();
}
var that=this;
setTimeout(function(){
@ -8445,7 +8595,7 @@
for(var i=0;i<cards.length;i++){
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){
nodes[j].moveTo(player).delete();
nodes[j].moveDelete(player);
cards.splice(i--,1);
nodes.splice(j--,1);
break;
@ -9292,6 +9442,77 @@
}
},
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 to=[path[2],path[3]];
var total=typeof arguments[1]==='number'?arguments[1]:lib.config.duration*2;
@ -10045,6 +10266,8 @@
if(!event.forced&&get.noSelected()) str+='c';
ui.create.confirm(str);
}
}
}
if(ui.confirm&&ui.confirm.lastChild.link=='cancel'){
if(_status.event.parent.name=='phaseUse'&&!_status.event.skill){
ui.confirm.lastChild.innerHTML='结束';
@ -10054,8 +10277,6 @@
}
}
}
}
}
return ok;
},
uncheck:function(){
@ -11145,7 +11366,7 @@
if(nc){
ui.control.animate('nozoom',500);
}
if(lib.config.low_performance||ui.control.classList.contains('nozoom')){
if(ui.control.classList.contains('nozoom')){
nozoom=true;
}
if(nozoom){
@ -13619,8 +13840,8 @@
player:function(position){
var node=ui.create.div('.player',position);
node.node={
avatar:ui.create.div('.avatar',node).hide(),
avatar2:ui.create.div('.avatar2',node).hide(),
avatar:ui.create.div('.avatar',node,ui.click.avatar).hide(),
avatar2:ui.create.div('.avatar2',node,ui.click.avatar2).hide(),
intro:ui.create.div('.intro',node),
identity:ui.create.div('.identity',node),
hp:ui.create.div('.hp',node),
@ -14573,6 +14794,84 @@
}
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(){
return ui.click.target.apply(this,arguments);
},
@ -15680,6 +15979,9 @@
evtDistance:function(e1,e2){
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){
var info=lib.skill[skill];
if(info.locked==false) return false;
@ -17136,12 +17438,8 @@
};
HTMLDivElement.prototype.goto=function(position,time){
if(time==undefined) time=500;
if(lib.config.low_performance){
this.remove();
}
else{
this.classList.add('removing');
}
var that=this;
this.timeout=setTimeout(function(){
position.appendChild(that);
@ -17162,8 +17460,14 @@
ext=ext||'.jpg';
subfolder=subfolder||'default'
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;
}
}
else{
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){
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;}
#mebg{z-index:-1}
#handcards1,#handcards2{width: calc(50% - 140px);height: 127px;padding: 10px;}
@ -130,7 +137,9 @@ body>.background{z-index:-2}
}
.card.cardflip{
animation:cardflip 0.3s ease-out;
animation-fill-mode: none;
-webkit-animation:cardflip 0.3s ease-out;
-webkit-animation-fill-mode:none;
}
.player .playerjiu{
animation:game_start 0.5s;
@ -276,6 +285,10 @@ margin-bottom: 5px;
font-size: 20px;
letter-spacing: -2px;
}
.player>.avatar.hidden,
.player>.avatar2.hidden{
pointer-events: none !important;
}
.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;
}
@ -555,6 +568,7 @@ margin-bottom: 5px;
#arena.thrownhighlight>.card.thrown:not(.thrownhighlight){
opacity: 0.5;
transform:scale(0.95);
/*-webkit-filter:blur(3px);*/
}
.card.start{
animation: card_start 0.5s;

View File

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

View File

@ -595,7 +595,7 @@ mode.identity={
game.zhu.setIdentity();
game.zhu.isZhu=true;
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.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.number==undefined) game.save('number',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.control_all==undefined) game.save('control_all',true);
// if(lib.storage.control_all==undefined) game.save('control_all',true);
switch(lib.storage.seat_order){
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;
}
game.save('only_zhu',true);
game.save('control_all',true);
ui.create.arena();
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_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_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_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_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');
@ -145,12 +148,12 @@ mode.versus={
// this.dialog.versus_cross_seat.parentNode.classList.remove('disabled');
// }
// }
if(lib.storage.single_control){
this.dialog.versus_control_all.parentNode.classList.remove('disabled');
}
else{
this.dialog.versus_control_all.parentNode.classList.add('disabled');
}
// if(lib.storage.single_control){
// this.dialog.versus_control_all.parentNode.classList.remove('disabled');
// }
// else{
// this.dialog.versus_control_all.parentNode.classList.add('disabled');
// }
};
event.confirm=function(){
var dialog=event.dialog;
@ -358,16 +361,17 @@ mode.versus={
case '随机':lib.storage.cross_seat=false;lib.storage.random_seat=true;break;
default:lib.storage.cross_seat=false;lib.storage.random_seat=false;
}
if(lib.storage.single_control){
dialog.versus_control_all.parentNode.classList.remove('disabled');
}
else{
dialog.versus_control_all.parentNode.classList.add('disabled');
}
game.save('control_all',dialog.versus_control_all.link);
// if(lib.storage.single_control){
// dialog.versus_control_all.parentNode.classList.remove('disabled');
// }
// else{
// dialog.versus_control_all.parentNode.classList.add('disabled');
// }
// game.save('control_all',dialog.versus_control_all.link);
game.save('die_stop',dialog.versus_die_stop.link);
game.save('number',dialog.versus_number.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('choice',dialog.choice.link);
var count,i;
@ -1038,6 +1042,7 @@ mode.versus={
seat_order_config:'座位排列',
versus_control_all_config:'固定控制位置',
versus_reward_config:'杀敌摸牌',
versus_punish_config:'杀死队友',
versus_number_config:'对阵人数',
replace_number_config:'替补人数',
choice_config:'候选人数'
@ -1121,11 +1126,18 @@ mode.versus={
else{
if(source){
if(source.side!=this.side){
if(lib.storage.versus_reward){
source.draw(lib.storage.versus_reward);
}
}
else{
if(lib.storage.versus_punish=='弃牌'){
source.discard(source.get('he'));
}
else if(lib.storage.versus_punish=='摸牌'&&lib.storage.versus_reward){
source.draw(lib.storage.versus_reward);
}
}
}
else{
game.delay();