Improve hp management in Vermillion

This commit is contained in:
Kyle Coburn 2015-04-14 16:55:24 -07:00
parent 5df9a724e1
commit 07d09f757e
2 changed files with 16 additions and 5 deletions

View File

@ -992,8 +992,9 @@ strategyFunctions.catchOddish = function()
end
Battle.handle()
end
elseif status.tries == 1 and py == 31 then
elseif status.tries == 1 and py == 31 and Combat.hp() > 12 then
Player.interact("Left")
Strategies.foughtRaticateEarly = true
else
local path
if caught then
@ -1040,6 +1041,14 @@ strategyFunctions.catchOddish = function()
end
end
strategyFunctions.potionBeforeRaticate = function()
if Strategies.foughtRaticateEarly then
Strategies.foughtRaticateEarly = nil
return true
end
return strategyFunctions.potion({hp=10, yolo=8, chain=true})
end
strategyFunctions.shopVermilionMart = function()
if Strategies.initialize() then
Strategies.setYolo("vermilion")
@ -1125,14 +1134,14 @@ strategyFunctions.fightSurge = function()
status.canProgress = true
local forced
if Pokemon.isOpponent("voltorb") then
Combat.disableThrash = true
Combat.disableThrash = not Control.yolo or Combat.inRedBar()
local __, enemyTurns = Combat.enemyAttack()
if not enemyTurns or enemyTurns > 2 then
forced = "bubblebeam"
elseif enemyTurns == 2 and not Strategies.opponentDamaged() then
local curr_hp, red_hp = Combat.hp(), Combat.redHP()
local afterHit = curr_hp - 20
if afterHit > 5 and afterHit <= red_hp then
if afterHit > 5 and afterHit <= red_hp - 3 then
forced = "bubblebeam"
end
end
@ -1164,6 +1173,8 @@ end
-- redbarCubone
-- announceOddish
strategyFunctions.undergroundElixer = function()
if Strategies.initialize() then
if Inventory.contains("elixer") and Inventory.contains("ether") then

View File

@ -136,7 +136,7 @@ local Paths = {
-- Underground exit
{74, {4,4}, {3,8}},
-- Oddish
{17, {17,14}, {c="a",a="Vermilion City"}, {c="catchOddish"}, {17,15}, {s="potion",hp=10,yolo=7}, {17,19}, {s="catchOddish"}, {11,29}, {s="potion",hp=10,yolo=7}, {11,29}, {s="waitToFight",dir="Down"}, {10,29}, {10,30}, {s="potion",hp=10,yolo=7}, {10,31}, {9,31}, {9,36}},
{17, {17,14}, {c="a",a="Vermilion City"}, {c="catchOddish"}, {17,15}, {s="potion",hp=10,yolo=7}, {17,19}, {s="catchOddish"}, {11,29}, {s="potion",hp=10,yolo=7}, {11,29}, {s="waitToFight",dir="Down"}, {10,29}, {10,30}, {s="potionBeforeRaticate"}, {10,31}, {9,31}, {9,36}},
-- Enter Vermilion
{5, {19,0}, {c="disableCatch"}, {19,6}, {21,6}, {21,14}, {23,14}, {23,13}},
-- Vermilion mart
@ -148,7 +148,7 @@ local Paths = {
-- First deck
{95, {27,0}, {27,1}, {26,1}, {26,7}, {2,7}, {2,6}},
-- Rival 3
{96, {2,4}, {2,11}, {3,11}, {3,12}, {37,12}, {37,9}, {s="swap",item="potion",dest=2,chain=true}, {s="potion",hp=23,yolo=16,chain=true}, {s="teach",move="bubblebeam",replace="tackle",close=true}, {37,8}, {s="rivalSandAttack"}, {37,5}, {36,5}, {36,4}},
{96, {2,4}, {2,11}, {3,11}, {3,12}, {37,12}, {37,9}, {s="swap",item="potion",dest=2,chain=true}, {s="potion",hp=25,yolo=19,chain=true}, {s="teach",move="bubblebeam",replace="tackle",close=true}, {37,8}, {s="rivalSandAttack"}, {37,5}, {36,5}, {36,4}},
-- Old man Cut
{101, {0,7}, {0,4}, {4,4}, {4,3}, {s="talk",dir="Up"}, {4,5}, {0,5}, {0,7}},
-- Second deck out