'use strict'; mode.boss={ start:function(){ "step 0" 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; } for(var i in lib.characterPack.mode_boss){ lib.character[i]=lib.characterPack.mode_boss[i]; if(!lib.character[i][4]){ lib.character[i][4]=[]; } } 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(lib.assetURL+'layout/mode','boss'); game.delay(0.1); "step 1" var bosslist=ui.create.div('#bosslist.hidden'); event.bosslist=bosslist; bosslist.ontouchmove = ui.click.touchScroll; bosslist.style.WebkitOverflowScrolling='touch'; if(!lib.config.touchscreen&&lib.config.mousewheel){ bosslist._scrollspeed=30; bosslist._scrollnum=10; bosslist.onmousewheel=ui.click.mousewheel; } var bosslistlinks={}; var toggleBoss=function(bool){ game.saveConfig(this._link.config._name,bool,true); var node=bosslistlinks[this._link.config._name]; 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); event.current=null; var list=[]; for(var i in lib.character){ var info=lib.character[i]; if(info[4].contains('boss')&&!lib.config.banned.contains(i)){ 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]); lib.mode.boss.config[cfg]={ name:get.translation(i), onclick:toggleBoss, init:true, } 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]; if(info[2]==Infinity){ player.node.hp.innerHTML='∞'; } player.setIdentity(player.name); player.node.identity.dataset.color=info[5]; bosslistlinks[cfg]=player; player.classList.add('bossplayer'); if(lib.storage.current==i){ event.current=player; player.classList.add('highlight'); } if(!get.config(cfg)){ player.style.display='none'; } } } if(!list.length){ alert('挑战模式不可隐藏boss武将包,请在选项-其它中选择“重置隐藏扩展包”'); event.finish(); _status.over=true; return; } if(!event.current){ event.current=bosslist.childNodes[1]; event.current.classList.add('highlight'); } ui.create.div(bosslist); lib.translate.boss_pangtong='涅槃凤雏'; ui.create.cards(); game.finishCards(); ui.arena.dataset.number=8; ui.control.style.transitionProperty='opacity'; ui.control.classList.add('bosslist'); setTimeout(function(){ ui.control.style.transitionProperty=''; },1000); ui.window.appendChild(bosslist); setTimeout(function(){ if(event.current){ var left=event.current.offsetLeft-(ui.window.offsetWidth-180)/2; if(bosslist.scrollLeft0){ td.innerHTML='剩余'+get.cnNumber(game.bossinfo.chongzheng-game.dead[i].storage.boss_chongzheng)+'回合'; } else{ td.innerHTML='无法重整' } } if(!added){ uiintro.add('
(无重整角色)
'); uiintro.add(ui.create.div('.placeholder.slim')) } else{ uiintro.add(table); } return uiintro; },180); 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'; } ui.arena.appendChild(boss); ui.refresh(boss); boss.classList.remove('highlight'); boss.classList.remove('bossplayer'); boss.style.left=''; boss.style.top=''; boss.style.position=''; setTimeout(function(){ boss.node.equips.style.opacity=''; },500); event.bosslist.delete(); game.arrangePlayers(); for(var i=0;i0){ if(player.hp0?player.node.handcards1:player.node.handcards2; card.fix(); card.animate('start'); position.insertBefore(card,position.firstChild); player.$draw(); game.log(player,'摸了一张牌'); } player.update(); if(player.storage.boss_chongzheng>=game.bossinfo.chongzheng){ player.revive(player.hp); } } if(game.bossinfo.loopType==2){ game.boss.chongzheng=true; } } else{ if(player.identity=='zhu'&&game.boss!=player){ player=game.boss; } 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; game.addVideo('onSwapControl'); var name=game.me.name; if(ui.fakeme&&ui.fakeme.current!=name){ ui.fakeme.current=name; if(ui.versushighlight&&ui.versushighlight!=game.me){ ui.versushighlight.classList.remove('current_action'); } ui.versushighlight=game.me; game.me.classList.add('current_action'); // game.me.line(ui.fakeme,{opacity:0.5,dashed:true}); ui.fakeme.style.backgroundImage=game.me.node.avatar.style.backgroundImage; // ui.fakeme.style.backgroundSize='cover'; } ui.updatehl(); }, 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.setContent(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; if(lib.character[i][4]&&lib.character[i][4].contains('forbidai')) continue; if(lib.config.forbidboss.contains(i)) continue; if(lib.filter.characterDisabled(i)) continue; list.push(i); } list.randomSort(); var dialog=ui.create.dialog('选择参战角色','hidden'); dialog.classList.add('fixed'); ui.window.appendChild(dialog); dialog.classList.add('bosscharacter'); dialog.classList.add('withbg'); // dialog.add('0/3'); 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]; // next.custom.add.button=function(){ // if(ui.cheat2&&ui.cheat2.backup) return; // _status.event.dialog.content.childNodes[1].innerHTML= // ui.selected.buttons.length+'/3'; // }; event.changeDialog=function(){ if(ui.cheat2&&ui.cheat2.dialog==_status.event.dialog){ return; } if(game.changeCoin){ game.changeCoin(-3); } list.randomSort(); var buttons=ui.create.div('.buttons'); var node=_status.event.dialog.buttons[0].parentNode; _status.event.dialog.buttons=ui.create.buttons(list.slice(0,20),'character',buttons); _status.event.dialog.content.insertBefore(buttons,node); buttons.animate('start'); node.remove(); game.uncheck(); game.check(); }; ui.create.cheat=function(){ _status.createControl=ui.cheat2||event.asboss; ui.cheat=ui.create.control('更换',event.changeDialog); delete _status.createControl; }; event.dialogxx=ui.create.characterDialog(); event.dialogxx.classList.add('bosscharacter'); event.dialogxx.classList.add('withbg'); event.dialogxx.classList.add('fixed'); ui.create.cheat2=function(){ _status.createControl=event.asboss; ui.cheat2=ui.create.control('自由选将',function(){ if(this.dialog==_status.event.dialog){ if(game.changeCoin){ game.changeCoin(50); } this.dialog.close(); _status.event.dialog=this.backup; ui.window.appendChild(this.backup); delete this.backup; game.uncheck(); game.check(); if(ui.cheat){ ui.cheat.style.opacity=1; } } else{ if(game.changeCoin){ game.changeCoin(-10); } 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(); if(ui.cheat){ ui.cheat.style.opacity=0.6; } } }); delete _status.createControl; } if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); event.asboss=ui.create.control('应战',function(){ event.boss=true; event.enemy=[]; for(var i=0;i0; }, content:function(){ "step 0" player.chooseCard(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+ get.translation(trigger.player.judging[0])+','+get.prompt('tiandao'),'he').ai=function(card){ var trigger=_status.event.parent._trigger; var player=_status.event.player; var result=trigger.judge(card)-trigger.judge(trigger.player.judging[0]); var attitude=ai.get.attitude(player,trigger.player); if(attitude==0||result==0) return 0; if(attitude>0){ return result; } else{ return -result; } }; "step 1" if(result.bool){ player.respond(result.cards,'highlight'); } else{ event.finish(); } "step 2" if(result.bool){ player.logSkill('tiandao'); player.$gain2(trigger.player.judging[0]); player.gain(trigger.player.judging[0]); trigger.player.judging[0]=result.cards[0]; trigger.position.appendChild(result.cards[0]); game.log(trigger.player,'的判定牌改为',result.cards[0]); } "step 3" game.delay(2); }, ai:{ tag:{ rejudge:1 }, threaten:1.5 } }, lianji:{ audio:true, enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ if(player==target) return false; return target.num('h')>0; }, selectTarget:2, multitarget:true, multiline:true, filter:function(event,player){ return player.num('h')>0; }, prepare:function(cards,player,targets){ player.$throw(cards); player.line(targets); }, discard:false, filterCard:true, check:function(card){ return 6-ai.get.value(card); }, content:function(){ "step 0" if(targets[0].num('h')&&targets[1].num('h')){ targets[0].chooseToCompare(targets[1]); } else{ event.finish(); } "step 1" if(result.bool){ targets[0].gain(cards); targets[0].$gain2(cards); targets[1].damage(targets[0]); } else{ targets[1].gain(cards); targets[1].$gain2(cards); targets[0].damage(targets[1]); } }, ai:{ expose:0.3, threaten:2, order:9, result:{ target:-1 } }, }, mazui:{ audio:true, enable:'phaseUse', usable:1, filterCard:{color:'black'}, filterTarget:function(card,player,target){ return !target.hasSkill('mazui2'); }, check:function(card){ return 6-ai.get.value(card); }, discard:false, prepare:function(cards,player,targets){ player.$give(cards,targets[0]); player.line(targets[0],'green'); }, content:function(){ "step 0" game.delay(); "step 1" target.storage.mazui2=cards[0]; target.addSkill('mazui2'); game.addVideo('storage',target,['mazui2',get.cardInfo(target.storage.mazui2),'card']); }, ai:{ expose:0.2, result:{ target:function(player,target){ return -target.hp; } }, order:4, threaten:1.2 } }, mazui2:{ trigger:{source:'damageBegin'}, forced:true, mark:'card', filter:function(event){ return event.num>0; }, content:function(){ trigger.num--; player.addSkill('mazui3'); player.removeSkill('mazui2'); }, intro:{ content:'card' } }, mazui3:{ trigger:{source:'damageEnd'}, forced:true, popup:false, content:function(){ player.gain(player.storage.mazui2,'gain2'); game.log(player,'获得了',player.storage.mazui2); player.removeSkill('mazui3'); delete player.storage.mazui2; } }, yunshen:{ trigger:{player:'respond'}, filter:function(event,player){ return event.card.name=='shan'; }, frequent:true, init:function(player){ player.storage.yunshen=0; }, content:function(){ player.storage.yunshen++; player.markSkill('yunshen'); }, ai:{ effect:{ target:function(card,player,target){ if(get.tag(card,'respondShan')){ var shans=target.num('h','shan'); var hs=target.num('h'); if(shans>1) return [1,1]; if(shans&&hs>2) return [1,1]; if(shans) return [1,0.5]; if(hs>2) return [1,0.3]; if(hs>1) return [1,0.2]; return [1.2,0]; } } }, threaten:0.8 }, intro:{ content:'mark' }, group:'yunshen2' }, yunshen2:{ trigger:{player:'phaseBegin'}, forced:true, filter:function(event,player){ return player.storage.yunshen>0; }, content:function(){ player.draw(player.storage.yunshen); player.storage.yunshen=0; player.unmarkSkill('yunshen'); }, mod:{ globalTo:function(from,to,distance){ if(typeof to.storage.yunshen=='number') return distance+to.storage.yunshen; } } }, lingbo:{ audio:2, trigger:{player:'respond'}, filter:function(event,player){ return event.card.name=='shan'; }, frequent:true, content:function(){ player.draw(2); }, ai:{ mingzhi:false, effect:{ target:function(card,player,target){ if(get.tag(card,'respondShan')){ var shans=target.num('h','shan'); var hs=target.num('h'); if(shans>1) return [0,1]; if(shans&&hs>2) return [0,1]; if(shans) return [0,0]; if(hs>2) return [0,0]; if(hs>1) return [1,0.5]; return [1.5,0]; } } }, threaten:0.8 } }, jiaoxia:{ audio:2, trigger:{target:'useCardToBegin'}, filter:function(event,player){ return event.card&&get.color(event.card)=='red'; }, frequent:true, content:function(){ player.draw(); }, ai:{ effect:function(card,player,target){ if(get.color(card)=='red') return [1,1]; }, } }, boss_nbianshenx:{}, boss_jingjue:{ inherit:'boss_danshu' }, boss_renxing:{ trigger:{global:['damageEnd','recoverEnd']}, forced:true, filter:function(event,player){ return _status.currentPhase!=player; }, content:function(){ player.draw(); } }, boss_ruizhi:{ trigger:{global:'phaseBegin'}, forced:true, filter:function(event,player){ return event.player!=player&&event.player.num('he')>1; }, content:function(){ 'step 0' player.line(trigger.player,'green'); var next=trigger.player.chooseCard(true,'选择保留一张手牌和一张装备区内的牌,然后弃置其它牌','he',function(card){ switch(get.position(card)){ case 'h':{ if(ui.selected.cards.length){ return get.position(ui.selected.cards[0])=='e'; } else{ return trigger.player.num('h')>1; } break; } case 'e':{ if(ui.selected.cards.length){ return get.position(ui.selected.cards[0])=='h'; } else{ return trigger.player.num('e')>1; } break; } } }); var num=0; if(trigger.player.num('h')>1){ num++; } if(trigger.player.num('e')>1){ num++; } next.selectCard=[num,num]; next.ai=function(card){ return ai.get.value(card); }; 'step 1' if(result.bool){ var he=[]; var hs=trigger.player.get('h'); var es=trigger.player.get('e'); if(hs.length>1){ he=he.concat(hs); } if(es.length>1){ he=he.concat(es); } for(var i=0;i4){ trigger.num=4+Math.floor(Math.random()*(player.hp-3)); } else{ trigger.num=4; } }, subSkill:{ sha:{ mod:{ cardUsable:function(card,player,num){ if(card.name=='sha'&&player.hp<5) return Infinity; } }, trigger:{source:'damageBegin'}, filter:function(event,player){ return event.card&&event.card.name=='sha'&&event.notLink()&&player.hp<5; }, forced:true, content:function(){ trigger.num++; } } } }, boss_shouyi:{ mod:{ targetInRange:function(){ return true; } }, }, boss_mengtai:{ group:['boss_mengtai_begin','boss_mengtai_draw','boss_mengtai_use', 'boss_mengtai_discard','boss_mengtai_end'], subSkill:{ begin:{ trigger:{player:'phaseBegin'}, forced:true, popup:false, content:function(){ player.storage.boss_mengtai_draw=true; player.storage.boss_mengtai_use=true; } }, draw:{ trigger:{player:'phaseDrawBegin'}, forced:true, popup:false, content:function(){ player.storage.boss_mengtai_draw=false; } }, use:{ trigger:{player:'phaseUseBegin'}, forced:true, popup:false, content:function(){ player.storage.boss_mengtai_use=false; } }, discard:{ trigger:{player:'phaseDiscardBefore'}, forced:true, filter:function(event,player){ if(player.storage.boss_mengtai_use) return true; return false; }, content:function(){ trigger.untrigger(); trigger.finish(); } }, end:{ trigger:{player:'phaseEnd'}, forced:true, filter:function(event,player){ if(player.storage.boss_mengtai_draw) return true; return false; }, content:function(){ player.draw(3); } } } }, boss_nbianshen:{ trigger:{player:'phaseBefore'}, forced:true, popup:false, priority:25, filter:function(event,player){ if(player.name=='boss_nianshou_heti'||player.storage.boss_nbianshen) return true; return false; }, content:function(){ if(player.storage.boss_nbianshen){ var hp=player.hp, maxHp=player.maxHp, hujia=player.hujia; player.init('boss_nianshou_'+player.storage.boss_nbianshen_next); player.storage.boss_nbianshen.remove(player.storage.boss_nbianshen_next); if(!player.storage.boss_nbianshen.length){ player.storage.boss_nbianshen=['jingjue','renxing','ruizhi','baonu']; } player.storage.boss_nbianshen_next=player.storage.boss_nbianshen.randomGet(player.storage.boss_nbianshen_next); player.hp=hp; player.maxHp=maxHp; player.hujia=hujia; player.update(); } else{ player.storage.boss_nbianshen=['jingjue','renxing','ruizhi','baonu']; player.storage.boss_nbianshen_next=player.storage.boss_nbianshen.randomGet(); player.markSkill('boss_nbianshen'); } }, intro:{ content:function(storage,player){ var map={ jingjue:'警觉', renxing:'任性', ruizhi:'睿智', baonu:'暴怒' }; return '下一个状态:'+map[player.storage.boss_nbianshen_next]; } } }, boss_damagecount:{ mode:['boss'], global:'boss_damagecount2' }, boss_damagecount2:{ trigger:{source:'damageEnd'}, forced:true, popup:false, silent:true, filter:function(event,player){ if(!ui.damageCount) return false; return event.num>0&&player.isFriendOf(game.me)&&event.player.isEnemyOf(game.me); }, content:function(){ _status.damageCount+=trigger.num; ui.damageCount.innerHTML='伤害: '+_status.damageCount; } }, boss_nianrui:{ trigger:{player:'phaseDrawBegin'}, forced:true, content:function(){ trigger.num+=2; }, ai:{ threaten:1.6 } }, boss_qixiang:{ group:['boss_qixiang1','boss_qixiang2'], ai:{ effect:{ target:function(card,player,target,current){ if(card.name=='lebu'&&card.name=='bingliang') return 0.8; } } } }, boss_qixiang1:{ trigger:{player:'judge'}, forced:true, filter:function(event,player){ if(event.card){ if(event.card.viewAs){ return event.card.viewAs=='lebu'; } else{ return event.card.name=='lebu'; } } }, content:function(){ player.addTempSkill('boss_qixiang3','judgeAfter'); } }, boss_qixiang2:{ trigger:{player:'judge'}, forced:true, filter:function(event,player){ if(event.card){ if(event.card.viewAs){ return event.card.viewAs=='bingliang'; } else{ return event.card.name=='bingliang'; } } }, content:function(){ player.addTempSkill('boss_qixiang4','judgeAfter'); } }, boss_qixiang3:{ mod:{ suit:function(card,suit){ if(suit=='diamond') return 'heart'; } } }, boss_qixiang4:{ mod:{ suit:function(card,suit){ if(suit=='spade') return 'club'; } } }, boss_bianshen2:{ mode:['boss'], global:'boss_bianshen2x' }, boss_bianshen2x:{ trigger:{global:'dieAfter'}, forced:true, priority:-10, globalFixed:true, filter:function(event){ if(lib.config.mode!='boss') return false; return event.player==game.boss&&event.player.hasSkill('boss_bianshen2'); }, content:function(){ 'step 0' game.delay(); 'step 1' game.changeBoss(['boss_niutou','boss_mamian'].randomGet()); } }, boss_bianshen3:{ mode:['boss'], global:'boss_bianshen3x' }, boss_bianshen3x:{ trigger:{global:'dieAfter'}, forced:true, priority:-10, globalFixed:true, filter:function(event){ if(lib.config.mode!='boss') return false; return event.player==game.boss&&event.player.hasSkill('boss_bianshen3'); }, content:function(){ 'step 0' game.delay(); 'step 1' game.changeBoss(['boss_baiwuchang','boss_heiwuchang'].randomGet()); } }, boss_bianshen4:{ mode:['boss'], global:'boss_bianshen4x' }, boss_bianshen4x:{ trigger:{global:'dieAfter'}, forced:true, priority:-10, globalFixed:true, filter:function(event){ if(lib.config.mode!='boss') return false; return event.player==game.boss&&event.player.hasSkill('boss_bianshen4'); }, content:function(){ 'step 0' game.delay(); 'step 1' game.changeBoss(['boss_yecha','boss_luocha'].randomGet()); } }, boss_moyany:{ trigger:{player:'loseEnd'}, frequent:true, unique:true, filter:function(event,player){ return _status.currentPhase!=player; }, content:function(){ "step 0" player.judge(function(card){ return get.color(card)=='red'?1:0; }); "step 1" if(result.bool){ player.chooseTarget(true,'选择一个目标对其造成两点火焰伤害',function(card,player,target){ return player!=target; }).ai=function(target){ return ai.get.damageEffect(target,player,player,'fire'); } } else{ event.finish(); } "step 2" if(result.targets.length){ player.line(result.targets,'fire'); result.targets[0].damage(2,'fire'); } }, ai:{ effect:{ target:function(card){ if(get.tag(card,'loseCard')){ return [0.5,1]; } } } } }, boss_danshu:{ trigger:{player:'loseEnd'}, frequent:true, unique:true, filter:function(event,player){ return _status.currentPhase!=player&&player.hp=player.hp; }).ai=function(target){ return ai.get.damageEffect(target,player,player,'fire'); } "step 1" if(result.bool){ player.logSkill('boss_xiaoshou',result.targets); result.targets[0].damage('fire',3); } }, }, boss_manjia:{ group:['boss_manjia1','boss_manjia2'] }, boss_manjia1:{ trigger:{target:'useCardToBefore'}, forced:true, priority:6, filter:function(event,player){ if(player.get('e','2')) return false; if(event.player.num('s','unequip')) return false; if(event.card.name=='nanman') return true; if(event.card.name=='wanjian') return true; if(event.card.name=='sha'&&!event.card.nature) return true; }, content:function(){ trigger.untrigger(); trigger.finish(); }, ai:{ effect:{ target:function(card,player,target,current){ if(target.get('e','2')) return; if(player.num('s','unequip')) return; if(card.name=='nanman'||card.name=='wanjian') return 0; if(card.name=='sha'){ var equip1=player.get('e','1'); if(equip1&&equip1.name=='zhuque') return 2; if(equip1&&equip1.name=='qinggang') return 1; if(!card.nature) return 0; } } } } }, boss_manjia2:{ trigger:{player:'damageBegin'}, filter:function(event,player){ if(player.get('e','2')) return false; if(event.nature=='fire') return true; }, forced:true, check:function(){ return false; }, content:function(){ trigger.num++; }, ai:{ effect:{ target:function(card,player,target,current){ if(target.get('e','2')) return; if(card.name=='sha'){ if(card.nature=='fire'||player.hasSkill('zhuque_skill')) return 2; } if(get.tag(card,'fireDamage')&¤t<0) return 2; } } } }, boss_lianyu:{ trigger:{player:'phaseEnd'}, unique:true, content:function(){ "step 0" event.players=get.players(player); "step 1" if(event.players.length){ var current=event.players.shift(); if(current.isEnemyOf(player)){ player.line(current,'fire'); current.damage('fire'); } event.redo(); } }, ai:{ threaten:2 } }, boss_guiji:{ trigger:{player:'phaseJudgeBegin'}, forced:true, content:function(){ player.discard(player.get('j').randomGet()); }, filter:function(event ,player){ return player.num('j')>0; }, ai:{ effect:{ target:function(card,player,target,current){ if(get.type(card)=='delay'&&target.num('j')==0) return 0.1; } } } }, boss_minbao:{ global:'boss_minbao2' }, boss_minbao2:{ trigger:{global:'dieAfter'}, forced:true, globalFixed:true, filter:function(event,player){ return event.player.hasSkill('boss_minbao')&&event.player.isDead(); }, content:function(){ trigger.player.line(player,'fire'); player.damage('nosource','fire').animate=false; player.$damage(trigger.player); if(lib.config.animation&&!lib.config.low_performance){ player.$fire(); } if(!event.parent.parent.boss_minbao_logv){ event.parent.parent.boss_minbao_logv=true; game.logv(trigger.player,'boss_minbao',game.players.slice(0),event.parent.parent); } } }, boss_guihuo:{ trigger:{player:'phaseEnd'}, direct:true, content:function(){ "step 0" player.chooseTarget(get.prompt('boss_guihuo'),function(card,player,target){ return player!=target; }).ai=function(target){ return ai.get.damageEffect(target,player,player,'fire'); } "step 1" if(result.bool){ player.logSkill('boss_guihuo',result.targets); result.targets[0].damage('fire'); } }, }, boss_luolei:{ trigger:{player:'phaseBegin'}, direct:true, content:function(){ "step 0" player.chooseTarget(get.prompt('boss_luolei'),function(card,player,target){ return player!=target; }).ai=function(target){ return ai.get.damageEffect(target,player,player,'thunder'); } "step 1" if(result.bool){ player.logSkill('boss_luolei',result.targets); result.targets[0].damage('thunder'); } }, }, boss_beiming:{ trigger:{player:'dieBegin'}, forced:true, filter:function(event){ return event.source!=undefined; }, content:function(){ trigger.source.discard(trigger.source.get('h')); }, ai:{ threaten:0.7 } }, boss_shanbeng:{ global:'boss_shanbeng2', trigger:{player:'dieBegin'}, forced:true, logv:false, content:function(){ var targets=[]; for(var i=0;i0&&event.player.hasSkill('boss_shanbeng')&&event.player.isDead(); }, content:function(){ player.discard(player.get('e')); } }, boss_didong:{ trigger:{player:'phaseEnd'}, direct:true, content:function(){ "step 0" player.chooseTarget(get.prompt('boss_didong'),function(card,player,target){ return target.isEnemyOf(player); }).ai=function(target){ var att=ai.get.attitude(player,target); if(target.isTurnedOver()){ if(att>0){ return att+5; } return -1; } if(player.isTurnedOver()){ return 5-att; } return -att; }; "step 1" if(result.bool){ player.logSkill('boss_didong',result.targets); result.targets[0].turnOver(); } }, ai:{ threaten:1.7 } }, boss_guimei:{ mod:{ targetEnabled:function(card,player,target){ if(get.type(card)=='delay'){ return false; } } } }, boss_bianshen:{ trigger:{global:'gameStart'}, forced:true, popup:false, content:function(){ player.init(['boss_chi','boss_mo','boss_wang','boss_liang'].randomGet()); game.addVideo('reinit2',player,player.name); } }, zhanjiang:{ trigger:{player:'phaseBegin'}, filter:function(event,player){ for(var i=0;i2){ if(!target.hasSkill('guidao')) return 0; return [0,hastarget?target.num('h')/4:0]; } if(target.num('h')>3||(be&&target.num('h')>=2)){ return [0,0]; } if(target.num('h')==0){ return [1.5,0]; } if(target.num('h')==1&&!be){ return [1.2,0]; } if(!target.hasSkill('guidao')) return [1,0.05]; return [1,Math.min(0.5,(target.num('h')+be)/4)]; } } } } }, wuqin:{ audio:2, trigger:{player:'phaseEnd'}, filter:function(event,player){ return player.num('h')==0; }, content:function(){ player.draw(3) } }, boss_baolin:{ audio:true, inherit:'juece', }, boss_qiangzheng:{ audio:2, trigger:{player:'phaseEnd'}, forced:true, unique:true, filter:function(event,player){ for(var i=0;i=3; }, content:function(){ "step 0" player.chooseTarget(function(card,player,target){ return target!=player; }).ai=function(){ return 1; } "step 1" if(result.bool){ player.logSkill('boss_konghun',result.targets); result.targets[0].goMad(); } }, group:'boss_konghun2' }, boss_konghun2:{ trigger:{player:'phaseBegin'}, forced:true, popup:false, content:function(){ var players=game.players.concat(game.dead); for(var i=0;i1){ num--; } else{ num++; } } return num; } } } }, huanhua:{ audio:2, trigger:{global:'gameDrawAfter'}, forced:true, unique:true, content:function(){ for(var i=0;i1; }, content:function(){ "step 0" event.players=get.players(player); event.num=0; "step 1" if(event.players.length){ event.players.shift().loseHp(); event.redo(); } } }, wuxin:{ inherit:'miles_xueyi', group:'swd_wuxie', audio:2, }, shenwei:{ audio:2, unique:true, trigger:{player:'phaseDrawBegin'}, forced:true, content:function(){ trigger.num+=Math.max(2,game.players.length-1); }, mod:{ maxHandcard:function(player,current){ return current+Math.max(2,game.players.length-1); } } }, shenji:{ unique:true, mod:{ selectTarget:function(card,player,range){ if(range[1]==-1) return; if(card.name=='sha'||card.name=='juedou') range[1]=3; }, } }, boss_baonu:{ unique:true, group:'boss_baonu2', trigger:{player:'changeHp'}, forced:true, priority:100, audio:2, mode:['identity','guozhan','boss','stone'], filter:function(event,player){ return player.hp<=4 }, content:function(){ player.init('boss_lvbu2'); player.update(); ui.clear(); while(_status.event.name!='phaseLoop'){ _status.event=_status.event.parent; } for(var i=0;i1) return [0,2]; if(num&&Math.random()<0.7) return [0,1]; } } } } } }, boss_baonu2:{ trigger:{player:'gameDrawBegin'}, forced:true, popup:false, content:function(){ player.draw(4,false); } }, qiwu:{ audio:true, trigger:{player:'useCard'}, forced:true, filter:function(event,player){ return get.suit(event.card)=='club'&&player.hp