Fixes real shinies being considered fake when fused as the head of a fusion

This commit is contained in:
infinitefusion
2022-12-06 17:38:03 -05:00
parent bc90211693
commit 9b3185f299
23 changed files with 67 additions and 10 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -26,6 +26,9 @@ class Game_Temp
attr_accessor :background_bitmap
attr_accessor :mart_prices
attr_accessor :unimportedSprites
attr_accessor :nb_imported_sprites
attr_accessor :loading_screen
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------

View File

@@ -601,7 +601,7 @@ class PokemonEvolutionScene
@sprites["msgwindow"].text = ""
# Check for consumed item and check if Pokémon should be duplicated
pbEvolutionMethodAfterEvolution
pbEvolutionMethodAfterEvolution if !reversing
oldAbility = @pokemon.ability.id
newSpecies = GameData::Species.get(@newspecies)

View File

@@ -756,6 +756,9 @@ class PokemonFusionScene
removeItem = false
if @pokemon2.isShiny? || @pokemon1.isShiny?
@pokemon1.makeShiny
if !(@pokemon1.debug_shiny ||@pokemon2.debug_shiny)
@pokemon1.natural_shiny = true if @pokemon2.natural_shiny
end
end
#make it untraded, pour qu'on puisse le unfused après, même si un des 2 était traded

View File

@@ -299,9 +299,14 @@ class PokemonLoadScreen
end
def pbStartLoadScreen
if($game_temp.unimportedSprites.size >0)
if($game_temp.unimportedSprites && $game_temp.unimportedSprites.size >0)
handleReplaceExistingSprites()
end
if ($game_temp.nb_imported_sprites && $game_temp.nb_imported_sprites > 0)
pbMessage(_INTL("{1} new custom sprites were imported into the game",$game_temp.nb_imported_sprites.to_s))
end
$game_temp.nb_imported_sprites=nil
copyKeybindings()
save_file_list = SaveData::AUTO_SLOTS + SaveData::MANUAL_SLOTS
first_time = true

View File

@@ -1411,7 +1411,6 @@ def pbFuse(pokemon, poke2, supersplicers = false)
end
def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
bodyPoke = getBasePokemonID(pokemon.species_data.id_number, true)
headPoke = getBasePokemonID(pokemon.species_data.id_number, false)
@@ -1468,12 +1467,16 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
if pokemon.bodyShiny? && pokemon.headShiny?
pokemon.shiny = true
poke2.shiny = true
pokemon.natural_shiny = true if pokemon.natural_shiny && !pokemon.debug_shiny
poke2.natural_shiny = true if pokemon.natural_shiny && !pokemon.debug_shiny
elsif pokemon.bodyShiny?
pokemon.shiny = true
poke2.shiny = false
pokemon.natural_shiny = true if pokemon.natural_shiny && !pokemon.debug_shiny
elsif pokemon.headShiny?
poke2.shiny = true
pokemon.shiny = false
poke2.natural_shiny = true if pokemon.natural_shiny && !pokemon.debug_shiny
else #shiny was obtained already fused
if rand(2) == 0
pokemon.shiny = true
@@ -1485,6 +1488,7 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
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

View File

@@ -14,9 +14,9 @@ def handleReplaceExistingSprites()
return if spritesToReplaceList.size==0
commands = []
#commands << "Pick which sprites to use as mains"
commands << "Do not import the new sprites"
commands << "Replace all the old sprites with the new ones"
#commands << "Import all the new sprites as alts"
commands << "Do not import the new sprites"
messageSingular = "While importing custom sprites, the game has detected that {1} new custom sprite already has a version that exist in the game."
messagePlural = "While importing custom sprites, the game has detected that {1} new custom sprites already have versions that exist in the game."
@@ -27,15 +27,17 @@ def handleReplaceExistingSprites()
command = pbMessage("What to do with the new sprites?",commands,commands.size-1)
case command
when 0 #Replace olds
when 0 #Do not import
pbMessage("You can manually sort the new sprites in the /indexed folder to choose which ones you want to keep.")
pbMessage("You can also delete the ones you don't want to replace the main sprites and restart the game.")
return
when 1 #Replace olds
spritesToReplaceList.each do |oldPath, newPath|
File.rename(oldPath, newPath)
$game_temp.nb_imported_sprites+=1
echo "\nSorted " + oldPath + " into " + newPath
end
#when 1 #Keep olds (rename new as alts)
when 1 #Do not import
pbMessage("You can manually sort the new sprites in the /indexed folder to choose which ones you want to keep.")
return
#when 2 #Keep olds (rename new as alts)
end
end
@@ -56,6 +58,7 @@ end
def sortCustomBattlers()
$game_temp.nb_imported_sprites=0
echo "Sorting CustomBattlers files..."
alreadyExists = {}
Dir.foreach(Settings::CUSTOM_BATTLERS_FOLDER) do |filename|
@@ -71,6 +74,7 @@ def sortCustomBattlers()
else
File.rename(oldPath, newPath)
$game_temp.nb_imported_sprites+=1
echo "\nSorted " + filename + " into " + newPath
end
rescue
@@ -81,9 +85,48 @@ def sortCustomBattlers()
$game_temp.unimportedSprites=alreadyExists
end
# def playInViewPort(viewport)
# @finished=false
# @currentFrame = 1
# @initialTime = Time.now
# @timeElapsed = Time.now
#
# pbBGMPlay(@bgm)
# while (@currentFrame <= @maxFrame)# && !(@canStopEarly && Input::ACTION))
# break if Input.trigger?(Input::C) && @canStopEarly
# frame = sprintf(@framesPath, @currentFrame)
# picture = Sprite.new(viewport)
# picture.bitmap = pbBitmap(frame)
# picture.visible=true
# pbWait(Graphics.frame_rate / 20)
# picture.dispose
# @currentFrame += 1
# end
# @finished=true
# pbBGMStop
# end
def showLoadingScreen
intro_frames_path = "Graphics\\titles\\loading_screen"
picture = Sprite.new(@viewport)
picture.bitmap = pbBitmap(intro_frames_path)
picture.visible=true
pbWait(Graphics.frame_rate / 20)
picture.dispose
end
def showLoadMovie
path = "Graphics\\Pictures\\introMarill"
loading_screen = Sprite.new(@viewport)
loading_screen.bitmap = pbBitmap(path)
loading_screen.visible=true
end
def mainFunctionDebug
begin
showLoadingScreen
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
PluginManager.runPlugins
Compiler.main
@@ -92,7 +135,6 @@ def mainFunctionDebug
Graphics.update
Graphics.freeze
sortCustomBattlers()
$scene = pbCallTitle
$scene.main until $scene.nil?
Graphics.transition(20)

Binary file not shown.