shinifixes

This commit is contained in:
infinitefusion
2022-10-19 19:27:23 -04:00
parent 689b1f09df
commit 49f7edb06a
15 changed files with 93 additions and 77 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -6,7 +6,7 @@
module Settings module Settings
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format. # The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
GAME_VERSION = '5.0.0' GAME_VERSION = '5.0.0'
GAME_VERSION_NUMBER = "5.0.35" GAME_VERSION_NUMBER = "5.0.35.2"
POKERADAR_LIGHT_ANIMATION_RED_ID = 17 POKERADAR_LIGHT_ANIMATION_RED_ID = 17
POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18 POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18
@@ -332,56 +332,56 @@ module Settings
# * Minimum possible level. # * Minimum possible level.
# * Maximum possible level (optional). # * Maximum possible level (optional).
POKE_RADAR_ENCOUNTERS = [ POKE_RADAR_ENCOUNTERS = [
[78, 30, :FLETCHLING,2,5], #Rt. 1 [78, 50, :FLETCHLING,2,5], #Rt. 1
[86, 30, :FLETCHLING,2,5], #Rt. 2 [86, 50, :FLETCHLING,2,5], #Rt. 2
[90, 30, :FLETCHLING,2,5], #Rt. 2 [90, 50, :FLETCHLING,2,5], #Rt. 2
[491, 30, :SHROOMISH,2,5], #Viridian Forest [491, 50, :SHROOMISH,2,5], #Viridian Forest
[490, 30, :BUDEW,4,9], #Rt. 3 [490, 50, :BUDEW,4,9], #Rt. 3
[106, 30, :NINCADA,8,10], #Rt. 4 [106, 50, :NINCADA,8,10], #Rt. 4
[12, 30, :TOGEPI,10,10], #Rt. 5 [12, 50, :TOGEPI,10,10], #Rt. 5
[16, 30, :SLAKOTH,12,15], #Rt. 6 [16, 50, :SLAKOTH,12,15], #Rt. 6
[413, 30, :DRIFLOON,17,20], #Rt. 7 [413, 50, :DRIFLOON,17,20], #Rt. 7
[409, 30, :SHINX,17,18], #Rt. 8 [409, 50, :SHINX,17,18], #Rt. 8
[495, 30, :ARON,12,15], #Rt. 9 [495, 50, :ARON,12,15], #Rt. 9
[351, 30, :ARON,12,15], #Rt. 9 [351, 50, :ARON,12,15], #Rt. 9
[154, 30, :KLINK,14,17], #Rt. 10 [154, 50, :KLINK,14,17], #Rt. 10
[155, 30, :NINCADA,12,15], #Rt. 11 [155, 50, :NINCADA,12,15], #Rt. 11
[159, 30, :COTTONEE,22,25], #Rt. 12 [159, 50, :COTTONEE,22,25], #Rt. 12
[437, 30, :COTTONEE,22,25], #Rt. 13 [437, 50, :COTTONEE,22,25], #Rt. 13
[437, 30, :JOLTIK,22,25], #Rt. 13 [437, 50, :JOLTIK,22,25], #Rt. 13
[440, 30, :JOLTIK,22,25], #Rt. 14 [440, 50, :JOLTIK,22,25], #Rt. 14
[444, 30, :SOLOSIS,22,25], #Rt. 15 [444, 50, :SOLOSIS,22,25], #Rt. 15
[438, 30, :NATU,22,25], #Rt. 16 [438, 50, :NATU,22,25], #Rt. 16
[146, 30, :KLEFKI,22,25], #Rt. 17 [146, 50, :KLEFKI,22,25], #Rt. 17
[517, 30, :FERROSEED,22,25], #Rt. 18 [517, 50, :FERROSEED,22,25], #Rt. 18
[445, 30, :BAGON,20,20], #Safari zone 1 [445, 50, :BAGON,20,20], #Safari zone 1
[484, 30, :AXEW,20,20], #Safari zone 2 [484, 50, :AXEW,20,20], #Safari zone 2
[485, 30, :DEINO,20,20], #Safari zone 3 [485, 50, :DEINO,20,20], #Safari zone 3
[486, 30, :LARVITAR,20,20], #Safari zone 4 [486, 50, :LARVITAR,20,20], #Safari zone 4
[487, 30, :BELDUM,20,20], #Safari zone 5 [487, 50, :BELDUM,20,20], #Safari zone 5
[59, 30, :DUNSPARCE,25,30], #Rt. 21 [59, 50, :DUNSPARCE,25,30], #Rt. 21
[171, 30, :BIDOOF,2,5], #Rt. 22 [171, 50, :BIDOOF,2,5], #Rt. 22
[143, 30, :RIOLU,25,25], #Rt. 23 [143, 50, :RIOLU,25,25], #Rt. 23
[8, 30, :BUNEARY,12,13], #Rt. 24 [8, 50, :BUNEARY,12,13], #Rt. 24
[145, 30, :ABSOL,30,35], #Rt. 26 [145, 50, :ABSOL,30,35], #Rt. 26
[147, 30, :ABSOL,30,35], #Rt. 27 [147, 50, :ABSOL,30,35], #Rt. 27
[311, 30, :BIDOOF,5,5], #Rt. 29 [311, 50, :BIDOOF,5,5], #Rt. 29
[284, 30, :LUXIO,40,45], #Rt. 33 [284, 50, :LUXIO,40,45], #Rt. 33
[288, 30, :VIGOROTH,40,45], #Rt. 32 [288, 50, :VIGOROTH,40,45], #Rt. 32
[342, 30, :GOLETT,40,45], #Ruins of Alph [342, 50, :GOLETT,40,45], #Ruins of Alph
[261, 30, :BELLOSSOM,45,50], #Rt. 31 [261, 50, :BELLOSSOM,45,50], #Rt. 31
[262, 30, :BIBAREL,45,50], #Rt. 30 [262, 50, :BIBAREL,45,50], #Rt. 30
[265, 30, :KIRLIA,25,30], #Rt. 34 [265, 50, :KIRLIA,25,30], #Rt. 34
[267, 30, :SUDOWOODO,25,30], #Rt. 36 [267, 50, :SUDOWOODO,25,30], #Rt. 36
[300, 30, :ROSELIA,30,30], #National Park [500, 50, :ROSELIA,30,30], #National Park
[266, 30, :BRELOOM,30,30], #Ilex Forest [266, 50, :BRELOOM,30,30], #Ilex Forest
[670, 30, :WEAVILE,50,50], #Ice mountains [670, 50, :WEAVILE,50,50], #Ice mountains
[528, 30, :PYUKUMUKU,20,20], #Treasure Beach [528, 50, :PYUKUMUKU,20,20], #Treasure Beach
[690, 30, :OCTILLERY,32,45], #Deep Ocean [690, 50, :OCTILLERY,32,45], #Deep Ocean
[561, 30, :FLETCHINDER,32,45], #Mt. Ember [561, 50, :FLETCHINDER,32,45], #Mt. Ember
[562, 30, :NINJASK,45,50], #Boon Island [562, 50, :NINJASK,45,50], #Boon Island
[603, 30, :KECLEON,45,50], #Chrono Island [603, 50, :KECLEON,45,50], #Chrono Island
[654, 30, :WHIMSICOTT,32,45] #Brine Road [654, 50, :WHIMSICOTT,32,45] #Brine Road
] ]
#============================================================================= #=============================================================================

View File

@@ -38,12 +38,8 @@ class AnimatedBitmap
end end
end end
MAX_SHIFT_VALUE = 360
MINIMUM_OFFSET=40
def shiftColors(offset = 0) 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 = GifBitmap.new(@path, @filename, offset)
end end

View File

@@ -35,6 +35,8 @@ class Pokemon
attr_accessor :head_shiny attr_accessor :head_shiny
attr_accessor :body_shiny attr_accessor :body_shiny
attr_accessor :debug_shiny attr_accessor :debug_shiny
attr_accessor :natural_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.
@@ -103,7 +105,7 @@ class Pokemon
# Maximum number of moves a Pokémon can know at once # Maximum number of moves a Pokémon can know at once
MAX_MOVES = 4 MAX_MOVES = 4
SHINY_CHANCE = 16 S_CHANCE_VALIDATOR = 16
def self.play_cry(species, form = 0, volume = 90, pitch = 100) def self.play_cry(species, form = 0, volume = 90, pitch = 100)
GameData::Species.play_cry_from_species(species, form, volume, pitch) GameData::Species.play_cry_from_species(species, form, volume, pitch)
@@ -170,13 +172,13 @@ class Pokemon
def shiny=(value) def shiny=(value)
@shiny=value @shiny=value
if value && Settings::SHINY_POKEMON_CHANCE != SHINY_CHANCE if value && Settings::SHINY_POKEMON_CHANCE != S_CHANCE_VALIDATOR
@debug_shiny=true @debug_shiny=true
end end
end end
def debugShiny? def debugShiny?
return @debug_shiny return !@natural_shiny || @debug_shiny
end end
def bodyShiny? def bodyShiny?
@@ -481,10 +483,16 @@ class Pokemon
b = a & 0xFFFF b = a & 0xFFFF
c = (a >> 16) & 0xFFFF c = (a >> 16) & 0xFFFF
d = b ^ c d = b ^ c
@shiny = d < Settings::SHINY_POKEMON_CHANCE is_shiny = d < Settings::SHINY_POKEMON_CHANCE
if is_shiny
@shiny = true
@natural_shiny=true
end
end end
if @shiny && Settings::SHINY_POKEMON_CHANCE != SHINY_CHANCE if @shiny && Settings::SHINY_POKEMON_CHANCE != S_CHANCE_VALIDATOR
@debug_shiny=true @debug_shiny=true
@natural_shiny=false
end end
return @shiny return @shiny
end end

View File

@@ -2147,20 +2147,20 @@ class PokemonStorageScreen
# #
def pbFuseFromPC(selected, heldpoke) def pbFuseFromPC(selected, heldpoke)
box = selected[0] box = selected[0]
index = selected[1] index = selected[1]
poke_body = @storage[box, index] poke_body = @storage[box, index]
poke_head = heldpoke poke_head = heldpoke
if heldpoke if heldpoke
if dexNum(heldpoke.species) > NB_POKEMON if dexNum(heldpoke.species) > NB_POKEMON
pbDisplay(_INTL("{1} is already fused!", heldpoke.name)) pbDisplay(_INTL("{1} is already fused!", heldpoke.name))
return return
end
if(selected.egg? || heldpoke.egg?)
pbDisplay(_INTL("It's impossible to fuse an egg!"))
return
end
end end
if(selected.egg? || heldpoke.egg?)
pbDisplay(_INTL("It's impossible to fuse an egg!"))
return
end
end
splicerItem = selectSplicer() splicerItem = selectSplicer()
if splicerItem == nil if splicerItem == nil

View File

@@ -21,16 +21,28 @@ module GameData
return ret return ret
end end
MAX_SHIFT_VALUE = 360
MINIMUM_OFFSET=40
ADDITIONAL_OFFSET_WHEN_TOO_CLOSE=40
MINIMUM_DEX_DIF=20
def self.calculateShinyHueOffset(dex_number, isBodyShiny = false, isHeadShiny = false) def self.calculateShinyHueOffset(dex_number, isBodyShiny = false, isHeadShiny = false)
dex_offset = dex_number dex_offset = dex_number
body_number = getBodyID(dex_number)
head_number=getHeadID(dex_number,body_number)
dex_diff = (body_number-head_number).abs
if isBodyShiny && isHeadShiny if isBodyShiny && isHeadShiny
dex_offset = dex_number dex_offset = dex_number
elsif isHeadShiny elsif isHeadShiny
dex_offset = getHeadID(dex_number) dex_offset = head_number
elsif isBodyShiny elsif isBodyShiny
dex_offset = getBodyID(dex_number) dex_offset = dex_diff > MINIMUM_DEX_DIF ? body_number : body_number+ADDITIONAL_OFFSET_WHEN_TOO_CLOSE
end end
return dex_offset + Settings::SHINY_HUE_OFFSET offset = dex_offset + Settings::SHINY_HUE_OFFSET
offset /= MAX_SHIFT_VALUE if offset > NB_POKEMON
offset = MINIMUM_OFFSET if offset < MINIMUM_OFFSET
offset = MINIMUM_OFFSET if (MAX_SHIFT_VALUE - offset).abs < MINIMUM_OFFSET
offset += pbGet(VAR_SHINY_HUE_OFFSET) #for testing - always 0 during normal gameplay
return 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)

Binary file not shown.

Binary file not shown.