mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
shiny fusion fixes + custom starters option (events)
This commit is contained in:
@@ -5,23 +5,35 @@ module GameData
|
||||
species = GameData::Species.get(species).id_number # Just to be sure it's a number
|
||||
return self.egg_sprite_bitmap(species, pkmn.form) if pkmn.egg?
|
||||
if back
|
||||
ret = self.back_sprite_bitmap(species,nil,nil,pkmn.shiny?)
|
||||
ret = self.back_sprite_bitmap(species, nil, nil, pkmn.shiny?,pkmn.bodyShiny?,pkmn.headShiny?)
|
||||
else
|
||||
ret = self.front_sprite_bitmap(species,nil,nil,pkmn.shiny?)
|
||||
ret = self.front_sprite_bitmap(species, nil, nil, pkmn.shiny?,pkmn.bodyShiny?,pkmn.headShiny?)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
def self.sprite_bitmap_from_pokemon_id(id, back = false)
|
||||
def self.sprite_bitmap_from_pokemon_id(id, back = false, shiny=false, bodyShiny=false,headShiny=false)
|
||||
if back
|
||||
ret = self.back_sprite_bitmap(id)
|
||||
ret = self.back_sprite_bitmap(id,nil,nil,shiny,bodyShiny,headShiny)
|
||||
else
|
||||
ret = self.front_sprite_bitmap(id)
|
||||
ret = self.front_sprite_bitmap(id,nil,nil,shiny,bodyShiny,headShiny)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
def self.front_sprite_bitmap(dex_number, a=0, b = 0, isShiny = false, d = 0)
|
||||
def self.calculateShinyHueOffset(dex_number, isBodyShiny = false, isHeadShiny = false)
|
||||
dex_offset = dex_number
|
||||
if isBodyShiny && isHeadShiny
|
||||
dex_offset = dex_number
|
||||
elsif isHeadShiny
|
||||
dex_offset = getHeadID(dex_number)
|
||||
elsif isBodyShiny
|
||||
dex_offset = getBodyID(dex_number)
|
||||
end
|
||||
return pbGet(VAR_SHINY_HUE_OFFSET) + dex_offset + Settings::SHINY_HUE_OFFSET
|
||||
end
|
||||
|
||||
def self.front_sprite_bitmap(dex_number, a = 0, b = 0, isShiny = false, bodyShiny = false, headShiny = false)
|
||||
#la méthode est utilisé ailleurs avec d'autres arguments (gender, form, etc.) mais on les veut pas
|
||||
if dex_number.is_a?(Symbol)
|
||||
dex_number = GameData::Species.get(dex_number).id_number
|
||||
@@ -29,16 +41,16 @@ module GameData
|
||||
filename = self.sprite_filename(dex_number)
|
||||
sprite = (filename) ? AnimatedBitmap.new(filename) : nil
|
||||
if isShiny
|
||||
sprite.shiftColors(pbGet(VAR_SHINY_HUE_OFFSET)+dex_number)
|
||||
sprite.shiftColors(self.calculateShinyHueOffset(dex_number, bodyShiny, headShiny))
|
||||
end
|
||||
return sprite
|
||||
end
|
||||
|
||||
def self.back_sprite_bitmap(dex_number, b=0, form = 0, isShiny=false, c = false, shadow = false)
|
||||
def self.back_sprite_bitmap(dex_number, b = 0, form = 0, isShiny = false, bodyShiny = false, headShiny = false)
|
||||
filename = self.sprite_filename(dex_number)
|
||||
sprite = (filename) ? AnimatedBitmap.new(filename) : nil
|
||||
if isShiny
|
||||
sprite.shiftColors(pbGet(VAR_SHINY_HUE_OFFSET)+dex_number)
|
||||
sprite.shiftColors(self.calculateShinyHueOffset(dex_number, bodyShiny, headShiny))
|
||||
end
|
||||
return sprite
|
||||
end
|
||||
|
||||
@@ -476,6 +476,7 @@ def reverseFusion(pokemon)
|
||||
pokemon.exp_when_fused_body = head_exp
|
||||
pokemon.exp_when_fused_head = body_exp
|
||||
|
||||
pokemon.head_shiny,pokemon.body_shiny = pokemon.body_shiny,pokemon.head_shiny
|
||||
#play animation
|
||||
pbFadeOutInWithMusic(99999) {
|
||||
fus = PokemonEvolutionScene.new
|
||||
@@ -1401,6 +1402,28 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
||||
pokemon.exp_when_fused_head = nil
|
||||
pokemon.exp_when_fused_body = nil
|
||||
|
||||
|
||||
if pokemon.shiny?
|
||||
pokemon.shiny = false
|
||||
if pokemon.bodyShiny? && pokemon.headShiny?
|
||||
pokemon.shiny = true
|
||||
poke2.shiny = true
|
||||
elsif pokemon.bodyShiny?
|
||||
pokemon.shiny = true
|
||||
elsif pokemon.headShiny?
|
||||
poke2.shiny = true
|
||||
else #shiny was obtained already fused
|
||||
if rand(2) == 0
|
||||
pokemon.shiny = true
|
||||
else
|
||||
poke2.shiny = true
|
||||
end
|
||||
end
|
||||
end
|
||||
pokemon.body_shiny=false
|
||||
pokemon.head_shiny=false
|
||||
|
||||
|
||||
if $Trainer.party.length >= 6
|
||||
if (keepInParty == 0)
|
||||
$PokemonStorage.pbStoreCaught(poke2)
|
||||
|
||||
Reference in New Issue
Block a user