diff --git a/game/game.js b/game/game.js index 28ea9dd58..c26903c71 100644 --- a/game/game.js +++ b/game/game.js @@ -13236,6 +13236,58 @@ this.updateMarks(); return this; }, + updateMark:function(i){ + if(!this.marks[i]){ + if(lib.skill[i]&&lib.skill[i].intro&&(this.storage[i]||lib.skill[i].intro.markcount)){ + this.markSkill(i); + if(!this.marks[i]) return this; + } + else{ + return this; + } + } + if(i=='ghujia'||((!this.marks[i].querySelector('.image')||this.storage[i+'_markcount'])&& + lib.skill[i]&&lib.skill[i].intro&&!lib.skill[i].intro.nocount&& + (this.storage[i]||lib.skill[i].intro.markcount))){ + this.marks[i].classList.add('overflowmark') + var num=0; + if(typeof lib.skill[i].intro.markcount=='function'){ + num=lib.skill[i].intro.markcount(this.storage[i],this); + } + else if(typeof this.storage[i+'_markcount']=='number'){ + num=this.storage[i+'_markcount']; + } + else if(i=='ghujia'){ + num=this.hujia; + } + else if(typeof this.storage[i]=='number'){ + num=this.storage[i]; + } + else if(Array.isArray(this.storage[i])){ + num=this.storage[i].length; + } + if(num){ + if(!this.marks[i].markcount){ + this.marks[i].markcount=ui.create.div('.markcount.menubutton',this.marks[i]); + } + this.marks[i].markcount.innerHTML=num; + } + else if(this.marks[i].markcount){ + this.marks[i].markcount.delete(); + delete this.marks[i].markcount; + } + } + else{ + if(this.marks[i].markcount){ + this.marks[i].markcount.delete(); + delete this.marks[i].markcount; + } + if(lib.skill[i].mark=='auto'){ + this.unmarkSkill(i); + } + } + return this; + }, updateMarks:function(connect){ if(typeof connect=='string'&&_status.connectMode&&!game.online){ game.broadcast(function(player,storage,skill){ @@ -13244,41 +13296,7 @@ },this,this.storage[connect],connect); } for(var i in this.marks){ - if(i=='ghujia'||((!this.marks[i].querySelector('.image')||this.storage[i+'_markcount'])&& - lib.skill[i]&&lib.skill[i].intro&&!lib.skill[i].intro.nocount&& - (this.storage[i]||lib.skill[i].intro.markcount))){ - this.marks[i].classList.add('overflowmark') - var num=0; - if(typeof lib.skill[i].intro.markcount=='function'){ - num=lib.skill[i].intro.markcount(this.storage[i],this); - } - else if(typeof this.storage[i+'_markcount']=='number'){ - num=this.storage[i+'_markcount']; - } - else if(i=='ghujia'){ - num=this.hujia; - } - else if(typeof this.storage[i]=='number'){ - num=this.storage[i]; - } - else if(Array.isArray(this.storage[i])){ - num=this.storage[i].length; - } - if(num){ - if(!this.marks[i].markcount){ - this.marks[i].markcount=ui.create.div('.markcount.menubutton',this.marks[i]); - } - this.marks[i].markcount.innerHTML=num; - } - else if(this.marks[i].markcount){ - this.marks[i].markcount.delete(); - delete this.marks[i].markcount; - } - } - else if(this.marks[i].markcount){ - this.marks[i].markcount.delete(); - delete this.marks[i].markcount; - } + this.updateMark(i); } }, num:function(arg1,arg2,arg3){ @@ -42592,6 +42610,31 @@ } return threaten; }, + condition:function(player){ + var num=player.hp; + if(num>4){ + num=4+Math.sqrt(num-4); + } + else{ + if(player.isHealthy()){ + if(player.hp==3){ + num+=0.5; + } + else if(player.hp<3){ + num++; + } + } + } + num+=player.countCards('h')/2; + var es=player.getCards('e'); + for(var i=0;i=7) num+=0.8; + if(val>=5) num+=0.5; + if(val>=3) num+=0.2; + } + return num; + }, attitude:function(from,to){ if(!from||!to) return 0; var att=get.rawAttitude.apply(this,arguments); diff --git a/mode/versus.js b/mode/versus.js index 265e4faa6..4fb3b543d 100644 --- a/mode/versus.js +++ b/mode/versus.js @@ -314,6 +314,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } } else if(_status.mode=='siguo'){ + _status.siguoai=[ + [-7.5,-2,0,-4.5,-6,-7.5], + [-7.5,-2,0,-4.5,-6,-7.5], + [-6,-6,-1,-4.5,-6,-7.5], + [-6,-3,0,-3,-3,-6], + [-6,-3,0,-3,-3,-6], + [-6,-6,-6,-6,-6,-6], + ].randomGet(); var firstChoose=_status.firstAct; game.gameDraw(firstChoose); game.phaseLoop(firstChoose); @@ -816,12 +824,31 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ delete ui.cheat2; } game.me.init(result.links[0]); - event.list[game.me.identity].remove(result.links[0]); + event.list[game.me.side].remove(result.links[0]); + var added={wei:0,shu:0,wu:0,qun:0}; for(var i=0;i=4){ + map[i]+=50; + } + else if(map2[i]==3){ + map[i]+=10; + } + else if(map2[i]==2){ + map[i]++; + } + } + list.sort(function(a,b){ + return map[b]-map[a]; + }); + var id1=list.indexOf(from.side); + var id2=list.indexOf(to.side); + var att=-1; + switch(id1){ + case 0:att=_status.siguoai[id2+2];break; + case 1: + switch(id2){ + case 0:att=_status.siguoai[0];break; + case 2:att=_status.siguoai[1];break; + case 3:att=_status.siguoai[2];break; + } + break; + case 2: + switch(id2){ + case 0:att=_status.siguoai[0];break; + case 1:att=_status.siguoai[1];break; + case 3:att=_status.siguoai[2];break; + } + break; + case 3:{ + if(id2==0){ + att=_status.siguoai[1];break; + } + else{ + att=_status.siguoai[2];break; + } + break; + } + } + if(map2[to.side]>=4){ + att-=10; + } + else if(map2[to.side]==3){ + att-=3; + } + else if(map2[to.side]==2){ + att-=0.5; + } + return att; + } + else{ + if(to.identity=='zhu'){ + if(_status.connectMode){ + if(_status.mode=='4v4') return -10; + } + else{ + if(lib.storage.main_zhu||_status.mode=='four') return -10; + } + } + return -6; + } } }, },