down;oad & switch base pokemon alt sprites

This commit is contained in:
infinitefusion
2023-05-10 21:01:50 -04:00
parent c022e95bca
commit 147b264f42
20 changed files with 64 additions and 19 deletions

1
.~lock.music_export.csv# Normal file
View File

@@ -0,0 +1 @@
Charles Dubois,DESKTOP-U5METSR/charl,DESKTOP-U5METSR,10.05.2023 20:13,file:///C:/Users/charl/AppData/Roaming/OpenOffice/4;

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
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
GAME_VERSION = '5.0.0'
GAME_VERSION_NUMBER = "5.2.0"
GAME_VERSION_NUMBER = "5.2.1"
POKERADAR_LIGHT_ANIMATION_RED_ID = 17
POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18
@@ -21,6 +21,7 @@ module Settings
#Infinite fusion settings
NB_POKEMON = 420
CUSTOM_BASE_SPRITES_FOLDER = "Graphics/CustomBattlers/customBaseSprites/"
CUSTOM_BATTLERS_FOLDER = "Graphics/CustomBattlers/"
CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/indexed/"
BATTLERS_FOLDER = "Graphics/Battlers/"

View File

@@ -194,6 +194,10 @@ def get_unfused_sprite_path(dex_number)
folder = dex_number.to_s
filename = sprintf("%s.png", dex_number)
if alt_sprites_substitutions_available && $PokemonGlobal.alt_sprite_substitutions.keys.include?(dex_number)
return $PokemonGlobal.alt_sprite_substitutions[dex_number]
end
normal_path = Settings::BATTLERS_FOLDER + folder + "/" + filename
lightmode_path = Settings::BATTLERS_FOLDER + filename
return normal_path if pbResolveBitmap(normal_path)

View File

@@ -38,9 +38,15 @@ end
def download_sprite(base_path, head_id, body_id, saveLocation = "Graphics/temp", alt_letter= "")
begin
downloaded_file_name = _INTL("{1}/{2}.{3}{4}.png", saveLocation, head_id, body_id,alt_letter)
if !body_id
downloaded_file_name = _INTL("{1}/{2}{3}.png", saveLocation, head_id,alt_letter)
end
return downloaded_file_name if pbResolveBitmap(downloaded_file_name)
url = _INTL(base_path, head_id, body_id)
#echo "\nSending request to " + url
if !body_id
url = _INTL(base_path, head_id)
end
response = HTTPLite.get(url)
if response[:status] == 200
File.open(downloaded_file_name, "wb") do |file|
@@ -78,6 +84,24 @@ def download_custom_sprite(head_id, body_id)
return nil
end
def download_unfused_alt_sprites(dex_num)
base_url = "https://raw.githubusercontent.com/infinitefusion/sprites/main/Other/Alternate%20Base%20Sprites/{1}"
extension = ".png"
destPath = _INTL("{1}", Settings::CUSTOM_BASE_SPRITES_FOLDER)
if !Dir.exist?(destPath)
Dir.mkdir(destPath)
end
alt_url = _INTL(base_url,dex_num) + extension
download_sprite(alt_url, dex_num,nil, destPath )
alphabet = ('a'..'z').to_a
alphabet.each do |letter|
alt_url = _INTL(base_url,dex_num) + letter + extension
sprite = download_sprite(alt_url, dex_num,nil, destPath, letter)
return if !sprite
end
end
def download_alt_sprites(head_id,body_id)
base_url = "https://raw.githubusercontent.com/infinitefusion/sprites/main/CustomBattlers/{1}.{2}"
extension = ".png"

View File

@@ -1,5 +1,6 @@
class PokedexUtils
POSSIBLE_ALTS = %w[a b c d e f g h i j k x]
POSSIBLE_ALTS = ["", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
"r", "s", "t", "u", "v", "w", "x", "y", "z"]
def pbGetAvailableAlts(species)
ret = []
@@ -8,6 +9,14 @@ class PokedexUtils
isFusion = dexNum > NB_POKEMON
if !isFusion
ret << Settings::BATTLERS_FOLDER + dexNum.to_s + "/" + dexNum.to_s + ".png"
POSSIBLE_ALTS.each { |alt_letter|
altFilePath = Settings::CUSTOM_BASE_SPRITES_FOLDER + dexNum.to_s + alt_letter + ".png"
if pbResolveBitmap(altFilePath)
ret << altFilePath
end
}
return ret
end
body_id = getBodyID(species)
@@ -19,16 +28,17 @@ class PokedexUtils
ret << baseFilePath
end
POSSIBLE_ALTS.each { |alt_letter|
altFilePath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + head_id.to_s + "/" + baseFilename + alt_letter + ".png"
if pbResolveBitmap(altFilePath)
ret << altFilePath
if alt_letter != "" #empty is included in alt letters because unfused sprites can be alts and not have a letter
altFilePath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + head_id.to_s + "/" + baseFilename + alt_letter + ".png"
if pbResolveBitmap(altFilePath)
ret << altFilePath
end
end
}
ret << Settings::BATTLERS_FOLDER + head_id.to_s + "/" + baseFilename + ".png"
return ret
end
#todo: return array for split evolution lines that have multiple final evos
def getFinalEvolution(species)
#ex: [[B3H4,Level 32],[B2H5, Level 35]]

View File

@@ -95,11 +95,17 @@ class PokemonPokedexInfo_Scene
end
def pbGetAvailableForms
body_id = getBodyID(@species)
head_id = getHeadID(@species, body_id)
download_custom_sprite(head_id, body_id)
download_autogen_sprite(head_id, body_id)
download_alt_sprites(head_id, body_id)
dex_num = getDexNumberForSpecies(@species)
if dex_num <= NB_POKEMON
download_unfused_alt_sprites(dex_num)
else
body_id = getBodyID(@species)
head_id = getHeadID(@species, body_id)
download_custom_sprite(head_id, body_id)
download_autogen_sprite(head_id, body_id)
download_alt_sprites(head_id, body_id)
end
return PokedexUtils.new.pbGetAvailableAlts(@species)
end
@@ -137,12 +143,13 @@ class PokemonPokedexInfo_Scene
@sprites["nextSprite"].setBitmap(@available[nextIndex])
selected_bitmap = @sprites["selectedSprite"].getBitmap
is_generated = !selected_bitmap.path.include?(Settings::CUSTOM_BATTLERS_FOLDER_INDEXED)
showSpriteCredits(selected_bitmap.filename,is_generated)
sprite_path = selected_bitmap.path
is_generated = sprite_path.start_with?(Settings::BATTLERS_FOLDER)
showSpriteCredits(selected_bitmap.filename, is_generated)
update_selected
end
def showSpriteCredits(filename,generated_sprite=false)
def showSpriteCredits(filename, generated_sprite = false)
@creditsOverlay.dispose
x = Graphics.width / 2 - 75
@@ -154,7 +161,7 @@ class PokemonPokedexInfo_Scene
discord_name = "Unknown artist" if !discord_name
else
#todo give credits to Japeal - need to differenciate unfused sprites
discord_name = ""#"Japeal\n(Generated)"
discord_name = "" #"Japeal\n(Generated)"
end
author_name = File.basename(discord_name, '#*')
@@ -256,8 +263,6 @@ class PokemonPokedexInfo_Scene
set_alt_sprite_substitution(species_number, new_main_sprite)
end
# def swap_main_sprite
# begin
# old_main_sprite = @available[0]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
5.2
5.2.1

Binary file not shown.