Moved species data constants into module SpeciesData

This commit is contained in:
Maruno17
2020-10-17 00:17:40 +01:00
parent e82b5409fb
commit d3ec5c2c53
25 changed files with 348 additions and 347 deletions

View File

@@ -134,10 +134,11 @@ def pbGetSpeciesData(species, form = 0, species_data_type = -1)
end
return species_data[s][species_data_type] if species_data[s] && species_data[s][species_data_type]
case species_data_type
when SpeciesType2; return nil
when SpeciesBaseStats; return [1, 1, 1, 1, 1, 1]
when SpeciesEffortPoints; return [0, 0, 0, 0, 0, 0]
when SpeciesStepsToHatch, SpeciesHeight, SpeciesWeight; return 1
when SpeciesData::TYPE2; return nil
when SpeciesData::BASE_STATS; return [1, 1, 1, 1, 1, 1]
when SpeciesData::EFFORT_POINTS; return [0, 0, 0, 0, 0, 0]
when SpeciesData::STEPS_TO_HATCH, SpeciesData::HEIGHT, SpeciesData::WEIGHT
return 1
end
return 0
end

View File

@@ -31,7 +31,7 @@ module PhoneMsgType
end
#===============================================================================
# Global and map metadata
# Global metadata
#===============================================================================
module Metadata
HOME = 1
@@ -123,100 +123,100 @@ end
#===============================================================================
# Pokémon data
#===============================================================================
SpeciesType1 = 0
SpeciesType2 = 1
SpeciesBaseStats = 2
SpeciesGenderRate = 3
SpeciesGrowthRate = 4
SpeciesBaseExp = 5
SpeciesEffortPoints = 6
SpeciesRareness = 7
SpeciesHappiness = 8
SpeciesAbilities = 9
SpeciesHiddenAbility = 10
SpeciesCompatibility = 11
SpeciesStepsToHatch = 12
SpeciesHeight = 13
SpeciesWeight = 14
SpeciesColor = 15
SpeciesShape = 16
SpeciesHabitat = 17
SpeciesWildItemCommon = 18
SpeciesWildItemUncommon = 19
SpeciesWildItemRare = 20
SpeciesIncense = 21
SpeciesPokedexForm = 22 # For alternate forms
SpeciesMegaStone = 23 # For alternate forms
SpeciesMegaMove = 24 # For alternate forms
SpeciesUnmegaForm = 25 # For alternate forms
SpeciesMegaMessage = 26 # For alternate forms
module SpeciesData
TYPE1 = 0
TYPE2 = 1
BASE_STATS = 2
GENDER_RATE = 3
GROWTH_RATE = 4
BASE_EXP = 5
EFFORT_POINTS = 6
RARENESS = 7
HAPPINESS = 8
ABILITIES = 9
HIDDEN_ABILITY = 10
COMPATIBILITY = 11
STEPS_TO_HATCH = 12
HEIGHT = 13
WEIGHT = 14
COLOR = 15
SHAPE = 16
HABITAT = 17
WILD_ITEM_COMMON = 18
WILD_ITEM_UNCOMMON = 19
WILD_ITEM_RARE = 20
INCENSE = 21
POKEDEX_FORM = 22 # For alternate forms
MEGA_STONE = 23 # For alternate forms
MEGA_MOVE = 24 # For alternate forms
UNMEGA_FORM = 25 # For alternate forms
MEGA_MESSAGE = 26 # For alternate forms
MetricBattlerPlayerX = 0
MetricBattlerPlayerY = 1
MetricBattlerEnemyX = 2
MetricBattlerEnemyY = 3
MetricBattlerAltitude = 4
MetricBattlerShadowX = 5
MetricBattlerShadowSize = 6
METRIC_PLAYER_X = 0
METRIC_PLAYER_Y = 1
METRIC_ENEMY_X = 2
METRIC_ENEMY_Y = 3
METRIC_ALTITUDE = 4
METRIC_SHADOW_X = 5
METRIC_SHADOW_SIZE = 6
module PokemonSpeciesData
def self.requiredValues(compilingForms=false)
def self.requiredValues(compilingForms = false)
ret = {
"Type1" => [SpeciesType1, "e", :PBTypes],
"BaseStats" => [SpeciesBaseStats, "vvvvvv"],
"BaseEXP" => [SpeciesBaseExp, "v"],
"EffortPoints" => [SpeciesEffortPoints, "uuuuuu"],
"Rareness" => [SpeciesRareness, "u"],
"Happiness" => [SpeciesHappiness, "u"],
"Compatibility" => [SpeciesCompatibility, "eE", :PBEggGroups, :PBEggGroups],
"StepsToHatch" => [SpeciesStepsToHatch, "v"],
"Height" => [SpeciesHeight, "f"],
"Weight" => [SpeciesWeight, "f"],
"Color" => [SpeciesColor, "e", :PBColors],
"Shape" => [SpeciesShape, "u"],
"Moves" => [0, "*ue", nil, :PBMoves],
"Kind" => [0, "s"],
"Pokedex" => [0, "q"]
"Type1" => [TYPE1, "e", :PBTypes],
"BaseStats" => [BASE_STATS, "vvvvvv"],
"BaseEXP" => [BASE_EXP, "v"],
"EffortPoints" => [EFFORT_POINTS, "uuuuuu"],
"Rareness" => [RARENESS, "u"],
"Happiness" => [HAPPINESS, "u"],
"Compatibility" => [COMPATIBILITY, "eE", :PBEggGroups, :PBEggGroups],
"StepsToHatch" => [STEPS_TO_HATCH, "v"],
"Height" => [HEIGHT, "f"],
"Weight" => [WEIGHT, "f"],
"Color" => [COLOR, "e", :PBColors],
"Shape" => [SHAPE, "u"],
"Moves" => [0, "*ue", nil, :PBMoves],
"Kind" => [0, "s"],
"Pokedex" => [0, "q"]
}
if !compilingForms
ret["GenderRate"] = [SpeciesGenderRate, "e", :PBGenderRates]
ret["GrowthRate"] = [SpeciesGrowthRate, "e", :PBGrowthRates]
ret["Name"] = [0, "s"]
ret["InternalName"] = [0, "n"]
ret["GenderRate"] = [GENDER_RATE, "e", :PBGenderRates]
ret["GrowthRate"] = [GROWTH_RATE, "e", :PBGrowthRates]
ret["Name"] = [0, "s"]
ret["InternalName"] = [0, "n"]
end
return ret
end
def self.optionalValues(compilingForms = false)
ret = {
"Type2" => [SpeciesType2, "e", :PBTypes],
"Abilities" => [SpeciesAbilities, "eE", :PBAbilities, :PBAbilities],
"HiddenAbility" => [SpeciesHiddenAbility, "eEEE", :PBAbilities, :PBAbilities,
:PBAbilities, :PBAbilities],
"Habitat" => [SpeciesHabitat, "e", :PBHabitats],
"WildItemCommon" => [SpeciesWildItemCommon, "e", :PBItems],
"WildItemUncommon" => [SpeciesWildItemUncommon, "e", :PBItems],
"WildItemRare" => [SpeciesWildItemRare, "e", :PBItems],
"BattlerPlayerX" => [MetricBattlerPlayerX, "i"],
"BattlerPlayerY" => [MetricBattlerPlayerY, "i"],
"BattlerEnemyX" => [MetricBattlerEnemyX, "i"],
"BattlerEnemyY" => [MetricBattlerEnemyY, "i"],
"BattlerAltitude" => [MetricBattlerAltitude, "i"],
"BattlerShadowX" => [MetricBattlerShadowX, "i"],
"BattlerShadowSize" => [MetricBattlerShadowSize, "u"],
"EggMoves" => [0, "*e", :PBMoves],
"FormName" => [0, "q"],
"Evolutions" => [0, "*ses", nil, :PBEvolution, nil]
"Type2" => [TYPE2, "e", :PBTypes],
"Abilities" => [ABILITIES, "eE", :PBAbilities, :PBAbilities],
"HiddenAbility" => [HIDDEN_ABILITY, "eEEE", :PBAbilities, :PBAbilities,
:PBAbilities, :PBAbilities],
"Habitat" => [HABITAT, "e", :PBHabitats],
"WildItemCommon" => [WILD_ITEM_COMMON, "e", :PBItems],
"WildItemUncommon" => [WILD_ITEM_UNCOMMON, "e", :PBItems],
"WildItemRare" => [WILD_ITEM_RARE, "e", :PBItems],
"BattlerPlayerX" => [METRIC_PLAYER_X, "i"],
"BattlerPlayerY" => [METRIC_PLAYER_Y, "i"],
"BattlerEnemyX" => [METRIC_ENEMY_X, "i"],
"BattlerEnemyY" => [METRIC_ENEMY_Y, "i"],
"BattlerAltitude" => [METRIC_ALTITUDE, "i"],
"BattlerShadowX" => [METRIC_SHADOW_X, "i"],
"BattlerShadowSize" => [METRIC_SHADOW_SIZE, "u"],
"EggMoves" => [0, "*e", :PBMoves],
"FormName" => [0, "q"],
"Evolutions" => [0, "*ses", nil, :PBEvolution, nil]
}
if compilingForms
ret["PokedexForm"] = [SpeciesPokedexForm, "u"]
ret["MegaStone"] = [SpeciesMegaStone, "e", :PBItems]
ret["MegaMove"] = [SpeciesMegaMove, "e", :PBMoves]
ret["UnmegaForm"] = [SpeciesUnmegaForm, "u"]
ret["MegaMessage"] = [SpeciesMegaMessage, "u"]
ret["PokedexForm"] = [POKEDEX_FORM, "u"]
ret["MegaStone"] = [MEGA_STONE, "e", :PBItems]
ret["MegaMove"] = [MEGA_MOVE, "e", :PBMoves]
ret["UnmegaForm"] = [UNMEGA_FORM, "u"]
ret["MegaMessage"] = [MEGA_MESSAGE, "u"]
else
ret["Incense"] = [SpeciesIncense, "e", :PBItems]
ret["RegionalNumbers"] = [0, "*u"]
ret["Incense"] = [INCENSE, "e", :PBItems]
ret["RegionalNumbers"] = [0, "*u"]
end
return ret
end

View File

@@ -167,7 +167,7 @@ module PokeBattle_BattleCommon
return 4 if $DEBUG && Input.press?(Input::CTRL)
# Get a rareness if one wasn't provided
if !rareness
rareness = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesRareness)
rareness = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesData::RARENESS)
end
# Modify rareness depending on the Poké Ball's effect
ultraBeast = (battler.isSpecies?(:NIHILEGO) ||

View File

@@ -428,7 +428,7 @@ class PokeBattle_SafariZone
@scene.pbSafariStart
@scene.pbCommonAnimation(PBWeather.animationName(@weather))
safariBall = getConst(PBItems,:SAFARIBALL)
rareness = pbGetSpeciesData(wildpoke.species,wildpoke.form,SpeciesRareness)
rareness = pbGetSpeciesData(wildpoke.species,wildpoke.form,SpeciesData::RARENESS)
catchFactor = (rareness*100)/1275
catchFactor = [[catchFactor,3].max,20].min
escapeFactor = (pbEscapeRate(rareness)*100)/1275

View File

@@ -147,7 +147,7 @@ BallHandlers::ModifyCatchRate.add(:QUICKBALL,proc { |ball,catchRate,battle,battl
})
BallHandlers::ModifyCatchRate.add(:FASTBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
baseStats = pbGetSpeciesData(battler.species,battler.form,SpeciesBaseStats)
baseStats = pbGetSpeciesData(battler.species,battler.form,SpeciesData::BASE_STATS)
baseSpeed = baseStats[PBStats::SPEED]
catchRate *= 4 if baseSpeed>=100
next [catchRate,255].min

View File

@@ -253,8 +253,8 @@ class PokemonEncounters
newChances = []
speciesData = pbLoadSpeciesData
for i in 0...encList.length
t1 = speciesData[encList[i][0]][SpeciesType1]
t2 = speciesData[encList[i][0]][SpeciesType2]
t1 = speciesData[encList[i][0]][SpeciesData::TYPE1]
t2 = speciesData[encList[i][0]][SpeciesData::TYPE2]
next if t1!=favoredType && (!t2 || t2!=favoredType)
newEncList.push(encList[i])
newChances.push(chances[i])

View File

@@ -105,7 +105,7 @@ end
# Check compatibility of Pokémon in the Day Care.
#===============================================================================
def pbIsDitto?(pkmn)
compat = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesCompatibility)
compat = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesData::COMPATIBILITY)
if compat.is_a?(Array)
return compat.include?(getConst(PBEggGroups,:Ditto))
end
@@ -129,14 +129,14 @@ def pbDayCareGetCompat
return 0 if pkmn1.shadowPokemon?
return 0 if pkmn2.shadowPokemon?
# Insert code here if certain forms of certain species cannot breed
compat1 = pbGetSpeciesData(pkmn1.species,pkmn1.form,SpeciesCompatibility)
compat1 = pbGetSpeciesData(pkmn1.species,pkmn1.form,SpeciesData::COMPATIBILITY)
if compat1.is_a?(Array)
compat10 = compat1[0] || 0
compat11 = compat1[1] || compat10
else
compat10 = compat11 = compat || 0
end
compat2 = pbGetSpeciesData(pkmn2.species,pkmn2.form,SpeciesCompatibility)
compat2 = pbGetSpeciesData(pkmn2.species,pkmn2.form,SpeciesData::COMPATIBILITY)
if compat2.is_a?(Array)
compat20 = compat2[0] || 0
compat21 = compat2[1] || compat20
@@ -396,7 +396,7 @@ def pbDayCareGenerateEgg
egg.calcStats
egg.obtainText = _INTL("Day-Care Couple")
egg.name = _INTL("Egg")
eggSteps = pbGetSpeciesData(babyspecies,egg.form,SpeciesStepsToHatch)
eggSteps = pbGetSpeciesData(babyspecies,egg.form,SpeciesData::STEPS_TO_HATCH)
egg.eggsteps = eggSteps
egg.givePokerus if rand(65536)<POKERUS_CHANCE
# Add egg to party

View File

@@ -27,7 +27,7 @@ class Pokemon
# second natural (1) or a hidden (2-5) ability available to its species.
# It is not possible to give the Pokémon any ability other than those
# defined in the PBS file "pokemon.txt" for its species
# (or "pokemonforms.txt" for its species and form).
# (or "pokemonforms.txt" for its species and form).
# @return [0, 1, 2, 3, 4, 5, nil] forced ability index (nil if none is set)
attr_accessor :abilityflag
# If defined, forces this Pokémon to be male (0) or female (1).
@@ -54,7 +54,7 @@ class Pokemon
# sleep (number of rounds before waking up), toxic (0 = regular poison, 1 = toxic)
attr_reader :statusCount
# Another Pokémon which has been fused with this Pokémon (or nil if there is none).
# Currently only used by Kyurem, to record a fused Reshiram or Zekrom.
# Currently only used by Kyurem, to record a fused Reshiram or Zekrom.
# @return [Pokemon, nil] the Pokémon fused into this one (nil if there is none)
attr_accessor :fused
# @return [Array<Integer>] an array of IV values for HP, Atk, Def, Speed, Sp. Atk and Sp. Def
@@ -205,12 +205,12 @@ class Pokemon
# @return [Integer] this Pokémon's growth rate (from PBGrowthRates)
def growthrate
return pbGetSpeciesData(@species, formSimple, SpeciesGrowthRate)
return pbGetSpeciesData(@species, formSimple, SpeciesData::GROWTH_RATE)
end
# @return [Integer] this Pokémon's base Experience value
def baseExp
return pbGetSpeciesData(@species, formSimple, SpeciesBaseExp)
return pbGetSpeciesData(@species, formSimple, SpeciesData::BASE_EXP)
end
# @return [Float] a number between 0 and 1 indicating how much of the current level's
@@ -231,7 +231,7 @@ class Pokemon
# @return [0, 1, 2] this Pokémon's gender (0 = male, 1 = female, 2 = genderless)
def gender
# Return sole gender option for all male/all female/genderless species
gender_rate = pbGetSpeciesData(@species, formSimple, SpeciesGenderRate)
gender_rate = pbGetSpeciesData(@species, formSimple, SpeciesData::GENDER_RATE)
case gender_rate
when PBGenderRates::AlwaysMale; return 0
when PBGenderRates::AlwaysFemale; return 1
@@ -245,7 +245,7 @@ class Pokemon
# @return [Boolean] whether this Pokémon species is restricted to only ever being one
# gender (or genderless)
def singleGendered?
gender_rate = pbGetSpeciesData(@species, formSimple, SpeciesGenderRate)
gender_rate = pbGetSpeciesData(@species, formSimple, SpeciesData::GENDER_RATE)
return gender_rate == PBGenderRates::AlwaysMale ||
gender_rate == PBGenderRates::AlwaysFemale ||
gender_rate == PBGenderRates::Genderless
@@ -295,7 +295,7 @@ class Pokemon
abilIndex = abilityIndex
# Hidden ability
if abilIndex >= 2
hiddenAbil = pbGetSpeciesData(@species, formSimple, SpeciesHiddenAbility)
hiddenAbil = pbGetSpeciesData(@species, formSimple, SpeciesData::HIDDEN_ABILITY)
if hiddenAbil.is_a?(Array)
ret = hiddenAbil[abilIndex - 2]
return ret if ret && ret > 0
@@ -305,7 +305,7 @@ class Pokemon
abilIndex = (@personalID & 1)
end
# Natural ability
abilities = pbGetSpeciesData(@species, formSimple, SpeciesAbilities)
abilities = pbGetSpeciesData(@species, formSimple, SpeciesData::ABILITIES)
if abilities.is_a?(Array)
ret = abilities[abilIndex]
ret = abilities[(abilIndex + 1) % 2] if !ret || ret == 0
@@ -341,13 +341,13 @@ class Pokemon
# where every element is [ability ID, ability index]
def getAbilityList
ret = []
abilities = pbGetSpeciesData(@species, formSimple, SpeciesAbilities)
abilities = pbGetSpeciesData(@species, formSimple, SpeciesData::ABILITIES)
if abilities.is_a?(Array)
abilities.each_with_index { |a, i| ret.push([a, i]) if a && a > 0 }
else
ret.push([abilities, 0]) if abilities > 0
end
hiddenAbil = pbGetSpeciesData(@species, formSimple, SpeciesHiddenAbility)
hiddenAbil = pbGetSpeciesData(@species, formSimple, SpeciesData::HIDDEN_ABILITY)
if hiddenAbil.is_a?(Array)
hiddenAbil.each_with_index { |a, i| ret.push([a, i + 2]) if a && a > 0 }
else
@@ -465,20 +465,20 @@ class Pokemon
# @return [Integer] this Pokémon's first type
def type1
return pbGetSpeciesData(@species, formSimple, SpeciesType1)
return pbGetSpeciesData(@species, formSimple, SpeciesData::TYPE1)
end
# @return [Integer] this Pokémon's second type, or the first type if none is defined
def type2
ret = pbGetSpeciesData(@species, formSimple, SpeciesType2)
ret = pbGetSpeciesData(@species, formSimple, SpeciesType1) if !ret
ret = pbGetSpeciesData(@species, formSimple, SpeciesData::TYPE2)
ret = pbGetSpeciesData(@species, formSimple, SpeciesData::TYPE1) if !ret
return ret
end
# @return [Array<Integer>] an array of this Pokémon's types
def types
ret1 = pbGetSpeciesData(@species, formSimple, SpeciesType1)
ret2 = pbGetSpeciesData(@species, formSimple, SpeciesType2)
ret1 = pbGetSpeciesData(@species, formSimple, SpeciesData::TYPE1)
ret2 = pbGetSpeciesData(@species, formSimple, SpeciesData::TYPE2)
ret = [ret1]
ret.push(ret2) if ret2 && ret2 != ret1
return ret
@@ -664,7 +664,7 @@ class Pokemon
def sheen
return @sheen || 0
end
# @return [Integer] the number of ribbons this Pokémon has
def ribbonCount
return (@ribbons) ? @ribbons.length : 0
@@ -752,9 +752,9 @@ class Pokemon
# @return [Array<Integer>] the items this species can be found holding in the wild
def wildHoldItems
ret = []
ret.push(pbGetSpeciesData(@species, formSimple, SpeciesWildItemCommon))
ret.push(pbGetSpeciesData(@species, formSimple, SpeciesWildItemUncommon))
ret.push(pbGetSpeciesData(@species, formSimple, SpeciesWildItemRare))
ret.push(pbGetSpeciesData(@species, formSimple, SpeciesData::WILD_ITEM_COMMON))
ret.push(pbGetSpeciesData(@species, formSimple, SpeciesData::WILD_ITEM_UNCOMMON))
ret.push(pbGetSpeciesData(@species, formSimple, SpeciesData::WILD_ITEM_RARE))
return ret
end
@@ -800,26 +800,26 @@ class Pokemon
return !egg? && @hp > 0
end
alias isAble? able?
# @return [Boolean] whether the Pokémon is fainted
def fainted?
return !egg? && @hp <= 0
end
alias isFainted? fainted?
# Heals all HP of this Pokémon.
def healHP
return if egg?
@hp = @totalhp
end
# Heals the status problem of this Pokémon.
def healStatus
return if egg?
@status = PBStatuses::NONE
@statusCount = 0
end
# Restores all PP of this Pokémon. If a move index is given, restores the PP
# of the move in that index.
# @param move_index [Integer] index of the move to heal (-1 if all moves
@@ -832,7 +832,7 @@ class Pokemon
@moves.each { |m| m.pp = m.totalpp }
end
end
# Heals all HP, PP, and status problems of this Pokémon.
def heal
return if egg?
@@ -890,12 +890,12 @@ class Pokemon
# @return [Integer] the height of this Pokémon in decimetres (0.1 metres)
def height
return pbGetSpeciesData(@species, formSimple, SpeciesHeight)
return pbGetSpeciesData(@species, formSimple, SpeciesData::HEIGHT)
end
# @return [Integer] the weight of this Pokémon in hectograms (0.1 kilograms)
def weight
return pbGetSpeciesData(@species, formSimple, SpeciesWeight)
return pbGetSpeciesData(@species, formSimple, SpeciesData::WEIGHT)
end
# Returns an array of booleans indicating whether a stat is made to have
@@ -918,7 +918,7 @@ class Pokemon
# @return [Array<Integer>] the EV yield of this Pokémon (an array of six values)
def evYield
ret = pbGetSpeciesData(@species, formSimple, SpeciesEffortPoints)
ret = pbGetSpeciesData(@species, formSimple, SpeciesData::EFFORT_POINTS)
return ret.clone
end
@@ -998,7 +998,7 @@ class Pokemon
# @return [Array<Integer>] this Pokémon's base stats, an array of six values
def baseStats
ret = pbGetSpeciesData(@species, formSimple, SpeciesBaseStats)
ret = pbGetSpeciesData(@species, formSimple, SpeciesData::BASE_STATS)
return ret.clone
end
@@ -1110,7 +1110,7 @@ class Pokemon
self.level = level
calcStats
@hp = @totalhp
@happiness = pbGetSpeciesData(@species, formSimple, SpeciesHappiness)
@happiness = pbGetSpeciesData(@species, formSimple, SpeciesData::HAPPINESS)
if withMoves
self.resetMoves
else

View File

@@ -11,12 +11,12 @@ class Pokemon
for i in 0...formData[@species].length
fSpec = formData[@species][i]
next if !fSpec || fSpec<=0
megaStone = speciesData[fSpec][SpeciesMegaStone] || 0
megaStone = speciesData[fSpec][SpeciesData::MEGA_STONE] || 0
if megaStone>0 && self.hasItem?(megaStone)
ret = i; break
end
if !checkItemOnly
megaMove = speciesData[fSpec][SpeciesMegaMove] || 0
megaMove = speciesData[fSpec][SpeciesData::MEGA_MOVE] || 0
if megaMove>0 && self.hasMove?(megaMove)
ret = i; break
end
@@ -27,7 +27,7 @@ class Pokemon
def getUnmegaForm
return -1 if !mega?
unmegaForm = pbGetSpeciesData(@species,formSimple,SpeciesUnmegaForm)
unmegaForm = pbGetSpeciesData(@species,formSimple,SpeciesData::UNMEGA_FORM)
return unmegaForm # form number
end
@@ -58,7 +58,7 @@ class Pokemon
end
def megaMessage # 0=default message, 1=Rayquaza message
return pbGetSpeciesData(@species,getMegaForm,SpeciesMegaMessage)
return pbGetSpeciesData(@species,getMegaForm,SpeciesData::MEGA_MESSAGE)
end
end

View File

@@ -156,7 +156,7 @@ def pbGetBabySpecies(species,item1=-1,item2=-1)
evoData.each do |evo|
next if !evo[3]
if item1>=0 && item2>=0
incense = pbGetSpeciesData(evo[0],0,SpeciesIncense)
incense = pbGetSpeciesData(evo[0],0,SpeciesData::INCENSE)
ret = evo[0] if item1==incense || item2==incense
else
ret = evo[0] # Species of prevolution

View File

@@ -341,16 +341,16 @@ def pbApplyBattlerMetricsToSprite(sprite,index,species,shadow=false,metrics=nil)
metrics = pbLoadSpeciesMetrics if !metrics
if shadow
if (index&1)==1 # Foe Pokémon
sprite.x += (metrics[MetricBattlerShadowX][species] || 0)*2
sprite.x += (metrics[SpeciesData::METRIC_SHADOW_X][species] || 0)*2
end
else
if (index&1)==0 # Player's Pokémon
sprite.x += (metrics[MetricBattlerPlayerX][species] || 0)*2
sprite.y += (metrics[MetricBattlerPlayerY][species] || 0)*2
sprite.x += (metrics[SpeciesData::METRIC_PLAYER_X][species] || 0)*2
sprite.y += (metrics[SpeciesData::METRIC_PLAYER_Y][species] || 0)*2
else # Foe Pokémon
sprite.x += (metrics[MetricBattlerEnemyX][species] || 0)*2
sprite.y += (metrics[MetricBattlerEnemyY][species] || 0)*2
sprite.y -= (metrics[MetricBattlerAltitude][species] || 0)*2
sprite.x += (metrics[SpeciesData::METRIC_ENEMY_X][species] || 0)*2
sprite.y += (metrics[SpeciesData::METRIC_ENEMY_Y][species] || 0)*2
sprite.y -= (metrics[SpeciesData::METRIC_ALTITUDE][species] || 0)*2
end
end
end
@@ -360,5 +360,5 @@ end
def showShadow?(species)
return true
# metrics = pbLoadSpeciesMetrics
# return (metrics[MetricBattlerAltitude][species] || 0)>0
# return (metrics[SpeciesData::METRIC_ALTITUDE][species] || 0)>0
end

View File

@@ -327,12 +327,12 @@ class PokemonPokedex_Scene
if pbCanAddForModeList?($PokemonGlobal.pokedexMode,nationalSpecies)
form = $Trainer.formlastseen[nationalSpecies][1] || 0
fspecies = pbGetFSpeciesFromForm(nationalSpecies,form)
color = speciesData[fspecies][SpeciesColor] || 0
type1 = speciesData[fspecies][SpeciesType1] || 0
type2 = speciesData[fspecies][SpeciesType2] || type1
shape = speciesData[fspecies][SpeciesShape] || 0
height = speciesData[fspecies][SpeciesHeight] || 1
weight = speciesData[fspecies][SpeciesWeight] || 1
color = speciesData[fspecies][SpeciesData::COLOR] || 0
type1 = speciesData[fspecies][SpeciesData::TYPE1] || 0
type2 = speciesData[fspecies][SpeciesData::TYPE2] || type1
shape = speciesData[fspecies][SpeciesData::SHAPE] || 0
height = speciesData[fspecies][SpeciesData::HEIGHT] || 1
weight = speciesData[fspecies][SpeciesData::WEIGHT] || 1
shift = DEXES_WITH_OFFSETS.include?(region)
dexlist.push([nationalSpecies,PBSpecies.getName(nationalSpecies),
height,weight,i,shift,type1,type2,color,shape])

View File

@@ -142,7 +142,7 @@ class PokemonPokedexInfo_Scene
@sprites["formback"].setSpeciesBitmap(@species,(@gender==1),@form,false,false,true)
@sprites["formback"].y = 256
fSpecies = pbGetFSpeciesFromForm(@species,@form)
@sprites["formback"].y += (pbLoadSpeciesMetrics[MetricBattlerPlayerY][fSpecies] || 0)*2
@sprites["formback"].y += (pbLoadSpeciesMetrics[SpeciesData::METRIC_PLAYER_Y][fSpecies] || 0)*2
end
if @sprites["formicon"]
@sprites["formicon"].pbSetParams(@species,@gender,@form)
@@ -158,7 +158,7 @@ class PokemonPokedexInfo_Scene
for i in 0...formdata[@species].length
fSpecies = pbGetFSpeciesFromForm(@species,i)
formname = pbGetMessage(MessageTypes::FormNames,fSpecies)
genderRate = pbGetSpeciesData(@species,i,SpeciesGenderRate)
genderRate = pbGetSpeciesData(@species,i,SpeciesData::GENDER_RATE)
if i==0 || (formname && formname!="")
multiforms = true if i>0
case genderRate
@@ -248,8 +248,8 @@ class PokemonPokedexInfo_Scene
kind = pbGetMessage(MessageTypes::Kinds,@species) if !kind || kind==""
textpos.push([_INTL("{1} Pokémon",kind),246,74,0,base,shadow])
# Write the height and weight
height = speciesData[SpeciesHeight] || 1
weight = speciesData[SpeciesWeight] || 1
height = speciesData[SpeciesData::HEIGHT] || 1
weight = speciesData[SpeciesData::WEIGHT] || 1
if pbGetCountry==0xF4 # If the user is in the United States
inches = (height/0.254).round
pounds = (weight/0.45359).round
@@ -273,8 +273,8 @@ class PokemonPokedexInfo_Scene
# Show the owned icon
imagepos.push(["Graphics/Pictures/Pokedex/icon_own",212,44])
# Draw the type icon(s)
type1 = speciesData[SpeciesType1] || 0
type2 = speciesData[SpeciesType2] || type1
type1 = speciesData[SpeciesData::TYPE1] || 0
type2 = speciesData[SpeciesData::TYPE2] || type1
type1rect = Rect.new(0,type1*32,96,32)
type2rect = Rect.new(0,type2*32,96,32)
overlay.blt(296,120,@typebitmap.bitmap,type1rect)

View File

@@ -13,16 +13,16 @@ class TriadCard
def initialize(species,form=0)
@species = species
@form = form
baseStats = pbGetSpeciesData(species,form,SpeciesBaseStats)
baseStats = pbGetSpeciesData(species,form,SpeciesData::BASE_STATS)
hp = baseStats[PBStats::HP]
attack = baseStats[PBStats::ATTACK]
defense = baseStats[PBStats::DEFENSE]
spAtk = baseStats[PBStats::SPATK]
spDef = baseStats[PBStats::SPDEF]
speed = baseStats[PBStats::SPEED]
@type = pbGetSpeciesData(species,form,SpeciesType1)
@type = pbGetSpeciesData(species,form,SpeciesData::TYPE1)
if isConst?(@type,PBTypes,:NORMAL)
type2 = pbGetSpeciesData(species,form,SpeciesType2)
type2 = pbGetSpeciesData(species,form,SpeciesData::TYPE2)
@type = type2 if type2
end
@west = baseStatToValue(attack+speed/3)

View File

@@ -269,7 +269,7 @@ def pbBugContestScore(pokemon)
for i in pokemon.iv; ivscore+=i; end
ivscore=(ivscore*100/186).floor
hpscore=(100*pokemon.hp/pokemon.totalhp).floor
rareness = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesRareness)
rareness = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesData::RARENESS)
rarescore=60
rarescore+=20 if rareness<=120
rarescore+=20 if rareness<=60

View File

@@ -1,5 +1,5 @@
def pbBaseStatTotal(species)
baseStats = pbGetSpeciesData(species,0,SpeciesBaseStats)
baseStats = pbGetSpeciesData(species,0,SpeciesData::BASE_STATS)
ret = 0
baseStats.each { |s| ret += s }
return ret
@@ -12,14 +12,14 @@ end
def pbTooTall?(pkmn,maxHeightInMeters)
species = (pkmn.is_a?(Pokemon)) ? pkmn.species : pkmn
form = (pkmn.is_a?(Pokemon)) ? pkmn.form : 0
height = pbGetSpeciesData(species,form,SpeciesHeight)
height = pbGetSpeciesData(species,form,SpeciesData::HEIGHT)
return height>(maxHeightInMeters*10).round
end
def pbTooHeavy?(pkmn,maxWeightInKg)
species = (pkmn.is_a?(Pokemon)) ? pkmn.species : pkmn
form = (pkmn.is_a?(Pokemon)) ? pkmn.form : 0
weight = pbGetSpeciesData(species,form,SpeciesWeight)
weight = pbGetSpeciesData(species,form,SpeciesData::WEIGHT)
return weight>(maxWeightInKg*10).round
end
@@ -396,7 +396,7 @@ class StandardRestriction
def isValid?(pokemon)
return false if !pokemon || pokemon.egg?
# Species with disadvantageous abilities are not banned
abilities = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesAbilities)
abilities = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesData::ABILITIES)
abilities = [abilities] if !abilities.is_a?(Array)
abilities.each do |a|
return true if isConst?(a,PBAbilities,:TRUANT) ||
@@ -413,7 +413,7 @@ class StandardRestriction
return false if pokemon.isSpecies?(i)
end
# Species with total base stat 600 or more are banned
baseStats = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesBaseStats)
baseStats = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesData::BASE_STATS)
bst = 0
baseStats.each { |s| bst += s }
return false if bst>=600

View File

@@ -190,7 +190,7 @@ end
class NonlegendaryRestriction
def isValid?(pkmn)
return true if !pkmn.genderless?
compatibility = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesCompatibility)
compatibility = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesData::COMPATIBILITY)
compatibility = [compatibility] if !compatibility.is_a?(Array)
compatibility.each { |c| return false if isConst?(c,PBEggGroups,:Undiscovered) }
return true
@@ -499,8 +499,8 @@ def pbRandomPokemonFromRule(rule,trainer)
item=getID(PBItems,:LEFTOVERS)
end
if isConst?(item,PBItems,:BLACKSLUDGE)
type1 = pbGetSpeciesData(species,0,SpeciesType1)
type2 = pbGetSpeciesData(species,0,SpeciesType2) || type1
type1 = pbGetSpeciesData(species,0,SpeciesData::TYPE1)
type2 = pbGetSpeciesData(species,0,SpeciesData::TYPE2) || type1
if !isConst?(type1,PBTypes,:POISON) && !isConst?(type2,PBTypes,:POISON)
item=getID(PBItems,:LEFTOVERS)
end
@@ -956,8 +956,8 @@ def pbRuledBattle(team1,team2,rule)
end
def getTypes(species)
type1 = pbGetSpeciesData(species,0,SpeciesType1)
type2 = pbGetSpeciesData(species,0,SpeciesType2) || type1
type1 = pbGetSpeciesData(species,0,SpeciesData::TYPE1)
type2 = pbGetSpeciesData(species,0,SpeciesData::TYPE2) || type1
return type1==type2 ? [type1] : [type1,type2]
end

View File

@@ -138,7 +138,7 @@ def pbCheckPokemonShadowBitmapFiles(species,form,fullmetrics=nil)
return bitmapFileName if ret
# Load metrics and use that graphic
fullmetrics = pbLoadSpeciesMetrics if !fullmetrics
size = (fullmetrics[MetricBattlerShadowSize][pbGetFSpeciesFromForm(species,form)] || 2)
size = (fullmetrics[SpeciesData::METRIC_SHADOW_SIZE][pbGetFSpeciesFromForm(species,form)] || 2)
bitmapFileName = sprintf("Graphics/Pictures/Battle/battler_shadow_%d",size)
return bitmapFileName if pbResolveBitmap(bitmapFileName)
return nil

View File

@@ -168,7 +168,7 @@ def pbGenerateEgg(pokemon,text="")
pokemon = Pokemon.new(pokemon,EGG_LEVEL)
end
# Get egg steps
eggSteps = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesStepsToHatch)
eggSteps = pbGetSpeciesData(pokemon.species,pokemon.form,SpeciesData::STEPS_TO_HATCH)
# Set egg's details
pokemon.name = _INTL("Egg")
pokemon.eggsteps = eggSteps
@@ -217,7 +217,7 @@ def pbSeenForm(pkmn,gender=0,form=0)
fSpecies = pbGetFSpeciesFromForm(species,form)
species, form = pbGetSpeciesFromFSpecies(fSpecies)
gender = 0 if gender>1
dexForm = pbGetSpeciesData(species,form,SpeciesPokedexForm)
dexForm = pbGetSpeciesData(species,form,SpeciesData::POKEDEX_FORM)
form = dexForm if dexForm>0
fSpecies = pbGetFSpeciesFromForm(species,form)
formName = pbGetMessage(MessageTypes::FormNames,fSpecies)
@@ -231,7 +231,7 @@ end
def pbUpdateLastSeenForm(pkmn)
$Trainer.formlastseen = [] if !$Trainer.formlastseen
form = (pkmn.form rescue 0)
dexForm = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesPokedexForm)
dexForm = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesData::POKEDEX_FORM)
form = dexForm if dexForm>0
formName = pbGetMessage(MessageTypes::FormNames,pkmn.fSpecies)
form = 0 if !formName || formName==""
@@ -452,7 +452,7 @@ end
# Calculates a Pokémon's size (in millimeters)
#===============================================================================
def pbSize(pkmn)
baseheight = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesHeight)
baseheight = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesData::HEIGHT)
hpiv = pkmn.iv[0]&15
ativ = pkmn.iv[1]&15
dfiv = pkmn.iv[2]&15
@@ -493,7 +493,7 @@ def pbHasEgg?(species)
# species may be unbreedable, so check its evolution's compatibilities
evoSpecies = pbGetEvolvedFormData(species,true)
compatSpecies = (evoSpecies && evoSpecies[0]) ? evoSpecies[0][2] : species
compat = pbGetSpeciesData(compatSpecies,0,SpeciesCompatibility)
compat = pbGetSpeciesData(compatSpecies,0,SpeciesData::COMPATIBILITY)
compat = [compat] if !compat.is_a?(Array)
return false if compat.include?(getConst(PBEggGroups,:Undiscovered))
return false if compat.include?(getConst(PBEggGroups,:Ditto))

View File

@@ -575,7 +575,7 @@ def pbDebugMenuActions(cmd="",sprites=nil,viewport=nil)
next if !formdata[i][form] || formdata[i][form]==0
fSpecies = pbGetFSpeciesFromForm(i,form)
formname = pbGetMessage(MessageTypes::FormNames,fSpecies)
genderRate = speciesData[i][SpeciesGenderRate] || 0
genderRate = speciesData[i][SpeciesData::GENDER_RATE] || 0
gender = (genderRate==PBGenderRates::AlwaysFemale) ? 1 : 0
if form==0
case genderRate

View File

@@ -719,7 +719,7 @@ module PokemonDebugMixin
pkmn.level = EGG_LEVEL
pkmn.calcStats
pkmn.name = _INTL("Egg")
pkmn.eggsteps = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesStepsToHatch)
pkmn.eggsteps = pbGetSpeciesData(pkmn.species,pkmn.form,SpeciesData::STEPS_TO_HATCH)
pkmn.hatchedMap = 0
pkmn.obtainMode = 1
pbRefreshSingle(pkmnid)

View File

@@ -836,7 +836,7 @@ def pbPokemonEditor
entry = messages.get(MessageTypes::Entries,selection)
cname = getConstantName(PBSpecies,selection) rescue sprintf("POKE%03d",selection)
formname = messages.get(MessageTypes::FormNames,selection)
abilities = speciesData[SpeciesAbilities]
abilities = speciesData[SpeciesData::ABILITIES]
if abilities.is_a?(Array)
ability1 = abilities[0]
ability2 = abilities[1]
@@ -844,20 +844,20 @@ def pbPokemonEditor
ability1 = abilities
ability2 = nil
end
color = speciesData[SpeciesColor]
habitat = speciesData[SpeciesHabitat]
type1 = speciesData[SpeciesType1]
type2 = speciesData[SpeciesType2]
color = speciesData[SpeciesData::COLOR]
habitat = speciesData[SpeciesData::HABITAT]
type1 = speciesData[SpeciesData::TYPE1]
type2 = speciesData[SpeciesData::TYPE2]
type2 = nil if type2==type1
baseStats = speciesData[SpeciesBaseStats].clone if speciesData[SpeciesBaseStats]
rareness = speciesData[SpeciesRareness]
shape = speciesData[SpeciesShape]
genderrate = speciesData[SpeciesGenderRate]
happiness = speciesData[SpeciesHappiness]
growthrate = speciesData[SpeciesGrowthRate]
stepstohatch = speciesData[SpeciesStepsToHatch]
effort = speciesData[SpeciesEffortPoints].clone if speciesData[SpeciesEffortPoints]
compats = speciesData[SpeciesCompatibility]
baseStats = speciesData[SpeciesData::BASE_STATS].clone if speciesData[SpeciesData::BASE_STATS]
rareness = speciesData[SpeciesData::RARENESS]
shape = speciesData[SpeciesData::SHAPE]
genderrate = speciesData[SpeciesData::GENDER_RATE]
happiness = speciesData[SpeciesData::HAPPINESS]
growthrate = speciesData[SpeciesData::GROWTH_RATE]
stepstohatch = speciesData[SpeciesData::STEPS_TO_HATCH]
effort = speciesData[SpeciesData::EFFORT_POINTS].clone if speciesData[SpeciesData::EFFORT_POINTS]
compats = speciesData[SpeciesData::COMPATIBILITY]
if compats.is_a?(Array)
compat1 = compats[0]
compat2 = compats[1]
@@ -865,10 +865,10 @@ def pbPokemonEditor
compat1 = compats
compat2 = nil
end
height = speciesData[SpeciesHeight]
weight = speciesData[SpeciesWeight]
baseexp = speciesData[SpeciesBaseExp]
hiddenAbils = speciesData[SpeciesHiddenAbility]
height = speciesData[SpeciesData::HEIGHT]
weight = speciesData[SpeciesData::WEIGHT]
baseexp = speciesData[SpeciesData::BASE_EXP]
hiddenAbils = speciesData[SpeciesData::HIDDEN_ABILITY]
if hiddenAbils.is_a?(Array)
hiddenability1 = hiddenAbils[0]
hiddenability2 = hiddenAbils[1]
@@ -880,10 +880,10 @@ def pbPokemonEditor
hiddenability3 = nil
hiddenability4 = nil
end
item1 = speciesData[SpeciesWildItemCommon]
item2 = speciesData[SpeciesWildItemUncommon]
item3 = speciesData[SpeciesWildItemRare]
incense = speciesData[SpeciesIncense]
item1 = speciesData[SpeciesData::WILD_ITEM_COMMON]
item2 = speciesData[SpeciesData::WILD_ITEM_UNCOMMON]
item3 = speciesData[SpeciesData::WILD_ITEM_RARE]
incense = speciesData[SpeciesData::INCENSE]
originalMoveset = pbGetSpeciesMoveset(selection)
movelist = []
originalMoveset.each_with_index { |m,i| movelist.push([m[0],m[1],i]) }
@@ -939,7 +939,7 @@ def pbPokemonEditor
for i in 0...6
data.push(metrics[i][selection] || 0) # 34, 35, 36, 37, 38, 39
end
data.push(metrics[MetricBattlerShadowSize][selection] || 2) # 40
data.push(metrics[SpeciesData::METRIC_SHADOW_SIZE][selection] || 2) # 40
data.push(evolutions) # 41
data.push(incense) # 42
# Edit the properties
@@ -966,28 +966,28 @@ def pbPokemonEditor
end
hiddenAbils = hiddenAbils[0] if !shouldArray
# Save data
speciesData[SpeciesAbilities] = abils
speciesData[SpeciesColor] = data[24]
speciesData[SpeciesHabitat] = data[26]
speciesData[SpeciesType1] = data[2]
speciesData[SpeciesType2] = data[3]
speciesData[SpeciesBaseStats] = data[4]
speciesData[SpeciesRareness] = data[9]
speciesData[SpeciesShape] = data[25]
speciesData[SpeciesGenderRate] = data[5]
speciesData[SpeciesHappiness] = data[10]
speciesData[SpeciesGrowthRate] = data[6]
speciesData[SpeciesStepsToHatch] = data[21]
speciesData[SpeciesEffortPoints] = data[8]
speciesData[SpeciesCompatibility] = compats
speciesData[SpeciesHeight] = data[22]
speciesData[SpeciesWeight] = data[23]
speciesData[SpeciesBaseExp] = data[7]
speciesData[SpeciesHiddenAbility] = hiddenAbils
speciesData[SpeciesWildItemCommon] = data[31]
speciesData[SpeciesWildItemUncommon] = data[32]
speciesData[SpeciesWildItemRare] = data[33]
speciesData[SpeciesIncense] = data[42]
speciesData[SpeciesData::ABILITIES] = abils
speciesData[SpeciesData::COLOR] = data[24]
speciesData[SpeciesData::HABITAT] = data[26]
speciesData[SpeciesData::TYPE1] = data[2]
speciesData[SpeciesData::TYPE2] = data[3]
speciesData[SpeciesData::BASE_STATS] = data[4]
speciesData[SpeciesData::RARENESS] = data[9]
speciesData[SpeciesData::SHAPE] = data[25]
speciesData[SpeciesData::GENDER_RATE] = data[5]
speciesData[SpeciesData::HAPPINESS] = data[10]
speciesData[SpeciesData::GROWTH_RATE] = data[6]
speciesData[SpeciesData::STEPS_TO_HATCH] = data[21]
speciesData[SpeciesData::EFFORT_POINTS] = data[8]
speciesData[SpeciesData::COMPATIBILITY] = compats
speciesData[SpeciesData::HEIGHT] = data[22]
speciesData[SpeciesData::WEIGHT] = data[23]
speciesData[SpeciesData::BASE_EXP] = data[7]
speciesData[SpeciesData::HIDDEN_ABILITY] = hiddenAbils
speciesData[SpeciesData::WILD_ITEM_COMMON] = data[31]
speciesData[SpeciesData::WILD_ITEM_UNCOMMON] = data[32]
speciesData[SpeciesData::WILD_ITEM_RARE] = data[33]
speciesData[SpeciesData::INCENSE] = data[42]
save_data(pbLoadSpeciesData,"Data/species.dat")
namearray = []
kindarray = []

View File

@@ -630,7 +630,7 @@ def pbSavePokemonData
kind = messages.get(MessageTypes::Kinds,i)
entry = messages.get(MessageTypes::Entries,i)
formname = messages.get(MessageTypes::FormNames,i)
abilities = speciesData[i][SpeciesAbilities]
abilities = speciesData[i][SpeciesData::ABILITIES]
if abilities.is_a?(Array)
ability1 = abilities[0] || 0
ability2 = abilities[1] || 0
@@ -638,27 +638,27 @@ def pbSavePokemonData
ability1 = abilities || 0
ability2 = 0
end
color = speciesData[i][SpeciesColor] || 0
habitat = speciesData[i][SpeciesHabitat] || 0
type1 = speciesData[i][SpeciesType1] || 0
type2 = speciesData[i][SpeciesType2] || type1
if speciesData[i][SpeciesBaseStats]
basestats = speciesData[i][SpeciesBaseStats].clone
color = speciesData[i][SpeciesData::COLOR] || 0
habitat = speciesData[i][SpeciesData::HABITAT] || 0
type1 = speciesData[i][SpeciesData::TYPE1] || 0
type2 = speciesData[i][SpeciesData::TYPE2] || type1
if speciesData[i][SpeciesData::BASE_STATS]
basestats = speciesData[i][SpeciesData::BASE_STATS].clone
else
basestats = [1,1,1,1,1,1]
end
rareness = speciesData[i][SpeciesRareness] || 0
shape = speciesData[i][SpeciesShape] || 0
gender = speciesData[i][SpeciesGenderRate] || 0
happiness = speciesData[i][SpeciesHappiness] || 0
growthrate = speciesData[i][SpeciesGrowthRate] || 0
stepstohatch = speciesData[i][SpeciesStepsToHatch] || 1
if speciesData[i][SpeciesEffortPoints]
effort = speciesData[i][SpeciesEffortPoints].clone
rareness = speciesData[i][SpeciesData::RARENESS] || 0
shape = speciesData[i][SpeciesData::SHAPE] || 0
gender = speciesData[i][SpeciesData::GENDER_RATE] || 0
happiness = speciesData[i][SpeciesData::HAPPINESS] || 0
growthrate = speciesData[i][SpeciesData::GROWTH_RATE] || 0
stepstohatch = speciesData[i][SpeciesData::STEPS_TO_HATCH] || 1
if speciesData[i][SpeciesData::EFFORT_POINTS]
effort = speciesData[i][SpeciesData::EFFORT_POINTS].clone
else
effort = [0,0,0,0,0,0]
end
compats = speciesData[i][SpeciesCompatibility]
compats = speciesData[i][SpeciesData::COMPATIBILITY]
if compats.is_a?(Array)
compat1 = compats[0] || 0
compat2 = compats[1] || compat1
@@ -666,10 +666,10 @@ def pbSavePokemonData
compat1 = compats || 0
compat2 = compat1
end
height = speciesData[i][SpeciesHeight] || 1
weight = speciesData[i][SpeciesWeight] || 1
baseexp = speciesData[i][SpeciesBaseExp] || 0
hiddenAbils = speciesData[i][SpeciesHiddenAbility]
height = speciesData[i][SpeciesData::HEIGHT] || 1
weight = speciesData[i][SpeciesData::WEIGHT] || 1
baseexp = speciesData[i][SpeciesData::BASE_EXP] || 0
hiddenAbils = speciesData[i][SpeciesData::HIDDEN_ABILITY]
if hiddenAbils.is_a?(Array)
hiddenability1 = hiddenAbils[0] || 0
hiddenability2 = hiddenAbils[1] || 0
@@ -681,10 +681,10 @@ def pbSavePokemonData
hiddenability3 = 0
hiddenability4 = 0
end
item1 = speciesData[i][SpeciesWildItemCommon] || 0
item2 = speciesData[i][SpeciesWildItemUncommon] || 0
item3 = speciesData[i][SpeciesWildItemRare] || 0
incense = speciesData[i][SpeciesIncense] || 0
item1 = speciesData[i][SpeciesData::WILD_ITEM_COMMON] || 0
item2 = speciesData[i][SpeciesData::WILD_ITEM_UNCOMMON] || 0
item3 = speciesData[i][SpeciesData::WILD_ITEM_RARE] || 0
incense = speciesData[i][SpeciesData::INCENSE] || 0
pokedata.write("\#-------------------------------\r\n")
pokedata.write("[#{i}]\r\nName = #{speciesname}\r\n")
pokedata.write("InternalName = #{cname}\r\n")
@@ -818,13 +818,13 @@ def pbSavePokemonData
pokedata.write("WildItemRare = #{citem3}\r\n")
end
if metrics && metrics.length>0
pokedata.write("BattlerPlayerX = #{metrics[MetricBattlerPlayerX][i] || 0}\r\n")
pokedata.write("BattlerPlayerY = #{metrics[MetricBattlerPlayerY][i] || 0}\r\n")
pokedata.write("BattlerEnemyX = #{metrics[MetricBattlerEnemyX][i] || 0}\r\n")
pokedata.write("BattlerEnemyY = #{metrics[MetricBattlerEnemyY][i] || 0}\r\n")
pokedata.write("BattlerAltitude = #{metrics[MetricBattlerAltitude][i] || 0}\r\n") if metrics[MetricBattlerAltitude][i]!=0
pokedata.write("BattlerShadowX = #{metrics[MetricBattlerShadowX][i] || 0}\r\n")
pokedata.write("BattlerShadowSize = #{metrics[MetricBattlerShadowSize][i] || 2}\r\n")
pokedata.write("BattlerPlayerX = #{metrics[SpeciesData::METRIC_PLAYER_X][i] || 0}\r\n")
pokedata.write("BattlerPlayerY = #{metrics[SpeciesData::METRIC_PLAYER_Y][i] || 0}\r\n")
pokedata.write("BattlerEnemyX = #{metrics[SpeciesData::METRIC_ENEMY_X][i] || 0}\r\n")
pokedata.write("BattlerEnemyY = #{metrics[SpeciesData::METRIC_ENEMY_Y][i] || 0}\r\n")
pokedata.write("BattlerAltitude = #{metrics[SpeciesData::METRIC_ALTITUDE][i] || 0}\r\n") if metrics[SpeciesData::METRIC_ALTITUDE][i]!=0
pokedata.write("BattlerShadowX = #{metrics[SpeciesData::METRIC_SHADOW_X][i] || 0}\r\n")
pokedata.write("BattlerShadowSize = #{metrics[SpeciesData::METRIC_SHADOW_SIZE][i] || 2}\r\n")
end
pokedata.write("Evolutions = ")
count = 0
@@ -896,7 +896,7 @@ def pbSavePokemonFormsData
entry = nil if entry==origentry || entry==""
formname = messages.get(MessageTypes::FormNames,i)
origdata = {}
abilities = speciesData[species][SpeciesAbilities]
abilities = speciesData[species][SpeciesData::ABILITIES]
if abilities.is_a?(Array)
origdata["ability1"] = abilities[0] || 0
origdata["ability2"] = abilities[1] || 0
@@ -904,27 +904,27 @@ def pbSavePokemonFormsData
origdata["ability1"] = abilities || 0
origdata["ability2"] = 0
end
origdata["color"] = speciesData[species][SpeciesColor] || 0
origdata["habitat"] = speciesData[species][SpeciesHabitat] || 0
origdata["type1"] = speciesData[species][SpeciesType1] || 0
origdata["type2"] = speciesData[species][SpeciesType2] || type1
if speciesData[species][SpeciesBaseStats]
origdata["basestats"] = speciesData[species][SpeciesBaseStats].clone
origdata["color"] = speciesData[species][SpeciesData::COLOR] || 0
origdata["habitat"] = speciesData[species][SpeciesData::HABITAT] || 0
origdata["type1"] = speciesData[species][SpeciesData::TYPE1] || 0
origdata["type2"] = speciesData[species][SpeciesData::TYPE2] || type1
if speciesData[species][SpeciesData::BASE_STATS]
origdata["basestats"] = speciesData[species][SpeciesData::BASE_STATS].clone
else
origdata["basestats"] = [1,1,1,1,1,1]
end
origdata["rareness"] = speciesData[species][SpeciesRareness] || 0
origdata["shape"] = speciesData[species][SpeciesShape] || 0
origdata["gender"] = speciesData[species][SpeciesGenderRate] || 0
origdata["happiness"] = speciesData[species][SpeciesHappiness] || 0
origdata["growthrate"] = speciesData[species][SpeciesGrowthRate] || 0
origdata["stepstohatch"] = speciesData[species][SpeciesStepsToHatch] || 1
if speciesData[species][SpeciesEffortPoints]
origdata["effort"] = speciesData[species][SpeciesEffortPoints].clone
origdata["rareness"] = speciesData[species][SpeciesData::RARENESS] || 0
origdata["shape"] = speciesData[species][SpeciesData::SHAPE] || 0
origdata["gender"] = speciesData[species][SpeciesData::GENDER_RATE] || 0
origdata["happiness"] = speciesData[species][SpeciesData::HAPPINESS] || 0
origdata["growthrate"] = speciesData[species][SpeciesData::GROWTH_RATE] || 0
origdata["stepstohatch"] = speciesData[species][SpeciesData::STEPS_TO_HATCH] || 1
if speciesData[species][SpeciesData::EFFORT_POINTS]
origdata["effort"] = speciesData[species][SpeciesData::EFFORT_POINTS].clone
else
origdata["effort"] = [0,0,0,0,0,0]
end
compats = speciesData[species][SpeciesCompatibility]
compats = speciesData[species][SpeciesData::COMPATIBILITY]
if compats.is_a?(Array)
origdata["compat1"] = compats[0] || 0
origdata["compat2"] = compats[1] || origdata["compat1"]
@@ -932,10 +932,10 @@ def pbSavePokemonFormsData
origdata["compat1"] = compats || 0
origdata["compat2"] = origdata["compat1"]
end
origdata["height"] = speciesData[species][SpeciesHeight] || 1
origdata["weight"] = speciesData[species][SpeciesWeight] || 1
origdata["baseexp"] = speciesData[species][SpeciesBaseExp] || 0
hiddenAbils = speciesData[species][SpeciesHiddenAbility]
origdata["height"] = speciesData[species][SpeciesData::HEIGHT] || 1
origdata["weight"] = speciesData[species][SpeciesData::WEIGHT] || 1
origdata["baseexp"] = speciesData[species][SpeciesData::BASE_EXP] || 0
hiddenAbils = speciesData[species][SpeciesData::HIDDEN_ABILITY]
if hiddenAbils.is_a?(Array)
origdata["hiddenability1"] = hiddenAbils[0] || 0
origdata["hiddenability2"] = hiddenAbils[1] || 0
@@ -947,11 +947,11 @@ def pbSavePokemonFormsData
origdata["hiddenability3"] = 0
origdata["hiddenability4"] = 0
end
origdata["item1"] = speciesData[species][SpeciesWildItemCommon] || 0
origdata["item2"] = speciesData[species][SpeciesWildItemUncommon] || 0
origdata["item3"] = speciesData[species][SpeciesWildItemRare] || 0
origdata["incense"] = speciesData[species][SpeciesIncense] || 0
abilities = speciesData[i][SpeciesAbilities]
origdata["item1"] = speciesData[species][SpeciesData::WILD_ITEM_COMMON] || 0
origdata["item2"] = speciesData[species][SpeciesData::WILD_ITEM_UNCOMMON] || 0
origdata["item3"] = speciesData[species][SpeciesData::WILD_ITEM_RARE] || 0
origdata["incense"] = speciesData[species][SpeciesData::INCENSE] || 0
abilities = speciesData[i][SpeciesData::ABILITIES]
if abilities.is_a?(Array)
ability1 = abilities[0] || 0
ability2 = abilities[1] || 0
@@ -962,17 +962,17 @@ def pbSavePokemonFormsData
if ability1==origdata["ability1"] && ability2==origdata["ability2"]
ability1 = ability2 = nil
end
color = speciesData[i][SpeciesColor] || 0
color = speciesData[i][SpeciesData::COLOR] || 0
color = nil if color==origdata["color"]
habitat = speciesData[i][SpeciesHabitat] || 0
habitat = speciesData[i][SpeciesData::HABITAT] || 0
habitat = nil if habitat==origdata["habitat"]
type1 = speciesData[i][SpeciesType1] || 0
type2 = speciesData[i][SpeciesType2] || type1
type1 = speciesData[i][SpeciesData::TYPE1] || 0
type2 = speciesData[i][SpeciesData::TYPE2] || type1
if type1==origdata["type1"] && type2==origdata["type2"]
type1 = type2 = nil
end
if speciesData[i][SpeciesBaseStats]
basestats = speciesData[i][SpeciesBaseStats].clone
if speciesData[i][SpeciesData::BASE_STATS]
basestats = speciesData[i][SpeciesData::BASE_STATS].clone
else
basestats = [1,1,1,1,1,1]
end
@@ -982,20 +982,20 @@ def pbSavePokemonFormsData
diff = true; break
end
basestats = nil if !diff
rareness = speciesData[i][SpeciesRareness] || 0
rareness = speciesData[i][SpeciesData::RARENESS] || 0
rareness = nil if rareness==origdata["rareness"]
shape = speciesData[i][SpeciesShape] || 0
shape = speciesData[i][SpeciesData::SHAPE] || 0
shape = nil if shape==origdata["shape"]
gender = speciesData[i][SpeciesGenderRate] || 0
gender = speciesData[i][SpeciesData::GENDER_RATE] || 0
gender = nil if gender==origdata["gender"]
happiness = speciesData[i][SpeciesHappiness] || 0
happiness = speciesData[i][SpeciesData::HAPPINESS] || 0
happiness = nil if happiness==origdata["happiness"]
growthrate = speciesData[i][SpeciesGrowthRate] || 0
growthrate = speciesData[i][SpeciesData::GROWTH_RATE] || 0
growthrate = nil if growthrate==origdata["growthrate"]
stepstohatch = speciesData[i][SpeciesStepsToHatch] || 1
stepstohatch = speciesData[i][SpeciesData::STEPS_TO_HATCH] || 1
stepstohatch = nil if stepstohatch==origdata["stepstohatch"]
if speciesData[i][SpeciesEffortPoints]
effort = speciesData[i][SpeciesEffortPoints].clone
if speciesData[i][SpeciesData::EFFORT_POINTS]
effort = speciesData[i][SpeciesData::EFFORT_POINTS].clone
else
effort = [0,0,0,0,0,0]
end
@@ -1005,7 +1005,7 @@ def pbSavePokemonFormsData
diff = true; break
end
effort = nil if !diff
compats = speciesData[i][SpeciesCompatibility]
compats = speciesData[i][SpeciesData::COMPATIBILITY]
if compats.is_a?(Array)
compat1 = compats[0] || 0
compat2 = compats[1] || compat1
@@ -1016,13 +1016,13 @@ def pbSavePokemonFormsData
if compat1==origdata["compat1"] && compat2==origdata["compat2"]
compat1 = compat2 = nil
end
height = speciesData[i][SpeciesHeight] || 1
height = speciesData[i][SpeciesData::HEIGHT] || 1
height = nil if height==origdata["height"]
weight = speciesData[i][SpeciesWeight] || 1
weight = speciesData[i][SpeciesData::WEIGHT] || 1
weight = nil if weight==origdata["weight"]
baseexp = speciesData[i][SpeciesBaseExp] || 0
baseexp = speciesData[i][SpeciesData::BASE_EXP] || 0
baseexp = nil if baseexp==origdata["baseexp"]
hiddenAbils = speciesData[i][SpeciesHiddenAbility]
hiddenAbils = speciesData[i][SpeciesData::HIDDEN_ABILITY]
if hiddenAbils.is_a?(Array)
hiddenability1 = hiddenAbils[0] || 0
hiddenability2 = hiddenAbils[1] || 0
@@ -1040,19 +1040,19 @@ def pbSavePokemonFormsData
hiddenability4==origdata["hiddenability4"]
hiddenability1 = hiddenability2 = hiddenability3 = hiddenability4 = nil
end
item1 = speciesData[i][SpeciesWildItemCommon] || 0
item2 = speciesData[i][SpeciesWildItemUncommon] || 0
item3 = speciesData[i][SpeciesWildItemRare] || 0
item1 = speciesData[i][SpeciesData::WILD_ITEM_COMMON] || 0
item2 = speciesData[i][SpeciesData::WILD_ITEM_UNCOMMON] || 0
item3 = speciesData[i][SpeciesData::WILD_ITEM_RARE] || 0
if item1==origdata["item1"] && item2==origdata["item2"] && item3==origdata["item3"]
item1 = item2 = item3 = nil
end
incense = speciesData[i][SpeciesIncense] || 0
incense = speciesData[i][SpeciesData::INCENSE] || 0
incense = nil if incense==origdata["incense"]
pokedexform = speciesData[i][SpeciesPokedexForm] || 0 # No nil check
megastone = speciesData[i][SpeciesMegaStone] || 0 # No nil check
megamove = speciesData[i][SpeciesMegaMove] || 0 # No nil check
unmega = speciesData[i][SpeciesUnmegaForm] || 0 # No nil check
megamessage = speciesData[i][SpeciesMegaMessage] || 0 # No nil check
pokedexform = speciesData[i][SpeciesData::POKEDEX_FORM] || 0 # No nil check
megastone = speciesData[i][SpeciesData::MEGA_STONE] || 0 # No nil check
megamove = speciesData[i][SpeciesData::MEGA_MOVE] || 0 # No nil check
unmega = speciesData[i][SpeciesData::UNMEGA_FORM] || 0 # No nil check
megamessage = speciesData[i][SpeciesData::MEGA_MESSAGE] || 0 # No nil check
pokedata.write("\#-------------------------------\r\n")
pokedata.write("[#{cname},#{form}]\r\n")
pokedata.write("FormName = #{formname}\r\n") if formname && formname!=""
@@ -1253,8 +1253,8 @@ def pbSavePokemonFormsData
pokedata.write(met+" = #{metrics[j][i] || 0}\r\n")
end
end
if metrics[MetricBattlerShadowSize][i]!=metrics[MetricBattlerShadowSize][species]
pokedata.write("BattlerShadowSize = #{metrics[MetricBattlerShadowSize][i] || 2}\r\n")
if metrics[SpeciesData::METRIC_SHADOW_SIZE][i]!=metrics[SpeciesData::METRIC_SHADOW_SIZE][species]
pokedata.write("BattlerShadowSize = #{metrics[SpeciesData::METRIC_SHADOW_SIZE][i] || 2}\r\n")
end
end
origevos = []

View File

@@ -18,18 +18,18 @@ def pbAutoPositionAll
Graphics.update if i%50==0
bitmap1 = pbLoadSpeciesBitmap(s[0],false,s[1],false,false,true)
bitmap2 = pbLoadSpeciesBitmap(s[0],false,s[1])
metrics[MetricBattlerPlayerX][i] = 0 # Player's x
metrics[SpeciesData::METRIC_PLAYER_X][i] = 0 # Player's x
if bitmap1 && bitmap1.bitmap # Player's y
metrics[MetricBattlerPlayerY][i] = (bitmap1.height-(findBottom(bitmap1.bitmap)+1))/2
metrics[SpeciesData::METRIC_PLAYER_Y][i] = (bitmap1.height-(findBottom(bitmap1.bitmap)+1))/2
end
metrics[MetricBattlerEnemyX][i] = 0 # Foe's x
metrics[SpeciesData::METRIC_ENEMY_X][i] = 0 # Foe's x
if bitmap2 && bitmap2.bitmap # Foe's y
metrics[MetricBattlerEnemyY][i] = (bitmap2.height-(findBottom(bitmap2.bitmap)+1))/2
metrics[MetricBattlerEnemyY][i] += 4 # Just because
metrics[SpeciesData::METRIC_ENEMY_Y][i] = (bitmap2.height-(findBottom(bitmap2.bitmap)+1))/2
metrics[SpeciesData::METRIC_ENEMY_Y][i] += 4 # Just because
end
metrics[MetricBattlerAltitude][i] = 0 # Foe's altitude, not used now
metrics[MetricBattlerShadowX][i] = 0 # Shadow's x
metrics[MetricBattlerShadowSize][i] = 2 # Shadow size
metrics[SpeciesData::METRIC_ALTITUDE][i] = 0 # Foe's altitude, not used now
metrics[SpeciesData::METRIC_SHADOW_X][i] = 0 # Shadow's x
metrics[SpeciesData::METRIC_SHADOW_SIZE][i] = 2 # Shadow size
bitmap1.dispose if bitmap1
bitmap2.dispose if bitmap2
end
@@ -139,18 +139,18 @@ class SpritePositioner
end
def pbAutoPosition
oldmetric1 = (@metrics[MetricBattlerPlayerY][@species] || 0)
oldmetric3 = (@metrics[MetricBattlerEnemyY][@species] || 0)
oldmetric4 = (@metrics[MetricBattlerAltitude][@species] || 0)
oldmetric1 = (@metrics[SpeciesData::METRIC_PLAYER_Y][@species] || 0)
oldmetric3 = (@metrics[SpeciesData::METRIC_ENEMY_Y][@species] || 0)
oldmetric4 = (@metrics[SpeciesData::METRIC_ALTITUDE][@species] || 0)
bitmap1 = @sprites["pokemon_0"].bitmap
bitmap2 = @sprites["pokemon_1"].bitmap
newmetric1 = (bitmap1.height-(findBottom(bitmap1)+1))/2
newmetric3 = (bitmap2.height-(findBottom(bitmap2)+1))/2
newmetric3 += 4 # Just because
if newmetric1!=oldmetric1 || newmetric3!=oldmetric3 || oldmetric4!=0
@metrics[MetricBattlerPlayerY][@species] = newmetric1
@metrics[MetricBattlerEnemyY][@species] = newmetric3
@metrics[MetricBattlerAltitude][@species] = 0
@metrics[SpeciesData::METRIC_PLAYER_Y][@species] = newmetric1
@metrics[SpeciesData::METRIC_ENEMY_Y][@species] = newmetric3
@metrics[SpeciesData::METRIC_ALTITUDE][@species] = 0
@metricsChanged = true
refresh
end
@@ -167,7 +167,7 @@ class SpritePositioner
def pbShadowSize
pbChangeSpecies(@species)
refresh
oldval = (@metrics[MetricBattlerShadowSize][@species] || 2)
oldval = (@metrics[SpeciesData::METRIC_SHADOW_SIZE][@species] || 2)
cmdvals = [0]; commands = [_INTL("None")]
defindex = 0
i = 0
@@ -190,17 +190,17 @@ class SpritePositioner
self.update
if cw.index!=oldindex
oldindex = cw.index
@metrics[MetricBattlerShadowSize][@species] = cmdvals[cw.index]
@metrics[SpeciesData::METRIC_SHADOW_SIZE][@species] = cmdvals[cw.index]
pbChangeSpecies(@species)
refresh
end
if Input.trigger?(Input::A) # Cycle to next option
pbPlayDecisionSE
@metricsChanged = true if @metrics[MetricBattlerShadowSize][@species]!=oldval
@metricsChanged = true if @metrics[SpeciesData::METRIC_SHADOW_SIZE][@species]!=oldval
ret = true
break
elsif Input.trigger?(Input::B)
@metrics[MetricBattlerShadowSize][@species] = oldval
@metrics[SpeciesData::METRIC_SHADOW_SIZE][@species] = oldval
pbPlayCancelSE
break
elsif Input.trigger?(Input::C)
@@ -223,15 +223,15 @@ class SpritePositioner
case param
when 0
sprite = @sprites["pokemon_0"]
xpos = (@metrics[MetricBattlerPlayerX][@species] || 0)
ypos = (@metrics[MetricBattlerPlayerY][@species] || 0)
xpos = (@metrics[SpeciesData::METRIC_PLAYER_X][@species] || 0)
ypos = (@metrics[SpeciesData::METRIC_PLAYER_Y][@species] || 0)
when 1
sprite = @sprites["pokemon_1"]
xpos = (@metrics[MetricBattlerEnemyX][@species] || 0)
ypos = (@metrics[MetricBattlerEnemyY][@species] || 0)
xpos = (@metrics[SpeciesData::METRIC_ENEMY_X][@species] || 0)
ypos = (@metrics[SpeciesData::METRIC_ENEMY_Y][@species] || 0)
when 3
sprite = @sprites["shadow_1"]
xpos = (@metrics[MetricBattlerShadowX][@species] || 0)
xpos = (@metrics[SpeciesData::METRIC_SHADOW_X][@species] || 0)
ypos = 0
end
oldxpos = xpos
@@ -251,32 +251,32 @@ class SpritePositioner
if Input.repeat?(Input::UP) && param!=3
ypos -= 1
case param
when 0; @metrics[MetricBattlerPlayerY][@species] = ypos
when 1; @metrics[MetricBattlerEnemyY][@species] = ypos
when 0; @metrics[SpeciesData::METRIC_PLAYER_Y][@species] = ypos
when 1; @metrics[SpeciesData::METRIC_ENEMY_Y][@species] = ypos
end
refresh
elsif Input.repeat?(Input::DOWN) && param!=3
ypos += 1
case param
when 0; @metrics[MetricBattlerPlayerY][@species] = ypos
when 1; @metrics[MetricBattlerEnemyY][@species] = ypos
when 0; @metrics[SpeciesData::METRIC_PLAYER_Y][@species] = ypos
when 1; @metrics[SpeciesData::METRIC_ENEMY_Y][@species] = ypos
end
refresh
end
if Input.repeat?(Input::LEFT)
xpos -= 1
case param
when 0; @metrics[MetricBattlerPlayerX][@species] = xpos
when 1; @metrics[MetricBattlerEnemyX][@species] = xpos
when 3; @metrics[MetricBattlerShadowX][@species] = xpos
when 0; @metrics[SpeciesData::METRIC_PLAYER_X][@species] = xpos
when 1; @metrics[SpeciesData::METRIC_ENEMY_X][@species] = xpos
when 3; @metrics[SpeciesData::METRIC_SHADOW_X][@species] = xpos
end
refresh
elsif Input.repeat?(Input::RIGHT)
xpos += 1
case param
when 0; @metrics[MetricBattlerPlayerX][@species] = xpos
when 1; @metrics[MetricBattlerEnemyX][@species] = xpos
when 3; @metrics[MetricBattlerShadowX][@species] = xpos
when 0; @metrics[SpeciesData::METRIC_PLAYER_X][@species] = xpos
when 1; @metrics[SpeciesData::METRIC_ENEMY_X][@species] = xpos
when 3; @metrics[SpeciesData::METRIC_SHADOW_X][@species] = xpos
end
refresh
end
@@ -288,13 +288,13 @@ class SpritePositioner
elsif Input.repeat?(Input::B)
case param
when 0
@metrics[MetricBattlerPlayerX][@species] = oldxpos
@metrics[MetricBattlerPlayerY][@species] = oldypos
@metrics[SpeciesData::METRIC_PLAYER_X][@species] = oldxpos
@metrics[SpeciesData::METRIC_PLAYER_Y][@species] = oldypos
when 1
@metrics[MetricBattlerEnemyX][@species] = oldxpos
@metrics[MetricBattlerEnemyY][@species] = oldypos
@metrics[SpeciesData::METRIC_ENEMY_X][@species] = oldxpos
@metrics[SpeciesData::METRIC_ENEMY_Y][@species] = oldypos
when 3
@metrics[MetricBattlerShadowX][@species] = oldxpos
@metrics[SpeciesData::METRIC_SHADOW_X][@species] = oldxpos
end
pbPlayCancelSE
refresh

View File

@@ -702,8 +702,8 @@ end
#===============================================================================
def pbCompilePokemonData
# Get schemas.
requiredValues = PokemonSpeciesData.requiredValues
optionalValues = PokemonSpeciesData.optionalValues
requiredValues = SpeciesData.requiredValues
optionalValues = SpeciesData.optionalValues
# Prepare arrays for compiled data.
speciesData = []
movesets = []
@@ -839,7 +839,7 @@ def pbCompilePokemonData
save_data(regionalDexes,"Data/regional_dexes.dat")
# Save metrics data.
for i in 0...7
defaultValue = (i==MetricBattlerShadowSize) ? 2 : 0 # Shadow size 2, other metrics 0
defaultValue = (i==SpeciesData::METRIC_SHADOW_SIZE) ? 2 : 0 # Shadow size 2, other metrics 0
for j in 0..maxValue
spriteMetrics[i] = [] if !spriteMetrics[i]
spriteMetrics[i][j] ||= defaultValue
@@ -895,8 +895,8 @@ end
#===============================================================================
def pbCompilePokemonForms
# Get schemas.
requiredValues = PokemonSpeciesData.requiredValues(true)
optionalValues = PokemonSpeciesData.optionalValues(true)
requiredValues = SpeciesData.requiredValues(true)
optionalValues = SpeciesData.optionalValues(true)
# Prepare arrays for compiled data.
speciesData = pbLoadSpeciesData
movesets = []
@@ -966,9 +966,9 @@ def pbCompilePokemonForms
if (contents["WildItemCommon"] && contents["WildItemCommon"]!="") ||
(contents["WildItemUncommon"] && contents["WildItemUncommon"]!="") ||
(contents["WildItemRare"] && contents["WildItemRare"]!="")
speciesData[speciesID][SpeciesWildItemCommon] = nil
speciesData[speciesID][SpeciesWildItemUncommon] = nil
speciesData[speciesID][SpeciesWildItemRare] = nil
speciesData[speciesID][SpeciesData::WILD_ITEM_COMMON] = nil
speciesData[speciesID][SpeciesData::WILD_ITEM_UNCOMMON] = nil
speciesData[speciesID][SpeciesData::WILD_ITEM_RARE] = nil
end
# Go through hashes of compilable data and compile this section.
[requiredValues,optionalValues].each do |hash|
@@ -1051,7 +1051,7 @@ def pbCompilePokemonForms
# Inherit base form metrics data.
newSpriteMetrics = pbLoadSpeciesMetrics
for i in 0...7
defaultValue = (i==MetricBattlerShadowSize) ? 2 : 0 # Shadow size 2, other metrics 0
defaultValue = (i==SpeciesData::METRIC_SHADOW_SIZE) ? 2 : 0 # Shadow size 2, other metrics 0
pbAppendToBaseFormData(PBSpecies.maxValue+1,maxValue,newSpriteMetrics[i],
spriteMetrics[i] || [],speciesToForm,false,defaultValue)
end