This commit is contained in:
infinitefusion
2021-06-25 20:33:47 -04:00
parent ba536c0b02
commit 84d885d4b0
14 changed files with 5150 additions and 379 deletions

26
.gitignore vendored
View File

@@ -2,7 +2,7 @@
Audio/ Audio/
Graphics/ Graphics/
Plugins/ Plugins/
PBS/pokemon.txt
# Data folder, but not Data/Scripts folder # Data folder, but not Data/Scripts folder
Data/* Data/*
!Data/Scripts.rxdata !Data/Scripts.rxdata
@@ -27,4 +27,26 @@ Thumbs.db
# Temp files # Temp files
~* ~*
/.gitignore
/Graphics/Battlers/
/Graphics/CustomBattlers/
/Graphics/CustomBattlers_backup/
/data_backup/
/PBS/pokemon.txt
/PBS/pokemon_381.txt
/PBS/pokemon_419.txt
/PBS/pokemon_fr.txt
/PBS/pokemon-fr-iso.txt
/etc/
/Saves/
/Data - Copy/
/extendtext.exe
/fluidsynth.dll
/mkxp.json
/mkxp-z.exe
/Data.zip
/patch/
/build/
/bin/

Binary file not shown.

View File

@@ -6,15 +6,21 @@
module Settings module Settings
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format. # The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
GAME_VERSION = '1.0.0' GAME_VERSION = '5.0.0'
#Infinite fusion settings
NB_POKEMON = 420
CUSTOM_BATTLERS_FOLDER="Graphics/CustomBattlers/"
BATTLERS_FOLDER="Graphics/Battlers/"
FRONTSPRITE_POSITION_OFFSET = 75
BACKSPRITE_POSITION_OFFSET = 60
# The generation that the battle system follows. Used throughout the battle # The generation that the battle system follows. Used throughout the battle
# scripts, and also by some other settings which are used in and out of battle # scripts, and also by some other settings which are used in and out of battle
# (you can of course change those settings to suit your game). # (you can of course change those settings to suit your game).
# Note that this isn't perfect. Essentials doesn't accurately replicate every # Note that this isn't perfect. Essentials doesn't accurately replicate every
# single generation's mechanics. It's considered to be good enough. Only # single generation's mechanics. It's considered to be good enough. Only
# generations 5 and later are reasonably supported. # generations 5 and later are reasonably supported.
MECHANICS_GENERATION = 7 MECHANICS_GENERATION = 5
#============================================================================= #=============================================================================

View File

@@ -4,33 +4,85 @@
class AnimatedBitmap class AnimatedBitmap
def initialize(file, hue = 0) def initialize(file, hue = 0)
raise "Filename is nil (missing graphic)." if file.nil? raise "Filename is nil (missing graphic)." if file.nil?
path = file path = file
filename = "" filename = ""
if file.last != '/' # Isn't just a directory if file.last != '/' # Isn't just a directory
split_file = file.split(/[\\\/]/) split_file = file.split(/[\\\/]/)
filename = split_file.pop filename = split_file.pop
path = split_file.join('/') + '/' path = split_file.join('/') + '/'
end end
if filename[/^\[\d+(?:,\d+)?\]/] # Starts with 1 or 2 numbers in square brackets if filename[/^\[\d+(?:,\d+)?\]/] # Starts with 1 or 2 numbers in square brackets
@bitmap = PngAnimatedBitmap.new(path, filename, hue) @bitmap = PngAnimatedBitmap.new(path, filename, hue)
else else
@bitmap = GifBitmap.new(path, filename, hue) @bitmap = GifBitmap.new(path, filename, hue)
end end
end end
def [](index); @bitmap[index]; end def [](index)
def width; @bitmap.bitmap.width; end ; @bitmap[index];
def height; @bitmap.bitmap.height; end end
def length; @bitmap.length; end
def each; @bitmap.each { |item| yield item }; end def width
def bitmap; @bitmap.bitmap; end @bitmap.bitmap.width;
def currentIndex; @bitmap.currentIndex; end end
def totalFrames; @bitmap.totalFrames; end
def disposed?; @bitmap.disposed?; end def height
def update; @bitmap.update; end @bitmap.bitmap.height;
def dispose; @bitmap.dispose; end end
def deanimate; @bitmap.deanimate; end
def copy; @bitmap.copy; end def length
@bitmap.length;
end
def each
@bitmap.each { |item| yield item };
end
def bitmap
@bitmap.bitmap;
end
def currentIndex
@bitmap.currentIndex;
end
def totalFrames
@bitmap.totalFrames;
end
def disposed?
@bitmap.disposed?;
end
def update
@bitmap.update;
end
def dispose
@bitmap.dispose;
end
def deanimate
@bitmap.deanimate;
end
def copy
@bitmap.copy;
end
def mirror
for x in 0..@bitmap.bitmap.width / 2
for y in 0..@bitmap.bitmap.height - 2
temp = @bitmap.bitmap.get_pixel(x, y)
newPix = @bitmap.bitmap.get_pixel((@bitmap.bitmap.width - x), y)
@bitmap.bitmap.set_pixel(x, y, newPix)
@bitmap.bitmap.set_pixel((@bitmap.bitmap.width - x), y, temp)
end
end
end
end end
#=============================================================================== #===============================================================================
@@ -41,15 +93,15 @@ class PngAnimatedBitmap
# Creates an animated bitmap from a PNG file. # Creates an animated bitmap from a PNG file.
def initialize(dir, filename, hue = 0) def initialize(dir, filename, hue = 0)
@frames = [] @frames = []
@currentFrame = 0 @currentFrame = 0
@framecount = 0 @framecount = 0
panorama = RPG::Cache.load_bitmap(dir, filename, hue) panorama = RPG::Cache.load_bitmap(dir, filename, hue)
if filename[/^\[(\d+)(?:,(\d+))?\]/] # Starts with 1 or 2 numbers in brackets if filename[/^\[(\d+)(?:,(\d+))?\]/] # Starts with 1 or 2 numbers in brackets
# File has a frame count # File has a frame count
numFrames = $1.to_i numFrames = $1.to_i
delay = $2.to_i delay = $2.to_i
delay = 10 if delay == 0 delay = 10 if delay == 0
raise "Invalid frame count in #{filename}" if numFrames <= 0 raise "Invalid frame count in #{filename}" if numFrames <= 0
raise "Invalid frame delay in #{filename}" if delay <= 0 raise "Invalid frame delay in #{filename}" if delay <= 0
if panorama.width % numFrames != 0 if panorama.width % numFrames != 0
@@ -72,8 +124,13 @@ class PngAnimatedBitmap
return @frames[index] return @frames[index]
end end
def width; self.bitmap.width; end def width
def height; self.bitmap.height; end self.bitmap.width;
end
def height
self.bitmap.height;
end
def deanimate def deanimate
for i in 1...@frames.length for i in 1...@frames.length
@@ -149,9 +206,9 @@ class GifBitmap
# Creates a bitmap from a GIF file. Can also load non-animated bitmaps. # Creates a bitmap from a GIF file. Can also load non-animated bitmaps.
def initialize(dir, filename, hue = 0) def initialize(dir, filename, hue = 0)
@bitmap = nil @bitmap = nil
@disposed = false @disposed = false
filename = "" if !filename filename = "" if !filename
begin begin
@bitmap = RPG::Cache.load_bitmap(dir, filename, hue) @bitmap = RPG::Cache.load_bitmap(dir, filename, hue)
rescue rescue
@@ -225,14 +282,14 @@ def pbGetTileBitmap(filename, tile_id, hue, width = 1, height = 1)
} }
end end
def pbGetTileset(name,hue=0) def pbGetTileset(name, hue = 0)
return AnimatedBitmap.new("Graphics/Tilesets/" + name, hue).deanimate return AnimatedBitmap.new("Graphics/Tilesets/" + name, hue).deanimate
end end
def pbGetAutotile(name,hue=0) def pbGetAutotile(name, hue = 0)
return AnimatedBitmap.new("Graphics/Autotiles/" + name, hue).deanimate return AnimatedBitmap.new("Graphics/Autotiles/" + name, hue).deanimate
end end
def pbGetAnimation(name,hue=0) def pbGetAnimation(name, hue = 0)
return AnimatedBitmap.new("Graphics/Animations/" + name, hue).deanimate return AnimatedBitmap.new("Graphics/Animations/" + name, hue).deanimate
end end

View File

@@ -208,10 +208,10 @@ module GameData
else else
if (index & 1) == 0 # Player's Pokémon if (index & 1) == 0 # Player's Pokémon
sprite.x += @back_sprite_x * 2 sprite.x += @back_sprite_x * 2
sprite.y += @back_sprite_y * 2 sprite.y += (@back_sprite_y * 2) + Settings::BACKSPRITE_POSITION_OFFSET
else # Foe Pokémon else # Foe Pokémon
sprite.x += @front_sprite_x * 2 sprite.x += @front_sprite_x * 2
sprite.y += @front_sprite_y * 2 sprite.y += (@front_sprite_y * 2) + Settings::FRONTSPRITE_POSITION_OFFSET
sprite.y -= @front_sprite_altitude * 2 sprite.y -= @front_sprite_altitude * 2
end end
end end

View File

@@ -44,7 +44,11 @@ module GameData
end end
def self.front_sprite_filename(tr_type) def self.front_sprite_filename(tr_type)
return self.check_file(tr_type, "Graphics/Trainers/") tr_type_data = self.try_get(tr_type)
path = "Graphics/Trainers/"
file = sprintf("trainer%03d", tr_type_data.id_number)
ret = path + file
return ret if pbResolveBitmap(ret)
end end
def self.player_front_sprite_filename(tr_type) def self.player_front_sprite_filename(tr_type)

View File

@@ -550,6 +550,7 @@ class PokemonBattlerSprite < RPG::Sprite
@pkmn = pkmn @pkmn = pkmn
@_iconBitmap.dispose if @_iconBitmap @_iconBitmap.dispose if @_iconBitmap
@_iconBitmap = GameData::Species.sprite_bitmap_from_pokemon(@pkmn, back) @_iconBitmap = GameData::Species.sprite_bitmap_from_pokemon(@pkmn, back)
@_iconBitmap.mirror if back
self.bitmap = (@_iconBitmap) ? @_iconBitmap.bitmap : nil self.bitmap = (@_iconBitmap) ? @_iconBitmap.bitmap : nil
pbSetPosition pbSetPosition
end end

View File

@@ -21,69 +21,69 @@
################################################################################ ################################################################################
########################## You may edit any settings below this freely. ########################## You may edit any settings below this freely.
module RandomizedChallenge # module RandomizedChallenge
Switch = 36 # switch ID to randomize a pokemon, if it's on then ALL # Switch = 36 # switch ID to randomize a pokemon, if it's on then ALL
# pokemon will be randomized. No exceptions. # # pokemon will be randomized. No exceptions.
#
BlackListedPokemon = [] #[PBSpecies::MEW, PBSpecies::ARCEUS] # BlackListedPokemon = [] #[PBSpecies::MEW, PBSpecies::ARCEUS]
# Pokemon to Black List. Any pokemon in here will NEVER appear. # # Pokemon to Black List. Any pokemon in here will NEVER appear.
#
WhiteListedPokemon = [] # WhiteListedPokemon = []
# Leave this empty if all pokemon are allowed, otherwise only pokemon listed # # Leave this empty if all pokemon are allowed, otherwise only pokemon listed
# above will be selected. # # above will be selected.
end # end
#
######################### Do not edit anything below here. # ######################### Do not edit anything below here.
class PokeBattle_Pokemon # class PokeBattle_Pokemon
#
alias randomized_init initialize # alias randomized_init initialize
#
def initialize(species, level, player = nil, withMoves = true) # def initialize(species, level, player = nil, withMoves = true)
#
if $game_switches && $game_switches[RandomizedChallenge::Switch] # if $game_switches && $game_switches[RandomizedChallenge::Switch]
if $game_switches[991] # if $game_switches[991]
species = rand(PBSpecies.maxValue - 1) + 1 # species = rand(PBSpecies.maxValue - 1) + 1
basestatsum = $pkmn_dex[species][5][0] # HP # basestatsum = $pkmn_dex[species][5][0] # HP
basestatsum += $pkmn_dex[species][5][1] # Attack # basestatsum += $pkmn_dex[species][5][1] # Attack
basestatsum += $pkmn_dex[species][5][2] # Defense # basestatsum += $pkmn_dex[species][5][2] # Defense
basestatsum += $pkmn_dex[species][5][3] # Speed # basestatsum += $pkmn_dex[species][5][3] # Speed
basestatsum += $pkmn_dex[species][5][4] # Special Attack # basestatsum += $pkmn_dex[species][5][4] # Special Attack
basestatsum += $pkmn_dex[species][5][5] # Special Defense # basestatsum += $pkmn_dex[species][5][5] # Special Defense
#
while basestatsum > $game_variables[53] || basestatsum < $game_variables[87] # while basestatsum > $game_variables[53] || basestatsum < $game_variables[87]
species = rand(PBSpecies.maxValue - 1) + 1 # species = rand(PBSpecies.maxValue - 1) + 1
basestatsum = $pkmn_dex[species][5][0] # HP # basestatsum = $pkmn_dex[species][5][0] # HP
basestatsum += $pkmn_dex[species][5][1] # Attack # basestatsum += $pkmn_dex[species][5][1] # Attack
basestatsum += $pkmn_dex[species][5][2] # Defense # basestatsum += $pkmn_dex[species][5][2] # Defense
basestatsum += $pkmn_dex[species][5][3] # Speed # basestatsum += $pkmn_dex[species][5][3] # Speed
basestatsum += $pkmn_dex[species][5][4] # Special Attack # basestatsum += $pkmn_dex[species][5][4] # Special Attack
basestatsum += $pkmn_dex[species][5][5] # Special Defense # basestatsum += $pkmn_dex[species][5][5] # Special Defense
end # end
#Kernel.pbMessage(_INTL("total = {1}, {2}",basestatsum, PBSpecies.getName(species))) # #Kernel.pbMessage(_INTL("total = {1}, {2}",basestatsum, PBSpecies.getName(species)))
else # else
if $game_switches[841] # if $game_switches[841]
species = getRandomCustomSprite() # species = getRandomCustomSprite()
else # else
species = rand(PBSpecies.maxValue - 1) + 1 # species = rand(PBSpecies.maxValue - 1) + 1
end # end
end # end
end # end
#
randomized_init(species, level, player, withMoves) # randomized_init(species, level, player, withMoves)
end # end
end # end
#
#
def getRandomCustomSprite() # def getRandomCustomSprite()
filesList = Dir["./Graphics/CustomBattlers/*"] # filesList = Dir["./Graphics/CustomBattlers/*"]
i = rand(filesList.length - 1) # i = rand(filesList.length - 1)
path = filesList[i] # path = filesList[i]
file = File.basename(path, ".*") # file = File.basename(path, ".*")
splitPoke = file.split(".") # splitPoke = file.split(".")
head = splitPoke[0].to_i # head = splitPoke[0].to_i
body = splitPoke[1].to_i # body = splitPoke[1].to_i
return (body * NB_POKEMON) + head # return (body * NB_POKEMON) + head
end # end
=begin =begin

View File

@@ -59,66 +59,66 @@ def displayProgress(current,total,bst)
Kernel.pbMessageNoSound(_INTL("\\ts[]Generating encounters file...\\n Map {1}/{2}\\^",current,total)) Kernel.pbMessageNoSound(_INTL("\\ts[]Generating encounters file...\\n Map {1}/{2}\\^",current,total))
end end
#
class PokemonEncounters # class PokemonEncounters
#
def setup(mapID) # def setup(mapID)
@density=nil # @density=nil
@stepcount=0 # @stepcount=0
@enctypes=[] # @enctypes=[]
begin # begin
#
data=load_data(getEncountersFilePath()) # data=load_data(getEncountersFilePath())
if data.is_a?(Hash) && data[mapID] # if data.is_a?(Hash) && data[mapID]
@density=data[mapID][0] # @density=data[mapID][0]
@enctypes=data[mapID][1] # @enctypes=data[mapID][1]
else # else
@density=nil # @density=nil
@enctypes=[] # @enctypes=[]
end # end
rescue # rescue
@density=nil # @density=nil
@enctypes=[] # @enctypes=[]
end # end
end # end
#
def getEncountersFilePath() # def getEncountersFilePath()
if $game_switches[777] && $game_switches[778] #[777] = random-by-area [778] = wildpokerandom activated # if $game_switches[777] && $game_switches[778] #[777] = random-by-area [778] = wildpokerandom activated
return "Data/encounters_randomized.dat" # return "Data/encounters_randomized.dat"
else # else
return "Data/encounters.dat" # return "Data/encounters.dat"
end # end
end # end
#
def pbMapEncounter(mapID,enctype) # def pbMapEncounter(mapID,enctype)
if enctype<0 || enctype>EncounterTypes::EnctypeChances.length # if enctype<0 || enctype>EncounterTypes::EnctypeChances.length
raise ArgumentError.new(_INTL("Encounter type out of range")) # raise ArgumentError.new(_INTL("Encounter type out of range"))
end # end
data=load_data(getEncountersFilePath()) # data=load_data(getEncountersFilePath())
if data.is_a?(Hash) && data[mapID] # if data.is_a?(Hash) && data[mapID]
enctypes=data[mapID][1] # enctypes=data[mapID][1]
else # else
return nil # return nil
end # end
return nil if enctypes[enctype]==nil # return nil if enctypes[enctype]==nil
chances=EncounterTypes::EnctypeChances[enctype] # chances=EncounterTypes::EnctypeChances[enctype]
chancetotal=0 # chancetotal=0
chances.each {|a| chancetotal+=a} # chances.each {|a| chancetotal+=a}
rnd=rand(chancetotal) # rnd=rand(chancetotal)
chosenpkmn=0 # chosenpkmn=0
chance=0 # chance=0
for i in 0...chances.length # for i in 0...chances.length
chance+=chances[i] # chance+=chances[i]
if rnd<chance # if rnd<chance
chosenpkmn=i # chosenpkmn=i
break # break
end # end
end # end
encounter=enctypes[enctype][chosenpkmn] # encounter=enctypes[enctype][chosenpkmn]
level=encounter[1]+rand(1+encounter[2]-encounter[1]) # level=encounter[1]+rand(1+encounter[2]-encounter[1])
return [encounter[0],level] # return [encounter[0],level]
end # end
end # end

View File

@@ -521,112 +521,113 @@ def addHealingItem(items)
end end
#####Overload de pbLoadTrainer #####Overload de pbLoadTrainer
def pbLoadTrainer(trainerid,trainername,partyid=0) #
if trainerid.is_a?(String) || trainerid.is_a?(Symbol) # def pbLoadTrainer(trainerid,trainername,partyid=0)
if !hasConst?(PBTrainers,trainerid) # if trainerid.is_a?(String) || trainerid.is_a?(Symbol)
raise _INTL("Trainer type does not exist ({1}, {2}, ID {3})",trainerid,trainername,partyid) # if !hasConst?(PBTrainers,trainerid)
end # raise _INTL("Trainer type does not exist ({1}, {2}, ID {3})",trainerid,trainername,partyid)
trainerid=getID(PBTrainers,trainerid) # end
end # trainerid=getID(PBTrainers,trainerid)
success=false # end
items=[] # success=false
party=[] # items=[]
opponent=nil # party=[]
trainers=load_data("Data/trainers.dat") # opponent=nil
trainerIndex=-1 # trainers=load_data("Data/trainers.dat")
# trainerIndex=-1
for trainer in trainers #
trainerIndex+=1 # for trainer in trainers
name=trainer[1] # trainerIndex+=1
thistrainerid=trainer[0] # name=trainer[1]
thispartyid=trainer[4] # thistrainerid=trainer[0]
next if trainerid!=thistrainerid || name!=trainername || partyid!=thispartyid # thispartyid=trainer[4]
items=trainer[2].clone # next if trainerid!=thistrainerid || name!=trainername || partyid!=thispartyid
# items=trainer[2].clone
if $game_switches[666] #hard mode #
items = addHealingItem(items) # if $game_switches[666] #hard mode
end # items = addHealingItem(items)
# end
#
name=pbGetMessageFromHash(MessageTypes::TrainerNames,name) #
for i in RIVALNAMES # name=pbGetMessageFromHash(MessageTypes::TrainerNames,name)
if isConst?(trainerid,PBTrainers,i[0]) && $game_variables[i[1]]!=0 # for i in RIVALNAMES
name=$game_variables[i[1]] # if isConst?(trainerid,PBTrainers,i[0]) && $game_variables[i[1]]!=0
end # name=$game_variables[i[1]]
end # end
opponent=PokeBattle_Trainer.new(name,thistrainerid) # end
opponent.setForeignID($Trainer) if $Trainer # opponent=PokeBattle_Trainer.new(name,thistrainerid)
# opponent.setForeignID($Trainer) if $Trainer
#
#use le random Array si randomized starters (et pas 1ere rival battle) #
isPlayingRandomized = $game_switches[987] && !$game_switches[46] # #use le random Array si randomized starters (et pas 1ere rival battle)
if isPlayingRandomized && $PokemonGlobal.randomTrainersHash[trainerIndex] == nil # isPlayingRandomized = $game_switches[987] && !$game_switches[46]
Kernel.pbMessage(_INTL("The trainers need to be re-shuffled.")) # if isPlayingRandomized && $PokemonGlobal.randomTrainersHash[trainerIndex] == nil
Kernel.pbShuffleTrainers() # Kernel.pbMessage(_INTL("The trainers need to be re-shuffled."))
end # Kernel.pbShuffleTrainers()
trainerParty = isPlayingRandomized ? $PokemonGlobal.randomTrainersHash[trainerIndex][3] : getTrainerParty(trainer) # end
# trainerParty = isPlayingRandomized ? $PokemonGlobal.randomTrainersHash[trainerIndex][3] : getTrainerParty(trainer)
#
isRematch = $game_switches[200] #
rematchId = getRematchId(trainername,trainerid) # isRematch = $game_switches[200]
for poke in trainerParty # rematchId = getRematchId(trainername,trainerid)
## # for poke in trainerParty
species=poke[TPSPECIES] # ##
species = replaceRivalStarterIfNecessary(species) # species=poke[TPSPECIES]
# species = replaceRivalStarterIfNecessary(species)
#
level= $game_switches[666] ? (poke[TPLEVEL]*1.1).ceil : poke[TPLEVEL] #
# level= $game_switches[666] ? (poke[TPLEVEL]*1.1).ceil : poke[TPLEVEL]
if isRematch #
nbRematch = getNumberRematch(rematchId) # if isRematch
level = getRematchLevel(level,nbRematch) # nbRematch = getNumberRematch(rematchId)
species = evolveRematchPokemon(nbRematch,species) # level = getRematchLevel(level,nbRematch)
end # species = evolveRematchPokemon(nbRematch,species)
# end
pokemon=PokeBattle_Pokemon.new(species,level,opponent) #
#pokemon.form=poke[TPFORM] # pokemon=PokeBattle_Pokemon.new(species,level,opponent)
pokemon.resetMoves # #pokemon.form=poke[TPFORM]
# pokemon.resetMoves
#
pokemon.setItem( $game_switches[843] ? rand(PBItems.maxValue) : poke[TPITEM]) #
# pokemon.setItem( $game_switches[843] ? rand(PBItems.maxValue) : poke[TPITEM])
if poke[TPMOVE1]>0 || poke[TPMOVE2]>0 || poke[TPMOVE3]>0 || poke[TPMOVE4]>0 #
k=0 # if poke[TPMOVE1]>0 || poke[TPMOVE2]>0 || poke[TPMOVE3]>0 || poke[TPMOVE4]>0
for move in [TPMOVE1,TPMOVE2,TPMOVE3,TPMOVE4] # k=0
pokemon.moves[k]=PBMove.new(poke[move]) # for move in [TPMOVE1,TPMOVE2,TPMOVE3,TPMOVE4]
k+=1 # pokemon.moves[k]=PBMove.new(poke[move])
end # k+=1
pokemon.moves.compact! # end
end # pokemon.moves.compact!
pokemon.setAbility(poke[TPABILITY]) # end
pokemon.setGender(poke[TPGENDER]) # pokemon.setAbility(poke[TPABILITY])
if poke[TPSHINY] # if this is a shiny Pokémon # pokemon.setGender(poke[TPGENDER])
pokemon.makeShiny # if poke[TPSHINY] # if this is a shiny Pokémon
else # pokemon.makeShiny
pokemon.makeNotShiny # else
end # pokemon.makeNotShiny
pokemon.setNature(poke[TPNATURE]) # end
iv=poke[TPIV] # pokemon.setNature(poke[TPNATURE])
for i in 0...6 # iv=poke[TPIV]
pokemon.iv[i]=iv&0x1F # for i in 0...6
pokemon.ev[i]=[85,level*3/2].min # pokemon.iv[i]=iv&0x1F
end # pokemon.ev[i]=[85,level*3/2].min
pokemon.happiness=poke[TPHAPPINESS] # end
pokemon.name=poke[TPNAME] if poke[TPNAME] && poke[TPNAME]!="" # pokemon.happiness=poke[TPHAPPINESS]
if poke[TPSHADOW] # if this is a Shadow Pokémon # pokemon.name=poke[TPNAME] if poke[TPNAME] && poke[TPNAME]!=""
pokemon.makeShadow rescue nil # if poke[TPSHADOW] # if this is a Shadow Pokémon
pokemon.pbUpdateShadowMoves(true) rescue nil # pokemon.makeShadow rescue nil
pokemon.makeNotShiny # pokemon.pbUpdateShadowMoves(true) rescue nil
end # pokemon.makeNotShiny
pokemon.ballused=poke[TPBALL] # end
pokemon.calcStats # pokemon.ballused=poke[TPBALL]
party.push(pokemon) # pokemon.calcStats
end # party.push(pokemon)
success=true # end
break # success=true
end # break
return success ? [opponent,items,party] : nil # end
end # return success ? [opponent,items,party] : nil
# end
def getRematchId(trainername, trainerid) def getRematchId(trainername, trainerid)
return trainername + trainerid.to_s return trainername + trainerid.to_s

View File

@@ -0,0 +1,43 @@
module GameData
class Species
def self.sprite_bitmap_from_pokemon(pkmn, back = false, species = nil)
species = pkmn.species if !species
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)
else
ret = self.front_sprite_bitmap(species)
end
return ret
end
def self.front_sprite_bitmap(dex_number)
filename = self.sprite_filename(dex_number)
return (filename) ? AnimatedBitmap.new(filename) : nil
end
def self.back_sprite_bitmap(dex_number)
filename = self.sprite_filename(dex_number)
return (filename) ? AnimatedBitmap.new(filename) : nil
end
def self.egg_sprite_bitmap(dex_number, form = 0)
filename = self.egg_sprite_filename(dex_number, form)
return (filename) ? AnimatedBitmap.new(filename) : nil
end
def self.sprite_filename(dex_number)
if dex_number <= Settings::NB_POKEMON
filename = sprintf("%s/%s.png", dex_number, dex_number)
else
body_id = getBodyID(dex_number)
head_id = getHeadID(dex_number, body_id)
filename = sprintf("%s/%s.%s.png", head_id, head_id, body_id)
end
customPath = pbResolveBitmap(Settings::CUSTOM_BATTLERS_FOLDER + filename)
return customPath ? customPath : pbResolveBitmap(Settings::BATTLERS_FOLDER + filename)
end
end
end

View File

@@ -102,4 +102,12 @@ def CanLearnMove(pokemon, move)
data = load_data("Data/tm.dat") data = load_data("Data/tm.dat")
return false if !data[move] return false if !data[move]
return data[move].any? { |item| item == species } return data[move].any? { |item| item == species }
end
def getBodyID(species)
return (species / NB_POKEMON).round
end
def getHeadID(species, bodyId)
return (species - (bodyId * NB_POKEMON)).round
end end

File diff suppressed because it is too large Load Diff

View File

@@ -1,116 +1,117 @@
# See the documentation on the wiki to learn how to edit this file. # See the documentation on the wiki to learn how to edit this file.
0,POKEMONTRAINER_Red,Pokémon Trainer,60,,,,Male, #-------------------------------
1,POKEMONTRAINER_Leaf,Pokémon Trainer,60,,,,Female, 0,POKEMONTRAINER_Red,Pokémon Trainer,60,,,,Male,,
2,POKEMONTRAINER_Gold,Pokémon Trainer,60,,,,Male, 1,POKEMONTRAINER_Leaf,Pokémon Trainer,60,,,,Female,,
3,POKEMONTRAINER_May,Pokémon Trainer,60,,,,Female, 2,POKEMONTRAINER_Gold,Pokémon Trainer,60,,,,Male,,
4,RIVAL1,Rival,16,,,,Male, 3,POKEMONTRAINER_May,Pokémon Trainer,60,,,,Female,,
5,RIVAL2,Rival,36,,,,Male, 4,RIVAL1,Rival,16,,,,Male,,
6,AROMALADY,Aroma Lady,32,,,,Female, 5,RIVAL2,Rival,36,,,,Male,,
7,BEAUTY,Beauty,56,,,,Female, 6,AROMALADY,Aroma Lady,32,,,,Female,,
8,BIKER,Biker,32,,,,Male, 7,BEAUTY,Beauty,56,,,,Female,,
9,BIRDKEEPER,Bird Keeper,32,,,,Male, 8,BIKER,Biker,32,,,,Male,,
10,BUGCATCHER,Bug Catcher,16,,,,Male, 9,BIRDKEEPER,Bird Keeper,32,,,,Male,,
11,BURGLAR,Burglar,88,,,,Male,32 10,BUGCATCHER,Bug Catcher,16,,,,Male,,
12,CHANNELER,Channeler,32,,,,Female, 11,BURGLAR,Burglar,88,,,,Male,32,
13,CUEBALL,Cue Ball,24,,,,Male, 12,CHANNELER,Channeler,32,,,,Female,,
14,ENGINEER,Engineer,48,,,,Male, 13,CUEBALL,Cue Ball,24,,,,Male,,
15,FISHERMAN,Fisherman,32,,,,Male, 14,ENGINEER,Engineer,48,,,,Male,,
16,GAMBLER,Gambler,72,,,,Male,32 15,FISHERMAN,Fisherman,32,,,,Male,,
17,GENTLEMAN,Gentleman,72,,,,Male, 16,GAMBLER,Gambler,72,,,,Male,32,
18,HIKER,Hiker,32,,,,Male, 17,GENTLEMAN,Gentleman,72,,,,Male,,
19,JUGGLER,Juggler,32,,,,Male, 18,HIKER,Hiker,32,,,,Male,,
20,LADY,Lady,160,,,,Female,72 19,JUGGLER,Juggler,32,,,,Male,,
21,PAINTER,Painter,16,,,,Female, 20,LADY,Lady,160,,,,Female,72,
22,POKEMANIAC,Poké Maniac,64,,,,Male, 21,PAINTER,Painter,16,,,,Female,,
23,POKEMONBREEDER,Pokémon Breeder,48,,,,Female, 22,POKEMANIAC,Poké Maniac,64,,,,Male,,
24,PROFESSOR,Professor,100,,,,Male, 23,POKEMONBREEDER,Pokémon Breeder,48,,,,Female,,
25,ROCKER,Rocker,24,,,,Male, 24,PROFESSOR,Professor,100,,,,Male,,
26,RUINMANIAC,Ruin Maniac,48,,,,Male, 25,ROCKER,Rocker,24,,,,Male,,
27,SAILOR,Sailor,32,,,,Male, 26,RUINMANIAC,Ruin Maniac,48,,,,Male,,
28,SCIENTIST,Scientist,48,,,,Male, 27,SAILOR,Sailor,32,,,,Male,,
29,SUPERNERD,Super Nerd,48,,,,Male, 28,SCIENTIST,Scientist,48,,,,Male,,
30,TAMER,Tamer,40,,,,Male, 29,SUPERNERD,Super Nerd,48,,,,Male,,
31,BLACKBELT,Black Belt,32,,,,Male, 30,TAMER,Tamer,40,,,,Male,,
32,CRUSHGIRL,Crush Girl,24,,,,Female, 31,BLACKBELT,Black Belt,32,,,,Male,,
33,CAMPER,Camper,16,,,,Male, 32,CRUSHGIRL,Crush Girl,24,,,,Female,,
34,PICNICKER,Picnicker,16,,,,Female, 33,CAMPER,Camper,16,,,,Male,,
35,COOLTRAINER_M,Cool Trainer,60,,,,Male, 34,PICNICKER,Picnicker,16,,,,Female,,
36,COOLTRAINER_F,Cool Trainer,60,,,,Female, 35,COOLTRAINER_M,Cool Trainer,60,,,,Male,,
37,YOUNGSTER,Youngster,16,,,,Male, 36,COOLTRAINER_F,Cool Trainer,60,,,,Female,,
38,LASS,Lass,16,,,,Female, 37,YOUNGSTER,Youngster,16,,,,Male,,
39,POKEMONRANGER_M,Pokémon Ranger,60,,,,Male, 38,LASS,Lass,16,,,,Female,,
40,POKEMONRANGER_F,Pokémon Ranger,60,,,,Female, 39,POKEMONRANGER_M,Pokémon Ranger,60,,,,Male,,
41,PSYCHIC_M,Psychic,32,,,,Male, 40,POKEMONRANGER_F,Pokémon Ranger,60,,,,Female,,
42,PSYCHIC_F,Psychic,32,,,,Female, 41,PSYCHIC_M,Psychic,32,,,,Male,,
43,SWIMMER_M,Swimmer,16,,,,Male,32 42,PSYCHIC_F,Psychic,32,,,,Female,,
44,SWIMMER_F,Swimmer,16,,,,Female,32 43,SWIMMER_M,Swimmer,16,,,,Male,32,
45,SWIMMER2_M,Swimmer,16,,,,Male,32 44,SWIMMER_F,Swimmer,16,,,,Female,32,
46,SWIMMER2_F,Swimmer,16,,,,Female,32 45,SWIMMER2_M,Swimmer,16,,,,Male,32,
47,TUBER_M,Tuber,4,,,,Male,16 46,SWIMMER2_F,Swimmer,16,,,,Female,32,
48,TUBER_F,Tuber,4,,,,Female,16 47,TUBER_M,Tuber,4,,,,Male,16,
49,TUBER2_M,Tuber,4,,,,Male,16 48,TUBER_F,Tuber,4,,,,Female,16,
50,TUBER2_F,Tuber,4,,,,Female,16 49,TUBER2_M,Tuber,4,,,,Male,16,
51,COOLCOUPLE,Cool Couple,72,,,,Mixed,48 50,TUBER2_F,Tuber,4,,,,Female,16,
52,CRUSHKIN,Crush Kin,48,,,,Mixed, 51,COOLCOUPLE,Cool Couple,72,,,,Mixed,48,
53,SISANDBRO,Sis and Bro,16,,,,Mixed,48 52,CRUSHKIN,Crush Kin,48,,,,Mixed,,
54,TWINS,Twins,24,,,,Mixed, 53,SISANDBRO,Sis and Bro,16,,,,Mixed,48,
55,YOUNGCOUPLE,Young Couple,60,,,,Mixed,32 54,TWINS,Twins,24,,,,Mixed,,
56,TEAMROCKET_M,Team Rocket,32,,,,Male, 55,YOUNGCOUPLE,Young Couple,60,,,,Mixed,32,
57,TEAMROCKET_F,Team Rocket,32,,,,Female, 56,TEAMROCKET_M,Team Rocket,32,,,,Male,,
58,ROCKETBOSS,Team Rocket Boss,100,,,,Male, 57,TEAMROCKET_F,Team Rocket,32,,,,Female,,
59,LEADER_Brock,Gym Leader,100,gymleader,,,Male, 58,ROCKETBOSS,Team Rocket Boss,100,,,,Male,,
60,LEADER_Misty,Gym Leader,100,gymleader,,,Female, 59,LEADER_Brock,Gym Leader,100,gymleader,,,Male,,
61,LEADER_Surge,Gym Leader,100,gymleader,,,Male, 60,LEADER_Misty,Gym Leader,100,gymleader,,,Female,,
62,LEADER_Erika,Gym Leader,100,gymleader,,,Female, 61,LEADER_Surge,Gym Leader,100,gymleader,,,Male,,
63,LEADER_Koga,Gym Leader,100,gymleader,,,Male, 62,LEADER_Erika,Gym Leader,100,gymleader,,,Female,,
64,LEADER_Sabrina,Gym Leader,100,gymleader,,,Female, 63,LEADER_Koga,Gym Leader,100,gymleader,,,Male,,
65,LEADER_Blaine,Gym Leader,100,gymleader,,,Male, 64,LEADER_Sabrina,Gym Leader,100,gymleader,,,Female,,
66,LEADER_Giovanni,Gym Leader,100,gymleader,,,Male, 65,LEADER_Blaine,Gym Leader,100,gymleader,,,Male,,
67,ELITEFOUR_Lorelei,Elite Four,100,elite,,,Female, 66,LEADER_Giovanni,Gym Leader,100,gymleader,,,Male,,
68,ELITEFOUR_Bruno,Elite Four,100,elite,,,Male, 67,ELITEFOUR_Lorelei,Elite Four,100,elite,,,Female,,
69,ELITEFOUR_Agatha,Elite Four,100,elite,,,Female, 68,ELITEFOUR_Bruno,Elite Four,100,elite,,,Male,,
70,ELITEFOUR_Lance,Elite Four,100,elite,,,Male, 69,ELITEFOUR_Agatha,Elite Four,100,elite,,,Female,,
71,CHAMPION,Champion,100,elite,,,Male, 70,ELITEFOUR_Lance,Elite Four,100,elite,,,Male,,
72,SOCIALITE,Socialite,160,,,,Female, 71,CHAMPION,Champion,100,elite,,,Male,,
73,BUGCATCHER_F,Bug Catcher,16,,,,Female, 72,SOCIALITE,Socialite,160,,,,Female,,
74,MR_FUJI,Mr.,16,,,,Male, 73,BUGCATCHER_F,Bug Catcher,16,,,,Female,,
75,ROUGHNECK,Roughneck,24,,,,Male, 74,MR_FUJI,Mr.,16,,,,Male,,
76,TEACHER,Teacher,32,,,,Female, 75,ROUGHNECK,Roughneck,24,,,,Male,,
77,PRESCHOOLER_M,Preschooler,4,,,,Male,16 76,TEACHER,Teacher,32,,,,Female,,
78,PRESCHOOLER_F,Preschooler,4,,,,Female,16 77,PRESCHOOLER_M,Preschooler,4,,,,Male,16,
79,HIPSTER,Hipster,32,,,,Male, 78,PRESCHOOLER_F,Preschooler,4,,,,Female,16,
80,HAUNTEDGIRL_YOUNG,Haunted Girl,4,,,,Female, 79,HIPSTER,Hipster,32,,,,Male,,
81,HAUNTEDGIRL,Haunted Girl,32,,,,Female, 80,HAUNTEDGIRL_YOUNG,Haunted Girl,4,,,,Female,,
82,CLOWN,Clown,32,,,,Male, 81,HAUNTEDGIRL,Haunted Girl,32,,,,Female,,
83,NURSE,Nurse,32,,,,Female, 82,CLOWN,Clown,32,,,,Male,,
84,WORKER,Worker,88,,,,Male,32 83,NURSE,Nurse,32,,,,Female,,
85,POKEMONTRAINER_RedB,Pokémon Trainer,60,,,,Male, 84,WORKER,Worker,88,,,,Male,32,
86,POKEMONTRAINER_RedG,Pokémon Trainer,60,,,,Male, 85,POKEMONTRAINER_RedB,Pokémon Trainer,60,,,,Male,,
87,POKEMONTRAINER_RedY,Pokémon Trainer,60,,,,Male, 86,POKEMONTRAINER_RedG,Pokémon Trainer,60,,,,Male,,
88,POKEMONTRAINER_LeafB,Pokémon Trainer,60,,,,Female, 87,POKEMONTRAINER_RedY,Pokémon Trainer,60,,,,Male,,
89,POKEMONTRAINER_LeafG,Pokémon Trainer,60,,,,Female, 88,POKEMONTRAINER_LeafB,Pokémon Trainer,60,,,,Female,,
90,POKEMONTRAINER_LeafY,Pokémon Trainer,60,,,,Female, 89,POKEMONTRAINER_LeafG,Pokémon Trainer,60,,,,Female,,
91,COOLTRAINER_M2,Cool Trainer,0,,,,Male,255 90,POKEMONTRAINER_LeafY,Pokémon Trainer,60,,,,Female,,
92,COOLTRAINER_F2,Cool Trainer,0,,,,Female,255 91,COOLTRAINER_M2,Cool Trainer,0,,,,Male,255,
93,ROBOT,Robot,0,,,,Mixed,255 92,COOLTRAINER_F2,Cool Trainer,0,,,,Female,255,
94,FARMER,Farmer,12,,,,Male, 93,ROBOT,Robot,0,,,,Mixed,255,
95,PYROMANIAC,Pyromaniac,88,,,,Male,32 94,FARMER,Farmer,12,,,,Male,,
96,ROCKETEXEC_F,Team Rocket Executive,100,,,,Female, 95,PYROMANIAC,Pyromaniac,88,,,,Male,32,
97,ROCKETEXEC_M,Team Rocket Executive,100,,,,Male, 96,ROCKETEXEC_F,Team Rocket Executive,100,,,,Female,,
98,LEADER_Whitney,Gym Leader,100,gymleader,,,Female, 97,ROCKETEXEC_M,Team Rocket Executive,100,,,,Male,,
99,LEADER_Kurt,Gym Leader,100,gymleader,,,Male, 98,LEADER_Whitney,Gym Leader,100,gymleader,,,Female,,
100,LEADER_Falkner,Gym Leader,100,gymleader,,,Male, 99,LEADER_Kurt,Gym Leader,100,gymleader,,,Male,,
101,LEADER_Clair,Gym Leader,100,gymleader,,,Female, 100,LEADER_Falkner,Gym Leader,100,gymleader,,,Male,,
102,MYSTICALMAN,Tamer,40,,,,Male, 101,LEADER_Clair,Gym Leader,100,gymleader,,,Female,,
103,LEADER_Morty,Gym Leader,100,gymleader,,,Male, 102,MYSTICALMAN,Tamer,40,,,,Male,,
104,TEAMPLASMA_M,Team Plasma,32,,,,Male, 103,LEADER_Morty,Gym Leader,100,gymleader,,,Male,,
105,TEAMPLASMA_F,Team Plasma,32,,,,Female, 104,TEAMPLASMA_M,Team Plasma,32,,,,Male,,
106,SCIENTIST_Colress,Scientist,100,,,,Male, 105,TEAMPLASMA_F,Team Plasma,32,,,,Female,,
107,LEADER_Pryce,Gym Leader,100,gymleader,,,Male, 106,SCIENTIST_Colress,Scientist,100,,,,Male,,
108,KIMONOGIRL,Kimono Girl,0,,,,Female,255 107,LEADER_Pryce,Gym Leader,100,gymleader,,,Male,,
109,SAGE,Sage,32,,,,Male, 108,KIMONOGIRL,Kimono Girl,0,,,,Female,255,
110,PLAYER,Player,32,,,,Male, 109,SAGE,Sage,32,,,,Male,,
111,LEADER_Chuck,Gym Leader,100,gymleader,,,Male, 110,PLAYER,Player,32,,,,Male,,
112,LEADER_Jasmine,Gym Leader,100,gymleader,,,Female, 111,LEADER_Chuck,Gym Leader,100,gymleader,,,Male,,
113,POLICE,Officer,32,,,,Male, 112,LEADER_Jasmine,Gym Leader,100,gymleader,,,Female,,
114,SKIER_F,Skier,16,,,,Female,32 113,POLICE,Officer,32,,,,Male,,
114,SKIER_F,Skier,16,,,,Female,32,