Skip to content

Commit

Permalink
Merge pull request #476 from besteon/dev
Browse files Browse the repository at this point in the history
8.6.1 Patch Release
  • Loading branch information
Fellshadow authored Sep 20, 2024
2 parents b945e7d + 7639c86 commit b13c0e1
Show file tree
Hide file tree
Showing 21 changed files with 603 additions and 98 deletions.
10 changes: 9 additions & 1 deletion ironmon_tracker/Languages/English.lua
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,11 @@ ScreenResources{
HeaderTabMisc = "Misc.",
LabelBaseStats = "Base Stats",
LabelBSTTotal = "Total", -- Usage: "Total: 505"
LabelYourIVs = "Your IVs",
LabelYourEVs = "Your EVs",
LabelShowIVs = "Show IVs",
LabelShowEVs = "Show EVs",
LabelShowBST = "Show BST",
ButtonLevelupMoves = "Levelup Moves",
ButtonTMMoves = "TM Moves",
LabelGymTMs = "Gym TMs",
Expand Down Expand Up @@ -613,8 +618,10 @@ ScreenResources{
CMD_Route_Help = "name > Displays trainer and wild encounter info for a route or area.",
CMD_Dungeon_Name = "Dungeon Info",
CMD_Dungeon_Help = "name > Displays info about which trainers have been defeated for an area.",
CMD_Unfought_Name = "Unfought Trainers",
CMD_Unfought_Help = "[dungeon] [sevii]> Displays a list of areas ordered by lowest-level, undefeated trainers. (Add param 'dungeon' to include partially completed dungeons.)",
CMD_Pivots_Name = "Pivots Seen",
CMD_Pivots_Help = "name > Displays known early game wild encounters for an area.",
CMD_Pivots_Help = "> Displays known early game wild encounters for an area.",
CMD_Revo_Name = "Pokémon Random Evolutions",
CMD_Revo_Help = "name [target-evo] > Displays randomized evolution possibilities for a Pokémon, and it's [target-evo] if more than one available.",
CMD_Coverage_Name = "Move Coverage Effectiveness",
Expand Down Expand Up @@ -832,6 +839,7 @@ ScreenResources{
CommandsUsageSyntax = "Usage Syntax",
CommandsExampleUsage = "Example Usage",
PokemonInfoBST = "BST",
PokemonInfoEXP = "EXP",
PokemonInfoWeight = "Weight",
PokemonInfoEvolution = "Evolution",
PokemonInfoKg = "kg",
Expand Down
10 changes: 9 additions & 1 deletion ironmon_tracker/Languages/French.lua
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,11 @@ ScreenResources{
HeaderTabMisc = "Misc.", -- NEEDS TRANSLATION
LabelBaseStats = "Base Stats", -- NEEDS TRANSLATION
LabelBSTTotal = "Total", -- NEEDS TRANSLATION
LabelYourIVs = "Your IVs", -- NEEDS TRANSLATION
LabelYourEVs = "Your EVs", -- NEEDS TRANSLATION
LabelShowIVs = "Show IVs", -- NEEDS TRANSLATION
LabelShowEVs = "Show EVs", -- NEEDS TRANSLATION
LabelShowBST = "Show BST", -- NEEDS TRANSLATION
ButtonLevelupMoves = "Levelup Moves", -- NEEDS TRANSLATION
ButtonTMMoves = "TM Moves", -- NEEDS TRANSLATION
LabelGymTMs = "Gym TMs", -- NEEDS TRANSLATION
Expand Down Expand Up @@ -614,8 +619,10 @@ ScreenResources{
CMD_Route_Help = "name > Displays trainer and wild encounter info for a route or area.",
CMD_Dungeon_Name = "Dungeon Info",
CMD_Dungeon_Help = "name > Displays info about which trainers have been defeated for an area.",
CMD_Unfought_Name = "Unfought Trainers",
CMD_Unfought_Help = "[dungeon] [sevii]> Displays a list of areas ordered by lowest-level, undefeated trainers. (Add param 'dungeon' to include partially completed dungeons.)",
CMD_Pivots_Name = "Pivots Seen",
CMD_Pivots_Help = "name > Displays known early game wild encounters for an area.",
CMD_Pivots_Help = "> Displays known early game wild encounters for an area.",
CMD_Revo_Name = "Pokémon Random Evolutions",
CMD_Revo_Help = "name [target-evo] > Displays randomized evolution possibilities for a Pokémon, and it's [target-evo] if more than one available.",
CMD_Coverage_Name = "Move Coverage Effectiveness",
Expand Down Expand Up @@ -833,6 +840,7 @@ ScreenResources{
CommandsUsageSyntax = "Usage Syntax", -- NEEDS TRANSLATION
CommandsExampleUsage = "Example Usage", -- NEEDS TRANSLATION
PokemonInfoBST = "BST", -- NEEDS TRANSLATION
PokemonInfoEXP = "EXP", -- NEEDS TRANSLATION
PokemonInfoWeight = "Weight", -- NEEDS TRANSLATION
PokemonInfoEvolution = "Evolution", -- NEEDS TRANSLATION
PokemonInfoKg = "kg", -- NEEDS TRANSLATION
Expand Down
10 changes: 9 additions & 1 deletion ironmon_tracker/Languages/German.lua
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,11 @@ ScreenResources{
HeaderTabMisc = "Misc.", -- NEEDS TRANSLATION
LabelBaseStats = "Base Stats", -- NEEDS TRANSLATION
LabelBSTTotal = "Total", -- NEEDS TRANSLATION
LabelYourIVs = "Your IVs", -- NEEDS TRANSLATION
LabelYourEVs = "Your EVs", -- NEEDS TRANSLATION
LabelShowIVs = "Show IVs", -- NEEDS TRANSLATION
LabelShowEVs = "Show EVs", -- NEEDS TRANSLATION
LabelShowBST = "Show BST", -- NEEDS TRANSLATION
ButtonLevelupMoves = "Levelup Moves", -- NEEDS TRANSLATION
ButtonTMMoves = "TM Moves", -- NEEDS TRANSLATION
LabelGymTMs = "Gym TMs", -- NEEDS TRANSLATION
Expand Down Expand Up @@ -614,8 +619,10 @@ ScreenResources{
CMD_Route_Help = "name > Displays trainer and wild encounter info for a route or area.",
CMD_Dungeon_Name = "Dungeon Info",
CMD_Dungeon_Help = "name > Displays info about which trainers have been defeated for an area.",
CMD_Unfought_Name = "Unfought Trainers",
CMD_Unfought_Help = "[dungeon] [sevii]> Displays a list of areas ordered by lowest-level, undefeated trainers. (Add param 'dungeon' to include partially completed dungeons.)",
CMD_Pivots_Name = "Pivots Seen",
CMD_Pivots_Help = "name > Displays known early game wild encounters for an area.",
CMD_Pivots_Help = "> Displays known early game wild encounters for an area.",
CMD_Revo_Name = "Pokémon Random Evolutions",
CMD_Revo_Help = "name [target-evo] > Displays randomized evolution possibilities for a Pokémon, and it's [target-evo] if more than one available.",
CMD_Coverage_Name = "Move Coverage Effectiveness",
Expand Down Expand Up @@ -833,6 +840,7 @@ ScreenResources{
CommandsUsageSyntax = "Usage Syntax", -- NEEDS TRANSLATION
CommandsExampleUsage = "Example Usage", -- NEEDS TRANSLATION
PokemonInfoBST = "BST", -- NEEDS TRANSLATION
PokemonInfoEXP = "EXP", -- NEEDS TRANSLATION
PokemonInfoWeight = "Weight", -- NEEDS TRANSLATION
PokemonInfoEvolution = "Evolution", -- NEEDS TRANSLATION
PokemonInfoKg = "kg", -- NEEDS TRANSLATION
Expand Down
10 changes: 9 additions & 1 deletion ironmon_tracker/Languages/Italian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,11 @@ ScreenResources{
HeaderTabMisc = "Misc.", -- NEEDS TRANSLATION
LabelBaseStats = "Base Stats", -- NEEDS TRANSLATION
LabelBSTTotal = "Total", -- NEEDS TRANSLATION
LabelYourIVs = "Your IVs", -- NEEDS TRANSLATION
LabelYourEVs = "Your EVs", -- NEEDS TRANSLATION
LabelShowIVs = "Show IVs", -- NEEDS TRANSLATION
LabelShowEVs = "Show EVs", -- NEEDS TRANSLATION
LabelShowBST = "Show BST", -- NEEDS TRANSLATION
ButtonLevelupMoves = "Levelup Moves", -- NEEDS TRANSLATION
ButtonTMMoves = "TM Moves", -- NEEDS TRANSLATION
LabelGymTMs = "Gym TMs", -- NEEDS TRANSLATION
Expand Down Expand Up @@ -614,8 +619,10 @@ ScreenResources{
CMD_Route_Help = "name > Displays trainer and wild encounter info for a route or area.",
CMD_Dungeon_Name = "Dungeon Info",
CMD_Dungeon_Help = "name > Displays info about which trainers have been defeated for an area.",
CMD_Unfought_Name = "Unfought Trainers",
CMD_Unfought_Help = "[dungeon] [sevii]> Displays a list of areas ordered by lowest-level, undefeated trainers. (Add param 'dungeon' to include partially completed dungeons.)",
CMD_Pivots_Name = "Pivots Seen",
CMD_Pivots_Help = "name > Displays known early game wild encounters for an area.",
CMD_Pivots_Help = "> Displays known early game wild encounters for an area.",
CMD_Revo_Name = "Pokémon Random Evolutions",
CMD_Revo_Help = "name [target-evo] > Displays randomized evolution possibilities for a Pokémon, and it's [target-evo] if more than one available.",
CMD_Coverage_Name = "Move Coverage Effectiveness",
Expand Down Expand Up @@ -833,6 +840,7 @@ ScreenResources{
CommandsUsageSyntax = "Usage Syntax", -- NEEDS TRANSLATION
CommandsExampleUsage = "Example Usage", -- NEEDS TRANSLATION
PokemonInfoBST = "BST", -- NEEDS TRANSLATION
PokemonInfoEXP = "EXP", -- NEEDS TRANSLATION
PokemonInfoWeight = "Weight", -- NEEDS TRANSLATION
PokemonInfoEvolution = "Evolution", -- NEEDS TRANSLATION
PokemonInfoKg = "kg", -- NEEDS TRANSLATION
Expand Down
10 changes: 9 additions & 1 deletion ironmon_tracker/Languages/Japanese.lua
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ ScreenResources{
HeaderTabMisc = "Misc.", -- NEEDS TRANSLATION
LabelBaseStats = "Base Stats", -- NEEDS TRANSLATION
LabelBSTTotal = "Total", -- NEEDS TRANSLATION
LabelYourIVs = "Your IVs", -- NEEDS TRANSLATION
LabelYourEVs = "Your EVs", -- NEEDS TRANSLATION
LabelShowIVs = "Show IVs", -- NEEDS TRANSLATION
LabelShowEVs = "Show EVs", -- NEEDS TRANSLATION
LabelShowBST = "Show BST", -- NEEDS TRANSLATION
ButtonLevelupMoves = "Levelup Moves", -- NEEDS TRANSLATION
ButtonTMMoves = "TM Moves", -- NEEDS TRANSLATION
LabelGymTMs = "Gym TMs", -- NEEDS TRANSLATION
Expand Down Expand Up @@ -616,8 +621,10 @@ ScreenResources{
CMD_Route_Help = "name > Displays trainer and wild encounter info for a route or area.",
CMD_Dungeon_Name = "Dungeon Info",
CMD_Dungeon_Help = "name > Displays info about which trainers have been defeated for an area.",
CMD_Unfought_Name = "Unfought Trainers",
CMD_Unfought_Help = "[dungeon] [sevii]> Displays a list of areas ordered by lowest-level, undefeated trainers. (Add param 'dungeon' to include partially completed dungeons.)",
CMD_Pivots_Name = "Pivots Seen",
CMD_Pivots_Help = "name > Displays known early game wild encounters for an area.",
CMD_Pivots_Help = "> Displays known early game wild encounters for an area.",
CMD_Revo_Name = "Pokémon Random Evolutions",
CMD_Revo_Help = "name [target-evo] > Displays randomized evolution possibilities for a Pokémon, and it's [target-evo] if more than one available.",
CMD_Coverage_Name = "Move Coverage Effectiveness",
Expand Down Expand Up @@ -835,6 +842,7 @@ ScreenResources{
CommandsUsageSyntax = "Usage Syntax", -- NEEDS TRANSLATION
CommandsExampleUsage = "Example Usage", -- NEEDS TRANSLATION
PokemonInfoBST = "BST", -- NEEDS TRANSLATION
PokemonInfoEXP = "EXP", -- NEEDS TRANSLATION
PokemonInfoWeight = "Weight", -- NEEDS TRANSLATION
PokemonInfoEvolution = "Evolution", -- NEEDS TRANSLATION
PokemonInfoKg = "kg", -- NEEDS TRANSLATION
Expand Down
10 changes: 9 additions & 1 deletion ironmon_tracker/Languages/Spanish.lua
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,11 @@ ScreenResources{
HeaderTabMisc = "Misc.", -- NEEDS TRANSLATION
LabelBaseStats = "Base Stats", -- NEEDS TRANSLATION
LabelBSTTotal = "Total", -- NEEDS TRANSLATION
LabelYourIVs = "Your IVs", -- NEEDS TRANSLATION
LabelYourEVs = "Your EVs", -- NEEDS TRANSLATION
LabelShowIVs = "Show IVs", -- NEEDS TRANSLATION
LabelShowEVs = "Show EVs", -- NEEDS TRANSLATION
LabelShowBST = "Show BST", -- NEEDS TRANSLATION
ButtonLevelupMoves = "Levelup Moves", -- NEEDS TRANSLATION
ButtonTMMoves = "TM Moves", -- NEEDS TRANSLATION
LabelGymTMs = "Gym TMs", -- NEEDS TRANSLATION
Expand Down Expand Up @@ -614,8 +619,10 @@ ScreenResources{
CMD_Route_Help = "name > Displays trainer and wild encounter info for a route or area.",
CMD_Dungeon_Name = "Dungeon Info",
CMD_Dungeon_Help = "name > Displays info about which trainers have been defeated for an area.",
CMD_Unfought_Name = "Unfought Trainers",
CMD_Unfought_Help = "[dungeon] [sevii]> Displays a list of areas ordered by lowest-level, undefeated trainers. (Add param 'dungeon' to include partially completed dungeons.)",
CMD_Pivots_Name = "Pivots Seen",
CMD_Pivots_Help = "name > Displays known early game wild encounters for an area.",
CMD_Pivots_Help = "> Displays known early game wild encounters for an area.",
CMD_Revo_Name = "Pokémon Random Evolutions",
CMD_Revo_Help = "name [target-evo] > Displays randomized evolution possibilities for a Pokémon, and it's [target-evo] if more than one available.",
CMD_Coverage_Name = "Move Coverage Effectiveness",
Expand Down Expand Up @@ -833,6 +840,7 @@ ScreenResources{
CommandsUsageSyntax = "Usage Syntax", -- NEEDS TRANSLATION
CommandsExampleUsage = "Example Usage", -- NEEDS TRANSLATION
PokemonInfoBST = "BST", -- NEEDS TRANSLATION
PokemonInfoEXP = "EXP", -- NEEDS TRANSLATION
PokemonInfoWeight = "Weight", -- NEEDS TRANSLATION
PokemonInfoEvolution = "Evolution", -- NEEDS TRANSLATION
PokemonInfoKg = "kg", -- NEEDS TRANSLATION
Expand Down
4 changes: 4 additions & 0 deletions ironmon_tracker/MGBADisplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,13 @@ MGBADisplay.LineBuilder = {

MGBADisplay.DataFormatter.formatPokemonInfo(data)

-- If viewing the mon, note that exp gained is calculated based on the viewed mon's level
local markExpAsBoosted = data.x.viewedPokemonLevel ~= 0 and "*" or ""

local labelBar = "%-12s %s"
table.insert(lines, Utils.formatUTF8("%-13s%s", data.p.name, Utils.formatUTF8("[%s]", data.p.typeline)))
table.insert(lines, Utils.formatUTF8(labelBar, Resources.MGBAScreens.PokemonInfoBST .. ":", data.p.bst))
table.insert(lines, Utils.formatUTF8(labelBar, Resources.MGBAScreens.PokemonInfoEXP .. ":", data.p.expYield .. markExpAsBoosted))
table.insert(lines, Utils.formatUTF8(labelBar, Resources.MGBAScreens.PokemonInfoWeight .. ":", data.p.weight))
table.insert(lines, Utils.formatUTF8(labelBar, Resources.MGBAScreens.PokemonInfoEvolution .. ":", data.p.evodetails))

Expand Down
2 changes: 1 addition & 1 deletion ironmon_tracker/Main.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Main = {}

-- The latest version of the tracker. Should be updated with each PR.
Main.Version = { major = "8", minor = "6", patch = "0" }
Main.Version = { major = "8", minor = "6", patch = "1" }

Main.CreditsList = { -- based on the PokemonBizhawkLua project by MKDasher
CreatedBy = "Besteon",
Expand Down
56 changes: 34 additions & 22 deletions ironmon_tracker/Program.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ Program = {
offsetBattleResultsLastAttackerMove = 0x22,
offsetBattleCommConfirmedCount = 0x4,
offsetBattleCommLevitate = 0x6,
offsetPokemonSubstruct = 0x20,
offsetPokemonStatus = 0x50,
offsetPokemonStatsLvCurHp = 0x54,
offsetPokemonStatsMaxHpAtk = 0x58,
offsetPokemonStatsDefSpe = 0x5C,
offsetPokemonStatsSpaSpd = 0x60,

sizeofBaseStatsPokemon = 0x1C,
sizeofExpTablePokemon = 0x194,
Expand All @@ -55,7 +61,12 @@ Program = {
sizeofTMHMMoveId = 0x2,
sizeofGameStat = 0x4,
sizeofLastAttackerMove = 0x2,
sizeofPokemonStruct = 0x64,
sizeofPokemonNickname = 0xA,
},
Values = {
ShinyOdds = 8, -- n/65536
}
}

Program.GameData = {
Expand Down Expand Up @@ -629,7 +640,7 @@ function Program.updatePokemonTeams()
end

-- Next Pokemon - Each is offset by 100 bytes
addressOffset = addressOffset + 100
addressOffset = addressOffset + Program.Addresses.sizeofPokemonStruct
end
end

Expand All @@ -645,27 +656,27 @@ function Program.readNewPokemon(startAddress, personality)
local miscoffset = (MiscData.TableData.misc[aux] - 1) * 12

-- Pokemon Data substructure: https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_data_substructures_(Generation_III)
local growth1 = Utils.bit_xor(Memory.readdword(startAddress + 32 + growthoffset), magicword)
local growth2 = Utils.bit_xor(Memory.readdword(startAddress + 32 + growthoffset + 4), magicword) -- Experience
local growth3 = Utils.bit_xor(Memory.readdword(startAddress + 32 + growthoffset + 8), magicword)
local attack1 = Utils.bit_xor(Memory.readdword(startAddress + 32 + attackoffset), magicword)
local attack2 = Utils.bit_xor(Memory.readdword(startAddress + 32 + attackoffset + 4), magicword)
local attack3 = Utils.bit_xor(Memory.readdword(startAddress + 32 + attackoffset + 8), magicword)
local effort1 = Utils.bit_xor(Memory.readdword(startAddress + 32 + effortoffset), magicword)
local effort2 = Utils.bit_xor(Memory.readdword(startAddress + 32 + effortoffset + 4), magicword)
local misc2 = Utils.bit_xor(Memory.readdword(startAddress + 32 + miscoffset + 4), magicword)
local growth1 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + growthoffset), magicword)
local growth2 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + growthoffset + 4), magicword) -- Experience
local growth3 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + growthoffset + 8), magicword)
local attack1 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + attackoffset), magicword)
local attack2 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + attackoffset + 4), magicword)
local attack3 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + attackoffset + 8), magicword)
local effort1 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + effortoffset), magicword)
local effort2 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + effortoffset + 4), magicword)
local misc2 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + miscoffset + 4), magicword)

local nickname = ""
for i=0, 9, 1 do
for i=0, Program.Addresses.sizeofPokemonNickname - 1, 1 do
local charByte = Memory.readbyte(startAddress + 8 + i)
if charByte == Program.Addresses.nicknameCharEnd then break end -- end of sequence
nickname = nickname .. (GameSettings.GameCharMap[charByte] or Constants.HIDDEN_INFO)
end
nickname = Utils.formatSpecialCharacters(nickname)

-- Unused data memory reads
-- local effort3 = Utils.bit_xor(Memory.readdword(startAddress + 32 + effortoffset + 8), magicword)
-- local misc3 = Utils.bit_xor(Memory.readdword(startAddress + 32 + miscoffset + 8), magicword)
-- local effort3 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + effortoffset + 8), magicword)
-- local misc3 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + miscoffset + 8), magicword)

-- Checksum, currently unused
-- local cs = Utils.addhalves(growth1) + Utils.addhalves(growth2) + Utils.addhalves(growth3)
Expand All @@ -682,16 +693,16 @@ function Program.readNewPokemon(startAddress, personality)
local secretID = Utils.getbits(otid, 16, 16)
local p1 = math.floor(personality / 65536)
local p2 = personality % 65536
local isShiny = Utils.bit_xor(Utils.bit_xor(Utils.bit_xor(trainerID, secretID), p1), p2) < 8
local isShiny = Utils.bit_xor(Utils.bit_xor(Utils.bit_xor(trainerID, secretID), p1), p2) < Program.Values.ShinyOdds
local hasPokerus
if GameSettings.game ~= 3 then -- PokeRus doesn't exist in FRLG due to lack of passing time
local misc1 = Utils.bit_xor(Memory.readdword(startAddress + 32 + miscoffset), magicword)
local misc1 = Utils.bit_xor(Memory.readdword(startAddress + Program.Addresses.offsetPokemonSubstruct + miscoffset), magicword)
-- First 4 bits are number of days until Pokerus is cured, Second 4 bits are the strain variation
hasPokerus = Utils.getbits(misc1, 0, 8) > 0
end

-- Determine status condition
local status_aux = Memory.readdword(startAddress + 80)
local status_aux = Memory.readdword(startAddress + Program.Addresses.offsetPokemonStatus)
local sleep_turns_result = 0
local status_result = 0
if status_aux == 0 then --None
Expand All @@ -712,10 +723,10 @@ function Program.readNewPokemon(startAddress, personality)
end

-- Can likely improve this further using memory.read_bytes_as_array but would require testing to verify
local level_and_currenthp = Memory.readdword(startAddress + 84)
local maxhp_and_atk = Memory.readdword(startAddress + 88)
local def_and_speed = Memory.readdword(startAddress + 92)
local spatk_and_spdef = Memory.readdword(startAddress + 96)
local level_and_currenthp = Memory.readdword(startAddress + Program.Addresses.offsetPokemonStatsLvCurHp)
local maxhp_and_atk = Memory.readdword(startAddress + Program.Addresses.offsetPokemonStatsMaxHpAtk)
local def_and_speed = Memory.readdword(startAddress + Program.Addresses.offsetPokemonStatsDefSpe)
local spatk_and_spdef = Memory.readdword(startAddress + Program.Addresses.offsetPokemonStatsSpaSpd)

return Program.DefaultPokemon:new({
personality = personality,
Expand Down Expand Up @@ -1147,10 +1158,11 @@ end

--- Returns a list of trainerIds of trainers defeated in the combined area (Use RouteData.CombinedAreas), as well as the total number of trainers in those areas
--- @param mapIdList table
--- @param saveBlock1Addr number? (Optional) Include the SaveBlock 1 address if known to avoid extra memory reads
--- @return table defeatedTrainers, number totalTrainers
function Program.getDefeatedTrainersByCombinedArea(mapIdList)
function Program.getDefeatedTrainersByCombinedArea(mapIdList, saveBlock1Addr)
if type(mapIdList) ~= "table" then return {}, 0 end
local saveBlock1Addr = Utils.getSaveBlock1Addr()
saveBlock1Addr = saveBlock1Addr or Utils.getSaveBlock1Addr()
local totalTrainers = 0
local defeatedTrainers = {}
for _, mapId in ipairs(mapIdList) do
Expand Down
Loading

0 comments on commit b13c0e1

Please sign in to comment.