diff --git a/Data/Map767.rxdata b/Data/Map767.rxdata index 5c5cac8d2..8023c54e1 100644 Binary files a/Data/Map767.rxdata and b/Data/Map767.rxdata differ diff --git a/Data/MapInfos.rxdata b/Data/MapInfos.rxdata index d6871a7c7..b7b6d86c1 100644 Binary files a/Data/MapInfos.rxdata and b/Data/MapInfos.rxdata differ diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 209607dd3..f200ade66 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -163,7 +163,7 @@ module Settings # e.g. To require the second badge, put false and 1. # To require at least 2 badges, put true and 2. BADGE_FOR_CUT = 1 - BADGE_FOR_FLASH = 2 + BADGE_FOR_FLASH = 1 BADGE_FOR_ROCKSMASH = 0 BADGE_FOR_SURF = 5 BADGE_FOR_FLY = 3 @@ -374,7 +374,7 @@ module Settings [265, 30, :KIRLIA,25,30], #Rt. 34 [267, 30, :SUDOWOODO,25,30], #Rt. 36 [300, 30, :ROSELIA,30,30], #National Park - [300, 30, :BRELOOM,30,30], #Ilex Forest + [266, 30, :BRELOOM,30,30], #Ilex Forest [670, 30, :WEAVILE,50,50], #Ice mountains [528, 30, :PYUKUMUKU,20,20], #Treasure Beach [690, 30, :OCTILLERY,32,45], #Deep Ocean diff --git a/Data/Scripts/007_Objects and windows/008_AnimatedBitmap.rb b/Data/Scripts/007_Objects and windows/008_AnimatedBitmap.rb index 2c5db123d..c5ea7eaf5 100644 --- a/Data/Scripts/007_Objects and windows/008_AnimatedBitmap.rb +++ b/Data/Scripts/007_Objects and windows/008_AnimatedBitmap.rb @@ -5,7 +5,6 @@ class AnimatedBitmap attr_reader :path attr_reader :filename - def initialize(file, hue = 0) raise "Filename is nil (missing graphic)." if file.nil? path = file @@ -15,8 +14,8 @@ class AnimatedBitmap filename = split_file.pop path = split_file.join('/') + '/' end - @filename= filename - @path= path + @filename = filename + @path = path if filename[/^\[\d+(?:,\d+)?\]/] # Starts with 1 or 2 numbers in square brackets @bitmap = PngAnimatedBitmap.new(path, filename, hue) else @@ -25,24 +24,27 @@ class AnimatedBitmap end def pbSetColor(r = 0, g = 0, b = 0, a = 255) + color = Color.new(r, g, b, a) + pbSetColorValue(color) + end + + def pbSetColorValue(color) for i in 0..@bitmap.bitmap.width for j in 0..@bitmap.bitmap.height if @bitmap.bitmap.get_pixel(i, j).alpha != 0 - color = Color.new(r, g, b, a) @bitmap.bitmap.set_pixel(i, j, color) end end end end - def shiftColors(offset=0) - - offset/=360 if offset >360 - offset=30 if offset <30 #this method is only used for shinies. shinies that barely shift are boring - + MAX_SHIFT_VALUE = 360 + MINIMUM_OFFSET=40 + def shiftColors(offset = 0) + offset /= MAX_SHIFT_VALUE if offset > NB_POKEMON + offset = MINIMUM_OFFSET if offset < MINIMUM_OFFSET || MAX_SHIFT_VALUE - offset < MINIMUM_OFFSET + offset += pbGet(VAR_SHINY_HUE_OFFSET) #for testing - always 0 during normal gameplay @bitmap = GifBitmap.new(@path, @filename, offset) - - #@bitmap.bitmap.hue_change(offset) end def [](index) @@ -104,7 +106,7 @@ class AnimatedBitmap destination_rect = Rect.new(0, 0, new_width, new_height) source_rect = Rect.new(0, 0, @bitmap.bitmap.width, @bitmap.bitmap.height) - new_bitmap = Bitmap.new(new_width,new_height) + new_bitmap = Bitmap.new(new_width, new_height) new_bitmap.stretch_blt( destination_rect, @bitmap.bitmap, @@ -125,14 +127,10 @@ class AnimatedBitmap # end # end - def mirror @bitmap.bitmap end - - - end #=============================================================================== @@ -258,11 +256,11 @@ class GifBitmap def initialize(dir, filename, hue = 0) @bitmap = nil @disposed = false - @loaded_from_cache=false + @loaded_from_cache = false filename = "" if !filename begin @bitmap = RPG::Cache.load_bitmap(dir, filename, hue) - @loaded_from_cache=true + @loaded_from_cache = true rescue @bitmap = nil end diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index c12f31b31..44259d354 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -1229,8 +1229,14 @@ def pbDrawImagePositions(bitmap,textpos) srcy=i[4] || 0 width=(i[5] && i[5]>=0) ? i[5] : srcbitmap.width height=(i[6] && i[6]>=0) ? i[6] : srcbitmap.height + color = i[7] || nil + if color + srcbitmap.pbSetColorValue(color) + end srcrect=Rect.new(srcx,srcy,width,height) bitmap.blt(x,y,srcbitmap.bitmap,srcrect) + + srcbitmap.dispose end end 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 1a325bd26..e336aa65c 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 @@ -235,7 +235,7 @@ class PokemonDataBox < SpriteWrapper # Draw shiny icon if @battler.shiny? shinyX = (@battler.opposes?(0)) ? 206 : -6 # Foe's/player's - imagePos.push(["Graphics/Pictures/shiny",@spriteBaseX+shinyX,36]) + addShinyStarsToGraphicsArray(imagePos,@spriteBaseX+shinyX,35, @battler.pokemon.bodyShiny?,@battler.pokemon.headShiny?,@battler.pokemon.debugShiny?) end # Draw Mega Evolution/Primal Reversion icon if @battler.mega? diff --git a/Data/Scripts/014_Pokemon/001_Pokemon.rb b/Data/Scripts/014_Pokemon/001_Pokemon.rb index 55314e1f5..acc522b32 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon.rb @@ -33,6 +33,7 @@ class Pokemon attr_writer :shiny attr_accessor :head_shiny attr_accessor :body_shiny + attr_accessor :debug_shiny # The index of this Pokémon's ability (0, 1 are natural abilities, 2+ are # hidden abilities)as defined for its species/form. An ability may not be # defined at this index. Is recalculated (as 0 or 1) if made nil. @@ -164,6 +165,10 @@ class Pokemon return headSpecies == checkSpeciesId end + def debugShiny? + return @debug_shiny + end + def bodyShiny? return @body_shiny end diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb index d87e2aeeb..e0533479a 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016_UI/005_UI_Party.rb @@ -427,8 +427,9 @@ class PokemonPartyPanel < SpriteWrapper end # Draw shiny icon if @pokemon.shiny? - pbDrawImagePositions(@overlaysprite.bitmap, [[ - "Graphics/Pictures/shiny", 80, 48, 0, 0, 16, 16]]) + imagePos=[] + addShinyStarsToGraphicsArray(imagePos,80,48,@pokemon.bodyShiny?,@pokemon.headShiny?,@pokemon.debugShiny?,0,0,16,16) + pbDrawImagePositions(@overlaysprite.bitmap,imagePos) end end pbDrawTextPositions(@overlaysprite.bitmap, textpos) diff --git a/Data/Scripts/016_UI/006_UI_Summary.rb b/Data/Scripts/016_UI/006_UI_Summary.rb index a7aa1b33c..ed0fb11fd 100644 --- a/Data/Scripts/016_UI/006_UI_Summary.rb +++ b/Data/Scripts/016_UI/006_UI_Summary.rb @@ -334,7 +334,8 @@ class PokemonSummary_Scene end # Show shininess star if @pokemon.shiny? - imagepos.push([sprintf("Graphics/Pictures/shiny"), 2, 134]) + addShinyStarsToGraphicsArray(imagepos,2,134,@pokemon.bodyShiny?,@pokemon.headShiny?,@pokemon.debugShiny?,nil,nil,nil,nil,true) + #imagepos.push([sprintf("Graphics/Pictures/shiny"), 2, 134]) end # Draw all images pbDrawImagePositions(overlay, imagepos) diff --git a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb index fd7e9f6fc..4e5cf14f0 100644 --- a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb +++ b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb @@ -1546,7 +1546,8 @@ class PokemonStorageScene textstrings.push([_INTL("No item"), 86, 336, 2, nonbase, nonshadow]) end if pokemon.shiny? - imagepos.push(["Graphics/Pictures/shiny", 156, 198]) + addShinyStarsToGraphicsArray(imagepos,156,198,pokemon.bodyShiny?,pokemon.headShiny?,pokemon.debugShiny?,nil,nil,nil,nil,false,true) + #imagepos.push(["Graphics/Pictures/shiny", 156, 198]) end typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) type1_number = GameData::Type.get(pokemon.type1).id_number diff --git a/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb index d10fac9ce..e31fbad8f 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb @@ -811,33 +811,33 @@ PokemonDebugMenuCommands.register("speciesform", { screen.pbRefreshSingle(pkmnid) end when 1 # Set form - cmd2 = 0 - formcmds = [[], []] - GameData::Species.each do |sp| - next if sp.species != pkmn.species - form_name = sp.form_name - form_name = _INTL("Unnamed form") if !form_name || form_name.empty? - form_name = sprintf("%d: %s", sp.form, form_name) - formcmds[0].push(sp.form) - formcmds[1].push(form_name) - cmd2 = sp.form if pkmn.form == sp.form - end - if formcmds[0].length <= 1 - screen.pbDisplay(_INTL("Species {1} only has one form.", pkmn.speciesName)) - else - cmd2 = screen.pbShowCommands(_INTL("Set the Pokémon's form."), formcmds[1], cmd2) - next if cmd2 < 0 - f = formcmds[0][cmd2] - if f != pkmn.form - if MultipleForms.hasFunction?(pkmn, "getForm") - next if !screen.pbConfirm(_INTL("This species decides its own form. Override?")) - pkmn.forced_form = f - end - pkmn.form = f - $Trainer.pokedex.register(pkmn) if !settingUpBattle - screen.pbRefreshSingle(pkmnid) - end - end + # cmd2 = 0 + # formcmds = [[], []] + # GameData::Species.each do |sp| + # next if sp.species != pkmn.species + # form_name = sp.form_name + # form_name = _INTL("Unnamed form") if !form_name || form_name.empty? + # form_name = sprintf("%d: %s", sp.form, form_name) + # formcmds[0].push(sp.form) + # formcmds[1].push(form_name) + # cmd2 = sp.form if pkmn.form == sp.form + # end + # if formcmds[0].length <= 1 + # screen.pbDisplay(_INTL("Species {1} only has one form.", pkmn.speciesName)) + # else + # cmd2 = screen.pbShowCommands(_INTL("Set the Pokémon's form."), formcmds[1], cmd2) + # next if cmd2 < 0 + # f = formcmds[0][cmd2] + # if f != pkmn.form + # if MultipleForms.hasFunction?(pkmn, "getForm") + # next if !screen.pbConfirm(_INTL("This species decides its own form. Override?")) + # pkmn.forced_form = f + # end + # pkmn.form = f + # $Trainer.pokedex.register(pkmn) if !settingUpBattle + # screen.pbRefreshSingle(pkmnid) + # end + # end when 2 # Remove form override pkmn.forced_form = nil screen.pbRefreshSingle(pkmnid) @@ -872,10 +872,13 @@ PokemonDebugMenuCommands.register("setshininess", { case cmd when 0 # Make shiny pkmn.shiny = true + pkmn.debug_shiny=true when 1 # Make normal pkmn.shiny = false + pkmn.debug_shiny=false when 2 # Reset pkmn.shiny = nil + pkmn.debug_shiny=nil end screen.pbRefreshSingle(pkmnid) end diff --git a/Data/Scripts/025-Randomizer/RandomizerSettings.rb b/Data/Scripts/025-Randomizer/RandomizerSettings.rb index 2c4019b53..ea77a14c6 100644 --- a/Data/Scripts/025-Randomizer/RandomizerSettings.rb +++ b/Data/Scripts/025-Randomizer/RandomizerSettings.rb @@ -10,7 +10,7 @@ class RandomizerOptionsScene < PokemonOption_Scene @openWildOptions = false @openGymOptions = false @openItemOptions = false - + $game_switches[SWITCH_RANDOMIZED_AT_LEAST_ONCE] = true end def getDefaultDescription diff --git a/Data/Scripts/025-Randomizer/randomizer.rb b/Data/Scripts/025-Randomizer/randomizer.rb index f4cb02e8a..96a98a836 100644 --- a/Data/Scripts/025-Randomizer/randomizer.rb +++ b/Data/Scripts/025-Randomizer/randomizer.rb @@ -97,7 +97,6 @@ def itemCanBeRandomized(item) end def pbShuffleItems() - $game_switches[SWITCH_RANDOMIZED_AT_LEAST_ONCE] = true randomItemsHash = Hash.new available_items = [] for itemElement in GameData::Item.list_all @@ -121,7 +120,6 @@ end def pbShuffleTMs() - $game_switches[SWITCH_RANDOMIZED_AT_LEAST_ONCE] = true randomItemsHash = Hash.new available_items = [] for itemElement in GameData::Item.list_all diff --git a/Data/Scripts/048_Fusion/PokemonFusion.rb b/Data/Scripts/048_Fusion/PokemonFusion.rb index 72ef2c50a..b54db1e11 100644 --- a/Data/Scripts/048_Fusion/PokemonFusion.rb +++ b/Data/Scripts/048_Fusion/PokemonFusion.rb @@ -719,6 +719,8 @@ class PokemonFusionScene if @pokemon1.shiny? @pokemon1.body_shiny=true end + @pokemon1.debug_shiny=true if @pokemon1.debug_shiny || @pokemon2.debug_shiny + setFusionIVs(superSplicer) #add to pokedex if !$Trainer.pokedex.owned?(newSpecies) diff --git a/Data/Scripts/050_AddOns/FusionSprites.rb b/Data/Scripts/050_AddOns/FusionSprites.rb index 17424c797..fc922b054 100644 --- a/Data/Scripts/050_AddOns/FusionSprites.rb +++ b/Data/Scripts/050_AddOns/FusionSprites.rb @@ -30,7 +30,7 @@ module GameData elsif isBodyShiny dex_offset = getBodyID(dex_number) end - return pbGet(VAR_SHINY_HUE_OFFSET) + dex_offset + Settings::SHINY_HUE_OFFSET + return dex_offset + Settings::SHINY_HUE_OFFSET end def self.front_sprite_bitmap(dex_number, a = 0, b = 0, isShiny = false, bodyShiny = false, headShiny = false) @@ -41,7 +41,7 @@ module GameData filename = self.sprite_filename(dex_number) sprite = (filename) ? AnimatedBitmap.new(filename) : nil if isShiny - sprite.shiftColors(self.calculateShinyHueOffset(dex_number, bodyShiny, headShiny)) + sprite.shiftColors(self.calculateShinyHueOffset(dex_number, bodyShiny, headShiny)) end return sprite end diff --git a/Data/Scripts/050_AddOns/GeneralUtils.rb b/Data/Scripts/050_AddOns/GeneralUtils.rb index ef5eb6ae4..5a6921e1e 100644 --- a/Data/Scripts/050_AddOns/GeneralUtils.rb +++ b/Data/Scripts/050_AddOns/GeneralUtils.rb @@ -160,6 +160,22 @@ def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customP end +def addShinyStarsToGraphicsArray(imageArray, xPos, yPos, shinyBody, shinyHead, debugShiny, srcx=nil, srcy=nil, width=nil, height=nil, + showSecondStarUnder=false, showSecondStarAbove=false) + color = debugShiny ? Color.new(0,0,0,255) : nil + imageArray.push(["Graphics/Pictures/shiny",xPos,yPos,srcx,srcy,width,height,color]) + if shinyBody && shinyHead + if showSecondStarUnder + yPos += 15 + elsif showSecondStarAbove + yPos -= 15 + else + xPos -= 15 + end + imageArray.push(["Graphics/Pictures/shiny",xPos,yPos,srcx,srcy,width,height,color]) + end +end + def getRandomCustomFusion(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3, maxBST=300) if customPokeList.length == 0 customPokeList = getCustomSpeciesList() diff --git a/Data/Scripts/050_AddOns/New Items effects.rb b/Data/Scripts/050_AddOns/New Items effects.rb index e2430a28e..ef60919f5 100644 --- a/Data/Scripts/050_AddOns/New Items effects.rb +++ b/Data/Scripts/050_AddOns/New Items effects.rb @@ -1420,10 +1420,20 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil) end end end + pokemon.debug_shiny=true if pokemon.debug_shiny && pokemon.body_shiny + poke2.debug_shiny=true if pokemon.debug_shiny || poke2.head_shiny + pokemon.body_shiny=false pokemon.head_shiny=false + if !pokemon.shiny? + pokemon.debug_shiny=false + end + if !poke2.shiny? + poke2.debug_shiny=false + end + if $Trainer.party.length >= 6 if (keepInParty == 0) $PokemonStorage.pbStoreCaught(poke2) diff --git a/Data/System.rxdata b/Data/System.rxdata index 5ddc7e862..3fe399553 100644 Binary files a/Data/System.rxdata and b/Data/System.rxdata differ