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){ game.zhu&&!game.zhu.isZhu&&player==game.zhong){
return false; return false;
} }
if(_status.noswap){
return false;
}
return !player.isTurnedOver(); return !player.isTurnedOver();
}, },
content:function(){ content:function(){

View File

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

View File

@ -5852,10 +5852,9 @@
lib.assetURL=noname_inited; lib.assetURL=noname_inited;
} }
ui.css={ ui.css={menu:lib.init.css(lib.assetURL+'layout/default','menu',function(){
menu:lib.init.css(lib.assetURL+'layout/default','menu'), ui.css.default=lib.init.css(lib.assetURL+'layout/default','layout');
default:lib.init.css(lib.assetURL+'layout/default','layout') })};
};
if(lib.device){ if(lib.device){
lib.init.cordovaReady=function(){ lib.init.cordovaReady=function(){
@ -12622,6 +12621,20 @@
return this; 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(){ send:function(){
if(!this.ws||this.ws.closed) return this; if(!this.ws||this.ws.closed) return this;
this.ws.send.apply(this.ws,arguments); this.ws.send.apply(this.ws,arguments);
@ -21470,6 +21483,11 @@
console.log(player); console.log(player);
} }
}, },
smoothAvatar:function(player){
if(player&&player.node&&player.node.avatar){
player.smoothAvatar();
}
},
reinit:function(source,content){ reinit:function(source,content){
if(source&&content){ if(source&&content){
source.uninit(); source.uninit();
@ -21528,9 +21546,31 @@
} }
}, },
addFellow:function(content){ 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; 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){ updateActCount:function(player,content){
if(player&&content){ if(player&&content){
player.updateActCount(content[0],content[1],content[2]); 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){ dialogCapt:function(content){
for(var i=0;i<ui.dialogs.length;i++){ for(var i=0;i<ui.dialogs.length;i++){
if(ui.dialogs[i].videoId==content[0]){ if(ui.dialogs[i].videoId==content[0]){
@ -22463,6 +22518,42 @@
_status.toprint.push(Array.from(arguments)); _status.toprint.push(Array.from(arguments));
}, },
animate:{ 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){ flame:function(x,y,duration,type){
var particles=[]; var particles=[];
var particle_count=50; var particle_count=50;
@ -23116,6 +23207,21 @@
lib.hook.globalskill.remove(skill); 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){ removeExtension:function(extname,keepfile){
var prefix='extension_'+extname; var prefix='extension_'+extname;
for(var i in lib.config){ for(var i in lib.config){
@ -24427,6 +24533,10 @@
ui.arena.classList.remove('dragging'); ui.arena.classList.remove('dragging');
_status.dragline.length=0; _status.dragline.length=0;
}, },
changeSeat:function(player,position){
game.addVideo('changeSeat',player,position);
player.dataset.position=position;
},
swapSeat:function(player1,player2,prompt,behind){ swapSeat:function(player1,player2,prompt,behind){
if(behind){ if(behind){
var totalPopulation=game.players.length+game.dead.length+1; var totalPopulation=game.players.length+game.dead.length+1;
@ -26158,7 +26268,7 @@
return player; return player;
}, },
addFellow:function(position,character,animation){ 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'); var player=ui.create.player(ui.arena).animate(animation||'start');
player.dataset.position=position||game.players.length+game.dead.length; player.dataset.position=position||game.players.length+game.dead.length;
player.getId(); player.getId();
@ -37951,8 +38061,10 @@
pause:function(){ pause:function(){
if(_status.paused2) return; if(_status.paused2) return;
if(_status.nopause) return; if(_status.nopause) return;
if(!_status.video){
if(ui.pause.classList.contains('hidden')) return; if(ui.pause.classList.contains('hidden')) return;
if(!_status.gameStarted&&!_status.video) return; if(!_status.gameStarted) return;
}
ui.system.hide(); ui.system.hide();
game.pause2(); game.pause2();
var node=ui.create.pause().animate('start'); var node=ui.create.pause().animate('start');

View File

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

View File

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

View File

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