Standardize move swapping, test swapping Thrash to slot 1
This commit is contained in:
parent
ee3babd3db
commit
d123cabe75
|
@ -111,16 +111,22 @@ Battle.pp = movePP
|
||||||
|
|
||||||
-- UTILS
|
-- UTILS
|
||||||
|
|
||||||
function Battle.swapMove(sidx, fidx)
|
function Battle.swapMove(move, toIndex)
|
||||||
|
toIndex = toIndex + 1
|
||||||
if openBattleMenu() then
|
if openBattleMenu() then
|
||||||
|
local moveIndex = Pokemon.battleMove(move)
|
||||||
|
if not moveIndex or moveIndex == toIndex then
|
||||||
|
return true
|
||||||
|
end
|
||||||
local selection = Memory.value("menu", "selection_mode")
|
local selection = Memory.value("menu", "selection_mode")
|
||||||
local swapSelect
|
local swapSelect
|
||||||
if selection == sidx then
|
if selection == toIndex then
|
||||||
swapSelect = fidx
|
swapSelect = moveIndex
|
||||||
else
|
else
|
||||||
swapSelect = sidx
|
swapSelect = toIndex
|
||||||
end
|
end
|
||||||
if Menu.select(swapSelect, false, false, nil, true, 3) then
|
local menuSize = Memory.raw(0x101F) == 0 and 3 or 4
|
||||||
|
if Menu.select(swapSelect, true, false, nil, true, menuSize) then
|
||||||
Input.press("Select")
|
Input.press("Select")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -749,6 +749,10 @@ Strategies.functions = {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
swapMove = function(data)
|
||||||
|
return Battle.swapMove(data.move, data.to)
|
||||||
|
end,
|
||||||
|
|
||||||
wait = function()
|
wait = function()
|
||||||
print("Please save state")
|
print("Please save state")
|
||||||
Input.press("Start", 999999999)
|
Input.press("Start", 999999999)
|
||||||
|
@ -904,13 +908,6 @@ Strategies.functions = {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
swapHornAttack = function()
|
|
||||||
if Pokemon.battleMove("horn_attack") == 1 then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
Battle.swapMove(1, 3)
|
|
||||||
end,
|
|
||||||
|
|
||||||
dodgePalletBoy = function()
|
dodgePalletBoy = function()
|
||||||
return Strategies.dodgeUp(0x0223, 14, 14, 15, 7)
|
return Strategies.dodgeUp(0x0223, 14, 14, 15, 7)
|
||||||
end,
|
end,
|
||||||
|
@ -1138,8 +1135,17 @@ Strategies.functions = {
|
||||||
nidokingStats()
|
nidokingStats()
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
swapThrash = function()
|
||||||
|
if not Battle.isActive() then
|
||||||
|
if Textbox.handle() and status.canProgress then
|
||||||
|
return true
|
||||||
|
end
|
||||||
else
|
else
|
||||||
Battle.automate()
|
status.canProgress = true
|
||||||
|
return Battle.swapMove("thrash", 0)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ local Paths = {
|
||||||
-- Leaving Pewter City
|
-- Leaving Pewter City
|
||||||
{2, {23,18}, {40,18}},
|
{2, {23,18}, {40,18}},
|
||||||
-- Route 3
|
-- Route 3
|
||||||
{14, {0,10}, {c="a",a="Route 3"}, {c="catchFlier"}, {c="pp",on=true}, {s="battleModeSet"}, {8,10}, {8,8}, {11,8}, {11,6}, {s="bugCatcher"}, {11,4}, {12,4}, {s="potion",hp=19}, {13,4}, {s="talk",dir="Right"}, {s="shortsKid"}, {s="tweetAfterBrock"}, {13,5}, {s="potionBeforeCocoons"}, {18,5}, {s="talk",dir="Right"}, {s="swapHornAttack"}, {18,6}, {22,6}, {22,5}, {s="potion",hp=4}, {24,5}, {s="talk",dir="Down"}, {s="fightMetapod"}, {27,5}, {27,9}, {s="catchFlierBackup"}, {37,8}, {37,5}, {49,5}, {49,10}, {57,10}, {57,8}, {59,8}, {59,-1}},
|
{14, {0,10}, {c="a",a="Route 3"}, {c="catchFlier"}, {c="pp",on=true}, {s="battleModeSet"}, {8,10}, {8,8}, {11,8}, {11,6}, {s="bugCatcher"}, {11,4}, {12,4}, {s="potion",hp=19}, {13,4}, {s="talk",dir="Right"}, {s="shortsKid"}, {s="tweetAfterBrock"}, {13,5}, {s="potionBeforeCocoons"}, {18,5}, {s="talk",dir="Right"}, {s="swapMove",move="horn_attack",to=0}, {18,6}, {22,6}, {22,5}, {s="potion",hp=4}, {24,5}, {s="talk",dir="Down"}, {s="fightMetapod"}, {27,5}, {27,9}, {s="catchFlierBackup"}, {37,8}, {37,5}, {49,5}, {49,10}, {57,10}, {57,8}, {59,8}, {59,-1}},
|
||||||
-- To the Center
|
-- To the Center
|
||||||
{15, {9,16}, {c="pp",on=false}, {12,16}, {12,6}, {11,6}, {11,5}},
|
{15, {9,16}, {c="pp",on=false}, {12,16}, {12,6}, {11,6}, {11,5}},
|
||||||
-- PP up
|
-- PP up
|
||||||
|
@ -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"}, {10,32}, {10,29}, {s="potion",hp=12,yolo=10}, {s="talk",dir="Up"}, {11,29}, {11,27}, {s="rareCandyEarly",close=true}, {s="potion",hp=10,yolo=8,close=true}, {11,26}, {s="talk",dir="Up"}, {10,26}, {10,24}, {s="teachThrash"}, {s="potion",hp=4}, {10,23}, {s="talk",dir="Up"}, {11,23}, {11,21}, {s="teachThrash"}, {s="potionForMankey"}, {11,20}, {s="talk",dir="Up"}, {s="redbarMankey"}, {10,20}, {10,19}, {s="teachThrash"}, {10,15}, {s="learnThrash"}, {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",close=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="redbarMankey"}, {s="swapThrash"}, {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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue