diff --git a/card/guozhan.js b/card/guozhan.js index e536cd9ee..51904ff73 100755 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -99,12 +99,20 @@ card.guozhan={ type:'trick', enable:true, filterTarget:function(card,player,target){ - if(player.identity=='unknown'||player.identity=='ye'||lib.config.mode!='guozhan') return player==target; - return player.identity==target.identity; + if(lib.config.mode=='guozhan'){ + if(player.identity=='unknown'||player.identity=='ye') return player==target; + return player.identity==target.identity; + } + else{ + return true; + } + }, + selectTarget:function(){ + if(lib.config.mode=='guozhan') return -1; + return [1,3]; }, - selectTarget:-1, content:function(){ - target.draw(lib.config.mode=='guozhan'?2:3); + target.draw(2); target.chooseToDiscard(2,'he',true).ai=ai.get.disvalue; }, ai:{ @@ -114,15 +122,17 @@ card.guozhan={ } }, basic:{ - useful:4, - value:4, - order:7 + useful:3, + value:3, + order:5 }, result:{ target:function(player,target){ - if(lib.config.mode!='guozhan') return 1; if(target.num('h')<=1){ - return 0; + if(target==player){ + return 0; + } + return 0.3; } return 1; }, @@ -229,7 +239,7 @@ card.guozhan={ zhibi:'知己知彼', zhibi_info:'出牌阶段对一名其他角色使用,观看其手牌或装备牌', yiyi:'以逸待劳', - yiyi_info:'对与自己势力相同的所有角色使用,摸两张牌然后弃置两张牌(非国战模式改为对自己使用,摸3张弃两张)', + yiyi_info:'对与自己势力相同的所有角色使用,摸两张牌然后弃置两张牌(非国战模式改为任意指定三名角色)', yiyi_bg:'逸', wuliu:'吴六剑', wuliu_info:'其他与装备者势力相同的角色攻击范围+1', diff --git a/character/hearth.js b/character/hearth.js index c66ba58eb..05ec58f46 100755 --- a/character/hearth.js +++ b/character/hearth.js @@ -537,6 +537,27 @@ character.hearth={ if(hs.length>10&&hs.length>player.hp){ player.discard(hs.randomGets(hs.length-player.hp)); } + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(player.skills.contains('jueqing')) return [1,-2]; + if(!target.hasFriend()) return; + var nh=target.num('h'); + if(nh>5) return [1,-1]; + if(nh<=1) return [1,-0.1]; + if(nh==2){ + if(target.hp>=2) return [1,0.1]; + } + else{ + if(target.hp>=4) return [1,2]; + if(target.hp==3) return [1,1.5]; + if(target.hp==2) return [1,0.5]; + } + } + } + } } }, chuidiao:{ diff --git a/character/rank.js b/character/rank.js index f2d916bc3..12e88d7e8 100644 --- a/character/rank.js +++ b/character/rank.js @@ -173,8 +173,13 @@ window.characterRank={ 'yxs_luzhishen', 'sunluyu', 'swd_xiyan', + 'hs_jiaziruila', ], bp:[ + 'hs_hudunren', + 'hs_nate', + 'hs_shifazhe', + 'hs_kchromaggus', 'hs_yelise', 'hs_loatheb', 'hs_alextrasza', @@ -270,8 +275,18 @@ window.characterRank={ 'zumao', 'sp_daqiao', 'sp_ganning', + 'jsp_guanyu', + 'wenpin', + 'sp_lvmeng', + 'wangji', + 'swd_weida', + 'swd_lilian', ], b:[ + 'sp_xiahoudun', + 'jsp_huangyueying', + 'cuiyan', + 'sp_zhangfei', 'hs_nozdormu', 'yxs_lishimin', 'hs_ruanniguai', diff --git a/game/game.js b/game/game.js index dc2a58ef5..5abc7c942 100755 --- a/game/game.js +++ b/game/game.js @@ -18,7 +18,8 @@ var lib={ version:'1.7.11', changeLog:[ - '扩展' + '扩展', + 'AI改进' ], configprefix:'noname_0.9_', updates:[], @@ -22514,9 +22515,9 @@ } } else if(e.keyCode==73){ - if(game.showIdentity){ - game.showIdentity(); - } + // if(game.showIdentity){ + // game.showIdentity(); + // } } else if(e.keyCode==67){ var node=ui.window.querySelector('#click'); diff --git a/layout/default/layout.css b/layout/default/layout.css index 1d2e2cd81..db2bea6a8 100755 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -1138,85 +1138,104 @@ div:hover>.intro{opacity: 1;} -webkit-animation:identity 0.8s; } .player .identity[data-color="zhu"], -div[data-nature='fire']{ +div[data-nature='fire'], +span[data-nature='fire']{ text-shadow: black 0 0 1px,rgba(232, 53, 53,1) 0 0 2px,rgba(232, 53, 53,1) 0 0 5px,rgba(232, 53, 53,1) 0 0 10px, rgba(232, 53, 53,1) 0 0 10px,rgba(232, 53, 53,1) 0 0 20px,rgba(232, 53, 53,1) 0 0 20px } -div[data-nature='firem']{ +div[data-nature='firem'], +span[data-nature='firem']{ text-shadow: black 0 0 1px,rgba(232, 53, 53,1) 0 0 2px,rgba(232, 53, 53,1) 0 0 5px,rgba(232, 53, 53,1) 0 0 5px, rgba(232, 53, 53,1) 0 0 5px,black 0 0 1px; } .player .identity[data-color="zhong"], .player .identity[data-color="mingzhong"], .player .identity[data-color="qun"], -div[data-nature='metal']{ +div[data-nature='metal'], +span[data-nature='metal']{ text-shadow: black 0 0 1px,rgba(255, 203, 0,1) 0 0 2px,rgba(255, 203, 0,1) 0 0 5px,rgba(255, 203, 0,1) 0 0 10px, rgba(255, 203, 0,1) 0 0 10px } -div[data-nature='metalm']{ +div[data-nature='metalm'], +span[data-nature='metalm']{ text-shadow: black 0 0 1px,rgba(255, 203, 0,1) 0 0 2px,rgba(255, 203, 0,1) 0 0 5px,rgba(255, 203, 0,1) 0 0 5px, rgba(255, 203, 0,1) 0 0 5px,black 0 0 1px; } -div[data-nature='metalmm']{ +div[data-nature='metalmm'], +span[data-nature='metalmm']{ text-shadow: black 0 0 1px,rgba(255, 203, 0,1) 0 0 2px,rgba(255, 203, 0,1) 0 0 2px,rgba(255, 203, 0,1) 0 0 2px, rgba(255, 203, 0,1) 0 0 2px,black 0 0 1px; } .player .identity[data-color="nei"], .player .identity[data-color="ye"], -div[data-nature='thunder']{ +div[data-nature='thunder'], +span[data-nature='thunder']{ text-shadow: rgba(100, 74, 139,1) 0 0 2px,rgba(100, 74, 139,1) 0 0 5px,rgba(100, 74, 139,1) 0 0 10px, rgba(100, 74, 139,1) 0 0 10px,rgba(100, 74, 139,1) 0 0 20px,rgba(100, 74, 139,1) 0 0 20px,black 0 0 1px; } -div[data-nature='thunderm']{ +div[data-nature='thunderm'], +span[data-nature='thunderm']{ text-shadow: rgba(100, 74, 139,1) 0 0 2px,rgba(100, 74, 139,1) 0 0 5px,rgba(100, 74, 139,1) 0 0 5px, rgba(100, 74, 139,1) 0 0 5px,black 0 0 1px; } .player .identity[data-color="fan"], .player .identity[data-color="wu"], -div[data-nature='wood']{ +div[data-nature='wood'], +span[data-nature='wood']{ text-shadow: rgba(57, 123, 4,1) 0 0 2px,rgba(57, 123, 4,1) 0 0 5px,rgba(57, 123, 4,1) 0 0 10px, rgba(57, 123, 4,1) 0 0 10px,rgba(57, 123, 4,1) 0 0 20px,rgba(57, 123, 4,1) 0 0 20px,black 0 0 1px; } -div[data-nature='woodm']{ +div[data-nature='woodm'], +span[data-nature='woodm']{ text-shadow: rgba(57, 123, 4,1) 0 0 2px,rgba(57, 123, 4,1) 0 0 5px,rgba(57, 123, 4,1) 0 0 5px, rgba(57, 123, 4,1) 0 0 5px,black 0 0 1px; } -div[data-nature='woodmm']{ +div[data-nature='woodmm'], +span[data-nature='woodmm']{ text-shadow: rgba(57, 123, 4,1) 0 0 2px,rgba(57, 123, 4,1) 0 0 2px,rgba(57, 123, 4,1) 0 0 2px, rgba(57, 123, 4,1) 0 0 2px,black 0 0 1px; } .player .identity[data-color="cai"], .player .identity[data-color="wei"], -div[data-nature='water']{ +div[data-nature='water'], +span[data-nature='water']{ text-shadow: rgba(78, 117, 140,1) 0 0 2px,rgba(78, 117, 140,1) 0 0 5px,rgba(78, 117, 140,1) 0 0 10px, rgba(78, 117, 140,1) 0 0 10px,rgba(78, 117, 140,1) 0 0 20px,rgba(78, 117, 140,1) 0 0 20px,black 0 0 1px; } -div[data-nature='waterm']{ +div[data-nature='waterm'], +span[data-nature='waterm']{ text-shadow: rgba(78, 117, 140,1) 0 0 2px,rgba(78, 117, 140,1) 0 0 5px,rgba(78, 117, 140,1) 0 0 5px, rgba(78, 117, 140,1) 0 0 5px,black 0 0 1px; -}div[data-nature='watermm']{ +} +div[data-nature='watermm'], +span[data-nature='watermm']{ text-shadow: rgba(78, 117, 140,1) 0 0 2px,rgba(78, 117, 140,1) 0 0 2px,rgba(78, 117, 140,1) 0 0 2px, rgba(78, 117, 140,1) 0 0 2px,black 0 0 1px; } .player .identity[data-color="shu"], -div[data-nature='soil']{ +div[data-nature='soil'], +span[data-nature='soil']{ text-shadow: rgba(128, 59, 2,1) 0 0 2px,rgba(128, 59, 2,1) 0 0 5px,rgba(128, 59, 2,1) 0 0 10px, rgba(128, 59, 2,1) 0 0 10px,rgba(128, 59, 2,1) 0 0 20px,rgba(128, 59, 2,1) 0 0 20px,black 0 0 1px; } -div[data-nature='soilm']{ +div[data-nature='soilm'], +span[data-nature='soilm']{ text-shadow: rgba(128, 59, 2,1) 0 0 2px,rgba(128, 59, 2,1) 0 0 5px,rgba(128, 59, 2,1) 0 0 5px, rgba(128, 59, 2,1) 0 0 5px,black 0 0 1px; } -div[data-nature='soilmm']{ +div[data-nature='soilmm'], +span[data-nature='soilmm']{ text-shadow: rgba(128, 59, 2,1) 0 0 2px,rgba(128, 59, 2,1) 0 0 2px,rgba(128, 59, 2,1) 0 0 2px, rgba(128, 59, 2,1) 0 0 2px,black 0 0 1px; } .player .identity[data-color="unknownx"], -div[data-nature='black']{ +div[data-nature='black'], +span[data-nature='black']{ text-shadow: rgba(0,0,0,0.5) 0 0 2px,rgba(0,0,0,0.5) 0 0 5px,rgba(0,0,0,0.5) 0 0 10px, rgba(0,0,0,0.5) 0 0 10px,rgba(0,0,0,0.5) 0 0 20px,rgba(0,0,0,0.5) 0 0 20px,black 0 0 1px; } -div[data-color="unknownm"]{ +div[data-color="unknownm"], +span[data-color="unknownm"]{ text-shadow: rgba(0,0,0,0.5) 0 0 2px,rgba(0,0,0,0.2) 0 0 5px,rgba(0,0,0,0.2) 0 0 5px, rgba(0,0,0,0.2) 0 0 5px,black 0 0 1px; } diff --git a/mode/identity.js b/mode/identity.js index 7d352fc64..3176e7925 100755 --- a/mode/identity.js +++ b/mode/identity.js @@ -263,7 +263,6 @@ mode.identity={ console.log(str); game.showIdentity(); } - lib.config.ai_guess=true; event.trigger('gameStart'); var players=get.players(lib.sort.position); @@ -802,6 +801,12 @@ mode.identity={ this.identityShown=true; } game.checkResult(); + if(game.zhu.isZhu){ + if(get.population('zhong')+get.population('nei')==0|| + get.population('zhong')+get.population('fan')==0){ + game.showIdentity(); + } + } if(this.identity=='fan'&&source) source.draw(3); else if(this.identity=='zhong'&&source&&source.identity=='zhu'&&source.isZhu){ source.discard(source.get('he')); @@ -867,7 +872,11 @@ mode.identity={ else if(shown<0.4) c=0.5; else if(shown<0.6) c=0.8; else c=1; - effect+=ai.get.effect(targets[i],card,this)*c; + var eff=ai.get.effect(targets[i],card,this); + effect+=eff*c; + if(eff==0&&shown==0&&this.identity=='zhong'&&targets[i]!=this){ + effect+=0.1; + } } } if(effect>0){ @@ -887,8 +896,9 @@ mode.identity={ if(this.ai.shown>0.95) this.ai.shown=0.95; if(this.ai.shown<-0.5) this.ai.shown=-0.5; - if(this!=game.me&&get.config('auto_mark_identity')&&this.ai.identity_mark!='finished'){ - if(_status.clickingidentity&&_status.clickingidentity[0]==this){ + var marknow=(this!=game.me&&get.config('auto_mark_identity')&&this.ai.identity_mark!='finished'); + if(true){ + if(marknow&&_status.clickingidentity&&_status.clickingidentity[0]==this){ for(var i=0;i<_status.clickingidentity[1].length;i++){ _status.clickingidentity[1][i].delete(); _status.clickingidentity[1][i].style.transform=''; @@ -927,28 +937,28 @@ mode.identity={ } } if(this.identity=='nei'){ - if(effect>=0){ + if(effect>0){ if(this.ai.identity_mark=='fan'){ - this.setIdentity(); + if(marknow) this.setIdentity(); this.ai.identity_mark='finished'; } else{ - this.setIdentity('zhong'); + if(marknow) this.setIdentity('zhong'); this.ai.identity_mark='zhong'; } } - else{ + else if(effect<0&&get.population('fan')>0){ if(this.ai.identity_mark=='zhong'){ - this.setIdentity(); + if(marknow) this.setIdentity(); this.ai.identity_mark='finished'; } else{ - this.setIdentity('fan'); + if(marknow) this.setIdentity('fan'); this.ai.identity_mark='fan'; } } } - else{ + else if(marknow){ if(effect>0&&this.identity!='fan'){ this.setIdentity('zhong'); this.ai.identity_mark='finished'; @@ -959,6 +969,7 @@ mode.identity={ } } } + }, } }, @@ -980,7 +991,7 @@ mode.identity={ } var difficulty=0; if(to==game.me) difficulty=2-get.difficulty(); - if(get.config('ai_identity')||from==to||!lib.config.ai_guess||(to.identityShown)){ + if(from==to||to.identityShown){ return ai.get.realAttitude(from,to)+difficulty*1.5; } else{ @@ -992,11 +1003,23 @@ mode.identity={ } } } - return ai.get.realAttitude(from,to)*to.ai.shown+difficulty*1.5; + var aishown=to.ai.shown; + if(to.identity=='nei'&&to.ai.shown<1&&(to.ai.identity_mark=='fan'||to.ai.identity_mark=='zhong')){ + aishown=0.5; + } + else if(aishown==0&&to.identity!='fan'&&to.identity!='zhu'){ + var fanshown=true; + for(var i=0;i1) return -5; } - return -10; - case 'zhong': return -7; + return -8; + case 'zhong': + if(!zhongmode&&game.zhu.hp>=3&&to.hp==1){ + return -10; + } + return -7; case 'mingzhong':return -5; case 'nei': if(zhongmode&&to.ai.sizhong) return -7;