From 311a549f32634a954c6b6e1493d08188c9d3321e Mon Sep 17 00:00:00 2001 From: libccy Date: Fri, 19 May 2017 17:07:59 +0800 Subject: [PATCH] s --- character/gujian.js | 2 ++ character/hearth.js | 4 ++-- character/refresh.js | 3 +++ character/shenhua.js | 3 ++- character/swd.js | 4 ++-- character/yxs.js | 3 +++ game/game.js | 9 +++++++++ 7 files changed, 23 insertions(+), 5 deletions(-) diff --git a/character/gujian.js b/character/gujian.js index 2f7728324..920a81443 100644 --- a/character/gujian.js +++ b/character/gujian.js @@ -303,6 +303,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, ai:{ + halfneg:true, effect:{ player:function(card,player,target,current){ if(get.color(card)=='red') return [1,0,1,-2]; @@ -1401,6 +1402,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:'turn' }, ai:{ + neg:true, mingzhi:false, threaten:0.8 }, diff --git a/character/hearth.js b/character/hearth.js index ed74b31be..d2820ba8f 100644 --- a/character/hearth.js +++ b/character/hearth.js @@ -1000,7 +1000,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ list.remove(player.getSkills()); list=list.randomGets(3); event.skillai=function(){ - return list.randomGet(); + return get.max(list,get.skillRank,'item'); }; if(event.isMine()){ var dialog=ui.create.dialog(); @@ -3251,7 +3251,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ list.remove('maoxian'); list=list.randomGets(3); event.skillai=function(){ - return list.randomGet(); + return get.max(list,get.skillRank,'item'); }; if(event.isMine()){ var dialog=ui.create.dialog(); diff --git a/character/refresh.js b/character/refresh.js index bebca2ed1..83d061b6d 100644 --- a/character/refresh.js +++ b/character/refresh.js @@ -239,6 +239,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(event.target){ player.useCard({name:'juedou'},event.target,'noai'); } + }, + ai:{ + halfneg:true } }, reqicai:{ diff --git a/character/shenhua.js b/character/shenhua.js index 505e95d53..dadd75463 100644 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -2448,7 +2448,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, ai:{ - threaten:0.5 + threaten:0.5, + neg:true, } }, baonue:{ diff --git a/character/swd.js b/character/swd.js index 1b4d8a296..e74530363 100644 --- a/character/swd.js +++ b/character/swd.js @@ -6787,7 +6787,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.removeSkill(player.additionalSkills.tianshu); } event.skillai=function(list){ - return list.randomGet(); + return get.max(list,get.skillRank,'item'); }; if(event.isMine()){ var dialog=ui.create.dialog(); @@ -6943,7 +6943,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 0" // target.gain(cards,player); event.skillai=function(list){ - return list.randomGet(); + return get.max(list,get.skillRank,'item'); }; if(event.isMine()){ event.dialog=lib.skill.tianshu.createDialog(player,target); diff --git a/character/yxs.js b/character/yxs.js index 384b30869..5c01d9e5e 100644 --- a/character/yxs.js +++ b/character/yxs.js @@ -728,6 +728,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, kuangchan:{ + ai:{ + neg:true + }, init:function(player){ if(lib.config.mode=='identity'&&player.isZhu){ player.maxHp--; diff --git a/game/game.js b/game/game.js index 7832d1180..638daa471 100644 --- a/game/game.js +++ b/game/game.js @@ -40540,6 +40540,15 @@ } return num?Math.round(9*(num-1)/8+1):'x'; }, + skillRank:function(skill){ + var info=lib.skill[skill]; + if(!info) return 0; + if(info.ai){ + if(info.ai.halfneg) return 0; + if(info.ai.neg) return -1; + } + return 1; + }, targetsInfo:function(targets){ var info=[]; for(var i=0;i