Cleanup Strategies
This commit is contained in:
parent
379a85c2e7
commit
1c29d9c4a6
|
@ -451,7 +451,7 @@ strategyFunctions.grabForestPotion = function()
|
||||||
if status.startPotions and potionCount > status.startPotions then
|
if status.startPotions and potionCount > status.startPotions then
|
||||||
status.startPotions = nil
|
status.startPotions = nil
|
||||||
end
|
end
|
||||||
if Pokemon.info("squirtle", "hp") <= 14 then
|
if Pokemon.info("squirtle", "hp") <= 12 then
|
||||||
if Menu.pause() then
|
if Menu.pause() then
|
||||||
Inventory.use("potion", "squirtle")
|
Inventory.use("potion", "squirtle")
|
||||||
end
|
end
|
||||||
|
@ -563,12 +563,12 @@ strategyFunctions.fightBrock = function()
|
||||||
p(Pokemon.getDVs("nidoran"))
|
p(Pokemon.getDVs("nidoran"))
|
||||||
|
|
||||||
local resetsForStats = att < 15 or spd < 14 or scl < 12
|
local resetsForStats = att < 15 or spd < 14 or scl < 12
|
||||||
if not resetsForStats and not RESET_FOR_TIME then
|
if not resetsForStats and RESET_FOR_TIME then
|
||||||
resetsForStats = att == 15 and spd == 14
|
resetsForStats = att == 15 and spd == 14
|
||||||
end
|
end
|
||||||
|
|
||||||
local nidoranStatus = "Att: "..att..", Def: "..def..", Speed: "..spd..", Special: "..scl
|
local nidoranStatus = "Att: "..att..", Def: "..def..", Speed: "..spd..", Special: "..scl
|
||||||
if resets then
|
if resetsForStats then
|
||||||
return Strategies.reset("Bad Nidoran - "..nidoranStatus)
|
return Strategies.reset("Bad Nidoran - "..nidoranStatus)
|
||||||
end
|
end
|
||||||
status.tries = 9001
|
status.tries = 9001
|
||||||
|
@ -665,7 +665,7 @@ strategyFunctions.bugCatcher = function()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Strategies.functions.leer({{"caterpie",8}, {"weedle",7}})
|
strategyFunctions.leer({{"caterpie",8}, {"weedle",7}})
|
||||||
elseif status.canProgress then
|
elseif status.canProgress then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
|
@ -692,14 +692,14 @@ strategyFunctions.shortsKid = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Control.battlePotion(fightingEkans or Strategies.damaged(2))
|
Control.battlePotion(fightingEkans or Strategies.damaged(2))
|
||||||
return Strategies.functions.leer({{"rattata",9}, {"ekans",10}})
|
return strategyFunctions.leer({{"rattata",9}, {"ekans",10}})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.potionBeforeCocoons = function()
|
strategyFunctions.potionBeforeCocoons = function()
|
||||||
if stats.nidoran.speed >= 15 then
|
if stats.nidoran.speed >= 15 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return Strategies.functions.potion({hp=6, yolo=3})
|
return strategyFunctions.potion({hp=6, yolo=3})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- swapHornAttack
|
-- swapHornAttack
|
||||||
|
@ -792,7 +792,7 @@ strategyFunctions.potionForMankey = function()
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return Strategies.functions.potion({hp=18, yolo=8})
|
return strategyFunctions.potion({hp=18, yolo=8})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.redbarMankey = function()
|
strategyFunctions.redbarMankey = function()
|
||||||
|
@ -924,7 +924,7 @@ strategyFunctions.potionBeforeMisty = function(data)
|
||||||
Bridge.chat(message, potionCount)
|
Bridge.chat(message, potionCount)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return Strategies.functions.potion({hp=healAmount, chain=data.chain})
|
return strategyFunctions.potion({hp=healAmount, chain=data.chain})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.fightMisty = function()
|
strategyFunctions.fightMisty = function()
|
||||||
|
@ -961,7 +961,7 @@ strategyFunctions.potionBeforeRocket = function()
|
||||||
if stats.nidoran.attackDV >= 12 then
|
if stats.nidoran.attackDV >= 12 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return Strategies.functions.potion({hp=13, yolo=11})
|
return strategyFunctions.potion({hp=13, yolo=11})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- jingleSkip
|
-- jingleSkip
|
||||||
|
@ -1115,9 +1115,9 @@ strategyFunctions.potionBeforeSurge = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Inventory.contains("potion") then
|
if Inventory.contains("potion") then
|
||||||
return Strategies.functions.potion({hp=20, yolo=yoloHp, forced="potion", chain=true})
|
return strategyFunctions.potion({hp=20, yolo=yoloHp, forced="potion", chain=true})
|
||||||
end
|
end
|
||||||
return Strategies.functions.potion({hp=8, yolo=yoloHp, chain=true})
|
return strategyFunctions.potion({hp=8, yolo=yoloHp, chain=true})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.fightSurge = function()
|
strategyFunctions.fightSurge = function()
|
||||||
|
@ -1313,7 +1313,7 @@ strategyFunctions.silphCarbos = function()
|
||||||
if stats.nidoran.speedDV >= 8 then
|
if stats.nidoran.speedDV >= 8 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return Strategies.functions.interact({dir="Left"})
|
return strategyFunctions.interact({dir="Left"})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.swapXSpecials = function()
|
strategyFunctions.swapXSpecials = function()
|
||||||
|
@ -1463,7 +1463,7 @@ strategyFunctions.potionBeforeHypno = function()
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return Strategies.functions.potion({hp=healTarget, yolo=yoloHP, close=true})
|
return strategyFunctions.potion({hp=healTarget, yolo=yoloHP, close=true})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.fightHypno = function()
|
strategyFunctions.fightHypno = function()
|
||||||
|
@ -1630,7 +1630,7 @@ strategyFunctions.checkGiovanni = function()
|
||||||
Bridge.chat(message)
|
Bridge.chat(message)
|
||||||
riskGiovanni = false
|
riskGiovanni = false
|
||||||
end
|
end
|
||||||
return Strategies.functions.potion({hp=50, yolo=ryhornDamage})
|
return strategyFunctions.potion({hp=50, yolo=ryhornDamage})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.fightGiovanni = function()
|
strategyFunctions.fightGiovanni = function()
|
||||||
|
@ -1691,17 +1691,7 @@ end
|
||||||
|
|
||||||
-- ether
|
-- ether
|
||||||
|
|
||||||
strategyFunctions.tossInVictoryRoad = function()
|
-- tossInVictoryRoad
|
||||||
if Strategies.initialize() then
|
|
||||||
if maxEtherSkip then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
if Inventory.count("ether") + Inventory.count("elixer") >= 2 then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return Strategies.tossItem("antidote", "pokeball")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- grabMaxEther
|
-- grabMaxEther
|
||||||
|
|
||||||
|
@ -1723,7 +1713,7 @@ strategyFunctions.potionBeforeLorelei = function()
|
||||||
end
|
end
|
||||||
Bridge.chat("is healing before Lorelei to skip the Elite 4 Center...")
|
Bridge.chat("is healing before Lorelei to skip the Elite 4 Center...")
|
||||||
end
|
end
|
||||||
return Strategies.functions.potion({hp=Combat.healthFor("LoreleiDewgong")})
|
return strategyFunctions.potion({hp=Combat.healthFor("LoreleiDewgong")})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.depositPokemon = function()
|
strategyFunctions.depositPokemon = function()
|
||||||
|
@ -1812,21 +1802,12 @@ end
|
||||||
strategyFunctions.bruno = function()
|
strategyFunctions.bruno = function()
|
||||||
if Battle.isActive() then
|
if Battle.isActive() then
|
||||||
status.canProgress = true
|
status.canProgress = true
|
||||||
local forced
|
|
||||||
if Pokemon.isOpponent("onix") then
|
|
||||||
forced = "ice_beam"
|
|
||||||
-- local curr_hp, red_hp = Pokemon.info("nidoking", "hp"), Combat.redHP()
|
|
||||||
-- if curr_hp > red_hp then
|
|
||||||
-- local enemyMove, enemyTurns = Combat.enemyAttack()
|
|
||||||
-- if enemyTurns and enemyTurns > 1 then
|
|
||||||
-- local rockDmg = enemyMove.damage
|
|
||||||
-- if curr_hp - rockDmg <= red_hp then
|
|
||||||
-- forced = "thunderbolt"
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
end
|
|
||||||
if Strategies.prepare("x_accuracy") then
|
if Strategies.prepare("x_accuracy") then
|
||||||
|
local forced
|
||||||
|
if Pokemon.isOpponent("onix") then
|
||||||
|
forced = "ice_beam"
|
||||||
|
end
|
||||||
Battle.automate(forced)
|
Battle.automate(forced)
|
||||||
end
|
end
|
||||||
elseif status.canProgress then
|
elseif status.canProgress then
|
||||||
|
@ -1836,7 +1817,7 @@ strategyFunctions.bruno = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.agatha = function() --TODO test without x acc
|
strategyFunctions.agatha = function()
|
||||||
if Battle.isActive() then
|
if Battle.isActive() then
|
||||||
status.canProgress = true
|
status.canProgress = true
|
||||||
if Combat.isSleeping() then
|
if Combat.isSleeping() then
|
||||||
|
@ -1897,7 +1878,7 @@ strategyFunctions.prepareForBlue = function()
|
||||||
end
|
end
|
||||||
local skyDmg = Combat.healthFor("BlueSky") * 0.925
|
local skyDmg = Combat.healthFor("BlueSky") * 0.925
|
||||||
local wingDmg = Combat.healthFor("BluePidgeot")
|
local wingDmg = Combat.healthFor("BluePidgeot")
|
||||||
return Strategies.functions.potion({hp=skyDmg-50, yolo=wingDmg, full=true})
|
return strategyFunctions.potion({hp=skyDmg-50, yolo=wingDmg, full=true})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.blue = function()
|
strategyFunctions.blue = function()
|
||||||
|
|
|
@ -797,6 +797,11 @@ Strategies.functions = {
|
||||||
if status.canProgress then
|
if status.canProgress then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
elseif main == 32 or main == 123 then
|
||||||
|
status.canProgress = true
|
||||||
|
Input.cancel()
|
||||||
|
else
|
||||||
|
Input.press("Start", 2)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
@ -1366,7 +1371,7 @@ Strategies.functions = {
|
||||||
elseif py < 9 then
|
elseif py < 9 then
|
||||||
py = 9
|
py = 9
|
||||||
else
|
else
|
||||||
return Strategies.functions.interact({dir="Down"})
|
return strategyFunctions.interact({dir="Down"})
|
||||||
end
|
end
|
||||||
Walk.step(px, py)
|
Walk.step(px, py)
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -188,24 +188,28 @@ strategyFunctions.catchNidoran = function()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Pokemon.updateParty()
|
Pokemon.updateParty()
|
||||||
|
local px, py = Player.position()
|
||||||
local hasNidoran = Pokemon.inParty("nidoran")
|
local hasNidoran = Pokemon.inParty("nidoran")
|
||||||
if hasNidoran then
|
if hasNidoran then
|
||||||
Bridge.caught("nidoran")
|
if px < 8 then
|
||||||
return true
|
px = 8
|
||||||
end
|
else
|
||||||
|
Bridge.caught("nidoran")
|
||||||
local timeLimit = Strategies.getTimeRequirement("nidoran")
|
return true
|
||||||
local resetMessage = "find a suitable Nidoran"
|
end
|
||||||
if Strategies.resetTime(timeLimit, resetMessage) then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
local px, py = Player.position()
|
|
||||||
if py > 48 then
|
|
||||||
py = 48
|
|
||||||
elseif px < 9 then
|
|
||||||
px = 9
|
|
||||||
else
|
else
|
||||||
px = 8
|
local timeLimit = Strategies.getTimeRequirement("nidoran")
|
||||||
|
local resetMessage = "find a suitable Nidoran"
|
||||||
|
if Strategies.resetTime(timeLimit, resetMessage) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
if py > 48 then
|
||||||
|
py = 48
|
||||||
|
elseif px < 9 then
|
||||||
|
px = 9
|
||||||
|
else
|
||||||
|
px = 8
|
||||||
|
end
|
||||||
end
|
end
|
||||||
Walk.step(px, py) --TODO DSum
|
Walk.step(px, py) --TODO DSum
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue