diff --git a/Data/Actors.rxdata b/Data/Actors.rxdata index 7967a5432..41edc8e26 100644 Binary files a/Data/Actors.rxdata and b/Data/Actors.rxdata differ diff --git a/Data/Animations.rxdata b/Data/Animations.rxdata index 8e67182ba..826e1e8a6 100644 Binary files a/Data/Animations.rxdata and b/Data/Animations.rxdata differ diff --git a/Data/Armors.rxdata b/Data/Armors.rxdata index 2249bec14..901f2bb2b 100644 Binary files a/Data/Armors.rxdata and b/Data/Armors.rxdata differ diff --git a/Data/CommonEvents.rxdata b/Data/CommonEvents.rxdata index 22a06f68e..eba36f0b2 100644 Binary files a/Data/CommonEvents.rxdata and b/Data/CommonEvents.rxdata differ diff --git a/Data/Enemies.rxdata b/Data/Enemies.rxdata index 004ee903d..be622f513 100644 Binary files a/Data/Enemies.rxdata and b/Data/Enemies.rxdata differ diff --git a/Data/Items.rxdata b/Data/Items.rxdata index 3e62ba6d2..fe767fa0b 100644 Binary files a/Data/Items.rxdata and b/Data/Items.rxdata differ diff --git a/Data/MapInfos.rxdata b/Data/MapInfos.rxdata index 86c0a5a97..7c94f3d16 100644 Binary files a/Data/MapInfos.rxdata and b/Data/MapInfos.rxdata differ diff --git a/Data/Scripts/013_Items/004_1_PokeradarUI.rb b/Data/Scripts/013_Items/004_1_PokeradarUI.rb index 2e98d9471..f7c06ffae 100644 --- a/Data/Scripts/013_Items/004_1_PokeradarUI.rb +++ b/Data/Scripts/013_Items/004_1_PokeradarUI.rb @@ -116,8 +116,8 @@ class PokeRadar_UI bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum) headPokeFileName = GameData::Species.icon_filename(headPoke) bitmapPath = sprintf("%s.png", bitmapFileName) - IO.copy_stream(headPokeFileName, bitmapPath) - result_bitmap = AnimatedBitmap.new(bitmapPath) + generated_new_icon = generateFusionIcon(headPokeFileName,bitmapPath) + result_bitmap = generated_new_icon ? AnimatedBitmap.new(bitmapPath) : bitmap1 for i in 0..bitmap1.width-1 for j in ((bitmap1.height / 2) + Settings::FUSION_ICON_SPRITE_OFFSET)..bitmap1.height-1 diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb index 232098a5f..b0ed8b0b1 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/003_Pokemon_Sprites.rb @@ -191,8 +191,8 @@ class PokemonIconSprite < SpriteWrapper bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum) headPokeFileName = GameData::Species.icon_filename(headPoke) bitmapPath = sprintf("%s.png", bitmapFileName) - IO.copy_stream(headPokeFileName, bitmapPath) - result_icon = AnimatedBitmap.new(bitmapPath) + generated_new_icon = generateFusionIcon(headPokeFileName,bitmapPath) + result_icon = generated_new_icon ? AnimatedBitmap.new(bitmapPath) : icon1 for i in 0..icon1.width-1 for j in ((icon1.height / 2) + Settings::FUSION_ICON_SPRITE_OFFSET)..icon1.height-1 diff --git a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb index fe7a82c0f..965d8cfe1 100644 --- a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb +++ b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb @@ -38,8 +38,8 @@ class PokemonBoxIcon < IconSprite bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum) headPokeFileName = GameData::Species.icon_filename(headPoke) bitmapPath = sprintf("%s.png", bitmapFileName) - IO.copy_stream(headPokeFileName, bitmapPath) - result_icon = AnimatedBitmap.new(bitmapPath) + generated_new_icon = generateFusionIcon(headPokeFileName,bitmapPath) + result_icon = generated_new_icon ? AnimatedBitmap.new(bitmapPath) : icon1 for i in 0..icon1.width - 1 for j in ((icon1.height / 2) + Settings::FUSION_ICON_SPRITE_OFFSET)..icon1.height - 1 diff --git a/Data/Scripts/050_AddOns/GeneralUtils.rb b/Data/Scripts/050_AddOns/GeneralUtils.rb index 89b090c8c..8e43e3b42 100644 --- a/Data/Scripts/050_AddOns/GeneralUtils.rb +++ b/Data/Scripts/050_AddOns/GeneralUtils.rb @@ -13,7 +13,7 @@ def pbAddPokemonID(pokemon, level = nil, seeform = true, dontRandomize = false) end #random species if randomized gift pokemon & wild poke if $game_switches[SWITCH_RANDOM_GIFT_POKEMON] && $game_switches[SWITCH_RANDOM_WILD] && !dontRandomize - tryRandomizeGiftPokemon(pokemon,dontRandomize) + tryRandomizeGiftPokemon(pokemon, dontRandomize) end speciesname = PBSpecies.getName(pokemon.species) @@ -38,7 +38,7 @@ def pbAddPokemonID(pokemon_id, level = 1, see_form = true, skip_randomize = fals #random species if randomized gift pokemon & wild poke if $game_switches[SWITCH_RANDOM_GIFT_POKEMON] && $game_switches[SWITCH_RANDOM_WILD] && !skip_randomize - tryRandomizeGiftPokemon(pokemon,skip_randomize) + tryRandomizeGiftPokemon(pokemon, skip_randomize) end pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $Trainer.name, species_name)) @@ -47,13 +47,21 @@ def pbAddPokemonID(pokemon_id, level = 1, see_form = true, skip_randomize = fals return true end +def generateFusionIcon(dexNum, path) + begin + IO.copy_stream(dexNum, path) + return true + rescue + return false + end +end def ensureFusionIconExists directory_name = "Graphics/Pokemon/FusionIcons" Dir.mkdir(directory_name) unless File.exists?(directory_name) end -def addNewTripleFusion(pokemon1,pokemon2,pokemon3,level = 1) +def addNewTripleFusion(pokemon1, pokemon2, pokemon3, level = 1) return if !pokemon1 return if !pokemon2 return if !pokemon3 @@ -64,7 +72,7 @@ def addNewTripleFusion(pokemon1,pokemon2,pokemon3,level = 1) return false end - pokemon = TripleFusion.new(pokemon1,pokemon2,pokemon3,level) + pokemon = TripleFusion.new(pokemon1, pokemon2, pokemon3, level) pokemon.calc_stats pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $Trainer.name, pokemon.name)) pbNicknameAndStore(pokemon) @@ -85,9 +93,8 @@ def pbHasSpecies?(species) return false end - #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) return nil elsif species.is_a?(Symbol) @@ -96,6 +103,7 @@ def getID(pbspecies_unused,species) id = species.dexNum end end + #Check if the Pokemon can learn a TM def CanLearnMove(pokemon, move) species = getID(PBSpecies, pokemon) @@ -138,8 +146,6 @@ def getDexNumberForSpecies(species) return dexNum end - - def getPokemon(dexNum) return GameData::Species.get(dexNum) end @@ -152,7 +158,6 @@ def getSpeciesIdForFusion(head_id, body_id) return (body_id) * Settings::NB_POKEMON + head_id end - #shortcut for using in game events because of script characters limit def dexNum(species) return getDexNumberForSpecies(species) @@ -162,10 +167,9 @@ def isTripleFusion?(num) return num >= Settings::ZAPMOLCUNO_NB end - def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3) if customPokeList.length == 0 - customPokeList = getCustomSpeciesList(false ) + customPokeList = getCustomSpeciesList(false) end randPoke = [] if customPokeList.length >= 5000 @@ -191,11 +195,10 @@ def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customP return randPoke end - -def addShinyStarsToGraphicsArray(imageArray, xPos, yPos, shinyBody, shinyHead, debugShiny, srcx=nil, srcy=nil, width=nil, height=nil, - showSecondStarUnder=false, showSecondStarAbove=false ) - color = debugShiny ? Color.new(0,0,0,255) : nil - imageArray.push(["Graphics/Pictures/shiny",xPos,yPos,srcx,srcy,width,height,color]) +def addShinyStarsToGraphicsArray(imageArray, xPos, yPos, shinyBody, shinyHead, debugShiny, srcx = nil, srcy = nil, width = nil, height = nil, + showSecondStarUnder = false, showSecondStarAbove = false) + color = debugShiny ? Color.new(0, 0, 0, 255) : nil + imageArray.push(["Graphics/Pictures/shiny", xPos, yPos, srcx, srcy, width, height, color]) if shinyBody && shinyHead if showSecondStarUnder yPos += 15 @@ -204,7 +207,7 @@ def addShinyStarsToGraphicsArray(imageArray, xPos, yPos, shinyBody, shinyHead, d else xPos -= 15 end - imageArray.push(["Graphics/Pictures/shiny",xPos,yPos,srcx,srcy,width,height,color]) + imageArray.push(["Graphics/Pictures/shiny", xPos, yPos, srcx, srcy, width, height, color]) end # if onlyOutline # imageArray.push(["Graphics/Pictures/shiny_black",xPos,yPos,srcx,srcy,width,height,color]) @@ -212,7 +215,7 @@ def addShinyStarsToGraphicsArray(imageArray, xPos, yPos, shinyBody, shinyHead, d end -def getRandomCustomFusion(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3, maxBST=300) +def getRandomCustomFusion(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3, maxBST = 300) if customPokeList.length == 0 customPokeList = getCustomSpeciesList() end @@ -235,11 +238,10 @@ def getRandomCustomFusion(returnRandomPokemonIfNoneFound = true, customPokeList return randPoke end - def getBodyID(species) dexNum = getDexNumberForSpecies(species) - if dexNum % NB_POKEMON ==0 - return (dexNum/NB_POKEMON)-1 + if dexNum % NB_POKEMON == 0 + return (dexNum / NB_POKEMON) - 1 end return (dexNum / NB_POKEMON).round end @@ -409,16 +411,12 @@ def obtainPokemonSpritePath(id, includeCustoms = true) return obtainPokemonSpritePath(body, head, includeCustoms) end - - - - 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) - if include_customs && customSpriteExistsBodyHead(bodyId,headId) - pathCustom = getCustomSpritePath(bodyId,headId) + if include_customs && customSpriteExistsBodyHead(bodyId, headId) + pathCustom = getCustomSpritePath(bodyId, headId) if (pbResolveBitmap(pathCustom)) picturePath = pathCustom end @@ -426,14 +424,14 @@ def obtainPokemonSpritePath(bodyId, headId, include_customs = true) return picturePath end -def getCustomSpritePath(body,head) +def getCustomSpritePath(body, head) return _INTL("Graphics/CustomBattlers/indexed/{1}/{1}.{2}.png", head, body) end def customSpriteExists(species) head = getBasePokemonID(species, false) body = getBasePokemonID(species, true) - pathCustom = getCustomSpritePath(body,head) + pathCustom = getCustomSpritePath(body, head) return true if pbResolveBitmap(pathCustom) != nil return download_custom_sprite(head, body) != nil @@ -443,16 +441,15 @@ def checkIfCustomSpriteExistsByPath(path) return true if pbResolveBitmap(path) != nil end - def customSpriteExistsBodyHead(body, head) - pathCustom = getCustomSpritePath(body,head) + pathCustom = getCustomSpritePath(body, head) return true if pbResolveBitmap(pathCustom) != nil return download_custom_sprite(head, body) != nil end -def customSpriteExistsBase(body,head) - pathCustom = getCustomSpritePath(body,head) +def customSpriteExistsBase(body, head) + pathCustom = getCustomSpritePath(body, head) return true if pbResolveBitmap(pathCustom) != nil return download_custom_sprite(head, body) != nil end @@ -521,49 +518,47 @@ def reverseFusionSpecies(species) end def Kernel.getRoamingMap(roamingArrayPos) - curmap=$PokemonGlobal.roamPosition[roamingArrayPos] - mapinfos=$RPGVX ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata") - text= mapinfos[curmap].name#,(curmap==$game_map.map_id) ? _INTL("(this map)") : "") + curmap = $PokemonGlobal.roamPosition[roamingArrayPos] + mapinfos = $RPGVX ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata") + text = mapinfos[curmap].name #,(curmap==$game_map.map_id) ? _INTL("(this map)") : "") return text end def Kernel.listPlatesInBag() list = [] - list << PBItems::FISTPLATE if $PokemonBag.pbQuantity(:FISTPLATE)>=1 - list << PBItems::SKYPLATE if $PokemonBag.pbQuantity(:SKYPLATE)>=1 - list << PBItems::TOXICPLATE if $PokemonBag.pbQuantity(:TOXICPLATE)>=1 - list << PBItems::EARTHPLATE if $PokemonBag.pbQuantity(:EARTHPLATE)>=1 - list << PBItems::STONEPLATE if $PokemonBag.pbQuantity(:STONEPLATE)>=1 - list << PBItems::INSECTPLATE if $PokemonBag.pbQuantity(:INSECTPLATE)>=1 - list << PBItems::SPOOKYPLATE if $PokemonBag.pbQuantity(:SPOOKYPLATE)>=1 - list << PBItems::IRONPLATE if $PokemonBag.pbQuantity(:IRONPLATE)>=1 - list << PBItems::FLAMEPLATE if $PokemonBag.pbQuantity(:FLAMEPLATE)>=1 - list << PBItems::SPLASHPLATE if $PokemonBag.pbQuantity(:SPLASHPLATE)>=1 - list << PBItems::MEADOWPLATE if $PokemonBag.pbQuantity(:MEADOWPLATE)>=1 - list << PBItems::ZAPPLATE if $PokemonBag.pbQuantity(:ZAPPLATE)>=1 - list << PBItems::MINDPLATE if $PokemonBag.pbQuantity(:MINDPLATE)>=1 - list << PBItems::ICICLEPLATE if $PokemonBag.pbQuantity(:ICICLEPLATE)>=1 - list << PBItems::DRACOPLATE if $PokemonBag.pbQuantity(:DRACOPLATE)>=1 - list << PBItems::DREADPLATE if $PokemonBag.pbQuantity(:DREADPLATE)>=1 - list << PBItems::PIXIEPLATE if $PokemonBag.pbQuantity(:PIXIEPLATE)>=1 + list << PBItems::FISTPLATE if $PokemonBag.pbQuantity(:FISTPLATE) >= 1 + list << PBItems::SKYPLATE if $PokemonBag.pbQuantity(:SKYPLATE) >= 1 + list << PBItems::TOXICPLATE if $PokemonBag.pbQuantity(:TOXICPLATE) >= 1 + list << PBItems::EARTHPLATE if $PokemonBag.pbQuantity(:EARTHPLATE) >= 1 + list << PBItems::STONEPLATE if $PokemonBag.pbQuantity(:STONEPLATE) >= 1 + list << PBItems::INSECTPLATE if $PokemonBag.pbQuantity(:INSECTPLATE) >= 1 + list << PBItems::SPOOKYPLATE if $PokemonBag.pbQuantity(:SPOOKYPLATE) >= 1 + list << PBItems::IRONPLATE if $PokemonBag.pbQuantity(:IRONPLATE) >= 1 + list << PBItems::FLAMEPLATE if $PokemonBag.pbQuantity(:FLAMEPLATE) >= 1 + list << PBItems::SPLASHPLATE if $PokemonBag.pbQuantity(:SPLASHPLATE) >= 1 + list << PBItems::MEADOWPLATE if $PokemonBag.pbQuantity(:MEADOWPLATE) >= 1 + list << PBItems::ZAPPLATE if $PokemonBag.pbQuantity(:ZAPPLATE) >= 1 + list << PBItems::MINDPLATE if $PokemonBag.pbQuantity(:MINDPLATE) >= 1 + list << PBItems::ICICLEPLATE if $PokemonBag.pbQuantity(:ICICLEPLATE) >= 1 + list << PBItems::DRACOPLATE if $PokemonBag.pbQuantity(:DRACOPLATE) >= 1 + list << PBItems::DREADPLATE if $PokemonBag.pbQuantity(:DREADPLATE) >= 1 + list << PBItems::PIXIEPLATE if $PokemonBag.pbQuantity(:PIXIEPLATE) >= 1 return list end def Kernel.getItemNamesAsString(list) strList = "" - for i in 0..list.length-1 + for i in 0..list.length - 1 id = list[i] - name =PBItems.getName(id) + name = PBItems.getName(id) strList += name - if i != list.length-1 && list.length > 1 + if i != list.length - 1 && list.length > 1 strList += "," end end return strList end - - def Kernel.getPlateType(item) return :FIGHTING if item == PBItems::FISTPLATE return :FLYING if item == PBItems::SKYPLATE @@ -584,7 +579,8 @@ def Kernel.getPlateType(item) return :FAIRY if item == PBItems::PIXIEPLATE return -1 end -def get_default_moves_at_level(species,level) + +def get_default_moves_at_level(species, level) moveset = GameData::Species.get(species).moves knowable_moves = [] moveset.each { |m| knowable_moves.push(m[1]) if m[0] <= level } @@ -604,11 +600,10 @@ def get_default_moves_at_level(species,level) return moves end - def find_newer_available_version latest_Version = fetch_latest_game_version return nil if !latest_Version - return nil if is_higher_version(Settings::GAME_VERSION_NUMBER,latest_Version) + return nil if is_higher_version(Settings::GAME_VERSION_NUMBER, latest_Version) return latest_Version end @@ -640,28 +635,26 @@ def get_difficulty_text end end -def change_game_difficulty(down_only=false) +def change_game_difficulty(down_only = false) message = "The game is currently on " + get_difficulty_text() + " difficulty." pbMessage(message) - choice_easy = "Easy" choice_normal = "Normal" choice_hard = "Hard" choice_cancel = "Cancel" - available_difficulties = [] - currentDifficulty =get_current_game_difficulty + currentDifficulty = get_current_game_difficulty if down_only if currentDifficulty == :HARD available_difficulties << choice_hard available_difficulties << choice_normal available_difficulties << choice_easy - elsif currentDifficulty ==:NORMAL + elsif currentDifficulty == :NORMAL available_difficulties << choice_normal available_difficulties << choice_easy - elsif currentDifficulty ==:EASY + elsif currentDifficulty == :EASY available_difficulties << choice_easy end else @@ -674,13 +667,13 @@ def change_game_difficulty(down_only=false) choice = available_difficulties[index] case choice when choice_easy - $game_switches[SWITCH_GAME_DIFFICULTY_EASY]=true + $game_switches[SWITCH_GAME_DIFFICULTY_EASY] = true $game_switches[SWITCH_GAME_DIFFICULTY_HARD] = false when choice_normal - $game_switches[SWITCH_GAME_DIFFICULTY_EASY]=false + $game_switches[SWITCH_GAME_DIFFICULTY_EASY] = false $game_switches[SWITCH_GAME_DIFFICULTY_HARD] = false when choice_hard - $game_switches[SWITCH_GAME_DIFFICULTY_EASY]=false + $game_switches[SWITCH_GAME_DIFFICULTY_EASY] = false $game_switches[SWITCH_GAME_DIFFICULTY_HARD] = true when choice_cancel return diff --git a/Data/Skills.rxdata b/Data/Skills.rxdata index 61cba7ea2..a45219f5e 100644 Binary files a/Data/Skills.rxdata and b/Data/Skills.rxdata differ diff --git a/Data/States.rxdata b/Data/States.rxdata index 0f9b4ae5d..868d49e59 100644 Binary files a/Data/States.rxdata and b/Data/States.rxdata differ diff --git a/Data/System.rxdata b/Data/System.rxdata index 019ae5b53..996c4ea20 100644 Binary files a/Data/System.rxdata and b/Data/System.rxdata differ diff --git a/Data/Tilesets.rxdata b/Data/Tilesets.rxdata index 3aeb3d610..328f9c904 100644 Binary files a/Data/Tilesets.rxdata and b/Data/Tilesets.rxdata differ diff --git a/Data/Weapons.rxdata b/Data/Weapons.rxdata index d9bd35260..c7ea19a7a 100644 Binary files a/Data/Weapons.rxdata and b/Data/Weapons.rxdata differ diff --git a/PBS/trainers.txt b/PBS/trainers.txt index c3b344bff..1adf6c945 100644 --- a/PBS/trainers.txt +++ b/PBS/trainers.txt @@ -1815,7 +1815,7 @@ Pokemon = B109H33,26 #Nidofing, [TEAMROCKET_M,Joffrey] Pokemon = KOFFING,21 #Tentata, Ball = ROCKETBALL -Pokemon = B20H73,23 #Tentaicate, +Pokemon = B42H20,23 #RATICATE/GOLBAT, Ball = ROCKETBALL ######################## @@ -1843,7 +1843,7 @@ Pokemon = B100H132,26 #Ditorb, Moves = TRANSFORM,CHARGEBEAM,LIGHTSCREEN,SONICBOOM AbilityIndex = 0 Ball = ROCKETBALL -Pokemon = B147H88,25 #Gritini, +Pokemon = B89h42,25 #muk / golbat, Ball = ROCKETBALL #######################