Add backup strategy for using the Elite 4 Center
This commit is contained in:
parent
ff14429114
commit
626c6da557
|
@ -208,6 +208,10 @@ local function potionForRedBar(damage)
|
||||||
return canPotion
|
return canPotion
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function requiresE4Center()
|
||||||
|
return Battle.pp("horn_drill") < 6 --TODO
|
||||||
|
end
|
||||||
|
|
||||||
-- STRATEGIES
|
-- STRATEGIES
|
||||||
|
|
||||||
local strategyFunctions = Strategies.functions
|
local strategyFunctions = Strategies.functions
|
||||||
|
@ -1900,6 +1904,20 @@ strategyFunctions.viridianRival = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
strategyFunctions.checkEther = function()
|
||||||
|
-- TODO don't skip center if not in redbar
|
||||||
|
local hornPP = Battle.pp("horn_drill")
|
||||||
|
if hornPP >= 5 then
|
||||||
|
maxEtherSkip = true
|
||||||
|
elseif hornPP >= 4 then
|
||||||
|
maxEtherSkip = stats.nidoran.attack > 53 and Battle.pp("earthquake") > 0
|
||||||
|
end
|
||||||
|
if not maxEtherSkip then
|
||||||
|
Bridge.chat("Grabbing the Max Ether to skip the Elite 4 Center.")
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
strategyFunctions.ether = function(data)
|
strategyFunctions.ether = function(data)
|
||||||
local main = Memory.value("menu", "main")
|
local main = Memory.value("menu", "main")
|
||||||
data.item = status.item
|
data.item = status.item
|
||||||
|
@ -1909,19 +1927,19 @@ strategyFunctions.ether = function(data)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if not status.item then
|
if not status.item then
|
||||||
if data.max then
|
if data.max and maxEtherSkip then
|
||||||
-- TODO don't skip center if not in redbar
|
|
||||||
maxEtherSkip = stats.nidoran.attack > 53 and Battle.pp("earthquake") > 0 and Battle.pp("horn_drill") > 3
|
|
||||||
if maxEtherSkip then
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
Bridge.chat("Grabbing the Max Ether to skip the Elite 4 Center.")
|
status.item = Inventory.contains("ether", "max_ether", "elixer")
|
||||||
end
|
|
||||||
status.item = Inventory.contains("ether", "max_ether")
|
|
||||||
if not status.item then
|
if not status.item then
|
||||||
|
if Strategies.closeMenuFor(data) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
status.tries = Inventory.count(status.item) --TODO remove?
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if status.item == "elixer" then
|
||||||
|
return Strategies.useItem({item="elixer", poke="nidoking", chain=data.chain, close=data.close})
|
||||||
end
|
end
|
||||||
if Memory.value("menu", "main") == 144 and Menu.getCol() == 5 then
|
if Memory.value("menu", "main") == 144 and Menu.getCol() == 5 then
|
||||||
if Memory.value("battle", "menu") ~= 95 then
|
if Memory.value("battle", "menu") ~= 95 then
|
||||||
|
@ -1936,7 +1954,7 @@ strategyFunctions.ether = function(data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.pickMaxEther = function()
|
strategyFunctions.grabMaxEther = function()
|
||||||
if Strategies.initialize() then
|
if Strategies.initialize() then
|
||||||
if maxEtherSkip or Inventory.isFull() then
|
if maxEtherSkip or Inventory.isFull() then
|
||||||
return true
|
return true
|
||||||
|
@ -1958,6 +1976,9 @@ end
|
||||||
|
|
||||||
strategyFunctions.potionBeforeLorelei = function()
|
strategyFunctions.potionBeforeLorelei = function()
|
||||||
if Strategies.initialize() then
|
if Strategies.initialize() then
|
||||||
|
if requiresE4Center() then
|
||||||
|
return true
|
||||||
|
end
|
||||||
local canPotion
|
local canPotion
|
||||||
if Inventory.contains("potion") and Strategies.hasHealthFor("LoreleiDewgong", 20) then
|
if Inventory.contains("potion") and Strategies.hasHealthFor("LoreleiDewgong", 20) then
|
||||||
canPotion = true
|
canPotion = true
|
||||||
|
@ -1974,7 +1995,7 @@ end
|
||||||
|
|
||||||
strategyFunctions.depositPokemon = function()
|
strategyFunctions.depositPokemon = function()
|
||||||
local toSize
|
local toSize
|
||||||
if Strategies.hasHealthFor("LoreleiDewgong") then
|
if Strategies.hasHealthFor("LoreleiDewgong") or requiresE4Center() then
|
||||||
toSize = 1
|
toSize = 1
|
||||||
else
|
else
|
||||||
toSize = 2
|
toSize = 2
|
||||||
|
@ -2010,7 +2031,9 @@ strategyFunctions.depositPokemon = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.centerSkip = function()
|
strategyFunctions.centerSkip = function()
|
||||||
|
if Strategies.initialize() then
|
||||||
Strategies.setYolo("e4center")
|
Strategies.setYolo("e4center")
|
||||||
|
if not requiresE4Center() then
|
||||||
local message = "Skipping the Center and attempting to red-bar "
|
local message = "Skipping the Center and attempting to red-bar "
|
||||||
if Strategies.hasHealthFor("LoreleiDewgong") then
|
if Strategies.hasHealthFor("LoreleiDewgong") then
|
||||||
message = message.."off Lorelei..."
|
message = message.."off Lorelei..."
|
||||||
|
@ -2019,6 +2042,9 @@ strategyFunctions.centerSkip = function()
|
||||||
end
|
end
|
||||||
Bridge.chat(message)
|
Bridge.chat(message)
|
||||||
return true
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return strategyFunctions.confirm({dir="Up"})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.lorelei = function()
|
strategyFunctions.lorelei = function()
|
||||||
|
@ -2121,6 +2147,9 @@ strategyFunctions.prepareForLance = function()
|
||||||
enableFull = true
|
enableFull = true
|
||||||
end
|
end
|
||||||
local min_recovery = Combat.healthFor("LanceGyarados")
|
local min_recovery = Combat.healthFor("LanceGyarados")
|
||||||
|
if not Control.yolo then
|
||||||
|
min_recovery = min_recovery + 2
|
||||||
|
end
|
||||||
return Strategies.functions.potion({hp=min_recovery, full=enableFull, chain=true})
|
return Strategies.functions.potion({hp=min_recovery, full=enableFull, chain=true})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -412,7 +412,7 @@ local Paths = {
|
||||||
-- Pokemon League 1
|
-- Pokemon League 1
|
||||||
{193, {4,7}, {4,0}},
|
{193, {4,7}, {4,0}},
|
||||||
-- PL 2
|
-- PL 2
|
||||||
{34, {7,139}, {s="ether",max=true,chain=true}, {s="bicycle"}, {7,132}, {14,132}, {14,124}, {9,124}, {9,116}, {10,116}, {10,104}, {s="skill",move="surf",y=103}, {10,92}, {7,92}, {7,90}, {s="pickMaxEther"}, {7,72}, {8,72}, {8,71}, {s="item",item="super_repel",chain=true}, {s="bicycle"}, {8,66}, {10,66}, {10,57}, {12,57}, {12,48}, {6,48}, {6,32}, {4,32}, {4,31}},
|
{34, {7,139}, {s="checkEther"}, {s="ether",max=true,chain=true}, {s="bicycle"}, {7,132}, {14,132}, {14,124}, {9,124}, {9,116}, {10,116}, {10,104}, {s="skill",move="surf",y=103}, {10,92}, {7,92}, {7,90}, {s="grabMaxEther"}, {7,72}, {8,72}, {8,71}, {s="item",item="super_repel",chain=true}, {s="bicycle"}, {8,66}, {10,66}, {10,57}, {12,57}, {12,48}, {6,48}, {6,32}, {4,32}, {4,31}},
|
||||||
-- Victory Road
|
-- Victory Road
|
||||||
{108, {8,17}, {c="a",a="Victory Road"}, {s="tweetVictoryRoad"}, {8,16}, {4,16}, {4,14}, {5,14}, {s="skill",move="strength"}, {5,15}, {4,15}, {4,16}, {7,16}, {s="push",dir="Right",x=0x0255,y=0x0254}, {7,17}, {9,17}, {9,15}, {8,15}, {8,14}, {15,14}, {15,15}, {16,15}, {16,14}, {s="push",dir="Up",x=0x0255,y=0x0254}, {14,14}, {14,12}, {16,12}, {16,11}, {17,11}, {17,12}, {14,12}, {14,14}, {8,14}, {8,16}, {5,16}, {5,12}, {11,12}, {11,6}, {7,6}, {7,8}, {3,8}, {3,5}, {2,5}, {2,1}, {1,1}},
|
{108, {8,17}, {c="a",a="Victory Road"}, {s="tweetVictoryRoad"}, {8,16}, {4,16}, {4,14}, {5,14}, {s="skill",move="strength"}, {5,15}, {4,15}, {4,16}, {7,16}, {s="push",dir="Right",x=0x0255,y=0x0254}, {7,17}, {9,17}, {9,15}, {8,15}, {8,14}, {15,14}, {15,15}, {16,15}, {16,14}, {s="push",dir="Up",x=0x0255,y=0x0254}, {14,14}, {14,12}, {16,12}, {16,11}, {17,11}, {17,12}, {14,12}, {14,14}, {8,14}, {8,16}, {5,16}, {5,12}, {11,12}, {11,6}, {7,6}, {7,8}, {3,8}, {3,5}, {2,5}, {2,1}, {1,1}},
|
||||||
-- F2
|
-- F2
|
||||||
|
|
Loading…
Reference in New Issue