diff --git a/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb b/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb index e019c8681..916fb4afd 100644 --- a/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb +++ b/Data/Scripts/010_Data/002_PBS data/009_Species_Files.rb @@ -302,14 +302,14 @@ end # @deprecated This alias is slated to be removed in v20. def pbPlayCrySpecies(species, form = 0, volume = 90, pitch = nil) - Deprecation.warn_method('pbPlayCrySpecies', 'v20', 'GameData::Species.play_cry_from_species(species, form)') - GameData::Species.play_cry_from_species(species, form, volume, pitch) + Deprecation.warn_method('pbPlayCrySpecies', 'v20', 'Pokemon.play_cry(species, form)') + Pokemon.play_cry(species, form, volume, pitch) end # @deprecated This alias is slated to be removed in v20. def pbPlayCryPokemon(pkmn, volume = 90, pitch = nil) - Deprecation.warn_method('pbPlayCryPokemon', 'v20', 'GameData::Species.play_cry_from_pokemon(pkmn)') - GameData::Species.play_cry_from_pokemon(pkmn, volume, pitch) + Deprecation.warn_method('pbPlayCryPokemon', 'v20', 'pkmn.play_cry') + pkmn.play_cry(volume, pitch) end # @deprecated This alias is slated to be removed in v20. diff --git a/Data/Scripts/011_Battle/005_Battle scene/004_PokeBattle_SceneElements.rb b/Data/Scripts/011_Battle/005_Battle scene/004_PokeBattle_SceneElements.rb index e7b68de1e..60ab999f7 100644 --- a/Data/Scripts/011_Battle/005_Battle scene/004_PokeBattle_SceneElements.rb +++ b/Data/Scripts/011_Battle/005_Battle scene/004_PokeBattle_SceneElements.rb @@ -559,8 +559,7 @@ class PokemonBattlerSprite < RPG::Sprite # recommendation is to create a PictureEx animation and push it into # the @battleAnimations array. def pbPlayIntroAnimation(pictureEx=nil) - return if !@pkmn - GameData::Species.play_cry_from_pokemon(@pkmn) + @pkmn.play_cry if @pkmn end QUARTER_ANIM_PERIOD = Graphics.frame_rate*3/20 diff --git a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb index 114070572..4efca12ef 100644 --- a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb +++ b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb @@ -119,7 +119,7 @@ def pbHiddenMoveAnimation(pokemon) sprite.visible=true if ptinterp.done? phase=3 - GameData::Species.play_cry_from_pokemon(pokemon) + pokemon.play_cry frames=0 end when 3 # Wait diff --git a/Data/Scripts/014_Pokemon/001_Pokemon.rb b/Data/Scripts/014_Pokemon/001_Pokemon.rb index d2623716b..07d92983c 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon.rb @@ -92,6 +92,14 @@ class Pokemon # Maximum number of moves a Pokémon can know at once MAX_MOVES = 4 + def self.play_cry(species, form = 0, volume = 90, pitch = 100) + GameData::Species.play_cry_from_species(species, form, volume, pitch) + end + + def play_cry(volume = 90, pitch = nil) + GameData::Species.play_cry_from_pokemon(self, volume, pitch) + end + def inspect str = super.chop str << format(' %s Lv.%s>', @species, @level.to_s || '???') diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb b/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb index 19526fdc4..7ec6833c5 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb @@ -70,7 +70,7 @@ class IntroEventScene < EventScene # Play random cry species_keys = GameData::Species::DATA.keys species_data = GameData::Species.get(species_keys[rand(species_keys.length)]) - GameData::Species.play_cry_from_species(species_data.species, species_data.form) + Pokemon.play_cry(species_data.species, species_data.form) @pic.moveXY(0, 20, 0, 0) # Adds 20 ticks (1 second) pause pictureWait # Fade out diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb index 88e82aad0..3a9cac03e 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb @@ -97,7 +97,7 @@ class PokemonEggHatch_Scene @sprites["overlay"].opacity=0 # Finish scene frames = GameData::Species.cry_length(@pokemon) - GameData::Species.play_cry_from_pokemon(@pokemon) + @pokemon.play_cry updateScene(frames) pbBGMStop() pbMEPlay("Evolution success") diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb index 89bba3804..7153f6b1f 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb @@ -532,7 +532,7 @@ class PokemonEvolutionScene metaplayer1.play metaplayer2.play pbBGMStop - GameData::Species.play_cry_from_pokemon(@pokemon) + @pokemon.play_cry pbMessageDisplay(@sprites["msgwindow"], _INTL("\\se[]What? {1} is evolving!\\^",@pokemon.name)) { pbUpdate } pbMessageWaitForInput(@sprites["msgwindow"],50,true) { pbUpdate } @@ -569,7 +569,7 @@ class PokemonEvolutionScene # Play cry of evolved species frames = GameData::Species.cry_length(@newspecies, @pokemon.form) pbBGMStop - GameData::Species.play_cry_from_species(@newspecies, @pokemon.form) + Pokemon.play_cry(@newspecies, @pokemon.form) frames.times do Graphics.update pbUpdate diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb index 71c359455..81909cdb1 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb @@ -184,7 +184,7 @@ class PokemonTrade_Scene def pbTrade pbBGMStop - GameData::Species.play_cry_from_pokemon(@pokemon) + @pokemon.play_cry speciesname1=GameData::Species.get(@pokemon.species).name speciesname2=GameData::Species.get(@pokemon2.species).name pbMessageDisplay(@sprites["msgwindow"], diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb index e35ac9fa8..57e759a4d 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb @@ -377,7 +377,7 @@ class HallOfFame_Scene if @battlerIndex<=@hallEntry.size # If it is a pokémon, write the pokémon text, wait the # ENTRYWAITTIME and goes to the next battler - GameData::Species.play_cry_from_pokemon(@hallEntry[@battlerIndex - 1]) + @hallEntry[@battlerIndex - 1].play_cry writePokemonData(@hallEntry[@battlerIndex-1]) (ENTRYWAITTIME*Graphics.frame_rate/20).times do Graphics.update @@ -432,7 +432,7 @@ class HallOfFame_Scene createBattlers(false) end # Change the pokemon - GameData::Species.play_cry_from_pokemon(@hallEntry[@battlerIndex]) + @hallEntry[@battlerIndex].play_cry setPokemonSpritesOpacity(@battlerIndex,OPACITY) hallNumber=$PokemonGlobal.hallOfFameLastNumber + @hallIndex - $PokemonGlobal.hallOfFame.size + 1 diff --git a/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb index 93f8b0a06..7c93ddc38 100644 --- a/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb +++ b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb @@ -442,7 +442,7 @@ class PokemonPokedexInfo_Scene end def pbScene - GameData::Species.play_cry_from_species(@species, @form) + Pokemon.play_cry(@species, @form) loop do Graphics.update Input.update @@ -450,7 +450,7 @@ class PokemonPokedexInfo_Scene dorefresh = false if Input.trigger?(Input::ACTION) pbSEStop - GameData::Species.play_cry_from_species(@species, @form) if @page == 1 + Pokemon.play_cry(@species, @form) if @page == 1 elsif Input.trigger?(Input::BACK) pbPlayCloseMenuSE break @@ -471,7 +471,7 @@ class PokemonPokedexInfo_Scene pbUpdateDummyPokemon @available = pbGetAvailableForms pbSEStop - (@page==1) ? GameData::Species.play_cry_from_species(@species, @form) : pbPlayCursorSE + (@page==1) ? Pokemon.play_cry(@species, @form) : pbPlayCursorSE dorefresh = true end elsif Input.trigger?(Input::DOWN) @@ -481,7 +481,7 @@ class PokemonPokedexInfo_Scene pbUpdateDummyPokemon @available = pbGetAvailableForms pbSEStop - (@page==1) ? GameData::Species.play_cry_from_species(@species, @form) : pbPlayCursorSE + (@page==1) ? Pokemon.play_cry(@species, @form) : pbPlayCursorSE dorefresh = true end elsif Input.trigger?(Input::LEFT) @@ -511,14 +511,14 @@ class PokemonPokedexInfo_Scene end def pbSceneBrief - GameData::Species.play_cry_from_species(@species, @form) + Pokemon.play_cry(@species, @form) loop do Graphics.update Input.update pbUpdate if Input.trigger?(Input::ACTION) pbSEStop - GameData::Species.play_cry_from_species(@species, @form) + Pokemon.play_cry(@species, @form) elsif Input.trigger?(Input::BACK) pbPlayCloseMenuSE break diff --git a/Data/Scripts/016_UI/006_UI_Summary.rb b/Data/Scripts/016_UI/006_UI_Summary.rb index 9090142e9..38d8f218c 100644 --- a/Data/Scripts/016_UI/006_UI_Summary.rb +++ b/Data/Scripts/016_UI/006_UI_Summary.rb @@ -913,7 +913,7 @@ class PokemonSummary_Scene @sprites["pokemon"].setPokemonBitmap(@pokemon) @sprites["itemicon"].item = @pokemon.item_id pbSEStop - GameData::Species.play_cry_from_pokemon(@pokemon) + @pokemon.play_cry end def pbMoveSelection @@ -1250,7 +1250,7 @@ class PokemonSummary_Scene end def pbScene - GameData::Species.play_cry_from_pokemon(@pokemon) + @pokemon.play_cry loop do Graphics.update Input.update @@ -1258,7 +1258,7 @@ class PokemonSummary_Scene dorefresh = false if Input.trigger?(Input::ACTION) pbSEStop - GameData::Species.play_cry_from_pokemon(@pokemon) + @pokemon.play_cry elsif Input.trigger?(Input::BACK) pbPlayCloseMenuSE break