mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 14:44:58 +00:00
Added Rare Candy being usable at level 100, added event evolutions
This commit is contained in:
@@ -961,6 +961,16 @@ class Pokemon
|
||||
}
|
||||
end
|
||||
|
||||
# Checks whether this Pokemon can evolve by a triggered event.
|
||||
# @param value [Integer] a value that may be used by the evolution method
|
||||
# @return [Symbol, nil] the ID of the species to evolve into
|
||||
def check_evolution_by_event(value = 0)
|
||||
return check_evolution_internal { |pkmn, new_species, method, parameter, value|
|
||||
success = GameData::Evolution.get(method).call_event(pkmn, parameter, value)
|
||||
next (success) ? new_species : nil
|
||||
}
|
||||
end
|
||||
|
||||
# Called after this Pokémon evolves, to remove its held item (if the evolution
|
||||
# required it to have a held item) or duplicate this Pokémon (Shedinja only).
|
||||
# @param new_species [Symbol] the species that this Pokémon evolved into
|
||||
@@ -986,6 +996,20 @@ class Pokemon
|
||||
return nil
|
||||
end
|
||||
|
||||
def trigger_event_evolution(value = 0)
|
||||
new_species = check_evolution_by_event(value)
|
||||
if new_species
|
||||
pbFadeOutInWithMusic {
|
||||
evo = PokemonEvolutionScene.new
|
||||
evo.pbStartScreen(self, new_species)
|
||||
evo.pbEvolution
|
||||
evo.pbEndScreen
|
||||
}
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
# Stat calculations
|
||||
#=============================================================================
|
||||
|
||||
Reference in New Issue
Block a user