身份牌特效

This commit is contained in:
Spmario233 2023-10-16 22:58:42 +08:00
parent f29d8a7aff
commit 2fc980766e
7 changed files with 146 additions and 62 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -1290,15 +1290,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
game.addGlobalSkill(list[i]); game.addGlobalSkill(list[i]);
} }
var localMark=(skill)=>{
var name=skill,info;
if(player.marks[name]) player.updateMarks();
if(lib.skill[name]) info=lib.skill[name].intro;
if(!info) return;
if(player.marks[name]) player.marks[name].info=info;
else player.marks[name]=player.mark(name,info);
player.updateMarks();
}
game.players.forEach(current=>{ game.players.forEach(current=>{
current.storage.zhibi=[]; current.storage.zhibi=[];
current.storage.zhibi_for=[]; current.storage.zhibi_for=[];
@ -1506,10 +1497,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
table.style.position='relative'; table.style.position='relative';
var listi; var listi;
if(event.zhongmode){ if(event.zhongmode){
listi=['random','zhu','mingzhong','zhong','nei','fan']; listi=['random','zhu','mingzhong','zhong','fan','nei'];
} }
else{ else{
listi=['random','zhu','zhong','nei','fan']; listi=['random','zhu','zhong','fan','nei'];
} }
for(var i=0;i<listi.length;i++){ for(var i=0;i<listi.length;i++){
@ -3010,27 +3001,58 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var send=(target,res,id)=>{ var send=(target,res,id)=>{
var str=get.translation(target)+'是'+get.translation(res+'2')+'<br>'; var str=get.translation(target)+'是'+get.translation(res+'2')+'<br>';
var dialog=ui.create.dialog(str,'forcebutton'); var dialog=ui.create.dialog(str,'forcebutton');
var card=ui.create.card();
card.classList.add('fullskin');
var buttons=ui.create.div('.buttons',dialog.content);
buttons.appendChild(card);
new Promise((resolve)=>{ new Promise((resolve)=>{
var imageName=`mougong_${res}`; var imageName=`mougong_${res}`;
resolve(`${lib.assetURL}image/card/${imageName}.jpg`); resolve(`${lib.assetURL}image/card/${imageName}.jpg`);
}).then(pth=>new Promise((resolve,reject)=>{ }).then(pth=>{
var image=new Image(); return new Promise((resolve,reject)=>{
image.onload=()=>resolve(pth); var image=new Image();
image.onerror=reject; image.onload=()=>resolve(pth);
image.src=pth; image.onerror=reject;
})).then(image=>{ image.src=pth;
var img=document.createElement('img'); }).then(image=>{
dialog.content.appendChild(img); card.node.image.setBackgroundImage(image);
img.setAttribute('src',image); }).catch(()=>{
img.setAttribute('width','106'); card.node.background.innerHTML=get.transition(res)[0];
img.setAttribute('height','150'); });
img.setAttribute('draggable',false); }).then(()=>{
img.style.transition='all 2s'; if(lib.config.cardback_style!='default'){
setTimeout(function(){ card.style.transitionProperty='none';
img.style.transform='rotateY(360deg)'; ui.refresh(card);
},100); card.classList.add('infohidden');
ui.refresh(card);
card.style.transitionProperty='';
}
else{
card.classList.add('infohidden');
}
buttons.appendChild(card);
card.style.transition='all 0s';
card.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
dialog.open(); dialog.open();
}).catch(()=>{}); var onEnd01=function(){
setTimeout(function(){
card.style.transition='all ease-in 0.3s';
card.style.transform='perspective(600px) rotateY(270deg) translateX(52px)';
var onEnd=function(){
card.classList.remove('infohidden');
card.style.transition='all 0s';
ui.refresh(card);
card.style.transform='perspective(600px) rotateY(-90deg) translateX(52px)';
ui.refresh(card);
card.style.transition='';
ui.refresh(card);
card.style.transform='';
}
card.listenTransition(onEnd);
},300);
};
onEnd01();
});
var control=ui.create.control('ok',()=>{ var control=ui.create.control('ok',()=>{
dialog.close(); dialog.close();
control.close(); control.close();
@ -3082,27 +3104,58 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var str=get.translation(target)+'是反贼<br>'; var str=get.translation(target)+'是反贼<br>';
event.videoId=lib.status.videoId++; event.videoId=lib.status.videoId++;
var dialog=ui.create.dialog(str,'forcebutton'); var dialog=ui.create.dialog(str,'forcebutton');
var card=ui.create.card();
var buttons=ui.create.div('.buttons',dialog.content);
buttons.appendChild(card)
card.classList.add('fullskin');
new Promise((resolve)=>{ new Promise((resolve)=>{
var imageName=`mougong_fan`; var imageName=`mougong_fan`;
resolve(`${lib.assetURL}image/card/${imageName}.jpg`); resolve(`${lib.assetURL}image/card/${imageName}.jpg`);
}).then(pth=>new Promise((resolve,reject)=>{ }).then(pth=>{
var image=new Image(); return new Promise((resolve,reject)=>{
image.onload=()=>resolve(pth); var image=new Image();
image.onerror=reject; image.onload=()=>resolve(pth);
image.src=pth; image.onerror=reject;
})).then(image=>{ image.src=pth;
var img=document.createElement('img'); }).then(image=>{
dialog.content.appendChild(img); card.node.image.setBackgroundImage(image);
img.setAttribute('src',image); }).catch(()=>{
img.setAttribute('width','106'); card.node.background.innerHTML='反';
img.setAttribute('height','150'); });
img.setAttribute('draggable',false); }).then(()=>{
img.style.transition='all 2s'; if(lib.config.cardback_style!='default'){
setTimeout(function(){ card.style.transitionProperty='none';
img.style.transform='rotateY(360deg)'; ui.refresh(card);
},300); card.classList.add('infohidden');
ui.refresh(card);
card.style.transitionProperty='';
}
else{
card.classList.add('infohidden');
}
buttons.appendChild(card);
dialog.open(); dialog.open();
}).catch(()=>{}); card.style.transition='all 0s';
card.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
var onEnd01=function(){
setTimeout(function(){
card.style.transition='all ease-in 0.3s';
card.style.transform='perspective(600px) rotateY(270deg) translateX(52px)';
var onEnd=function(){
card.classList.remove('infohidden');
card.style.transition='all 0s';
ui.refresh(card);
card.style.transform='perspective(600px) rotateY(-90deg) translateX(52px)';
ui.refresh(card);
card.style.transition='';
ui.refresh(card);
card.style.transform='';
}
card.listenTransition(onEnd);
},300);
};
onEnd01();
});
dialog.videoId=event.videoId; dialog.videoId=event.videoId;
game.me.chooseControl('ok').set('dialog',dialog); game.me.chooseControl('ok').set('dialog',dialog);
} }
@ -3123,27 +3176,58 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(!game.me.storage.zhibi.contains(target)) game.me.storage.zhibi.push(target); if(!game.me.storage.zhibi.contains(target)) game.me.storage.zhibi.push(target);
var str=get.translation(target)+'是反贼<br>'; var str=get.translation(target)+'是反贼<br>';
var dialog=ui.create.dialog(str,'forcebutton'); var dialog=ui.create.dialog(str,'forcebutton');
var card=ui.create.card();
var buttons=ui.create.div('.buttons',dialog.content);
buttons.appendChild(card)
card.classList.add('fullskin');
new Promise((resolve)=>{ new Promise((resolve)=>{
var imageName=`mougong_fan`; var imageName=`mougong_fan`;
resolve(`${lib.assetURL}image/card/${imageName}.jpg`); resolve(`${lib.assetURL}image/card/${imageName}.jpg`);
}).then(pth=>new Promise((resolve,reject)=>{ }).then(pth=>{
var image=new Image(); return new Promise((resolve,reject)=>{
image.onload=()=>resolve(pth); var image=new Image();
image.onerror=reject; image.onload=()=>resolve(pth);
image.src=pth; image.onerror=reject;
})).then(image=>{ image.src=pth;
var img=document.createElement('img'); }).then(image=>{
dialog.content.appendChild(img); card.node.image.setBackgroundImage(image);
img.setAttribute('src',image); }).catch(()=>{
img.setAttribute('width','106'); card.node.background.innerHTML='反';
img.setAttribute('height','150'); });
img.setAttribute('draggable',false); }).then(()=>{
img.style.transition='all 2s'; if(lib.config.cardback_style!='default'){
setTimeout(function(){ card.style.transitionProperty='none';
img.style.transform='rotateY(360deg)'; ui.refresh(card);
},300); card.classList.add('infohidden');
ui.refresh(card);
card.style.transitionProperty='';
}
else{
card.classList.add('infohidden');
}
buttons.appendChild(card);
dialog.open(); dialog.open();
}).catch(()=>{}); card.style.transition='all 0s';
card.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
var onEnd01=function(){
setTimeout(function(){
card.style.transition='all ease-in 0.3s';
card.style.transform='perspective(600px) rotateY(270deg) translateX(52px)';
var onEnd=function(){
card.classList.remove('infohidden');
card.style.transition='all 0s';
ui.refresh(card);
card.style.transform='perspective(600px) rotateY(-90deg) translateX(52px)';
ui.refresh(card);
card.style.transition='';
ui.refresh(card);
card.style.transform='';
}
card.listenTransition(onEnd);
},300);
};
onEnd01();
});
dialog.videoId=id; dialog.videoId=id;
game.me.chooseControl('ok').set('dialog',dialog); game.me.chooseControl('ok').set('dialog',dialog);
} }