Add skip water gun strategy

This commit is contained in:
Kyle Coburn 2015-01-19 17:11:52 -08:00
parent 619c9d295e
commit 47a3d1f3c4
3 changed files with 83 additions and 66 deletions

View File

@ -14,16 +14,16 @@ local pokemon = require "storage.pokemon"
local game_controls local game_controls
local shouldFight, minExp, skipHiker local shouldFight, minExp
local shouldCatch, attackIdx local shouldCatch, attackIdx
local encounters = 0, extraEncounter local encounters = 0, extraEncounter
local potionIn = true local potionInBattle = true
local fightEncounter, caveFights = 0, 0 local fightEncounter, caveFights = 0, 0
local maxEncounters local maxEncounters
local isYolo, battleYolo local isYolo, battleYolo
local function battlePotion(enable) local function battlePotion(enable)
potionIn = enable potionInBattle = enable
end end
control.battlePotion = battlePotion control.battlePotion = battlePotion
@ -73,24 +73,19 @@ local controlFunctions = {
end, end,
moon1Exp = function() moon1Exp = function()
if (skipHiker) then
minExp = 2704 minExp = 2704
shouldFight = {{name="zubat",lvl={9,10}}, {name="geodude"}} shouldFight = {{name="zubat",lvl={9,10}}}
oneHits = true oneHits = true
end
end, end,
moon2Exp = function() moon2Exp = function()
if (skipHiker) then
minExp = 3011 minExp = 3011
shouldFight = {{name="zubat"}, {name="geodude"}, {name="paras"}} shouldFight = {{name="zubat"}, {name="paras"}}
end
end, end,
moon3Exp = function() moon3Exp = function()
if (skipHiker) then
minExp = 3798 minExp = 3798
end shouldFight = {{name="zubat"}, {name="geodude",lvl={9}}, {name="paras"}} --TODO geodude?
end, end,
catchNidoran = function() catchNidoran = function()
@ -199,7 +194,7 @@ end
-- Items -- Items
function control.canRecover() function control.canRecover()
return potionIn and (not battleYolo or not isYolo) return potionInBattle and (not battleYolo or not isYolo)
end end
function control.set(data) function control.set(data)
@ -211,18 +206,13 @@ function control.setYolo(enabled)
end end
function control.setPotion(enabled) function control.setPotion(enabled)
potionIn = enabled potionInBattle = enabled
end end
function control.encounters() function control.encounters()
return encounters return encounters
end end
function control.mtMoonExp()
print("Skipping Hiker strats")
skipHiker = true
end
function control.wildEncounter() function control.wildEncounter()
encounters = encounters + 1 encounters = encounters + 1
paint.wildEncounters(encounters) paint.wildEncounters(encounters)
@ -234,8 +224,7 @@ function control.reset()
shouldCatch = nil shouldCatch = nil
shouldFight = nil shouldFight = nil
extraEncounter = nil extraEncounter = nil
skipHiker = false potionInBattle = true
potionIn = true
encounters = 0 encounters = 0
fightEncounter = 0 fightEncounter = 0
caveFights = 0 caveFights = 0

View File

@ -25,8 +25,10 @@ local areaName
local nidoAttack, nidoSpeed, nidoSpecial = 0, 0, 0 local nidoAttack, nidoSpeed, nidoSpecial = 0, 0, 0
local squirtleAtt, squirtleDef, squirtleSpd, squirtleScl local squirtleAtt, squirtleDef, squirtleSpd, squirtleScl
local deepRun, resetting local deepRun, resetting
local level4Nidoran = true local level4Nidoran = true -- 57 vs 96 (d39)
local skipHiker, yolo, riskGiovanni, maxEtherSkip local yolo, riskGiovanni, maxEtherSkip
-- Reset cutoff times
local timeRequirements = { local timeRequirements = {
mankey = function() mankey = function()
@ -400,6 +402,9 @@ local function nidoranDSum(disabled)
-- tries = {0, 0, 10} -- TODO can't escape -- tries = {0, 0, 10} -- TODO can't escape
end end
elseif (opName == "spearow") then elseif (opName == "spearow") then
if (opLevel == 5) then
-- can't escape
end
elseif (opName == "nidoran") then elseif (opName == "nidoran") then
tries = {0, 6, 12} tries = {0, 6, 12}
elseif (opName == "nidoranf") then elseif (opName == "nidoranf") then
@ -471,14 +476,31 @@ strategyFunctions = {
tweetMisty = function() tweetMisty = function()
local elt = paint.elapsedTime() local elt = paint.elapsedTime()
setYolo("misty") if (setYolo("misty")) then
print("Misty: "..elt) print("Misty: "..elt)
else
local timeReq = 40
if (pokemon.inParty("paras")) then
timeReq = timeReq + 0.75
end
timeReq = timeReq - 1.75
local pbn = "!"
if (not overMinute(timeReq)) then
pbn = " (PB pace)"
end
bridge.tweet("Got a run going, just beat Misty "..elt.." in"..pbn.." http://www.twitch.tv/thepokebot")
end
return true return true
end, end,
tweetVictoryRoad = function() tweetVictoryRoad = function()
local elt = paint.elapsedTime() local elt = paint.elapsedTime()
bridge.tweet("Entering Victory Road at "..elt.." on our way to the Elite Four! http://www.twitch.tv/thepokebot") local pbn = ""
if (not overMinute(98)) then -- TODO verify
pbn = " (PB pace)"
end
local elt = paint.elapsedTime()
bridge.tweet("Entering Victory Road at "..elt..pbn.." on our way to the Elite Four! http://www.twitch.tv/thepokebot")
return true return true
end, end,
@ -991,6 +1013,7 @@ strategyFunctions = {
if (turnsToKill) then if (turnsToKill) then
local forced local forced
if (turnsToDie < 2 or turnsToKill < 2 or tempDir - bideTurns > 1) then if (turnsToDie < 2 or turnsToKill < 2 or tempDir - bideTurns > 1) then
-- elseif (turnsToKill < 3 and tempDir == bideTurns) then
elseif (onixHP == canProgress) then elseif (onixHP == canProgress) then
forced = "tail_whip" forced = "tail_whip"
end end
@ -1205,10 +1228,6 @@ strategyFunctions = {
startMtMoon = function() startMtMoon = function()
strategies.moonEncounters = 0 strategies.moonEncounters = 0
strategies.canDie = nil strategies.canDie = nil
skipHiker = nidoAttack > 15 -- RISK or level4Nidoran
if (skipHiker) then
control.mtMoonExp()
end
return true return true
end, end,
@ -1236,27 +1255,6 @@ strategyFunctions = {
end end
end, end,
teachWaterGun = function()
if (battle.handleWild()) then
if (not pokemon.inParty("nidorino")) then
print("")
print("")
print("")
print("")
print("")
return reset("Did not evolve to Nidorino", pokemon.info("nidoran", "level"))
end
return strategyFunctions.teach({move="water_gun",replace="tackle"})
end
end,
fightHiker = function()
if (skipHiker) then
return true
end
return strategyFunctions.interact({dir="Left"})
end,
evolveNidoking = function() evolveNidoking = function()
if (battle.handleWild()) then if (battle.handleWild()) then
if (not inventory.contains("moon_stone")) then if (not inventory.contains("moon_stone")) then
@ -1312,9 +1310,6 @@ strategyFunctions = {
if (nidoAttack > 15 and nidoSpeed > 14) then if (nidoAttack > 15 and nidoSpeed > 14) then
timeLimit = timeLimit + 0.25 timeLimit = timeLimit + 0.25
end end
if (not skipHiker) then
timeLimit = timeLimit + 0.25
end
if (pokemon.inParty("paras")) then if (pokemon.inParty("paras")) then
timeLimit = timeLimit + 1.0 timeLimit = timeLimit + 1.0
end end
@ -1470,7 +1465,29 @@ strategyFunctions = {
end end
end, end,
thrashGeodude = function()
if (battle.isActive()) then
canProgress = true
if (pokemon.isOpponent("geodude") and pokemon.isDeployed("nidoking")) then
local sacrifice = pokemon.inParty("squirtle")
if (sacrifice and pokemon.info(sacrifice, "hp") > 0) then
battle.swap(sacrifice)
return false
end
end
battle.automate()
elseif (canProgress) then
return true
else
textbox.handle()
end
end,
potionBeforeGoldeen = function() potionBeforeGoldeen = function()
if (not STREAMING_MODE and nidoSpeed == 51) then
return false --TEST
end
if (initialize()) then if (initialize()) then
if (setYolo("goldeen") or pokemon.index(0, "hp") > 7) then if (setYolo("goldeen") or pokemon.index(0, "hp") > 7) then
return true return true
@ -1623,7 +1640,6 @@ strategyFunctions = {
local px, py = player.position() local px, py = player.position()
if (px == 4 and py == 6) then if (px == 4 and py == 6) then
tries = tries + 1 tries = tries + 1
local timeLimit = getTimeRequirement("trash") + 1 local timeLimit = getTimeRequirement("trash") + 1
if (resetTime(timeLimit, "complete Trashcans ("..tries.." tries)")) then if (resetTime(timeLimit, "complete Trashcans ("..tries.." tries)")) then
return true return true
@ -1642,7 +1658,7 @@ strategyFunctions = {
elseif (tries < 24) then elseif (tries < 24) then
prefix = "Ugh" prefix = "Ugh"
suffix = "." suffix = "."
else else -- TODO trashcans WR
prefix = "Reset me now" prefix = "Reset me now"
suffix = " BibleThump" suffix = " BibleThump"
end end
@ -2661,6 +2677,7 @@ strategyFunctions = {
end end
if (tries == 0) then if (tries == 0) then
bridge.tweet("Beat Pokemon Red in "..canProgress.."!") bridge.tweet("Beat Pokemon Red in "..canProgress.."!")
-- strategyFunctions.reportFrames()
if (strategies.seed) then if (strategies.seed) then
print(memory.value("game", "frames").." frames, with seed "..strategies.seed) print(memory.value("game", "frames").." frames, with seed "..strategies.seed)
print("Please save this seed number to share, if you would like proof of your run!") print("Please save this seed number to share, if you would like proof of your run!")
@ -2691,6 +2708,14 @@ function strategies.execute(data)
end end
function strategies.init(midGame) function strategies.init(midGame)
if (not STREAMING_MODE) then --TODO remove
-- setYolo(0)
nidoAttack = 55
nidoSpeed = 50
nidoSpecial = 45
riskGiovanni = true
print(nidoAttack.." x "..nidoSpeed.." "..nidoSpecial)
end
if (midGame) then if (midGame) then
combat.factorPP(true) combat.factorPP(true)
end end

View File

@ -42,7 +42,7 @@ local paths = {
-- 2: NIDORAN -- 2: NIDORAN
-- Out of Viridian City -- Out of Viridian City
{1, {0,17}, {16,17}, {16,16}, {18,16}, {18,6}, {s="dodgeViridianOldMan"}, {17, 0}, {17, -1}}, {1, {0,17}, {c="encounters",limit=10,extra="spearow"}, {16,17}, {16,16}, {18,16}, {18,6}, {s="dodgeViridianOldMan"}, {17, 0}, {17, -1}},
-- To the Forest -- To the Forest
{13, {7,71}, {7,57}, {4,57}, {4,52}, {10,52}, {10,44}, {3,44}, {3,43}}, {13, {7,71}, {7,57}, {4,57}, {4,52}, {10,52}, {10,44}, {3,44}, {3,43}},
-- Forest entrance -- Forest entrance
@ -78,11 +78,11 @@ local paths = {
-- 4: ROUTE 3 -- 4: ROUTE 3
-- Mt. Moon F1 -- Mt. Moon F1
{59, {14,35}, {s="startMtMoon"}, {c="catchParas"}, {14,29}, {5,29}, {5,31}, {s="interact",dir="Down"}, {5,26}, {14,26}, {14,22}, {21,22}, {21,15}, {24,15}, {24,27}, {25,27}, {25,31}, {s="interact",dir="Left"}, {25,32}, {33,32}, {33,31}, {34,31}, {s="interact",dir="Right"}, {34,7}, {30,7}, {s="evolveNidorino"}, {28,7}, {s="teachWaterGun"}, {c="moon1Exp"}, {16,7}, {16,17}, {7,17}, {7,6}, {6,6}, {s="fightHiker"}, {6,2}, {3,2}, {s="interact",dir="Left"}, {5,2}, {5,5}}, {59, {14,35}, {s="startMtMoon"}, {c="catchParas"}, {14,22}, {21,22}, {21,15}, {24,15}, {24,27}, {25,27}, {25,31}, {s="interact",dir="Left"}, {25,32}, {33,32}, {33,31}, {34,31}, {s="interact",dir="Right"}, {34,7}, {30,7}, {s="evolveNidorino"}, {c="moon1Exp"}, {28,7}, {16,7}, {16,17}, {2,17}, {2,3}, {s="interact",dir="Up"}, {5,3}, {5,5}},
-- Mt. Moon B2 -- Mt. Moon B2
{60, {5,5}, {5,17}, {21,17}}, {60, {5,5}, {5,17}, {21,17}},
-- Mt. Moon B3 -- Mt. Moon B3
{61, {21,17}, {23,17}, {23,14}, {27,14}, {27,16}, {33,16}, {33,14}, {36,14}, {36,24}, {32, 24}, {32,31}, {10,31}, {10,18}, {s="evolveNidoking"}, {c="encounters",limit=nil}, {10,17}, {12,17}, {c="moon2Exp"}, {13,17}, {13,15}, {s="potion",hp=7}, {13,7}, {c="moon3Exp"}, {s="helix"}, {13,4}, {3,4}, {3,7}, {5,7}}, {61, {21,17}, {23,17}, {23,14}, {27,14}, {27,16}, {33,16}, {33,14}, {36,14}, {36,24}, {32, 24}, {32,31}, {10,31}, {10,18}, {s="evolveNidoking"}, {c="encounters",limit=nil}, {10,17}, {12,17}, {c="moon2Exp"}, {12,9}, {s="potion",hp=7}, {s="interact",dir="Up"}, {13,9}, {c="moon3Exp"}, {13,7}, {s="helix"}, {13,5}, {12,5}, {12,4}, {3,4}, {3,7}, {5,7}},
-- Mt. Moon escape -- Mt. Moon escape
{60, {23,3}, {27,3}}, {60, {23,3}, {27,3}},
@ -110,7 +110,7 @@ local paths = {
-- 6: NUGGET BRIDGE -- 6: NUGGET BRIDGE
-- To Bill's -- To Bill's
{36, {0,8}, {9,8}, {9,7}, {11,7}, {11,9}, {14,9}, {14,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}, {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}},
-- 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
@ -135,12 +135,12 @@ local paths = {
-- Underground exit -- Underground exit
{74, {4,4}, {3,8}}, {74, {4,4}, {3,8}},
-- Oddish -- Oddish
-- TODO Bubblebeam split {17, {17,14}, {s="a",a="Vermilion City"}, {c="catchOddish"}, {17,15}, {s="potion",hp=9,yolo=5}, {17,19}, {s="catchOddish"}, {11,29}, {s="potion",hp=9,yolo=5}, {11,29}, {s="waitToFight",dir="Down"}, {10,29}, {10,30}, {s="potion",hp=9,yolo=5}, {10,31}, {9,31}, {9,32}, {s="potion",hp=20,yolo=18,chain=true}, {9,36}},
{17, {17,14}, {s="a",a="Vermilion City"}, {c="catchOddish"}, {17,15}, {s="potion",hp=9,yolo=5}, {17,19}, {s="catchOddish"}, {11,29}, {s="potion",hp=9,yolo=5}, {11,29}, {s="waitToFight",dir="Down"}, {10,29}, {10,30}, {s="potion",hp=9,yolo=5}, {10,31}, {9,31}, {9,32}, {s="potion",hp=20,yolo=18,chain=true}, {s="teach",move="bubblebeam",replace="water_gun"}, {9,36}},
-- Enter Vermilion -- Enter Vermilion
{5, {19,0}, {c="disableCatch"}, {19,6}, {21,6}, {21,14}, {23,14}, {23,13}}, {5, {19,0}, {c="disableCatch"}, {19,6}, {21,6}, {21,14}, {23,14}, {23,13}},
-- Vermilion mart -- Vermilion mart
{91, {3,7}, {3,5}, {2,5}, {s="vermilionMart"}, {3,5}, {3,8}}, -- TODO Bubblebeam split?
{91, {3,7}, {3,5}, {2,5}, {s="vermilionMart"}, {3,5}, {s="teach",move="bubblebeam",replace="tackle"}, {3,8}},
-- To S.S. Anne -- To S.S. Anne
{5, {23,14}, {30,14}, {30,26}, {18,26}, {18,31}}, {5, {23,14}, {30,14}, {30,26}, {18,26}, {18,31}},
-- Mew -- Mew
@ -205,6 +205,7 @@ local paths = {
-- Celadon -- Celadon
{6, {49,11}, {s="a",a="Celadon Mart"}, {14,11}, {14,14}, {10,14}, {10,13}}, {6, {49,11}, {s="a",a="Celadon Mart"}, {14,11}, {14,14}, {10,14}, {10,13}},
-- Department store -- Department store
--TODO elevator down
{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}, {16,2}, {16,1}}, {123, {12,2}, {16,2}, {16,1}},
@ -392,6 +393,7 @@ local paths = {
-- Saffron again -- Saffron again
{10, {0,18}, {3,18}, {3,6}, {31,6}, {31,4}, {34,4}, {34,3}}, {10, {0,18}, {3,18}, {3,6}, {31,6}, {31,4}, {34,4}, {34,3}},
-- Sabrina -- Sabrina
--TODO verify strats
{178, {8,17}, {s="a",a="Sabrina's Gym"}, {8,16}, {11,16}, {11,15}, {16,17}, {16,15}, {15,15}, {18,3}, {18,5}, {15,5}, {1,5}, {11,11}, {11,8}, {10,8}, {s="waitToFight",dir="Left"}, {s="split"}, {11,8}, {11,11}, {s="earthquakeElixer",min=4,chain=true}, {s="skill",move="dig",map=178}}, {178, {8,17}, {s="a",a="Sabrina's Gym"}, {8,16}, {11,16}, {11,15}, {16,17}, {16,15}, {15,15}, {18,3}, {18,5}, {15,5}, {1,5}, {11,11}, {11,8}, {10,8}, {s="waitToFight",dir="Left"}, {s="split"}, {11,8}, {11,11}, {s="earthquakeElixer",min=4,chain=true}, {s="skill",move="dig",map=178}},
-- 15: SABRINA -- 15: SABRINA
@ -401,6 +403,7 @@ local paths = {
-- Viridian again -- Viridian again
{1, {23,26}, {s="bicycle"}, {19,26}, {19,4}, {27,4}, {27,3}, {34,3}, {34,8}, {32,8}, {32,7}}, {1, {23,26}, {s="bicycle"}, {19,26}, {19,4}, {27,4}, {27,3}, {34,3}, {34,8}, {32,8}, {32,7}},
-- Giovanni Gym -- Giovanni Gym
--TODO reeval earthquake machoke
{45, {16,17}, {c="potion",b=false}, {s="a",a="Giovanni's Gym"}, {16,16}, {14,16}, {14,9}, {13,9}, {13,7}, {15,7}, {15,4}, {12,4}, {12,5}, {10,5}, {s="a",a="Machoke"}, {10,4}, {s="fightGiovanniMachoke"}, {10,5}, {s="a",a="Giovanni's Gym"}, {13,5}, {13,4}, {15,4}, {15,7}, {13,7}, {13,11}, {14,11}, {14,16}, {16,16}, {16,18}}, {45, {16,17}, {c="potion",b=false}, {s="a",a="Giovanni's Gym"}, {16,16}, {14,16}, {14,9}, {13,9}, {13,7}, {15,7}, {15,4}, {12,4}, {12,5}, {10,5}, {s="a",a="Machoke"}, {10,4}, {s="fightGiovanniMachoke"}, {10,5}, {s="a",a="Giovanni's Gym"}, {13,5}, {13,4}, {15,4}, {15,7}, {13,7}, {13,11}, {14,11}, {14,16}, {16,16}, {16,18}},
-- Reset Gym -- Reset Gym
{1, {32,8}, {32,7}}, {1, {32,8}, {32,7}},