mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Moved species data constants into module SpeciesData
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user