Describe deaths involving Confusion/Sand-Attack, standardize check for Sand-attack, fix timing of Thrash Confusion messages
This commit is contained in:
parent
ba3f8b780e
commit
bfc6a8ad0b
|
@ -2,9 +2,10 @@ local Combat = {}
|
||||||
|
|
||||||
local Movelist = require "data.movelist"
|
local Movelist = require "data.movelist"
|
||||||
local Opponents = require "data.opponents"
|
local Opponents = require "data.opponents"
|
||||||
local Utils = require "util.utils"
|
|
||||||
|
|
||||||
local Memory = require "util.memory"
|
local Memory = require "util.memory"
|
||||||
|
local Utils = require "util.utils"
|
||||||
|
|
||||||
local Pokemon = require "storage.pokemon"
|
local Pokemon = require "storage.pokemon"
|
||||||
|
|
||||||
local damageMultiplier = { -- http://bulbapedia.bulbagarden.net/wiki/Type_chart#Generation_I
|
local damageMultiplier = { -- http://bulbapedia.bulbagarden.net/wiki/Type_chart#Generation_I
|
||||||
|
@ -315,6 +316,10 @@ local function isConfused()
|
||||||
end
|
end
|
||||||
Combat.isConfused = isConfused
|
Combat.isConfused = isConfused
|
||||||
|
|
||||||
|
function Combat.sandAttacked()
|
||||||
|
return Memory.value("battle", "accuracy") < 7
|
||||||
|
end
|
||||||
|
|
||||||
-- HP
|
-- HP
|
||||||
|
|
||||||
function Combat.hp()
|
function Combat.hp()
|
||||||
|
|
|
@ -306,7 +306,7 @@ function Control.encounter(battleState)
|
||||||
if turnMarker == 100 or turnMarker == 128 then
|
if turnMarker == 100 or turnMarker == 128 then
|
||||||
local isMiss = Memory.value("battle", "miss") == 1
|
local isMiss = Memory.value("battle", "miss") == 1
|
||||||
if isMiss then
|
if isMiss then
|
||||||
if not Control.ignoreMiss and Battle.accurateAttack and Memory.value("battle", "accuracy") == 7 then
|
if not Control.ignoreMiss and Battle.accurateAttack and not Combat.sandAttacked() then
|
||||||
local exclaim = Strategies.deepRun and ";_; " or ""
|
local exclaim = Strategies.deepRun and ";_; " or ""
|
||||||
Bridge.chat("gen 1 missed "..exclaim.."(1 in 256 chance)")
|
Bridge.chat("gen 1 missed "..exclaim.."(1 in 256 chance)")
|
||||||
end
|
end
|
||||||
|
|
|
@ -965,10 +965,15 @@ strategyFunctions.thrashGeodude = function()
|
||||||
Bridge.chat(" Thrash didn't finish the kill :( swapping to Squirtle for safety.")
|
Bridge.chat(" Thrash didn't finish the kill :( swapping to Squirtle for safety.")
|
||||||
end
|
end
|
||||||
elseif Pokemon.isOpponent("geodude") and Battle.opponentAlive() and Combat.isConfused() then
|
elseif Pokemon.isOpponent("geodude") and Battle.opponentAlive() and Combat.isConfused() then
|
||||||
if Strategies.initialize() then
|
if Menu.onBattleSelect() and Strategies.initialize("shouldSacrifice") then
|
||||||
status.sacrificeSquirtle = not Control.yolo or Combat.inRedBar()
|
if not Control.yolo or Combat.inRedBar() then
|
||||||
|
status.sacrificeSquirtle = true
|
||||||
|
else
|
||||||
|
local __, turnsToKill = Combat.bestMove()
|
||||||
|
status.sacrificeSquirtle = turnsToKill > 1
|
||||||
|
end
|
||||||
if not status.sacrificeSquirtle then
|
if not status.sacrificeSquirtle then
|
||||||
Bridge.chat("is attempting to hit through confusion to avoid switching out to Squirtle...")
|
Bridge.chat("is attempting to hit through Confusion to avoid switching out to Squirtle...")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1058,6 +1063,7 @@ strategyFunctions.fightMisty = function()
|
||||||
sacrifice = Pokemon.getSacrifice("pidgey", "spearow", "squirtle", "paras")
|
sacrifice = Pokemon.getSacrifice("pidgey", "spearow", "squirtle", "paras")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Menu.onBattleSelect() then
|
||||||
if Strategies.initialize("sacrificed") then
|
if Strategies.initialize("sacrificed") then
|
||||||
local swapMessage = " Thrash didn't finish the kill :( "
|
local swapMessage = " Thrash didn't finish the kill :( "
|
||||||
if sacrifice then
|
if sacrifice then
|
||||||
|
@ -1069,6 +1075,7 @@ strategyFunctions.fightMisty = function()
|
||||||
end
|
end
|
||||||
Bridge.chat(swapMessage)
|
Bridge.chat(swapMessage)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if sacrifice and Battle.sacrifice(sacrifice) then
|
if sacrifice and Battle.sacrifice(sacrifice) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
|
@ -85,10 +85,16 @@ function Strategies.death(extra)
|
||||||
if Control.missed then
|
if Control.missed then
|
||||||
explanation = "Missed"
|
explanation = "Missed"
|
||||||
reason = "miss"
|
reason = "miss"
|
||||||
|
elseif Combat.isConfused() then
|
||||||
|
explanation = "Confusion'd"
|
||||||
|
reason = "confusion"
|
||||||
elseif Control.criticaled then
|
elseif Control.criticaled then
|
||||||
explanation = "Critical'd"
|
explanation = "Critical'd"
|
||||||
reason = "critical"
|
reason = "critical"
|
||||||
elseif Control.yolo and stats.nidoran then
|
elseif Combat.sandAttacked() then
|
||||||
|
explanation = "Sand-Attack'd"
|
||||||
|
reason = "accuracy"
|
||||||
|
elseif Control.yolo and stats.nidoran and stats.nidoran.attack then
|
||||||
explanation = "Yolo strats"
|
explanation = "Yolo strats"
|
||||||
reason = "yolo"
|
reason = "yolo"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue