From 1ae370ec22a59f2b25bf6c8978ec90020bde682b Mon Sep 17 00:00:00 2001 From: Kyle Coburn Date: Sun, 12 Apr 2015 11:30:31 -0700 Subject: [PATCH] Add chat messages for Oddish and 4 turn Bellsprout --- ai/red/strategies.lua | 12 +++++++++++- ai/strategies.lua | 11 +++++++++++ data/red/paths.lua | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ai/red/strategies.lua b/ai/red/strategies.lua index 3354b73..1199826 100644 --- a/ai/red/strategies.lua +++ b/ai/red/strategies.lua @@ -354,7 +354,8 @@ strategyFunctions.catchNidoran = function() if Battle.isActive() then local isNidoran = Pokemon.isOpponent("nidoran") if isNidoran and Memory.value("battle", "opponent_level") > 2 then - if not Bridge.polling then + if not status.polled then + status.polled = true Bridge.pollForName() end end @@ -977,6 +978,15 @@ strategyFunctions.catchOddish = function() return true end local caught = Pokemon.inParty("oddish", "paras") + if Strategies.initialize() then + if caught then + if Pokemon.inParty("oddish") then + Bridge.chat("found an Oddish without having to search in the grass Kreygasm") + end + else + Bridge.chat("is searching for an Oddish in the grass, to teach it Cut") + end + end local battleValue = Memory.value("game", "battle") local px, py = Player.position() if battleValue > 0 then diff --git a/ai/strategies.lua b/ai/strategies.lua index 7f3d0d7..d750d49 100644 --- a/ai/strategies.lua +++ b/ai/strategies.lua @@ -726,6 +726,12 @@ Strategies.functions = { end, waitToPause = function() + if Menu.pause() then + return true + end + end, + + waitToPauseFromBattle = function() local main = Memory.value("menu", "main") if main == 128 then if status.canProgress then @@ -1083,6 +1089,11 @@ Strategies.functions = { end end, + announceFourTurn = function() + Bridge.chat("needs a 4-turn thrash (1 in 2 chance) to beat this dangerous trainer...") + return true + end, + playPokeflute = function() if Battle.isActive() then return true diff --git a/data/red/paths.lua b/data/red/paths.lua index 5171a5d..4928879 100644 --- a/data/red/paths.lua +++ b/data/red/paths.lua @@ -175,7 +175,7 @@ local Paths = { -- Bicycle out of Cerulean {3, {13,26}, {s="swap",item="bicycle",dest=1,chain=true}, {s="teach",move="thunderbolt",replace="horn_attack",chain=true}, {s="bicycle"}, {19,26}, {19,27}, {s="skill",move="cut",done=0x0D4D}, {19,29}, {36,29}, {36,16}, {40,16}}, -- TPP's Bane - {20, {0,8}, {c="a",a="Route 9"}, {4,8}, {s="skill",move="cut",done=0x0C17,val=2}, {13,8}, {13,9}, {s="talk",dir="Down"}, {12,9}, {12,12}, {23,12}, {23,11}, {29,11}, {29,12}, {41,12}, {41,10}, {40,10}, {40,9}, {s="talk",dir="Up"}, {41,9}, {41,6}, {39,6}, {39,4}, {45,4}, {45,3}, {51,3}, {51,8}, {60,8}}, + {20, {0,8}, {c="a",a="Route 9"}, {4,8}, {s="skill",move="cut",done=0x0C17,val=2}, {13,8}, {13,9}, {s="talk",dir="Down"}, {s="announceFourTurn"}, {12,9}, {12,12}, {23,12}, {23,11}, {29,11}, {29,12}, {41,12}, {41,10}, {40,10}, {40,9}, {s="talk",dir="Up"}, {41,9}, {41,6}, {39,6}, {39,4}, {45,4}, {45,3}, {51,3}, {51,8}, {60,8}}, -- To the cave {21, {0,8}, {3,8}, {3,10}, {13,10}, {13,15}, {14,15}, {14,26}, {3,26}, {3,18}, {7,18}, {s="item",item="repel"}, {8,18}, {8,17}}, -- Rock tunnel @@ -325,7 +325,7 @@ local Paths = { -- Rival 5 {212, {5,3}, {c="a",a="Silph Rival"}, {4,3}, {4,2}, {3,2}, {c="potion",b=false}, {s="silphRival"}, {3,7}, {c="potion",b=true,yolo=true}, {5,7}}, -- Giovanni - {235, {3,2}, {c="a",a="Silph Giovanni"}, {3,11}, {2,11}, {2,15}, {s="rareCandyGiovanni"}, {2,16}, {s="talk",dir="Right"}, {2,15}, {5,15}, {s="potion",hp=17,yolo=12}, {6,15}, {6,14}, {s="interact",dir="Up"}, {6,13}, {s="fightXAccuracy"}, {s="fightSilphGiovanni"}, {s="split"}, {s="waitToPause"}, {s="skill",move="dig",map=235}}, + {235, {3,2}, {c="a",a="Silph Giovanni"}, {3,11}, {2,11}, {2,15}, {s="rareCandyGiovanni"}, {2,16}, {s="talk",dir="Right"}, {2,15}, {5,15}, {s="potion",hp=17,yolo=12}, {6,15}, {6,14}, {s="interact",dir="Up"}, {6,13}, {s="fightXAccuracy"}, {s="fightSilphGiovanni"}, {s="split"}, {s="waitToPauseFromBattle"}, {s="skill",move="dig",map=235}}, -- 11: SILPH CO.