Cleanup
This commit is contained in:
parent
33c43b3e88
commit
099c11291a
|
@ -495,7 +495,7 @@ strategyFunctions.fightBrock = function()
|
||||||
if status.tries < 1 then
|
if status.tries < 1 then
|
||||||
status.tries = 1
|
status.tries = 1
|
||||||
end
|
end
|
||||||
local bubble, turnsToKill, turnsToDie = Combat.bestMove()
|
local __, turnsToKill, turnsToDie = Combat.bestMove()
|
||||||
if not Pokemon.isDeployed("squirtle") then
|
if not Pokemon.isDeployed("squirtle") then
|
||||||
Battle.swap("squirtle")
|
Battle.swap("squirtle")
|
||||||
elseif turnsToDie and turnsToDie < 2 and Inventory.contains("potion") then
|
elseif turnsToDie and turnsToDie < 2 and Inventory.contains("potion") then
|
||||||
|
@ -729,8 +729,8 @@ strategyFunctions.rivalSandAttack = function(data)
|
||||||
if Memory.value("battle", "accuracy") < 7 then
|
if Memory.value("battle", "accuracy") < 7 then
|
||||||
local sacrifice
|
local sacrifice
|
||||||
if opponent == "pidgeotto" then
|
if opponent == "pidgeotto" then
|
||||||
local __, turns = Combat.bestMove()
|
local __, turnsToKill = Combat.bestMove()
|
||||||
if turns == 1 then
|
if turnsToKill == 1 then
|
||||||
sacrifice = Pokemon.getSacrifice("pidgey", "spearow", "paras", "oddish", "squirtle")
|
sacrifice = Pokemon.getSacrifice("pidgey", "spearow", "paras", "oddish", "squirtle")
|
||||||
end
|
end
|
||||||
elseif opponent == "raticate" then
|
elseif opponent == "raticate" then
|
||||||
|
|
|
@ -543,10 +543,10 @@ Strategies.functions = {
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if not status.unavailable and data.item ~= "carbos" and not Inventory.contains(data.item) then
|
if not status.checked and data.item ~= "carbos" and not Inventory.contains(data.item) then
|
||||||
status.unavailable = true
|
|
||||||
print("No "..data.item.." available!")
|
print("No "..data.item.." available!")
|
||||||
end
|
end
|
||||||
|
status.checked = true
|
||||||
return Strategies.useItem(data)
|
return Strategies.useItem(data)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -565,6 +565,7 @@ Strategies.functions = {
|
||||||
if type(toHP) == "string" then
|
if type(toHP) == "string" then
|
||||||
toHP = Combat.healthFor(toHP)
|
toHP = Combat.healthFor(toHP)
|
||||||
end
|
end
|
||||||
|
toHP = math.min(toHP, Pokemon.index(0, "max_hp"))
|
||||||
local toHeal = toHP - curr_hp
|
local toHeal = toHP - curr_hp
|
||||||
if toHeal > 0 then
|
if toHeal > 0 then
|
||||||
local toPotion
|
local toPotion
|
||||||
|
@ -1076,13 +1077,16 @@ Strategies.functions = {
|
||||||
|
|
||||||
rareCandyEarly = function(data)
|
rareCandyEarly = function(data)
|
||||||
if Strategies.initialize() then
|
if Strategies.initialize() then
|
||||||
p("RCE", Pokemon.getExp())
|
if Pokemon.info("nidoking", "level") ~= 20 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
if yellow then
|
if yellow then
|
||||||
|
p("RCE", Pokemon.getExp())
|
||||||
if Pokemon.getExp() > 5500 then --TODO
|
if Pokemon.getExp() > 5500 then --TODO
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if Pokemon.info("nidoking", "level") ~= 20 or Pokemon.getExp() > 5550 then
|
if Pokemon.getExp() > 5550 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1165,13 +1169,12 @@ Strategies.functions = {
|
||||||
local curr_hp, red_hp = Combat.hp(), Combat.redHP()
|
local curr_hp, red_hp = Combat.hp(), Combat.redHP()
|
||||||
local clubDmg = enemyMove.damage
|
local clubDmg = enemyMove.damage
|
||||||
local afterHit = curr_hp - clubDmg
|
local afterHit = curr_hp - clubDmg
|
||||||
red_hp = red_hp - 2
|
|
||||||
local acceptableHealth = Control.yolo and -1 or 1
|
local acceptableHealth = Control.yolo and -1 or 1
|
||||||
if afterHit >= acceptableHealth and afterHit < red_hp then
|
if afterHit >= acceptableHealth and afterHit < red_hp - 2 then
|
||||||
forced = "thunderbolt"
|
forced = "thunderbolt"
|
||||||
else
|
else
|
||||||
afterHit = afterHit - clubDmg
|
afterHit = afterHit - clubDmg
|
||||||
if afterHit > 1 and afterHit < red_hp then
|
if afterHit > 1 and afterHit < red_hp - 4 then
|
||||||
forced = "thunderbolt"
|
forced = "thunderbolt"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1589,7 +1592,7 @@ function Strategies.execute(data)
|
||||||
Strategies.status = status
|
Strategies.status = status
|
||||||
Strategies.completeGameStrategy()
|
Strategies.completeGameStrategy()
|
||||||
if yellow then
|
if yellow then
|
||||||
print(data.s)
|
-- print(data.s)
|
||||||
end
|
end
|
||||||
if resetting then
|
if resetting then
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -420,7 +420,7 @@ local Paths = {
|
||||||
-- F3
|
-- F3
|
||||||
{198, {23,7}, {23,6}, {22,6}, {22,4}, {s="skill",move="strength"}, {22,2}, {23,2}, {23,1}, {7,1}, {7,0}, {6,0}, {6,1}, {7,1}, {7,2}, {3,2}, {3,1}, {2,1}, {2,4}, {1,4}, {1,5}, {2,5}, {2,4}, {4,4}, {4,2}, {7,2}, {7,1}, {20,1}, {20,6}, {17,6}, {17,4}, {9,4}, {9,10}, {5,10}, {5,8}, {1,8}, {1,15}, {11,15}, {11,16}, {20,16}, {20,15}, {23,15}},
|
{198, {23,7}, {23,6}, {22,6}, {22,4}, {s="skill",move="strength"}, {22,2}, {23,2}, {23,1}, {7,1}, {7,0}, {6,0}, {6,1}, {7,1}, {7,2}, {3,2}, {3,1}, {2,1}, {2,4}, {1,4}, {1,5}, {2,5}, {2,4}, {4,4}, {4,2}, {7,2}, {7,1}, {20,1}, {20,6}, {17,6}, {17,4}, {9,4}, {9,10}, {5,10}, {5,8}, {1,8}, {1,15}, {11,15}, {11,16}, {20,16}, {20,15}, {23,15}},
|
||||||
-- F2
|
-- F2
|
||||||
{194, {22,16}, {s="potionBeforeLorelei"}, {s="item",item="super_repel",chain=true}, {s="skill",move="strength"}, {s="bicycle"}, {22,17}, {24,17}, {24,16}, {11,16}, {s="push",dir="Left",x=0x02D5,y=0x02D4}, {21,16}, {21,14}, {25,14}},
|
{194, {22,16}, {s="potionBeforeLorelei"}, {s="item",item="super_repel",chain=true}, {s="skill",move="strength",chain=true}, {s="bicycle"}, {22,17}, {24,17}, {24,16}, {11,16}, {s="push",dir="Left",x=0x02D5,y=0x02D4}, {21,16}, {21,14}, {25,14}},
|
||||||
-- F3
|
-- F3
|
||||||
{198, {27,15}, {27,8}, {26,8}},
|
{198, {27,15}, {27,8}, {26,8}},
|
||||||
-- F2 Exit
|
-- F2 Exit
|
||||||
|
|
|
@ -71,7 +71,7 @@ function Settings.startNewAdventure(startWait)
|
||||||
Menu.select(0)
|
Menu.select(0)
|
||||||
end
|
end
|
||||||
elseif math.random(0, startWait) == 0 then
|
elseif math.random(0, startWait) == 0 then
|
||||||
Input.press("Start")
|
Input.press("Start", 2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue