Rewrote evolution methods to make them modular

This commit is contained in:
Maruno17
2020-09-10 22:22:06 +01:00
parent aaf5949c13
commit 6f353ba813
9 changed files with 474 additions and 363 deletions

View File

@@ -207,9 +207,7 @@ BallHandlers::ModifyCatchRate.add(:MOONBALL,proc { |ball,catchRate,battle,battle
# family can evolve with the Moon Stone, not whether the target itself # family can evolve with the Moon Stone, not whether the target itself
# can immediately evolve with the Moon Stone. # can immediately evolve with the Moon Stone.
if hasConst?(PBItems,:MOONSTONE) && if hasConst?(PBItems,:MOONSTONE) &&
pbCheckEvolutionFamilyForMethod(battler.species, pbCheckEvolutionFamilyForItemMethodItem(battler.species,getConst(PBItems,:MOONSTONE))
[PBEvolution::Item,PBEvolution::ItemMale,PBEvolution::ItemFemale],
getConst(PBItems,:MOONSTONE))
catchRate *= 4 catchRate *= 4
end end
next [catchRate,255].min next [catchRate,255].min

View File

@@ -1,5 +1,5 @@
module PBEvolution module PBEvolution
None = 0 # Do not use None = 0
Happiness = 1 Happiness = 1
HappinessDay = 2 HappinessDay = 2
HappinessNight = 3 HappinessNight = 3
@@ -31,10 +31,6 @@ module PBEvolution
LevelRain = 29 LevelRain = 29
HappinessMoveType = 30 HappinessMoveType = 30
LevelEvening = 31 LevelEvening = 31
Custom1 = 32
Custom2 = 33
Custom3 = 34
Custom4 = 35
EVONAMES = ["None", EVONAMES = ["None",
"Happiness", "HappinessDay", "HappinessNight", "Level", "Trade", "Happiness", "HappinessDay", "HappinessNight", "Level", "Trade",
@@ -43,29 +39,43 @@ module PBEvolution
"ItemMale", "ItemFemale", "DayHoldItem", "NightHoldItem", "HasMove", "ItemMale", "ItemFemale", "DayHoldItem", "NightHoldItem", "HasMove",
"HasInParty", "LevelMale", "LevelFemale", "Location", "TradeSpecies", "HasInParty", "LevelMale", "LevelFemale", "Location", "TradeSpecies",
"LevelDay", "LevelNight", "LevelDarkInParty", "LevelRain", "HappinessMoveType", "LevelDay", "LevelNight", "LevelDarkInParty", "LevelRain", "HappinessMoveType",
"LevelEvening", "Custom1", "Custom2", "Custom3", "Custom4", "LevelEvening"
] ]
# 0 = no parameter @@evolution_methods = HandlerHash.new(:PBEvolution)
# 1 = Positive integer
# 2 = Item internal name def self.copy(sym, *syms)
# 3 = Move internal name @@evolution_methods.copy(sym, *syms)
# 4 = Species internal name end
# 5 = Type internal name
# 6 = Ability internal name def self.register(sym, hash)
EVOPARAM = [0, # None (do not use) @@evolution_methods.add(sym, hash)
0,0,0,1,0, # Happiness, HappinessDay, HappinessNight, Level, Trade end
2,2,1,1,1, # TradeItem, Item, AttackGreater, AtkDefEqual, DefenseGreater
1,1,1,1,1, # Silcoon, Cascoon, Ninjask, Shedinja, Beauty def self.registerIf(cond, hash)
2,2,2,2,3, # ItemMale, ItemFemale, DayHoldItem, NightHoldItem, HasMove @@evolution_methods.addIf(cond, hash)
4,1,1,1,4, # HasInParty, LevelMale, LevelFemale, Location, TradeSpecies end
1,1,1,1,5, # LevelDay, LevelNight, LevelDarkInParty, LevelRain, HappinessMoveType
1,1,1,1,1 # LevelEvening, Custom 1-4 def self.hasFunction?(method, function)
] method = (method.is_a?(Numeric)) ? method : getConst(PBEvolution, method)
method_hash = @@evolution_methods[method]
return method_hash && method_hash[function]
end
def self.getFunction(method, function)
method = (method.is_a?(Numeric)) ? method : getConst(PBEvolution, method)
method_hash = @@evolution_methods[method]
return (method_hash && method_hash[function]) ? method_hash[function] : nil
end
def self.call(function, method, *args)
method = (method.is_a?(Numeric)) ? method : getConst(PBEvolution, method)
method_hash = @@evolution_methods[method]
return nil if !method_hash || !method_hash[function]
return method_hash[function].call(*args)
end
end end
#=============================================================================== #===============================================================================
# Evolutions data cache # Evolutions data cache
#=============================================================================== #===============================================================================
@@ -73,8 +83,6 @@ class PokemonTemp
attr_accessor :evolutionsData attr_accessor :evolutionsData
end end
def pbLoadEvolutionsData def pbLoadEvolutionsData
$PokemonTemp = PokemonTemp.new if !$PokemonTemp $PokemonTemp = PokemonTemp.new if !$PokemonTemp
if !$PokemonTemp.evolutionsData if !$PokemonTemp.evolutionsData
@@ -138,24 +146,18 @@ def pbGetBabySpecies(species,item1=-1,item2=-1)
end end
def pbGetMinimumLevel(species) def pbGetMinimumLevel(species)
methodsWithMinLevel = [
PBEvolution::Level, PBEvolution::LevelMale, PBEvolution::LevelFemale,
PBEvolution::AttackGreater, PBEvolution::AtkDefEqual, PBEvolution::DefenseGreater,
PBEvolution::Silcoon, PBEvolution::Cascoon,
PBEvolution::Ninjask, PBEvolution::Shedinja,
PBEvolution::LevelDay, PBEvolution::LevelNight,
PBEvolution::LevelDarkInParty, PBEvolution::LevelRain
]
evoData = pbGetEvolutionData(species) evoData = pbGetEvolutionData(species)
return 1 if !evoData || evoData.length==0 return 1 if !evoData || evoData.length == 0
ret = -1 ret = -1
evoData.each do |evo| evoData.each do |evo|
if evo[3] && methodsWithMinLevel.include?(evo[1]) # Is the prevolution next if !evo[3] # Is the prevolution
ret = (ret<0) ? evo[2] : [ret,evo[2]].min if PBEvolution.hasFunction?(evo[1], "levelUpCheck")
break min_level = PBEvolution.getFunction(evo[1], "minimumLevel")
ret = evo[2] if !min_level || min_level != 1
end end
break # Because only one prevolution method can be defined
end end
return (ret==-1) ? 1 : ret return (ret == -1) ? 1 : ret
end end
def pbGetEvolutionFamilyData(species) def pbGetEvolutionFamilyData(species)
@@ -172,17 +174,31 @@ end
# Used by the Moon Ball when checking if a Pokémon's evolution family includes # Used by the Moon Ball when checking if a Pokémon's evolution family includes
# an evolution that uses the Moon Stone. # an evolution that uses the Moon Stone.
def pbCheckEvolutionFamilyForMethod(species,method,param=-1) def pbCheckEvolutionFamilyForMethod(species, method, param = -1)
species = pbGetBabySpecies(species) species = pbGetBabySpecies(species)
evos = pbGetEvolutionFamilyData(species) evos = pbGetEvolutionFamilyData(species)
return false if !evos || evos.length==0 return false if !evos || evos.length == 0
for evo in evos for evo in evos
if method.is_a?(Array) if method.is_a?(Array)
next if !method.include?(evo[1]) next if !method.include?(evo[1])
elsif method>=0 elsif method>=0
next if evo[1]!=method next if evo[1] != method
end end
next if param>=0 && evo[2]!=param next if param >= 0 && evo[2] != param
return true
end
return false
end
# Used by the Moon Ball when checking if a Pokémon's evolution family includes
# an evolution that uses the Moon Stone.
def pbCheckEvolutionFamilyForItemMethodItem(species, param = -1)
species = pbGetBabySpecies(species)
evos = pbGetEvolutionFamilyData(species)
return false if !evos || evos.length == 0
for evo in evos
next if !PBEvolution.hasFunction?(evo[1], "itemCheck")
next if param >= 0 && evo[2] != param
return true return true
end end
return false return false
@@ -202,106 +218,17 @@ def pbEvoDebug # Unused
echo "end\n" echo "end\n"
end end
#=============================================================================== #===============================================================================
# Evolution methods # Evolution checks
#=============================================================================== #===============================================================================
def pbMiniCheckEvolution(pokemon,evonib,level,poke) def pbMiniCheckEvolution(pkmn, method, parameter, new_species)
case evonib success = PBEvolution.call("levelUpCheck", method, pkmn, parameter)
when PBEvolution::Happiness return (success) ? new_species : -1
return poke if pokemon.happiness>=220
when PBEvolution::HappinessDay
return poke if pokemon.happiness>=220 && PBDayNight.isDay?
when PBEvolution::HappinessNight
return poke if pokemon.happiness>=220 && PBDayNight.isNight?
when PBEvolution::HappinessMoveType
if pokemon.happiness>=220
for m in pokemon.moves
return poke if m.id>0 && m.type==level
end
end
when PBEvolution::Level
return poke if pokemon.level>=level
when PBEvolution::LevelDay
return poke if pokemon.level>=level && PBDayNight.isDay?
when PBEvolution::LevelNight
return poke if pokemon.level>=level && PBDayNight.isNight?
when PBEvolution::LevelEvening
return poke if pokemon.level>=level && PBDayNight.isEvening?
when PBEvolution::LevelMale
return poke if pokemon.level>=level && pokemon.male?
when PBEvolution::LevelFemale
return poke if pokemon.level>=level && pokemon.female?
when PBEvolution::AttackGreater # Hitmonlee
return poke if pokemon.level>=level && pokemon.attack>pokemon.defense
when PBEvolution::AtkDefEqual # Hitmontop
return poke if pokemon.level>=level && pokemon.attack==pokemon.defense
when PBEvolution::DefenseGreater # Hitmonchan
return poke if pokemon.level>=level && pokemon.attack<pokemon.defense
when PBEvolution::Silcoon
return poke if pokemon.level>=level && (((pokemon.personalID>>16)&0xFFFF)%10)<5
when PBEvolution::Cascoon
return poke if pokemon.level>=level && (((pokemon.personalID>>16)&0xFFFF)%10)>=5
when PBEvolution::Ninjask
return poke if pokemon.level>=level
when PBEvolution::Shedinja
return -1
when PBEvolution::DayHoldItem
return poke if pokemon.item==level && PBDayNight.isDay?
when PBEvolution::NightHoldItem
return poke if pokemon.item==level && PBDayNight.isNight?
when PBEvolution::HasMove
for m in pokemon.moves
return poke if m.id==level
end
when PBEvolution::HasInParty
for i in $Trainer.pokemonParty
return poke if i.species==level
end
when PBEvolution::LevelDarkInParty
if pokemon.level>=level
for i in $Trainer.pokemonParty
return poke if i.hasType?(:DARK)
end
end
when PBEvolution::Location
return poke if $game_map.map_id==level
when PBEvolution::LevelRain
if pokemon.level>=level
if $game_screen && ($game_screen.weather_type==PBFieldWeather::Rain ||
$game_screen.weather_type==PBFieldWeather::HeavyRain ||
$game_screen.weather_type==PBFieldWeather::Storm)
return poke
end
end
when PBEvolution::Beauty # Feebas
return poke if pokemon.beauty>=level
when PBEvolution::Trade, PBEvolution::TradeItem, PBEvolution::TradeSpecies
return -1
when PBEvolution::Custom1
# Add code for custom evolution type 1
when PBEvolution::Custom2
# Add code for custom evolution type 2
when PBEvolution::Custom3
# Add code for custom evolution type 3
when PBEvolution::Custom4
# Add code for custom evolution type 4
end
return -1
end end
def pbMiniCheckEvolutionItem(pokemon,evonib,level,poke,item) def pbMiniCheckEvolutionItem(pkmn, method, parameter, new_species, item)
# Checks for when an item is used on the Pokémon (e.g. an evolution stone) success = PBEvolution.call("itemCheck", method, pkmn, parameter, item)
case evonib return (success) ? new_species : -1
when PBEvolution::Item
return poke if level==item
when PBEvolution::ItemMale
return poke if level==item && pokemon.male?
when PBEvolution::ItemFemale
return poke if level==item && pokemon.female?
end
return -1
end end
# Checks whether a Pokemon can evolve now. If a block is given, calls the block # Checks whether a Pokemon can evolve now. If a block is given, calls the block
@@ -332,3 +259,244 @@ def pbCheckEvolution(pokemon,item=0)
} }
end end
end end
#===============================================================================
# Evolution methods that trigger when levelling up
#===============================================================================
PBEvolution.register(:Level, {
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter
}
})
PBEvolution.register(:LevelMale, {
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter && pkmn.male?
}
})
PBEvolution.register(:LevelFemale, {
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter && pkmn.female?
}
})
PBEvolution.register(:LevelDay, {
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter && PBDayNight.isDay?
}
})
PBEvolution.register(:LevelNight, {
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter && PBDayNight.isNight?
}
})
PBEvolution.register(:LevelEvening, {
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter && PBDayNight.isEvening?
}
})
PBEvolution.register(:LevelDarkInParty, {
"levelUpCheck" => proc { |pkmn, parameter|
if pkmn.level >= parameter
next $Trainer.pokemonParty.any? { |p| p && p.hasType(:DARK) }
end
}
})
PBEvolution.register(:LevelRain, {
"levelUpCheck" => proc { |pkmn, parameter|
if pkmn.level >= parameter && $game_screen
next [PBFieldWeather::Rain, PBFieldWeather::HeavyRain,
PBFieldWeather::Storm].include?($game_screen.weather_type)
end
}
})
PBEvolution.register(:AttackGreater, { # Hitmonlee
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter && pkmn.attack > pkmn.defense
}
})
PBEvolution.register(:AtkDefEqual, { # Hitmontop
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter && pkmn.attack == pkmn.defense
}
})
PBEvolution.register(:DefenseGreater, { # Hitmonchan
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter && pkmn.attack < pkmn.defense
}
})
PBEvolution.register(:Silcoon, {
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter && (((pkmn.personalID >> 16) & 0xFFFF) % 10) < 5
}
})
PBEvolution.register(:Cascoon, {
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter && (((pkmn.personalID >> 16) & 0xFFFF) % 10) >= 5
}
})
PBEvolution.register(:Ninjask, {
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.level >= parameter
}
})
PBEvolution.register(:Shedinja, {
"afterEvolution" => proc { |pkmn, new_species, parameter, evo_species|
next false if $Trainer.party.length>=6
next false if !$PokemonBag.pbHasItem?(getConst(PBItems,:POKEBALL))
PokemonEvolutionScene.pbDuplicatePokemon(pkmn, new_species)
$PokemonBag.pbDeleteItem(getConst(PBItems,:POKEBALL))
next true
}
})
PBEvolution.register(:Happiness, {
"minimumLevel" => 1, # Needs any level up
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.happiness >= 220
}
})
PBEvolution.register(:HappinessDay, {
"minimumLevel" => 1, # Needs any level up
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.happiness >= 220 && PBDayNight.isDay?
}
})
PBEvolution.register(:HappinessNight, {
"minimumLevel" => 1, # Needs any level up
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.happiness >= 220 && PBDayNight.isDay?
}
})
PBEvolution.register(:HappinessMoveType, {
"minimumLevel" => 1, # Needs any level up
"parameterType" => :PBTypes,
"levelUpCheck" => proc { |pkmn, parameter|
if pkmn.happiness >= 220
next pkmn.moves.any? { |m| m && m.id > 0 && m.type == parameter }
end
}
})
PBEvolution.register(:Beauty, { # Feebas
"minimumLevel" => 1, # Needs any level up
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.beauty >= parameter
}
})
PBEvolution.register(:DayHoldItem, {
"minimumLevel" => 1, # Needs any level up
"parameterType" => :PBItems,
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.item == parameter && PBDayNight.isDay?
},
"afterEvolution" => proc { |pkmn, new_species, parameter, evo_species|
next false if evo_species != new_species || !pkmn.hasItem?(parameter)
pkmn.setItem(0) # Item is now consumed
next true
}
})
PBEvolution.register(:NightHoldItem, {
"minimumLevel" => 1, # Needs any level up
"parameterType" => :PBItems,
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.item == parameter && PBDayNight.isNight?
},
"afterEvolution" => proc { |pkmn, new_species, parameter, evo_species|
next false if evo_species != new_species || !pkmn.hasItem?(parameter)
pkmn.setItem(0) # Item is now consumed
next true
}
})
PBEvolution.register(:HasMove, {
"minimumLevel" => 1, # Needs any level up
"parameterType" => :PBMoves,
"levelUpCheck" => proc { |pkmn, parameter|
next pkmn.moves.any? { |m| m && m.id == parameter }
}
})
PBEvolution.register(:HasInParty, {
"minimumLevel" => 1, # Needs any level up
"parameterType" => :PBSpecies,
"levelUpCheck" => proc { |pkmn, parameter|
next pbHasSpecies?(parameter)
}
})
PBEvolution.register(:Location, {
"minimumLevel" => 1, # Needs any level up
"levelUpCheck" => proc { |pkmn, parameter|
next $game_map.map_id == parameter
}
})
#===============================================================================
# Evolution methods that trigger when using an item on the Pokémon
#===============================================================================
PBEvolution.register(:Item, {
"parameterType" => :PBItems,
"itemCheck" => proc { |pkmn, parameter, item|
next item == parameter
}
})
PBEvolution.register(:ItemMale, {
"parameterType" => :PBItems,
"itemCheck" => proc { |pkmn, parameter, item|
next item == parameter && pkmn.male?
}
})
PBEvolution.register(:ItemFemale, {
"parameterType" => :PBItems,
"itemCheck" => proc { |pkmn, parameter, item|
next item == parameter && pkmn.female?
}
})
#===============================================================================
# Evolution methods that trigger when the Pokémon is obtained in a trade
#===============================================================================
PBEvolution.register(:Trade, {
"tradeCheck" => proc { |pkmn, parameter, other_pkmn|
next true
}
})
PBEvolution.register(:TradeItem, {
"parameterType" => :PBItems,
"tradeCheck" => proc { |pkmn, parameter, other_pkmn|
next pkmn.item == parameter
},
"afterEvolution" => proc { |pkmn, new_species, parameter, evo_species|
next false if evo_species != new_species || !pkmn.hasItem?(parameter)
pkmn.setItem(0) # Item is now consumed
next true
}
})
PBEvolution.register(:TradeSpecies, {
"parameterType" => :PBSpecies,
"tradeCheck" => proc { |pkmn, parameter, other_pkmn|
next pkmn.species == parameter && !other_pkmn.hasItem?(:EVERSTONE)
}
})

View File

@@ -583,7 +583,7 @@ class PokemonEvolutionScene
@pokemon.name,newspeciesname)) { pbUpdate } @pokemon.name,newspeciesname)) { pbUpdate }
@sprites["msgwindow"].text = "" @sprites["msgwindow"].text = ""
# Check for consumed item and check if Pokémon should be duplicated # Check for consumed item and check if Pokémon should be duplicated
createSpecies = pbRemoveItemAfterEvolution pbEvolutionMethodAfterEvolution
# Modify Pokémon to make it evolved # Modify Pokémon to make it evolved
@pokemon.species = @newspecies @pokemon.species = @newspecies
@pokemon.name = newspeciesname if @pokemon.name==oldspeciesname @pokemon.name = newspeciesname if @pokemon.name==oldspeciesname
@@ -599,46 +599,30 @@ class PokemonEvolutionScene
next if i[0]!=0 && i[0]!=@pokemon.level # 0 is "learn upon evolution" next if i[0]!=0 && i[0]!=@pokemon.level # 0 is "learn upon evolution"
pbLearnMove(@pokemon,i[1],true) { pbUpdate } pbLearnMove(@pokemon,i[1],true) { pbUpdate }
end end
# Duplicate Pokémon (i.e. Shedinja)
if createSpecies>0 && $Trainer.party.length<6
pbDuplicatePokemon(createSpecies)
# Consume Poké Ball
$PokemonBag.pbDeleteItem(getConst(PBItems,:POKEBALL))
end
end end
def pbRemoveItemAfterEvolution def pbEvolutionMethodAfterEvolution
removeItem = false pbCheckEvolutionEx(@pokemon) { |pkmn, method, parameter, new_species|
createSpecies = pbCheckEvolutionEx(@pokemon) { |_pokemon,evonib,_level,pkmn| success = PBEvolution.call("afterEvolution", method, pkmn, new_species, parameter, @newspecies)
case evonib next (success) ? 1 : -1
when PBEvolution::Shedinja
next pkmn if $PokemonBag.pbHasItem?(getConst(PBItems,:POKEBALL))
when PBEvolution::TradeItem,PBEvolution::DayHoldItem,PBEvolution::NightHoldItem
removeItem = true if pkmn==@newspecies # Item is now consumed
end
next -1
} }
@pokemon.setItem(0) if removeItem
return createSpecies
end end
def pbDuplicatePokemon(createSpecies) def self.pbDuplicatePokemon(pkmn, new_species)
newpokemon = @pokemon.clone new_pkmn = pkmn.clone
newpokemon.species = createSpecies new_pkmn.species = new_species
newpokemon.name = PBSpecies.getName(createSpecies) new_pkmn.name = PBSpecies.getName(new_species)
newpokemon.iv = @pokemon.iv.clone new_pkmn.markings = 0
newpokemon.ev = @pokemon.ev.clone new_pkmn.ballused = 0
newpokemon.markings = 0 new_pkmn.setItem(0)
newpokemon.ballused = 0 new_pkmn.clearAllRibbons
newpokemon.setItem(0) new_pkmn.calcStats
newpokemon.clearAllRibbons new_pkmn.heal
newpokemon.calcStats
newpokemon.heal
# Add duplicate Pokémon to party # Add duplicate Pokémon to party
$Trainer.party.push(newpokemon) $Trainer.party.push(new_pkmn)
# See and own duplicate Pokémon # See and own duplicate Pokémon
$Trainer.seen[createSpecies] = true $Trainer.seen[new_species] = true
$Trainer.owned[createSpecies] = true $Trainer.owned[new_species] = true
pbSeenForm(newpokemon) pbSeenForm(new_pkmn)
end end
end end

View File

@@ -227,22 +227,10 @@ end
#=============================================================================== #===============================================================================
# Evolution methods # Evolution methods
#=============================================================================== #===============================================================================
def pbTradeCheckEvolution(pokemon,pokemon2) def pbTradeCheckEvolution(pkmn, other_pkmn)
ret = pbCheckEvolutionEx(pokemon) { |pokemon,evonib,level,poke| ret = pbCheckEvolutionEx(pkmn) { |pkmn, method, parameter, new_species|
case evonib success = PBEvolution.call("tradeCheck", method, pkmn, parameter, other_pkmn)
when PBEvolution::Trade next (success) ? new_species : -1
next poke
when PBEvolution::TradeItem
if pokemon.item==level
pokemon.setItem(0)
next poke
end
when PBEvolution::TradeSpecies
if !pokemon2.hasItem?(:EVERSTONE)
next poke if pokemon2.species==level
end
end
next -1
} }
return ret return ret
end end

View File

@@ -798,7 +798,7 @@ def pbPokemonEditor
_INTL("Urban"),_INTL("Rare")]), _INTL("Urban"),_INTL("Rare")]),
_INTL("The habitat of this species.")], _INTL("The habitat of this species.")],
[_INTL("RegionalNumbers"),ReadOnlyProperty,_INTL("Regional Dex numbers for the Pokémon. These are edited elsewhere.")], [_INTL("RegionalNumbers"),ReadOnlyProperty,_INTL("Regional Dex numbers for the Pokémon. These are edited elsewhere.")],
[_INTL("Kind"),StringProperty._INTL("Kind of Pokémon species.")], [_INTL("Kind"),StringProperty,_INTL("Kind of Pokémon species.")],
[_INTL("Pokédex"),StringProperty,_INTL("Description of the Pokémon as displayed in the Pokédex.")], [_INTL("Pokédex"),StringProperty,_INTL("Description of the Pokémon as displayed in the Pokédex.")],
[_INTL("FormName"),StringProperty,_INTL("Name of this form of the Pokémon.")], [_INTL("FormName"),StringProperty,_INTL("Name of this form of the Pokémon.")],
[_INTL("WildItemCommon"),ItemProperty,_INTL("Item commonly held by wild Pokémon of this species.")], [_INTL("WildItemCommon"),ItemProperty,_INTL("Item commonly held by wild Pokémon of this species.")],

View File

@@ -829,33 +829,21 @@ def pbSavePokemonData
pokedata.write("Evolutions = ") pokedata.write("Evolutions = ")
count = 0 count = 0
for form in pbGetEvolvedFormData(i) for form in pbGetEvolvedFormData(i)
evonib = form[0] method = form[0]
level = form[1] parameter = form[1]
poke = form[2] new_species = form[2]
next if poke==0 next if new_species==0
cpoke = getConstantName(PBSpecies,poke) rescue pbGetSpeciesConst(poke) cnew_species = getConstantName(PBSpecies,new_species) rescue pbGetSpeciesConst(new_species)
evoname = getConstantName(PBEvolution,evonib) rescue pbGetEvolutionConst(evonib) evoname = getConstantName(PBEvolution,method) rescue pbGetEvolutionConst(method)
next if !cpoke || cpoke=="" next if !cnew_species || cnew_species==""
pokedata.write(",") if count>0 pokedata.write(",") if count>0
pokedata.write(sprintf("%s,%s,",cpoke,evoname)) pokedata.write(sprintf("%s,%s,",cnew_species,evoname))
case PBEvolution::EVOPARAM[evonib] param_type = PBEvolution.getFunction(method, "parameterType")
when 1 if param_type
pokedata.write("#{level}") cparameter = getConstantName(param_type,parameter) rescue ""
when 2 pokedata.write("#{cparameter}")
clevel = getConstantName(PBItems,level) rescue pbGetItemConst(level) else
pokedata.write("#{clevel}") pokedata.write("#{parameter}")
when 3
clevel = getConstantName(PBMoves,level) rescue pbGetMoveConst(level)
pokedata.write("#{clevel}")
when 4
clevel = getConstantName(PBSpecies,level) rescue pbGetSpeciesConst(level)
pokedata.write("#{clevel}")
when 5
clevel = getConstantName(PBTypes,level) rescue pbGetTypeConst(level)
pokedata.write("#{clevel}")
when 6
clevel = getConstantName(PBAbilities,level) rescue pbGetAbilityConst(level)
pokedata.write("#{clevel}")
end end
count += 1 count += 1
end end
@@ -1230,8 +1218,9 @@ def pbSavePokemonFormsData
if shape!=nil if shape!=nil
pokedata.write("Shape = #{shape}\r\n") pokedata.write("Shape = #{shape}\r\n")
end end
if habitat!=nil if habitat!=nil && habitat>0
pokedata.write("Habitat = "+["","Grassland","Forest","WatersEdge","Sea","Cave","Mountain","RoughTerrain","Urban","Rare"][habitat]+"\r\n") if habitat>0 habitat_name = getConstantName(PBHabitats,habitat) rescue pbGetHabitatConst(habitat)
pokedata.write("Habitat = #{habitat_name}\r\n")
end end
if kind!=nil if kind!=nil
pokedata.write("Kind = #{kind}\r\n") pokedata.write("Kind = #{kind}\r\n")
@@ -1267,25 +1256,25 @@ def pbSavePokemonFormsData
end end
origevos = [] origevos = []
for form in pbGetEvolvedFormData(species) for form in pbGetEvolvedFormData(species)
evonib = form[0] method = form[0]
level = form[1] parameter = form[1]
poke = form[2] new_species = form[2]
next if poke==0 next if new_species==0
cpoke = getConstantName(PBSpecies,poke) rescue pbGetSpeciesConst(poke) cnew_species = getConstantName(PBSpecies,new_species) rescue pbGetSpeciesConst(new_species)
evoname = getConstantName(PBEvolution,evonib) rescue pbGetEvolutionConst(evonib) evoname = getConstantName(PBEvolution,method) rescue pbGetEvolutionConst(method)
next if !cpoke || cpoke=="" next if !cnew_species || cnew_species==""
origevos.push([evonib,level,poke]) origevos.push([method,parameter,new_species])
end end
evos = [] evos = []
for form in pbGetEvolvedFormData(i) for form in pbGetEvolvedFormData(i)
evonib = form[0] method = form[0]
level = form[1] parameter = form[1]
poke = form[2] new_species = form[2]
next if poke==0 next if new_species==0
cpoke = getConstantName(PBSpecies,poke) rescue pbGetSpeciesConst(poke) cnew_species = getConstantName(PBSpecies,new_species) rescue pbGetSpeciesConst(new_species)
evoname = getConstantName(PBEvolution,evonib) rescue pbGetEvolutionConst(evonib) evoname = getConstantName(PBEvolution,method) rescue pbGetEvolutionConst(method)
next if !cpoke || cpoke=="" next if !cnew_species || cnew_species==""
evos.push([evonib,level,poke]) evos.push([method,parameter,new_species])
end end
diff = false diff = false
if evos.length!=origevos.length if evos.length!=origevos.length
@@ -1302,28 +1291,19 @@ def pbSavePokemonFormsData
if diff if diff
pokedata.write("Evolutions = ") pokedata.write("Evolutions = ")
for k in 0...evos.length for k in 0...evos.length
cpoke = getConstantName(PBSpecies,poke) rescue pbGetSpeciesConst(poke) method = form[0]
evoname = getConstantName(PBEvolution,evonib) rescue pbGetEvolutionConst(evonib) parameter = form[1]
next if !cpoke || cpoke=="" new_species = form[2]
pokedata.write(sprintf("%s,%s,",cpoke,evoname)) cnew_species = getConstantName(PBSpecies,new_species) rescue pbGetSpeciesConst(new_species)
case PBEvolution::EVOPARAM[evonib] evoname = getConstantName(PBEvolution,method) rescue pbGetEvolutionConst(method)
when 1 next if !cnew_species || cnew_species==""
pokedata.write("#{level}") pokedata.write(sprintf("%s,%s,",cnew_species,evoname))
when 2 param_type = PBEvolution.getFunction(method, "parameterType")
clevel = getConstantName(PBItems,level) rescue pbGetItemConst(level) if param_type
pokedata.write("#{clevel}") cparameter = getConstantName(param_type,parameter) rescue ""
when 3 pokedata.write("#{cparameter}")
clevel = getConstantName(PBMoves,level) rescue pbGetMoveConst(level) else
pokedata.write("#{clevel}") pokedata.write("#{parameter}")
when 4
clevel = getConstantName(PBSpecies,level) rescue pbGetSpeciesConst(level)
pokedata.write("#{clevel}")
when 5
clevel = getConstantName(PBTypes,level) rescue pbGetTypeConst(level)
pokedata.write("#{clevel}")
when 6
clevel = getConstantName(PBAbilities,level) rescue pbGetAbilityConst(level)
pokedata.write("#{clevel}")
end end
pokedata.write(",") if k<evos.length-1 pokedata.write(",") if k<evos.length-1
end end

View File

@@ -1184,7 +1184,6 @@ end
class EvolutionsProperty class EvolutionsProperty
def initialize(methods) def initialize(methods)
@methods = methods @methods = methods
@evoparams = PBEvolution::EVOPARAM
end end
def set(_settingname,oldsetting) def set(_settingname,oldsetting)
@@ -1207,14 +1206,11 @@ class EvolutionsProperty
commands.push(_INTL("[ADD EVOLUTION]")) commands.push(_INTL("[ADD EVOLUTION]"))
else else
level = realcmds[i][1] level = realcmds[i][1]
case @evoparams[realcmds[i][0]] param_type = PBEvolution.getFunction(realcmds[i][0], "parameterType")
when 0; level = "" if param_type
when 2; level = sprintf("#{PBItems.getName(level)}") level = (Object.const_get(param_type).getName(level) rescue getConstantName(param_type, level) rescue level)
when 3; level = sprintf("#{PBMoves.getName(level)}")
when 4; level = sprintf("#{PBSpecies.getName(level)}")
when 5; level = sprintf("#{PBTypes.getName(level)}")
when 6; level = sprintf("#{PBAbilities.getName(level)}")
end end
level = "" if !level
commands.push(_INTL("{1}: {2}, {3}", commands.push(_INTL("{1}: {2}, {3}",
PBSpecies.getName(realcmds[i][2]),@methods[realcmds[i][0]],level.to_s)) PBSpecies.getName(realcmds[i][2]),@methods[realcmds[i][0]],level.to_s))
end end
@@ -1242,30 +1238,29 @@ class EvolutionsProperty
if newspecies>0 if newspecies>0
newmethod = pbMessage(_INTL("Choose an evolution method."),@methods,-1) newmethod = pbMessage(_INTL("Choose an evolution method."),@methods,-1)
if newmethod>0 if newmethod>0
newparam = 0 newparam = -1
if @evoparams[newmethod]==2 # Items allow_zero = false
param_type = PBEvolution.getFunction(newmethod, "parameterType")
case param_type
when :PBItems
newparam = pbChooseItemList newparam = pbChooseItemList
elsif @evoparams[newmethod]==3 # Moves when :PBMoves
newparam = pbChooseMoveList newparam = pbChooseMoveList
elsif @evoparams[newmethod]==4 # Species when :PBSpecies
newparam = pbChooseSpeciesList newparam = pbChooseSpeciesList
elsif @evoparams[newmethod]==5 # Types when :PBTypes
allow_zero = true
newparam = pbChooseTypeList newparam = pbChooseTypeList
elsif @evoparams[newmethod]==6 # Abilities when :PBAbilities
newparam = pbChooseAbilityList newparam = pbChooseAbilityList
elsif @evoparams[newmethod]!=0 else
allow_zero = true
params = ChooseNumberParams.new params = ChooseNumberParams.new
params.setRange(0,65535) params.setRange(0,65535)
params.setDefaultValue(-1) params.setCancelValue(-1)
newparam = pbMessageChooseNumber(_INTL("Choose a parameter."),params) newparam = pbMessageChooseNumber(_INTL("Choose a parameter."),params)
end end
if @evoparams[newmethod]==0 || if newparam && (newparam>0 || (allow_zero && newparam == 0))
(@evoparams[newmethod]==1 && newparam && newparam>=0) ||
(@evoparams[newmethod]==2 && newparam && newparam>0) ||
(@evoparams[newmethod]==3 && newparam && newparam>0) ||
(@evoparams[newmethod]==4 && newparam && newparam>0) ||
(@evoparams[newmethod]==5 && newparam && newparam>=0) ||
(@evoparams[newmethod]==6 && newparam && newparam>0)
havemove = -1 havemove = -1
for i in 0...realcmds.length for i in 0...realcmds.length
havemove = realcmds[i][3] if realcmds[i][0]==newmethod && havemove = realcmds[i][3] if realcmds[i][0]==newmethod &&
@@ -1320,41 +1315,38 @@ class EvolutionsProperty
realcmds[cmd[1]] = nil realcmds[cmd[1]] = nil
realcmds.compact! realcmds.compact!
oldsel = havemove oldsel = havemove
else elsif newmethod != entry[0]
entry[0] = newmethod entry[0] = newmethod
entry[1] = 0 if @evoparams[entry[0]]==0 entry[1] = 0
oldsel = entry[3] oldsel = entry[3]
end end
refreshlist = true refreshlist = true
end end
elsif cmd2==2 # Change parameter elsif cmd2==2 # Change parameter
if @evoparams[entry[0]]==0
pbMessage(_INTL("This evolution method doesn't use a parameter."))
else
newparam = -1 newparam = -1
if @evoparams[entry[0]]==2 # Items allow_zero = false
param_type = PBEvolution.getFunction(entry[0], "parameterType")
case param_type
when :PBItems
newparam = pbChooseItemList(entry[1]) newparam = pbChooseItemList(entry[1])
elsif @evoparams[entry[0]]==3 # Moves when :PBMoves
newparam = pbChooseMoveList(entry[1]) newparam = pbChooseMoveList(entry[1])
elsif @evoparams[entry[0]]==4 # Species when :PBSpecies
newparam = pbChooseSpeciesList(entry[1]) newparam = pbChooseSpeciesList(entry[1])
elsif @evoparams[entry[0]]==5 # Types when :PBTypes
allow_zero = true
newparam = pbChooseTypeList(entry[1]) newparam = pbChooseTypeList(entry[1])
elsif @evoparams[entry[0]]==6 # Abilities when :PBAbilities
newparam = pbChooseAbilityList(entry[1]) newparam = pbChooseAbilityList(entry[1])
else else
allow_zero = true
params = ChooseNumberParams.new params = ChooseNumberParams.new
params.setRange(0,65535) params.setRange(0,65535)
params.setDefaultValue(entry[1]) params.setDefaultValue(entry[1])
params.setCancelValue(-1) params.setCancelValue(-1)
newparam = pbMessageChooseNumber(_INTL("Choose a parameter."),params) newparam = pbMessageChooseNumber(_INTL("Choose a parameter."),params)
end end
if (@evoparams[entry[0]]==1 && newparam && newparam>=0) || if newparam && (newparam>0 || (allow_zero && newparam == 0))
(@evoparams[entry[0]]==2 && newparam && newparam>0) ||
(@evoparams[entry[0]]==3 && newparam && newparam>0) ||
(@evoparams[entry[0]]==4 && newparam && newparam>0) ||
(@evoparams[entry[0]]==5 && newparam && newparam>=0) ||
(@evoparams[entry[0]]==6 && newparam && newparam>0)
havemove = -1 havemove = -1
for i in 0...realcmds.length for i in 0...realcmds.length
havemove = realcmds[i][3] if realcmds[i][0]==entry[0] && havemove = realcmds[i][3] if realcmds[i][0]==entry[0] &&
@@ -1371,7 +1363,6 @@ class EvolutionsProperty
end end
refreshlist = true refreshlist = true
end end
end
elsif cmd2==3 # Delete elsif cmd2==3 # Delete
realcmds[cmd[1]] = nil realcmds[cmd[1]] = nil
realcmds.compact! realcmds.compact!
@@ -1409,14 +1400,11 @@ class EvolutionsProperty
for i in 0...value.length for i in 0...value.length
ret << "," if i>0 ret << "," if i>0
param = value[i][1] param = value[i][1]
case @evoparams[value[i][0]] param_type = PBEvolution.getFunction(value[i][0], "parameterType")
when 0; param = "" if param_type
when 2; param = sprintf("#{PBItems.getName(param)}") param = (Object.const_get(param_type).getName(param) rescue getConstantName(param_type, param) rescue param)
when 3; param = sprintf("#{PBMoves.getName(param)}")
when 4; param = sprintf("#{PBSpecies.getName(param)}")
when 5; param = sprintf("#{PBTypes.getName(param)}")
when 6; param = sprintf("#{PBAbilities.getName(param)}")
end end
param = "" if !param
ret << sprintf("#{PBSpecies.getName(value[i][2])},#{@methods[value[i][0]]},#{param}") ret << sprintf("#{PBSpecies.getName(value[i][2])},#{@methods[value[i][0]]},#{param}")
end end
return ret return ret

View File

@@ -232,6 +232,17 @@ def pbGetGenderConst(i)
return ret return ret
end end
def pbGetHabitatConst(i)
ret = MakeshiftConsts.get(53,i,PBHabitats)
if !ret
ret = ["","Grassland","Forest","WatersEdge","Sea","Cave","Mountain",
"RoughTerrain","Urban","Rare"]
i = 0 if i>=ret.length || i<0
ret = ret[i]
end
return ret
end
def pbGetAbilityConst(i) def pbGetAbilityConst(i)
return MakeshiftConsts.get(MessageTypes::Abilities,i,PBAbilities) return MakeshiftConsts.get(MessageTypes::Abilities,i,PBAbilities)
end end
@@ -267,11 +278,11 @@ def pbChooseSpeciesList(default=0)
cname = getConstantName(PBSpecies,i) rescue nil cname = getConstantName(PBSpecies,i) rescue nil
commands.push([i,PBSpecies.getName(i)]) if cname commands.push([i,PBSpecies.getName(i)]) if cname
end end
return pbChooseList(commands,default,-1) return pbChooseList(commands,default,0,-1)
end end
# Displays an alphabetically sorted list of all moves, and returns the ID of the # Displays an alphabetically sorted list of all moves, and returns the ID of the
# move selected (or 0 if the selection was canceled). "default", if specified, # move selected (or -1 if the selection was canceled). "default", if specified,
# is the ID of the move to initially select. # is the ID of the move to initially select.
def pbChooseMoveList(default=0) def pbChooseMoveList(default=0)
commands = [] commands = []
@@ -279,7 +290,7 @@ def pbChooseMoveList(default=0)
cname = getConstantName(PBMoves,i) rescue nil cname = getConstantName(PBMoves,i) rescue nil
commands.push([i,PBMoves.getName(i)]) if cname commands.push([i,PBMoves.getName(i)]) if cname
end end
return pbChooseList(commands,default) return pbChooseList(commands,default,0)
end end
def pbChooseMoveListForSpecies(species,defaultMoveID=0) def pbChooseMoveListForSpecies(species,defaultMoveID=0)
@@ -319,9 +330,9 @@ def pbChooseMoveListForSpecies(species,defaultMoveID=0)
end end
# Displays an alphabetically sorted list of all types, and returns the ID of the # Displays an alphabetically sorted list of all types, and returns the ID of the
# type selected (or 0 if the selection was canceled). "default", if specified, # type selected (or -1 if the selection was canceled). "default", if specified,
# is the ID of the type to initially select. # is the ID of the type to initially select.
def pbChooseTypeList(default=0) def pbChooseTypeList(default=-1)
commands = [] commands = []
for i in 0..PBTypes.maxValue for i in 0..PBTypes.maxValue
cname = getConstantName(PBTypes,i) rescue nil cname = getConstantName(PBTypes,i) rescue nil
@@ -330,9 +341,9 @@ def pbChooseTypeList(default=0)
return pbChooseList(commands,default) return pbChooseList(commands,default)
end end
# Displays a list of all items, and returns the ID of the item selected (or 0 if # Displays a list of all items, and returns the ID of the item selected (or -1
# the selection was canceled). "default", if specified, is the ID of the item to # if the selection was canceled). "default", if specified, is the ID of the item
# initially select. Pressing Input::A will toggle the list sorting between # to initially select. Pressing Input::A will toggle the list sorting between
# numerical and alphabetical. # numerical and alphabetical.
def pbChooseItemList(default=0) def pbChooseItemList(default=0)
commands = [] commands = []
@@ -340,11 +351,11 @@ def pbChooseItemList(default=0)
cname = getConstantName(PBItems,i) rescue nil cname = getConstantName(PBItems,i) rescue nil
commands.push([i,PBItems.getName(i)]) if cname commands.push([i,PBItems.getName(i)]) if cname
end end
return pbChooseList(commands,default,-1) return pbChooseList(commands,default,0,-1)
end end
# Displays a list of all abilities, and returns the ID of the ability selected # Displays a list of all abilities, and returns the ID of the ability selected
# (or 0 if the selection was canceled). "default", if specified, is the ID of # (or -1 if the selection was canceled). "default", if specified, is the ID of
# the ability to initially select. Pressing Input::A will toggle the list # the ability to initially select. Pressing Input::A will toggle the list
# sorting between numerical and alphabetical. # sorting between numerical and alphabetical.
def pbChooseAbilityList(default=0) def pbChooseAbilityList(default=0)
@@ -353,7 +364,7 @@ def pbChooseAbilityList(default=0)
cname = getConstantName(PBAbilities,i) rescue nil cname = getConstantName(PBAbilities,i) rescue nil
commands.push([i,PBAbilities.getName(i)]) if cname commands.push([i,PBAbilities.getName(i)]) if cname
end end
return pbChooseList(commands,default,-1) return pbChooseList(commands,default,0,-1)
end end
def pbChooseBallList(defaultMoveID=-1) def pbChooseBallList(defaultMoveID=-1)
@@ -475,7 +486,7 @@ def pbCommands3(cmdwindow,commands,cmdIfCancel,defaultindex=-1,noresize=false)
return ret return ret
end end
def pbChooseList(commands,default=0,sortType=1) def pbChooseList(commands,default=0,cancelValue=-1,sortType=1)
cmdwin = pbListWindow([]) cmdwin = pbListWindow([])
itemID = default itemID = default
itemIndex = 0 itemIndex = 0
@@ -493,7 +504,7 @@ def pbChooseList(commands,default=0,sortType=1)
end end
realcommands = [] realcommands = []
for command in commands for command in commands
if sortType<0 || sortType==0 if sortType<=0
realcommands.push(sprintf("%03d: %s",command[0],command[1])) realcommands.push(sprintf("%03d: %s",command[0],command[1]))
else else
realcommands.push(command[1]) realcommands.push(command[1])
@@ -503,7 +514,7 @@ def pbChooseList(commands,default=0,sortType=1)
end end
cmd = pbCommandsSortable(cmdwin,realcommands,-1,itemIndex,(sortType<0)) cmd = pbCommandsSortable(cmdwin,realcommands,-1,itemIndex,(sortType<0))
if cmd[0]==0 # Chose an option or cancelled if cmd[0]==0 # Chose an option or cancelled
itemID = (cmd[1]<0) ? 0 : commands[cmd[1]][0] itemID = (cmd[1]<0) ? cancelValue : commands[cmd[1]][0]
break break
elsif cmd[0]==1 # Toggle sorting elsif cmd[0]==1 # Toggle sorting
itemID = commands[cmd[1]][0] itemID = commands[cmd[1]][0]
@@ -512,7 +523,7 @@ def pbChooseList(commands,default=0,sortType=1)
end end
end end
cmdwin.dispose cmdwin.dispose
return (itemID>0) ? itemID : 0 return itemID
end end
def pbCommandsSortable(cmdwindow,commands,cmdIfCancel,defaultindex=-1,sortable=false) def pbCommandsSortable(cmdwindow,commands,cmdIfCancel,defaultindex=-1,sortable=false)

View File

@@ -852,14 +852,11 @@ def pbCompilePokemonData
evolutions[e].each_with_index do |evo,i| evolutions[e].each_with_index do |evo,i|
FileLineData.setSection(i,"Evolutions","") FileLineData.setSection(i,"Evolutions","")
evo[0] = csvEnumField!(evo[0],PBSpecies,"Evolutions",i) # Species evo[0] = csvEnumField!(evo[0],PBSpecies,"Evolutions",i) # Species
case PBEvolution::EVOPARAM[evo[1]] # Evolution method param_type = PBEvolution.getFunction(evo[1], "parameterType")
when 1; evo[2] = csvPosInt!(evo[2]) if param_type
when 2; evo[2] = csvEnumField!(evo[2],PBItems,"Evolutions",i) evo[2] = csvEnumField!(evo[2], param_type, "Evolutions", i)
when 3; evo[2] = csvEnumField!(evo[2],PBMoves,"Evolutions",i) else
when 4; evo[2] = csvEnumField!(evo[2],PBSpecies,"Evolutions",i) evo[2] = csvInt!(evo[2]) if evo[2] && evo[2] != ""
when 5; evo[2] = csvEnumField!(evo[2],PBTypes,"Evolutions",i)
when 6; evo[2] = csvEnumField!(evo[2],PBAbilities,"Evolutions",i)
else; evo[2] = 0
end end
end end
end end
@@ -1065,14 +1062,11 @@ def pbCompilePokemonForms
evolutions[e].each_with_index do |evo,i| evolutions[e].each_with_index do |evo,i|
FileLineData.setSection(i,"Evolutions","") FileLineData.setSection(i,"Evolutions","")
evo[0] = csvEnumField!(evo[0],PBSpecies,"Evolutions",i) # Species evo[0] = csvEnumField!(evo[0],PBSpecies,"Evolutions",i) # Species
case PBEvolution::EVOPARAM[evo[1]] # Evolution method param_type = PBEvolution.getFunction(evo[1], "parameterType")
when 1; evo[2] = csvPosInt!(evo[2]) if param_type
when 2; evo[2] = csvEnumField!(evo[2],PBItems,"Evolutions",i) evo[2] = csvEnumField!(evo[2], param_type, "Evolutions", i)
when 3; evo[2] = csvEnumField!(evo[2],PBMoves,"Evolutions",i) else
when 4; evo[2] = csvEnumField!(evo[2],PBSpecies,"Evolutions",i) evo[2] = csvPosInt!(evo[2]) if evo[2] && evo[2] != ""
when 5; evo[2] = csvEnumField!(evo[2],PBTypes,"Evolutions",i)
when 6; evo[2] = csvEnumField!(evo[2],PBAbilities,"Evolutions",i)
else; evo[2] = 0
end end
end end
end end