From 7079097cebc0dc9b65687ddec7ed8e588cfb4d23 Mon Sep 17 00:00:00 2001 From: Kyle Coburn Date: Thu, 23 Apr 2015 10:25:20 -0700 Subject: [PATCH] Cleanup --- action/battle.lua | 7 +++++-- ai/strategies.lua | 4 ++-- data/red/paths.lua | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/action/battle.lua b/action/battle.lua index 5bb590d..bd114b2 100644 --- a/action/battle.lua +++ b/action/battle.lua @@ -196,8 +196,11 @@ function Battle.handle() end end -function Battle.handleWild() - if Memory.value("game", "battle") ~= 1 then +function Battle.handleWild(battleStatus) + if not battleStatus then + battleStatus = Memory.value("game", "battle") + end + if battleStatus ~= 1 then return true end Battle.handle() diff --git a/ai/strategies.lua b/ai/strategies.lua index aac6ceb..2ef1577 100644 --- a/ai/strategies.lua +++ b/ai/strategies.lua @@ -192,9 +192,9 @@ function Strategies.trainerBattle() return true end Battle.handleWild(battleStatus) - return false + else + Textbox.handle() end - Textbox.handle() end function Strategies.opponentDamaged(factor) diff --git a/data/red/paths.lua b/data/red/paths.lua index 7db916a..00ae103 100644 --- a/data/red/paths.lua +++ b/data/red/paths.lua @@ -68,7 +68,7 @@ local Paths = { -- Leaving Pewter City {2, {23,18}, {40,18}}, -- Route 3 - {14, {0,10}, {c="a",a="Route 3"}, {c="catchFlier"}, {c="pp",on=true}, {c="trackEncounters",area="route3"}, {s="battleModeSet"}, {8,10}, {8,8}, {11,8}, {11,6}, {s="bugCatcher"}, {11,4}, {12,4}, {c="a",a="Shorts Kid"}, {s="potion",hp=19}, {13,4}, {s="talk",dir="Right"}, {s="shortsKid"}, {s="tweetAfterBrock"}, {13,5}, {c="a",a="Route 3"}, {s="potionBeforeCocoons"}, {18,5}, {s="talk",dir="Right"}, {s="swapMove",move="horn_attack",to=0}, {18,6}, {22,6}, {22,5}, {s="potion",hp=4}, {24,5}, {s="talk",dir="Down"}, {s="fightMetapod"}, {27,5}, {27,9}, {s="catchFlierBackup"}, {37,8}, {37,5}, {49,5}, {49,10}, {57,10}, {57,8}, {59,8}, {59,-1}}, + {14, {0,10}, {c="a",a="Route 3"}, {c="catchFlier"}, {c="pp",on=true}, {c="trackEncounters",area="route3"}, {s="battleModeSet"}, {8,10}, {8,8}, {11,8}, {11,6}, {s="bugCatcher"}, {11,4}, {12,4}, {c="a",a="Shorts Kid"}, {s="potion",hp=19}, {13,4}, {s="talk",dir="Right"}, {s="shortsKid"}, {s="tweetAfterBrock"}, {13,5}, {c="a",a="Route 3"}, {s="potionBeforeCocoons"}, {18,5}, {s="talk",dir="Right"}, {s="swapMove",move="horn_attack",to=0}, {18,6}, {22,6}, {22,5}, {23,5}, {s="potion",hp=4}, {24,5}, {s="talk",dir="Down"}, {s="fightMetapod"}, {27,5}, {27,9}, {s="catchFlierBackup"}, {37,8}, {37,5}, {49,5}, {49,10}, {57,10}, {57,8}, {59,8}, {59,-1}}, -- To the Center {15, {9,16}, {c="pp",on=false}, {12,16}, {12,6}, {11,6}, {11,5}}, -- PP up