Add Moon encounters guessing
This commit is contained in:
parent
e06f44921c
commit
20e6eb23b9
|
@ -100,6 +100,7 @@ local controlFunctions = {
|
||||||
startMtMoon = function()
|
startMtMoon = function()
|
||||||
Control.canDie(false)
|
Control.canDie(false)
|
||||||
Control.getMoonExp = not Data.yellow
|
Control.getMoonExp = not Data.yellow
|
||||||
|
Bridge.moonGuesses(false)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
moon1Exp = function()
|
moon1Exp = function()
|
||||||
|
|
|
@ -261,6 +261,7 @@ local strategyFunctions = Strategies.functions
|
||||||
-- General
|
-- General
|
||||||
|
|
||||||
strategyFunctions.tweetAfterBrock = function()
|
strategyFunctions.tweetAfterBrock = function()
|
||||||
|
Bridge.moonGuesses(true)
|
||||||
if stats.nidoran.rating < 2 then
|
if stats.nidoran.rating < 2 then
|
||||||
if not Strategies.overMinute("shorts") then
|
if not Strategies.overMinute("shorts") then
|
||||||
Strategies.tweetProgress("On pace after Brock with a great Nidoran", "brock")
|
Strategies.tweetProgress("On pace after Brock with a great Nidoran", "brock")
|
||||||
|
@ -342,7 +343,7 @@ strategyFunctions.fightBulbasaur = function()
|
||||||
end
|
end
|
||||||
if Battle.isActive() and Battle.opponentAlive() then
|
if Battle.isActive() and Battle.opponentAlive() then
|
||||||
local attack = Memory.double("battle", "our_attack")
|
local attack = Memory.double("battle", "our_attack")
|
||||||
if attack > 0 and not status.growled then
|
if attack > 0 and RESET_FOR_TIME and not status.growled then
|
||||||
if attack ~= status.attack then
|
if attack ~= status.attack then
|
||||||
-- p(attack, Memory.double("battle", "opponent_hp"))
|
-- p(attack, Memory.double("battle", "opponent_hp"))
|
||||||
status.attack = attack
|
status.attack = attack
|
||||||
|
@ -413,21 +414,20 @@ strategyFunctions.catchNidoran = function()
|
||||||
message = "fight an encounter for experience"
|
message = "fight an encounter for experience"
|
||||||
resetLimit = resetLimit + 0.15
|
resetLimit = resetLimit + 0.15
|
||||||
else
|
else
|
||||||
local catchTarget
|
|
||||||
if catchableNidoran or opponent == "spearow" then
|
if catchableNidoran or opponent == "spearow" then
|
||||||
resetLimit = resetLimit + 0.15
|
resetLimit = resetLimit + 0.15
|
||||||
catchTarget = Utils.capitalize(opponent)
|
message = Utils.capitalize(opponent)
|
||||||
else
|
else
|
||||||
resetLimit = resetLimit - 0.1
|
resetLimit = resetLimit - 0.1
|
||||||
if Data.run.encounters_rattata and Data.run.encounters_rattata >= 4 then
|
if opponent == "rattata" and Data.run.encounters_rattata and Data.run.encounters_rattata >= 4 then
|
||||||
message = "Death by Rattata"
|
message = "Death by Rattata"
|
||||||
customReason = true
|
customReason = true
|
||||||
else
|
else
|
||||||
catchTarget = "Nidoran"
|
message = "Nidoran"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if catchTarget then
|
if not customReason then
|
||||||
message = "catch "..catchTarget
|
message = "catch "..message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Strategies.resetTime(resetLimit, message, customReason) then
|
if Strategies.resetTime(resetLimit, message, customReason) then
|
||||||
|
@ -462,17 +462,14 @@ strategyFunctions.catchNidoran = function()
|
||||||
enableDSum = false
|
enableDSum = false
|
||||||
end
|
end
|
||||||
|
|
||||||
local resetMessage, customReason
|
local resetMessage
|
||||||
if hasNidoran then
|
if hasNidoran then
|
||||||
resetMessage = "get an encounter for experience before Brock"
|
resetMessage = "get an encounter for experience before Brock"
|
||||||
elseif Data.run.encounters_rattata and Data.run.encounters_rattata >= 4 then
|
|
||||||
resetMessage = "Death by Rattata"
|
|
||||||
customReason = true
|
|
||||||
else
|
else
|
||||||
resetMessage = "find a suitable Nidoran"
|
resetMessage = "find a suitable Nidoran"
|
||||||
end
|
end
|
||||||
local resetLimit = Strategies.getTimeRequirement("nidoran")
|
local resetLimit = Strategies.getTimeRequirement("nidoran")
|
||||||
if Strategies.resetTime(resetLimit, resetMessage, customReason) then
|
if Strategies.resetTime(resetLimit, resetMessage) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
if enableDSum then
|
if enableDSum then
|
||||||
|
@ -493,14 +490,16 @@ strategyFunctions.grabTreePotion = function()
|
||||||
if Strategies.setYolo("old_man") then
|
if Strategies.setYolo("old_man") then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
if RESET_FOR_TIME then
|
||||||
local current = Utils.igt()
|
local current = Utils.igt()
|
||||||
local limit = Strategies.getTimeRequirement("old_man") * 60
|
local limit = Strategies.getTimeRequirement("old_man") * 60
|
||||||
local diff = math.floor((limit - current) / 6)
|
local diff = math.floor((limit - current) / 5)
|
||||||
p("grab", diff)
|
p("grab", diff)
|
||||||
if Pokemon.info("squirtle", "hp") > 12 + diff then
|
if Pokemon.info("squirtle", "hp") > 13 + diff then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if Inventory.contains("potion") then
|
if Inventory.contains("potion") then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -799,8 +798,6 @@ end
|
||||||
|
|
||||||
-- 4: ROUTE 3
|
-- 4: ROUTE 3
|
||||||
|
|
||||||
-- startMtMoon
|
|
||||||
|
|
||||||
-- evolveNidorino
|
-- evolveNidorino
|
||||||
|
|
||||||
-- evolveNidoking
|
-- evolveNidoking
|
||||||
|
|
|
@ -143,6 +143,10 @@ function Bridge.report(report)
|
||||||
send("report", json.encode(report))
|
send("report", json.encode(report))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Bridge.moonGuesses(enabled)
|
||||||
|
send("moon,"..(enabled and "on" or "off"))
|
||||||
|
end
|
||||||
|
|
||||||
function Bridge.reset()
|
function Bridge.reset()
|
||||||
send("reset")
|
send("reset")
|
||||||
timeStopped = false
|
timeStopped = false
|
||||||
|
|
Loading…
Reference in New Issue