From ac716926a0f9abcabb1e92b6f380d791b588a6a0 Mon Sep 17 00:00:00 2001 From: HearthstoneBot Date: Fri, 21 Mar 2014 01:27:09 +0100 Subject: [PATCH] AI improvements There can at most be 7, not 8 minions on the battlefield. Also entities need to have more than 0 attack, to be able to attack! --- projects/Release/LuaScripts/AI.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/Release/LuaScripts/AI.lua b/projects/Release/LuaScripts/AI.lua index 01fea12..b462616 100644 --- a/projects/Release/LuaScripts/AI.lua +++ b/projects/Release/LuaScripts/AI.lua @@ -34,8 +34,9 @@ local canEntityAttack = function(entity) local can_attack = CanAttack(entity) local is_exhausted = IsExhausted(entity) local is_frozen = IsFrozen(entity) + local attack_dmg = GetATK(entity) - return can_attack and (is_exhausted == false) and (is_frozen == false) + return can_attack and (is_exhausted == false) and (is_frozen == false) and (attack_dmg > 0) end local num_battlefield_minions = function() @@ -239,7 +240,7 @@ turn_start_function = function() end -- Throw all minions - while num_battlefield_minions() < 8 and throw_random_minion() do + while num_battlefield_minions() < 7 and throw_random_minion() do end -- Keep killing tanks, while we're able to