mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
@@ -216,12 +216,13 @@ class PokemonFusionScene
|
||||
|
||||
def pbChooseAbility(poke, hidden1 = false, hidden2 = false)
|
||||
abilityList = poke.getAbilityList
|
||||
|
||||
if $game_switches[SWITCH_DOUBLE_ABILITIES]
|
||||
abID1 = @pokemon1.ability
|
||||
abID2 = @pokemon2.ability
|
||||
else
|
||||
abID1 = hidden1 ? abilityList[-2][0] : abilityList[0][0]
|
||||
abID2 = hidden2 ? abilityList[-1][0] : abilityList[1][0]
|
||||
abID1 = hidden1 ? abilityList[4][0] : abilityList[0][0]
|
||||
abID2 = hidden2 ? abilityList[5][0] : abilityList[1][0]
|
||||
end
|
||||
availableNatures = []
|
||||
availableNatures << @pokemon1.nature
|
||||
|
||||
@@ -81,19 +81,6 @@ class FusionTutorService
|
||||
@show_full_list = value
|
||||
end
|
||||
|
||||
#todo: these moves
|
||||
# DRAGONHAMMER
|
||||
# FIRELASH
|
||||
# BEAKBLAST
|
||||
# CHATTER
|
||||
# SOLARBLADE
|
||||
# LEAFAGE
|
||||
# HEADCHARGE
|
||||
# HYPERSPACEHOLE
|
||||
# HOLDBACK
|
||||
# CELEBRATE
|
||||
# HEARTSWAP
|
||||
|
||||
def getCompatibleMoves(includeLegendaries = false)
|
||||
compatibleMoves = []
|
||||
#normal moves
|
||||
@@ -115,7 +102,7 @@ class FusionTutorService
|
||||
compatibleMoves << :ELECTRIFY if is_fusion_of([:KLINK, :KLANG, :KLINKLANG]) || hasType(:ELECTRIC)
|
||||
compatibleMoves << :AROMATICMIST if is_fusion_of([:WEEZING, :BULBASAUR, :IVYSAUR, :VENUSAUR, :CHIKORITA, :BAYLEEF, :MEGANIUM, :GLOOM, :VILEPLUME, :BELLOSSOM, :ROSELIA, :ROSERADE])
|
||||
compatibleMoves << :FLORALHEALING if is_fusion_of([:SUNFLORA, :BELLOSSOM, :ROSELIA, :ROSERADE])
|
||||
#compatibleMoves << :FLYINGPRESS if is_fusion_of([:TORCHIC, :COMBUSKEN, :BLAZIKEN, :FARFETCHD, :HERACROSS]) || (hasType(:FLYING) && hasType(:FIGHTING))
|
||||
compatibleMoves << :FLYINGPRESS if is_fusion_of([:TORCHIC, :COMBUSKEN, :BLAZIKEN, :FARFETCHD, :HERACROSS]) || (hasType(:FLYING) && hasType(:FIGHTING))
|
||||
compatibleMoves << :SECRETSWORD if is_fusion_of([:HONEDGE, :DOUBLADE, :AEGISLASH, :GALLADE, :FARFETCHD, :ABSOL, :BISHARP])
|
||||
compatibleMoves << :MATBLOCK if is_fusion_of([:MACHOP, :MACHOKE, :MACHAMP, :TYROGUE, :HITMONLEE, :HITMONCHAN, :HITMONTOP])
|
||||
compatibleMoves << :MINDBLOWN if is_fusion_of([:VOLTORB, :ELECTRODE, :EXEGGUTOR])
|
||||
@@ -125,22 +112,22 @@ class FusionTutorService
|
||||
compatibleMoves << :SPIRITSHACKLE if is_fusion_of([:BANETTE, :SPIRITOMB, :DUSKNOIR, :SHEDINJA, :COFAGRIGUS])
|
||||
compatibleMoves << :TRICKORTREAT if (hasType(:GRASS) && hasType(:GHOST)) || is_fusion_of([:GASTLY, :HAUNTER, :GENGAR, :MIMIKYU, :ZORUA, :ZOROARK])
|
||||
compatibleMoves << :TROPKICK if is_fusion_of([:HITMONLEE, :HITMONTOP, :ROSERADE]) || (hasType(:GRASS) && hasType(:FIGHTING))
|
||||
#compatibleMoves << :NEEDLEARM if is_fusion_of([:FERROTHORN])
|
||||
#compatibleMoves << :FORESTSCURSE if (hasType(:GRASS) && hasType(:GHOST))
|
||||
#compatibleMoves << :SPIKYSHIELD if is_fusion_of([:FERROSEED, :FERROTHORN]) || (is_fusion_of([:SANDSLASH, :JOLTEON, :CLOYSTER]) && hasType(:GRASS))
|
||||
compatibleMoves << :NEEDLEARM if is_fusion_of([:FERROTHORN])
|
||||
compatibleMoves << :FORESTSCURSE if (hasType(:GRASS) && hasType(:GHOST))
|
||||
compatibleMoves << :SPIKYSHIELD if is_fusion_of([:FERROSEED, :FERROTHORN]) || (is_fusion_of([:SANDSLASH, :JOLTEON, :CLOYSTER]) && hasType(:GRASS))
|
||||
compatibleMoves << :STRENGTHSAP if is_fusion_of([:ODDISH, :GLOOM, :VILEPLUME, :BELLOSSOM, :HOPPIP, :SKIPLOOM, :JUMPLUFF, :BELLSPROUT, :WEEPINBELL, :VICTREEBEL, :PARAS, :PARASECT, :DRIFBLIM, :BRELOOM])
|
||||
#compatibleMoves << :SHOREUP if is_fusion_of([:GRIMER, :MUK]) && hasType(:GROUND)
|
||||
compatibleMoves << :ICEHAMMER if (canLearnMove(:CRABHAMMER) || canLearnMove(:GRASSHAMMER) || canLearnMove(:HAMMERARM)) && hasType(:ICE)
|
||||
compatibleMoves << :SHOREUP if is_fusion_of([:GRIMER, :MUK]) && hasType(:GROUND)
|
||||
compatibleMoves << :ICEHAMMER if (canLearnMove(:CRABHAMMER) || canLearnMove(:GRASSHAMMER)) && hasType(:ICE)
|
||||
compatibleMoves << :MULTIATTACK if is_fusion_of([:ARCEUS, :MEW, :GENESECT])
|
||||
# compatibleMoves << :REVELATIONDANCE if is_fusion_of([:KECLEON, :BELLOSSOM, :CLEFAIRY, :CLEFABLE, :CLEFFA])
|
||||
#compatibleMoves << :BANEFULBUNKER if is_fusion_of([:TENTACOOL, :TENTACRUEL, :NIDORINA, :NIDORINO, :NIDOQUEEN, :NIDOKING, :GRIMER, :MUK, :QWILFISH])
|
||||
compatibleMoves << :REVELATIONDANCE if is_fusion_of([:KECLEON, :BELLOSSOM, :CLEFAIRY, :CLEFABLE, :CLEFFA])
|
||||
compatibleMoves << :BANEFULBUNKER if is_fusion_of([:TENTACOOL, :TENTACRUEL, :NIDORINA, :NIDORINO, :NIDOQUEEN, :NIDOKING, :GRIMER, :MUK, :QWILFISH])
|
||||
compatibleMoves << :INSTRUCT if is_fusion_of([:CHIMCHAR, :MONFERNO, :INFERNAPE, :KADABRA, :ALAKAZAM, :SLOWKING])
|
||||
compatibleMoves << :PSYCHICTERRAIN if hasType(:PSYCHIC)
|
||||
#compatibleMoves << :GRASSYTERRAIN if hasType(:GRASS)
|
||||
compatibleMoves << :GRASSYTERRAIN if hasType(:GRASS)
|
||||
compatibleMoves << :MISTYTERRAIN if hasType(:FAIRY)
|
||||
compatibleMoves << :SPEEDSWAP if is_fusion_of([:PIKACHU, :RAICHU, :ABRA, :KADABRA, :ALAKAZAM, :PORYGON, :PORYGON2, :PORYGONZ, :MEWTWO, :MEW, :JOLTIK, :GALVANTULA])
|
||||
#compatibleMoves << :ACCELEROCK if is_fusion_of([:AERODACTYL, :KABUTOPS, :ANORITH, :ARMALDO])
|
||||
#compatibleMoves << :ANCHORSHOT if (is_fusion_of([:EMPOLEON, :STEELIX, :BELDUM, :METANG, :METAGROSS, :KLINK, :KLINKLANG, :KLANG, :ARON, :LAIRON, :AGGRON]) && hasType(:WATER)) || (is_fusion_of([:LAPRAS, :WAILORD, :KYOGRE]) && hasType(:STEEL))
|
||||
compatibleMoves << :ACCELEROCK if is_fusion_of([:AERODACTYL, :KABUTOPS, :ANORITH, :ARMALDO])
|
||||
compatibleMoves << :ANCHORSHOT if (is_fusion_of([:EMPOLEON, :STEELIX, :BELDUM, :METANG, :METAGROSS, :KLINK, :KLINKLANG, :KLANG, :ARON, :LAIRON, :AGGRON]) && hasType(:WATER)) || (is_fusion_of([:LAPRAS, :WAILORD, :KYOGRE]) && hasType(:STEEL))
|
||||
compatibleMoves << :SPARKLINGARIA if (is_fusion_of([:JYNX, :JIGGLYPUFF, :WIGGLYTUFF]) && hasType(:WATER)) || is_fusion_of([:LAPRAS])
|
||||
compatibleMoves << :WATERSHURIKEN if is_fusion_of([:NINJASK, :LUCARIO, :ZOROARK, :BISHARP]) && hasType(:WATER)
|
||||
end
|
||||
@@ -168,8 +155,8 @@ class FusionTutorService
|
||||
compatibleMoves << :RELICSONG if is_fusion_of([:JYNX, :LAPRAS, :JIGGLYPUFF, :WIGGLYTUFF, :MISDREAVUS, :MISMAGIUS])
|
||||
compatibleMoves << :HAPPYHOUR if is_fusion_of([:MEOWTH, :JIRACHI, :DELIBIRD, :MUNCHLAX, :SNORLAX, :PIKACHU, :RAICHU])
|
||||
compatibleMoves << :HOLDHANDS if is_fusion_of([:CHARMANDER, :BULBASAUR, :SQUIRTLE, :PIKACHU, :TOGEPI])
|
||||
#compatibleMoves << :PRISMATICLASER if is_fusion_of([:LANTURN, :AMPHAROS, :HOOH, :DEOXYS, :MEWTWO, :MEW]) && hasType(:PSYCHIC)
|
||||
#compatibleMoves << :PHOTONGEYSER if is_fusion_of([:LANTURN, :AMPHAROS, :HOOH, :MEW, :MEWTWO, :DEOXYS]) && hasType(:PSYCHIC)
|
||||
compatibleMoves << :PRISMATICLASER if is_fusion_of([:LANTURN, :AMPHAROS, :HOOH, :DEOXYS, :MEWTWO, :MEW]) && hasType(:PSYCHIC)
|
||||
compatibleMoves << :PHOTONGEYSER if is_fusion_of([:LANTURN, :AMPHAROS, :HOOH, :MEW, :MEWTWO, :DEOXYS]) && hasType(:PSYCHIC)
|
||||
compatibleMoves << :LUNARDANCE if is_fusion_of([:CLEFAIRY, :CLEFABLE, :STARYU, :STARMIE])
|
||||
compatibleMoves << :DIAMONDSTORM if ((hasType(:FAIRY) && hasType(:ROCK)) || (hasType(:ROCK) && hasType(:STEEL))) || is_fusion_of([:DIALGA, :STEELIX])
|
||||
compatibleMoves << :SUNSTEELSTRIKE if is_fusion_of([:CHARIZARD, :VOLCARONA, :FLAREON, :NINETALES, :ENTEI, :HOOH, :RAPIDASH]) && hasType(:STEEL)
|
||||
|
||||
@@ -5,26 +5,26 @@ module GameData
|
||||
species = GameData::Species.get(species).id_number # Just to be sure it's a number
|
||||
return self.egg_sprite_bitmap(species, pkmn.form) if pkmn.egg?
|
||||
if back
|
||||
ret = self.back_sprite_bitmap(species, pkmn.spriteform_body, pkmn.spriteform_head, pkmn.shiny?, pkmn.bodyShiny?, pkmn.headShiny?)
|
||||
ret = self.back_sprite_bitmap(species, nil, nil, pkmn.shiny?,pkmn.bodyShiny?,pkmn.headShiny?)
|
||||
else
|
||||
ret = self.front_sprite_bitmap(species, pkmn.spriteform_body, pkmn.spriteform_head, pkmn.shiny?, pkmn.bodyShiny?, pkmn.headShiny?)
|
||||
ret = self.front_sprite_bitmap(species, nil, nil, pkmn.shiny?,pkmn.bodyShiny?,pkmn.headShiny?)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
def self.sprite_bitmap_from_pokemon_id(id, back = false, shiny = false, bodyShiny = false, headShiny = false)
|
||||
def self.sprite_bitmap_from_pokemon_id(id, back = false, shiny=false, bodyShiny=false,headShiny=false)
|
||||
if back
|
||||
ret = self.back_sprite_bitmap(id, nil, nil, shiny, bodyShiny, headShiny)
|
||||
ret = self.back_sprite_bitmap(id,nil,nil,shiny,bodyShiny,headShiny)
|
||||
else
|
||||
ret = self.front_sprite_bitmap(id, nil, nil, shiny, bodyShiny, headShiny)
|
||||
ret = self.front_sprite_bitmap(id,nil,nil,shiny,bodyShiny,headShiny)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
MAX_SHIFT_VALUE = 360
|
||||
MINIMUM_OFFSET = 40
|
||||
ADDITIONAL_OFFSET_WHEN_TOO_CLOSE = 40
|
||||
MINIMUM_DEX_DIF = 20
|
||||
MINIMUM_OFFSET=40
|
||||
ADDITIONAL_OFFSET_WHEN_TOO_CLOSE=40
|
||||
MINIMUM_DEX_DIF=20
|
||||
|
||||
def self.calculateShinyHueOffset(dex_number, isBodyShiny = false, isHeadShiny = false)
|
||||
if dex_number <= NB_POKEMON
|
||||
@@ -32,35 +32,36 @@ module GameData
|
||||
return SHINY_COLOR_OFFSETS[dex_number]
|
||||
end
|
||||
body_number = dex_number
|
||||
head_number = dex_number
|
||||
head_number=dex_number
|
||||
|
||||
else
|
||||
else
|
||||
body_number = getBodyID(dex_number)
|
||||
head_number = getHeadID(dex_number, body_number)
|
||||
head_number=getHeadID(dex_number,body_number)
|
||||
end
|
||||
if isBodyShiny && isHeadShiny && SHINY_COLOR_OFFSETS[body_number] && SHINY_COLOR_OFFSETS[head_number]
|
||||
if isBodyShiny && isHeadShiny && SHINY_COLOR_OFFSETS[body_number] && SHINY_COLOR_OFFSETS[head_number]
|
||||
offset = SHINY_COLOR_OFFSETS[body_number] + SHINY_COLOR_OFFSETS[head_number]
|
||||
elsif isHeadShiny && SHINY_COLOR_OFFSETS[head_number]
|
||||
offset = SHINY_COLOR_OFFSETS[head_number]
|
||||
elsif isBodyShiny && SHINY_COLOR_OFFSETS[body_number]
|
||||
offset = SHINY_COLOR_OFFSETS[body_number]
|
||||
else
|
||||
offset = calculateShinyHueOffsetDefaultMethod(body_number, head_number, dex_number, isBodyShiny, isHeadShiny)
|
||||
offset = calculateShinyHueOffsetDefaultMethod(body_number,head_number,dex_number,isBodyShiny,isHeadShiny)
|
||||
end
|
||||
return offset
|
||||
end
|
||||
|
||||
def self.calculateShinyHueOffsetDefaultMethod(body_number, head_number, dex_number, isBodyShiny = false, isHeadShiny = false)
|
||||
|
||||
def self.calculateShinyHueOffsetDefaultMethod(body_number,head_number,dex_number, isBodyShiny = false, isHeadShiny = false)
|
||||
dex_offset = dex_number
|
||||
#body_number = getBodyID(dex_number)
|
||||
#head_number=getHeadID(dex_number,body_number)
|
||||
dex_diff = (body_number - head_number).abs
|
||||
dex_diff = (body_number-head_number).abs
|
||||
if isBodyShiny && isHeadShiny
|
||||
dex_offset = dex_number
|
||||
elsif isHeadShiny
|
||||
dex_offset = head_number
|
||||
elsif isBodyShiny
|
||||
dex_offset = dex_diff > MINIMUM_DEX_DIF ? body_number : body_number + ADDITIONAL_OFFSET_WHEN_TOO_CLOSE
|
||||
dex_offset = dex_diff > MINIMUM_DEX_DIF ? body_number : body_number+ADDITIONAL_OFFSET_WHEN_TOO_CLOSE
|
||||
end
|
||||
offset = dex_offset + Settings::SHINY_HUE_OFFSET
|
||||
offset /= MAX_SHIFT_VALUE if offset > NB_POKEMON
|
||||
@@ -70,15 +71,21 @@ module GameData
|
||||
return offset
|
||||
end
|
||||
|
||||
def self.front_sprite_bitmap(dex_number, spriteform_body = nil, spriteform_head = nil, isShiny = false, bodyShiny = false, headShiny = false)
|
||||
spriteform_body = nil if spriteform_body == 0
|
||||
spriteform_head = nil if spriteform_head == 0
|
||||
|
||||
def self.front_sprite_bitmap(dex_number, a = 0, b = 0, isShiny = false, bodyShiny = false, headShiny = false)
|
||||
#la méthode est utilisé ailleurs avec d'autres arguments (gender, form, etc.) mais on les veut pas
|
||||
if dex_number.is_a?(Symbol)
|
||||
dex_number = GameData::Species.get(dex_number).id_number
|
||||
end
|
||||
filename = self.sprite_filename(dex_number, spriteform_body, spriteform_head)
|
||||
filename = self.sprite_filename(dex_number)
|
||||
sprite = (filename) ? AnimatedBitmap.new(filename) : nil
|
||||
if isShiny
|
||||
sprite.shiftColors(self.calculateShinyHueOffset(dex_number, bodyShiny, headShiny))
|
||||
end
|
||||
return sprite
|
||||
end
|
||||
|
||||
def self.back_sprite_bitmap(dex_number, b = 0, form = 0, isShiny = false, bodyShiny = false, headShiny = false)
|
||||
filename = self.sprite_filename(dex_number)
|
||||
sprite = (filename) ? AnimatedBitmap.new(filename) : nil
|
||||
if isShiny
|
||||
sprite.shiftColors(self.calculateShinyHueOffset(dex_number, bodyShiny, headShiny))
|
||||
@@ -86,16 +93,7 @@ module GameData
|
||||
return sprite
|
||||
end
|
||||
|
||||
def self.back_sprite_bitmap(dex_number, spriteform_body = nil, spriteform_head = nil, isShiny = false, bodyShiny = false, headShiny = false)
|
||||
filename = self.sprite_filename(dex_number, spriteform_body, spriteform_head)
|
||||
sprite = (filename) ? AnimatedBitmap.new(filename) : nil
|
||||
if isShiny
|
||||
sprite.shiftColors(self.calculateShinyHueOffset(dex_number, bodyShiny, headShiny))
|
||||
end
|
||||
return sprite
|
||||
end
|
||||
|
||||
def self.egg_sprite_bitmap(dex_number, form = nil)
|
||||
def self.egg_sprite_bitmap(dex_number, form = 0)
|
||||
filename = self.egg_sprite_filename(dex_number, form)
|
||||
return (filename) ? AnimatedBitmap.new(filename) : nil
|
||||
end
|
||||
@@ -103,9 +101,7 @@ module GameData
|
||||
def self.getSpecialSpriteName(dexNum)
|
||||
base_path = "Graphics/Battlers/special/"
|
||||
case dexNum
|
||||
when Settings::ZAPMOLCUNO_NB
|
||||
return sprintf(base_path + "144.145.146")
|
||||
when Settings::ZAPMOLCUNO_NB + 1
|
||||
when Settings::ZAPMOLCUNO_NB..Settings::ZAPMOLCUNO_NB + 1
|
||||
return sprintf(base_path + "144.145.146")
|
||||
when Settings::ZAPMOLCUNO_NB + 2
|
||||
return sprintf(base_path + "243.244.245")
|
||||
@@ -157,37 +153,24 @@ module GameData
|
||||
return sprintf(base_path +"343.344.345")
|
||||
when Settings::ZAPMOLCUNO_NB + 25 #sinnohboss right
|
||||
return sprintf(base_path +"invisible")
|
||||
when Settings::ZAPMOLCUNO_NB + 25 #cardboard
|
||||
return sprintf(base_path +"invisible")
|
||||
when Settings::ZAPMOLCUNO_NB + 26 #cardboard
|
||||
return sprintf(base_path + "cardboard")
|
||||
when Settings::ZAPMOLCUNO_NB + 27 #Triple regi
|
||||
return sprintf(base_path + "447.448.449")
|
||||
else
|
||||
return sprintf(base_path + "000")
|
||||
end
|
||||
end
|
||||
|
||||
def self.sprite_filename(dex_number, spriteform_body = nil, spriteform_head = nil)
|
||||
#dex_number = GameData::NAT_DEX_MAPPING[dex_number] ? GameData::NAT_DEX_MAPPING[dex_number] : dex_number
|
||||
if dex_number.is_a?(GameData::Species)
|
||||
dex_number = dex_number.id_number
|
||||
end
|
||||
if dex_number.is_a?(Symbol)
|
||||
dex_number = getDexNumberForSpecies(dex_number)
|
||||
end
|
||||
def self.sprite_filename(dex_number)
|
||||
return nil if dex_number == nil
|
||||
if dex_number <= Settings::NB_POKEMON
|
||||
return get_unfused_sprite_path(dex_number, spriteform_body)
|
||||
return get_unfused_sprite_path(dex_number)
|
||||
else
|
||||
if dex_number >= Settings::ZAPMOLCUNO_NB
|
||||
specialPath = getSpecialSpriteName(dex_number)
|
||||
return pbResolveBitmap(specialPath)
|
||||
head_id = nil
|
||||
head_id=nil
|
||||
else
|
||||
body_id = getBodyID(dex_number)
|
||||
head_id = getHeadID(dex_number, body_id)
|
||||
return get_fusion_sprite_path(head_id, body_id, spriteform_body, spriteform_head)
|
||||
return get_fusion_sprite_path(head_id,body_id)
|
||||
# folder = head_id.to_s
|
||||
# filename = sprintf("%s.%s.png", head_id, body_id)
|
||||
end
|
||||
@@ -207,161 +190,47 @@ module GameData
|
||||
end
|
||||
end
|
||||
|
||||
def get_unfused_sprite_path(dex_number_id, spriteform = nil)
|
||||
dex_number = dex_number_id.to_s
|
||||
spriteform_letter = spriteform ? "_" + spriteform.to_s : ""
|
||||
def get_unfused_sprite_path(dex_number)
|
||||
folder = dex_number.to_s
|
||||
substitution_id = _INTL("{1}{2}", dex_number, spriteform_letter)
|
||||
filename = sprintf("%s.png", dex_number)
|
||||
|
||||
if alt_sprites_substitutions_available && $PokemonGlobal.alt_sprite_substitutions.keys.include?(substitution_id)
|
||||
substitutionPath = $PokemonGlobal.alt_sprite_substitutions[substitution_id]
|
||||
return substitutionPath if pbResolveBitmap(substitutionPath)
|
||||
if alt_sprites_substitutions_available && $PokemonGlobal.alt_sprite_substitutions.keys.include?(dex_number)
|
||||
return $PokemonGlobal.alt_sprite_substitutions[dex_number]
|
||||
end
|
||||
random_alt = get_random_alt_letter_for_unfused(dex_number, true) #nil if no main
|
||||
random_alt = "" if !random_alt
|
||||
|
||||
|
||||
filename = _INTL("{1}{2}{3}.png", dex_number, spriteform_letter,random_alt)
|
||||
|
||||
normal_path = Settings::BATTLERS_FOLDER + folder + spriteform_letter + "/" + filename
|
||||
normal_path = Settings::BATTLERS_FOLDER + folder + "/" + filename
|
||||
lightmode_path = Settings::BATTLERS_FOLDER + filename
|
||||
|
||||
path = random_alt == "" ? normal_path : lightmode_path
|
||||
|
||||
if pbResolveBitmap(path)
|
||||
record_sprite_substitution(substitution_id,path)
|
||||
return path
|
||||
end
|
||||
downloaded_path = download_unfused_main_sprite(dex_number, random_alt)
|
||||
if pbResolveBitmap(downloaded_path)
|
||||
record_sprite_substitution(substitution_id,downloaded_path)
|
||||
return downloaded_path
|
||||
end
|
||||
return normal_path
|
||||
return normal_path if pbResolveBitmap(normal_path)
|
||||
return lightmode_path
|
||||
end
|
||||
|
||||
def alt_sprites_substitutions_available
|
||||
return $PokemonGlobal && $PokemonGlobal.alt_sprite_substitutions
|
||||
end
|
||||
|
||||
def print_stack_trace
|
||||
stack_trace = caller
|
||||
stack_trace.each_with_index do |call, index|
|
||||
echo("#{index + 1}: #{call}")
|
||||
end
|
||||
end
|
||||
|
||||
def record_sprite_substitution(substitution_id, sprite_name)
|
||||
return if !$PokemonGlobal
|
||||
return if !$PokemonGlobal.alt_sprite_substitutions
|
||||
$PokemonGlobal.alt_sprite_substitutions[substitution_id] = sprite_name
|
||||
end
|
||||
|
||||
def get_fusion_sprite_path(head_id, body_id, spriteform_body = nil, spriteform_head = nil)
|
||||
#Todo: ça va chier si on fusionne une forme d'un pokemon avec une autre forme, mais pas un problème pour tout de suite
|
||||
form_suffix = ""
|
||||
form_suffix += "_" + spriteform_body.to_s if spriteform_body
|
||||
form_suffix += "_" + spriteform_head.to_s if spriteform_head
|
||||
|
||||
def get_fusion_sprite_path(head_id,body_id)
|
||||
#Swap path if alt is selected for this pokemon
|
||||
dex_num = getSpeciesIdForFusion(head_id, body_id)
|
||||
substitution_id = dex_num.to_s + form_suffix
|
||||
|
||||
|
||||
if alt_sprites_substitutions_available && $PokemonGlobal.alt_sprite_substitutions.keys.include?(substitution_id)
|
||||
substitutionPath= $PokemonGlobal.alt_sprite_substitutions[substitution_id]
|
||||
return substitutionPath if pbResolveBitmap(substitutionPath)
|
||||
dex_num = getSpeciesIdForFusion(head_id,body_id)
|
||||
if alt_sprites_substitutions_available && $PokemonGlobal.alt_sprite_substitutions.keys.include?(dex_num)
|
||||
return $PokemonGlobal.alt_sprite_substitutions[dex_num]
|
||||
end
|
||||
|
||||
random_alt = get_random_alt_letter_for_custom(head_id, body_id) #nil if no main
|
||||
random_alt = "" if !random_alt
|
||||
|
||||
#Try local custom sprite
|
||||
spriteform_body_letter = spriteform_body ? "_" + spriteform_body.to_s : ""
|
||||
spriteform_head_letter = spriteform_head ? "_" + spriteform_head.to_s : ""
|
||||
filename = sprintf("%s.%s.png", head_id, body_id)
|
||||
local_custom_path = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + head_id.to_s + "/" +filename
|
||||
return local_custom_path if pbResolveBitmap(local_custom_path)
|
||||
|
||||
filename = _INTL("{1}{2}.{3}{4}{5}.png", head_id, spriteform_head_letter, body_id, spriteform_body_letter, random_alt)
|
||||
local_custom_path = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + head_id.to_s + spriteform_head_letter + "/" + filename
|
||||
if pbResolveBitmap(local_custom_path)
|
||||
record_sprite_substitution(substitution_id, local_custom_path)
|
||||
return local_custom_path
|
||||
end
|
||||
#Try to download custom sprite if none found locally
|
||||
downloaded_custom = download_custom_sprite(head_id, body_id, spriteform_body_letter, spriteform_head_letter, random_alt)
|
||||
if downloaded_custom
|
||||
record_sprite_substitution(substitution_id, downloaded_custom)
|
||||
return downloaded_custom
|
||||
end
|
||||
downloaded_custom = download_custom_sprite(head_id,body_id)
|
||||
return downloaded_custom if downloaded_custom
|
||||
|
||||
#Try local generated sprite
|
||||
local_generated_path = Settings::BATTLERS_FOLDER + head_id.to_s + spriteform_head_letter + "/" + filename
|
||||
local_generated_path = Settings::BATTLERS_FOLDER + head_id.to_s + "/" + filename
|
||||
return local_generated_path if pbResolveBitmap(local_generated_path)
|
||||
|
||||
#Download generated sprite if nothing else found
|
||||
autogen_path = download_autogen_sprite(head_id, body_id)
|
||||
#Download generate sprite if nothing else found
|
||||
autogen_path= download_autogen_sprite(head_id,body_id)
|
||||
return autogen_path if pbResolveBitmap(autogen_path)
|
||||
|
||||
return Settings::DEFAULT_SPRITE_PATH
|
||||
end
|
||||
|
||||
def get_random_alt_letter_for_custom(head_id, body_id, onlyMain = true)
|
||||
spriteName = _INTL("{1}.{2}", head_id, body_id)
|
||||
if onlyMain
|
||||
return list_main_sprites_letters(spriteName).sample
|
||||
else
|
||||
return list_all_sprites_letters(spriteName).sample
|
||||
end
|
||||
end
|
||||
|
||||
def get_random_alt_letter_for_unfused(dex_num, onlyMain = true)
|
||||
spriteName = _INTL("{1}", dex_num)
|
||||
if onlyMain
|
||||
letters_list= list_main_sprites_letters(spriteName)
|
||||
else
|
||||
letters_list= list_all_sprites_letters(spriteName)
|
||||
end
|
||||
letters_list << "" #add main sprite
|
||||
return letters_list.sample
|
||||
end
|
||||
|
||||
def list_main_sprites_letters(spriteName)
|
||||
all_sprites = map_alt_sprite_letters_for_pokemon(spriteName)
|
||||
main_sprites = []
|
||||
all_sprites.each do |key, value|
|
||||
main_sprites << key if value == "main"
|
||||
end
|
||||
return main_sprites
|
||||
end
|
||||
|
||||
def list_all_sprites_letters(spriteName)
|
||||
all_sprites_map = map_alt_sprite_letters_for_pokemon(spriteName)
|
||||
letters = []
|
||||
all_sprites_map.each do |key, value|
|
||||
letters << key
|
||||
end
|
||||
return letters
|
||||
end
|
||||
|
||||
def list_alt_sprite_letters(spriteName)
|
||||
all_sprites = map_alt_sprite_letters_for_pokemon(spriteName)
|
||||
alt_sprites = []
|
||||
all_sprites.each do |key, value|
|
||||
alt_sprites << key if value == "alt"
|
||||
end
|
||||
end
|
||||
|
||||
def map_alt_sprite_letters_for_pokemon(spriteName)
|
||||
alt_sprites = {}
|
||||
File.foreach(Settings::CREDITS_FILE_PATH) do |line|
|
||||
row = line.split(',')
|
||||
sprite_name = row[0]
|
||||
if sprite_name.start_with?(spriteName) && sprite_name.length > spriteName.length
|
||||
letter = sprite_name[spriteName.length]
|
||||
if letter.match?(/[a-zA-Z]/)
|
||||
main_or_alt = row[2] ? row[2] : nil
|
||||
alt_sprites[letter] = main_or_alt
|
||||
end
|
||||
end
|
||||
end
|
||||
return alt_sprites
|
||||
end
|
||||
@@ -1,702 +0,0 @@
|
||||
#todo: make the flower disappear from the tileset somehow?
|
||||
def oricorioEventPickFlower(flower_color)
|
||||
quest_progression = pbGet(VAR_ORICORIO_FLOWERS)
|
||||
if flower_color == :PINK
|
||||
$game_switches[SWITCH_ORICORIO_QUEST_PINK] = true
|
||||
pbMessage(_INTL("It's a flower with pink nectar."))
|
||||
pbSEPlay("MiningAllFound")
|
||||
pbMessage(_INTL("{1} picked some of the pink flowers.", $Trainer.name))
|
||||
elsif flower_color == :RED && quest_progression == 1
|
||||
$game_switches[SWITCH_ORICORIO_QUEST_RED] = true
|
||||
pbMessage(_INTL("It's a flower with red nectar."))
|
||||
pbSEPlay("MiningAllFound")
|
||||
pbMessage(_INTL("{1} picked some of the red flowers.", $Trainer.name))
|
||||
elsif flower_color == :BLUE && quest_progression == 2
|
||||
$game_switches[SWITCH_ORICORIO_QUEST_BLUE] = true
|
||||
pbMessage(_INTL("It's a flower with blue nectar."))
|
||||
pbSEPlay("MiningAllFound")
|
||||
pbMessage(_INTL("{1} picked some of the blue flowers.", $Trainer.name))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def changeOricorioFlower(form = 1)
|
||||
return if !($Trainer.has_species_or_fusion?(:ORICORIO_1) || $Trainer.has_species_or_fusion?(:ORICORIO_2) || $Trainer.has_species_or_fusion?(:ORICORIO_3) || $Trainer.has_species_or_fusion?(:ORICORIO_4))
|
||||
message = ""
|
||||
form_name = ""
|
||||
if form == 1
|
||||
message = "It's a flower with red nectar. "
|
||||
form_name = "Baile"
|
||||
elsif form == 2
|
||||
message = "It's a flower with yellow nectar. "
|
||||
form_name = "Pom-pom"
|
||||
elsif form == 3
|
||||
message = "It's a flower with pink nectar. "
|
||||
form_name = "Pa'u"
|
||||
elsif form == 4
|
||||
message = "It's a flower with blue nectar. "
|
||||
form_name = "Sensu"
|
||||
end
|
||||
|
||||
message = message + "Show it to a Pokémon?"
|
||||
if pbConfirmMessage(message)
|
||||
pbChoosePokemon(1, 2,
|
||||
proc { |poke|
|
||||
!poke.egg? &&
|
||||
(Kernel.isPartPokemon(poke, :ORICORIO_1) ||
|
||||
Kernel.isPartPokemon(poke, :ORICORIO_2) ||
|
||||
Kernel.isPartPokemon(poke, :ORICORIO_3) ||
|
||||
Kernel.isPartPokemon(poke, :ORICORIO_4))
|
||||
})
|
||||
if (pbGet(1) != -1)
|
||||
poke = $Trainer.party[pbGet(1)]
|
||||
if changeOricorioForm(poke, form)
|
||||
pbMessage(_INTL("{1} switched to the {2} style", poke.name, form_name))
|
||||
pbSet(1, poke.name)
|
||||
else
|
||||
pbMessage(_INTL("{1} remained the same...", poke.name, form_name))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def changeOricorioForm(pokemon, form = nil)
|
||||
oricorio_forms = [:ORICORIO_1, :ORICORIO_2, :ORICORIO_3, :ORICORIO_4]
|
||||
body_id = pokemon.isFusion? ? get_body_species_from_symbol(pokemon.species) : pokemon.species
|
||||
head_id = pokemon.isFusion? ? get_head_species_from_symbol(pokemon.species) : pokemon.species
|
||||
|
||||
oricorio_body = oricorio_forms.include?(body_id)
|
||||
oricorio_head = oricorio_forms.include?(head_id)
|
||||
|
||||
if form == 1
|
||||
body_id = :ORICORIO_1 if oricorio_body
|
||||
head_id = :ORICORIO_1 if oricorio_head
|
||||
elsif form == 2
|
||||
body_id = :ORICORIO_2 if oricorio_body
|
||||
head_id = :ORICORIO_2 if oricorio_head
|
||||
elsif form == 3
|
||||
body_id = :ORICORIO_3 if oricorio_body
|
||||
head_id = :ORICORIO_3 if oricorio_head
|
||||
elsif form == 4
|
||||
body_id = :ORICORIO_4 if oricorio_body
|
||||
head_id = :ORICORIO_4 if oricorio_head
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
||||
head_number = getDexNumberForSpecies(head_id)
|
||||
body_number = getDexNumberForSpecies(body_id)
|
||||
|
||||
newForm = pokemon.isFusion? ? getSpeciesIdForFusion(head_number, body_number) : head_id
|
||||
$Trainer.pokedex.set_seen(newForm)
|
||||
$Trainer.pokedex.set_owned(newForm)
|
||||
|
||||
pokemon.species = newForm
|
||||
return true
|
||||
end
|
||||
|
||||
# tradedPoke = pbGet(154)
|
||||
# party=[tradedPoke]
|
||||
# customTrainerBattle("Eusine",
|
||||
# :MYSTICALMAN,
|
||||
# party,
|
||||
# tradedPoke.level,
|
||||
# "Okay, okay I'll give it back!" )
|
||||
|
||||
def fossilsGuyBattle(level = 20, end_message = "")
|
||||
team = getFossilsGuyTeam(level)
|
||||
customTrainerBattle("Miguel",
|
||||
:SUPERNERD,
|
||||
team,
|
||||
level,
|
||||
end_message
|
||||
)
|
||||
|
||||
end
|
||||
|
||||
def getFossilsGuyTeam(level)
|
||||
base_poke_evolution_level = 20
|
||||
fossils_evolution_level_1 = 30
|
||||
fossils_evolution_level_2 = 50
|
||||
|
||||
fossils = []
|
||||
base_poke = level <= base_poke_evolution_level ? :B88H109 : :B89H110
|
||||
team = []
|
||||
team << Pokemon.new(base_poke, level)
|
||||
|
||||
#Mt. Moon fossil
|
||||
if $game_switches[SWITCH_PICKED_HELIC_FOSSIL]
|
||||
fossils << :KABUTO if level < fossils_evolution_level_1
|
||||
fossils << :KABUTOPS if level >= fossils_evolution_level_1
|
||||
elsif $game_switches[SWITCH_PICKED_DOME_FOSSIL]
|
||||
fossils << :OMANYTE if level < fossils_evolution_level_1
|
||||
fossils << :OMASTAR if level >= fossils_evolution_level_1
|
||||
end
|
||||
|
||||
#S.S. Anne fossil
|
||||
if $game_switches[SWITCH_PICKED_LILEEP_FOSSIL]
|
||||
fossils << :ANORITH if level < fossils_evolution_level_1
|
||||
fossils << :ARMALDO if level >= fossils_evolution_level_1
|
||||
|
||||
elsif $game_switches[SWITCH_PICKED_ANORITH_FOSSIL]
|
||||
fossils << :LILEEP if level < fossils_evolution_level_1
|
||||
fossils << :CRADILY if level >= fossils_evolution_level_1
|
||||
|
||||
end
|
||||
#Celadon fossil
|
||||
if $game_switches[SWITCH_PICKED_ARMOR_FOSSIL]
|
||||
fossils << :CRANIDOS if level < fossils_evolution_level_2
|
||||
fossils << :RAMPARDOS if level >= fossils_evolution_level_2
|
||||
|
||||
elsif $game_switches[SWITCH_PICKED_SKULL_FOSSIL]
|
||||
fossils << :SHIELDON if level < fossils_evolution_level_2
|
||||
fossils << :BASTIODON if level >= fossils_evolution_level_2
|
||||
end
|
||||
|
||||
skip_next = false
|
||||
for index in 0..fossils.length
|
||||
if index == fossils.length - 1
|
||||
team << Pokemon.new(fossils[index], level)
|
||||
else
|
||||
if skip_next
|
||||
skip_next = false
|
||||
next
|
||||
end
|
||||
head_poke = fossils[index]
|
||||
body_poke = fossils[index + 1]
|
||||
if head_poke && body_poke
|
||||
newPoke = getFusionSpecies(dexNum(body_poke), dexNum(head_poke))
|
||||
team << Pokemon.new(newPoke, level)
|
||||
skip_next = true
|
||||
end
|
||||
end
|
||||
end
|
||||
return team
|
||||
end
|
||||
|
||||
def find_last_outfit(player_sprite)
|
||||
for i in 1..Settings::MAX_NB_OUTFITS
|
||||
return i - 1 if !pbResolveBitmap("Graphics/Characters/" + player_sprite + "_" + i.to_s)
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
def changeToNextOutfit(incr = 1)
|
||||
metadata = GameData::Metadata.get_player($Trainer.character_ID)
|
||||
player_sprite = metadata[$game_player.charsetData[1]]
|
||||
|
||||
currentOutfit = $Trainer.outfit
|
||||
currentOutfit = 0 if !currentOutfit
|
||||
|
||||
nextOutfit = currentOutfit + incr
|
||||
nextOutfitName = "Graphics/Characters/" + player_sprite + "_" + nextOutfit.to_s
|
||||
nextOutfitName = "Graphics/Characters/" + player_sprite if nextOutfit == 0
|
||||
if !pbResolveBitmap(nextOutfitName)
|
||||
if incr > 0
|
||||
nextOutfit = 0
|
||||
else
|
||||
nextOutfit = find_last_outfit(player_sprite)
|
||||
end
|
||||
end
|
||||
$Trainer.outfit = nextOutfit
|
||||
end
|
||||
|
||||
def playPokeFluteAnimation
|
||||
return if $Trainer.outfit != 0
|
||||
$game_player.setDefaultCharName("players/pokeflute", 0, false)
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
end
|
||||
|
||||
def restoreDefaultCharacterSprite(charset_number=0)
|
||||
meta = GameData::Metadata.get_player($Trainer.character_ID)
|
||||
charset = pbGetPlayerCharset(meta,charset_number)
|
||||
|
||||
$game_player.setDefaultCharName(charset, 0, false)
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
end
|
||||
|
||||
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
|
||||
if down_only
|
||||
if currentDifficulty == :HARD
|
||||
available_difficulties << choice_hard
|
||||
available_difficulties << choice_normal
|
||||
available_difficulties << choice_easy
|
||||
elsif currentDifficulty == :NORMAL
|
||||
available_difficulties << choice_normal
|
||||
available_difficulties << choice_easy
|
||||
elsif currentDifficulty == :EASY
|
||||
available_difficulties << choice_easy
|
||||
end
|
||||
else
|
||||
available_difficulties << choice_easy
|
||||
available_difficulties << choice_normal
|
||||
available_difficulties << choice_hard
|
||||
end
|
||||
available_difficulties << choice_cancel
|
||||
index = pbMessage("Select a new difficulty", available_difficulties, available_difficulties[-1])
|
||||
choice = available_difficulties[index]
|
||||
case choice
|
||||
when choice_easy
|
||||
$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_HARD] = false
|
||||
when choice_hard
|
||||
$game_switches[SWITCH_GAME_DIFFICULTY_EASY] = false
|
||||
$game_switches[SWITCH_GAME_DIFFICULTY_HARD] = true
|
||||
when choice_cancel
|
||||
return
|
||||
end
|
||||
|
||||
message = "The game is currently on " + get_difficulty_text() + " difficulty."
|
||||
pbMessage(message)
|
||||
end
|
||||
|
||||
def Kernel.getPlateType(item)
|
||||
return :FIGHTING if item == PBItems::FISTPLATE
|
||||
return :FLYING if item == PBItems::SKYPLATE
|
||||
return :POISON if item == PBItems::TOXICPLATE
|
||||
return :GROUND if item == PBItems::EARTHPLATE
|
||||
return :ROCK if item == PBItems::STONEPLATE
|
||||
return :BUG if item == PBItems::INSECTPLATE
|
||||
return :GHOST if item == PBItems::SPOOKYPLATE
|
||||
return :STEEL if item == PBItems::IRONPLATE
|
||||
return :FIRE if item == PBItems::FLAMEPLATE
|
||||
return :WATER if item == PBItems::SPLASHPLATE
|
||||
return :GRASS if item == PBItems::MEADOWPLATE
|
||||
return :ELECTRIC if item == PBItems::ZAPPLATE
|
||||
return :PSYCHIC if item == PBItems::MINDPLATE
|
||||
return :ICE if item == PBItems::ICICLEPLATE
|
||||
return :DRAGON if item == PBItems::DRACOPLATE
|
||||
return :DARK if item == PBItems::DREADPLATE
|
||||
return :FAIRY if item == PBItems::PIXIEPLATE
|
||||
return -1
|
||||
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
|
||||
return list
|
||||
end
|
||||
|
||||
def getArceusPlateType(heldItem)
|
||||
return :NORMAL if heldItem == nil
|
||||
case heldItem
|
||||
when :FISTPLATE
|
||||
return :FIGHTING
|
||||
when :SKYPLATE
|
||||
return :FLYING
|
||||
when :TOXICPLATE
|
||||
return :POISON
|
||||
when :EARTHPLATE
|
||||
return :GROUND
|
||||
when :STONEPLATE
|
||||
return :ROCK
|
||||
when :INSECTPLATE
|
||||
return :BUG
|
||||
when :SPOOKYPLATE
|
||||
return :GHOST
|
||||
when :IRONPLATE
|
||||
return :STEEL
|
||||
when :FLAMEPLATE
|
||||
return :FIRE
|
||||
when :SPLASHPLATE
|
||||
return :WATER
|
||||
when :MEADOWPLATE
|
||||
return :GRASS
|
||||
when :ZAPPLATE
|
||||
return :ELECTRIC
|
||||
when :MINDPLATE
|
||||
return :PSYCHIC
|
||||
when :ICICLEPLATE
|
||||
return :ICE
|
||||
when :DRACOPLATE
|
||||
return :DRAGON
|
||||
when :DREADPLATE
|
||||
return :DARK
|
||||
when :PIXIEPLATE
|
||||
return :FAIRY
|
||||
else
|
||||
return :NORMAL
|
||||
end
|
||||
end
|
||||
|
||||
def getGenericPokemonCryText(pokemonSpecies)
|
||||
case pokemonSpecies
|
||||
when 25
|
||||
return "Pika!"
|
||||
when 16, 17, 18, 21, 22, 144, 145, 146, 227, 417, 418, 372 #birds
|
||||
return "Squawk!"
|
||||
when 163, 164
|
||||
return "Hoot!" #owl
|
||||
else
|
||||
return "Guaugh!"
|
||||
end
|
||||
end
|
||||
|
||||
def Kernel.setRocketPassword(variableNum)
|
||||
abilityIndex = rand(233)
|
||||
speciesIndex = rand(PBSpecies.maxValue - 1)
|
||||
|
||||
word1 = PBSpecies.getName(speciesIndex)
|
||||
word2 = GameData::Ability.get(abilityIndex).name
|
||||
password = _INTL("{1}'s {2}", word1, word2)
|
||||
pbSet(variableNum, password)
|
||||
end
|
||||
|
||||
def obtainBadgeMessage(badgeName)
|
||||
Kernel.pbMessage(_INTL("\\me[Badge get]{1} obtained the {2}!", $Trainer.name, badgeName))
|
||||
end
|
||||
|
||||
KANTO_OUTDOOR_MAPS = [
|
||||
78, #Route 1
|
||||
185, #Secret Garden
|
||||
86, #Route 2
|
||||
90, #Route 2 (north)
|
||||
655, #Hidden Forest
|
||||
40, #Viridian River
|
||||
490, #Route 3
|
||||
106, #Route 4
|
||||
12, #Route 5
|
||||
16, #Route 6
|
||||
413, # Route 7
|
||||
409, # Route 8
|
||||
351, #Route 9 (east)
|
||||
495, #Route 9 (west)
|
||||
154, #Route 10
|
||||
155, #Route 11
|
||||
159, #Route 12
|
||||
440, #Route 14
|
||||
444, #Route 15
|
||||
712, #Creepy house
|
||||
438, #Route 16
|
||||
146, #Route 17
|
||||
517, #Route 18
|
||||
437, #Route 13
|
||||
57, # Route 19
|
||||
227, #Route 19 (underwater)
|
||||
56, #Route 19 (surf race)
|
||||
58, #Route 20
|
||||
480, #Route 20 underwater 1
|
||||
228, #Route 20 underwater 2
|
||||
171, #Route 22
|
||||
8, #Route 24
|
||||
9, #Route 25
|
||||
143, #Route 23
|
||||
145, #Route 26
|
||||
147, #Route 27
|
||||
58, #Route 21
|
||||
#CITIES
|
||||
42, #Pallet Town
|
||||
79, #Viridian City
|
||||
1, #Cerulean City
|
||||
387, #Cerulean City (race)
|
||||
19, #Vermillion City
|
||||
36, #S.S. Anne deck
|
||||
95, #Celadon city
|
||||
436, #Celadon city dept store (roof)
|
||||
472, #Fuchsia city
|
||||
50, #Lavender town
|
||||
108, #Saffron city
|
||||
98, #Cinnabar island
|
||||
167, #Crimson city
|
||||
303, #indigo plateau
|
||||
380, #Pewter city
|
||||
#
|
||||
# DUNGEONS
|
||||
#
|
||||
102, #Mt. Moon
|
||||
103, #Mt. Moon
|
||||
105, #Mt. Moon
|
||||
496, #Mt Moon
|
||||
104, #Mt. Moon
|
||||
494, #Mt. Moon Square
|
||||
140, #Diglett cave
|
||||
398, #Diglett cave
|
||||
399, #Diglett cave
|
||||
349, #Rock tunnel
|
||||
350, #Rock tunnel
|
||||
512, #Rock tunnel (outdoor)
|
||||
445, #Safari Zone 1
|
||||
484, #Safari Zone 2
|
||||
485, #Safari Zone 3
|
||||
486, #Safari Zone 4
|
||||
487, #Safari Zone 5
|
||||
491, #Viridian Forest
|
||||
529, #Mt. Silver entrance
|
||||
777, #Mt. Silver outdoor 1
|
||||
781, #Mt. Silver outdoor 2
|
||||
782, #Mt. Silver
|
||||
783, #Mt. Silver summit
|
||||
400, #Pokemon Tower
|
||||
401, #Pokemon Tower
|
||||
402, #Pokemon Tower
|
||||
403, #Pokemon Tower
|
||||
467, #Pokemon Tower
|
||||
468, #Pokemon Tower
|
||||
469, #Pokemon Tower
|
||||
]
|
||||
KANTO_DARKNESS_STAGE_1 = [
|
||||
50, #Lavender town
|
||||
409, # Route 8
|
||||
351, #Route 9 (east)
|
||||
495, #Route 9 (west)
|
||||
154, #Route 10
|
||||
108, #Saffron city
|
||||
1, #Cerulean City
|
||||
387, #Cerulean City (race)
|
||||
106, #Route 4
|
||||
8, #Route 24
|
||||
9, #Route 25
|
||||
400, #Pokemon Tower
|
||||
401, #Pokemon Tower
|
||||
402, #Pokemon Tower
|
||||
403, #Pokemon Tower
|
||||
467, #Pokemon Tower
|
||||
468, #Pokemon Tower
|
||||
469, #Pokemon Tower
|
||||
159, #Route 12
|
||||
349, #Rock tunnel
|
||||
350, #Rock tunnel
|
||||
512, #Rock tunnel (outdoor)
|
||||
12, #Route 5
|
||||
|
||||
]
|
||||
KANTO_DARKNESS_STAGE_2 = [
|
||||
95, #Celadon city
|
||||
436, #Celadon city dept store (roof)
|
||||
143, #Route 23
|
||||
167, #Crimson city
|
||||
413, # Route 7
|
||||
438, #Route 16
|
||||
146, #Route 17
|
||||
106, #Route 4
|
||||
19, #Vermillion City
|
||||
36, #S.S. Anne deck
|
||||
16, #Route 6
|
||||
437, #Route 13
|
||||
155, #Route 11
|
||||
140, #Diglett cave
|
||||
398, #Diglett cave
|
||||
399, #Diglett cave
|
||||
]
|
||||
KANTO_DARKNESS_STAGE_3 = [
|
||||
472, #Fuchsia city
|
||||
445, #Safari Zone 1
|
||||
484, #Safari Zone 2
|
||||
485, #Safari Zone 3
|
||||
486, #Safari Zone 4
|
||||
487, #Safari Zone 5
|
||||
444, #Route 15
|
||||
440, #Route 14
|
||||
712, #Creepy house
|
||||
517, #Route 18
|
||||
57, # Route 19
|
||||
227, #Route 19 (underwater)
|
||||
56, #Route 19 (surf race)
|
||||
58, #Route 20
|
||||
480, #Route 20 underwater 1
|
||||
228, #Route 20 underwater 2
|
||||
98, #Cinnabar island
|
||||
58, #Route 21
|
||||
]
|
||||
KANTO_DARKNESS_STAGE_4 = KANTO_OUTDOOR_MAPS
|
||||
|
||||
def darknessEffectOnCurrentMap()
|
||||
return if !$game_switches
|
||||
return if !$game_switches[SWITCH_KANTO_DARKNESS]
|
||||
return darknessEffectOnMap($game_map.map_id)
|
||||
end
|
||||
|
||||
def darknessEffectOnMap(map_id)
|
||||
return if !$game_switches
|
||||
return if !$game_switches[SWITCH_KANTO_DARKNESS]
|
||||
return if !KANTO_OUTDOOR_MAPS.include?(map_id)
|
||||
dark_maps = []
|
||||
dark_maps += KANTO_DARKNESS_STAGE_1 if $game_switches[SWITCH_KANTO_DARKNESS_STAGE_1]
|
||||
dark_maps += KANTO_DARKNESS_STAGE_2 if $game_switches[SWITCH_KANTO_DARKNESS_STAGE_2]
|
||||
dark_maps += KANTO_DARKNESS_STAGE_3 if $game_switches[SWITCH_KANTO_DARKNESS_STAGE_3]
|
||||
dark_maps = KANTO_OUTDOOR_MAPS if $game_switches[SWITCH_KANTO_DARKNESS_STAGE_4]
|
||||
return dark_maps.include?(map_id)
|
||||
end
|
||||
|
||||
def apply_darkness()
|
||||
$PokemonTemp.darknessSprite = DarknessSprite.new
|
||||
darkness = $PokemonTemp.darknessSprite
|
||||
darkness.radius = 276
|
||||
while darkness.radius > 64
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
darkness.radius -= 4
|
||||
end
|
||||
$PokemonGlobal.flashUsed = false
|
||||
$PokemonTemp.darknessSprite.dispose
|
||||
Events.onMapSceneChange.trigger(self, $scene, true)
|
||||
end
|
||||
|
||||
def isInMtMoon()
|
||||
mt_moon_maps = [102, 103, 105, 496, 104]
|
||||
return mt_moon_maps.include?($game_map.map_id)
|
||||
end
|
||||
|
||||
def getMtMoonDirection()
|
||||
maps_east = [380, #Pewter city
|
||||
490, #Route 3
|
||||
303, #indigo plateau
|
||||
145, #Route 26
|
||||
147, #Route 27
|
||||
]
|
||||
maps_south = [
|
||||
8, #Route 24
|
||||
9, #Route 25
|
||||
143, #Route 23
|
||||
167, #Crimson city
|
||||
]
|
||||
maps_west = []
|
||||
return 2 if maps_south.include?($game_map.map_id)
|
||||
return 4 if maps_west.include?($game_map.map_id)
|
||||
return 6 if maps_east.include?($game_map.map_id)
|
||||
return 8 #north (most maps)
|
||||
end
|
||||
|
||||
def has_species_or_fusion?(species, form = -1)
|
||||
return $Trainer.pokemon_party.any? { |p| p && p.isSpecies?(species) || p.isFusionOf(species) }
|
||||
end
|
||||
|
||||
|
||||
|
||||
#Solution: position of boulders [[x,y],[x,y],etc.]
|
||||
def validate_regirock_ice_puzzle(solution)
|
||||
for boulder_position in solution
|
||||
x = boulder_position[0]
|
||||
y = boulder_position[1]
|
||||
# echoln ""
|
||||
# echoln x.to_s + ", " + y.to_s
|
||||
# echoln $game_map.event_at_position(x,y)
|
||||
return false if !$game_map.event_at_position(x,y)
|
||||
end
|
||||
echoln "all boulders in place"
|
||||
return true
|
||||
end
|
||||
|
||||
def validate_regirock_steel_puzzle()
|
||||
expected_pressed_switches = [75,77,74,68,73,69]
|
||||
expected_unpressed_switches = [76,67,72,70]
|
||||
switch_ids = [75,77,76,67,
|
||||
74,68,
|
||||
73,72,70,69]
|
||||
|
||||
|
||||
pressed_switches =[]
|
||||
unpressed_switches = []
|
||||
switch_ids.each do |switch_id|
|
||||
is_pressed = pbGetSelfSwitch(switch_id,"A")
|
||||
if is_pressed
|
||||
pressed_switches << switch_id
|
||||
else
|
||||
unpressed_switches << switch_id
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
for event_id in switch_ids
|
||||
is_pressed = pbGetSelfSwitch(event_id,"A")
|
||||
return false if !is_pressed && expected_pressed_switches.include?(event_id)
|
||||
return false if is_pressed && expected_unpressed_switches.include?(event_id)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
def registeel_ice_press_switch(letter)
|
||||
order = pbGet(1)
|
||||
solution = "ssBSBGG"#GGSBBss"
|
||||
registeel_ice_reset_switches() if !order.is_a?(String)
|
||||
order << letter
|
||||
pbSet(1,order)
|
||||
if order == solution
|
||||
echoln "OK"
|
||||
pbSEPlay("Evolution start",nil,130)
|
||||
elsif order.length >= solution.length
|
||||
registeel_ice_reset_switches()
|
||||
end
|
||||
echoln order
|
||||
end
|
||||
|
||||
def registeel_ice_reset_switches()
|
||||
switches_events = [66,78,84,85,86,87,88]
|
||||
switches_events.each do |switch_id|
|
||||
pbSetSelfSwitch(switch_id, "A", false)
|
||||
echoln "reset" + switch_id.to_s
|
||||
end
|
||||
pbSet(1,"")
|
||||
end
|
||||
|
||||
|
||||
def regirock_steel_move_boulder()
|
||||
|
||||
switches_position = [
|
||||
[16,21],[18,21],[20,21],[22,21],
|
||||
[16,23], [22,23],
|
||||
[16,25],[18,25],[20,25],[22,25]
|
||||
]
|
||||
boulder_event = get_self
|
||||
old_x = boulder_event.x
|
||||
old_y = boulder_event.y
|
||||
stepped_off_switch = switches_position.find { |position| position[0] == old_x && position[1] == old_y }
|
||||
|
||||
|
||||
pbPushThisBoulder()
|
||||
boulder_event = get_self
|
||||
|
||||
if stepped_off_switch
|
||||
switch_event = $game_map.get_event_at_position(old_x,old_y,[boulder_event.id])
|
||||
echoln switch_event.id if switch_event
|
||||
pbSEPlay("Entering Door",nil,80)
|
||||
pbSetSelfSwitch(switch_event.id, "A", false) if switch_event
|
||||
end
|
||||
|
||||
stepped_on_switch = switches_position.find { |position| position[0] == boulder_event.x && position[1] == boulder_event.y }
|
||||
if stepped_on_switch
|
||||
switch_event = $game_map.get_event_at_position(boulder_event.x,boulder_event.y,[boulder_event.id])
|
||||
echoln switch_event.id if switch_event
|
||||
pbSEPlay("Entering Door")
|
||||
pbSetSelfSwitch(switch_event.id, "A", true) if switch_event
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
# PokemonFusion
|
||||
#
|
||||
|
||||
NB_POKEMON = Settings::NB_POKEMON#809#420 #351 #aussi CONST_NB_POKE
|
||||
CONST_NB_POKE = NB_POKEMON
|
||||
NB_POKEMON = 420 #351 #aussi CONST_NB_POKE
|
||||
|
||||
def pbPokemonBitmapFile(species)
|
||||
# Used by the Pokédex
|
||||
# Load normal bitmap
|
||||
|
||||
@@ -146,63 +146,16 @@ def getDexNumberForSpecies(species)
|
||||
return dexNum
|
||||
end
|
||||
|
||||
def getFusedPokemonIdFromDexNum(body_dex, head_dex)
|
||||
return ("B" + body_dex.to_s + "H" + head_dex.to_s).to_sym
|
||||
end
|
||||
|
||||
def getPokemon(dexNum)
|
||||
if dexNum.is_a?(Integer)
|
||||
if dexNum > NB_POKEMON
|
||||
body_id = getBodyID(dexNum)
|
||||
head_id = getHeadID(dexNum, body_id)
|
||||
pokemon_id = getFusedPokemonIdFromDexNum(body_id, head_id)
|
||||
else
|
||||
pokemon_id = dexNum
|
||||
end
|
||||
else
|
||||
pokemon_id = dexNum
|
||||
end
|
||||
|
||||
return GameData::Species.get(pokemon_id)
|
||||
return GameData::Species.get(dexNum)
|
||||
end
|
||||
|
||||
def getSpecies(dexnum)
|
||||
return getPokemon(dexnum)
|
||||
end
|
||||
|
||||
def getSpeciesIdForFusion(head_number, body_number)
|
||||
return (body_number) * Settings::NB_POKEMON + head_number
|
||||
end
|
||||
|
||||
|
||||
def get_body_species_from_symbol(fused_id)
|
||||
body_num = get_body_number_from_symbol(fused_id)
|
||||
return GameData::Species.get(body_num).species
|
||||
end
|
||||
|
||||
def get_head_species_from_symbol(fused_id)
|
||||
head_num = get_head_number_from_symbol(fused_id)
|
||||
return GameData::Species.get(head_num).species
|
||||
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
|
||||
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
|
||||
end
|
||||
|
||||
def getFusionSpecies(body, head)
|
||||
body_num = getDexNumberForSpecies(body)
|
||||
head_num = getDexNumberForSpecies(head)
|
||||
id = body_num * Settings::NB_POKEMON + head_num
|
||||
return GameData::Species.get(id)
|
||||
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
|
||||
@@ -214,15 +167,6 @@ def isTripleFusion?(num)
|
||||
return num >= Settings::ZAPMOLCUNO_NB
|
||||
end
|
||||
|
||||
def isFusion(num)
|
||||
return num > Settings::NB_POKEMON && !isTripleFusion?(num)
|
||||
end
|
||||
|
||||
def isSpeciesFusion(species)
|
||||
num = getDexNumberForSpecies(species)
|
||||
return isFusion(num)
|
||||
end
|
||||
|
||||
def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3)
|
||||
if customPokeList.length == 0
|
||||
customPokeList = getCustomSpeciesList(false)
|
||||
@@ -295,11 +239,7 @@ def getRandomCustomFusion(returnRandomPokemonIfNoneFound = true, customPokeList
|
||||
end
|
||||
|
||||
def getBodyID(species)
|
||||
if species.is_a?(Integer)
|
||||
dexNum = species
|
||||
else
|
||||
dexNum = getDexNumberForSpecies(species)
|
||||
end
|
||||
dexNum = getDexNumberForSpecies(species)
|
||||
if dexNum % NB_POKEMON == 0
|
||||
return (dexNum / NB_POKEMON) - 1
|
||||
end
|
||||
@@ -307,19 +247,14 @@ def getBodyID(species)
|
||||
end
|
||||
|
||||
def getHeadID(species, bodyId = nil)
|
||||
if species.is_a?(Integer)
|
||||
fused_dexNum = species
|
||||
else
|
||||
fused_dexNum = getDexNumberForSpecies(species)
|
||||
end
|
||||
|
||||
if bodyId == nil
|
||||
bodyId = getBodyID(species)
|
||||
end
|
||||
fused_dexNum = getDexNumberForSpecies(species)
|
||||
body_dexNum = getDexNumberForSpecies(bodyId)
|
||||
|
||||
calculated_number = (fused_dexNum - (body_dexNum * NB_POKEMON)).round
|
||||
return calculated_number == 0 ? NB_POKEMON : calculated_number
|
||||
return calculated_number == 0 ? 420 : calculated_number
|
||||
end
|
||||
|
||||
def getAllNonLegendaryPokemon()
|
||||
@@ -372,6 +307,10 @@ def pbGetSelfSwitch(eventId, switch)
|
||||
return $game_self_switches[[@map_id, eventId, switch]]
|
||||
end
|
||||
|
||||
def obtainBadgeMessage(badgeName)
|
||||
Kernel.pbMessage(_INTL("\\me[Badge get]{1} obtained the {2}!", $Trainer.name, badgeName))
|
||||
end
|
||||
|
||||
def getAllNonLegendaryPokemon()
|
||||
list = []
|
||||
for i in 1..143
|
||||
@@ -442,6 +381,29 @@ def pbBitmap(path)
|
||||
return bmp
|
||||
end
|
||||
|
||||
def Kernel.setRocketPassword(variableNum)
|
||||
abilityIndex = rand(233)
|
||||
speciesIndex = rand(PBSpecies.maxValue - 1)
|
||||
|
||||
word1 = PBSpecies.getName(speciesIndex)
|
||||
word2 = GameData::Ability.get(abilityIndex).name
|
||||
password = _INTL("{1}'s {2}", word1, word2)
|
||||
pbSet(variableNum, password)
|
||||
end
|
||||
|
||||
def getGenericPokemonCryText(pokemonSpecies)
|
||||
case pokemonSpecies
|
||||
when 25
|
||||
return "Pika!"
|
||||
when 16, 17, 18, 21, 22, 144, 145, 146, 227, 417, 418, 372 #birds
|
||||
return "Squawk!"
|
||||
when 163, 164
|
||||
return "Hoot!" #owl
|
||||
else
|
||||
return "Guaugh!"
|
||||
end
|
||||
end
|
||||
|
||||
def obtainPokemonSpritePath(id, includeCustoms = true)
|
||||
head = getBasePokemonID(param.to_i, false)
|
||||
body = getBasePokemonID(param.to_i, true)
|
||||
@@ -466,25 +428,6 @@ def getCustomSpritePath(body, head)
|
||||
return _INTL("Graphics/CustomBattlers/indexed/{1}/{1}.{2}.png", head, body)
|
||||
end
|
||||
|
||||
def customSpriteExistsForm(species,form_id_head=nil, form_id_body=nil)
|
||||
head = getBasePokemonID(species, false)
|
||||
body = getBasePokemonID(species, true)
|
||||
|
||||
folder = head.to_s
|
||||
|
||||
folder += "_" + form_id_head.to_s if form_id_head
|
||||
|
||||
spritename = head.to_s
|
||||
spritename += "_" + form_id_head.to_s if form_id_head
|
||||
spritename += "." + body.to_s
|
||||
spritename += "_" + form_id_body.to_s if form_id_body
|
||||
|
||||
pathCustom = _INTL("Graphics/CustomBattlers/indexed/{1}/{2}.png", folder, spritename)
|
||||
|
||||
return true if pbResolveBitmap(pathCustom) != nil
|
||||
return download_custom_sprite(head, body,form_id_head,form_id_body) != nil
|
||||
end
|
||||
|
||||
def customSpriteExists(species)
|
||||
head = getBasePokemonID(species, false)
|
||||
body = getBasePokemonID(species, true)
|
||||
@@ -511,16 +454,58 @@ def customSpriteExistsBase(body, head)
|
||||
return download_custom_sprite(head, body) != nil
|
||||
end
|
||||
|
||||
# def getSpriteCredits(spriteName)
|
||||
# File.foreach(Settings::CREDITS_FILE_PATH) do |line|
|
||||
# row = line.split(';')
|
||||
# echo row[0]
|
||||
# if row[0] == spriteName
|
||||
# return row[1]
|
||||
# end
|
||||
# end
|
||||
# return nil
|
||||
# end
|
||||
def getSpriteCredits(spriteName)
|
||||
File.foreach(Settings::CREDITS_FILE_PATH) do |line|
|
||||
row = line.split(';')
|
||||
echo row[0]
|
||||
if row[0] == spriteName
|
||||
return row[1]
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
def getArceusPlateType(heldItem)
|
||||
return :NORMAL if heldItem == nil
|
||||
case heldItem
|
||||
when :FISTPLATE
|
||||
return :FIGHTING
|
||||
when :SKYPLATE
|
||||
return :FLYING
|
||||
when :TOXICPLATE
|
||||
return :POISON
|
||||
when :EARTHPLATE
|
||||
return :GROUND
|
||||
when :STONEPLATE
|
||||
return :ROCK
|
||||
when :INSECTPLATE
|
||||
return :BUG
|
||||
when :SPOOKYPLATE
|
||||
return :GHOST
|
||||
when :IRONPLATE
|
||||
return :STEEL
|
||||
when :FLAMEPLATE
|
||||
return :FIRE
|
||||
when :SPLASHPLATE
|
||||
return :WATER
|
||||
when :MEADOWPLATE
|
||||
return :GRASS
|
||||
when :ZAPPLATE
|
||||
return :ELECTRIC
|
||||
when :MINDPLATE
|
||||
return :PSYCHIC
|
||||
when :ICICLEPLATE
|
||||
return :ICE
|
||||
when :DRACOPLATE
|
||||
return :DRAGON
|
||||
when :DREADPLATE
|
||||
return :DARK
|
||||
when :PIXIEPLATE
|
||||
return :FAIRY
|
||||
else
|
||||
return :NORMAL
|
||||
end
|
||||
end
|
||||
|
||||
def reverseFusionSpecies(species)
|
||||
dexId = getDexNumberForSpecies(species)
|
||||
@@ -539,6 +524,28 @@ def Kernel.getRoamingMap(roamingArrayPos)
|
||||
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
|
||||
return list
|
||||
end
|
||||
|
||||
def Kernel.getItemNamesAsString(list)
|
||||
strList = ""
|
||||
for i in 0..list.length - 1
|
||||
@@ -552,21 +559,25 @@ def Kernel.getItemNamesAsString(list)
|
||||
return strList
|
||||
end
|
||||
|
||||
def get_body_id_from_symbol(id)
|
||||
split_id = id.to_s.match(/\d+/)
|
||||
if !split_id #non-fusion
|
||||
return GameData::Species.get(id).id_number
|
||||
end
|
||||
return split_id[0].to_i
|
||||
end
|
||||
|
||||
def get_head_id_from_symbol(id)
|
||||
split_id = id.to_s.match(/(?<=H)\d+/)
|
||||
if !split_id #non-fusion
|
||||
return GameData::Species.get(id).id_number
|
||||
end
|
||||
|
||||
return split_id[0].to_i
|
||||
def Kernel.getPlateType(item)
|
||||
return :FIGHTING if item == PBItems::FISTPLATE
|
||||
return :FLYING if item == PBItems::SKYPLATE
|
||||
return :POISON if item == PBItems::TOXICPLATE
|
||||
return :GROUND if item == PBItems::EARTHPLATE
|
||||
return :ROCK if item == PBItems::STONEPLATE
|
||||
return :BUG if item == PBItems::INSECTPLATE
|
||||
return :GHOST if item == PBItems::SPOOKYPLATE
|
||||
return :STEEL if item == PBItems::IRONPLATE
|
||||
return :FIRE if item == PBItems::FLAMEPLATE
|
||||
return :WATER if item == PBItems::SPLASHPLATE
|
||||
return :GRASS if item == PBItems::MEADOWPLATE
|
||||
return :ELECTRIC if item == PBItems::ZAPPLATE
|
||||
return :PSYCHIC if item == PBItems::MINDPLATE
|
||||
return :ICE if item == PBItems::ICICLEPLATE
|
||||
return :DRAGON if item == PBItems::DRACOPLATE
|
||||
return :DARK if item == PBItems::DREADPLATE
|
||||
return :FAIRY if item == PBItems::PIXIEPLATE
|
||||
return -1
|
||||
end
|
||||
|
||||
def get_default_moves_at_level(species, level)
|
||||
@@ -585,6 +596,7 @@ def get_default_moves_at_level(species, level)
|
||||
#moves.push(Pokemon::Move.new(knowable_moves[i]))
|
||||
moves << knowable_moves[i]
|
||||
end
|
||||
p moves
|
||||
return moves
|
||||
end
|
||||
|
||||
@@ -623,9 +635,50 @@ def get_difficulty_text
|
||||
end
|
||||
end
|
||||
|
||||
def pokemonExceedsLevelCap(pokemon)
|
||||
return false if $Trainer.badge_count >= Settings::NB_BADGES
|
||||
current_max_level = Settings::LEVEL_CAPS[$Trainer.badge_count]
|
||||
current_max_level *= Settings::HARD_MODE_LEVEL_MODIFIER if $game_switches[SWITCH_GAME_DIFFICULTY_HARD]
|
||||
return pokemon.level >= current_max_level
|
||||
end
|
||||
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
|
||||
if down_only
|
||||
if currentDifficulty == :HARD
|
||||
available_difficulties << choice_hard
|
||||
available_difficulties << choice_normal
|
||||
available_difficulties << choice_easy
|
||||
elsif currentDifficulty == :NORMAL
|
||||
available_difficulties << choice_normal
|
||||
available_difficulties << choice_easy
|
||||
elsif currentDifficulty == :EASY
|
||||
available_difficulties << choice_easy
|
||||
end
|
||||
else
|
||||
available_difficulties << choice_easy
|
||||
available_difficulties << choice_normal
|
||||
available_difficulties << choice_hard
|
||||
end
|
||||
available_difficulties << choice_cancel
|
||||
index = pbMessage("Select a new difficulty", available_difficulties, available_difficulties[-1])
|
||||
choice = available_difficulties[index]
|
||||
case choice
|
||||
when choice_easy
|
||||
$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_HARD] = false
|
||||
when choice_hard
|
||||
$game_switches[SWITCH_GAME_DIFFICULTY_EASY] = false
|
||||
$game_switches[SWITCH_GAME_DIFFICULTY_HARD] = true
|
||||
when choice_cancel
|
||||
return
|
||||
end
|
||||
|
||||
message = "The game is currently on " + get_difficulty_text() + " difficulty."
|
||||
pbMessage(message)
|
||||
end
|
||||
@@ -8,12 +8,12 @@ end
|
||||
|
||||
def updateHttpSettingsFile
|
||||
return if $PokemonSystem.download_sprites != 0
|
||||
download_file(Settings::HTTP_CONFIGS_FILE_URL, Settings::HTTP_CONFIGS_FILE_PATH,)
|
||||
download_file(Settings::HTTP_CONFIGS_FILE_URL, Settings::HTTP_CONFIGS_FILE_PATH)
|
||||
end
|
||||
|
||||
def updateCreditsFile
|
||||
return if $PokemonSystem.download_sprites != 0
|
||||
download_file(Settings::CREDITS_FILE_URL, Settings::CREDITS_FILE_PATH,)
|
||||
download_file(Settings::CREDITS_FILE_URL,Settings::CREDITS_FILE_PATH,)
|
||||
end
|
||||
|
||||
def createCustomSpriteFolders()
|
||||
@@ -32,10 +32,8 @@ def download_file(url, saveLocation)
|
||||
File.open(saveLocation, "wb") do |file|
|
||||
file.write(response[:body])
|
||||
end
|
||||
echoln _INTL("\nDownloaded file {1} to {2}", url, saveLocation)
|
||||
echo _INTL("\nDownloaded file {1} to {2}", url, saveLocation)
|
||||
return saveLocation
|
||||
else
|
||||
echoln _INTL("Tried to download file {1} . Got response {2}",url,response[:body])
|
||||
end
|
||||
return nil
|
||||
rescue MKXPError, Errno::ENOENT => error
|
||||
@@ -46,37 +44,33 @@ end
|
||||
|
||||
def download_pokemon_sprite_if_missing(body, head)
|
||||
return if $PokemonSystem.download_sprites != 0
|
||||
get_fusion_sprite_path(head, body)
|
||||
get_fusion_sprite_path(head,body)
|
||||
end
|
||||
|
||||
def download_sprite(base_path, head_id, body_id, saveLocation = "Graphics/temp", alt_letter = "", spriteformBody_suffix = "", spriteformHead_suffix = "")
|
||||
begin
|
||||
head_id = (head_id.to_s) + spriteformHead_suffix
|
||||
body_id = (body_id.to_s) + spriteformBody_suffix
|
||||
|
||||
downloaded_file_name = _INTL("{1}/{2}.{3}{4}.png", saveLocation, head_id, body_id, alt_letter)
|
||||
if !body_id || body_id == ""
|
||||
downloaded_file_name = _INTL("{1}/{2}{3}.png", saveLocation, head_id, alt_letter)
|
||||
|
||||
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)
|
||||
|
||||
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|
|
||||
file.write(response[:body])
|
||||
end
|
||||
echoln _INTL("\nDownloaded file from {1} to {2}", base_path, saveLocation)
|
||||
echo _INTL("\nDownloaded file from {1} to {2}", base_path, saveLocation)
|
||||
return downloaded_file_name
|
||||
end
|
||||
return nil
|
||||
rescue MKXPError, Errno::ENOENT
|
||||
rescue MKXPError,Errno::ENOENT
|
||||
return nil
|
||||
end
|
||||
end
|
||||
@@ -90,59 +84,44 @@ def download_autogen_sprite(head_id, body_id)
|
||||
return nil
|
||||
end
|
||||
|
||||
def download_custom_sprite(head_id, body_id, spriteformBody_suffix = "", spriteformHead_suffix = "", alt_letter="")
|
||||
head_id = (head_id.to_s) + spriteformHead_suffix.to_s
|
||||
body_id = (body_id.to_s) + spriteformBody_suffix.to_s
|
||||
def download_custom_sprite(head_id, body_id)
|
||||
return nil if $PokemonSystem.download_sprites != 0
|
||||
url = Settings::CUSTOM_SPRITES_REPO_URL + "{1}.{2}{3}.png"
|
||||
url = Settings::CUSTOM_SPRITES_REPO_URL + "{1}.{2}.png"
|
||||
destPath = _INTL("{1}{2}", Settings::CUSTOM_BATTLERS_FOLDER_INDEXED, head_id)
|
||||
if !Dir.exist?(destPath)
|
||||
Dir.mkdir(destPath)
|
||||
end
|
||||
sprite = download_sprite(_INTL(url, head_id, body_id,alt_letter), head_id, body_id, destPath, alt_letter)
|
||||
|
||||
sprite = download_sprite(_INTL(url, head_id, body_id), head_id, body_id, destPath)
|
||||
return sprite if sprite
|
||||
return nil
|
||||
end
|
||||
|
||||
#todo refactor & put custom base sprites in same folder as fusion sprites
|
||||
def download_unfused_main_sprite(dex_num, alt_letter="")
|
||||
base_url = alt_letter == "" ? Settings::BASE_POKEMON_SPRITES_REPO_URL : Settings::BASE_POKEMON_ALT_SPRITES_REPO_URL
|
||||
filename = _INTL("{1}{2}.png",dex_num,alt_letter)
|
||||
url = base_url + filename
|
||||
|
||||
|
||||
destPath = alt_letter == "" ? _INTL("{1}{2}", Settings::BATTLERS_FOLDER, dex_num) : Settings::CUSTOM_BASE_SPRITES_FOLDER
|
||||
sprite = download_sprite(url, dex_num, nil, destPath,alt_letter)
|
||||
|
||||
return sprite if sprite
|
||||
return nil
|
||||
end
|
||||
|
||||
def download_all_unfused_alt_sprites(dex_num)
|
||||
def download_unfused_alt_sprites(dex_num)
|
||||
base_url = Settings::BASE_POKEMON_ALT_SPRITES_REPO_URL + "{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 + ('aa'..'az').to_a
|
||||
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)
|
||||
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_all_alt_sprites(head_id, body_id)
|
||||
def download_alt_sprites(head_id,body_id)
|
||||
base_url = "#{Settings::CUSTOM_SPRITES_REPO_URL}{1}.{2}"
|
||||
extension = ".png"
|
||||
destPath = _INTL("{1}{2}", Settings::CUSTOM_BATTLERS_FOLDER_INDEXED, head_id)
|
||||
if !Dir.exist?(destPath)
|
||||
Dir.mkdir(destPath)
|
||||
end
|
||||
alphabet = ('a'..'z').to_a + ('aa'..'az').to_a
|
||||
alphabet = ('a'..'z').to_a
|
||||
alphabet.each do |letter|
|
||||
alt_url = base_url + letter + extension
|
||||
sprite = download_sprite(alt_url, head_id, body_id, destPath, letter)
|
||||
@@ -150,6 +129,7 @@ def download_all_alt_sprites(head_id, body_id)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#format: [1.1.png, 1.2.png, etc.]
|
||||
# https://api.github.com/repos/infinitefusion/contents/sprites/CustomBattlers
|
||||
# repo = "Aegide/custom-fusion-sprites"
|
||||
@@ -185,6 +165,7 @@ end
|
||||
# write_custom_sprites_csv(files)
|
||||
# end
|
||||
|
||||
|
||||
# Too many file to get everything without getting
|
||||
# rate limited by github, so instead we're getting the
|
||||
# files list from a csv file that will be manually updated
|
||||
@@ -192,22 +173,23 @@ end
|
||||
|
||||
def updateOnlineCustomSpritesFile
|
||||
return if $PokemonSystem.download_sprites != 0
|
||||
download_file(Settings::SPRITES_FILE_URL, Settings::CUSTOM_SPRITES_FILE_PATH)
|
||||
download_file(Settings::SPRITES_FILE_URL,Settings::CUSTOM_SPRITES_FILE_PATH)
|
||||
end
|
||||
|
||||
def list_online_custom_sprites(updateList = false)
|
||||
sprites_list = []
|
||||
|
||||
def list_online_custom_sprites(updateList=false)
|
||||
sprites_list= []
|
||||
File.foreach(Settings::CUSTOM_SPRITES_FILE_PATH) do |line|
|
||||
sprites_list << line
|
||||
end
|
||||
return sprites_list
|
||||
end
|
||||
|
||||
GAME_VERSION_FORMAT_REGEX = /\A\d+(\.\d+)*\z/
|
||||
|
||||
GAME_VERSION_FORMAT_REGEX = /\A\d+(\.\d+)*\z/
|
||||
def fetch_latest_game_version
|
||||
begin
|
||||
download_file(Settings::VERSION_FILE_URL, Settings::VERSION_FILE_PATH,)
|
||||
download_file(Settings::VERSION_FILE_URL,Settings::VERSION_FILE_PATH,)
|
||||
version_file = File.open(Settings::VERSION_FILE_PATH, "r")
|
||||
version = version_file.first
|
||||
version_file.close
|
||||
|
||||
@@ -285,7 +285,9 @@ class PokemonLoadScreen
|
||||
def try_load_backup(file_path)
|
||||
if File.file?(file_path + ".bak")
|
||||
pbMessage(_INTL("The save file is corrupt. A backup will be loaded."))
|
||||
save_data = load_save_file(file_path + ".bak")
|
||||
file_copy(file_path, SaveData.get_backup_file_path)
|
||||
File.rename(file_path + '.bak', file_path)
|
||||
save_data = load_save_file(file_path)
|
||||
else
|
||||
self.prompt_save_deletion(file_path)
|
||||
return {}
|
||||
@@ -694,6 +696,9 @@ module Game
|
||||
$Trainer.save_slot = slot unless auto
|
||||
$Trainer.last_time_saved = Time.now
|
||||
begin
|
||||
if File.exists?(file_path)
|
||||
file_copy(file_path, file_path + '.bak')
|
||||
end
|
||||
SaveData.save_to_file(file_path)
|
||||
Graphics.frame_reset
|
||||
rescue IOError, SystemCallError
|
||||
|
||||
@@ -41,7 +41,7 @@ def getRockSmashItemList(inclRareItems)
|
||||
:REVIVE,:NUGGET,:DIAMOND]
|
||||
|
||||
fossilItems = [:ROOTFOSSIL,:CLAWFOSSIL,:DOMEFOSSIL,:HELIXFOSSIL,
|
||||
:SKULLFOSSIL,:ARMORFOSSIL,:JAWFOSSIL,:SAILFOSSIL]
|
||||
:SKULLFOSSIL,:ARMORFOSSIL]
|
||||
|
||||
# Kernel.pbMessage(inclRareItems.to_s)
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ def useLantern()
|
||||
Kernel.pbMessage(_INTL("It's already illuminated..."))
|
||||
return false
|
||||
end
|
||||
Kernel.pbMessage(_INTL("The Lantern illuminated the area!"))
|
||||
Kernel.pbMessage(_INTL("The Lantern illuminated the cave!"))
|
||||
darkness.radius += 176
|
||||
$PokemonGlobal.flashUsed = true
|
||||
while darkness.radius < 176
|
||||
@@ -208,7 +208,7 @@ ItemHandlers::UseFromBag.add(:LANTERN, proc { |item|
|
||||
Kernel.pbMessage(_INTL("The cave is already illuminated."))
|
||||
next false
|
||||
end
|
||||
Kernel.pbMessage(_INTL("The Lantern illuminated the area!"))
|
||||
Kernel.pbMessage(_INTL("The Lantern illuminated the cave!"))
|
||||
$PokemonGlobal.flashUsed = true
|
||||
darkness.radius += 176
|
||||
while darkness.radius < 176
|
||||
@@ -388,17 +388,6 @@ def useDreamMirror
|
||||
Kernel.pbMessage(_INTL("You can see a faint glimpse of {1} in the reflection.", map_name))
|
||||
end
|
||||
|
||||
|
||||
def useStrangePlant
|
||||
if darknessEffectOnCurrentMap()
|
||||
Kernel.pbMessage(_INTL("The strange plant appears to be glowing."))
|
||||
$scene.spriteset.addUserSprite(LightEffect_GlowPlant.new($game_player))
|
||||
else
|
||||
Kernel.pbMessage(_INTL("It had no effect"))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
#DREAMMIRROR
|
||||
ItemHandlers::UseFromBag.add(:DREAMMIRROR, proc { |item|
|
||||
useDreamMirror
|
||||
@@ -410,17 +399,6 @@ ItemHandlers::UseInField.add(:DREAMMIRROR, proc { |item|
|
||||
next 1
|
||||
})
|
||||
|
||||
#STRANGE PLANT
|
||||
ItemHandlers::UseFromBag.add(:STRANGEPLANT, proc { |item|
|
||||
useStrangePlant()
|
||||
next 1
|
||||
})
|
||||
|
||||
ItemHandlers::UseInField.add(:STRANGEPLANT, proc { |item|
|
||||
useStrangePlant()
|
||||
next 1
|
||||
})
|
||||
|
||||
ItemHandlers::UseFromBag.add(:MAGICBOOTS, proc { |item|
|
||||
if $DEBUG
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Take off the Magic Boots?"))
|
||||
@@ -484,52 +462,48 @@ end
|
||||
#########################
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:INFINITESPLICERS, proc { |item, pokemon, scene|
|
||||
next true if pbDNASplicing(pokemon, scene, item)
|
||||
next true if pbDNASplicing(pokemon, scene, true, true)
|
||||
next false
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:DNASPLICERS, proc { |item, pokemon, scene|
|
||||
next true if pbDNASplicing(pokemon, scene, item)
|
||||
next true if pbDNASplicing(pokemon, scene)
|
||||
next false
|
||||
})
|
||||
|
||||
ItemHandlers::UseInField.add(:DNASPLICERS, proc { |item|
|
||||
fusion_success = useSplicerFromField(item)
|
||||
fusion_success = useSplicerFromField(false, false)
|
||||
next 3 if fusion_success
|
||||
next false
|
||||
})
|
||||
|
||||
|
||||
ItemHandlers::UseInField.add(:SUPERSPLICERS, proc { |item|
|
||||
fusion_success = useSplicerFromField(item)
|
||||
fusion_success = useSplicerFromField(true, true)
|
||||
next 3 if fusion_success
|
||||
next false
|
||||
})
|
||||
|
||||
|
||||
ItemHandlers::UseInField.add(:INFINITESPLICERS, proc { |item|
|
||||
fusion_success = useSplicerFromField(item)
|
||||
fusion_success = useSplicerFromField(false, false)
|
||||
next true if fusion_success
|
||||
next false
|
||||
})
|
||||
|
||||
ItemHandlers::UseInField.add(:INFINITESPLICERS2, proc { |item|
|
||||
fusion_success = useSplicerFromField(item)
|
||||
fusion_success = useSplicerFromField(true, true)
|
||||
next true if fusion_success
|
||||
next false
|
||||
})
|
||||
|
||||
def isSuperSplicersMechanics(item)
|
||||
return [:SUPERSPLICERS,:INFINITESPLICERS2].include?(item)
|
||||
end
|
||||
|
||||
def useSplicerFromField(item)
|
||||
def useSplicerFromField(supersplicers, superSplicer_arg2)
|
||||
scene = PokemonParty_Scene.new
|
||||
scene.pbStartScene($Trainer.party,"Select a Pokémon")
|
||||
screen = PokemonPartyScreen.new(scene, $Trainer.party)
|
||||
chosen = screen.pbChoosePokemon("Select a Pokémon")
|
||||
pokemon = $Trainer.party[chosen]
|
||||
fusion_success = pbDNASplicing(pokemon, scene, item)
|
||||
fusion_success = pbDNASplicing(pokemon, scene, supersplicers, superSplicer_arg2)
|
||||
screen.pbEndScene
|
||||
scene.dispose
|
||||
return fusion_success
|
||||
@@ -768,7 +742,7 @@ def drawPokemonType(pokemon_id, x_pos = 192, y_pos = 264)
|
||||
end
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:SUPERSPLICERS, proc { |item, pokemon, scene|
|
||||
next true if pbDNASplicing(pokemon, scene, item)
|
||||
next true if pbDNASplicing(pokemon, scene, true, true)
|
||||
})
|
||||
|
||||
def returnItemsToBag(pokemon, poke2)
|
||||
@@ -899,18 +873,22 @@ ItemHandlers::UseOnPokemon.add(:DAMAGEUP, proc { |item, pokemon, scene|
|
||||
|
||||
#easter egg for evolving shellder into slowbro's tail
|
||||
ItemHandlers::UseOnPokemon.add(:SLOWPOKETAIL, proc { |item, pokemon, scene|
|
||||
echoln pokemon.species
|
||||
#next false if pokemon.species != :SHELLDER
|
||||
shellbroNum = NB_POKEMON * PBSpecies::SHELLDER + PBSpecies::SLOWBRO #SHELLBRO
|
||||
newspecies = pokemon.species == PBSpecies::SHELLDER ? shellbroNum : -1
|
||||
if newspecies <= 0
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
else
|
||||
pbFadeOutInWithMusic(99999) {
|
||||
evo = PokemonEvolutionScene.new
|
||||
evo.pbStartScreen(pokemon, :B90H80)
|
||||
evo.pbStartScreen(pokemon, newspecies)
|
||||
evo.pbEvolution(false)
|
||||
evo.pbEndScreen
|
||||
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 }) if scene.pbHasAnnotations?
|
||||
scene.pbRefresh
|
||||
}
|
||||
next true
|
||||
|
||||
end
|
||||
})
|
||||
#
|
||||
# ItemHandlers::UseOnPokemon.add(:SHINYSTONE, proc { |item, pokemon, scene|
|
||||
@@ -1314,17 +1292,17 @@ end
|
||||
#########################
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:INFINITESPLICERS, proc { |item, pokemon, scene|
|
||||
next true if pbDNASplicing(pokemon, scene, item)
|
||||
next true if pbDNASplicing(pokemon, scene)
|
||||
next false
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:INFINITESPLICERS2, proc { |item, pokemon, scene|
|
||||
next true if pbDNASplicing(pokemon, scene, item)
|
||||
next true if pbDNASplicing(pokemon, scene, true, true)
|
||||
next false
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:DNASPLICERS, proc { |item, pokemon, scene|
|
||||
next true if pbDNASplicing(pokemon, scene, item)
|
||||
next true if pbDNASplicing(pokemon, scene)
|
||||
next false
|
||||
})
|
||||
|
||||
@@ -1338,9 +1316,7 @@ def getPokemonPositionInParty(pokemon)
|
||||
end
|
||||
|
||||
#don't remember why there's two Supersplicers arguments.... probably a mistake
|
||||
def pbDNASplicing(pokemon, scene, item=:DNASPLICERS)
|
||||
is_supersplicer = isSuperSplicersMechanics(item)
|
||||
|
||||
def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
playingBGM = $game_system.getPlayingBGM
|
||||
dexNumber = pokemon.species_data.id_number
|
||||
if (pokemon.species_data.id_number <= NB_POKEMON)
|
||||
@@ -1372,7 +1348,7 @@ def pbDNASplicing(pokemon, scene, item=:DNASPLICERS)
|
||||
return false
|
||||
end
|
||||
|
||||
selectedHead = selectFusion(pokemon, poke2, is_supersplicer)
|
||||
selectedHead = selectFusion(pokemon, poke2, supersplicers)
|
||||
if selectedHead == -1 #cancelled
|
||||
return false
|
||||
end
|
||||
@@ -1391,8 +1367,8 @@ def pbDNASplicing(pokemon, scene, item=:DNASPLICERS)
|
||||
end
|
||||
end
|
||||
|
||||
if (Kernel.pbConfirmMessage(_INTL("Fuse {1} and {2}?",selectedHead.name,selectedBase.name)))
|
||||
pbFuse(selectedHead, selectedBase, item)
|
||||
if (Kernel.pbConfirmMessage(_INTL("Fuse the two Pokémon?")))
|
||||
pbFuse(selectedHead, selectedBase, superSplicer)
|
||||
pbRemovePokemonAt(chosen)
|
||||
scene.pbHardRefresh
|
||||
pbBGMPlay(playingBGM)
|
||||
@@ -1412,7 +1388,7 @@ def pbDNASplicing(pokemon, scene, item=:DNASPLICERS)
|
||||
end
|
||||
else
|
||||
#UNFUSE
|
||||
return true if pbUnfuse(pokemon, scene, is_supersplicer)
|
||||
return true if pbUnfuse(pokemon, scene, supersplicers)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1450,20 +1426,12 @@ end
|
||||
# end
|
||||
# end
|
||||
|
||||
def pbFuse(pokemon, poke2, splicer_item)
|
||||
|
||||
use_supersplicers_mechanics =isSuperSplicersMechanics(splicer_item)
|
||||
pokemon.spriteform_body=nil
|
||||
pokemon.spriteform_head=nil
|
||||
poke2.spriteform_body=nil
|
||||
poke2.spriteform_head=nil
|
||||
|
||||
def pbFuse(pokemon, poke2, supersplicers = false)
|
||||
newid = (pokemon.species_data.id_number) * NB_POKEMON + poke2.species_data.id_number
|
||||
fus = PokemonFusionScene.new
|
||||
|
||||
if (fus.pbStartScreen(pokemon, poke2, newid,splicer_item))
|
||||
if (fus.pbStartScreen(pokemon, poke2, newid))
|
||||
returnItemsToBag(pokemon, poke2)
|
||||
fus.pbFusionScreen(false, use_supersplicers_mechanics)
|
||||
fus.pbFusionScreen(false, supersplicers)
|
||||
$game_variables[VAR_FUSE_COUNTER] += 1 #fuse counter
|
||||
fus.pbEndScreen
|
||||
return true
|
||||
@@ -1471,9 +1439,6 @@ def pbFuse(pokemon, poke2, splicer_item)
|
||||
end
|
||||
|
||||
def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
||||
pokemon.spriteform_body=nil
|
||||
pokemon.spriteform_head=nil
|
||||
|
||||
bodyPoke = getBasePokemonID(pokemon.species_data.id_number, true)
|
||||
headPoke = getBasePokemonID(pokemon.species_data.id_number, false)
|
||||
|
||||
@@ -1604,6 +1569,8 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
||||
#On ajoute l'autre dans le pokedex aussi
|
||||
$Trainer.pokedex.set_seen(poke1.species)
|
||||
$Trainer.pokedex.set_owned(poke1.species)
|
||||
$Trainer.pokedex.set_seen(poke2.species)
|
||||
$Trainer.pokedex.set_owned(poke2.species)
|
||||
|
||||
pokemon.species = poke1.species
|
||||
pokemon.level = poke1.level
|
||||
@@ -1621,7 +1588,7 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
||||
end
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:SUPERSPLICERS, proc { |item, pokemon, scene|
|
||||
next true if pbDNASplicing(pokemon, scene, item)
|
||||
next true if pbDNASplicing(pokemon, scene, true, true)
|
||||
})
|
||||
|
||||
def returnItemsToBag(pokemon, poke2)
|
||||
|
||||
@@ -1,44 +1,33 @@
|
||||
class PokedexUtils
|
||||
# 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", "aa", "ab", "ac", "ad", "ae", "af", "ag", "ah",
|
||||
# "ai", "aj", "ak", "al", "am", "an", "ao", "ap", "aq", "ar", "as", "at", "au", "av", "aw", "ax",
|
||||
# "ay", "az"]
|
||||
|
||||
def getAltLettersList()
|
||||
return ('a'..'z').to_a + ('aa'..'az').to_a
|
||||
end
|
||||
|
||||
def pbGetAvailableAlts(species, form_index = 0)
|
||||
if form_index
|
||||
form_suffix = form_index <= 0 ? "" : "_" + form_index.to_s
|
||||
else
|
||||
form_suffix = ""
|
||||
end
|
||||
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 = []
|
||||
return ret if !species
|
||||
dexNum = getDexNumberForSpecies(species)
|
||||
isFusion = dexNum > NB_POKEMON
|
||||
if !isFusion
|
||||
ret << Settings::BATTLERS_FOLDER + dexNum.to_s + form_suffix + "/" + dexNum.to_s + form_suffix + ".png"
|
||||
ret << Settings::BATTLERS_FOLDER + dexNum.to_s + "/" + dexNum.to_s + ".png"
|
||||
|
||||
getAltLettersList().each { |alt_letter|
|
||||
altFilePath = Settings::CUSTOM_BASE_SPRITES_FOLDER + dexNum.to_s + form_suffix + alt_letter + ".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)
|
||||
head_id = getHeadID(species, body_id)
|
||||
|
||||
baseFilename = head_id.to_s + "." + body_id.to_s + form_suffix
|
||||
baseFilename = head_id.to_s + "." + body_id.to_s
|
||||
baseFilePath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + head_id.to_s + "/" + baseFilename + ".png"
|
||||
if pbResolveBitmap(baseFilePath)
|
||||
ret << baseFilePath
|
||||
end
|
||||
getAltLettersList().each { |alt_letter|
|
||||
POSSIBLE_ALTS.each { |alt_letter|
|
||||
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)
|
||||
|
||||
@@ -70,7 +70,6 @@ def pbColor(color)
|
||||
end
|
||||
|
||||
defaultQuestColor = :PURPLE
|
||||
specialQuestColor = :DARKRED
|
||||
questBranchHotels = "Hotel Quests"
|
||||
questBranchField = "Field Quests"
|
||||
|
||||
@@ -125,7 +124,7 @@ QUESTS = [
|
||||
Quest.new(30, "Diamonds and Pearls", "Find a Diamond Necklace to save the man's marriage.", questBranchHotels, "BW (71)", "Cinnabar Island", defaultQuestColor),
|
||||
|
||||
#Goldenrod City
|
||||
Quest.new(31, "Hoenn Pokémon", "A woman wants you to show her a Pokémon native to the Hoenn region.", questBranchHotels, "BW (48)", "Goldenrod City", defaultQuestColor),
|
||||
Quest.new(31, "Hoenn Pokémon", "A woman wants you to show her a Pokémon native to the Hoenn region.", questBranchHotels, "BW (37)", "Goldenrod City", defaultQuestColor),
|
||||
Quest.new(32, "Safari Souvenir!", "Bring back a souvenir from the Fuchsia City Safari Zone", questBranchHotels, "BW (28)", "Goldenrod City", defaultQuestColor),
|
||||
|
||||
#Violet City
|
||||
@@ -150,20 +149,6 @@ QUESTS = [
|
||||
Quest.new(45, "First Contact (Part 2)", "Ask the sailor at Cinnabar Island's harbour to take you to the uncharted island where the spaceship might be located", questBranchHotels, "BW (92)", "Bond Bridge", defaultQuestColor),
|
||||
Quest.new(46, "The rarest fish", "A fisherman wants you to show him a Feebas. Apparently they can be fished around the Sevii Islands when it rains.", questBranchField, "BW056", "Kin Island", defaultQuestColor),
|
||||
|
||||
#Necrozma quest
|
||||
Quest.new(47, "Mysterious prisms", "You found a pedestal with a mysterious prism on it. There seems to be room for more prisms.", questBranchField, "BW_Sabrina", "Pokémon Tower", specialQuestColor),
|
||||
|
||||
Quest.new(48, "The long night (Part 1)", "A mysterious darkness has shrouded some of the region. Meet Sabrina outside of Saffron City's western gate to investigate.", questBranchField, "BW_Sabrina", "Lavender Town", specialQuestColor),
|
||||
Quest.new(49, "The long night (Part 2)", "The mysterious darkness has expended. Meet Sabrina on top of Celadon City's Dept. Store to figure out the source of the darkness.", questBranchField, "BW_Sabrina", "Route 7", specialQuestColor),
|
||||
Quest.new(50, "The long night (Part 3)", "Fuchsia City appears to be unaffected by the darkness. Go investigate to see if you can find out more information.", questBranchField, "BW_Sabrina", "Celadon City", specialQuestColor),
|
||||
Quest.new(51, "The long night (Part 4)", "The mysterious darkness has expended yet again and strange plants have appeared. Follow the plants to see where they lead.", questBranchField, "BW_koga", "Fuchsia City", specialQuestColor),
|
||||
Quest.new(52, "The long night (Part 5)", "You found a strange fruit that appears to be related to the mysterious darkness. Go see professor Oak to have it analyzed.", questBranchField, "BW029", "Safari Zone", specialQuestColor),
|
||||
Quest.new(53, "The long night (Part 6)", "The strange plant you found appears to glow in the mysterious darkness that now covers the entire region. Try to follow the glow to find out the source of the disturbance.", questBranchField, "BW-oak", "Pallet Town", specialQuestColor),
|
||||
|
||||
Quest.new(54, "Nectar garden", "An old man wants you to bring differently colored flowers for the city's garden.", questBranchField, "BW (039)", "Pewter City", defaultQuestColor),
|
||||
Quest.new(55, "The Cursed Forest", "A child wants you to find a floating tree stump in Ilex Forest. What could she be talking about?", questBranchHotels, "BW109", "Goldenrod City", defaultQuestColor),
|
||||
Quest.new(56, "Bitey Pokémon", "A fisherman wants to know what is the sharp-toothed Pokémon that bit him in the Safari Zone's lake.", questBranchHotels, "BW (71)", "Fuchsia City", defaultQuestColor),
|
||||
|
||||
# attention: c'est un array et non un hash... l'id est en fait l'index, donc il est important de garder l'ordre
|
||||
#out of order quests
|
||||
#42 (cinnabar)
|
||||
@@ -174,8 +159,7 @@ class PokeBattle_Trainer
|
||||
attr_accessor :quests
|
||||
end
|
||||
|
||||
|
||||
def pbAcceptNewQuest(id, bubblePosition = 20, show_description=true)
|
||||
def pbAcceptNewQuest(id, bubblePosition = 20)
|
||||
return if isQuestAlreadyAccepted?(id)
|
||||
$game_variables[96] += 1 #nb. quests accepted
|
||||
$game_variables[97] += 1 #nb. quests active
|
||||
@@ -187,10 +171,8 @@ def pbAcceptNewQuest(id, bubblePosition = 20, show_description=true)
|
||||
|
||||
pbCallBub(1, bubblePosition)
|
||||
Kernel.pbMessage("\\C[6]NEW QUEST: " + title)
|
||||
if show_description
|
||||
pbCallBub(1, bubblePosition)
|
||||
Kernel.pbMessage("\\C[1]" + description)
|
||||
end
|
||||
pbCallBub(1, bubblePosition)
|
||||
Kernel.pbMessage("\\C[1]" + description)
|
||||
pbAddQuest(id)
|
||||
end
|
||||
|
||||
@@ -203,9 +185,6 @@ def isQuestAlreadyAccepted?(id)
|
||||
end
|
||||
|
||||
def finishQuest(id)
|
||||
pbMEPlay("Register phone")
|
||||
Kernel.pbMessage("\\C[6]Quest completed!")
|
||||
|
||||
$game_variables[222] += 1 # karma
|
||||
$game_variables[97] -= 1 #nb. quests active
|
||||
$game_variables[98] += 1 #nb. quests completed
|
||||
@@ -336,6 +315,7 @@ class Questlog
|
||||
pbDrawOutlineText(@main, 0, 142, 512, 384, "Ongoing: " + @ongoing.size.to_s, Color.new(255, 255, 255), Color.new(0, 0, 0), 1)
|
||||
pbDrawOutlineText(@main, 0, 198, 512, 384, "Completed: " + @completed.size.to_s, Color.new(255, 255, 255), Color.new(0, 0, 0), 1)
|
||||
|
||||
|
||||
12.times do |i|
|
||||
Graphics.update
|
||||
@sprites["bg0"].opacity += 32 if i < 8
|
||||
@@ -797,9 +777,11 @@ class Questlog
|
||||
@sprites["completed#{i}"].src_rect.height = (@sprites["completed#{i}"].bitmap.height / 2).round
|
||||
@sprites["completed#{i}"].src_rect.y = (@sprites["completed#{i}"].bitmap.height / 2).round if i == @sel_two
|
||||
@sprites["completed#{i}"].opacity = 0
|
||||
pbDrawOutlineText(@main, 11, getCellYPosition(i), 512, 384, @completed[i].name, @completed[i].color, Color.new(0, 0, 0), 1)
|
||||
pbDrawOutlineText(@main, 11,getCellYPosition(i), 512, 384, @completed[i].name, @completed[i].color, Color.new(0, 0, 0), 1)
|
||||
end
|
||||
|
||||
|
||||
|
||||
pbDrawOutlineText(@main, 0, 175, 512, 384, "No completed quests", pbColor(:WHITE), pbColor(:BLACK), 1) if @completed.size == 0
|
||||
pbDrawOutlineText(@main, 0, 2, 512, 384, "Completed Quests", Color.new(255, 255, 255), Color.new(0, 0, 0), 1)
|
||||
12.times do |i|
|
||||
@@ -814,10 +796,10 @@ class Questlog
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def getCellYPosition(i)
|
||||
return 56 + (52 * i)
|
||||
end
|
||||
|
||||
def pbEnd
|
||||
12.times do |i|
|
||||
Graphics.update
|
||||
@@ -825,7 +807,7 @@ class Questlog
|
||||
@sprites["btn0"].opacity -= 32 if @sprites["btn0"]
|
||||
@sprites["btn1"].opacity -= 32 if @sprites["btn1"]
|
||||
@sprites["main"].opacity -= 32 if @sprites["main"]
|
||||
@sprites["char"].opacity -= 40 if @sprites["char"] rescue nil
|
||||
@sprites["char"].opacity -= 40 if @sprites["char"]rescue nil
|
||||
@sprites["char2"].opacity -= 40 if @sprites["char2"] rescue nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -55,9 +55,7 @@ module Graphics
|
||||
$GameSpeed = 0 if $GameSpeed >= SPEEDUP_STAGES.size
|
||||
end
|
||||
$frame += 1
|
||||
speedStage = SPEEDUP_STAGES[$GameSpeed]
|
||||
speedStage=5 if $DEBUG && Input.press?(Input::SHIFT)
|
||||
return unless $frame % speedStage == 0
|
||||
return unless $frame % SPEEDUP_STAGES[$GameSpeed] == 0
|
||||
fast_forward_update
|
||||
$frame = 0
|
||||
end
|
||||
|
||||
@@ -222,7 +222,12 @@ def getFusionSpeciesSymbol(body, head)
|
||||
return GameData::Species.get(id).species
|
||||
end
|
||||
|
||||
|
||||
def getFusionSpecies(body, head)
|
||||
body_num = dexNum(body)
|
||||
head_num = dexNum(head)
|
||||
id = body_num * Settings::NB_POKEMON + head_num
|
||||
return GameData::Species.get(id)
|
||||
end
|
||||
|
||||
#
|
||||
def evolveHead(species)
|
||||
|
||||
@@ -14,15 +14,16 @@ class PokemonPokedexInfo_Scene
|
||||
X_POSITION_BG_SELECTED = 145
|
||||
X_POSITION_BG_NEXT = 363
|
||||
|
||||
def drawPageForms()
|
||||
def drawPageForms
|
||||
#@selected_index=0
|
||||
|
||||
@sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_forms"))
|
||||
overlay = @sprites["overlay"].bitmap
|
||||
base = Color.new(88, 88, 80)
|
||||
shadow = Color.new(168, 184, 184)
|
||||
|
||||
#alts_list= pbGetAvailableAlts
|
||||
@selected_index = 0 if !@selected_index
|
||||
@selected_index = 0
|
||||
update_displayed
|
||||
end
|
||||
|
||||
@@ -50,16 +51,9 @@ class PokemonPokedexInfo_Scene
|
||||
end
|
||||
|
||||
def initializeSpritesPage(altsList)
|
||||
@forms_list = list_pokemon_forms()
|
||||
@formIndex = 0
|
||||
|
||||
init_selected_bg
|
||||
@speciesData = getSpecies(@species)
|
||||
|
||||
@selected_index = 0
|
||||
set_displayed_to_current_alt(altsList)
|
||||
|
||||
|
||||
@sprites["selectedSprite"] = IconSprite.new(0, 0, @viewport)
|
||||
@sprites["selectedSprite"].x = X_POSITION_SELECTED
|
||||
@sprites["selectedSprite"].y = Y_POSITION_BIG
|
||||
@@ -100,36 +94,19 @@ class PokemonPokedexInfo_Scene
|
||||
|
||||
end
|
||||
|
||||
|
||||
def set_displayed_to_current_alt(altsList)
|
||||
species_id = getDexNumberForSpecies(@species).to_s
|
||||
return if !$PokemonGlobal.alt_sprite_substitutions[species_id]
|
||||
|
||||
current_sprite =$PokemonGlobal.alt_sprite_substitutions[species_id]
|
||||
index = @selected_index
|
||||
for alt in altsList
|
||||
if alt == current_sprite
|
||||
@selected_index = index
|
||||
return
|
||||
end
|
||||
index +=1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def pbGetAvailableForms(species=nil)
|
||||
chosen_species = species != nil ? species : @species
|
||||
dex_num = getDexNumberForSpecies(chosen_species)
|
||||
def pbGetAvailableForms
|
||||
dex_num = getDexNumberForSpecies(@species)
|
||||
if dex_num <= NB_POKEMON
|
||||
download_all_unfused_alt_sprites(dex_num)
|
||||
download_unfused_alt_sprites(dex_num)
|
||||
else
|
||||
body_id = getBodyID(chosen_species)
|
||||
head_id = getHeadID(chosen_species, body_id)
|
||||
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_all_alt_sprites(head_id, body_id)
|
||||
download_alt_sprites(head_id, body_id)
|
||||
end
|
||||
return PokedexUtils.new.pbGetAvailableAlts(chosen_species, @formIndex)
|
||||
|
||||
return PokedexUtils.new.pbGetAvailableAlts(@species)
|
||||
end
|
||||
|
||||
def hide_all_selected_windows
|
||||
@@ -158,11 +135,10 @@ class PokemonPokedexInfo_Scene
|
||||
if previousIndex < 0
|
||||
previousIndex = @available.size - 1
|
||||
end
|
||||
@sprites["previousSprite"].visible = @available.size > 2
|
||||
@sprites["nextSprite"].visible = @available.size > 1
|
||||
@sprites["previousSprite"].visible = false if @available.size <= 2
|
||||
@sprites["nextSprite"].visible = false if @available.size <= 1
|
||||
|
||||
@sprites["previousSprite"].setBitmap(@available[previousIndex]) if previousIndex != nextIndex
|
||||
|
||||
@sprites["selectedSprite"].setBitmap(@available[@selected_index])
|
||||
@sprites["nextSprite"].setBitmap(@available[nextIndex])
|
||||
|
||||
@@ -197,85 +173,33 @@ class PokemonPokedexInfo_Scene
|
||||
pbDrawTextPositions(@creditsOverlay, textpos)
|
||||
end
|
||||
|
||||
def list_pokemon_forms
|
||||
dexNum = dexNum(@species)
|
||||
if dexNum > NB_POKEMON
|
||||
body_id = getBodyID(dexNum)
|
||||
else
|
||||
if @species.is_a?(Symbol)
|
||||
body_id = get_body_number_from_symbol(@species)
|
||||
else
|
||||
body_id = dexNum
|
||||
end
|
||||
end
|
||||
forms_list = []
|
||||
found_last_form = false
|
||||
form_index = 0
|
||||
while !found_last_form
|
||||
form_index += 1
|
||||
form_path = Settings::BATTLERS_FOLDER + body_id.to_s + "_" + form_index.to_s
|
||||
echoln form_path
|
||||
if File.directory?(form_path)
|
||||
forms_list << form_index
|
||||
else
|
||||
found_last_form = true
|
||||
end
|
||||
end
|
||||
return forms_list
|
||||
end
|
||||
|
||||
|
||||
|
||||
def pbChooseAlt(brief=false)
|
||||
def pbChooseForm
|
||||
loop do
|
||||
@sprites["rightarrow"].visible = true
|
||||
@sprites["leftarrow"].visible = true
|
||||
if @forms_list.length >= 1
|
||||
@sprites["uparrow"].visible = true
|
||||
@sprites["downarrow"].visible = true
|
||||
end
|
||||
multiple_forms = @forms_list.length > 0
|
||||
@sprites["uparrow"].visible = true
|
||||
@sprites["downarrow"].visible = true
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdate
|
||||
if Input.trigger?(Input::LEFT)
|
||||
if Input.trigger?(Input::RIGHT)
|
||||
pbPlayCursorSE
|
||||
@selected_index -= 1 #(index+@available.length-1)%@available.length
|
||||
if @selected_index < 0
|
||||
@selected_index = @available.size - 1
|
||||
end
|
||||
update_displayed
|
||||
elsif Input.trigger?(Input::RIGHT)
|
||||
elsif Input.trigger?(Input::LEFT)
|
||||
pbPlayCursorSE
|
||||
@selected_index += 1
|
||||
@selected_index += 1 #= (index+1)%@available.length
|
||||
if @selected_index > @available.size - 1
|
||||
@selected_index = 0
|
||||
end
|
||||
update_displayed
|
||||
elsif Input.trigger?(Input::UP) && multiple_forms
|
||||
pbPlayCursorSE
|
||||
@formIndex += 1
|
||||
if @formIndex > @forms_list.length
|
||||
@formIndex = 0
|
||||
end
|
||||
@available = pbGetAvailableForms()
|
||||
@selected_index = 0
|
||||
update_displayed
|
||||
elsif Input.trigger?(Input::DOWN) && multiple_forms
|
||||
pbPlayCursorSE
|
||||
@formIndex -= 1
|
||||
if @formIndex < 0
|
||||
@formIndex = @forms_list.length
|
||||
end
|
||||
@available = pbGetAvailableForms()
|
||||
@selected_index = 0
|
||||
update_displayed
|
||||
elsif Input.trigger?(Input::BACK)
|
||||
pbPlayCancelSE
|
||||
break
|
||||
elsif Input.trigger?(Input::USE)
|
||||
pbPlayDecisionSE
|
||||
if select_sprite(brief)
|
||||
if select_sprite
|
||||
@endscene = true
|
||||
break
|
||||
end
|
||||
@@ -303,7 +227,7 @@ class PokemonPokedexInfo_Scene
|
||||
index = @selected_index
|
||||
end
|
||||
selected_sprite = @available[index]
|
||||
species_id = getDexNumberForSpecies(@species).to_s
|
||||
species_id = getDexNumberForSpecies(@species)
|
||||
$PokemonGlobal.alt_sprite_substitutions = {} if !$PokemonGlobal.alt_sprite_substitutions
|
||||
if $PokemonGlobal.alt_sprite_substitutions[species_id]
|
||||
return $PokemonGlobal.alt_sprite_substitutions[species_id] == selected_sprite
|
||||
@@ -320,28 +244,14 @@ class PokemonPokedexInfo_Scene
|
||||
return spritename.match?(/[a-zA-Z]/)
|
||||
end
|
||||
|
||||
def select_sprite(brief=false)
|
||||
if @available.length > 1
|
||||
if is_main_sprite
|
||||
if brief
|
||||
pbMessage("This sprite will remain the displayed sprite")
|
||||
return true
|
||||
else
|
||||
pbMessage("This sprite is already the displayed sprite")
|
||||
end
|
||||
else
|
||||
if @forms_list.length > 0
|
||||
message = _INTL('Would you like to use this sprite instead of the current sprite for form {1}?', @formIndex)
|
||||
else
|
||||
message = 'Would you like to use this sprite instead of the current sprite?'
|
||||
end
|
||||
if pbConfirmMessage(_INTL(message))
|
||||
swap_main_sprite()
|
||||
return true
|
||||
end
|
||||
end
|
||||
def select_sprite
|
||||
if is_main_sprite
|
||||
pbMessage("This sprite is already the displayed sprite")
|
||||
else
|
||||
pbMessage("This is the only sprite available for this Pokémon!")
|
||||
if pbConfirmMessage(_INTL('Would you like to use this sprite instead of the current sprite?'))
|
||||
swap_main_sprite()
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
@@ -350,7 +260,7 @@ class PokemonPokedexInfo_Scene
|
||||
old_main_sprite = @available[0]
|
||||
new_main_sprite = @available[@selected_index]
|
||||
species_number = dexNum(@species)
|
||||
set_alt_sprite_substitution(species_number, new_main_sprite, @formIndex)
|
||||
set_alt_sprite_substitution(species_number, new_main_sprite)
|
||||
end
|
||||
|
||||
# def swap_main_sprite
|
||||
@@ -391,14 +301,9 @@ class PokemonGlobalMetadata
|
||||
attr_accessor :alt_sprite_substitutions
|
||||
end
|
||||
|
||||
def set_alt_sprite_substitution(original_sprite_name, selected_alt, formIndex = 0)
|
||||
def set_alt_sprite_substitution(original_sprite_name, selected_alt)
|
||||
if !$PokemonGlobal.alt_sprite_substitutions
|
||||
$PokemonGlobal.alt_sprite_substitutions = {}
|
||||
end
|
||||
if formIndex
|
||||
form_suffix = formIndex != 0 ? "_" + formIndex.to_s : ""
|
||||
else
|
||||
form_suffix = ""
|
||||
end
|
||||
$PokemonGlobal.alt_sprite_substitutions[original_sprite_name.to_s + form_suffix] = selected_alt
|
||||
$PokemonGlobal.alt_sprite_substitutions[original_sprite_name] = selected_alt
|
||||
end
|
||||
|
||||
@@ -98,7 +98,7 @@ def pbWonderTrade(lvl, except = [], except2 = [], premiumWonderTrade = true)
|
||||
end
|
||||
if species > 0
|
||||
skipLegendaryCheck = premiumWonderTrade && rand(100) < luck
|
||||
species = 0 if pokemonIsPartLegendary(species) && !$game_switches[SWITCH_BEAT_THcE_LEAGUE] && !skipLegendaryCheck
|
||||
species = 0 if pokemonIsPartLegendary(species) && !$game_switches[SWITCH_BEAT_THE_LEAGUE] && !skipLegendaryCheck
|
||||
end
|
||||
#Redo loop if below BST - 200
|
||||
species = 0 if bst < (chosenBST - 200)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
EXPORT_EXCEPT_MAP_IDS= [768,722,723,724,720]
|
||||
|
||||
def exportAllMaps
|
||||
for id in 810..815
|
||||
for id in 1..798
|
||||
begin
|
||||
MapExporter.export(id, [:Events]) if !EXPORT_EXCEPT_MAP_IDS.include?(id)
|
||||
rescue
|
||||
@@ -11,16 +11,6 @@ def exportAllMaps
|
||||
end
|
||||
end
|
||||
|
||||
def exportSpecificMaps(maps_to_export)
|
||||
for id in maps_to_export
|
||||
begin
|
||||
MapExporter.export(id, [:Events])
|
||||
rescue
|
||||
echo "error in " +(id.to_s) +"\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
module MapExporter
|
||||
@@map = nil
|
||||
|
||||
Reference in New Issue
Block a user