Release 6.9.0

This commit is contained in:
chardub
2026-11-02 11:34:46 -05:00
parent 060726298d
commit ae6e2ebc64
5697 changed files with 131795 additions and 17423 deletions
@@ -13,12 +13,35 @@ def map_sprites_by_artist
return creditsMap
end
def titleize(str)
str.split(/ |\_/).map(&:capitalize).join(" ")
end
def map_sprites_by_reference
creditsMap = Hash.new { |hash, key| hash[key] = [] }
File.foreach(Settings::CREDITS_FILE_PATH) do |line|
row = line.split(',')
spritename = row[0]
next unless row[3]
tags = row[3].chomp.split(';')
next unless tags[0] == 'reference'
tags[1..-1].each do |reference|
creditsMap[reference] << spritename
end
end
return creditsMap
end
SPRITER_CREDITS_BLACKLIST = ["Game Freak", "Anonymous"]
def get_top_artists(nb_names = 100)
filename = Settings::CREDITS_FILE_PATH
name_counts = Hash.new(0)
File.readlines(filename).each do |line|
name = line.strip.split(',')[1]
next if name.nil? || SPRITER_CREDITS_BLACKLIST.include?(name)
name_counts[name] += 1
end
@@ -37,7 +37,7 @@ module GameData
@base_exp = calculate_base_exp()
@growth_rate = calculate_growth_rate()
@gender_ratio = calculate_gender() #todo
@gender_ratio = calculate_gender()
@catch_rate = calculate_catch_rate()
@happiness = calculate_base_happiness()
@@ -285,7 +285,7 @@ module GameData
def get_split_names
case getCurrentLanguage
when :ENGLISH
when :ENGLISH, :FRENCH_CANADA
return GameData::SPLIT_NAMES
when :FRENCH
return GameData::SPLIT_NAMES_FRENCH
@@ -393,11 +393,12 @@ module GameData
return :Medium
end
#todo
def calculate_gender
head_ratio = @head_pokemon.gender_ratio
body_ratio = @body_pokemon.gender_ratio
return :Genderless if head_ratio == :Genderless || body_ratio == :Genderless
return :Female50Percent
return @body_pokemon.gender_ratio
end
@@ -1137,6 +1137,7 @@ end
def drawSpriteCredits(pif_sprite, viewport)
@credits_overlay = BitmapSprite.new(Graphics.width, Graphics.height, @viewport).bitmap
pbSetSystemFont(@credits_overlay)
return if pif_sprite.type == :AUTOGEN
return if pif_sprite.local_path
x = Graphics.width / 2
@@ -71,7 +71,7 @@ module GameData
["Ma", "champ"],
["Bell", "sprout"],
["Weepin", "bell"],
["Victree", "bell"],
["Victree", "bel"],
["Tenta", "cool"],
["Tenta", "cruel"],
["Geo", "dude"],
@@ -511,12 +511,12 @@ module GameData
["Stout", "land"],
["Purr", "loin"],
["Lie", "pard"],
["Pans", "ansage"],
["Sim", "misage"],
["Panse", "ansear"],
["Simis", "misear"],
["Panp", "pour"],
["Simip", "mipour"],
["Pan", "sage"],
["Simi", "sage"],
["Pans", "sear"],
["Simi", "sear"],
["Pan", "pour"],
["Simi", "pour"],
["Mun", "na"],
["Mush", "sharna"],
["Pido", "dove"],
@@ -314,14 +314,14 @@ end
def get_body_number_from_symbol(id)
dexNum = getDexNumberForSpecies(id)
return dexNum if !isFusion(dexNum)
id.to_s.match(/\d+/)[0]
return id.to_s.match(/\d+/)[0].to_i
dexNum -= get_head_number_from_symbol(id)
return dexNum / Settings::NB_POKEMON
end
def get_head_number_from_symbol(id)
dexNum = getDexNumberForSpecies(id)
return dexNum if !isFusion(dexNum)
return id.to_s.match(/(?<=H)\d+/)[0].to_i
return dexNum % Settings::NB_POKEMON
end
def get_fusion_symbol(head_id, body_id)
@@ -440,7 +440,7 @@ end
def getSpeciesRealName(species_symbol)
return nil if !species_symbol
species = GameData::Species.get(species_symbol)
return species.real_name
return species.name
end
def playerHasFusedPokemonInTeam()
@@ -522,6 +522,14 @@ def get_triple_fusion_components(species_id)
return [480,483,486]
when Settings::ZAPMOLCUNO_NB + 30
return [481,484,487]
when Settings::ZAPMOLCUNO_NB + 31 #Telemauv
return [000]
when Settings::ZAPMOLCUNO_NB + 32 #Solrock/minior/lunatone
return [498,544,545]
when Settings::ZAPMOLCUNO_NB + 33 #Solrock/minior_core/lunatone
return [499,544,545]
when Settings::ZAPMOLCUNO_NB + 34 #stunfisk/bruxish/luvdisc
return [420,469,501]
else
return [000]
end
@@ -91,7 +91,7 @@ class BattleSpriteLoader
def obtain_fusion_pif_sprite(head_id,body_id)
substitution_id = get_sprite_substitution_id_for_fusion(head_id, body_id)
pif_sprite = $PokemonSystem.alt_sprite_substitutions[substitution_id] if $PokemonGlobal
#pif_sprite.dump_info if pif_sprite
if !pif_sprite || $PokemonSystem.random_sprites
pif_sprite = select_new_pif_fusion_sprite(head_id, body_id)
local_path = check_for_local_sprite(pif_sprite)
@@ -124,6 +124,11 @@ class BattleSpriteLoader
pif_sprite = $PokemonSystem.alt_sprite_substitutions[substitution_id] if $PokemonGlobal
if !pif_sprite || $PokemonSystem.random_sprites
pif_sprite = select_new_pif_base_sprite(dex_number)
local_path = check_for_local_sprite(pif_sprite)
if local_path
pif_sprite.local_path = local_path
end
$PokemonSystem.alt_sprite_substitutions[substitution_id] = pif_sprite if $PokemonGlobal && !$PokemonSystem.random_sprites
end
if pif_sprite.local_path
@@ -181,6 +186,7 @@ class BattleSpriteLoader
return pif_sprite.local_path if pif_sprite.local_path
if pif_sprite.type == :BASE
sprite_path = "#{Settings::CUSTOM_BASE_SPRITES_FOLDER}#{pif_sprite.head_id}#{pif_sprite.alt_letter}.png"
echoln sprite_path
else
sprite_path = "#{Settings::CUSTOM_BATTLERS_FOLDER_INDEXED}#{pif_sprite.head_id}/#{pif_sprite.head_id}.#{pif_sprite.body_id}#{pif_sprite.alt_letter}.png"
end
@@ -228,13 +234,46 @@ class BattleSpriteLoader
if $PokemonTemp.forced_alt_sprites && $PokemonTemp.forced_alt_sprites.include?(spritename)
alt_letter = $PokemonTemp.forced_alt_sprites[spritename]
end
if $game_switches && $game_switches[SWITCH_RANDOM_REFERENCE_SPRITES]
unless $PokemonTemp.selected_reference_sprites
$PokemonTemp.selected_reference_sprites = getSelectedReferenceSprites()
end
unless $PokemonTemp.reference_sprite_index
$PokemonTemp.reference_sprite_index = build_reference_sprite_index($PokemonTemp.selected_reference_sprites)
end
matching_alts = $PokemonTemp.reference_sprite_index[spritename]
if matching_alts && !matching_alts.empty?
alt_letter = matching_alts.sample
type = :CUSTOM
end
end
return PIFSprite.new(type, head_id, body_id, alt_letter)
end
def build_reference_sprite_index(list)
index = Hash.new { |h, k| h[k] = [] }
list.each do |entry|
# spritename portion is digits/dots only; alt suffix is trailing lowercase letters
if entry =~ /\A([\d.]+)([a-z]*)\z/
index[$1] << $2
end
end
index
end
def select_new_pif_base_sprite(dex_number)
random_alt = get_random_alt_letter_for_unfused(dex_number, true) #nil if no main
random_alt = "" if !random_alt
return PIFSprite.new(:BASE, dex_number, nil, random_alt)
pif_sprite = PIFSprite.new(:BASE, dex_number, nil, random_alt)
local_path = check_for_local_sprite(pif_sprite)
if local_path
pif_sprite.local_path = local_path
pif_sprite.type = :CUSTOM
end
return pif_sprite
end
#todo refactor by using get_triple_fusion_components()
@@ -295,6 +295,9 @@ end
#
class PokemonTemp
attr_accessor :forced_alt_sprites
attr_accessor :selected_reference_sprites
attr_accessor :reference_sprite_index
end
# todo: