Improve handling next trashcan after failed unlock 2

This commit is contained in:
Kyle Coburn 2015-04-13 00:48:49 -07:00
parent bfa25c529a
commit eec7438d82
1 changed files with 9 additions and 5 deletions

View File

@ -22,6 +22,7 @@ local status = Strategies.status
local stats = Strategies.stats local stats = Strategies.stats
local strategyFunctions = Strategies.functions local strategyFunctions = Strategies.functions
Strategies.flareon = true
-- TIME CONSTRAINTS -- TIME CONSTRAINTS
@ -408,19 +409,21 @@ strategyFunctions.trashcans = function()
status.unlocking = false status.unlocking = false
local flipIndex = status.canIndex + status.nextDelta local flipIndex = status.canIndex + status.nextDelta
local flipCan = trashPath[flipIndex][1] local flipCan = trashPath[flipIndex][1]
status.flipIndex = flipIndex
if px == flipCan[1] and py == flipCan[2] then if px == flipCan[1] and py == flipCan[2] then
status.direction = status.direction * -1 status.nextDirection = status.direction * -1
status.canIndex = status.flipIndex status.canIndex = flipIndex
status.progress = 1
else else
status.flipIndex = flipIndex status.flipIndex = flipIndex
status.direction = 1 status.direction = 1
status.nextDirection = status.direction * -1 status.nextDirection = status.direction * -1
status.progress = status.progress + 1 status.progress = status.progress + 1
end end
return false else
status.canIndex = Utils.nextCircularIndex(status.canIndex, status.direction, totalPathCount)
status.progress = nil
end end
status.canIndex = Utils.nextCircularIndex(status.canIndex, status.direction, totalPathCount)
status.progress = nil
else else
status.unlocking = true status.unlocking = true
status.progress = status.progress + 1 status.progress = status.progress + 1
@ -662,6 +665,7 @@ end
function Strategies.resetGame() function Strategies.resetGame()
status = Strategies.status status = Strategies.status
stats = Strategies.stats stats = Strategies.stats
Strategies.flareon = true
end end
return Strategies return Strategies