Describe PB runs, use specific status variable to avoid collisions on Strategies.initialized

This commit is contained in:
Kyle Coburn 2015-04-15 13:20:29 -07:00
parent 19e3874f80
commit 245ff23c7a
3 changed files with 35 additions and 19 deletions

View File

@ -122,6 +122,10 @@ Strategies.timeRequirements = {
return 108.5
end,
champion = function() --PB
return 110.22
end,
}
-- HELPERS
@ -904,7 +908,8 @@ strategyFunctions.potionBeforeMisty = function(data)
end
healAmount = healAmount - (stats.nidoran.special - 43)
if Strategies.initialize() then
if not status.healed then
status.healed = true
local message
local potionCount = Inventory.count("potion")
local needsToHeal = healAmount - Pokemon.index(0, "hp")
@ -1940,7 +1945,8 @@ strategyFunctions.blue = function()
if Memory.value("battle", "attack_turns") > 0 then
local skyDamage = Combat.healthFor("BlueSky")
local healCutoff = skyDamage * 0.825
if Strategies.initialize() then
if not status.skyAttacked then
status.skyAttacked = true
if not Strategies.isPrepared("x_accuracy", status.xItem) then
local msg = " Uh oh... First-turn Sky Attack could end the run here, "
if Pokemon.index(0, "hp") > skyDamage then

View File

@ -627,7 +627,8 @@ Strategies.functions = {
return true
end
else
if Strategies.initialize() then
if not status.triedTeaching then
status.triedTeaching = true
if not Inventory.contains(itemName) then
return Strategies.reset("Unable to teach move "..itemName.." to "..data.poke, nil, true)
end
@ -702,25 +703,26 @@ Strategies.functions = {
end,
swap = function(data)
if Strategies.initialize() then
if not Inventory.contains(data.item) then
return true
end
local itemIndex = data.item
if type(itemIndex) == "string" then
itemIndex = Inventory.indexOf(itemIndex)
end
local itemIndex = Inventory.indexOf(data.item)
local destIndex = data.dest
local hasSwappedItems
if type(destIndex) == "string" then
destIndex = Inventory.indexOf(destIndex)
if destIndex < 0 then
p("Not available to swap", data.item, data.dest)
return true
end
hasSwappedItems = itemIndex < destIndex
else
hasSwappedItems = itemIndex == destIndex
end
if hasSwappedItems then
local swapComplete
if itemIndex < 0 or destIndex < 0 then
swapComplete = true
if not status.swapUnavailable then
status.swapUnavailable = true
p("Not available to swap", data.item, data.dest, itemIndex, destIndex)
end
else
swapComplete = itemIndex == destIndex
end
if swapComplete then
if Strategies.closeMenuFor(data) then
return true
end
@ -1543,7 +1545,11 @@ Strategies.functions = {
if status.finishTime then
if not status.frames then
status.frames = 0
Strategies.tweetProgress("Beat Pokemon "..Utils.capitalize(GAME_NAME).." in "..status.finishTime.."!")
local victoryMessage = "Beat Pokemon "..Utils.capitalize(GAME_NAME).." in "..status.finishTime
if not Strategies.overMinute("champion") then
victoryMessage = victoryMessage..", a new PB!"
end
Strategies.tweetProgress(victoryMessage)
if Strategies.seed then
print("v"..VERSION..": "..Utils.frames().." frames, with seed "..Strategies.seed)
print("Please save this seed number to share, if you would like proof of your run!")

View File

@ -56,7 +56,11 @@ Strategies.timeRequirements = {
end,
victory_road = function() --PB
return 102
return 105
end,
champion = function() --PB
return 120
end,
}