From eec7438d823a52b281d97838880faa4cf2324cb3 Mon Sep 17 00:00:00 2001 From: Kyle Coburn Date: Mon, 13 Apr 2015 00:48:49 -0700 Subject: [PATCH] Improve handling next trashcan after failed unlock 2 --- ai/yellow/strategies.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ai/yellow/strategies.lua b/ai/yellow/strategies.lua index 2744806..295ecdc 100644 --- a/ai/yellow/strategies.lua +++ b/ai/yellow/strategies.lua @@ -22,6 +22,7 @@ local status = Strategies.status local stats = Strategies.stats local strategyFunctions = Strategies.functions +Strategies.flareon = true -- TIME CONSTRAINTS @@ -408,19 +409,21 @@ strategyFunctions.trashcans = function() status.unlocking = false local flipIndex = status.canIndex + status.nextDelta local flipCan = trashPath[flipIndex][1] + status.flipIndex = flipIndex if px == flipCan[1] and py == flipCan[2] then - status.direction = status.direction * -1 - status.canIndex = status.flipIndex + status.nextDirection = status.direction * -1 + status.canIndex = flipIndex + status.progress = 1 else status.flipIndex = flipIndex status.direction = 1 status.nextDirection = status.direction * -1 status.progress = status.progress + 1 end - return false + else + status.canIndex = Utils.nextCircularIndex(status.canIndex, status.direction, totalPathCount) + status.progress = nil end - status.canIndex = Utils.nextCircularIndex(status.canIndex, status.direction, totalPathCount) - status.progress = nil else status.unlocking = true status.progress = status.progress + 1 @@ -662,6 +665,7 @@ end function Strategies.resetGame() status = Strategies.status stats = Strategies.stats + Strategies.flareon = true end return Strategies