Standardize E4 center skipping and potioning for Yellow

This commit is contained in:
Kyle Coburn 2015-05-04 19:29:15 -07:00
parent 050d21fea7
commit bb67895a7e
3 changed files with 57 additions and 64 deletions

View File

@ -1419,15 +1419,7 @@ strategyFunctions.fightSilphMachoke = function()
end
end
strategyFunctions.silphCarbos = function()
if Strategies.initialize() then
if stats.nidoran.speedDV >= 8 then
return true
end
Bridge.chat(" This Nidoking has bad speed, so we need the extra Carbos here.")
end
return strategyFunctions.interact({dir="Left"})
end
-- silphCarbos
strategyFunctions.swapXSpecials = function()
local destination = Inventory.contains("ether") and 5 or 6
@ -1808,24 +1800,7 @@ end
-- push
strategyFunctions.potionBeforeLorelei = function()
if Strategies.initialize() then
if Strategies.requiresE4Center() then
return true
end
local canPotion
if Inventory.contains("potion") and Strategies.hasHealthFor("LoreleiDewgong", 20) then
canPotion = true
elseif Inventory.contains("super_potion") and Strategies.hasHealthFor("LoreleiDewgong", 50) then
canPotion = true
end
if not canPotion then
return true
end
Bridge.chat("is healing before Lorelei to skip the Elite 4 Center...")
end
return strategyFunctions.potion({hp=Combat.healthFor("LoreleiDewgong")})
end
-- potionBeforeLorelei
strategyFunctions.depositPokemon = function()
local toSize
@ -1864,22 +1839,7 @@ strategyFunctions.depositPokemon = function()
end
end
strategyFunctions.centerSkip = function()
if Strategies.initialize() then
Strategies.setYolo("e4center")
if not Strategies.requiresE4Center() then
local message = "is skipping the Center and attempting to red-bar "
if Strategies.hasHealthFor("LoreleiDewgong") then
message = message.."off Lorelei..."
else
message = message.."the Elite 4!"
end
Bridge.chat(message)
return true
end
end
return strategyFunctions.confirm({dir="Up"})
end
-- centerSkip
strategyFunctions.lorelei = function()
if Strategies.trainerBattle() then

View File

@ -1709,8 +1709,11 @@ Strategies.functions = {
end,
checkEther = function()
-- TODO don't skip center if not in redbar
Strategies.maxEtherSkip = not Strategies.requiresE4Center()
if Data.yellow then
Strategies.maxEtherSkip = Strategies.requiresE4Center()
else -- TODO don't skip center if not in redbar?
Strategies.maxEtherSkip = not Strategies.requiresE4Center()
end
if not Strategies.maxEtherSkip then
Bridge.chat("is grabbing the Max Ether to skip the Elite 4 Center.")
end
@ -1787,6 +1790,46 @@ Strategies.functions = {
end
end,
potionBeforeLorelei = function()
if Strategies.initialize() then
if Strategies.requiresE4Center() then
return true
end
if not Strategies.canHealFor("LoreleiDewgong") then
return true
end
Bridge.chat("is healing before Lorelei to skip the Elite 4 Center...")
end
return strategyFunctions.potion({hp=Combat.healthFor("LoreleiDewgong")})
end,
centerSkip = function()
if Strategies.initialize() then
Strategies.setYolo("e4center")
if not Strategies.requiresE4Center() then
local message
if Data.yellow then
message = " has enough HP to skip the Center. "..Utils.random {
"Let's do this!",
"Let's go!",
"What could go wrong?",
"No crits!",
}
else
message = "is skipping the Center and attempting to red-bar "
if Strategies.hasHealthFor("LoreleiDewgong") then
message = message.."off Lorelei..."
else
message = message.."the Elite 4!"
end
end
Bridge.chat(message)
return true
end
end
return strategyFunctions.confirm({dir="Up"})
end,
prepareForLance = function()
local enableFull
if Strategies.hasHealthFor("LanceGyarados", 100) then

View File

@ -645,16 +645,17 @@ end
-- silphElevator
strategyFunctions.silphCarbos = function(data)
if not Strategies.needs1Carbos() then
if Strategies.closeMenuFor(data) then
return true
end
else
-- silphCarbos
strategyFunctions.useSilphCarbos = function(data)
if Strategies.getsSilphCarbosSpecially() then --TODO inventory count
data.item = "carbos"
data.poke = "nidoking"
return strategyFunctions.item(data)
end
if Strategies.closeMenuFor(data) then
return true
end
end
strategyFunctions.silphRival = function()
@ -827,21 +828,10 @@ strategyFunctions.depositPokemon = function()
end
end
strategyFunctions.centerSkip = function()
if Strategies.initialize() then
Strategies.setYolo("e4center")
Control.preferredPotion = "full"
if false then --TODO
local message = "is skipping the Elite 4 Center!"
Bridge.chat(message)
return true
end
end
return strategyFunctions.confirm({dir="Up"})
end
-- centerSkip
strategyFunctions.shopE4 = function()
Control.preferredPotion = "full"
return Shop.transaction {
buy = {{name="full_restore", index=2, amount=3}}
}