mode.guozhan={ game:{ start:function(){ var next=game.createEvent('game',false); next.content=function(){ "step 0" game.prepareArena(); game.delay(); "step 1" if(lib.storage.test){ _status.auto=true; ui.auto.classList.add('glow'); } game.chooseCharacter(); "step 2" if(lib.storage.test){ var str=''; for(var i=0;iget.population()/2) this.identity='ye'; else this.identity=this.group; // this.node.identity.dataset.color=this.identity; this.setIdentity(this.identity); this.ai.shown=1; } var skills; switch(num){ case 0: game.log(get.translation(this)+'展示了主将'+get.translation(this.name1)); this.name=this.name1; skills=lib.character[this.name][3]; this.sex=lib.character[this.name][0]; this.classList.remove('unseen'); break; case 1: game.log(get.translation(this)+'展示了副将'+get.translation(this.name2)); skills=lib.character[this.name2][3]; if(this.sex=='unknown') this.sex=lib.character[this.name2][0]; if(this.name.indexOf('unknown')==0) this.name=this.name2; this.classList.remove('unseen2'); break; case 2: game.log(get.translation(this)+'展示了主将'+get.translation(this.name1)+'、副将'+get.translation(this.name2)); this.name=this.name1; skills=lib.character[this.name][3].concat(lib.character[this.name2][3]); this.sex=lib.character[this.name][0]; this.classList.remove('unseen'); this.classList.remove('unseen2'); break; } var initdraw=get.config('initshow_draw'); if(!_status.initshown&&initdraw&&this.isAlive()){ this.popup('首亮'); game.log(get.translation(this)+'首先明置武将,得到奖励'); game.log(get.translation(this)+'摸了'+get.cnNumber(initdraw)+'张牌'); this.draw(initdraw).log=false; _status.initshown=true; } for(var i=0;i=2||player.hp>=player.maxHp-1) return 'draw_card'; if(player.hp==2&&player.num('h')==0) return 'draw_card'; return 'recover_hp'; },ui.create.dialog('hidden','珠联璧合:选择一项奖励')); } "step 1" if(result.control=='draw_card'){ player.draw(2); } else{ player.recover(); } } } } }, perfectPair:function(){ if(lib.perfectPair[this.name1]&&lib.perfectPair[this.name1].contains(this.name2)){ return true; } if(lib.perfectPair[this.name2]&&lib.perfectPair[this.name2].contains(this.name1)){ return true; } return false; }, siege:function(player){ if(game.players.length==2) return false; if(this.identity=='unknown'||this.identity=='ye') return false; if(player.identity=='unknown') return false; if(player.identity==this.identity) return false; if(player==this.next&&this.next.next.identity==this.identity) return true; if(player==this.previous&&this.previous.previous.identity==this.identity) return true; return false; }, sieged:function(){ return this.next.siege(this)||this.previous.siege(this); }, sieging:function(){ return this.siege(this.next)||this.siege(this.previous); }, inline:function(){ if(this.identity=='unknown'||this.identity=='ye') return false; if(this.next.identity!=this.identity&&this.previous.identity!=this.identity) return false; var pointer; for(var i=0;i0){ 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; }, } }, skill:{ _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&&get.totalPopulation(group)+1<=get.population()/2){ 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=game.players.length/2){ if(to_p<=from_p){ return 0.5; } return 0; } if(to_p=get.population()-2){ toidentity='ye'; } } var att=ai.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; }, } }, config:['player_number','initshow_draw', 'free_choose','change_identity','change_choice','change_card', 'swap','dierestart','ai_identity','revive','double_hp','difficulty'] }