diff --git a/ai/red/strategies.lua b/ai/red/strategies.lua index 50d5103..6d5f0c2 100644 --- a/ai/red/strategies.lua +++ b/ai/red/strategies.lua @@ -116,7 +116,7 @@ Strategies.timeRequirements = { end, vermilion = function() - return 42.5 + timeForStats() + return 42.25 + timeForStats() end, trash = function() --RESET @@ -2101,32 +2101,7 @@ function Strategies.initGame(midGame) speed = 11, special = 11, } - if Pokemon.inParty("nidoking") then - local attDV, defDV, spdDV, sclDV = Pokemon.getDVs("nidoking") - p(attDV, defDV, spdDV, sclDV) - stats.nidoran = { - attack = 55, - defense = 45, - speed = 50, - special = 45, - rating = 1, - attackDV = attDV, - defenseDV = defDV, - speedDV = spdDV, - specialDV = sclDV, - } - riskGiovanni = canRiskGiovanni() - else - stats.nidoran = { - attack = 16, - defense = 12, - speed = 15, - special = 13, - level4 = true, - rating = 1, - } - end - p(stats.nidoran.attack, "x", stats.nidoran.speed, stats.nidoran.special) + riskGiovanni = canRiskGiovanni() end end diff --git a/ai/strategies.lua b/ai/strategies.lua index 141f98c..9e273a3 100644 --- a/ai/strategies.lua +++ b/ai/strategies.lua @@ -241,8 +241,10 @@ end function Strategies.buffTo(buff, defLevel) if Strategies.trainerBattle() then local forced - if defLevel and Memory.double("battle", "opponent_defense") > defLevel then - forced = buff + if not Strategies.opponentDamaged() then + if defLevel and Memory.double("battle", "opponent_defense") > defLevel then + forced = buff + end end Battle.automate(forced, true) elseif status.foughtTrainer then @@ -1197,10 +1199,10 @@ Strategies.functions = { if Combat.isDisabled("horn_attack") and Strategies.initialize("disabled") then local message = Utils.random { "Last for 0 turns pretty please?", - "I guess it's time to tackle everything.", + "Guess it's time to tackle everything.", "How could this... happen to me?", } - Bridge.chat("WutFace Grimer just disabled Horn Attack. " + message) + Bridge.chat("WutFace Grimer just disabled Horn Attack. "..message) end Battle.automate() elseif status.foughtTrainer then @@ -1880,6 +1882,33 @@ function Strategies.init(midGame) Control.preferredPotion = "super" Combat.factorPP(true) end + + local nido = Pokemon.inParty("nidoran", "nidorino", "nidoking") + if nido then + local attDV, defDV, spdDV, sclDV = Pokemon.getDVs(nido) + p(attDV, defDV, spdDV, sclDV) + stats.nidoran = { + rating = 1, + attackDV = attDV, + defenseDV = defDV, + speedDV = spdDV, + specialDV = sclDV, + level4 = true, + } + if nido == "nidoking" then + stats.nidoran.attack = 55 + stats.nidoran.defense = 45 + stats.nidoran.speed = 50 + stats.nidoran.special = 45 + else + stats.nidoran.attack = 16 + stats.nidoran.defense = 12 + stats.nidoran.speed = 15 + stats.nidoran.special = 13 + end + p(stats.nidoran.attack, "x", stats.nidoran.speed, stats.nidoran.special) + end + Strategies.initGame(midGame) end diff --git a/data/red/paths.lua b/data/red/paths.lua index 36c4052..3c4dc70 100644 --- a/data/red/paths.lua +++ b/data/red/paths.lua @@ -357,7 +357,7 @@ local Paths = { -- F3 {215, {6,2}, {11,2}, {11,6}, {10,6}, {s="confirm",dir="Up"}, {14,6}, {14,11}, {16,11}, {16,14}}, -- F1 drop - {165, {16,14}, {16,15}, {13,15}, {13,20}, {s="cinnabarCarbos"}, {21,23}}, + {165, {16,14}, {16,16}, {13,16}, {13,20}, {s="cinnabarCarbos"}, {21,23}}, -- B1 --TODO menu cancel for RC {216, {23,22}, {23,15}, {21,15}, {s="item",item="super_repel",chain=true}, {s="item",item="carbos",poke="nidoking",close=true}, {17,15}, {17,19}, {18,19}, {18,23}, {17,23}, {17,26}, {18,26}, {s="confirm",dir="Up"}, {14,26}, {14,22}, {12,22}, {12,15}, {24,15}, {24,18}, {26,18}, {26,6}, {24,6}, {24,4}, {20,4}, {s="confirm",dir="Up"}, {24,4}, {24,6}, {12,6}, {12,2}, {11,2}, {s="take",dir="Left"}, {12,2}, {12,7}, {4,7}, {4,9}, {2,9}, {s="take",dir="Left"}, {5,9}, {5,10}, {s="teach",move="strength",poke="squirtle",replace="tackle",chain=true}, {s="item",item="rare_candy",amount=2,poke="nidoking",close=true}, {5,12}, {s="take",dir="Down"}, {5,12}, {s="skill",move="dig",map=216}}, diff --git a/storage/pokemon.lua b/storage/pokemon.lua index b1e9a00..d3ee2d5 100644 --- a/storage/pokemon.lua +++ b/storage/pokemon.lua @@ -332,8 +332,8 @@ function Pokemon.use(move) return true end -function Pokemon.getDVs(name) - local index = Pokemon.indexOf(name) +function Pokemon.getDVs(...) + local index = Pokemon.indexOf(...) local baseAddress = getAddress(index) local attackDefense = Memory.raw(baseAddress + 0x1B) local speedSpecial = Memory.raw(baseAddress + 0x1C)