Begin optimizing inventory management with menuing

This commit is contained in:
Kyle Coburn 2015-04-09 04:00:36 -07:00
parent 626c6da557
commit 6d3b035b76
2 changed files with 68 additions and 13 deletions

View File

@ -620,7 +620,7 @@ end
strategyFunctions.shopPewterMart = function() strategyFunctions.shopPewterMart = function()
return Shop.transaction{ return Shop.transaction{
buy = {{name="potion", index=1, amount=9}} buy = {{name="potion", index=1, amount=10}}
} }
end end
@ -868,6 +868,36 @@ strategyFunctions.thrashGeodude = function()
end end
end end
strategyFunctions.hikerElixer = function()
if Strategies.initialize() then
if not Inventory.contains("antidote") and Inventory.indexOf("tm34") ~= 1 then
return true
end
end
local px, py = Player.position()
if Inventory.contains("elixer") then
if py == 4 then
return true
end
py = 4
elseif py > 2 then
py = 2
else
Player.interact("Up")
return false
end
Walk.step(px, py)
end
strategyFunctions.lassEther = function()
if Strategies.initialize() then
if Inventory.contains("antidote") and Inventory.contains("elixer") then
return true
end
end
return strategyFunctions.interact({dir="Up"})
end
strategyFunctions.potionBeforeGoldeen = function() strategyFunctions.potionBeforeGoldeen = function()
if Strategies.initialize() then if Strategies.initialize() then
if Strategies.setYolo("goldeen") or Pokemon.index(0, "hp") > 7 then if Strategies.setYolo("goldeen") or Pokemon.index(0, "hp") > 7 then
@ -1031,17 +1061,13 @@ strategyFunctions.shopVermilionMart = function()
if Strategies.initialize() then if Strategies.initialize() then
Strategies.setYolo("vermilion") Strategies.setYolo("vermilion")
end end
local buyArray, sellArray local sellArray = {{name="tm34"}, {name="nugget"}}
if not Inventory.contains("pokeball") or (not Control.yolo and stats.nidoran.attack < 53) then if not Inventory.contains("elixer") then
sellArray = {{name="pokeball"}, {name="antidote"}, {name="tm34"}, {name="nugget"}} table.insert(sellArray, 1, {name="antidote"})
buyArray = {{name="super_potion",index=1,amount=3}, {name="paralyze_heal",index=4,amount=2}, {name="repel",index=5,amount=3}}
else
sellArray = {{name="antidote"}, {name="tm34"}, {name="nugget"}}
buyArray = {{name="super_potion",index=1,amount=3}, {name="repel",index=5,amount=3}}
end end
return Shop.transaction { return Shop.transaction {
sell = sellArray, sell = sellArray,
buy = buyArray buy = {{name="super_potion",index=1,amount=3}, {name="repel",index=5,amount=3}}
} }
end end
@ -1228,6 +1254,15 @@ strategyFunctions.redbarCubone = function()
end end
end end
strategyFunctions.undergroundElixer = function()
if Strategies.initialize() then
if Inventory.contains("elixer") and Inventory.contains("ether") then
return true
end
end
return strategyFunctions.interact({dir="Left"})
end
strategyFunctions.shopTM07 = function() strategyFunctions.shopTM07 = function()
return Shop.transaction{ return Shop.transaction{
direction = "Up", direction = "Up",
@ -1242,6 +1277,26 @@ strategyFunctions.shopRepels = function()
} }
end end
strategyFunctions.dodgeDepartment = function()
if Strategies.initialize() then
status.startPosition = Memory.raw(0x0242)
end
local px, py = Player.position()
local dx, dy = px, py
if status.startPosition > 7 then
dy = 2
else
dy = 5
end
if py == dy then
if px > 14 then
return true
end
dx = 15
end
Walk.step(dx, dy)
end
strategyFunctions.shopPokeDoll = function() strategyFunctions.shopPokeDoll = function()
return Shop.transaction{ return Shop.transaction{
direction = "Down", direction = "Down",

View File

@ -90,7 +90,7 @@ local Paths = {
-- 5: MT. MOON -- 5: MT. MOON
-- To Cerulean -- To Cerulean
{15, {24,6}, {s="reportMtMoon"}, {s="split"}, {35,6}, {35,10}, {61,10}, {61,8}, {79,8}, {79,10}, {90,10}}, {15, {24,6}, {s="reportMtMoon"}, {s="split"}, {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
@ -112,7 +112,7 @@ local Paths = {
-- 6: NUGGET BRIDGE -- 6: NUGGET BRIDGE
-- To Bill's -- To Bill's
{36, {0,8}, {9,8}, {9,6}, {9,6}, {8,6}, {8,5}, {s="interact",dir="Up"}, {s="thrashGeodude"}, {10,5}, {10,2}, {s="interact",dir="Up"}, {10,4}, {13,4}, {13,6}, {15,6}, {15,4}, {17,4}, {17,7}, {18,7}, {s="interact",dir="Down"}, {20,7}, {20,8}, {22,8}, {22,6}, {35,6}, {35,4}, {36,4}, {s="interact",dir="Right"}, {36,5}, {38,5}, {38,4}, {s="interact",dir="Up"}, {45,4}, {45,3}}, {36, {0,8}, {9,8}, {9,6}, {9,6}, {8,6}, {8,5}, {s="interact",dir="Up"}, {s="thrashGeodude"}, {10,5}, {s="hikerElixer"}, {10,4}, {13,4}, {13,6}, {15,6}, {15,4}, {17,4}, {17,7}, {18,7}, {s="interact",dir="Down"}, {20,7}, {20,8}, {22,8}, {22,6}, {35,6}, {35,4}, {36,4}, {s="interact",dir="Right"}, {36,5}, {38,5}, {38,4}, {s="lassEther"}, {45,4}, {45,3}},
-- Save Bill -- Save Bill
{88, {2,7}, {2,5}, {5,5}, {s="confirm",dir="Right"}, {1,5}, {s="interact",dir="Up"}, {4,5}, {s="interact",dir="Up"}, {s="waitToTalk"}, {s="potionBeforeGoldeen"}, {s="item",item="escape_rope"}}, {88, {2,7}, {2,5}, {5,5}, {s="confirm",dir="Right"}, {1,5}, {s="interact",dir="Up"}, {4,5}, {s="interact",dir="Up"}, {s="waitToTalk"}, {s="potionBeforeGoldeen"}, {s="item",item="escape_rope"}},
-- To Misty -- To Misty
@ -198,7 +198,7 @@ local Paths = {
-- Underground entrance -- Underground entrance
{80, {3,7}, {3,6}, {4,6}, {4,4}}, {80, {3,7}, {3,6}, {4,6}, {4,4}},
-- Underground -- Underground
{121, {47,2}, {s="bicycle"}, {47,5}, {22,5}, {s="interact",dir="Left"}, {2,5}}, {121, {47,2}, {s="bicycle"}, {47,5}, {22,5}, {s="undergroundElixer"}, {2,5}},
-- Underground exit -- Underground exit
{77, {4,4}, {4,8}}, {77, {4,4}, {4,8}},
-- To Celadon -- To Celadon
@ -208,7 +208,7 @@ local Paths = {
-- F1: Department store -- F1: Department store
{122, {16,7}, {c="potion",b=true,yolo=true}, {c="pp",on=true}, {16,3}, {12,3}, {12,1}}, {122, {16,7}, {c="potion",b=true,yolo=true}, {c="pp",on=true}, {16,3}, {12,3}, {12,1}},
-- F2 -- F2
{123, {12,2}, {8,2}, {8,5}, {6,5}, {s="shopTM07"}, {5,5}, {s="shopRepels"}, {9,5}, {9,2}, {16,2}, {16,1}}, {123, {12,2}, {8,2}, {8,5}, {6,5}, {s="shopTM07"}, {5,5}, {s="shopRepels"}, {9,5}, {s="dodgeDepartment"}, {15,2}, {16,2}, {16,1}},
-- F3 -- F3
{124, {16,2}, {12,2}, {12,1}}, {124, {16,2}, {12,2}, {12,1}},
-- F4: Poke Doll -- F4: Poke Doll