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

View File

@ -25,8 +25,10 @@ local areaName
local nidoAttack, nidoSpeed, nidoSpecial = 0, 0, 0
local squirtleAtt, squirtleDef, squirtleSpd, squirtleScl
local deepRun, resetting
local level4Nidoran = true
local skipHiker, yolo, riskGiovanni, maxEtherSkip
local level4Nidoran = true -- 57 vs 96 (d39)
local yolo, riskGiovanni, maxEtherSkip
-- Reset cutoff times
local timeRequirements = {
mankey = function()
@ -400,6 +402,9 @@ local function nidoranDSum(disabled)
-- tries = {0, 0, 10} -- TODO can't escape
end
elseif (opName == "spearow") then
if (opLevel == 5) then
-- can't escape
end
elseif (opName == "nidoran") then
tries = {0, 6, 12}
elseif (opName == "nidoranf") then
@ -471,14 +476,31 @@ strategyFunctions = {
tweetMisty = function()
local elt = paint.elapsedTime()
setYolo("misty")
print("Misty: "..elt)
if (setYolo("misty")) then
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
end,
tweetVictoryRoad = function()
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
end,
@ -991,6 +1013,7 @@ strategyFunctions = {
if (turnsToKill) then
local forced
if (turnsToDie < 2 or turnsToKill < 2 or tempDir - bideTurns > 1) then
-- elseif (turnsToKill < 3 and tempDir == bideTurns) then
elseif (onixHP == canProgress) then
forced = "tail_whip"
end
@ -1205,10 +1228,6 @@ strategyFunctions = {
startMtMoon = function()
strategies.moonEncounters = 0
strategies.canDie = nil
skipHiker = nidoAttack > 15 -- RISK or level4Nidoran
if (skipHiker) then
control.mtMoonExp()
end
return true
end,
@ -1236,27 +1255,6 @@ strategyFunctions = {
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()
if (battle.handleWild()) then
if (not inventory.contains("moon_stone")) then
@ -1312,9 +1310,6 @@ strategyFunctions = {
if (nidoAttack > 15 and nidoSpeed > 14) then
timeLimit = timeLimit + 0.25
end
if (not skipHiker) then
timeLimit = timeLimit + 0.25
end
if (pokemon.inParty("paras")) then
timeLimit = timeLimit + 1.0
end
@ -1470,7 +1465,29 @@ strategyFunctions = {
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()
if (not STREAMING_MODE and nidoSpeed == 51) then
return false --TEST
end
if (initialize()) then
if (setYolo("goldeen") or pokemon.index(0, "hp") > 7) then
return true
@ -1623,7 +1640,6 @@ strategyFunctions = {
local px, py = player.position()
if (px == 4 and py == 6) then
tries = tries + 1
local timeLimit = getTimeRequirement("trash") + 1
if (resetTime(timeLimit, "complete Trashcans ("..tries.." tries)")) then
return true
@ -1642,7 +1658,7 @@ strategyFunctions = {
elseif (tries < 24) then
prefix = "Ugh"
suffix = "."
else
else -- TODO trashcans WR
prefix = "Reset me now"
suffix = " BibleThump"
end
@ -2661,6 +2677,7 @@ strategyFunctions = {
end
if (tries == 0) then
bridge.tweet("Beat Pokemon Red in "..canProgress.."!")
-- strategyFunctions.reportFrames()
if (strategies.seed) then
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!")
@ -2691,6 +2708,14 @@ function strategies.execute(data)
end
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
combat.factorPP(true)
end

View File

@ -42,7 +42,7 @@ local paths = {
-- 2: NIDORAN
-- 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
{13, {7,71}, {7,57}, {4,57}, {4,52}, {10,52}, {10,44}, {3,44}, {3,43}},
-- Forest entrance
@ -78,11 +78,11 @@ local paths = {
-- 4: ROUTE 3
-- 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
{60, {5,5}, {5,17}, {21,17}},
-- 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
{60, {23,3}, {27,3}},
@ -110,7 +110,7 @@ local paths = {
-- 6: NUGGET BRIDGE
-- 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
{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
@ -135,12 +135,12 @@ local paths = {
-- Underground exit
{74, {4,4}, {3,8}},
-- 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}, {s="teach",move="bubblebeam",replace="water_gun"}, {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}, {9,36}},
-- Enter Vermilion
{5, {19,0}, {c="disableCatch"}, {19,6}, {21,6}, {21,14}, {23,14}, {23,13}},
-- 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
{5, {23,14}, {30,14}, {30,26}, {18,26}, {18,31}},
-- Mew
@ -205,6 +205,7 @@ local paths = {
-- Celadon
{6, {49,11}, {s="a",a="Celadon Mart"}, {14,11}, {14,14}, {10,14}, {10,13}},
-- Department store
--TODO elevator down
{122, {16,7}, {c="potion",b=true,yolo=true}, {c="pp",on=true}, {16,3}, {12,3}, {12,1}},
-- F2
{123, {12,2}, {16,2}, {16,1}},
@ -392,6 +393,7 @@ local paths = {
-- Saffron again
{10, {0,18}, {3,18}, {3,6}, {31,6}, {31,4}, {34,4}, {34,3}},
-- 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}},
-- 15: SABRINA
@ -401,6 +403,7 @@ local paths = {
-- Viridian again
{1, {23,26}, {s="bicycle"}, {19,26}, {19,4}, {27,4}, {27,3}, {34,3}, {34,8}, {32,8}, {32,7}},
-- 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}},
-- Reset Gym
{1, {32,8}, {32,7}},