Ensure we only set up vs Koffing in Koga fight

This commit is contained in:
Kyle Coburn 2015-04-22 20:20:00 -07:00
parent aed1eb0cd6
commit 82dfaaa3a5
2 changed files with 11 additions and 4 deletions

View File

@ -1597,8 +1597,8 @@ strategyFunctions.fightKoga = function()
if Battle.opponentAlive() then if Battle.opponentAlive() then
local opponent = Battle.opponent() local opponent = Battle.opponent()
local curr_hp = Combat.hp() local curr_hp = Combat.hp()
if Pokemon.isOpponent("weezing") then if opponent == "weezing" then
local drillHp = (Pokemon.index(0, "level") > 40) and 12 or 9 local drillHp = (Pokemon.index(0, "level") >= 41) and 12 or 9
if curr_hp > 0 and curr_hp < drillHp and Battle.pp("horn_drill") > 0 then if curr_hp > 0 and curr_hp < drillHp and Battle.pp("horn_drill") > 0 then
forced = "horn_drill" forced = "horn_drill"
if Strategies.initialize("drilling") then if Strategies.initialize("drilling") then
@ -1617,10 +1617,16 @@ strategyFunctions.fightKoga = function()
Control.canDie(true) Control.canDie(true)
end end
else else
if opponent == "koffing" then
local __, enemyTurns = Combat.enemyAttack()
if enemyTurns > 1 then
if not Strategies.prepare("x_accuracy") then
return false
end
end
end
if Strategies.isPrepared("x_accuracy") then if Strategies.isPrepared("x_accuracy") then
forced = "horn_drill" forced = "horn_drill"
elseif curr_hp > 9 and not Strategies.prepare("x_accuracy") then
return false
end end
end end
end end

View File

@ -28,6 +28,7 @@ local pokeIDs = {
kadabra = 38, kadabra = 38,
hitmonchan = 44, hitmonchan = 44,
magneton = 54, magneton = 54,
koffing = 55,
venonat = 65, venonat = 65,
jinx = 72, jinx = 72,
meowth = 77, meowth = 77,