Resolve memory table collision

This commit is contained in:
Kyle Coburn 2015-04-10 01:38:35 -07:00
parent d63ed66072
commit 38bd21b888
5 changed files with 10 additions and 10 deletions

View File

@ -344,11 +344,11 @@ function Combat.inKillRange(draw)
hpReq = hpReq + math.floor(ours.hp * 0.2)
end
if ours.hp <= hpReq then
local outspeed = enemyAttack.outspeed
if outspeed and outspeed ~= true then
outspeed = Memory.value("battle", "turns") > 0
local outsped = enemyAttack.outspeed
if outsped and outsped ~= true then
outsped = Memory.value("battle", "attack_turns") > 0
end
if outspeed or isConfused or turnsToKill > 1 or ours.speed <= enemy.speed or isSleeping() then
if outsped or isConfused or turnsToKill > 1 or ours.speed <= enemy.speed or isSleeping() then
return ours, hpReq
end
end

View File

@ -331,7 +331,7 @@ function Control.encounter(battleState)
end
end
elseif Control.inBattle then
if Memory.value("battle", "turns") == 0 then
if Memory.value("battle", "battle_turns") == 0 then
Control.escaped = true
end
Control.inBattle = false

View File

@ -670,7 +670,7 @@ end
strategyFunctions.shortsKid = function()
local fightingEkans = Pokemon.isOpponent("ekans")
if fightingEkans then
local wrapping = Memory.value("battle", "turns") > 0
local wrapping = Memory.value("battle", "attack_turns") > 0
if wrapping then
local curr_hp = Memory.double("battle", "our_hp")
if not status.wrappedAt then
@ -2263,7 +2263,7 @@ strategyFunctions.blue = function()
local forced = "horn_drill"
if Memory.value("battle", "turns") > 0 then
if Memory.value("battle", "attack_turns") > 0 then
local skyDamage = Combat.healthFor("BlueSky")
local healCutoff = skyDamage * 0.825
if Strategies.initialize() then

View File

@ -279,7 +279,7 @@ local moves = {
id = 31,
move_type = 'normal',
special = false,
outspeed = true,
outspeed = "turns",
power = 15,
max_pp = 20,
accuracy = 85,

View File

@ -58,7 +58,7 @@ local memoryNames = {
exp3 = 0x117B,
},
battle = {
turns = 0x1067,
attack_turns = 0x1067,
text = 0x1125,
menu = 0x0C50,
accuracy = 0x0D1E,
@ -72,7 +72,7 @@ local memoryNames = {
critical = 0x105E,
miss = 0x105F,
our_turn = 0x1FF1,
turns = 0x0CD5,
battle_turns = 0x0CD5,
opponent_bide = 0x106F,
opponent_id = 0x0FE5,