Fix resetting strategy status table
This commit is contained in:
parent
f01cb1368c
commit
b3bcb2ac3f
|
@ -25,6 +25,8 @@ local riskGiovanni, maxEtherSkip
|
||||||
|
|
||||||
local status = Strategies.status
|
local status = Strategies.status
|
||||||
|
|
||||||
|
-- TIME CONSTRAINTS
|
||||||
|
|
||||||
Strategies.timeRequirements = {
|
Strategies.timeRequirements = {
|
||||||
|
|
||||||
bulbasaur = function()
|
bulbasaur = function()
|
||||||
|
@ -1489,17 +1491,6 @@ strategyFunctions.lavenderRival = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
strategyFunctions.pokeDoll = function()
|
|
||||||
if Battle.isActive() then
|
|
||||||
status.canProgress = true
|
|
||||||
Inventory.use("pokedoll", nil, true)
|
|
||||||
elseif status.canProgress then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
Input.cancel()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
strategyFunctions.digFight = function()
|
strategyFunctions.digFight = function()
|
||||||
if Battle.isActive() then
|
if Battle.isActive() then
|
||||||
status.canProgress = true
|
status.canProgress = true
|
||||||
|
@ -1524,6 +1515,17 @@ strategyFunctions.digFight = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
strategyFunctions.pokeDoll = function()
|
||||||
|
if Battle.isActive() then
|
||||||
|
status.canProgress = true
|
||||||
|
Inventory.use("pokedoll", nil, true)
|
||||||
|
elseif status.canProgress then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
Input.cancel()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
strategyFunctions.thunderboltFirst = function()
|
strategyFunctions.thunderboltFirst = function()
|
||||||
local forced
|
local forced
|
||||||
if Pokemon.isOpponent("zubat") then
|
if Pokemon.isOpponent("zubat") then
|
||||||
|
@ -2378,6 +2380,10 @@ function Strategies.initGame(midGame)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Strategies.completeGameStrategy()
|
||||||
|
status = Strategies.status
|
||||||
|
end
|
||||||
|
|
||||||
function Strategies.resetGame()
|
function Strategies.resetGame()
|
||||||
maxEtherSkip = false
|
maxEtherSkip = false
|
||||||
status = Strategies.status
|
status = Strategies.status
|
||||||
|
|
|
@ -683,10 +683,12 @@ strategyFunctions = Strategies.functions
|
||||||
function Strategies.execute(data)
|
function Strategies.execute(data)
|
||||||
if strategyFunctions[data.s](data) then
|
if strategyFunctions[data.s](data) then
|
||||||
status = {tries=0}
|
status = {tries=0}
|
||||||
|
Strategies.status = status
|
||||||
|
Strategies.completeGameStrategy()
|
||||||
|
-- print(data.s)
|
||||||
if resetting then
|
if resetting then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
-- print(data.s)
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|
@ -703,7 +705,8 @@ function Strategies.init(midGame)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Strategies.softReset()
|
function Strategies.softReset()
|
||||||
status = {}
|
status = {tries=0}
|
||||||
|
Strategies.status = status
|
||||||
splitNumber, splitTime = 0, 0
|
splitNumber, splitTime = 0, 0
|
||||||
resetting = nil
|
resetting = nil
|
||||||
Strategies.resetGame()
|
Strategies.resetGame()
|
||||||
|
|
|
@ -20,6 +20,8 @@ local pokemon = require "storage.pokemon"
|
||||||
|
|
||||||
local status = Strategies.status
|
local status = Strategies.status
|
||||||
|
|
||||||
|
-- TIME CONSTRAINTS
|
||||||
|
|
||||||
Strategies.timeRequirements = {}
|
Strategies.timeRequirements = {}
|
||||||
|
|
||||||
-- STRATEGIES
|
-- STRATEGIES
|
||||||
|
@ -34,6 +36,10 @@ function Strategies.initGame(midGame)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Strategies.completeGameStrategy()
|
||||||
|
status = Strategies.status
|
||||||
|
end
|
||||||
|
|
||||||
function Strategies.resetGame()
|
function Strategies.resetGame()
|
||||||
status = Strategies.status
|
status = Strategies.status
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue