diff --git a/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb b/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb index 4cd5bdb99..f51189f8a 100644 --- a/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb +++ b/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb @@ -630,83 +630,42 @@ GameData::Evolution.register({ #=============================================================================== # Evolution methods that are triggered by an event +# Each event has its own number, which is the value of the parameter as defined +# in pokemon.txt/pokemon_forms.txt. It is also 'number' in def pbEvolutionEvent, +# which triggers evolution checks for a particular event number. 'value' in an +# event_proc is the number of the evolution event currently being triggered. +# Evolutions caused by different events should have different numbers. Used +# event numbers are: +# 1: Kubfu -> Urshifu +# 2: Galarian Yamask -> Runerigus #=============================================================================== -GameData::Evolution.register({ - :id => :Event, - :event_proc => proc { |pkmn, parameter, value| - next true - } -}) +def pbEvolutionEvent(number) + return if !$player + $player.able_pokemon_party.each do |pkmn| + pkmn.trigger_event_evolution(number) + end +end GameData::Evolution.register({ - :id => :EventValue, + :id => :Event, :parameter => Integer, :event_proc => proc { |pkmn, parameter, value| next value == parameter } }) -GameData::Evolution.register({ - :id => :EventLevel, - :parameter => Integer, - :event_proc => proc { |pkmn, parameter, value| - next pkmn.level >= parameter - } -}) - -GameData::Evolution.register({ - :id => :EventMale, - :event_proc => proc { |pkmn, parameter, value| - next pkmn.male? - } -}) - -GameData::Evolution.register({ - :id => :EventFemale, - :event_proc => proc { |pkmn, parameter, value| - next pkmn.female? - } -}) - -GameData::Evolution.register({ - :id => :EventDay, - :event_proc => proc { |pkmn, parameter, value| - next PBDayNight.isDay? - } -}) - -GameData::Evolution.register({ - :id => :EventNight, - :event_proc => proc { |pkmn, parameter, value| - next PBDayNight.isNight? - } -}) - -GameData::Evolution.register({ - :id => :EventItem, - :parameter => :Item, - :event_proc => proc { |pkmn, parameter, value| - next pkmn.item == parameter - }, - :after_evolution_proc => proc { |pkmn, new_species, parameter, evo_species| - next false if evo_species != new_species || !pkmn.hasItem?(parameter) - pkmn.item = nil # Item is now consumed - next true - } -}) - GameData::Evolution.register({ :id => :EventAfterDamageTaken, :parameter => Integer, :after_battle_proc => proc { |pkmn, party_index, parameter| if $game_temp.party_direct_damage_taken && $game_temp.party_direct_damage_taken[party_index] && - $game_temp.party_direct_damage_taken[party_index] >= parameter + $game_temp.party_direct_damage_taken[party_index] >= 49 pkmn.ready_to_evolve = true end next false }, :event_proc => proc { |pkmn, parameter, value| - next pkmn.ready_to_evolve + next value == parameter && pkmn.ready_to_evolve } }) diff --git a/Data/Scripts/014_Pokemon/001_Pokemon.rb b/Data/Scripts/014_Pokemon/001_Pokemon.rb index 4ee4ccc04..52dba4514 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon.rb @@ -1025,8 +1025,8 @@ class Pokemon return nil end - def trigger_event_evolution(value = 0) - new_species = check_evolution_by_event(value) + def trigger_event_evolution(number) + new_species = check_evolution_by_event(number) if new_species pbFadeOutInWithMusic { evo = PokemonEvolutionScene.new diff --git a/PBS/Gen 8/pokemon.txt b/PBS/Gen 8/pokemon.txt index 7f499f6ff..d0da366c6 100644 --- a/PBS/Gen 8/pokemon.txt +++ b/PBS/Gen 8/pokemon.txt @@ -23258,7 +23258,7 @@ Shape = BipedalTail Category = Wushu Pokedex = Kubfu trains hard to perfect its moves. The moves it masters will determine which form it takes when it evolves. Generation = 8 -Evolutions = URSHIFU,Event, +Evolutions = URSHIFU,Event,1 #------------------------------- [URSHIFU] Name = Urshifu diff --git a/PBS/Gen 8/pokemon_forms.txt b/PBS/Gen 8/pokemon_forms.txt index a511d783f..895438529 100644 --- a/PBS/Gen 8/pokemon_forms.txt +++ b/PBS/Gen 8/pokemon_forms.txt @@ -1438,7 +1438,7 @@ TutorMoves = ALLYSWITCH,ATTRACT,BRUTALSWING,CALMMIND,DARKPULSE,EARTHPOWER,EARTHQ Pokedex = A clay slab with cursed engravings took possession of a Yamask. The slab is said to be absorbing the Yamask's dark power. Generation = 8 Flags = InheritFormWithEverStone -Evolutions = RUNERIGUS,EventAfterDamageTaken,49 +Evolutions = RUNERIGUS,EventAfterDamageTaken,2 #------------------------------- [DEERLING,1] FormName = Summer Form diff --git a/PBS/pokemon.txt b/PBS/pokemon.txt index 7f499f6ff..d0da366c6 100644 --- a/PBS/pokemon.txt +++ b/PBS/pokemon.txt @@ -23258,7 +23258,7 @@ Shape = BipedalTail Category = Wushu Pokedex = Kubfu trains hard to perfect its moves. The moves it masters will determine which form it takes when it evolves. Generation = 8 -Evolutions = URSHIFU,Event, +Evolutions = URSHIFU,Event,1 #------------------------------- [URSHIFU] Name = Urshifu diff --git a/PBS/pokemon_forms.txt b/PBS/pokemon_forms.txt index a511d783f..895438529 100644 --- a/PBS/pokemon_forms.txt +++ b/PBS/pokemon_forms.txt @@ -1438,7 +1438,7 @@ TutorMoves = ALLYSWITCH,ATTRACT,BRUTALSWING,CALMMIND,DARKPULSE,EARTHPOWER,EARTHQ Pokedex = A clay slab with cursed engravings took possession of a Yamask. The slab is said to be absorbing the Yamask's dark power. Generation = 8 Flags = InheritFormWithEverStone -Evolutions = RUNERIGUS,EventAfterDamageTaken,49 +Evolutions = RUNERIGUS,EventAfterDamageTaken,2 #------------------------------- [DEERLING,1] FormName = Summer Form