update 6.7

This commit is contained in:
chardub
2025-09-28 15:53:01 -04:00
parent ef5e023ae0
commit 318ff90d8d
696 changed files with 111759 additions and 198230 deletions

View File

@@ -59,7 +59,7 @@
# basestatsum += $pkmn_dex[species][5][4] # Special Attack
# basestatsum += $pkmn_dex[species][5][5] # Special Defense
# end
# #Kernel.pbMessage(_INTL("total = {1}, {2}",basestatsum, PBSpecies.getName(species)))
# #Kernel.pbMessage("total = {1}, {2}",basestatsum, PBSpecies.getName(species))
# else
# if $game_switches[841]
# species = getRandomCustomSprite()

View File

@@ -164,7 +164,7 @@ class RandomizerTrainerOptionsScene < PokemonOption_Scene
"Use only Pokémon that have custom sprites in trainer teams"
)
# options << EnumOption.new(_INTL("Allow legendaries"), [_INTL("On"), _INTL("Off")],
# options << EnumOption.new("Allow legendaries", ["On", "Off"],
# proc { $game_switches[SWITCH_RANDOM_TRAINER_LEGENDARIES] ? 0 : 1 },
# proc { |value|
# $game_switches[SWITCH_RANDOM_TRAINER_LEGENDARIES] = value == 0
@@ -361,7 +361,7 @@ class RandomizerGymOptionsScene < PokemonOption_Scene
}, "Shuffle the gym types"
)
# options << EnumOption.new(_INTL("Allow legendaries"), [_INTL("On"), _INTL("Off")],
# options << EnumOption.new("Allow legendaries", ["On", "Off"],
# proc { $game_switches[SWITCH_RANDOM_GYM_LEGENDARIES] ? 0 : 1 },
# proc { |value|
# $game_switches[SWITCH_RANDOM_GYM_LEGENDARIES] = value == 0

View File

@@ -124,3 +124,18 @@ def pbGetRandomTM()
return newItem
end
def displayRandomizerErrorMessage()
echoln caller
Kernel.pbMessage(_INTL("The randomizer has encountered an error. You should try to re-randomize your game as soon as possible."))
Kernel.pbMessage(_INTL("You can do this on the top floor of Pokémon Centers."))
end
def ensureRandomHashInitialized()
if $PokemonGlobal.psuedoBSTHash == nil
psuedoHash = Hash.new
for i in 0..NB_POKEMON
psuedoHash[i] = i
end
$PokemonGlobal.psuedoBSTHash = psuedoHash
end
end

View File

@@ -109,7 +109,7 @@ end
# def displayProgress(current,total,bst)
# return if bst >= 100
# return if bst >= 20 && current % 10 != 0
# Kernel.pbMessageNoSound(_INTL("\\ts[]Generating encounters file...\\n Map {1}/{2}\\^",current,total))
# Kernel.pbMessageNoSound("\\ts[]Generating encounters file...\\n Map {1}/{2}\\^",current,total)
# end
#
@@ -145,7 +145,7 @@ end
#
# def pbMapEncounter(mapID,enctype)
# if enctype<0 || enctype>EncounterTypes::EnctypeChances.length
# raise ArgumentError.new(_INTL("Encounter type out of range"))
# raise ArgumentError.new("Encounter type out of range")
# end
# data=load_data(getEncountersFilePath())
# if data.is_a?(Hash) && data[mapID]

View File

@@ -150,10 +150,10 @@ end
def getLeaderType()
currentGym = $game_variables[VAR_CURRENT_GYM_TYPE]
if currentGym > $game_variables[151].length
if currentGym > $game_variables[VAR_GYM_TYPES_ARRAY].length
return nil
else
typeIndex = $game_variables[151][currentGym]
typeIndex = $game_variables[VAR_GYM_TYPES_ARRAY][currentGym]
type = PBTypes.getName(typeIndex)
end
return typeIndex
@@ -266,16 +266,24 @@ def Kernel.pbRandomizeTM()
for item in $itemData
#machine=$ItemData[item][ITEMMACHINE]
#movename=PBMoves.getName(machine)
#Kernel.pbMessage(_INTL("It contained {1}.\1",item))
#Kernel.pbMessage("It contained {1}.\1",item)
tmList << item if pbIsHiddenMachine?(item)
end
end
def getNewSpecies(oldSpecies, bst_range = 50, ignoreRivalPlaceholder = false, maxDexNumber = PBSpecies.maxValue, includeLegendaries=true)
oldSpecies_dex = dexNum(oldSpecies)
return oldSpecies_dex if (oldSpecies_dex == Settings::RIVAL_STARTER_PLACEHOLDER_SPECIES && !ignoreRivalPlaceholder)
return oldSpecies_dex if oldSpecies_dex >= Settings::ZAPMOLCUNO_NB
if $game_switches[SWITCH_LEGENDARY_MODE]
new_species= convert_species_to_legendary(oldSpecies)
newspecies_dex = dexNum(new_species)
return newspecies_dex
end
newspecies_dex = rand(maxDexNumber - 1) + 1
i = 0
while bstNotOk(newspecies_dex, oldSpecies_dex, bst_range) || !(legendaryOk(oldSpecies_dex,newspecies_dex,includeLegendaries))
@@ -289,6 +297,15 @@ def getNewSpecies(oldSpecies, bst_range = 50, ignoreRivalPlaceholder = false, ma
end
def getNewCustomSpecies(oldSpecies, customSpeciesList, bst_range = 50, ignoreRivalPlaceholder = false,includeLegendaries=true)
if $game_switches[SWITCH_LEGENDARY_MODE]
new_species= convert_species_to_legendary(oldSpecies)
echoln "CHOSEN #{get_readable_fusion_name(oldSpecies)} -> #{get_readable_fusion_name(new_species)}"
newspecies_dex = dexNum(new_species)
return newspecies_dex
end
oldSpecies_dex = dexNum(oldSpecies)
return oldSpecies_dex if (oldSpecies_dex == Settings::RIVAL_STARTER_PLACEHOLDER_SPECIES && !ignoreRivalPlaceholder)
return oldSpecies_dex if oldSpecies_dex >= Settings::ZAPMOLCUNO_NB
@@ -330,9 +347,13 @@ def Kernel.pbShuffleTrainers(bst_range = 50, customsOnly = false, customsList =
customsOnly = false
end
randomTrainersHash = Hash.new
trainers_data = GameData::Trainer.list_all
trainers_data = getTrainersDataMode.list_all
trainers_data.each do |key, value|
trainer = trainers_data[key]
echoln "------"
echoln "Processing [#{trainer.id}#] {trainer.trainer_type} ##{trainer.real_name}"
i = 0
new_party = []
for poke in trainer.pokemon
@@ -365,9 +386,9 @@ end
# i += 1
# if i % 2 == 0
# n = (i.to_f/trainers.length)*100
# Kernel.pbMessageNoSound(_INTL("\\ts[]Shuffling trainers...\\n {1}%\\^",sprintf('%.2f', n),PBSpecies.maxValue))
# Kernel.pbMessageNoSound("\\ts[]Shuffling trainers...\\n {1}%\\^",sprintf('%.2f', n),PBSpecies.maxValue)
# end
# #Kernel.pbMessage(_INTL("pushing trainer {1}: {2} ",i,trainer))
# #Kernel.pbMessage("pushing trainer {1}: {2} ",i,trainer)
# end
# $PokemonGlobal.randomTrainersHash = randomTrainersHash
# end
@@ -376,12 +397,12 @@ def Kernel.pbShuffleTrainersCustom(bst_range = 50)
randomTrainersHash = Hash.new
bst_range = pbGet(VAR_RANDOMIZER_TRAINER_BST)
Kernel.pbMessage(_INTL("Parsing custom sprites folder"))
Kernel.pbMessage(_INTL("Parsing custom sprites folder..."))
customsList = getCustomSpeciesList(true, true)
Kernel.pbMessage(_INTL("{1} sprites found", customsList.length.to_s))
Kernel.pbMessage(_INTL("{1} sprites found. Shuffling...", customsList.length.to_s))
if customsList.length == 0
Kernel.pbMessage(_INTL("To use custom sprites, please place correctly named sprites in the /CustomBattlers folder. See readMe.txt for more information"))
Kernel.pbMessage(_INTL("To use custom sprites, please place correctly named sprites in the /CustomBattlers folder. See readMe.txt for more information."))
Kernel.pbMessage(_INTL("Trainer Pokémon will include auto-generated sprites."))
return Kernel.pbShuffleTrainers(bst_range)
elsif customsList.length < 200
@@ -410,9 +431,9 @@ end
# i += 1
# if i % 2 == 0
# n = (i.to_f/trainers.length)*100
# Kernel.pbMessageNoSound(_INTL("\\ts[]Shuffling trainers (custom sprites only)...\\n {1}%\\^",sprintf('%.2f', n),PBSpecies.maxValue))
# Kernel.pbMessageNoSound("\\ts[]Shuffling trainers (custom sprites only)...\\n {1}%\\^",sprintf('%.2f', n),PBSpecies.maxValue)
# end
# #Kernel.pbMessage(_INTL("pushing trainer {1}: {2} ",i,trainer))
# #Kernel.pbMessage("pushing trainer {1}: {2} ",i,trainer)
# end
# $PokemonGlobal.randomTrainersHash = randomTrainersHash
@@ -447,7 +468,7 @@ def getCustomSpeciesList(allowOnline = true, redownload_file = false)
end
# if speciesList.length <= 20000 && allowOnline
# if redownload_file && Kernel.pbConfirmMessage(_INTL("Not enough local sprites found. Attempt to fetch list from the internet?"))
# if redownload_file && Kernel.pbConfirmMessage("Not enough local sprites found. Attempt to fetch list from the internet?")
# updateOnlineCustomSpritesFile
# end
#try to get list from github
@@ -518,39 +539,34 @@ def Kernel.getBaseStats(species)
end
def Kernel.gymLeaderRematchHint()
hints = [
"I heard that Brock has a huge interest in Pokémon fossils. He donated a lot of fossils he excavated to the Pewter City Museum.",
"Misty is a pro at swimming. I heard she trains every single morning.",
"Did you know that Lt. Surge used the magnetic fields generated by his Pokémon to navigate his plane back when he was in the army. He still loves a good magnetic field.",
"Erika is a lover of nature. She loves going to parks to relax during the day.",
"Koga has been seen leaving Fuschia city in the evenings. The rumors say he's preparing for a new job somewhere else...",
"People say that Sabrina never sleeps. I wonder where she goes when she leaves her gym at night.",
"The hot-headed Blaine is a man of extremes. He likes to explore around his hometown during the day.",
"Giovanni is a mysterious man. I wonder where he goes in the evening. Probably somewhere as remote as possible to meditate in peace...",
"I heard that Whitney went to school in one of the towns near Goldenrod before becoming a Gym Leader. She kept in touch with her old teacher and she goes to visit sometimes in the evening.",
"Kurt is always on the lookout for Bug-type Pokémon. He goes hunting early in the morning.",
"Falkner rises up early in the morning. You can usually find him in high places.",
"Clair is a member of a famous clan of dragon masters. She goes to a special place to pray at night.",
"Chuck is a martial arts pro. I've seen him train with Saffron City's dojo master back in the days.",
"Morty is a mysterious man. He's been known to be one of the few people who dare enter Pokémon Tower at night.",
"Pryce is an ice-type expert who has been around for a long time. He used to train in the Ice Tunnel between Mahogany Town and Blackthorn City before it froze over.",
"Jasmine is on vacation in the Sevii Islands. She likes to rise up early to explore around the islands when no one's around."
]
arr = []
n = 0
for i in 426..437
if !$game_switches[i]
arr.push(n)
end
n += 1
hints = {
426 =>_INTL("I heard that Brock has a huge interest in Pokémon fossils. He donated a lot of fossils he excavated to the Pewter City Museum."),
427 =>_INTL("Misty is a pro at swimming. I heard she trains every single morning."),
428 =>_INTL("Did you know that Lt. Surge used the magnetic fields generated by his Pokémon to navigate his plane back when he was in the army? He still loves a good magnetic field."),
429 =>_INTL("Erika is a lover of nature. She loves going to parks to relax during the day."),
430 =>_INTL("Koga has been seen leaving Fuschia city in the evenings. The rumors say he's preparing for a new job somewhere else..."),
431 =>_INTL("People say that Sabrina never sleeps. I wonder where she goes when she leaves her gym at night."),
432 =>_INTL("The hot-headed Blaine is a man of extremes. He likes to explore around his hometown during the day."),
433 =>_INTL("Giovanni is a mysterious man. I wonder where he goes in the evening. Probably somewhere as remote as possible to meditate in peace..."),
434 =>_INTL("I heard that Whitney went to school in one of the towns near Goldenrod before becoming a Gym Leader. She kept in touch with her old teacher and she goes to visit sometimes in the evening."),
435 =>_INTL("Kurt is always on the lookout for Bug-type Pokémon. He goes hunting early in the morning."),
436 =>_INTL("Falkner rises up early in the morning. You can usually find him in high places."),
437 =>_INTL("Clair is a member of a famous clan of dragon masters. She goes to a special place to pray at night."),
510 =>_INTL("Chuck is a martial arts pro. I've seen him train with Saffron City's dojo master back in the days."),
508 =>_INTL("Morty is a mysterious man. He's been known to be one of the few people who dare enter Pokémon Tower at night."),
509 =>_INTL("Pryce is an ice-type expert who has been around for a long time. He used to train in the Ice Tunnel between Mahogany Town and Blackthorn City before it froze over."),
511 =>_INTL("Jasmine is on vacation in the Sevii Islands. She likes to rise up early to explore around the islands when no one's around.")
}
remaining_leaders = []
for switch_nb in hints.keys
remaining_leaders << switch_nb unless $game_switches[switch_nb]
end
arr.push(508); arr.push(509); arr.push(510); arr.push(511);
n += 4
if arr.length > 0
return hints[arr[rand(arr.length)]]
if remaining_leaders.empty?
return "You got every Gym Leader to come here. This place is more popular than ever!\nNow go and battle them!"
else
key = remaining_leaders.sample
return hints[key]
end
return "You got every Gym Leader to come here. This place is more popular than ever!\nNow go and battle them!"
end
def getTrainerParty(trainer)
@@ -606,7 +622,7 @@ end
# def pbLoadTrainer(trainerid,trainername,partyid=0)
# if trainerid.is_a?(String) || trainerid.is_a?(Symbol)
# if !hasConst?(PBTrainers,trainerid)
# raise _INTL("Trainer type does not exist ({1}, {2}, ID {3})",trainerid,trainername,partyid)
# raise "Trainer type does not exist ({1}, {2}, ID {3})",trainerid,trainername,partyid
# end
# trainerid=getID(PBTrainers,trainerid)
# end
@@ -643,7 +659,7 @@ end
# #use le random Array si randomized starters (et pas 1ere rival battle)
# isPlayingRandomized = $game_switches[987] && !$game_switches[46]
# if isPlayingRandomized && $PokemonGlobal.randomTrainersHash[trainerIndex] == nil
# Kernel.pbMessage(_INTL("The trainers need to be re-shuffled."))
# Kernel.pbMessage("The trainers need to be re-shuffled.")
# Kernel.pbShuffleTrainers()
# end
# trainerParty = isPlayingRandomized ? $PokemonGlobal.randomTrainersHash[trainerIndex][3] : getTrainerParty(trainer)

View File

@@ -1,9 +1,10 @@
LEGENDARIES_LIST = [:ARTICUNO, :ZAPDOS, :MOLTRES, :MEWTWO, :MEW,
:ENTEI, :RAIKOU, :SUICUNE, :HOOH, :LUGIA, :CELEBI,
:GROUDON, :KYOGRE, :RAYQUAZA, :DEOXYS, :JIRACHI, :LATIAS, :LATIOS,
:REGIROCK, :REGICE, :REGISTEEL,
:REGIGIGAS, :DIALGA, :PALKIA, :GIRATINA, :DARKRAI, :CRESSELIA, :ARCEUS,
:GENESECT, :RESHIRAM, :ZEKROM, :KYUREM, :MELOETTA,
:NECROZMA]
:GENESECT, :RESHIRAM, :ZEKROM, :KYUREM, :MELOETTA_A,:MELOETTA_P,
:NECROZMA, :U_NECROZMA, :DIANCIE]
class PokemonGlobalMetadata
attr_accessor :psuedoHash
@@ -31,7 +32,7 @@ def get_pokemon_list(include_fusions = false)
#Create array of all pokemon dex numbers
pokeArray = []
monLimit = include_fusions ? PBSpecies.maxValue : NB_POKEMON - 1
monLimit = include_fusions ? PBSpecies.maxValue : NB_POKEMON
for i in 1..monLimit
pokeArray.push(i)
end
@@ -41,7 +42,7 @@ end
def get_randomized_bst_hash(poke_list, bst_range, show_progress = true)
bst_hash = Hash.new
for i in 1..NB_POKEMON - 1
for i in 1..NB_POKEMON
show_shuffle_progress(i) if show_progress
baseStats = getBaseStatsFormattedForRandomizer(i)
statsTotal = getStatsTotal(baseStats)
@@ -99,7 +100,7 @@ def is_legendary(dex_num,printInfo=false)
is_legendary = is_fusion_of_any(pokemon_id,LEGENDARIES_LIST)
#echoln "#{pokemon_id} is legendary? : #{is_legendary}"
#echoln _INTL("{1} ({2}) {3}",dex_num,pokemon_id,is_legendary) if printInfo
#echoln "{1} ({2}) {3}",dex_num,pokemon_id,is_legendary) if printInfo
return is_legendary
end
@@ -223,7 +224,7 @@ end
# pokeArrayRand.delete(pokeArrayRand[j])
# if i % 2 == 0 && type == 1
# n = (i.to_f/NB_POKEMON)*100
# Kernel.pbMessageNoSound(_INTL("\\ts[]Shuffling wild Pokémon...\\n {1}%\\^",sprintf('%.2f', n),NB_POKEMON))
# Kernel.pbMessageNoSound("\\ts[]Shuffling wild Pokémon...\\n {1}%\\^",sprintf('%.2f', n),NB_POKEMON)
# end
# break
# end
@@ -302,7 +303,7 @@ end
# for i in 1..PBSpecies.maxValue
# if i % 20 == 0
# n = (i.to_f/PBSpecies.maxValue)*100
# #Kernel.pbMessage(_INTL("\\ts[]Shuffling...\\n {1}%\\^",sprintf('%.2f', n),PBSpecies.maxValue))
# #Kernel.pbMessage("\\ts[]Shuffling...\\n {1}%\\^",sprintf('%.2f', n),PBSpecies.maxValue)
# end
#
# baseStats=calcBaseStats(i)