From 6bf749d3f3c656b24c3367c3872b7b37932eff61 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sun, 7 Feb 2021 15:06:21 +0000 Subject: [PATCH] Removed support for ID numbers in species/item/trainer graphics filenames --- .../Scripts/011_Data/001_PBS data/003_Item.rb | 8 ---- .../011_Data/001_PBS data/008_Trainer type.rb | 4 -- .../001_PBS data/011_Species files.rb | 40 +++---------------- .../Scripts/013_Overworld/002_PField_Field.rb | 7 ++-- .../013_Overworld/003_PField_Visuals.rb | 8 ---- .../013_Overworld/007_PField_Encounters.rb | 4 +- .../013_Overworld/012_PField_BerryPlants.rb | 3 -- Data/Scripts/017_UI/006_PScreen_Summary.rb | 2 +- .../Scripts/017_UI/020_PScreen_EggHatching.rb | 5 +-- Data/Scripts/017_UI/027_PScreen_HallOfFame.rb | 6 ++- Data/Scripts/021_Debug/004_Editor_Screens.rb | 6 +-- 11 files changed, 21 insertions(+), 72 deletions(-) diff --git a/Data/Scripts/011_Data/001_PBS data/003_Item.rb b/Data/Scripts/011_Data/001_PBS data/003_Item.rb index 1d5fd90c7..e057ced9e 100644 --- a/Data/Scripts/011_Data/001_PBS data/003_Item.rb +++ b/Data/Scripts/011_Data/001_PBS data/003_Item.rb @@ -25,16 +25,12 @@ module GameData # Check for files ret = sprintf("Graphics/Items/%s", item_data.id) return ret if pbResolveBitmap(ret) - ret = sprintf("Graphics/Items/%03d", item_data.id_number) - return ret if pbResolveBitmap(ret) # Check for TM/HM type icons if item_data.is_machine? move_type = GameData::Move.get(item_data.move).type type_data = GameData::Type.get(move_type) ret = sprintf("Graphics/Items/machine_%s", type_data.id) return ret if pbResolveBitmap(ret) - ret = sprintf("Graphics/Items/machine_%03d", type_data.id_number) - return ret if pbResolveBitmap(ret) end return "Graphics/Items/000" end @@ -46,8 +42,6 @@ module GameData # Check for files ret = sprintf("Graphics/Pictures/Party/icon_%s_%s", name_base, item_data.id) return ret if pbResolveBitmap(ret) - ret = sprintf("Graphics/Pictures/Party/icon_%s_%03d", name_base, item_data.id_number) - return ret if pbResolveBitmap(ret) return sprintf("Graphics/Pictures/Party/icon_%s", name_base) end @@ -56,8 +50,6 @@ module GameData return nil if !item_data # Check for files ret = sprintf("Graphics/Pictures/Mail/mail_%s", item_data.id) - return ret if pbResolveBitmap(ret) - ret = sprintf("Graphics/Pictures/Mail/mail_%03d", item_data.id_number) return pbResolveBitmap(ret) ? ret : nil end diff --git a/Data/Scripts/011_Data/001_PBS data/008_Trainer type.rb b/Data/Scripts/011_Data/001_PBS data/008_Trainer type.rb index 3a825d07c..a0cab59d9 100644 --- a/Data/Scripts/011_Data/001_PBS data/008_Trainer type.rb +++ b/Data/Scripts/011_Data/001_PBS data/008_Trainer type.rb @@ -24,12 +24,8 @@ module GameData if !optional_suffix.empty? ret = path + tr_type_data.id.to_s + optional_suffix + suffix return ret if pbResolveBitmap(ret) - ret = path + sprintf("%03d", tr_type_data.id_number) + optional_suffix + suffix - return ret if pbResolveBitmap(ret) end ret = path + tr_type_data.id.to_s + suffix - return ret if pbResolveBitmap(ret) - ret = path + sprintf("%03d", tr_type_data.id_number) + suffix return (pbResolveBitmap(ret)) ? ret : nil end diff --git a/Data/Scripts/011_Data/001_PBS data/011_Species files.rb b/Data/Scripts/011_Data/001_PBS data/011_Species files.rb index ee2406c8e..8c65540b6 100644 --- a/Data/Scripts/011_Data/001_PBS data/011_Species files.rb +++ b/Data/Scripts/011_Data/001_PBS data/011_Species files.rb @@ -2,8 +2,6 @@ module GameData class Species def self.check_graphic_file(path, species, form = 0, gender = 0, shiny = false, shadow = false, subfolder = "") try_subfolder = sprintf("%s/", subfolder) -# species_data = self.get_species_form(species, form) -# species_id = sprintf("%03d", (species_data) ? self.get(species_data.species).id_number : 0) try_species = species try_form = (form > 0) ? sprintf("_%d", form) : "" try_gender = (gender == 1) ? "_female" : "" @@ -28,14 +26,10 @@ module GameData end end # Look for a graphic matching this combination's parameters -# for j in 0...2 # Try using the species' ID symbol and then its ID number -# next if !try_species || (try_species == "000" && j == 1) -# try_species_text = (j == 0) ? try_species : species_id - try_species_text = try_species - ret = pbResolveBitmap(sprintf("%s%s%s%s%s%s", path, try_subfolder, - try_species_text, try_form, try_gender, try_shadow)) - return ret if ret -# end + try_species_text = try_species + ret = pbResolveBitmap(sprintf("%s%s%s%s%s%s", path, try_subfolder, + try_species_text, try_form, try_gender, try_shadow)) + return ret if ret end return nil end @@ -43,17 +37,11 @@ module GameData def self.check_egg_graphic_file(path, species, form, suffix = "") species_data = self.get_species_form(species, form) return nil if species_data.nil? -# species_id = self.get(species_data.species).id_number if form > 0 ret = pbResolveBitmap(sprintf("%s%s_%d%s", path, species_data.species, form, suffix)) return ret if ret -# ret = pbResolveBitmap(sprintf("%s%03d_%d%s", path, species_id, form, suffix)) -# return ret if ret end - ret = pbResolveBitmap(sprintf("%s%s%s", path, species_data.species, suffix)) - return ret -# return ret if ret -# return pbResolveBitmap(sprintf("%s%03d%s", path, species_id, suffix)) + return pbResolveBitmap(sprintf("%s%s%s", path, species_data.species, suffix)) end def self.front_sprite_filename(species, form = 0, gender = 0, shiny = false, shadow = false) @@ -150,17 +138,11 @@ module GameData def self.footprint_filename(species, form = 0) species_data = self.get_species_form(species, form) return nil if species_data.nil? -# species_id = self.get(species_data.species).id_number if form > 0 ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Footprints/%s_%d", species_data.species, form)) return ret if ret -# ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Footprints/%03d_%d", species_id, form)) -# return ret if ret end - ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Footprints/%s", species_data.species)) - return ret -# return ret if ret -# return pbResolveBitmap(sprintf("Graphics/Pokemon/Footprints/%03d", species_id)) + return pbResolveBitmap(sprintf("Graphics/Pokemon/Footprints/%s", species_data.species)) end #=========================================================================== @@ -168,18 +150,13 @@ module GameData def self.shadow_filename(species, form = 0) species_data = self.get_species_form(species, form) return nil if species_data.nil? -# species_id = self.get(species_data.species).id_number # Look for species-specific shadow graphic if form > 0 ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Shadow/%s_%d", species_data.species, form)) return ret if ret -# ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Shadow/%03d_%d", species_id, form)) -# return ret if ret end ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Shadow/%s", species_data.species)) return ret if ret -# ret = pbResolveBitmap(sprintf("Graphics/Pokemon/Shadow/%03d", species_id)) -# return ret if ret # Use general shadow graphic return pbResolveBitmap(sprintf("Graphics/Pokemon/Shadow/%d", species_data.shadow_size)) end @@ -199,16 +176,11 @@ module GameData def self.check_cry_file(species, form) species_data = self.get_species_form(species, form) return nil if species_data.nil? -# species_id = self.get(species_data.species).id_number if form > 0 ret = sprintf("Cries/%s_%d", species_data.species, form) return ret if pbResolveAudioSE(ret) -# ret = sprintf("Cries/%03d_%d", species_id, form) -# return ret if pbResolveAudioSE(ret) end ret = sprintf("Cries/%s", species_data.species) -# return ret if pbResolveAudioSE(ret) -# ret = sprintf("Cries/%03d", species_id) return (pbResolveAudioSE(ret)) ? ret : nil end diff --git a/Data/Scripts/013_Overworld/002_PField_Field.rb b/Data/Scripts/013_Overworld/002_PField_Field.rb index 0400c7402..ed3a2e775 100644 --- a/Data/Scripts/013_Overworld/002_PField_Field.rb +++ b/Data/Scripts/013_Overworld/002_PField_Field.rb @@ -361,12 +361,13 @@ def pbOnStepTaken(eventTriggered) $PokemonGlobal.stepcount = 0 if !$PokemonGlobal.stepcount $PokemonGlobal.stepcount += 1 $PokemonGlobal.stepcount &= 0x7FFFFFFF + repel_active = ($PokemonGlobal.repel > 0) Events.onStepTaken.trigger(nil) # Events.onStepTakenFieldMovement.trigger(nil,$game_player) handled = [nil] Events.onStepTakenTransferPossible.trigger(nil,handled) return if handled[0] - pbBattleOnStepTaken if !eventTriggered && !$game_temp.in_menu + pbBattleOnStepTaken(repel_active) if !eventTriggered && !$game_temp.in_menu $PokemonTemp.encounterTriggered = false # This info isn't needed here end @@ -375,7 +376,7 @@ Events.onChangeDirection += proc { pbBattleOnStepTaken if !$game_temp.in_menu } -def pbBattleOnStepTaken +def pbBattleOnStepTaken(repel_active) return if $Trainer.able_pokemon_count == 0 return if !$PokemonEncounters.encounter_possible_here? encounterType = $PokemonEncounters.encounter_type @@ -384,7 +385,7 @@ def pbBattleOnStepTaken $PokemonTemp.encounterType = encounterType encounter = $PokemonEncounters.choose_wild_pokemon(encounterType) encounter = EncounterModifier.trigger(encounter) - if $PokemonEncounter.allow_encounter?(encounter) + if $PokemonEncounter.allow_encounter?(encounter, repel_active) if $PokemonEncounter.have_double_wild_battle? encounter2 = $PokemonEncounters.choose_wild_pokemon(encounterType) encounter2 = EncounterModifier.trigger(encounter2) diff --git a/Data/Scripts/013_Overworld/003_PField_Visuals.rb b/Data/Scripts/013_Overworld/003_PField_Visuals.rb index 90e9865d9..80a9ebc55 100644 --- a/Data/Scripts/013_Overworld/003_PField_Visuals.rb +++ b/Data/Scripts/013_Overworld/003_PField_Visuals.rb @@ -132,15 +132,11 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil) ##### Tweaked by Maruno ##### if (battletype==1 || battletype==3) && foe.length==1 # Against single trainer tr_type = foe[0].trainer_type - tr_type_id = GameData::TrainerType.get(tr_type).id_number if tr_type tbargraphic = sprintf("Graphics/Transitions/vsBar_%s", tr_type.to_s) rescue nil - tbargraphic = sprintf("Graphics/Transitions/vsBar_%d", tr_type_id) if !pbResolveBitmap(tbargraphic) tgraphic = sprintf("Graphics/Transitions/vsTrainer_%s", tr_type.to_s) rescue nil - tgraphic = sprintf("Graphics/Transitions/vsTrainer_%d", tr_type_id) if !pbResolveBitmap(tgraphic) if pbResolveBitmap(tbargraphic) && pbResolveBitmap(tgraphic) player_tr_type = $Trainer.trainer_type - player_tr_type_id = GameData::TrainerType.get(player_tr_type).id_number outfit = $Trainer.outfit # Set up viewplayer = Viewport.new(0,Graphics.height/3,Graphics.width/2,128) @@ -157,10 +153,8 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil) overlay.bitmap = Bitmap.new(Graphics.width,Graphics.height) pbSetSystemFont(overlay.bitmap) pbargraphic = sprintf("Graphics/Transitions/vsBar_%s_%d", player_tr_type.to_s, outfit) rescue nil - pbargraphic = sprintf("Graphics/Transitions/vsBar_%d_%d", player_tr_type_id, outfit) if !pbResolveBitmap(pbargraphic) if !pbResolveBitmap(pbargraphic) pbargraphic = sprintf("Graphics/Transitions/vsBar_%s", player_tr_type.to_s) rescue nil - pbargraphic = sprintf("Graphics/Transitions/vsBar_%d", player_tr_type_id) if !pbResolveBitmap(pbargraphic) end xoffset = ((Graphics.width/2)/10)*10 bar1 = Sprite.new(viewplayer) @@ -198,10 +192,8 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil) bar2 = AnimatedPlane.new(viewopp) bar2.bitmap = BitmapCache.load_bitmap(tbargraphic) pgraphic = sprintf("Graphics/Transitions/vsTrainer_%s_%d", player_tr_type.to_s, outfit) rescue nil - pgraphic = sprintf("Graphics/Transitions/vsTrainer_%d_%d", player_tr_type_id, outfit) if !pbResolveBitmap(pgraphic) if !pbResolveBitmap(pgraphic) pgraphic = sprintf("Graphics/Transitions/vsTrainer_%s", player_tr_type.to_s) rescue nil - pgraphic = sprintf("Graphics/Transitions/vsTrainer_%d", player_tr_type_id) if !pbResolveBitmap(pgraphic) end player = Sprite.new(viewplayer) player.bitmap = BitmapCache.load_bitmap(pgraphic) diff --git a/Data/Scripts/013_Overworld/007_PField_Encounters.rb b/Data/Scripts/013_Overworld/007_PField_Encounters.rb index 7d25944b1..2664b2e32 100644 --- a/Data/Scripts/013_Overworld/007_PField_Encounters.rb +++ b/Data/Scripts/013_Overworld/007_PField_Encounters.rb @@ -249,10 +249,10 @@ class PokemonEncounters # Returns whether an encounter with the given Pokémon should be allowed after # taking into account Repels and ability effects. - def allow_encounter?(enc_data, ignore_repel = false) + def allow_encounter?(enc_data, repel_active = false) return false if !enc_data # Repel - if !ignore_repel && $PokemonGlobal.repel > 0 && !pbPokeRadarOnShakingGrass + if repel_active && !pbPokeRadarOnShakingGrass first_pkmn = (Settings::REPEL_COUNTS_FAINTED_POKEMON) ? $Trainer.first_pokemon : $Trainer.first_able_pokemon return false if first_pkmn && enc_data[1] < first_pkmn.level end diff --git a/Data/Scripts/013_Overworld/012_PField_BerryPlants.rb b/Data/Scripts/013_Overworld/012_PField_BerryPlants.rb index fc32248f4..76d11be69 100644 --- a/Data/Scripts/013_Overworld/012_PField_BerryPlants.rb +++ b/Data/Scripts/013_Overworld/012_PField_BerryPlants.rb @@ -251,9 +251,6 @@ class BerryPlantSprite @event.turn_down else filename=sprintf("berrytree%s",GameData::Item.get(berryData[1]).id.to_s) - if !pbResolveBitmap("Graphics/Characters/"+filename) - filename=sprintf("berrytree%03d",GameData::Item.get(berryData[1]).id_number) - end if pbResolveBitmap("Graphics/Characters/"+filename) @event.character_name=filename case berryData[0] diff --git a/Data/Scripts/017_UI/006_PScreen_Summary.rb b/Data/Scripts/017_UI/006_PScreen_Summary.rb index f0d5f956b..a57e3ce0d 100644 --- a/Data/Scripts/017_UI/006_PScreen_Summary.rb +++ b/Data/Scripts/017_UI/006_PScreen_Summary.rb @@ -388,7 +388,7 @@ class PokemonSummary_Scene [_INTL("ID No."),238,208,0,base,shadow], ] # Write the Regional/National Dex number - dexnum = @pokemon.species + dexnum = GameData::Species.get(@pokemon.species).id_number dexnumshift = false if $PokemonGlobal.pokedexUnlocked[$PokemonGlobal.pokedexUnlocked.length-1] dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(-1) diff --git a/Data/Scripts/017_UI/020_PScreen_EggHatching.rb b/Data/Scripts/017_UI/020_PScreen_EggHatching.rb index e2ee8fb7e..47482e07b 100644 --- a/Data/Scripts/017_UI/020_PScreen_EggHatching.rb +++ b/Data/Scripts/017_UI/020_PScreen_EggHatching.rb @@ -29,10 +29,7 @@ class PokemonEggHatch_Scene false, false, true) # Egg sprite # Load egg cracks bitmap crackfilename = sprintf("Graphics/Pokemon/Eggs/%s_cracks", @pokemon.species) - if !pbResolveBitmap(crackfilename) - crackfilename = sprintf("Graphics/Pokemon/Eggs/%03d_cracks", @pokemon.species_data.id_number) - crackfilename = sprintf("Graphics/Pokemon/Eggs/000_cracks") if !pbResolveBitmap(crackfilename) - end + crackfilename = sprintf("Graphics/Pokemon/Eggs/000_cracks") if !pbResolveBitmap(crackfilename) crackfilename=pbResolveBitmap(crackfilename) @hatchSheet=AnimatedBitmap.new(crackfilename) # Create egg cracks sprite diff --git a/Data/Scripts/017_UI/027_PScreen_HallOfFame.rb b/Data/Scripts/017_UI/027_PScreen_HallOfFame.rb index f5ce25b89..d9744c116 100644 --- a/Data/Scripts/017_UI/027_PScreen_HallOfFame.rb +++ b/Data/Scripts/017_UI/027_PScreen_HallOfFame.rb @@ -303,7 +303,11 @@ class HallOfFame_Scene pokename+="/"+speciesname pokename=_INTL("Egg")+"/"+_INTL("Egg") if pokemon.egg? idno=(pokemon.owner.name.empty? || pokemon.egg?) ? "?????" : sprintf("%05d",pokemon.owner.public_id) - dexnumber=pokemon.egg? ? _INTL("No. ???") : _ISPRINTF("No. {1:03d}",pokemon.species) + dexnumber = _INTL("No. ???") + if !pokemon.egg? + species_data = GameData::Species.get(pokemon.species) + dexnumber = _ISPRINTF("No. {1:03d}",species_data.id_number) + end textPositions=[ [dexnumber,32,Graphics.height-80,0,BASECOLOR,SHADOWCOLOR], [pokename,Graphics.width-192,Graphics.height-80,2,BASECOLOR,SHADOWCOLOR], diff --git a/Data/Scripts/021_Debug/004_Editor_Screens.rb b/Data/Scripts/021_Debug/004_Editor_Screens.rb index aa8fa6bba..adbe87d0c 100644 --- a/Data/Scripts/021_Debug/004_Editor_Screens.rb +++ b/Data/Scripts/021_Debug/004_Editor_Screens.rb @@ -459,8 +459,7 @@ def pbTrainerTypeEditorNew(default_name) GameData::TrainerType.save pbConvertTrainerData pbMessage(_INTL("The trainer type {1} was created (ID: {2}).", name, id.to_s)) - pbMessage(_ISPRINTF("Put the Trainer's graphic (trainer{1:s}.png or trainer{2:03d}.png) in Graphics/Trainers, or it will be blank.", - id, id_number)) + pbMessage(_INTL("Put the Trainer's graphic ({1}.png) in Graphics/Trainers, or it will be blank.", id.to_s)) return id.to_sym end @@ -937,8 +936,7 @@ def pbItemEditorNew(default_name) GameData::Item.save Compiler.write_items pbMessage(_INTL("The item {1} was created (ID: {2}).", name, id.to_s)) - pbMessage(_ISPRINTF("Put the item's graphic (item{1:s}.png or item{2:03d}.png) in Graphics/Icons, or it will be blank.", - id, id_number)) + pbMessage(_INTL("Put the item's graphic ({1}.png) in Graphics/Items, or it will be blank.", id.to_s)) end