From c9600d216692e3f076c19f447d6bf44d9a2eef2d Mon Sep 17 00:00:00 2001 From: Kyle Coburn Date: Thu, 16 Apr 2015 12:30:21 -0700 Subject: [PATCH] Improve potioning, add DSum for Spearow, use Horn Attack first on NB Caterpie --- ai/red/strategies.lua | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/ai/red/strategies.lua b/ai/red/strategies.lua index 544f35c..7a1cbd8 100644 --- a/ai/red/strategies.lua +++ b/ai/red/strategies.lua @@ -144,8 +144,10 @@ local function nidoranDSum(enabled) status.path = {0, 0, 10} end elseif opponentName == "spearow" then - if opponentLevel == 5 then --TODO + if opponentLevel == 3 then + status.path = {2, 6, 12} else + status.path = {3, 6, 12} end elseif opponentName == "nidoran" then status.path = {0, 6, 12} @@ -434,7 +436,7 @@ strategyFunctions.grabForestPotion = function() local potionCount = Inventory.count("potion") if Strategies.initialize() then status.previousPotions = potionCount - status.needsExtraPotion = Pokemon.info("squirtle", "hp") <= 16 + status.needsExtraPotion = potionCount == 0 or Pokemon.info("squirtle", "hp") <= 16 elseif status.needsExtraPotion then if potionCount > status.previousPotions then status.needsExtraPotion = false @@ -773,6 +775,24 @@ strategyFunctions.rivalSandAttack = function(data) end end +strategyFunctions.hornAttackCaterpie = function() + if Strategies.initialize() then + if Pokemon.hasMove("thrash") then + return true + end + end + local forced + if Battle.isActive() then + status.canProgress = true + if not Strategies.opponentDamaged() then + forced = "horn_attack" + end + elseif status.canProgress then + return true + end + Battle.automate(forced) +end + -- rareCandyEarly -- teachThrash @@ -1048,7 +1068,7 @@ strategyFunctions.potionBeforeRaticate = function() Strategies.foughtRaticateEarly = nil return true end - return strategyFunctions.potion({hp=10, yolo=8, chain=true}) + return strategyFunctions.potion({hp=10, yolo=8}) end strategyFunctions.shopVermilionMart = function()