'use strict'; game.import('mode',function(){ var game=window.game; var ui=window.ui; var get=window.get; var ai=window.ai; var lib=window.lib; var _status=window._status; return { name:'guozhan', startBefore:function(){ var playback=localStorage.getItem(lib.configprefix+'playback'); for(var i in lib.characterPack.mode_guozhan){ if(!get.config('onlyguozhan')&&!playback){ if(lib.character[i.slice(3)]) continue; } lib.character[i]=lib.characterPack.mode_guozhan[i]; if(!lib.character[i][4]){ lib.character[i][4]=[]; } if(!lib.translate[i]){ lib.translate[i]=lib.translate[i.slice(3)]; } } for(var i in lib.character){ if(lib.character[i][1]=='shen'){ if(lib.character[i][4]&&lib.group.contains(lib.character[i][4][0])){ lib.character[i][1]=lib.character[i][4][0]; } else{ lib.character[i][1]='qun'; } } } }, onreinit:function(){ var pack=lib.characterPack.mode_guozhan; for(var i in pack){ if(!lib.configOL.onlyguozhan){ if(lib.character[i.slice(3)]) continue; } lib.character[i]=pack[i]; if(!lib.character[i][4]){ lib.character[i][4]=[]; } if(!lib.translate[i]){ lib.translate[i]=lib.translate[i.slice(3)]; } } }, 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(); } else if(_status.connectMode){ game.waitForPlayer(); } else{ if(get.config('guozhanpile')){ lib.card.list=lib.guozhanPile.slice(0); } game.prepareArena(); // game.delay(); game.showChangeLog(); } if(!_status.connectMode){ _status.mode=get.config('guozhan_mode'); if(_status.brawl&&_status.brawl.submode){ _status.mode=_status.brawl.submode; } } "step 1" if(_status.connectMode){ if(lib.configOL.guozhanpile){ lib.card.list=lib.guozhanPile.slice(0); } game.broadcastAll(function(pack){ for(var i=0;i0){ return true; } return false; }, content:function(){ "step 0" var zhu=get.zhu(player,'hongfa'); player.chooseCardButton(get.prompt('huangjintianbingfu'),zhu.storage.huangjintianbingfu).set('ai',function(){ if(_status.event.goon) return 1; return 0; }).set('goon',player.countCards('h','sha')==0); "step 1" if(result.bool){ var card=result.links[0]; trigger.untrigger(); trigger.responded=true; trigger.result={bool:true,card:{name:'sha'},cards:[card]}; var zhu=get.zhu(player,'hongfa'); zhu.storage.huangjintianbingfu.remove(card); zhu.syncStorage('huangjintianbingfu'); zhu.updateMarks('huangjintianbingfu'); player.logSkill('_hongfa2'); } } }, _hongfa:{ enable:'chooseToUse', filter:function(event,player){ if(!event.filterCard({name:'sha'},player)) return false; var zhu=get.zhu(player,'hongfa'); if(zhu&&zhu.storage.huangjintianbingfu&&zhu.storage.huangjintianbingfu.length>0){ return true; } return false; }, chooseButton:{ dialog:function(event,player){ var zhu=get.zhu(player,'hongfa'); return ui.create.dialog('黄巾天兵符',zhu.storage.huangjintianbingfu,'hidden'); }, backup:function(links,player){ return { filterCard:function(){return false}, selectCard:-1, viewAs:{name:'sha'}, cards:links, onuse:function(result,player){ result.cards=lib.skill[result.skill].cards; var card=result.cards[0]; var zhu=get.zhu(player,'hongfa'); zhu.storage.huangjintianbingfu.remove(card); zhu.syncStorage('huangjintianbingfu'); zhu.updateMarks('huangjintianbingfu'); player.logSkill('_hongfa',result.targets); } } }, prompt:function(links,player){ return '选择杀的目标'; } }, ai:{ respondSha:true, skillTagFilter:function(player){ var zhu=get.zhu(player,'hongfa'); if(zhu&&zhu.storage.huangjintianbingfu&&zhu.storage.huangjintianbingfu.length>0){ return true; } return false; }, order:function(){ return get.order({name:'sha'})-0.1; }, result:{ player:function(player){ if(player.countCards('h','sha')) return 0; return 1; } } } }, hongfa:{ init:function(player){ player.storage.huangjintianbingfu=[]; }, derivation:'huangjintianbingfu', unique:true, forceunique:true, trigger:{player:'phaseBegin'}, forced:true, filter:function(event,player){ return player.storage.huangjintianbingfu.length==0; }, content:function(){ player.storage.huangjintianbingfu.addArray(get.cards(get.population('qun'))); player.syncStorage('huangjintianbingfu'); player.updateMarks('huangjintianbingfu'); }, ai:{ threaten:2, }, group:'hongfa_hp', subSkill:{ hp:{ trigger:{player:'loseHpBefore'}, filter:function(event,player){ return player.storage.huangjintianbingfu.length>0; }, direct:true, content:function(){ 'step 0' player.chooseCardButton(get.prompt('hongfa'),player.storage.huangjintianbingfu).set('ai',function(){ return 1; }); 'step 1' if(result.bool){ var card=result.links[0]; ui.discardPile.appendChild(card); player.storage.huangjintianbingfu.remove(card); player.$throw(card,1000); player.updateMarks('huangjintianbingfu'); player.syncStorage('huangjintianbingfu'); trigger.untrigger(); trigger.finish(); player.logSkill('hongfa'); game.delay(); } } } } }, wendao:{ unique:true, forceunique:true, enable:'phaseUse', filterCard:{color:'red'}, position:'he', check:function(card){ return 6-get.value(card); }, filter:function(event,player){ for(var i=0;i
  • 当你计算群势力角色数时,每一张“天兵”均可视为一名群势力角色。
  • 每当你失去体力时,你可改为将一张“天兵”置入弃牌堆。
  • 与你势力相同的角色可将一张“天兵”当【杀】使用或打出。',false) }, } }, wuxin:{ unique:true, trigger:{player:'phaseDrawBegin'}, // frequent:'check', // check:function(event,player){ // var num=get.population('qun'); // if(player.hasSkill('huangjintianbingfu')){ // num+=player.storage.huangjintianbingfu.length; // } // return num>event.num; // }, content:function(){ 'step 0' var num=get.population('qun'); if(player.hasSkill('huangjintianbingfu')){ num+=player.storage.huangjintianbingfu.length; } player.chooseCardButton(num,true,get.cards(num),'按顺将卡牌置于牌堆顶(先选择的在上)').set('ai',function(button){ return get.value(button.link); }); 'step 1' if(result.bool){ var list=result.links.slice(0); while(list.length){ ui.cardPile.insertBefore(list.pop(),ui.cardPile.firstChild); } } } }, zhangwu:{ unique:true, forceunique:true, ai:{ threaten:2, }, group:['zhangwu_gain','zhangwu_clear','zhangwu_count1','zhangwu_count2','zhangwu_count3'], subSkill:{ gain:{ trigger:{global:['discardAfter','respondAfter','useCardAfter','equipAfter', 'judgeAfter','useSkillAfter','phaseDrawBegin','phaseAfter']}, forced:true, filter:function(event,player){ if(player.storage.zhangwu){ for(var i=0;i
    【武圣】
    将“红色牌”改为“任意牌”
    【咆哮】
    增加描述“你使用的【杀】无视其他角色的防具”
    【龙胆】
    增加描述“你每发动一次‘龙胆’便摸一张牌”
    【烈弓】
    增加描述“你的攻击范围+1”
    【铁骑】
    将“若结果为红色”改为“若结果不为黑桃”
    ' } }, jizhao:{ derivation:'gzrende', unique:true, enable:'chooseToUse', mark:true, skillAnimation:true, animationColor:'fire', init:function(player){ player.storage.jizhao=false; }, filter:function(event,player){ if(player.storage.jizhao) return false; if(event.type=='dying'){ if(player!=event.dying) return false; return true; } return false; }, content:function(){ 'step 0' player.awakenSkill('jizhao'); player.storage.jizhao=true; var num=player.maxHp-player.countCards('h'); if(num>0){ player.draw(num); } 'step 1' if(player.hp<2){ player.recover(2-player.hp); } 'step 2' player.removeSkill('shouyue'); player.removeSkill('wuhujiangdaqi'); player.addSkill('gzrende'); }, ai:{ order:1, skillTagFilter:function(player){ if(player.storage.jizhao) return false; if(player.hp>0) return false; }, save:true, result:{ player:10 }, }, intro:{ content:'limited' } }, gzshoucheng:{ inherit:'shoucheng', filter:function(event,player){ if(event.player.countCards('h')) return false; if(!event.player.isFriendOf(player)) return false; if(_status.currentPhase==event.player) return false; for(var i=0;i0; }, content:function(){ "step 0" player.chooseCardTarget({ filterCard:function(card){ return get.type(card)=='equip'; }, position:'he', filterTarget:function(card,player,target){ return !target.getEquip(card); }, ai1:function(card){ return 6-get.value(card); }, ai2:function(target){ return get.attitude(_status.event.player,target)-3; }, prompt:get.prompt('yuanhu') }); "step 1" if(result.bool){ var target=result.targets[0]; player.logSkill('huyuan',target); event.current=target; target.equip(result.cards[0]); if(target!=player){ player.$give(result.cards,target); } game.delay(2); player.chooseTarget('弃置一名角色的一张牌',function(card,player,target){ var source=_status.event.source; return get.distance(source,target)<=1&&source!=target&&target.countCards('he'); }).set('ai',function(target){ return -get.attitude(_status.event.player,target); }).set('source',target); } else{ event.finish(); } "step 2" if(result.targets.length){ event.current.line(result.targets,'green'); player.discardPlayerCard(true,result.targets[0],'he'); } }, }, heyi:{ zhenfa:'inline' }, _heyi:{ mod:{ globalTo:function(from,to,distance){ if(game.hasPlayer(function(current){ return current.hasSkill('heyi')&¤t.inline(to); })){ return distance+1; } } } }, tianfu:{ init:function(player){ player.checkMainSkill('tianfu'); }, inherit:'kanpo', zhenfa:'inline', viewAsFilter:function(player){ return _status.currentPhase.inline(player)&&!player.hasSkill('kanpo')&&player.countCards('h',{color:'black'})>0; }, }, yizhi:{ init:function(player){ if(player.checkViceSkill('yizhi')){ player.removeMaxHp(); } }, inherit:'guanxing', filter:function(event,player){ return !player.hasSkill('guanxing'); } }, gzshangyi:{ audio:'shangyi', enable:'phaseUse', usable:1, filter:function(event,player){ return player.countCards('h')>0; }, filterTarget:function(card,player,target){ return player!=target&&(target.countCards('h')||target.isUnseen(2)); }, content:function(){ "step 0" target.viewCards(get.translation(player)+'的手牌',player.getCards('h')); "step 1" if(!target.countCards('h')){ event._result={index:1}; } else if(!target.isUnseen(2)){ event._result={index:0}; } else{ player.chooseControl().set('choiceList',[ '观看'+get.translation(target)+'的手牌并可以弃置其中的一张黑色牌', '观看'+get.translation(target)+'的所有暗置的武将牌', ]); } "step 2" if(result.index==0){ player.discardPlayerCard(target,'h').set('filterButton',function(button){ return get.color(button.link)=='black'; }).set('visible',true); } else{ player.viewCharacter(target,2); } }, ai:{ order:11, result:{ target:function(player,target){ return -target.countCards('h'); } }, threaten:1.1 }, }, niaoxiang:{ zhenfa:'siege' }, _niaoxiang:{ trigger:{player:'shaBegin'}, filter:function(event,player){ if(game.countPlayer()<4) return false; return player.siege(event.target)&&game.hasPlayer(function(current){ return current.hasSkill('niaoxiang')&¤t.siege(event.target); }); }, forced:true, logTarget:'target', content:function(){ "step 0" var next=trigger.target.chooseToRespond({name:'shan'}); next.autochoose=lib.filter.autoRespondShan; next.set('ai',function(card){ if(_status.event.player.countCards('h','shan')>1){ return get.unuseful2(card); } return -1; }); "step 1" if(result.bool==false){ trigger.untrigger(); trigger.directHit=true; } } }, fengshi:{ zhenfa:'siege' }, _fengshi:{ trigger:{player:'shaBegin'}, filter:function(event,player){ if(game.countPlayer()<4) return false; return player.siege(event.target)&&game.hasPlayer(function(current){ return current.hasSkill('fengshi')&¤t.siege(event.target); })&&event.target.countCards('e'); }, logTarget:'target', content:function(){ trigger.target.chooseToDiscard('e',true); } }, gzguixiu:{ init2:function(player){ player.logSkill('guixiu'); player.draw(2); }, onremove:function(player){ if(player.isDamaged()){ player.logSkill('guixiu'); player.recover(); } } }, gzcunsi:{ derivation:'gzyongjue', enable:'phaseUse', filter:function(event,player){ return player.checkMainSkill('gzcunsi',false)||player.checkViceSkill('gzcunsi',false); }, unique:true, forceunique:true, filterTarget:true, skillAnimation:true, content:function(){ 'step 0' if(player.checkMainSkill('gzcunsi',false)){ player.removeCharacter(0); } else{ player.removeCharacter(1); } 'step 1' target.addSkill('gzyongjue'); if(target!=player){ target.draw(2); } }, ai:{ order:9, result:{ player:function(player,target){ var num=0; if(player.isDamaged()&&target.isFriendOf(player)){ num++; if(target.hasSkill('kanpo')) num+=0.5; if(target.hasSkill('liegong')) num+=0.5; if(target.hasSkill('tieji')) num+=0.5; if(target.hasSkill('gzrende')) num+=1.2; if(target.hasSkill('longdan')) num+=1.2; if(target.hasSkill('paoxiao')) num+=1.2; if(target.hasSkill('zhangwu')) num+=1.5; if(target!=player) num+=0.5; } return num; } } } }, gzyongjue:{ trigger:{global:'useCardAfter'}, filter:function(event,player){ if(event.gzyongjue==player){ for(var i=0;i0&&event.source&&event.source.isUnseen(2); }, content:function(){ trigger.num--; }, ai:{ effect:{ target:function(card,player,target){ if(player.hasSkillTag('jueqing')) return; if(!player.isUnseen(2)) return; var num=get.tag(card,'damage'); if(num){ if(num>1) return 0.5; return 0; } } } }, }, hunshang:{ init:function(player){ if(player.checkViceSkill('hunshang')){ player.removeMaxHp(); } }, group:['hunshang_yingzi','hunshang_yinghun'], }, hunshang_yingzi:{ inherit:'yingzi', filter:function(event,player){ return player.hp<=1&&!player.hasSkill('yingzi'); } }, hunshang_yinghun:{ inherit:'gzyinghun', filter:function(event,player){ return player.hp<=1&&player.isDamaged()&&!player.hasSkill('gzyinghun'); } }, yingyang:{ trigger:{player:'compare',target:'compare'}, filter:function(event){ return !event.iwhile; }, content:function(){ if(player==trigger.player){ trigger.num1+=3; } else{ trigger.num2+=3; } } }, gzqianxi:{ audio:'qianxi', trigger:{player:'phaseBegin'}, content:function(){ "step 0" player.judge(); "step 1" event.color=result.color; player.chooseTarget(function(card,player,target){ return player!=target&&get.distance(player,target)<=1; },true).set('ai',function(target){ return -get.attitude(_status.event.player,target); }); "step 2" if(result.bool&&result.targets.length){ result.targets[0].storage.qianxi2=event.color; result.targets[0].addSkill('qianxi2'); player.line(result.targets,'green'); game.addVideo('storage',result.targets[0],['qianxi2',event.color]); } }, }, gzduanchang:{ audio:'duanchang', trigger:{player:'dieBegin'}, forced:true, silent:true, filter:function(event,player){ return event.source&&event.source.isIn()&&event.source!=player&& (event.source.hasMainCharacter()||event.source.hasViceCharacter()); }, content:function(){ 'step 0' if(!trigger.source.hasViceCharacter()){ event._result={control:'主将'} } else if(!trigger.source.hasMainCharacter()){ event._result={control:'副将'} } else{ player.chooseControl('主将','副将',function(){ return Math.random()<0.5?'主将':'副将'; }).set('prompt','令'+get.translation(trigger.source)+'失去一张武将牌的所有技能'); } 'step 1' var skills; if(result.control=='主将'){ trigger.source.showCharacter(0); game.broadcastAll(function(player){ player.node.avatar.classList.add('disabled'); },trigger.source); skills=lib.character[trigger.source.name][3]; game.log(trigger.source,'失去了主将技能'); } else{ trigger.source.showCharacter(1); game.broadcastAll(function(player){ player.node.avatar2.classList.add('disabled'); },trigger.source); skills=lib.character[trigger.source.name2][3]; game.log(trigger.source,'失去了副将技能'); } var list=[]; for(var i=0;i2) return 0; if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0; if(!ui.selected.cards.length&&card.name=='du') return 20; var player=get.owner(card); if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){ if(ui.selected.cards.length){ return -1; } var players=game.filterPlayer(); for(var i=0;i=3&& get.attitude(players[i],player)>=3){ return 11-get.value(card); } } if(player.countCards('h')>player.hp) return 10-get.value(card); if(player.countCards('h')>2) return 6-get.value(card); return -1; } return 10-get.value(card); }, content:function(){ target.gain(cards,player); if(typeof player.storage.gzrende!='number'){ player.storage.gzrende=0; } if(player.storage.gzrende>=0){ player.storage.gzrende+=cards.length; if(player.storage.gzrende>=3){ player.recover(); player.storage.gzrende=-1; } } }, ai:{ order:function(skill,player){ if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){ return 1; } return 10; }, result:{ target:function(player,target){ if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ return -10; } if(target.hasJudge('lebu')) return 0; var nh=target.countCards('h'); var np=player.countCards('h'); if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){ if(nh>=np-1&&np<=player.hp&&!target.hasSkill('haoshi')) return 0; } return Math.max(1,5-nh); } }, effect:{ target:function(card,player,target){ if(player==target&&get.type(card)=='equip'){ if(player.countCards('e',{subtype:get.subtype(card)})){ var players=game.filterPlayer(); for(var i=0;i0){ return 0; } } } } } }, threaten:0.8 } }, gzrende1:{ trigger:{player:'phaseUseBegin'}, forced:true, popup:false, silent:true, content:function(){ player.storage.gzrende=0; } }, gzzhiheng:{ inherit:'zhiheng', selectCard:function(){ return [1,_status.event.player.maxHp]; }, prompt:'出牌阶段限一次,你可以弃置至多X张牌(X为你的体力上限),然后摸等量的牌' }, huoshui:{ enable:'phaseUse', unique:true, forceunique:true, filter:function(event,player){ if(player.name1=='gz_zoushi') return player.isUnseen(0); return player.isUnseen(1); }, content:function(){ if(player.name1=='gz_zoushi') player.showCharacter(0); else player.showCharacter(1); } }, _huoshui:{ ai:{ nomingzhi:true, skillTagFilter:function(player){ return _status.currentPhase&&_status.currentPhase!=player&&_status.currentPhase.hasSkill('huoshui'); } } }, qingcheng:{ enable:'phaseUse', filter:function(event,player){ return player.countCards('he',{type:'equip'})&&game.hasPlayer(function(current){ return current!=player&&!current.isUnseen(2); }); }, filterCard:{type:'equip'}, position:'he', filterTarget:function(card,player,target){ return !target.isUnseen(2); }, check:function(card){ return 6-get.value(card,_status.event.player); }, content:function(){ 'step 0' if(get.is.jun(target)){ event._result={control:'副将'}; } else{ var choice='主将'; var skills=lib.character[target.name2][3]; for(var i=0;i=0) return 0; if(player.hasCard(function(card){ return get.tag(card,'damage')&&player.canUse(card,target,true,true); })){ if(target.maxHp>3) return -0.5; return -1; } return 0; } } } }, qingcheng_ai:{ ai:{ effect:{ target:function(card){ if(get.tag(card,'damage')) return 2; } } } }, duoshi:{ enable:'chooseToUse', viewAs:{name:'yiyi'}, usable:4, filterCard:{color:'red'}, viewAsFilter:function(player){ return player.countCards('h',{color:'red'})>0; }, check:function(card){ return 5-get.value(card); } }, gzxiaoguo:{ inherit:'xiaoguo', content:function(){ "step 0" var nono=(Math.abs(get.attitude(player,trigger.player))<3); if(get.damageEffect(trigger.player,player,player)<=0){ nono=true; } var next=player.chooseToDiscard(get.prompt('gzxiaoguo',trigger.player),{type:'basic'}); next.set('ai',function(card){ if(_status.event.nono) return 0; return 8-get.useful(card); }); next.set('logSkill',['gzxiaoguo',trigger.player]); next.set('nono',nono); "step 1" if(result.bool){ var nono=(get.damageEffect(trigger.player,player,trigger.player)>=0); trigger.player.chooseToDiscard('he',{type:'equip'}).set('ai',function(card){ if(_status.event.nono){ return 0; } if(_status.event.player.hp==1) return 10-get.value(card); return 9-get.value(card); }).set('nono',nono); } else{ event.finish(); } "step 2" if(!result.bool){ trigger.player.damage(); } }, }, _mingzhi1:{ trigger:{player:'phaseBegin'}, priority:19, forced:true, popup:false, content:function(){ "step 0" var choice=1; for(var i=0;i=2||(popu==1&&game.players.length<=4)){ return Math.random()<0.5?3:(Math.random()<0.5?2:1); } if(choice==0) return 0; if(get.population(group)>0&&player.wontYe()){ return Math.random()<0.2?(Math.random()<0.5?3:(Math.random()<0.5?2:1)):0; } var nming=0; for(var i=0;i=2||(popu==1&&game.players.length<=4)){ return true; } if(get.population(group)>0&&player.wontYe()){ return Math.random()<0.2?true:false; } var nming=0; for(var i=0;i=num){ break; } } } else{ if(!map[lib.character[list[i]][1]]){ group=lib.character[list[i]][1]; choice.push(list[i]); list.splice(i--,1); } } } } return choice; }, getState:function(){ var state={}; for(var i in lib.playerOL){ var player=lib.playerOL[i]; state[i]={ identity:player.identity, shown:player.ai.shown, }; } return state; }, updateState:function(state){ for(var i in state){ var player=lib.playerOL[i]; if(player){ player.identity=state[i].identity; player.ai.shown=state[i].shown; } } }, getRoomInfo:function(uiintro){ var num,last; if(lib.configOL.initshow_draw=='0'){ num='关闭' } else{ num=get.cnNumber(parseInt(lib.configOL.initshow_draw))+'张' } uiintro.add('
    首亮摸牌:'+num); uiintro.add('
    珠联璧合:'+(lib.configOL.zhulian?'开启':'关闭')); uiintro.add('
    出牌时限:'+lib.configOL.choose_timeout+'秒'); uiintro.add('
    国战牌堆:'+(lib.configOL.guozhanpile?'开启':'关闭')); last=uiintro.add('
    国战武将:'+(lib.configOL.onlyguozhan?'开启':'关闭')); if(!lib.configOL.onlyguozhan){ uiintro.add('
    屏蔽弱将:'+(lib.configOL.ban_weak?'开启':'关闭')); last=uiintro.add('
    屏蔽强将:'+(lib.configOL.ban_strong?'开启':'关闭')); if(lib.configOL.banned.length){ last=uiintro.add('
    禁用武将:'+get.translation(lib.configOL.banned)); } if(lib.configOL.bannedcards.length){ last=uiintro.add('
    禁用卡牌:'+get.translation(lib.configOL.bannedcards)); } } last.style.paddingBottom='8px'; }, addRecord:function(bool){ if(typeof bool=='boolean'){ var data=lib.config.gameRecord.guozhan.data; var identity=game.me.identity; if(!data[identity]){ data[identity]=[0,0]; } if(bool){ data[identity][0]++; } else{ data[identity][1]++; } var list=['wei','shu','wu','qun','ye']; var str=''; for(var i=0;i'; } } lib.config.gameRecord.guozhan.str=str; game.saveConfig('gameRecord',lib.config.gameRecord); } }, getIdentityList:function(player){ if(!player.isUnseen()) return; if(player==game.me) return; var list={ wei:'魏', shu:'蜀', wu:'吴', qun:'群', ye:'野', unknown:'猜' } var num=Math.floor((game.players.length+game.dead.length)/2); var noye=true; if(get.population('wei')>=num){ delete list.wei; noye=false; } if(get.population('shu')>=num){ delete list.shu; noye=false; } if(get.population('wu')>=num){ delete list.wu; noye=false; } if(get.population('qun')>=num){ delete list.qun; noye=false; } if(noye){ delete list.ye; } return list; }, getVideoName:function(){ var str=get.translation(game.me.name1)+'/'+get.translation(game.me.name2); var str2=get.cnNumber(parseInt(get.config('player_number')))+'人'+ get.translation(lib.config.mode); if(game.me.identity=='ye'){ str2+=' - 野心家'; } var name=[str,str2]; return name; }, showIdentity:function(started){ if(game.phaseNumber==0&&!started) return; for(var i=0;i1){ check=false; } } else{ if(hasunknown&&!game.hasPlayer(function(current){ return get.is.jun(current); })){ var players=game.players.concat(game.dead); var num=0; for(var i=0;iplayers.length/2){ check=false; } } } } if(check){ game.checkResult(); } else if(!hasunknown){ var ids=[]; var idmap={}; var idp={}; for(var i=0;i1&&idmap[id2]>1) return; if(idmap[id1]>1&&id1=='ye') return; if(idmap[id2]>1&&id2=='ye') return; if(idmap[id1]==1){ idp[id1].showGiveup(); } if(idmap[id2]==1){ idp[id2].showGiveup(); } } }, checkResult:function(){ _status.overing=true; for(var i=0;i0; }, chooseCharacter:function(){ var next=game.createEvent('chooseCharacter',false); next.showConfig=true; next.addPlayer=true; next.ai=function(player,list,back){ if(_status.brawl&&_status.brawl.chooseCharacterAi){ if(_status.brawl.chooseCharacterAi(player,list,back)!==false){ return; } } for(var i=0;i'; td.link=i-1; td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ if(_status.dragged) return; if(_status.justdragged) return; if(_status.cheat_seat){ _status.cheat_seat.classList.remove('thundertext'); if(_status.cheat_seat==this){ delete _status.cheat_seat; return; } } this.classList.add('thundertext'); _status.cheat_seat=this; }); } dialog.content.appendChild(seats); if(game.me==game.zhu){ seats.previousSibling.style.display='none'; seats.style.display='none'; } dialog.add(ui.create.div('.placeholder')); dialog.add(ui.create.div('.placeholder')); dialog.add(ui.create.div('.placeholder')); }; var removeSetting=function(){ var dialog=_status.event.dialog; if(dialog.querySelector('table')&&!get.config('change_identity')){ dialog.querySelector('table').previousSibling.remove(); dialog.querySelector('table').nextSibling.remove(); dialog.querySelector('table').nextSibling.remove(); dialog.querySelector('table').nextSibling.remove(); dialog.querySelector('table').remove(); } }; event.addSetting=addSetting; event.removeSetting=removeSetting; var chosen=lib.config.continue_name||[]; game.saveConfig('continue_name'); event.chosen=chosen; var i; event.list=[]; for(i in lib.character){ if(i.indexOf('gz_shibing')==0) continue; if(chosen.contains(i)) continue; if(lib.filter.characterDisabled(i)) continue; if(get.config('onlyguozhan')){ if(!lib.characterPack.mode_guozhan[i]) continue; if(get.config('junzhu')){ if(lib.junList.contains(i.slice(3))) continue; } else{ if(get.is.jun(i)) continue; } } if(lib.character[i][2]==3||lib.character[i][2]==4||lib.character[i][2]==5) event.list.push(i); } _status.characterlist=event.list.slice(0); _status.yeidentity=[]; if(_status.brawl&&_status.brawl.chooseCharacterFilter){ event.list=_status.brawl.chooseCharacterFilter(event.list); } event.list.randomSort(); // var list=event.list.splice(0,parseInt(get.config('choice_num'))); var list; if(_status.brawl&&_status.brawl.chooseCharacter){ list=_status.brawl.chooseCharacter(event.list,game.me); } else{ list=game.getCharacterChoice(event.list,parseInt(get.config('choice_num'))); } if(_status.auto){ event.ai(game.me,list); lib.init.onfree(); } else if(chosen.length){ game.me.init(chosen[0],chosen[1],false); lib.init.onfree(); } else{ var dialog=ui.create.dialog('选择角色','hidden',[list,'character']); if(!_status.brawl||!_status.brawl.noAddSetting){ if(get.config('change_identity')){ addSetting(dialog); } } var next=game.me.chooseButton(dialog,true,2).set('onfree',true); next.filterButton=function(button){ if(ui.dialog.buttons.length<=10){ for(var i=0;ilist.length){ num=5; } else if(lib.configOL.number*7>list.length){ num=6; } else{ num=7; } var filterButton=function(button){ if(ui.dialog){ if(ui.dialog.buttons.length<=10){ for(var i=0;i每当你失去体力时,你可改为将一张“天兵”置入弃牌堆。
    与你势力相同的角色可将一张“天兵”当【杀】使用或打出。', wuhujiangdaqi:'五虎将大旗', wuhujiangdaqi_bg:'旗', wuhujiangdaqi_info:'存活的蜀势力角色的技能按以下规则改动:
    武圣:将“红色牌”改为“任意牌”
    咆哮:增加描述“你使用的【杀】无视其他角色的防具”
    龙胆:增加描述“你每发动一次‘龙胆’便摸一张牌”
    烈弓:增加描述“你的攻击范围+1”
    铁骑:将“若结果为红色”改为“若结果不为黑桃”', zhangwu:'章武', zhangwu_info:'锁定技。当【飞龙夺凤】进入弃牌堆或其他角色的装备区时,你获得之。当你失去【飞龙夺风】时,展示之,然后将此牌置于牌堆底并摸两张牌', shouyue:'授钺', shouyue_info:'君主技。只要此武将牌处于明置状态,你便拥有“五虎将大旗”', jizhao:'激诏', jizhao_bg:'诏', jizhao_info:'限定技。当你处于濒死状态时,你可以将手牌补至体力上限,体力回复至2点,失去技能“授钺”并获得技能“仁德”', gzshoucheng:'守成', gzshoucheng_info:'当与你势力相同的一名角色于其回合外失去最后手牌时,你可以令其摸一张牌', gzmingshi:'名士', gzmingshi_info:'锁定技,当你受到伤害时,若伤害来源有暗置的武将牌,此伤害-1', fengshi:'锋矢', _fengshi:'锋矢', fengshi_info:'阵法技,在同一个围攻关系中,若你是围攻角色,则你或另一名围攻角色使用【杀】指定被围攻角色为目标后,可令该角色弃置装备区里的一张牌', gzsuishi:'随势', gzsuishi_info:'锁定技,当其他角色进入濒死状态时,若伤害来源与你势力相同,你摸一张牌;当其他角色死亡时,若其与你势力相同,你失去1点体力', baoling:'暴凌', baoling_info:'主将技,锁定技,出牌阶段结束时,若你有副将,则你移除副将,然后加3点体力上限,回复3点体力,并获得“崩坏”', yingyang:'鹰扬', yingyang_info:'当你拼点的牌亮出后,你可以令此牌的点数+3或-3', hunshang:'魂殇', hunshang_info:'副将技,此武将牌减少半个阴阳鱼;准备阶段,若你的体力值不大于1,则你本回合获得“英姿”和“英魂”', gzguixiu:'闺秀', gzguixiu_info:'当你明置此武将牌时,你摸两张牌;当你失去此技能时,你回复1点体力', gzcunsi:'存嗣', gzcunsi_info:'出牌阶段,你可以移除此武将牌并选择一名角色,然后其获得技能“勇决”,若你没有获得“勇决”,则获得“勇决”的角色摸两张牌', gzyongjue:'勇决', gzyongjue_info:'若与你势力相同的一名角色于其回合内使用的第一张牌为【杀】,则该角色可以在此【杀】结算完成后获得之', gzqianxi:'潜袭', gzqianxi_info:'准备阶段开始时,你可以进行判定,然后你选择距离为1的一名角色,直到回合结束,该角色不能使用或打出与结果颜色相同的手牌', gzshangyi:'尚义', gzshangyi_info:'出牌阶段限一次,你可以令一名其他角色观看你的手牌。若如此做,你选择一项:1.观看其手牌并可以弃置其中的一张黑色牌;2.观看其所有暗置的武将牌', niaoxiang:'鸟翔', _niaoxiang:'鸟翔', niaoxiang_info:'阵法技,在同一个围攻关系中,若你是围攻角色,则你或另一名围攻角色使用【杀】指定被围攻角色为目标后,你令该角色需依次使用两张【闪】才能抵消', yicheng:'疑城', yicheng_info:'当与你势力相同的一名角色成为【杀】的目标后,你可以令该角色摸一张牌然后弃置一张牌', yizhi:'遗志', yizhi_info:'副将技,此武将牌上单独的阴阳鱼个数-1。若你的主将拥有技能“观星”,则将其描述中的X改为5;若你的主将没有技能“观星”,则你拥有技能“观星”', tianfu:'天覆', tianfu_info:'主将技,阵法技,若当前回合角色与你处于同一队列,你拥有技能“看破”', ziliang:'资粮', ziliang_info:'副将技,当与你势力相同的一名角色受到伤害后,你可以将一张“田”交给该角色', gzjixi:'急袭', gzjixi_info:'主将技,此武将牌减少半个阴阳鱼;你可以将一张“田”当【顺手牵羊】使用', huyuan:'护援', huyuan_info:'结束阶段开始时,你可以将一张装备牌置入一名角色的装备区,然后你可以弃置该角色距离为1的一名角色的一张牌', heyi:'鹤翼', heyi_info:'阵法技,与你处于同一队列的其他角色防御距离+1', gz_shibing1wei:'魏兵', gz_shibing2wei:'魏兵', gz_shibing1shu:'蜀兵', gz_shibing2shu:'蜀兵', gz_shibing1wu:'吴兵', gz_shibing2wu:'吴兵', gz_shibing1qun:'群兵', gz_shibing2qun:'群兵', gzduanchang:'断肠', gzduanchang_info:'锁定技,当你死亡时,你令杀死你的角色失去一张武将牌的所有技能', gzweimu:'帷幕', gzweimu_info:'锁定技,当你成为黑色锦囊牌的目标时,则取消之', gzqianxun:'谦逊', gzqianxun_info:'锁定技,当你成为顺手牵羊或乐不思蜀的目标时,则取消之', gzkongcheng:'空城', gzkongcheng_info:'锁定技,当你成为【杀】或【决斗】的目标时,若你没有手牌,则取消之', gzxiaoji:'枭姬', gzxiaoji_info:'当你失去装备区里的牌后,你可以摸两张牌', gzrende:'仁德', gzrende_info:'出牌阶段,你可以将任意张手牌交给其他角色,然后若你于此阶段内给出第三张“仁德”牌时,你回复1点体力', gzzhiheng:'制衡', gzzhiheng_info:'出牌阶段限一次,你可以弃置至多X张牌(X为你的体力上限),然后摸等量的牌', huoshui:'祸水', huoshui_info:'出牌阶段,你可以明置此武将牌;你的回合内,若此武将牌处于明置状态,其他角色不能明置其武将牌', qingcheng:'倾城', qingcheng_info:'出牌阶段,你可以弃置一张装备牌并选择一名两张武将牌均明置的其他角色,你暗置其一张武将牌', duoshi:'度势', duoshi_info:'出牌阶段限四次,你可以将一张红色手牌当【以逸待劳】使用。', gzxiaoguo:'骁果', gzxiaoguo_info:'其他角色的结束阶段开始时,你可以弃置一张基本牌,令该角色选择一项:1.弃置一张装备牌;2.受到你对其造成的1点伤害。', }, junList:['liubei','zhangjiao'], guozhanPile:[ ["spade",7,"sha"], ["spade",8,"sha"], ["spade",8,"sha"], ["spade",9,"sha"], ["spade",9,"sha"], ["spade",10,"sha"], ["spade",10,"sha"], ["club",2,"sha"], ["club",3,"sha"], ["club",4,"sha"], ["club",5,"sha"], ["club",6,"sha"], ["club",7,"sha"], ["club",8,"sha"], ["club",8,"sha"], ["club",9,"sha"], ["club",9,"sha"], ["club",10,"sha"], ["club",10,"sha"], ["club",11,"sha"], ["club",11,"sha"], ["heart",10,"sha"], ["heart",10,"sha"], ["heart",11,"sha"], ["diamond",6,"sha"], ["diamond",7,"sha"], ["diamond",8,"sha"], ["diamond",9,"sha"], ["diamond",10,"sha"], ["diamond",13,"sha"], ["heart",2,"shan"], ["heart",2,"shan"], ["heart",13,"shan"], ["diamond",2,"shan"], ["diamond",2,"shan"], ["diamond",3,"shan"], ["diamond",4,"shan"], ["diamond",5,"shan"], ["diamond",6,"shan"], ["diamond",7,"shan"], ["diamond",8,"shan"], ["diamond",9,"shan"], ["diamond",10,"shan"], ["diamond",11,"shan"], ["diamond",11,"shan"], ["heart",3,"tao"], ["heart",4,"tao"], ["heart",6,"tao"], ["heart",7,"tao"], ["heart",8,"tao"], ["heart",9,"tao"], ["heart",12,"tao"], ["diamond",12,"tao"], ["spade",2,"bagua"], ["club",2,"bagua"], ["spade",5,"jueying"], ["club",5,"dilu"], ["heart",13,"zhuahuang"], ["heart",5,"chitu"], ["spade",13,"dawan"], ["diamond",13,"zixin"], ["club",1,"zhuge"], ["diamond",1,"zhuge"], ["spade",2,"feilongduofeng"], ["spade",6,"qinggang"], ["spade",5,"qinglong"], ["spade",12,"zhangba"], ["diamond",5,"guanshi"], ["diamond",12,"fangtian"], ["heart",5,"qilin"], ["heart",3,"wugu"], ["heart",4,"wugu"], ["heart",1,"taoyuan"], ["spade",7,"nanman"], ["spade",13,"nanman"], ["club",7,"nanman"], ["heart",1,"wanjian"], ["spade",1,"juedou"], ["club",1,"juedou"], ["diamond",1,"juedou"], ["heart",7,"wuzhong"], ["heart",8,"wuzhong"], ["heart",9,"wuzhong"], ["heart",11,"wuzhong"], ["spade",3,'shunshou'], ["spade",4,'shunshou'], ["spade",11,'shunshou'], ["diamond",3,'shunshou'], ["diamond",4,'shunshou'], ["spade",3,'guohe'], ["spade",4,'guohe'], ["spade",12,'guohe'], ["club",3,'guohe'], ["club",4,'guohe'], ["heart",12,'guohe'], ["club",12,'jiedao'], ["club",13,'jiedao'], ["spade",11,'wuxie'], ["club",12,'wuxie'], ["club",13,'wuxie'], ["spade",6,'lebu'], ["club",6,'lebu'], ["heart",6,'lebu'], ["spade",1,'shandian','thunder'], ["spade",2,'hanbing'], ["club",2,'renwang'], ["heart",12,'shandian','thunder'], ["diamond",12,'wuxie'], ["heart",4,"sha","fire"], ["heart",7,"sha","fire"], ["heart",10,"sha","fire"], ["diamond",4,"sha","fire"], ["diamond",5,"sha","fire"], ["spade",4,"sha","thunder"], ["spade",5,"sha","thunder"], ["spade",6,"sha","thunder"], ["spade",7,"sha","thunder"], ["spade",8,"sha","thunder"], ["club",5,"sha","thunder"], ["club",6,"sha","thunder"], ["club",7,"sha","thunder"], ["club",8,"sha","thunder"], ["heart",8,"shan"], ["heart",9,"shan"], ["heart",11,"shan"], ["heart",12,"shan"], ["diamond",6,"shan"], ["diamond",7,"shan"], ["diamond",8,"shan"], ["diamond",10,"shan"], ["diamond",11,"shan"], ["heart",5,"tao"], ["heart",6,"tao"], ["diamond",2,"tao"], ["diamond",3,"tao"], ["diamond",9,"jiu"], ["spade",3,"jiu"], ["spade",9,"jiu"], ["club",3,"jiu"], ["club",9,"jiu"], ["diamond",13,"hualiu"], ["club",1,"baiyin"], ["spade",2,"tengjia",'fire'], ["club",2,"tengjia",'fire'], ["spade",1,"guding"], ["diamond",1,"zhuque",'fire'], ["heart",2,"huogong","fire"], ["heart",3,"huogong","fire"], ["diamond",12,"huogong","fire"], ["spade",11,"tiesuo"], ["spade",12,"tiesuo"], ["club",10,"tiesuo"], ["club",11,"tiesuo"], ["club",12,"tiesuo"], ["club",13,"tiesuo"], ["heart",13,"wuxie"], ["heart",13,"wuxie"], ["spade",13,"wuxie"], ["spade",10,"bingliang"], ["club",4,"bingliang"], ['heart',9,'yuanjiao'], ['club',3,'zhibi'], ['club',4,'zhibi'], ['diamond',4,'yiyi'], ['heart',11,'yiyi'], ['diamond',6,'wuliu'], ['diamond',12,'sanjian'], ['heart',3,'jingfanma'], ["spade",4,'shunshou'], ["spade",12,'guohe'], ["spade",11,'wuxie'], ['spade',3,'huoshaolianying','fire'], ['club',11,'huoshaolianying','fire'], ['heart',12,'huoshaolianying','fire'], ['club',2,'huxinjing'], ['heart',2,'diaohulishan'], ['diamond',10,'diaohulishan'], ['heart',1,'lianjunshengyan'], ['club',3,'chiling'], ['spade',12,'lulitongxin'], ['club',10,'lulitongxin'], ['club',12,'shuiyanqijunx'], ['heart',13,'shuiyanqijunx'], ['spade',1,'xietianzi'], ['diamond',1,'xietianzi'], ['diamond',4,'xietianzi'], ['club',1,'yuxi'], ['heart',3,'taipingyaoshu'], ], element:{ content:{ zhulian:function(){ player.popup('珠联璧合'); game.log(player,'发动了【珠联璧合】'); player.chooseDrawRecover(2,true,'珠联璧合:摸两张牌或回复一点体力'); } }, player:{ getModeState:function(){ return { unseen:this.isUnseen(0), unseen2:this.isUnseen(1), } }, setModeState:function(info){ if(info.mode.unseen) this.classList.add('unseen'); if(info.mode.unseen2) this.classList.add('unseen2'); if(!info.name) return; // if(info.name.indexOf('unknown')==0){ // if(this==game.me){ // lib.translate[info.name]+='(你)'; // } // } this.init(info.name1,info.name2,false); this.name1=info.name1; this.name=info.name; this.node.name_seat=ui.create.div('.name.name_seat',get.verticalStr(lib.translate[this.name].slice(0,3)),this); if(info.identityShown){ this.setIdentity(info.identity); this.node.identity.classList.remove('guessing'); } else if(this!=game.me){ this.node.identity.firstChild.innerHTML='猜'; this.node.identity.dataset.color='unknown'; this.node.identity.classList.add('guessing'); } }, dieAfter:function(source){ this.showCharacter(2); if(get.is.jun(this.name1)){ var yelist=[]; for(var i=0;i0){ min=Math.min(min,num); } } return get.population(this.identity)==min; }, logAi:function(targets,card){ if(this.ai.shown==1||this.isMad()) return; if(typeof targets=='number'){ this.ai.shown+=targets; } else{ var effect=0,c,shown; var info=get.info(card); if(info.ai&&info.ai.expose){ if(_status.event.name=='_wuxie'){ if(_status.event.source&&_status.event.source.ai.shown){ this.ai.shown+=0.2; } } else{ this.ai.shown+=info.ai.expose; } } if(targets.length>0){ for(var i=0;i0){ if(effect<1) c=0.5; else c=1; if(targets.length==1&&targets[0]==this); else if(targets.length==1) this.ai.shown+=0.2*c; else this.ai.shown+=0.1*c; } } if(this.ai.shown>0.95) this.ai.shown=0.95; if(this.ai.shown<-0.5) this.ai.shown=-0.5; }, } }, get:{ realAttitude:function(from,toidentity,difficulty){ if(from.identity==toidentity&&toidentity!='ye'){ return 4+difficulty; } if(from.identity=='unknown'&&lib.character[from.name1][1]==toidentity){ if(from.wontYe()) return 4+difficulty; } var groups=[]; for(var i=0;i=game.players.length/2){ if(to_p<=from_p){ return 0.5; } return 0; } if(to_p=get.population()-2){ toidentity='ye'; } } var att=get.realAttitude(from,toidentity,difficulty); if(from.storage.zhibi&&from.storage.zhibi.contains(to)){ return att; } if(to.ai.shown>=0.5) return att*to.ai.shown; var nshown=0; for(var i=0;i=game.players.length/2&&att>=0){ return 0; } return Math.min(0,Math.random()-0.5)+difficulty; } if(to.ai.shown>=0.2){ if(att>2){ return Math.max(0,Math.random()-0.5)+difficulty; } if(att>=0){ return 0; } return Math.min(0,Math.random()-0.7)+difficulty; } if(att>2){ return Math.max(0,Math.random()-0.7)+difficulty; } if(att>=0){ return Math.min(0,Math.random()-0.3)+difficulty; } return Math.min(0,Math.random()-0.5)+difficulty; }, } }; });