From 23485a722ca860a0d12ea171c5a8e70170a2ec00 Mon Sep 17 00:00:00 2001 From: libccy Date: Mon, 16 Nov 2015 09:59:54 +0800 Subject: [PATCH] ai --- card/extra.js | 3 +++ card/hearth.js | 3 +++ character/fire.js | 1 + game/game.js | 21 ++++++++++++--------- mode/chess.js | 3 +++ 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/card/extra.js b/card/extra.js index 0fdd25f20..e7d8ed596 100755 --- a/card/extra.js +++ b/card/extra.js @@ -132,6 +132,9 @@ card.extra={ value:[3,1], useful:1, }, + wuxie:function(target,card,player,current,state){ + if(ai.get.attitude(current,player)>=0&&state>0) return false; + }, result:{ player:function(player){ var nh=player.num('h'); diff --git a/card/hearth.js b/card/hearth.js index 5666a9c5a..53db6fde5 100644 --- a/card/hearth.js +++ b/card/hearth.js @@ -208,6 +208,9 @@ card.hearth={ value:[3,1], useful:1, }, + wuxie:function(target,card,player,current,state){ + if(ai.get.attitude(current,player)>=0&&state>0) return false; + }, result:{ player:function(player){ var nh=player.num('h'); diff --git a/character/fire.js b/character/fire.js index 32317b886..d051e7f1e 100755 --- a/character/fire.js +++ b/character/fire.js @@ -315,6 +315,7 @@ character.fire={ return -2; }, target:function(player,target){ + if(player.hp<=2) return 0; return ai.get.damageEffect(target,player); } } diff --git a/game/game.js b/game/game.js index 5bcda3ce2..88798427a 100755 --- a/game/game.js +++ b/game/game.js @@ -7157,16 +7157,15 @@ node.addEventListener(lib.config.touchscreen?'touchend':'mouseup',function(e){ node.classList.remove('controlthundertext'); node.parentNode.classList.remove('controlpressdown'); - setTimeout(function(){ - node.parentNode.classList.remove('controlpressdownx'); - },200); + node.parentNode.classList.remove('controlpressdownx'); + // setTimeout(function(){ + // if(node.parentNode) + // },200); }); node.addEventListener(lib.config.touchscreen?'touchmove':'mousemove',function(e){ node.classList.remove('controlthundertext'); node.parentNode.classList.remove('controlpressdown'); - setTimeout(function(){ - node.parentNode.classList.remove('controlpressdownx'); - },200); + node.parentNode.classList.remove('controlpressdownx'); }); } }, @@ -10949,10 +10948,14 @@ return caption; }, control:function(){ - var nc=true; + var nc=(ui.control.childNodes.length==0); for(var i=0;i