Hotfix patch 6.9.2: Randomized champion crash fix

This commit is contained in:
chardub
2026-11-04 21:43:56 -05:00
parent 894c4c5343
commit 0c5e524b16
14 changed files with 27 additions and 43 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+5 -5
View File
@@ -5,11 +5,11 @@
#==============================================================================#
module Settings
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
GAME_VERSION_NUMBER = "6.9.1"
LATEST_GAME_RELEASE = "6.9.1"
GAME_VERSION_NUMBER = "6.9.2"
LATEST_GAME_RELEASE = "6.9.2"
HOENN_VERSION_NUMBER = "1.3"
HOENN_LATEST_GAME_RELEASE = "1.3.2"
HOENN_VERSION_NUMBER = "1.3.1"
HOENN_LATEST_GAME_RELEASE = "1.3.1"
SNOW_DAY = true
@@ -37,7 +37,7 @@ module Settings
ANIMATE_REFLECTIONS = false # GAME_ID == :IF_HOENN #true
USE_REFLECTIONS = false
# Infinite fusion settings
NB_POKEMON = 576
NB_POKEMON = 582
TRANSFER_BOX_DISCLAIMER_MESSAGE = ""
CUSTOM_BASE_SPRITES_FOLDER = "Graphics/CustomBattlers/local_sprites/BaseSprites/"
CUSTOM_BATTLERS_FOLDER = "Graphics/CustomBattlers/"
+2 -17
View File
@@ -2,22 +2,7 @@ module Encryption
ENCRYPTION_KEY = [0x4A, 0x8F, 0x2C, 0xE1, 0x73, 0xB5, 0x96, 0x0D,
0x5E, 0xA2, 0x3F, 0xC7, 0x81, 0x14, 0x6B, 0xD9]
CHUNK_SIZE = 1 << 20
def self.xor(data)
key = ENCRYPTION_KEY.pack("C*")
@full_chunk_key ||= (key * (CHUNK_SIZE / key.length)).unpack1("H*").to_i(16)
full_chunk_key = @full_chunk_key
result = String.new(capacity: data.bytesize, encoding: Encoding::BINARY)
offset = 0
while offset < data.bytesize
chunk = data.byteslice(offset, CHUNK_SIZE)
size = chunk.bytesize
chunk_key = size == CHUNK_SIZE ? full_chunk_key : (key * (size / key.length + 1)).byteslice(0, size).unpack1("H*").to_i(16)
xored = chunk.unpack1("H*").to_i(16) ^ chunk_key
result << [xored.to_s(16).rjust(size * 2, "0")].pack("H*")
offset += CHUNK_SIZE
end
return result
data.bytes.each_with_index.map { |b, i| b ^ ENCRYPTION_KEY[i % ENCRYPTION_KEY.length] }.pack("C*")
end
end
end
@@ -548,7 +548,7 @@ class Messages
@messages = [] if !@messages
arr = []
for i in 0...array.length
arr[i] = (array[i] == "") ? nil : array[i]
arr[i] = (array[i]) ? array[i] : ""
end
@messages[type] = arr
end
@@ -557,8 +557,7 @@ class Messages
@messages = [] if !@messages
arr = (@messages[type]) ? @messages[type] : []
for i in 0...array.length
arr[i] = array[i] if array[i]
arr[i] = nil if arr[i] == ""
arr[i] = (array[i]) ? array[i] : (arr[i]) ? arr[i] : ""
end
@messages[type] = arr
end
@@ -766,10 +765,6 @@ module MessageTypes
@@messages.loadMessageFile(filename)
end
def self.loadFallbackMessageFile(filename)
@@messagesFallback.loadMessageFile(filename)
end
def self.get(type, id)
ret = @@messages.get(type, id)
if ret == ""
@@ -202,7 +202,15 @@ module GameData
def generateRandomChampionSpecies(old_species)
customsList = getCustomSpeciesList()
bst_range = pbGet(VAR_RANDOMIZER_TRAINER_BST)
new_species = $game_switches[SWITCH_RANDOM_GYM_CUSTOMS] ? getSpecies(getNewCustomSpecies(old_species, customsList, bst_range)) : getSpecies(getNewSpecies(old_species, bst_range))
same_egg_group = $game_switches[SWITCH_RANDOM_WILD_EGG_GROUP]
includeLegendaries = $game_switches[SWITCH_RANDOM_WILD_LEGENDARIES]
if $game_switches[SWITCH_RANDOM_GYM_CUSTOMS]
new_species = getSpecies(getNewCustomSpecies(old_species, customsList, bst_range,false,includeLegendaries,same_egg_group))
else
new_species = getSpecies(getNewSpecies(old_species, bst_range,false,PBSpecies.maxValue,includeLegendaries,same_egg_group))
end
#every pokemon should be fully evolved
evolved_species_id = getEvolution(new_species)
evolved_species_id = getEvolution(evolved_species_id)
@@ -101,7 +101,6 @@ def pbStartOver(gameover = false)
if Settings::HOENN
$game_switches[SWITCH_RIVAL_ON_MT_CHIMNEY] = false
$game_switches[SWITCH_WAILMER_EGGS_QUEST] = false
$game_variables[]
end
@@ -419,7 +419,6 @@ end
# Dive
#===============================================================================
def pbDive
return
return false if $game_player.pbFacingEvent
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
return false if !map_metadata || !map_metadata.dive_map_id
@@ -356,7 +356,7 @@ def new_legendary_cache
Hash.new { |h, sp| h[sp] = is_legendary_num(sp) }
end
def getNewCustomSpecies(oldSpecies, customSpeciesList, bst_range, ignoreRivalPlaceholder, includeLegendaries, same_egg_group,
def getNewCustomSpecies(oldSpecies, customSpeciesList, bst_range, ignoreRivalPlaceholder=false, includeLegendaries=true, same_egg_group=false,
bst_cache = nil, egg_group_cache = nil, legendary_cache = nil, fallback_cache = nil)
if $game_switches[SWITCH_LEGENDARY_MODE]
return dexNum(convert_species_to_legendary(oldSpecies))
@@ -48,7 +48,6 @@ class Movie
picture.bitmap = pbBitmap(frame)
picture.visible=true
pbWait(Graphics.frame_rate / 20)
picture.bitmap&.dispose
picture.dispose
@currentFrame += 1
end
+1 -1
View File
@@ -168,7 +168,7 @@ end
def mainFunctionDebug
begin
showLoadingScreen
MessageTypes.loadFallbackMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
PluginManager.runPlugins
Compiler.main
Game.initialize
+7 -8
View File
@@ -9,16 +9,15 @@ module Settings
ALTERING_CAVE_ENCOUNTERS =
{
:MONDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :PHANTUMP],
:TUESDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :STANTLER],
:WEDNESDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :GASTLY],
:THURSDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :MIMIKYU],
:FRIDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :HOOTHOOT],
:SATURDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :PUMPKABOO],
:SUNDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :MISDREAVUS],
:MONDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :HOUNDOUR],
:TUESDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :SCRAGGY],
:WEDNESDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :PINECO],
:THURSDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :MAREEP],
:FRIDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :TEDDIURSA],
:SATURDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :AIPOM],
:SUNDAY => [:ZUBAT, :ZUBAT, :ZUBAT, :WOOBAT, :SMEARGLE],
}
STARTUP_MESSAGES = "Pokémon Infinite Fusion 2 is now available! Download it from the game's Discord!" #Legacy starting PIF1 6.8
STARTUP_MESSAGES_KANTO = "Pokémon Infinite Fusion 2 is now available! Download it from the game's Discord!"
STARTUP_MESSAGES_HOENN = "Pokémon Infinite Fusion 2 is still in development. Make sure to restart the game once in a while if you experience any lag issues."