Add more helper support for Yellow
This commit is contained in:
parent
f4304e7adf
commit
71109b040c
|
@ -26,6 +26,7 @@ local pokeIDs = {
|
|||
meowth = 77,
|
||||
pikachu = 84,
|
||||
dragonair = 89,
|
||||
sandshrew = 96,
|
||||
zubat = 107,
|
||||
ekans = 108,
|
||||
paras = 109,
|
||||
|
@ -74,6 +75,7 @@ local data = {
|
|||
hp = {1, true},
|
||||
status = {4},
|
||||
moves = {8},
|
||||
pp = {28},
|
||||
level = {33},
|
||||
max_hp = {34, true},
|
||||
|
||||
|
@ -207,6 +209,11 @@ function Pokemon.updateParty()
|
|||
end
|
||||
end
|
||||
|
||||
function Pokemon.pp(index, move)
|
||||
local midx = Pokemon.battleMove(move)
|
||||
return Memory.raw(getAddress(index) + 28 + midx)
|
||||
end
|
||||
|
||||
-- General
|
||||
|
||||
function Pokemon.isOpponent(...)
|
||||
|
|
|
@ -5,6 +5,7 @@ local Textbox = require "action.textbox"
|
|||
local Input = require "util.input"
|
||||
local Memory = require "util.memory"
|
||||
|
||||
local yellow = YELLOW
|
||||
local facingDirections = {Up=8, Right=1, Left=2, Down=4}
|
||||
|
||||
function Player.isFacing(direction)
|
||||
|
@ -22,7 +23,7 @@ end
|
|||
|
||||
function Player.interact(direction)
|
||||
if Player.face(direction) then
|
||||
Input.press("A", 2)
|
||||
Input.press("A", yellow and 3 or 2)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -44,6 +44,10 @@ function Utils.key(needle, haystack)
|
|||
return nil
|
||||
end
|
||||
|
||||
function Utils.capitalize(string)
|
||||
return string:sub(1, 1):toUpperCase()..string:sub(1)
|
||||
end
|
||||
|
||||
-- GAME
|
||||
|
||||
function Utils.canPotionWith(potion, forDamage, curr_hp, max_hp)
|
||||
|
@ -64,7 +68,7 @@ end
|
|||
|
||||
function Utils.onPokemonSelect(battleMenu)
|
||||
if yellow then
|
||||
return battleMenu == 27
|
||||
return battleMenu == 27 or battleMenu == 243
|
||||
end
|
||||
return battleMenu == 8 or battleMenu == 48 or battleMenu == 184 or battleMenu == 224
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue