This commit is contained in:
Kyle Coburn 2015-05-25 12:18:52 -07:00
parent 557f390890
commit 16f37b0330
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ local function recover()
second = "full_restore"
end
else
if Control.preferredPotion == "super" and max_hp - curr_hp > 22 then
if Control.preferredPotion == "super" or max_hp - curr_hp > 22 then
first = "super_potion"
second = "potion"
else

View File

@ -193,13 +193,13 @@ local function calcBestHit(attacker, defender, ours, rng)
local bestTurns, bestMinTurns = 9001, 9001
local bestDmg = -1
local ourMaxHit
local targetHP = defender.hp
local ret = nil
for idx,move in ipairs(attacker.moves) do
if not move.pp or move.pp > 0 then
local minDmg, maxDmg = calcDamage(move, attacker, defender, rng)
if maxDmg then
local minTurns, maxTurns
local targetHP = defender.hp
if maxDmg <= 0 then
minTurns, maxTurns = 9001, 9001
else