mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixes crash when can't copy file when generating fusion icon
This commit is contained in:
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.
@@ -116,8 +116,8 @@ class PokeRadar_UI
|
|||||||
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
|
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
|
||||||
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
||||||
bitmapPath = sprintf("%s.png", bitmapFileName)
|
bitmapPath = sprintf("%s.png", bitmapFileName)
|
||||||
IO.copy_stream(headPokeFileName, bitmapPath)
|
generated_new_icon = generateFusionIcon(headPokeFileName,bitmapPath)
|
||||||
result_bitmap = AnimatedBitmap.new(bitmapPath)
|
result_bitmap = generated_new_icon ? AnimatedBitmap.new(bitmapPath) : bitmap1
|
||||||
|
|
||||||
for i in 0..bitmap1.width-1
|
for i in 0..bitmap1.width-1
|
||||||
for j in ((bitmap1.height / 2) + Settings::FUSION_ICON_SPRITE_OFFSET)..bitmap1.height-1
|
for j in ((bitmap1.height / 2) + Settings::FUSION_ICON_SPRITE_OFFSET)..bitmap1.height-1
|
||||||
|
|||||||
@@ -191,8 +191,8 @@ class PokemonIconSprite < SpriteWrapper
|
|||||||
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
|
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
|
||||||
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
||||||
bitmapPath = sprintf("%s.png", bitmapFileName)
|
bitmapPath = sprintf("%s.png", bitmapFileName)
|
||||||
IO.copy_stream(headPokeFileName, bitmapPath)
|
generated_new_icon = generateFusionIcon(headPokeFileName,bitmapPath)
|
||||||
result_icon = AnimatedBitmap.new(bitmapPath)
|
result_icon = generated_new_icon ? AnimatedBitmap.new(bitmapPath) : icon1
|
||||||
|
|
||||||
for i in 0..icon1.width-1
|
for i in 0..icon1.width-1
|
||||||
for j in ((icon1.height / 2) + Settings::FUSION_ICON_SPRITE_OFFSET)..icon1.height-1
|
for j in ((icon1.height / 2) + Settings::FUSION_ICON_SPRITE_OFFSET)..icon1.height-1
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ class PokemonBoxIcon < IconSprite
|
|||||||
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
|
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
|
||||||
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
headPokeFileName = GameData::Species.icon_filename(headPoke)
|
||||||
bitmapPath = sprintf("%s.png", bitmapFileName)
|
bitmapPath = sprintf("%s.png", bitmapFileName)
|
||||||
IO.copy_stream(headPokeFileName, bitmapPath)
|
generated_new_icon = generateFusionIcon(headPokeFileName,bitmapPath)
|
||||||
result_icon = AnimatedBitmap.new(bitmapPath)
|
result_icon = generated_new_icon ? AnimatedBitmap.new(bitmapPath) : icon1
|
||||||
|
|
||||||
for i in 0..icon1.width - 1
|
for i in 0..icon1.width - 1
|
||||||
for j in ((icon1.height / 2) + Settings::FUSION_ICON_SPRITE_OFFSET)..icon1.height - 1
|
for j in ((icon1.height / 2) + Settings::FUSION_ICON_SPRITE_OFFSET)..icon1.height - 1
|
||||||
|
|||||||
@@ -47,6 +47,14 @@ def pbAddPokemonID(pokemon_id, level = 1, see_form = true, skip_randomize = fals
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def generateFusionIcon(dexNum, path)
|
||||||
|
begin
|
||||||
|
IO.copy_stream(dexNum, path)
|
||||||
|
return true
|
||||||
|
rescue
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def ensureFusionIconExists
|
def ensureFusionIconExists
|
||||||
directory_name = "Graphics/Pokemon/FusionIcons"
|
directory_name = "Graphics/Pokemon/FusionIcons"
|
||||||
@@ -85,7 +93,6 @@ def pbHasSpecies?(species)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
#ancienne methode qui est encore callée un peu partout dans les vieux scripts
|
#ancienne methode qui est encore callée un peu partout dans les vieux scripts
|
||||||
def getID(pbspecies_unused, species)
|
def getID(pbspecies_unused, species)
|
||||||
if species.is_a?(String)
|
if species.is_a?(String)
|
||||||
@@ -96,6 +103,7 @@ def getID(pbspecies_unused,species)
|
|||||||
id = species.dexNum
|
id = species.dexNum
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#Check if the Pokemon can learn a TM
|
#Check if the Pokemon can learn a TM
|
||||||
def CanLearnMove(pokemon, move)
|
def CanLearnMove(pokemon, move)
|
||||||
species = getID(PBSpecies, pokemon)
|
species = getID(PBSpecies, pokemon)
|
||||||
@@ -138,8 +146,6 @@ def getDexNumberForSpecies(species)
|
|||||||
return dexNum
|
return dexNum
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def getPokemon(dexNum)
|
def getPokemon(dexNum)
|
||||||
return GameData::Species.get(dexNum)
|
return GameData::Species.get(dexNum)
|
||||||
end
|
end
|
||||||
@@ -152,7 +158,6 @@ def getSpeciesIdForFusion(head_id, body_id)
|
|||||||
return (body_id) * Settings::NB_POKEMON + head_id
|
return (body_id) * Settings::NB_POKEMON + head_id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
#shortcut for using in game events because of script characters limit
|
#shortcut for using in game events because of script characters limit
|
||||||
def dexNum(species)
|
def dexNum(species)
|
||||||
return getDexNumberForSpecies(species)
|
return getDexNumberForSpecies(species)
|
||||||
@@ -162,7 +167,6 @@ def isTripleFusion?(num)
|
|||||||
return num >= Settings::ZAPMOLCUNO_NB
|
return num >= Settings::ZAPMOLCUNO_NB
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3)
|
def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3)
|
||||||
if customPokeList.length == 0
|
if customPokeList.length == 0
|
||||||
customPokeList = getCustomSpeciesList(false)
|
customPokeList = getCustomSpeciesList(false)
|
||||||
@@ -191,7 +195,6 @@ def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customP
|
|||||||
return randPoke
|
return randPoke
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def addShinyStarsToGraphicsArray(imageArray, xPos, yPos, shinyBody, shinyHead, debugShiny, srcx = nil, srcy = nil, width = nil, height = nil,
|
def addShinyStarsToGraphicsArray(imageArray, xPos, yPos, shinyBody, shinyHead, debugShiny, srcx = nil, srcy = nil, width = nil, height = nil,
|
||||||
showSecondStarUnder = false, showSecondStarAbove = false)
|
showSecondStarUnder = false, showSecondStarAbove = false)
|
||||||
color = debugShiny ? Color.new(0, 0, 0, 255) : nil
|
color = debugShiny ? Color.new(0, 0, 0, 255) : nil
|
||||||
@@ -235,7 +238,6 @@ def getRandomCustomFusion(returnRandomPokemonIfNoneFound = true, customPokeList
|
|||||||
return randPoke
|
return randPoke
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def getBodyID(species)
|
def getBodyID(species)
|
||||||
dexNum = getDexNumberForSpecies(species)
|
dexNum = getDexNumberForSpecies(species)
|
||||||
if dexNum % NB_POKEMON == 0
|
if dexNum % NB_POKEMON == 0
|
||||||
@@ -409,10 +411,6 @@ def obtainPokemonSpritePath(id, includeCustoms = true)
|
|||||||
return obtainPokemonSpritePath(body, head, includeCustoms)
|
return obtainPokemonSpritePath(body, head, includeCustoms)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def obtainPokemonSpritePath(bodyId, headId, include_customs = true)
|
def obtainPokemonSpritePath(bodyId, headId, include_customs = true)
|
||||||
download_pokemon_sprite_if_missing(bodyId, headId)
|
download_pokemon_sprite_if_missing(bodyId, headId)
|
||||||
picturePath = _INTL("Graphics/Battlers/{1}/{1}.{2}.png", headId, bodyId)
|
picturePath = _INTL("Graphics/Battlers/{1}/{1}.{2}.png", headId, bodyId)
|
||||||
@@ -443,7 +441,6 @@ def checkIfCustomSpriteExistsByPath(path)
|
|||||||
return true if pbResolveBitmap(path) != nil
|
return true if pbResolveBitmap(path) != nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def customSpriteExistsBodyHead(body, head)
|
def customSpriteExistsBodyHead(body, head)
|
||||||
pathCustom = getCustomSpritePath(body, head)
|
pathCustom = getCustomSpritePath(body, head)
|
||||||
|
|
||||||
@@ -562,8 +559,6 @@ def Kernel.getItemNamesAsString(list)
|
|||||||
return strList
|
return strList
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def Kernel.getPlateType(item)
|
def Kernel.getPlateType(item)
|
||||||
return :FIGHTING if item == PBItems::FISTPLATE
|
return :FIGHTING if item == PBItems::FISTPLATE
|
||||||
return :FLYING if item == PBItems::SKYPLATE
|
return :FLYING if item == PBItems::SKYPLATE
|
||||||
@@ -584,6 +579,7 @@ def Kernel.getPlateType(item)
|
|||||||
return :FAIRY if item == PBItems::PIXIEPLATE
|
return :FAIRY if item == PBItems::PIXIEPLATE
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_default_moves_at_level(species, level)
|
def get_default_moves_at_level(species, level)
|
||||||
moveset = GameData::Species.get(species).moves
|
moveset = GameData::Species.get(species).moves
|
||||||
knowable_moves = []
|
knowable_moves = []
|
||||||
@@ -604,7 +600,6 @@ def get_default_moves_at_level(species,level)
|
|||||||
return moves
|
return moves
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def find_newer_available_version
|
def find_newer_available_version
|
||||||
latest_Version = fetch_latest_game_version
|
latest_Version = fetch_latest_game_version
|
||||||
return nil if !latest_Version
|
return nil if !latest_Version
|
||||||
@@ -644,13 +639,11 @@ def change_game_difficulty(down_only=false)
|
|||||||
message = "The game is currently on " + get_difficulty_text() + " difficulty."
|
message = "The game is currently on " + get_difficulty_text() + " difficulty."
|
||||||
pbMessage(message)
|
pbMessage(message)
|
||||||
|
|
||||||
|
|
||||||
choice_easy = "Easy"
|
choice_easy = "Easy"
|
||||||
choice_normal = "Normal"
|
choice_normal = "Normal"
|
||||||
choice_hard = "Hard"
|
choice_hard = "Hard"
|
||||||
choice_cancel = "Cancel"
|
choice_cancel = "Cancel"
|
||||||
|
|
||||||
|
|
||||||
available_difficulties = []
|
available_difficulties = []
|
||||||
currentDifficulty = get_current_game_difficulty
|
currentDifficulty = get_current_game_difficulty
|
||||||
if down_only
|
if down_only
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1815,7 +1815,7 @@ Pokemon = B109H33,26 #Nidofing,
|
|||||||
[TEAMROCKET_M,Joffrey]
|
[TEAMROCKET_M,Joffrey]
|
||||||
Pokemon = KOFFING,21 #Tentata,
|
Pokemon = KOFFING,21 #Tentata,
|
||||||
Ball = ROCKETBALL
|
Ball = ROCKETBALL
|
||||||
Pokemon = B20H73,23 #Tentaicate,
|
Pokemon = B42H20,23 #RATICATE/GOLBAT,
|
||||||
Ball = ROCKETBALL
|
Ball = ROCKETBALL
|
||||||
########################
|
########################
|
||||||
|
|
||||||
@@ -1843,7 +1843,7 @@ Pokemon = B100H132,26 #Ditorb,
|
|||||||
Moves = TRANSFORM,CHARGEBEAM,LIGHTSCREEN,SONICBOOM
|
Moves = TRANSFORM,CHARGEBEAM,LIGHTSCREEN,SONICBOOM
|
||||||
AbilityIndex = 0
|
AbilityIndex = 0
|
||||||
Ball = ROCKETBALL
|
Ball = ROCKETBALL
|
||||||
Pokemon = B147H88,25 #Gritini,
|
Pokemon = B89h42,25 #muk / golbat,
|
||||||
Ball = ROCKETBALL
|
Ball = ROCKETBALL
|
||||||
#######################
|
#######################
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user