This commit is contained in:
libccy 2017-04-14 23:47:11 +08:00
parent 58e6f1d9da
commit 9c78dc1f06
6 changed files with 185 additions and 30 deletions

View File

@ -178,6 +178,9 @@ character.hearth={
game.zhu&&!game.zhu.isZhu&&player==game.zhong){
return false;
}
if(_status.noswap){
return false;
}
return !player.isTurnedOver();
},
content:function(){

View File

@ -6095,6 +6095,7 @@ character.yijiang={
while(_status.event.name!='phase'){
_status.event=_status.event.parent;
}
game.resetSkills();
_status.event.finish();
_status.event.untrigger(true);
}

View File

@ -5852,10 +5852,9 @@
lib.assetURL=noname_inited;
}
ui.css={
menu:lib.init.css(lib.assetURL+'layout/default','menu'),
default:lib.init.css(lib.assetURL+'layout/default','layout')
};
ui.css={menu:lib.init.css(lib.assetURL+'layout/default','menu',function(){
ui.css.default=lib.init.css(lib.assetURL+'layout/default','layout');
})};
if(lib.device){
lib.init.cordovaReady=function(){
@ -12622,6 +12621,20 @@
return this;
},
smoothAvatar:function(){
var div=ui.create.div('.fulldiv');
div.style.background=getComputedStyle(this.node.avatar).background;
this.node.avatar.appendChild(div);
ui.refresh(div);
div.style.transition='all 1s';
setTimeout(function(){
div.classList.add('removing');
setTimeout(function(){
div.remove();
},2000);
},100);
game.addVideo('smoothAvatar',this);
},
send:function(){
if(!this.ws||this.ws.closed) return this;
this.ws.send.apply(this.ws,arguments);
@ -21470,6 +21483,11 @@
console.log(player);
}
},
smoothAvatar:function(player){
if(player&&player.node&&player.node.avatar){
player.smoothAvatar();
}
},
reinit:function(source,content){
if(source&&content){
source.uninit();
@ -21528,9 +21546,31 @@
}
},
addFellow:function(content){
var player=game.addFellow(content[0],content[1]);
var player=game.addFellow(content[0],content[1],content[2]);
game.playerMap[player.dataset.position]=player;
},
windowzoom1:function(){
ui.window.style.transition='all 0.5s';
ui.window.classList.add('zoomout3');
ui.window.hide();
},
windowzoom2:function(){
ui.window.style.transition='all 0s';
ui.refresh(ui.window);
},
windowzoom3:function(){
ui.window.classList.remove('zoomout3');
ui.window.classList.add('zoomin3');
},
windowzoom4:function(){
ui.window.style.transition='all 0.5s';
ui.refresh(ui.window);
ui.window.show();
ui.window.classList.remove('zoomin3');
},
windowzoom5:function(){
ui.window.style.transition='';
},
updateActCount:function(player,content){
if(player&&content){
player.updateActCount(content[0],content[1],content[2]);
@ -22146,6 +22186,21 @@
}
}
},
changeSeat:function(player,info){
if(player){
player.style.transition='all 0s';
ui.refresh(player);
player.dataset.position=info;
setTimeout(function(){
player.style.transition='';
},100);
game.playerMap={};
var players=game.players.concat(game.dead);
for(var i=0;i<players.length;i++){
game.playerMap[players[i].dataset.position]=players[i];
}
}
},
dialogCapt:function(content){
for(var i=0;i<ui.dialogs.length;i++){
if(ui.dialogs[i].videoId==content[0]){
@ -22463,6 +22518,42 @@
_status.toprint.push(Array.from(arguments));
},
animate:{
window:function(num){
switch(num){
case 1:{
ui.window.style.transition='all 0.5s';
ui.window.classList.add('zoomout3');
ui.window.hide();
game.addVideo('windowzoom1');
game.delay(0,500);
break;
}
case 2:{
ui.window.style.transition='all 0s';
ui.refresh(ui.window);
game.addVideo('windowzoom2');
game.pause();
setTimeout(function(){
ui.window.classList.remove('zoomout3');
ui.window.classList.add('zoomin3');
game.addVideo('windowzoom3');
setTimeout(function(){
ui.window.style.transition='all 0.5s';
ui.refresh(ui.window);
ui.window.show();
ui.window.classList.remove('zoomin3');
game.addVideo('windowzoom4');
setTimeout(function(){
ui.window.style.transition='';
game.addVideo('windowzoom5');
game.resume();
},500);
},100);
},100);
break;
}
}
},
flame:function(x,y,duration,type){
var particles=[];
var particle_count=50;
@ -23116,6 +23207,21 @@
lib.hook.globalskill.remove(skill);
}
},
resetSkills:function(){
for(var i=0;i<game.players.length;i++){
for(var j in game.players[i].tempSkills){
game.players[i].removeSkill(j);
}
var skills=game.players[i].getSkills();
for(var j=0;j<skills.length;j++){
if(lib.skill[skills[j]].temp){
game.players[i].removeSkill(skills[j]);
}
}
game.players[i].in(true);
}
ui.clear();
},
removeExtension:function(extname,keepfile){
var prefix='extension_'+extname;
for(var i in lib.config){
@ -24427,6 +24533,10 @@
ui.arena.classList.remove('dragging');
_status.dragline.length=0;
},
changeSeat:function(player,position){
game.addVideo('changeSeat',player,position);
player.dataset.position=position;
},
swapSeat:function(player1,player2,prompt,behind){
if(behind){
var totalPopulation=game.players.length+game.dead.length+1;
@ -26158,7 +26268,7 @@
return player;
},
addFellow:function(position,character,animation){
game.addVideo('addFellow',null,[position,character]);
game.addVideo('addFellow',null,[position,character,animation]);
var player=ui.create.player(ui.arena).animate(animation||'start');
player.dataset.position=position||game.players.length+game.dead.length;
player.getId();
@ -37951,8 +38061,10 @@
pause:function(){
if(_status.paused2) return;
if(_status.nopause) return;
if(!_status.video){
if(ui.pause.classList.contains('hidden')) return;
if(!_status.gameStarted&&!_status.video) return;
if(!_status.gameStarted) return;
}
ui.system.hide();
game.pause2();
var node=ui.create.pause().animate('start');

View File

@ -1109,6 +1109,17 @@ body>.background.upper {
transition-property: top,box-shadow,opacity,transform;
transition-duration: 0.5s;
}
.fulldiv{
width: 100%;
height: 100%;
left: 0;
top: 0;
margin: 0;
padding: 0;
border: none;
display: block;
position: absolute;
}
.intro {
width: 20px;
height: 20px;

View File

@ -1,6 +1,6 @@
#bosslist{
width:100%;
height:calc(50% + 200px);
height:250px;
text-align:center;
top:calc(50% - 200px);
top:60px;

View File

@ -187,20 +187,21 @@ mode.boss={
setTimeout(function(){
ui.control.classList.remove('bosslist');
},500);
var rect=event.current.getBoundingClientRect();
var boss=ui.create.player();
boss.getId();
game.boss=boss;
boss.init(event.current.name);
boss.side=true;
boss.node.equips.style.opacity='0';
if(!event.noslide){
// boss.classList.add('bossplayer');
// boss.classList.add('highlight');
var rect=event.current.getBoundingClientRect();
boss.animate('bossing');
boss.node.hp.animate('start');
boss.style.left=(rect.left-ui.arena.offsetLeft)+'px';
boss.style.top=(rect.top-ui.arena.offsetTop)+'px';
boss.bossinginfo=[rect.left+rect.width/2,rect.top+rect.height/2];
boss.style.transition='all 0s';
boss.node.equips.style.opacity='0';
}
else{
boss.animate('start');
}
boss.setIdentity('zhu');
boss.identity='zhu';
@ -319,15 +320,17 @@ mode.boss={
}
ui.arena.appendChild(boss);
if(boss.bossinginfo){
var rect=boss.getBoundingClientRect();
boss.style.transform='translate('+(boss.bossinginfo[0]-rect.left-rect.width/2)+'px,'+(boss.bossinginfo[1]-rect.top-rect.height/2)+'px) scale(1.1)';
ui.refresh(boss);
boss.classList.remove('highlight');
boss.classList.remove('bossplayer');
boss.style.left='';
boss.style.top='';
boss.style.position='';
boss.style.transition='';
boss.style.transform='';
delete boss.bossinginfo;
setTimeout(function(){
boss.node.equips.style.opacity='';
},500);
}
event.bosslist.delete();
@ -916,7 +919,9 @@ mode.boss={
forced:true,
popup:false,
content:function(){
player.smoothAvatar();
player.init('boss_zhuque');
_status.noswap=true;
game.addVideo('reinit2',player,player.name);
}
},
@ -937,7 +942,34 @@ mode.boss={
'step 0'
game.delay();
'step 1'
game.animate.window(1);
'step 2'
game.changeBoss('boss_huoshenzhurong');
if(game.me!=game.boss){
game.changeSeat(game.boss,6);
}
else{
game.changeSeat(game.boss.nextSeat,3);
game.changeSeat(game.boss.previousSeat,5);
}
for(var i=0;i<game.players.length;i++){
game.players[i].hp=game.players[i].maxHp;
game.players[i].update();
}
game.addFellow(game.me==game.boss?1:5,'boss_yanling','zoominanim').directgain(get.cards(4));
game.addFellow(7,'boss_yanling','zoominanim').directgain(get.cards(4));
game.animate.window(2);
'step 3'
while(_status.event.name!='phaseLoop'){
_status.event=_status.event.parent;
}
game.resetSkills();
_status.paused=false;
_status.event.player=game.boss;
_status.event.step=0;
if(game.bossinfo){
game.bossinfo.loopType=1;
}
}
},
boss_chiyan3:{
@ -2566,6 +2598,7 @@ mode.boss={
forced:true,
popup:false,
content:function(){
player.smoothAvatar();
player.init(['boss_chi','boss_mo','boss_wang','boss_liang'].randomGet());
game.addVideo('reinit2',player,player.name);
}
@ -3519,12 +3552,7 @@ mode.boss={
while(_status.event.name!='phaseLoop'){
_status.event=_status.event.parent;
}
for(var i=0;i<game.players.length;i++){
for(var j in game.players[i].tempSkills){
game.players[i].removeSkill(j);
}
game.players[i].in(true);
}
game.resetSkills();
_status.paused=false;
_status.event.player=player;
_status.event.step=0;