Add early Rare Candy strat, unify more shared strategies, improve Nugget Bridge potioning

This commit is contained in:
Kyle Coburn 2015-04-10 22:04:00 -07:00
parent a4c8fc7e1b
commit 28ea9fc83f
3 changed files with 105 additions and 46 deletions

View File

@ -778,40 +778,9 @@ strategyFunctions.rivalSandAttack = function(data)
end
end
strategyFunctions.teachThrash = function()
if Strategies.initialize() then
if Pokemon.hasMove("thrash") or Pokemon.info("nidoking", "level") < 21 then
return true
end
end
if Strategies.functions.teach({move="thrash",item="rare_candy",replace="leer"}) then
if Menu.close() then
local att = Pokemon.index(0, "attack")
local def = Pokemon.index(0, "defense")
local spd = Pokemon.index(0, "speed")
local scl = Pokemon.index(0, "special")
local statDesc = att.." "..def.." "..spd.." "..scl
local attDv, defDV, spdDv, sclDV = Pokemon.getDVs("nidoking")
stats.nidoran = {
attack = att,
defense = def,
speed = spd,
special = scl,
level4 = stats.nidoran.level4,
rating = stats.nidoran.rating,
attackDV = attDv,
defenseDV = defDV,
speedDV = spdDv,
specialDV = sclDV,
}
-- rareCandyEarly
p(attDv, defDV, spdDv, sclDV)
print(statDesc)
Bridge.stats(statDesc)
return true
end
end
end
-- teachThrash
strategyFunctions.potionForMankey = function()
if Strategies.initialize() then
@ -987,18 +956,7 @@ strategyFunctions.potionBeforeRocket = function()
return Strategies.functions.potion({hp=13, yolo=11})
end
strategyFunctions.jingleSkip = function()
if status.canProgress then
local px, py = Player.position()
if px < 4 then
return true
end
Input.press("Left", 0)
else
Input.press("A", 0)
status.canProgress = true
end
end
-- jingleSkip
strategyFunctions.catchOddish = function()
if not Control.canCatch() then

View File

@ -346,6 +346,31 @@ function Strategies.prepare(...)
end
end
local function nidokingStats()
local att = Pokemon.index(0, "attack")
local def = Pokemon.index(0, "defense")
local spd = Pokemon.index(0, "speed")
local scl = Pokemon.index(0, "special")
local statDesc = att.." "..def.." "..spd.." "..scl
local attDv, defDV, spdDv, sclDV = Pokemon.getDVs("nidoking")
stats.nidoran = {
attack = att,
defense = def,
speed = spd,
special = scl,
level4 = stats.nidoran.level4,
rating = stats.nidoran.rating,
attackDV = attDv,
defenseDV = defDV,
speedDV = spdDv,
specialDV = sclDV,
}
p(attDv, defDV, spdDv, sclDV)
print(statDesc)
Bridge.stats(statDesc)
end
-- GENERALIZED STRATEGIES
Strategies.functions = {
@ -912,6 +937,82 @@ Strategies.functions = {
}
end,
rareCandyEarly = function(data)
if Strategies.initialize() then
p("RCE", Pokemon.getExp())
if yellow then
if Pokemon.getExp() > 5500 then --TODO
return true
end
else
if Pokemon.info("nidoking", "level") ~= 20 or Pokemon.getExp() > 5550 then
return true
end
end
end
return strategyFunctions.item({item="rare_candy", amount=2, poke="nidoking", chain=data.chain, close=data.close})
end,
teachThrash = function()
if Strategies.initialize() then
if Pokemon.hasMove("thrash") or Pokemon.info("nidoking", "level") < 21 or not Inventory.contains("rare_candy") then
return true
end
end
local replacementMove = yellow and "tackle" or "leer"
if strategyFunctions.teach({move="thrash",item="rare_candy",replace=replacementMove}) then
if Menu.close() then
nidokingStats()
return true
end
end
end,
learnThrash = function()
if Battle.isActive() then
status.canProgress = true
local settingsRow = Memory.value("menu", "settings_row")
if settingsRow == 8 then
local column = Memory.value("menu", "column")
if column == 15 then
Input.press("A")
elseif column == 5 then
local replacementMove = yellow and "tackle" or "leer"
local replaceIndex = Pokemon.moveIndex(replacementMove, "nidoking")
if replaceIndex then
Menu.select(replaceIndex - 1, true)
status.learned = true
else
Input.cancel()
end
end
else
Battle.automate()
end
elseif status.canProgress then
if status.learned then
print("learn'd")
nidokingStats()
end
return true
else
Battle.automate()
end
end,
jingleSkip = function()
if status.canProgress then
local px, py = Player.position()
if px < 4 then
return true
end
Input.press("Left", 0)
else
Input.press("A", 0)
status.canProgress = true
end
end,
playPokeflute = function()
if Battle.isActive() then
return true

View File

@ -107,7 +107,7 @@ local Paths = {
{3, {9,12}, {c="a",a="Cerulean Rival"}, {21,12}, {21,6}, {s="rivalSandAttack"}, {21,-1}},
-- Nugget bridge
--TODO RC early strat
{35, {11,35}, {c="a",a="Nugget Bridge"}, {11,32}, {s="interact",dir="Up"}, {10,32}, {10,29}, {s="interact",dir="Up"}, {11,29}, {11,27}, {s="potion",hp=4}, {11,26}, {s="interact",dir="Up"}, {10,26}, {10,24}, {s="teachThrash"}, {s="potion",hp=4}, {10,23}, {s="interact",dir="Up"}, {11,23}, {11,21}, {s="teachThrash"}, {s="potionForMankey"}, {11,20}, {s="interact",dir="Up"}, {s="redbarMankey"}, {10,20}, {10,19}, {s="teachThrash"}, {10,15}, {s="waitToFight"}, {s="teachThrash"}, {s="split"}, {10,8}, {20,8}},
{35, {11,35}, {c="a",a="Nugget Bridge"}, {11,32}, {s="interact",dir="Up"}, {10,32}, {10,29}, {s="potion",hp=12,yolo=10}, {s="interact",dir="Up"}, {11,29}, {11,27}, {s="rareCandyEarly",close=true}, {s="potion",hp=10,yolo=8,close=true}, {11,26}, {s="interact",dir="Up"}, {10,26}, {10,24}, {s="teachThrash"}, {s="potion",hp=4}, {10,23}, {s="interact",dir="Up"}, {11,23}, {11,21}, {s="teachThrash"}, {s="potionForMankey"}, {11,20}, {s="interact",dir="Up"}, {s="redbarMankey"}, {10,20}, {10,19}, {s="teachThrash"}, {10,15}, {s="learnThrash"}, {s="teachThrash"}, {s="split"}, {10,8}, {20,8}},
-- 6: NUGGET BRIDGE