Standardize more menuing
This commit is contained in:
parent
d21caec80a
commit
d36927fa55
|
@ -898,20 +898,22 @@ end
|
||||||
|
|
||||||
-- teachThrash
|
-- teachThrash
|
||||||
|
|
||||||
strategyFunctions.potionForMankey = function()
|
strategyFunctions.potionForMankey = function(data)
|
||||||
local healForDefense = 16 + (14 - stats.nidoran.defense)
|
local healForDefense = 16 + (14 - stats.nidoran.defense)
|
||||||
local yoloHP = 8
|
local yoloHP = 8
|
||||||
if Strategies.initialize() then
|
if Strategies.initialize() then
|
||||||
Strategies.setYolo("mankey")
|
Strategies.setYolo("mankey")
|
||||||
if Pokemon.info("nidoking", "level") >= 23 then
|
if Pokemon.info("nidoking", "level") >= 23 then
|
||||||
return true
|
status.cancel = true
|
||||||
end
|
else
|
||||||
local curr_hp = Combat.hp()
|
local curr_hp = Combat.hp()
|
||||||
if Control.yolo and curr_hp < healForDefense and curr_hp >= yoloHP then
|
if Control.yolo and curr_hp < healForDefense and curr_hp >= yoloHP then
|
||||||
Bridge.chat("is attempting to stay in range of red-bar by skipping potioning before Mankey...")
|
Bridge.chat("is attempting to stay in range of red-bar by skipping potioning before Mankey...")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return strategyFunctions.potion({hp=healForDefense, yolo=yoloHP})
|
end
|
||||||
|
|
||||||
|
return strategyFunctions.potion({hp=healForDefense, yolo=yoloHP, chain=data.chain, close=data.close})
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.redbarMankey = function()
|
strategyFunctions.redbarMankey = function()
|
||||||
|
|
|
@ -871,24 +871,10 @@ Strategies.functions = {
|
||||||
elseif Battle.isActive() then
|
elseif Battle.isActive() then
|
||||||
status.canProgress = false
|
status.canProgress = false
|
||||||
Battle.automate()
|
Battle.automate()
|
||||||
elseif main == (Data.yellow and 23 or 123) then
|
elseif main == 123 then
|
||||||
status.canProgress = true
|
|
||||||
Input.press("B")
|
|
||||||
elseif Textbox.handle() then
|
|
||||||
Input.press("Start", 2)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
|
|
||||||
waitToReceive = function()
|
|
||||||
local main = Memory.value("menu", "main")
|
|
||||||
if main == 128 then
|
|
||||||
if status.canProgress then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
elseif main == 32 or main == 123 then
|
|
||||||
status.canProgress = true
|
status.canProgress = true
|
||||||
Input.cancel()
|
Input.cancel()
|
||||||
else
|
elseif Textbox.handle() then
|
||||||
Input.press("Start", 2)
|
Input.press("Start", 2)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -1270,30 +1256,29 @@ Strategies.functions = {
|
||||||
rareCandyEarly = function(data)
|
rareCandyEarly = function(data)
|
||||||
if Strategies.initialize() then
|
if Strategies.initialize() then
|
||||||
if Pokemon.info("nidoking", "level") ~= 20 then
|
if Pokemon.info("nidoking", "level") ~= 20 then
|
||||||
return true
|
status.cancel = true
|
||||||
end
|
else
|
||||||
if Data.yellow then
|
if Data.yellow then
|
||||||
p("RCE", Pokemon.getExp())
|
p("RCE", Pokemon.getExp())
|
||||||
end
|
end
|
||||||
if Pokemon.getExp() > 5550 then
|
status.cancel = Pokemon.getExp() > 5550
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return strategyFunctions.item({item="rare_candy", amount=2, poke="nidoking", chain=data.chain, close=data.close})
|
return strategyFunctions.item({item="rare_candy", amount=2, poke="nidoking", chain=data.chain, close=data.close})
|
||||||
end,
|
end,
|
||||||
|
|
||||||
teachThrash = function()
|
teachThrash = function(data)
|
||||||
if Strategies.initialize() then
|
if Strategies.initialize() then
|
||||||
local nidoLevel = Pokemon.info("nidoking", "level")
|
local nidoLevel = Pokemon.info("nidoking", "level")
|
||||||
if nidoLevel < 21 or nidoLevel >= 23 or not Inventory.contains("rare_candy") then
|
if nidoLevel < 21 or nidoLevel >= 23 or not Inventory.contains("rare_candy") then
|
||||||
status.close = true
|
status.cancel = true
|
||||||
end
|
else
|
||||||
end
|
|
||||||
if not status.close then
|
|
||||||
local replacementMove = Data.yellow and "tackle" or "leer"
|
|
||||||
status.close = strategyFunctions.teach({move="thrash", item="rare_candy", replace=replacementMove})
|
|
||||||
status.updateStats = true
|
status.updateStats = true
|
||||||
elseif Menu.close() then
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local replacementMove = Data.yellow and "tackle" or "leer"
|
||||||
|
if strategyFunctions.teach({move="thrash", item="rare_candy", replace=replacementMove, chain=data.chain, close=data.close}) then
|
||||||
if status.updateStats then
|
if status.updateStats then
|
||||||
nidokingStats()
|
nidokingStats()
|
||||||
end
|
end
|
||||||
|
|
|
@ -57,7 +57,7 @@ local Paths = {
|
||||||
-- Pewter City
|
-- Pewter City
|
||||||
{2, {18,35}, {18,22}, {19,22}, {19,13}, {10,13}, {10,18}, {16,18}, {16,17}},
|
{2, {18,35}, {18,22}, {19,22}, {19,13}, {10,13}, {10,18}, {16,18}, {16,17}},
|
||||||
-- Brock
|
-- Brock
|
||||||
{54, {4,13}, {c="a",a="Brock's Gym"}, {4,8}, {1,8}, {1,4}, {4,4}, {4,2}, {s="talk",dir="Up"}, {s="fightBrock"}, {s="splitBrock"}, {s="emuSpeed",percent=100}, {4,14}},
|
{54, {4,13}, {c="a",a="Brock's Gym"}, {4,8}, {1,8}, {1,4}, {4,4}, {4,2}, {s="talk",dir="Up"}, {s="fightBrock"}, {s="splitBrock"}, {4,14}},
|
||||||
|
|
||||||
-- 3: BROCK
|
-- 3: BROCK
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ local Paths = {
|
||||||
-- 5: MT. MOON
|
-- 5: MT. MOON
|
||||||
|
|
||||||
-- To Cerulean
|
-- To Cerulean
|
||||||
{15, {24,6}, {s="reportMtMoon"}, {c="trackEncounters",area=nil}, {s="split"}, {24,8}, {35,8}, {35,10}, {61,10}, {61,8}, {79,8}, {79,10}, {90,10}},
|
{15, {24,6}, {s="reportMtMoon"}, {s="split"}, {c="trackEncounters",area=nil}, {24,8}, {35,8}, {35,10}, {61,10}, {61,8}, {79,8}, {79,10}, {90,10}},
|
||||||
-- Enter Cerulean
|
-- Enter Cerulean
|
||||||
{3, {0,18}, {c="a",a="Cerulean"}, {14,18}, {s="dodgeCerulean"}, {19,18}, {19,17}},
|
{3, {0,18}, {c="a",a="Cerulean"}, {14,18}, {s="dodgeCerulean"}, {19,18}, {19,17}},
|
||||||
-- Cerulean Center
|
-- Cerulean Center
|
||||||
|
@ -106,7 +106,7 @@ local Paths = {
|
||||||
-- Rival 2
|
-- Rival 2
|
||||||
{3, {9,12}, {c="a",a="Cerulean Rival"}, {21,12}, {21,6}, {s="rivalSandAttack"}, {21,-1}},
|
{3, {9,12}, {c="a",a="Cerulean Rival"}, {21,12}, {21,6}, {s="rivalSandAttack"}, {21,-1}},
|
||||||
-- Nugget bridge
|
-- Nugget bridge
|
||||||
{35, {11,35}, {c="a",a="Nugget Bridge"}, {11,32}, {s="talk",dir="Up"}, {s="hornAttackCaterpie"}, {10,32}, {10,29}, {s="potion",hp=12,yolo=10}, {s="talk",dir="Up"}, {11,29}, {11,27}, {s="rareCandyEarly",chain=true}, {s="potion",hp=10,yolo=8,close=true}, {11,26}, {s="talk",dir="Up"}, {s="swapThrash"}, {10,26}, {10,24}, {s="teachThrash"}, {s="potion",hp=4}, {10,23}, {s="talk",dir="Up"}, {s="swapThrash"}, {11,23}, {11,21}, {s="teachThrash"}, {s="potionForMankey"}, {11,20}, {s="talk",dir="Up"}, {s="swapThrash"}, {s="redbarMankey"}, {10,20}, {10,19}, {s="teachThrash"}, {10,15}, {s="learnThrash"}, {s="swapThrash"}, {s="waitToFight"}, {s="teachThrash"}, {s="split"}, {10,8}, {20,8}},
|
{35, {11,35}, {c="a",a="Nugget Bridge"}, {11,32}, {s="talk",dir="Up"}, {s="hornAttackCaterpie"}, {10,32}, {10,29}, {s="potion",hp=12,yolo=10}, {s="talk",dir="Up"}, {11,29}, {11,27}, {s="rareCandyEarly",chain=true}, {s="potion",hp=10,yolo=8,close=true}, {11,26}, {s="talk",dir="Up"}, {s="swapThrash"}, {10,26}, {10,24}, {s="teachThrash",chain=true}, {s="potion",hp=4,close=true}, {10,23}, {s="talk",dir="Up"}, {s="swapThrash"}, {11,23}, {11,21}, {s="teachThrash",chain=true}, {s="potionForMankey",close=true}, {11,20}, {s="talk",dir="Up"}, {s="swapThrash"}, {s="redbarMankey"}, {10,20}, {10,19}, {s="teachThrash"}, {10,15}, {s="learnThrash"}, {s="swapThrash"}, {s="waitToFight"}, {s="teachThrash"}, {s="split"}, {10,8}, {20,8}},
|
||||||
|
|
||||||
-- 6: NUGGET BRIDGE
|
-- 6: NUGGET BRIDGE
|
||||||
|
|
||||||
|
@ -345,6 +345,7 @@ local Paths = {
|
||||||
-- Fly home
|
-- Fly home
|
||||||
{7, {27,28}, {s="fly",dest="pallet",map=0}},
|
{7, {27,28}, {s="fly",dest="pallet",map=0}},
|
||||||
-- Pallet to Cinnabar
|
-- Pallet to Cinnabar
|
||||||
|
--TODO combine RC for Carbos
|
||||||
{0, {5,6}, {s="item",item="super_repel",chain=true}, {s="item",item="rare_candy",amount=3,poke="nidoking",chain=true}, {s="bicycle"}, {s="allowDeath",on=false}, {3,6}, {s="dodgeGirl"}, {3,17}, {s="skill",move="surf",dir="Right",x=4}, {4,18}},
|
{0, {5,6}, {s="item",item="super_repel",chain=true}, {s="item",item="rare_candy",amount=3,poke="nidoking",chain=true}, {s="bicycle"}, {s="allowDeath",on=false}, {3,6}, {s="dodgeGirl"}, {3,17}, {s="skill",move="surf",dir="Right",x=4}, {4,18}},
|
||||||
-- To Cinnabar
|
-- To Cinnabar
|
||||||
{32, {4,0}, {4,14}, {3,14}, {3,90}},
|
{32, {4,0}, {4,14}, {3,14}, {3,90}},
|
||||||
|
@ -373,7 +374,7 @@ local Paths = {
|
||||||
-- Cinnabar
|
-- Cinnabar
|
||||||
{8, {11,12}, {s="earthquakeElixer",min=4,chain=true}, {s="bicycle"}, {18,12}, {18,3}},
|
{8, {11,12}, {s="earthquakeElixer",min=4,chain=true}, {s="bicycle"}, {18,12}, {18,3}},
|
||||||
-- Cinnabar Gym
|
-- Cinnabar Gym
|
||||||
{166, {16,17}, {c="a",a="Blaine's Gym"}, {16,14}, {18,14}, {18,10}, {15,10}, {15,8}, {s="confirm",dir="Up"}, {16,8}, {16,7}, {18,7}, {18,1}, {12,1}, {12,2}, {10,2}, {s="confirm",dir="Up",type="B"}, {12,2}, {12,7}, {10,7}, {10,8}, {9,8}, {s="confirm",dir="Up",type="B"}, {9,11}, {12,11}, {12,13}, {10,13}, {10,14}, {9,14}, {s="confirm",dir="Up",type="B"}, {9,16}, {1,16}, {1,14}, {s="confirm",dir="Up"}, {2,14}, {2,13}, {4,13}, {4,9}, {1,9}, {1,8}, {s="confirm",dir="Up",type="B"}, {2,8}, {2,7}, {4,7}, {4,5}, {3,5}, {3,4}, {c="potion",b=false}, {s="waitToFight",dir="Up"}, {s="split"}, {s="waitToReceive"}, {s="skill",move="dig",map=166}},
|
{166, {16,17}, {c="a",a="Blaine's Gym"}, {16,14}, {18,14}, {18,10}, {15,10}, {15,8}, {s="confirm",dir="Up"}, {16,8}, {16,7}, {18,7}, {18,1}, {12,1}, {12,2}, {10,2}, {s="confirm",dir="Up",type="B"}, {12,2}, {12,7}, {10,7}, {10,8}, {9,8}, {s="confirm",dir="Up",type="B"}, {9,11}, {12,11}, {12,13}, {10,13}, {10,14}, {9,14}, {s="confirm",dir="Up",type="B"}, {9,16}, {1,16}, {1,14}, {s="confirm",dir="Up"}, {2,14}, {2,13}, {4,13}, {4,9}, {1,9}, {1,8}, {s="confirm",dir="Up",type="B"}, {2,8}, {2,7}, {4,7}, {4,5}, {3,5}, {3,4}, {c="potion",b=false}, {s="waitToFight",dir="Up"}, {s="split"}, {s="waitToPauseFromBattle"}, {s="skill",move="dig",map=166}},
|
||||||
|
|
||||||
-- 14: BLAINE
|
-- 14: BLAINE
|
||||||
|
|
||||||
|
|
|
@ -116,6 +116,8 @@ function Inventory.teach(item, poke, replaceIdx)
|
||||||
Input.press("A")
|
Input.press("A")
|
||||||
elseif column == 15 then
|
elseif column == 15 then
|
||||||
Menu.select(0, true)
|
Menu.select(0, true)
|
||||||
|
elseif Menu.hasTextbox() then
|
||||||
|
Input.press("B")
|
||||||
else
|
else
|
||||||
local teachIndex = 0
|
local teachIndex = 0
|
||||||
if poke then
|
if poke then
|
||||||
|
|
Loading…
Reference in New Issue