Rearranged some code relating to data and its caching

This commit is contained in:
Maruno17
2020-09-07 22:48:11 +01:00
parent 7221e88be4
commit e987c10472
13 changed files with 414 additions and 380 deletions

View File

@@ -1,3 +1,6 @@
#===============================================================================
# Trainers data
#===============================================================================
TPSPECIES = 0
TPLEVEL = 1
TPITEM = 2
@@ -15,6 +18,32 @@ TPBALL = 13
TPEV = 14
TPLOSETEXT = 15
module TrainersMetadata
InfoTypes = {
"Items" => [0, "eEEEEEEE", PBItems, PBItems, PBItems, PBItems,
PBItems, PBItems, PBItems, PBItems],
"Pokemon" => [TPSPECIES, "ev", PBSpecies,nil], # Species, level
"Item" => [TPITEM, "e", PBItems],
"Moves" => [TPMOVES, "eEEE", PBMoves, PBMoves, PBMoves, PBMoves],
"Ability" => [TPABILITY, "u"],
"Gender" => [TPGENDER, "e", { "M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0,
"F" => 1, "f" => 1, "Female" => 1, "female" => 1, "1" => 1 }],
"Form" => [TPFORM, "u"],
"Shiny" => [TPSHINY, "b"],
"Nature" => [TPNATURE, "e", PBNatures],
"IV" => [TPIV, "uUUUUU"],
"Happiness" => [TPHAPPINESS, "u"],
"Name" => [TPNAME, "s"],
"Shadow" => [TPSHADOW, "b"],
"Ball" => [TPBALL, "u"],
"EV" => [TPEV, "uUUUUU"],
"LoseText" => [TPLOSETEXT, "s"]
}
end
#===============================================================================
#
#===============================================================================
def pbLoadTrainer(trainerid,trainername,partyid=0)
if trainerid.is_a?(String) || trainerid.is_a?(Symbol)
if !hasConst?(PBTrainers,trainerid)