double shinies and fake shinies

This commit is contained in:
infinitefusion
2022-10-16 11:56:35 -04:00
parent 749cdff356
commit 53082e910f
18 changed files with 98 additions and 57 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -163,7 +163,7 @@ module Settings
# e.g. To require the second badge, put false and 1. # e.g. To require the second badge, put false and 1.
# To require at least 2 badges, put true and 2. # To require at least 2 badges, put true and 2.
BADGE_FOR_CUT = 1 BADGE_FOR_CUT = 1
BADGE_FOR_FLASH = 2 BADGE_FOR_FLASH = 1
BADGE_FOR_ROCKSMASH = 0 BADGE_FOR_ROCKSMASH = 0
BADGE_FOR_SURF = 5 BADGE_FOR_SURF = 5
BADGE_FOR_FLY = 3 BADGE_FOR_FLY = 3
@@ -374,7 +374,7 @@ module Settings
[265, 30, :KIRLIA,25,30], #Rt. 34 [265, 30, :KIRLIA,25,30], #Rt. 34
[267, 30, :SUDOWOODO,25,30], #Rt. 36 [267, 30, :SUDOWOODO,25,30], #Rt. 36
[300, 30, :ROSELIA,30,30], #National Park [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 [670, 30, :WEAVILE,50,50], #Ice mountains
[528, 30, :PYUKUMUKU,20,20], #Treasure Beach [528, 30, :PYUKUMUKU,20,20], #Treasure Beach
[690, 30, :OCTILLERY,32,45], #Deep Ocean [690, 30, :OCTILLERY,32,45], #Deep Ocean

View File

@@ -5,7 +5,6 @@ class AnimatedBitmap
attr_reader :path attr_reader :path
attr_reader :filename attr_reader :filename
def initialize(file, hue = 0) def initialize(file, hue = 0)
raise "Filename is nil (missing graphic)." if file.nil? raise "Filename is nil (missing graphic)." if file.nil?
path = file path = file
@@ -15,8 +14,8 @@ class AnimatedBitmap
filename = split_file.pop filename = split_file.pop
path = split_file.join('/') + '/' path = split_file.join('/') + '/'
end end
@filename= filename @filename = filename
@path= path @path = path
if filename[/^\[\d+(?:,\d+)?\]/] # Starts with 1 or 2 numbers in square brackets if filename[/^\[\d+(?:,\d+)?\]/] # Starts with 1 or 2 numbers in square brackets
@bitmap = PngAnimatedBitmap.new(path, filename, hue) @bitmap = PngAnimatedBitmap.new(path, filename, hue)
else else
@@ -25,24 +24,27 @@ class AnimatedBitmap
end end
def pbSetColor(r = 0, g = 0, b = 0, a = 255) 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 i in 0..@bitmap.bitmap.width
for j in 0..@bitmap.bitmap.height for j in 0..@bitmap.bitmap.height
if @bitmap.bitmap.get_pixel(i, j).alpha != 0 if @bitmap.bitmap.get_pixel(i, j).alpha != 0
color = Color.new(r, g, b, a)
@bitmap.bitmap.set_pixel(i, j, color) @bitmap.bitmap.set_pixel(i, j, color)
end end
end end
end end
end end
def shiftColors(offset=0) MAX_SHIFT_VALUE = 360
MINIMUM_OFFSET=40
offset/=360 if offset >360 def shiftColors(offset = 0)
offset=30 if offset <30 #this method is only used for shinies. shinies that barely shift are boring 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 = GifBitmap.new(@path, @filename, offset)
#@bitmap.bitmap.hue_change(offset)
end end
def [](index) def [](index)
@@ -104,7 +106,7 @@ class AnimatedBitmap
destination_rect = Rect.new(0, 0, new_width, new_height) destination_rect = Rect.new(0, 0, new_width, new_height)
source_rect = Rect.new(0, 0, @bitmap.bitmap.width, @bitmap.bitmap.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( new_bitmap.stretch_blt(
destination_rect, destination_rect,
@bitmap.bitmap, @bitmap.bitmap,
@@ -125,14 +127,10 @@ class AnimatedBitmap
# end # end
# end # end
def mirror def mirror
@bitmap.bitmap @bitmap.bitmap
end end
end end
#=============================================================================== #===============================================================================
@@ -258,11 +256,11 @@ class GifBitmap
def initialize(dir, filename, hue = 0) def initialize(dir, filename, hue = 0)
@bitmap = nil @bitmap = nil
@disposed = false @disposed = false
@loaded_from_cache=false @loaded_from_cache = false
filename = "" if !filename filename = "" if !filename
begin begin
@bitmap = RPG::Cache.load_bitmap(dir, filename, hue) @bitmap = RPG::Cache.load_bitmap(dir, filename, hue)
@loaded_from_cache=true @loaded_from_cache = true
rescue rescue
@bitmap = nil @bitmap = nil
end end

View File

@@ -1229,8 +1229,14 @@ def pbDrawImagePositions(bitmap,textpos)
srcy=i[4] || 0 srcy=i[4] || 0
width=(i[5] && i[5]>=0) ? i[5] : srcbitmap.width width=(i[5] && i[5]>=0) ? i[5] : srcbitmap.width
height=(i[6] && i[6]>=0) ? i[6] : srcbitmap.height 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) srcrect=Rect.new(srcx,srcy,width,height)
bitmap.blt(x,y,srcbitmap.bitmap,srcrect) bitmap.blt(x,y,srcbitmap.bitmap,srcrect)
srcbitmap.dispose srcbitmap.dispose
end end
end end

View File

@@ -235,7 +235,7 @@ class PokemonDataBox < SpriteWrapper
# Draw shiny icon # Draw shiny icon
if @battler.shiny? if @battler.shiny?
shinyX = (@battler.opposes?(0)) ? 206 : -6 # Foe's/player's 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 end
# Draw Mega Evolution/Primal Reversion icon # Draw Mega Evolution/Primal Reversion icon
if @battler.mega? if @battler.mega?

View File

@@ -33,6 +33,7 @@ class Pokemon
attr_writer :shiny attr_writer :shiny
attr_accessor :head_shiny attr_accessor :head_shiny
attr_accessor :body_shiny attr_accessor :body_shiny
attr_accessor :debug_shiny
# The index of this Pokémon's ability (0, 1 are natural abilities, 2+ are # 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 # 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. # defined at this index. Is recalculated (as 0 or 1) if made nil.
@@ -164,6 +165,10 @@ class Pokemon
return headSpecies == checkSpeciesId return headSpecies == checkSpeciesId
end end
def debugShiny?
return @debug_shiny
end
def bodyShiny? def bodyShiny?
return @body_shiny return @body_shiny
end end

View File

@@ -427,8 +427,9 @@ class PokemonPartyPanel < SpriteWrapper
end end
# Draw shiny icon # Draw shiny icon
if @pokemon.shiny? if @pokemon.shiny?
pbDrawImagePositions(@overlaysprite.bitmap, [[ imagePos=[]
"Graphics/Pictures/shiny", 80, 48, 0, 0, 16, 16]]) addShinyStarsToGraphicsArray(imagePos,80,48,@pokemon.bodyShiny?,@pokemon.headShiny?,@pokemon.debugShiny?,0,0,16,16)
pbDrawImagePositions(@overlaysprite.bitmap,imagePos)
end end
end end
pbDrawTextPositions(@overlaysprite.bitmap, textpos) pbDrawTextPositions(@overlaysprite.bitmap, textpos)

View File

@@ -334,7 +334,8 @@ class PokemonSummary_Scene
end end
# Show shininess star # Show shininess star
if @pokemon.shiny? 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 end
# Draw all images # Draw all images
pbDrawImagePositions(overlay, imagepos) pbDrawImagePositions(overlay, imagepos)

View File

@@ -1546,7 +1546,8 @@ class PokemonStorageScene
textstrings.push([_INTL("No item"), 86, 336, 2, nonbase, nonshadow]) textstrings.push([_INTL("No item"), 86, 336, 2, nonbase, nonshadow])
end end
if pokemon.shiny? 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 end
typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
type1_number = GameData::Type.get(pokemon.type1).id_number type1_number = GameData::Type.get(pokemon.type1).id_number

View File

@@ -811,33 +811,33 @@ PokemonDebugMenuCommands.register("speciesform", {
screen.pbRefreshSingle(pkmnid) screen.pbRefreshSingle(pkmnid)
end end
when 1 # Set form when 1 # Set form
cmd2 = 0 # cmd2 = 0
formcmds = [[], []] # formcmds = [[], []]
GameData::Species.each do |sp| # GameData::Species.each do |sp|
next if sp.species != pkmn.species # next if sp.species != pkmn.species
form_name = sp.form_name # form_name = sp.form_name
form_name = _INTL("Unnamed form") if !form_name || form_name.empty? # form_name = _INTL("Unnamed form") if !form_name || form_name.empty?
form_name = sprintf("%d: %s", sp.form, form_name) # form_name = sprintf("%d: %s", sp.form, form_name)
formcmds[0].push(sp.form) # formcmds[0].push(sp.form)
formcmds[1].push(form_name) # formcmds[1].push(form_name)
cmd2 = sp.form if pkmn.form == sp.form # cmd2 = sp.form if pkmn.form == sp.form
end # end
if formcmds[0].length <= 1 # if formcmds[0].length <= 1
screen.pbDisplay(_INTL("Species {1} only has one form.", pkmn.speciesName)) # screen.pbDisplay(_INTL("Species {1} only has one form.", pkmn.speciesName))
else # else
cmd2 = screen.pbShowCommands(_INTL("Set the Pokémon's form."), formcmds[1], cmd2) # cmd2 = screen.pbShowCommands(_INTL("Set the Pokémon's form."), formcmds[1], cmd2)
next if cmd2 < 0 # next if cmd2 < 0
f = formcmds[0][cmd2] # f = formcmds[0][cmd2]
if f != pkmn.form # if f != pkmn.form
if MultipleForms.hasFunction?(pkmn, "getForm") # if MultipleForms.hasFunction?(pkmn, "getForm")
next if !screen.pbConfirm(_INTL("This species decides its own form. Override?")) # next if !screen.pbConfirm(_INTL("This species decides its own form. Override?"))
pkmn.forced_form = f # pkmn.forced_form = f
end # end
pkmn.form = f # pkmn.form = f
$Trainer.pokedex.register(pkmn) if !settingUpBattle # $Trainer.pokedex.register(pkmn) if !settingUpBattle
screen.pbRefreshSingle(pkmnid) # screen.pbRefreshSingle(pkmnid)
end # end
end # end
when 2 # Remove form override when 2 # Remove form override
pkmn.forced_form = nil pkmn.forced_form = nil
screen.pbRefreshSingle(pkmnid) screen.pbRefreshSingle(pkmnid)
@@ -872,10 +872,13 @@ PokemonDebugMenuCommands.register("setshininess", {
case cmd case cmd
when 0 # Make shiny when 0 # Make shiny
pkmn.shiny = true pkmn.shiny = true
pkmn.debug_shiny=true
when 1 # Make normal when 1 # Make normal
pkmn.shiny = false pkmn.shiny = false
pkmn.debug_shiny=false
when 2 # Reset when 2 # Reset
pkmn.shiny = nil pkmn.shiny = nil
pkmn.debug_shiny=nil
end end
screen.pbRefreshSingle(pkmnid) screen.pbRefreshSingle(pkmnid)
end end

View File

@@ -10,7 +10,7 @@ class RandomizerOptionsScene < PokemonOption_Scene
@openWildOptions = false @openWildOptions = false
@openGymOptions = false @openGymOptions = false
@openItemOptions = false @openItemOptions = false
$game_switches[SWITCH_RANDOMIZED_AT_LEAST_ONCE] = true
end end
def getDefaultDescription def getDefaultDescription

View File

@@ -97,7 +97,6 @@ def itemCanBeRandomized(item)
end end
def pbShuffleItems() def pbShuffleItems()
$game_switches[SWITCH_RANDOMIZED_AT_LEAST_ONCE] = true
randomItemsHash = Hash.new randomItemsHash = Hash.new
available_items = [] available_items = []
for itemElement in GameData::Item.list_all for itemElement in GameData::Item.list_all
@@ -121,7 +120,6 @@ end
def pbShuffleTMs() def pbShuffleTMs()
$game_switches[SWITCH_RANDOMIZED_AT_LEAST_ONCE] = true
randomItemsHash = Hash.new randomItemsHash = Hash.new
available_items = [] available_items = []
for itemElement in GameData::Item.list_all for itemElement in GameData::Item.list_all

View File

@@ -719,6 +719,8 @@ class PokemonFusionScene
if @pokemon1.shiny? if @pokemon1.shiny?
@pokemon1.body_shiny=true @pokemon1.body_shiny=true
end end
@pokemon1.debug_shiny=true if @pokemon1.debug_shiny || @pokemon2.debug_shiny
setFusionIVs(superSplicer) setFusionIVs(superSplicer)
#add to pokedex #add to pokedex
if !$Trainer.pokedex.owned?(newSpecies) if !$Trainer.pokedex.owned?(newSpecies)

View File

@@ -30,7 +30,7 @@ module GameData
elsif isBodyShiny elsif isBodyShiny
dex_offset = getBodyID(dex_number) dex_offset = getBodyID(dex_number)
end end
return pbGet(VAR_SHINY_HUE_OFFSET) + dex_offset + Settings::SHINY_HUE_OFFSET return dex_offset + Settings::SHINY_HUE_OFFSET
end end
def self.front_sprite_bitmap(dex_number, a = 0, b = 0, isShiny = false, bodyShiny = false, headShiny = false) 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) filename = self.sprite_filename(dex_number)
sprite = (filename) ? AnimatedBitmap.new(filename) : nil sprite = (filename) ? AnimatedBitmap.new(filename) : nil
if isShiny if isShiny
sprite.shiftColors(self.calculateShinyHueOffset(dex_number, bodyShiny, headShiny)) sprite.shiftColors(self.calculateShinyHueOffset(dex_number, bodyShiny, headShiny))
end end
return sprite return sprite
end end

View File

@@ -160,6 +160,22 @@ def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customP
end 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) def getRandomCustomFusion(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3, maxBST=300)
if customPokeList.length == 0 if customPokeList.length == 0
customPokeList = getCustomSpeciesList() customPokeList = getCustomSpeciesList()

View File

@@ -1420,10 +1420,20 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
end end
end 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.body_shiny=false
pokemon.head_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 $Trainer.party.length >= 6
if (keepInParty == 0) if (keepInParty == 0)
$PokemonStorage.pbStoreCaught(poke2) $PokemonStorage.pbStoreCaught(poke2)

Binary file not shown.