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) hpReq = hpReq + math.floor(ours.hp * 0.2)
end end
if ours.hp <= hpReq then if ours.hp <= hpReq then
local outspeed = enemyAttack.outspeed local outsped = enemyAttack.outspeed
if outspeed and outspeed ~= true then if outsped and outsped ~= true then
outspeed = Memory.value("battle", "turns") > 0 outsped = Memory.value("battle", "attack_turns") > 0
end 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 return ours, hpReq
end end
end end

View File

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

View File

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

View File

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

View File

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