noname/mode/boss.js

799 lines
21 KiB
JavaScript
Raw Normal View History

2015-05-08 08:07:38 +00:00
'use strict';
mode.boss={
2015-05-12 09:51:40 +00:00
element:{
player:{
dieAfter:function(){
if(this!=game.boss){
this.storage.boss_chongzheng=0;
}
2016-01-07 09:29:44 +00:00
if(game.bossinfo.checkResult&&game.bossinfo.checkResult(this)===false){
2016-01-04 08:59:37 +00:00
return;
}
2015-05-12 09:51:40 +00:00
if(this==game.boss||game.players.length==1){
game.checkResult();
}
2015-05-12 15:10:35 +00:00
},
2015-05-12 09:51:40 +00:00
}
},
2015-05-08 08:07:38 +00:00
game:{
2015-05-11 11:57:44 +00:00
reserveDead:true,
2016-01-04 08:59:37 +00:00
changeBoss:function(name){
if(game.additionaldead){
game.additionaldead.push(game.boss);
}
else{
game.additionaldead=[game.boss];
}
game.boss.delete();
game.dead.remove(game.boss);
var boss=ui.create.player().init(name);
game.addVideo('bossSwap',game.boss,boss.name);
if(game.me==game.boss){
boss.dataset.position=0;
game.swapControl(boss);
}
else{
boss.dataset.position=7;
}
game.players.push(boss.animate('zoominanim'));
game.arrangePlayers();
game.boss=boss;
ui.arena.appendChild(boss);
boss.directgain(get.cards(4));
boss.setIdentity('zhu');
boss.identity='zhu';
},
2015-05-12 09:51:40 +00:00
checkResult:function(){
if(game.boss==game.me){
game.over(game.boss.isAlive());
}
else{
game.over(!game.boss.isAlive());
}
},
2015-11-04 01:59:00 +00:00
getVideoName:function(){
var str=get.translation(game.me.name);
if(game.me.name2){
str+='/'+get.translation(game.me.name2);
}
var str2='挑战';
if(game.me!=game.boss){
str2+=' - '+get.translation(game.boss);
}
var name=[str,str2];
return name;
},
2015-05-08 08:07:38 +00:00
start:function(){
var next=game.createEvent('game',false);
next.content=function(){
"step 0"
2015-12-06 15:23:47 +00:00
if(lib.db&&!_status.characterLoaded){
_status.waitingForCharacters=true;
game.pause();
}
"step 1"
2016-02-05 03:09:04 +00:00
if(lib.config.hiddenCharacterPack.contains('boss')){
game.loadPackage('character/boss');
}
"step 2"
2015-11-04 01:59:00 +00:00
var playback=localStorage.getItem(lib.configprefix+'playback');
if(playback){
ui.create.me();
ui.arena.style.display='none';
ui.system.style.display='none';
_status.playback=playback;
localStorage.removeItem(lib.configprefix+'playback');
var store=lib.db.transaction(['video'],'readwrite').objectStore('video');
store.get(parseInt(playback)).onsuccess=function(e){
if(e.target.result){
game.playVideoContent(e.target.result.video);
}
else{
alert('播放失败:找不到录像');
game.reload();
}
}
event.finish();
return;
}
2015-05-11 11:57:44 +00:00
for(var i in lib.skill){
if(lib.skill[i].changeSeat){
lib.skill[i]={};
if(lib.translate[i+'_info']){
lib.translate[i+'_info']='此模式下不可用';
}
}
}
lib.init.css('layout/mode','boss');
2015-05-12 09:51:40 +00:00
game.delay(0.1);
2016-02-05 03:09:04 +00:00
"step 3"
2015-05-12 09:51:40 +00:00
var bosslist=ui.create.div('#bosslist.hidden');
event.bosslist=bosslist;
2015-05-13 10:26:54 +00:00
bosslist.ontouchmove = ui.click.touchScroll;
bosslist.style.WebkitOverflowScrolling='touch';
2015-05-11 11:57:44 +00:00
if(!lib.config.touchscreen&&lib.config.mousewheel){
bosslist._scrollspeed=30;
bosslist._scrollnum=10;
bosslist.onmousewheel=ui.click.mousewheel;
}
var bosslistlinks={};
var toggleBoss=function(bool){
2015-10-29 17:36:14 +00:00
game.saveConfig(this._link.config._name,bool,true);
var node=bosslistlinks[this._link.config._name];
2015-05-11 11:57:44 +00:00
if(bool){
node.style.display='';
}
else{
node.style.display='none';
}
};
var onpause=function(){
ui.window.classList.add('bosspaused');
}
var onresume=function(){
ui.window.classList.remove('bosspaused');
}
game.onpause=onpause;
game.onpause2=onpause;
game.onresume=onresume;
game.onresume2=onresume;
ui.create.div(bosslist);
2015-05-12 09:51:40 +00:00
event.current=null;
2015-05-11 11:57:44 +00:00
var list=[];
for(var i in lib.character){
var info=lib.character[i];
2015-12-07 11:15:35 +00:00
if(info[4].contains('boss')&&!lib.config.banned.contains(i)){
2015-05-11 11:57:44 +00:00
var cfg=i+'_bossconfig';
if(get.config(cfg)==undefined){
game.saveConfig(cfg,true,true);
}
lib.translate[cfg+'_config']=lib.translate[i];
lib.config.current_mode.push([cfg,get.config(cfg),toggleBoss]);
2015-10-29 17:36:14 +00:00
lib.mode.boss.config[cfg]={
name:get.translation(i),
onclick:toggleBoss,
init:true,
}
2015-05-11 11:57:44 +00:00
var player=ui.create.player(bosslist).init(i);
list.push(player);
player.node.hp.classList.add('text');
player.node.hp.dataset.condition='';
player.node.hp.innerHTML=info[2];
2016-01-28 06:46:42 +00:00
if(info[2]==Infinity){
player.node.hp.innerHTML='∞';
}
2015-05-11 11:57:44 +00:00
player.setIdentity(player.name);
player.node.identity.dataset.color=info[5];
bosslistlinks[cfg]=player;
2015-05-12 09:51:40 +00:00
player.classList.add('bossplayer');
if(lib.storage.current==i){
event.current=player;
player.classList.add('highlight');
}
2015-05-11 11:57:44 +00:00
if(!get.config(cfg)){
player.style.display='none';
}
}
}
2016-01-12 13:18:47 +00:00
if(!list.length){
alert('挑战模式不可隐藏boss武将包请在选项其它中选择“重置隐藏扩展包”');
event.finish();
_status.over=true;
return;
}
2015-05-12 15:10:35 +00:00
if(!event.current){
event.current=bosslist.childNodes[1];
event.current.classList.add('highlight');
}
2015-05-11 11:57:44 +00:00
ui.create.div(bosslist);
lib.translate.boss_pangtong='涅槃凤雏';
2015-05-12 09:51:40 +00:00
ui.create.cards();
game.finishCards();
ui.arena.dataset.number=8;
2015-12-10 15:57:45 +00:00
ui.control.style.transitionProperty='opacity';
2015-05-11 11:57:44 +00:00
ui.control.classList.add('bosslist');
2015-12-10 15:57:45 +00:00
setTimeout(function(){
ui.control.style.transitionProperty='';
},1000);
2015-05-11 11:57:44 +00:00
ui.window.appendChild(bosslist);
2015-05-12 09:51:40 +00:00
setTimeout(function(){
if(event.current){
var left=event.current.offsetLeft-(ui.window.offsetWidth-180)/2;
if(bosslist.scrollLeft<left){
bosslist.scrollLeft=left;
}
2015-05-11 11:57:44 +00:00
}
2015-05-12 09:51:40 +00:00
bosslist.show();
},200);
game.me=ui.create.player();
2016-01-28 06:46:42 +00:00
if(lib.config.continue_name_boss){
event.noslide=true;
}
else{
game.chooseCharacter(function(target){
if(event.current){
event.current.classList.remove('highlight');
}
event.current=target;
game.save('current',target.name);
target.classList.add('highlight');
});
}
2016-01-07 09:29:44 +00:00
if(lib.storage.test){
event.current.classList.remove('highlight');
if(event.current.nextSibling&&event.current.nextSibling.classList.contains('player')){
event.current=event.current.nextSibling;
}
else{
event.current=event.current.parentNode.childNodes[1];
}
lib.config.game_speed='vfast';
_status.auto=true;
ui.auto.classList.add('glow');
game.save('current',event.current.name);
}
2016-02-05 03:09:04 +00:00
"step 4"
2015-05-12 09:51:40 +00:00
game.bossinfo=lib.boss.global;
for(var i in lib.boss[event.current.name]){
game.bossinfo[i]=lib.boss[event.current.name][i];
}
delete lib.boss;
2015-05-11 11:57:44 +00:00
setTimeout(function(){
2015-05-12 09:51:40 +00:00
ui.control.classList.remove('bosslist');
2015-05-11 11:57:44 +00:00
},500);
2015-05-12 09:51:40 +00:00
var rect=event.current.getBoundingClientRect();
var boss=ui.create.player().init(event.current.name);
game.boss=boss;
boss.side=true;
2016-01-28 06:46:42 +00:00
if(!event.noslide){
// boss.classList.add('bossplayer');
// boss.classList.add('highlight');
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';
}
2015-05-12 09:51:40 +00:00
boss.setIdentity('zhu');
2015-11-04 01:59:00 +00:00
boss.identity='zhu';
2016-01-28 06:46:42 +00:00
if(lib.config.continue_name_boss){
result=lib.config.continue_name_boss;
game.saveConfig('continue_name_boss');
}
2015-05-12 09:51:40 +00:00
for(var i=0;i<result.links.length;i++){
var player=ui.create.player(ui.arena).init(result.links[i]).animate('start');
player.setIdentity('cai');
2015-11-04 01:59:00 +00:00
player.identity='cai';
2015-05-12 09:51:40 +00:00
player.side=false;
game.players.push(player);
if(result.boss){
player.dataset.position=(i+1)*2;
}
else{
player.dataset.position=i+1;
}
}
if(result.boss){
game.players.unshift(boss);
boss.dataset.position=0;
}
else{
game.players.push(boss);
boss.dataset.position=7;
}
ui.create.me();
if(game.me!==boss){
2015-10-08 06:16:37 +00:00
game.singleHandcard=true;
ui.arena.classList.add('single-handcard');
2015-12-01 05:46:28 +00:00
ui.fakeme=ui.create.div('.fakeme.avatar',ui.me);
// ui.fakeme.dataset.position=0;
// ui.fakeme.line=lib.element.player.line;
// ui.fakemebg=ui.create.div('.avatar',ui.fakeme).hide();
// ui.refresh(ui.fakemebg);
2015-05-12 09:51:40 +00:00
game.onSwapControl();
2015-12-01 05:46:28 +00:00
// ui.fakemebg.show();
2015-05-12 09:51:40 +00:00
2016-01-12 13:18:47 +00:00
lib.setPopped(ui.create.system('手牌',null,true),function(){
2015-05-12 09:51:40 +00:00
var uiintro=ui.create.dialog('hidden');
var players=game.players.concat(game.dead);
for(var i=0;i<players.length;i++){
if(players[i].side==game.me.side&&players[i]!=game.me){
uiintro.add(get.translation(players[i]));
var cards=players[i].get('h');
if(cards.length){
2016-01-12 13:18:47 +00:00
uiintro.addSmall(cards,true);
2015-05-12 09:51:40 +00:00
}
else{
uiintro.add('(无)');
}
}
}
return uiintro;
2016-01-12 13:18:47 +00:00
},220);
2015-05-12 09:51:40 +00:00
}
lib.setPopped(ui.create.system('重整',null,true),function(){
var uiintro=ui.create.dialog('hidden');
uiintro.add('重整');
var table=ui.create.div('.bosschongzheng');
var tr,td,added=false;
for(var i=0;i<game.dead.length;i++){
if(typeof game.dead[i].storage.boss_chongzheng!=='number') continue;
added=true;
tr=ui.create.div(table);
td=ui.create.div(tr);
td.innerHTML=get.translation(game.dead[i]);
td=ui.create.div(tr);
2015-05-13 03:14:57 +00:00
if(game.dead[i].maxHp>0){
td.innerHTML='剩余'+get.cnNumber(game.bossinfo.chongzheng-game.dead[i].storage.boss_chongzheng)+'回合';
}
else{
td.innerHTML='无法重整'
}
2015-05-12 09:51:40 +00:00
}
if(!added){
uiintro.add('<div class="text center">(无重整角色)</div>');
uiintro.add(ui.create.div('.placeholder.slim'))
}
else{
uiintro.add(table);
}
return uiintro;
},180);
2016-01-07 09:29:44 +00:00
ui.single_swap=ui.create.system('换人',function(){
var players=get.players(game.me);
players.remove(game.boss);
if(players.length>1){
if(ui.auto.classList.contains('hidden')){
game.me.popup('请稍后换人');
return;
}
if(_status.event.isMine()){
ui.click.auto();
setTimeout(function(){
ui.click.auto();
},500);
}
game.modeSwapPlayer(players[1]);
}
},true);
if(get.config('single_control')||game.me==game.boss){
ui.single_swap.style.display='none';
}
2015-05-12 09:51:40 +00:00
ui.arena.appendChild(boss);
ui.refresh(boss);
boss.classList.remove('highlight');
boss.classList.remove('bossplayer');
boss.style.left='';
boss.style.top='';
boss.style.position='';
event.bosslist.delete();
game.arrangePlayers();
2015-10-08 06:16:37 +00:00
for(var i=0;i<game.players.length;i++){
2015-11-06 10:05:08 +00:00
game.players[i].node.action.innerHTML='行动';
2015-10-08 06:16:37 +00:00
}
2015-11-04 01:59:00 +00:00
var players=get.players(lib.sort.position);
var info=[];
for(var i=0;i<players.length;i++){
info.push({
name:players[i].name,
identity:players[i].identity,
position:players[i].dataset.position
});
}
_status.videoInited=true,
info.boss=(game.me==game.boss);
game.addVideo('init',null,info);
2016-01-28 06:46:42 +00:00
if(game.bossinfo.init){
game.bossinfo.init();
}
2016-02-05 03:09:04 +00:00
"step 5"
2015-11-09 03:15:16 +00:00
event.trigger('gameStart');
2015-05-12 09:51:40 +00:00
game.gameDraw(game.boss);
game.bossPhaseLoop();
2015-10-08 06:16:37 +00:00
setTimeout(function(){
2015-12-09 08:49:22 +00:00
ui.updatehl();
2015-10-08 06:16:37 +00:00
},200);
2015-05-08 08:07:38 +00:00
}
2015-05-12 09:51:40 +00:00
},
bossPhaseLoop:function(){
var next=game.createEvent('phaseLoop');
next.player=game.boss;
_status.looped=true;
next.content=function(){
"step 0"
if(player.chongzheng){
player.chongzheng=false;
}
else if(player.isDead()){
if(player.hp<0) player.hp=0;
player.storage.boss_chongzheng++;
2015-05-13 03:14:57 +00:00
if(player.maxHp>0){
if(player.hp<player.maxHp){
player.hp++;
2015-12-08 13:54:44 +00:00
game.log(player,'回复了一点体力');
2015-05-13 03:14:57 +00:00
}
2016-02-05 03:09:04 +00:00
else if(player.num('h')<4){
2015-05-13 03:14:57 +00:00
var card=get.cards()[0];
var sort=lib.config.sort_card(card);
var position=sort>0?player.node.handcards1:player.node.handcards2;
card.fix();
card.animate('start');
position.insertBefore(card,position.firstChild);
player.$draw();
2015-12-08 13:54:44 +00:00
game.log(player,'摸了一张牌');
2015-05-13 03:14:57 +00:00
}
player.update();
if(player.storage.boss_chongzheng>=game.bossinfo.chongzheng){
2015-12-07 11:15:35 +00:00
player.revive(player.hp);
2015-05-13 03:14:57 +00:00
}
2015-05-12 09:51:40 +00:00
}
if(game.bossinfo.loopType==2){
game.boss.chongzheng=true;
}
}
else{
2016-01-04 08:59:37 +00:00
if(player.identity=='zhu'&&game.boss!=player){
player=game.boss;
}
2015-05-12 09:51:40 +00:00
player.phase();
}
"step 1"
if(game.bossinfo.loopType==2){
if(event.player==game.boss){
if(!_status.last||_status.last.nextSeat==game.boss){
event.player=game.boss.nextSeat;
}
else{
event.player=_status.last.nextSeat;
}
}
else{
_status.last=player;
event.player=game.boss;
}
}
else{
event.player=event.player.nextSeat;
}
event.goto(0);
}
},
onSwapControl:function(){
if(game.me==game.boss) return;
2015-11-04 01:59:00 +00:00
game.addVideo('onSwapControl');
2015-05-12 09:51:40 +00:00
var name=game.me.name;
if(ui.fakeme&&ui.fakeme.current!=name){
ui.fakeme.current=name;
if(ui.versushighlight&&ui.versushighlight!=game.me){
2015-12-01 05:46:28 +00:00
ui.versushighlight.classList.remove('current_action');
2015-05-12 09:51:40 +00:00
}
ui.versushighlight=game.me;
2015-12-01 05:46:28 +00:00
game.me.classList.add('current_action');
2015-10-08 06:16:37 +00:00
// game.me.line(ui.fakeme,{opacity:0.5,dashed:true});
2015-05-12 09:51:40 +00:00
2015-12-01 05:46:28 +00:00
ui.fakeme.style.backgroundImage=game.me.node.avatar.style.backgroundImage;
// ui.fakeme.style.backgroundSize='cover';
2015-05-12 09:51:40 +00:00
}
2015-12-09 08:49:22 +00:00
ui.updatehl();
2015-05-12 09:51:40 +00:00
},
modeSwapPlayer:function(player){
game.swapControl(player);
game.onSwapControl();
},
chooseCharacter:function(func){
var next=game.createEvent('chooseCharacter',false);
next.showConfig=true;
next.customreplacetarget=func;
next.ai=function(player,list){
if(get.config('double_character')){
player.init(list[0],list[1]);
}
else{
player.init(list[0]);
}
}
next.content=function(){
"step 0"
var i;
var list=[];
event.list=list;
for(i in lib.character){
if(lib.character[i][4].contains('minskin')) continue;
if(lib.character[i][4].contains('boss')) continue;
if(lib.character[i][4].contains('hiddenboss')) continue;
2015-12-07 11:15:35 +00:00
if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue;
2015-05-12 09:51:40 +00:00
if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidall.contains(i)) continue;
if(lib.config.forbidboss.contains(i)) continue;
2015-12-06 15:23:47 +00:00
if(lib.config.banned.contains(i)) continue;
2015-05-12 09:51:40 +00:00
if(get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue;
2015-11-18 03:39:14 +00:00
if(get.config('ban_weak')&&(lib.rank.c.contains(i)||lib.rank.d.contains(i))) continue;
if(get.config('ban_strong')&&(lib.rank.s.contains(i)||lib.rank.ap.contains(i))) continue;
2015-05-12 09:51:40 +00:00
list.push(i);
}
list.randomSort();
var dialog=ui.create.dialog('选择参战角色','hidden');
2015-12-16 06:49:43 +00:00
dialog.classList.add('fixed');
2015-05-12 09:51:40 +00:00
ui.window.appendChild(dialog);
dialog.classList.add('bosscharacter');
2016-02-01 09:32:18 +00:00
dialog.classList.add('withbg');
2016-01-04 08:59:37 +00:00
// dialog.add('0/3');
2015-05-12 09:51:40 +00:00
dialog.add([list.slice(0,20),'character']);
dialog.noopen=true;
var next=game.me.chooseButton(dialog,true);
next._triggered=null;
next.custom.replace.target=event.customreplacetarget;
next.selectButton=[3,3];
2016-01-04 08:59:37 +00:00
// next.custom.add.button=function(){
// if(ui.cheat2&&ui.cheat2.backup) return;
// _status.event.dialog.content.childNodes[1].innerHTML=
// ui.selected.buttons.length+'/3';
// };
2015-05-12 09:51:40 +00:00
event.changeDialog=function(){
if(ui.cheat2&&ui.cheat2.dialog==_status.event.dialog){
return;
}
2015-12-27 08:09:12 +00:00
if(game.changeCoin){
2016-01-12 13:18:47 +00:00
game.changeCoin(-3);
2015-12-27 08:09:12 +00:00
}
2015-05-12 09:51:40 +00:00
list.randomSort();
_status.event.dialog.close();
_status.event.dialog=ui.create.dialog('选择参战角色','hidden');
ui.window.appendChild(_status.event.dialog);
_status.event.dialog.classList.add('bosscharacter');
2016-02-01 09:32:18 +00:00
_status.event.dialog.classList.add('withbg');
2015-12-16 06:49:43 +00:00
_status.event.dialog.classList.add('fixed');
2016-01-04 08:59:37 +00:00
// _status.event.dialog.add('0/3');
2015-05-12 09:51:40 +00:00
_status.event.dialog.add([list.slice(0,20),'character']);
game.uncheck();
game.check();
};
ui.create.cheat=function(){
2015-09-03 03:49:14 +00:00
_status.createControl=ui.cheat2||event.asboss;
2015-05-12 09:51:40 +00:00
ui.cheat=ui.create.control('更换',event.changeDialog);
2015-09-03 03:49:14 +00:00
delete _status.createControl;
2015-05-12 09:51:40 +00:00
};
event.dialogxx=ui.create.characterDialog();
event.dialogxx.classList.add('bosscharacter');
2016-02-01 09:32:18 +00:00
event.dialogxx.classList.add('withbg');
2015-12-16 06:49:43 +00:00
event.dialogxx.classList.add('fixed');
2015-05-12 09:51:40 +00:00
ui.create.cheat2=function(){
2015-09-03 03:49:14 +00:00
_status.createControl=event.asboss;
2015-05-12 09:51:40 +00:00
ui.cheat2=ui.create.control('自由选将',function(){
if(this.dialog==_status.event.dialog){
2015-12-27 08:09:12 +00:00
if(game.changeCoin){
game.changeCoin(50);
}
2015-05-12 09:51:40 +00:00
this.dialog.close();
_status.event.dialog=this.backup;
ui.window.appendChild(this.backup);
delete this.backup;
game.uncheck();
game.check();
2015-09-03 03:49:14 +00:00
if(ui.cheat){
ui.cheat.style.opacity=1;
}
2015-05-12 09:51:40 +00:00
if(ui.cheat2x){
ui.cheat2x.close();
delete ui.cheat2x;
}
}
else{
2015-12-27 08:09:12 +00:00
if(game.changeCoin){
2016-01-12 13:18:47 +00:00
game.changeCoin(-10);
2015-12-27 08:09:12 +00:00
}
2015-05-12 09:51:40 +00:00
ui.cheat2x=ui.create.groupControl(_status.event.parent.dialogxx);
this.backup=_status.event.dialog;
_status.event.dialog.close();
_status.event.dialog=_status.event.parent.dialogxx;
this.dialog=_status.event.dialog;
ui.window.appendChild(this.dialog);
game.uncheck();
game.check();
2015-09-03 03:49:14 +00:00
if(ui.cheat){
ui.cheat.style.opacity=0.6;
}
2015-05-12 09:51:40 +00:00
}
});
2015-09-03 03:49:14 +00:00
delete _status.createControl;
2015-05-12 09:51:40 +00:00
}
if(!ui.cheat&&get.config('change_choice'))
ui.create.cheat();
if(!ui.cheat2&&get.config('free_choose'))
ui.create.cheat2();
2015-05-13 10:26:54 +00:00
event.asboss=ui.create.control('应战',function(){
event.boss=true;
event.enemy=[];
for(var i=0;i<ui.selected.buttons.length;i++){
event.enemy.push(ui.selected.buttons[i].link);
event.list.remove(ui.selected.buttons[i].link);
}
while(event.enemy.length<3){
event.enemy.push(event.list.randomRemove());
}
game.uncheck();
if(ui.confirm){
ui.confirm.close();
}
game.resume();
});
2015-05-12 09:51:40 +00:00
"step 1"
if(ui.cheat){
ui.cheat.close();
delete ui.cheat;
}
if(ui.cheat2){
ui.cheat2.close();
delete ui.cheat2;
}
if(ui.cheat2x){
ui.cheat2x.close();
delete ui.cheat2x;
}
event.asboss.close();
if(event.boss){
event.result={
boss:true,
links:event.enemy
};
}
else{
event.result={
boss:false,
links:result.links
};
2015-12-15 05:13:47 +00:00
_status.coinCoeff=get.coinCoeff(result.links);
2015-05-12 09:51:40 +00:00
}
}
return next;
},
},
boss:{
2016-01-04 08:59:37 +00:00
boss_zhuoguiquxie:{
chongzheng:99,
2016-01-07 09:29:44 +00:00
checkResult:function(player){
if(player==game.boss&&game.boss.name!='boss_yecha'&&game.boss.name!='boss_luocha'){
2016-01-04 08:59:37 +00:00
return false;
}
2016-01-28 06:46:42 +00:00
},
init:function(){
_status.additionalReward=function(){
return 500;
}
}
},
boss_nianshou:{
chongzheng:99,
init:function(){
game.boss.node.action.classList.add('freecolor');
game.boss.node.action.style.opacity=1;
game.boss.node.action.style.letterSpacing='4px';
game.boss.node.action.style.marginRight=0;
game.boss.node.action.style.fontFamily='huangcao';
game.boss.node.action.innerHTML='';
_status.additionalReward=function(){
return Math.round(Math.pow(_status.damageCount,2.4))*2;
}
var time=360;
var interval=setInterval(function(){
if(_status.over){
clearInterval(interval);
return;
}
var sec=time%60;
if(sec<10){
sec='0'+sec;
}
game.boss.node.action.innerHTML=Math.floor(time/60)+':'+sec;
if(time<=0){
delete _status.additionalReward;
if(typeof _status.coin=='number'){
if(game.me==game.boss){
_status.coin+=Math.round(Math.pow(_status.damageCount,2.4));
}
else{
_status.coin+=Math.round(Math.pow(_status.damageCount,1.8));
}
}
game.forceOver(true);
clearInterval(interval);
}
time--;
},1000);
_status.damageCount=0;
ui.damageCount=ui.create.system('伤害: 0',null,true);
2016-01-04 08:59:37 +00:00
}
},
2016-02-05 03:09:04 +00:00
boss_nianshou_heti:{
chongzheng:99,
},
2015-05-12 15:10:35 +00:00
boss_zhangjiao:{
2015-10-08 06:16:37 +00:00
// loopType:2,
2015-05-12 15:10:35 +00:00
},
2015-05-12 09:51:40 +00:00
boss_caiwenji:{
loopType:2,
},
boss_pangtong:{
2015-08-15 09:10:06 +00:00
loopType:2,
chongzheng:12
2015-05-12 09:51:40 +00:00
},
2015-11-28 07:19:04 +00:00
boss_zhaoyun:{
chongzheng:12
},
2015-05-12 09:51:40 +00:00
boss_zhenji:{
chongzheng:4,
},
boss_lvbu1:{
loopType:2
},
2015-05-12 15:10:35 +00:00
boss_zuoci:{
2015-05-14 02:21:00 +00:00
chongzheng:4,
2015-05-12 15:10:35 +00:00
},
boss_diaochan:{
2015-05-14 02:21:00 +00:00
chongzheng:4,
2015-05-12 15:10:35 +00:00
},
2015-08-15 09:10:06 +00:00
boss_huangyueying:{
chongzheng:12,
2015-05-12 15:10:35 +00:00
},
2015-05-12 09:51:40 +00:00
global:{
loopType:1,
chongzheng:6
},
2015-05-11 03:43:37 +00:00
},
2015-05-12 09:51:40 +00:00
skill:{
_bossswap:{
trigger:{player:['phaseBegin','chooseToUseBegin','chooseToRespondBegin','chooseToDiscardBegin','chooseToCompareBegin',
'chooseButtonBegin','chooseCardBegin','chooseTargetBegin','chooseCardTargetBegin','chooseControlBegin',
'chooseBoolBegin','choosePlayerCardBegin','discardPlayerCardBegin','gainPlayerCardBegin']},
forced:true,
priority:100,
popup:false,
filter:function(event,player){
2016-01-07 09:29:44 +00:00
if(!get.config('single_control')) return false;
2015-05-12 09:51:40 +00:00
if(event.autochoose&&event.autochoose()) return false;
return player.isUnderControl();
},
content:function(){
game.modeSwapPlayer(player);
},
},
2015-05-11 03:43:37 +00:00
},
2015-05-11 11:57:44 +00:00
translate:{
2015-05-12 09:51:40 +00:00
zhu:'神',
cai:'盟',
},
ai:{
get:{
attitude:function(from,to){
2015-05-12 15:10:35 +00:00
var t=(from.side===to.side?1:-1);
2015-05-13 10:26:54 +00:00
if(from.isMad()){
2015-05-12 15:10:35 +00:00
t=-t;
}
2015-05-13 10:26:54 +00:00
else if(to.isMad()){
2015-05-12 15:10:35 +00:00
t=0;
}
return 6*t;
2015-05-12 09:51:40 +00:00
}
}
},
config:['ban_weak','change_choice','free_choose','']
2015-05-08 08:07:38 +00:00
}