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/
Graphics/
Plugins/
PBS/pokemon.txt
# Data folder, but not Data/Scripts folder
Data/*
!Data/Scripts.rxdata
@@ -27,4 +27,26 @@ Thumbs.db
# 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
# 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
# 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).
# Note that this isn't perfect. Essentials doesn't accurately replicate every
# single generation's mechanics. It's considered to be good enough. Only
# generations 5 and later are reasonably supported.
MECHANICS_GENERATION = 7
MECHANICS_GENERATION = 5
#=============================================================================

View File

@@ -4,33 +4,85 @@
class AnimatedBitmap
def initialize(file, hue = 0)
raise "Filename is nil (missing graphic)." if file.nil?
path = file
path = file
filename = ""
if file.last != '/' # Isn't just a directory
if file.last != '/' # Isn't just a directory
split_file = file.split(/[\\\/]/)
filename = split_file.pop
path = split_file.join('/') + '/'
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)
else
@bitmap = GifBitmap.new(path, filename, hue)
end
end
def [](index); @bitmap[index]; end
def width; @bitmap.bitmap.width; end
def height; @bitmap.bitmap.height; 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 [](index)
; @bitmap[index];
end
def width
@bitmap.bitmap.width;
end
def height
@bitmap.bitmap.height;
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
#===============================================================================
@@ -41,15 +93,15 @@ class PngAnimatedBitmap
# Creates an animated bitmap from a PNG file.
def initialize(dir, filename, hue = 0)
@frames = []
@frames = []
@currentFrame = 0
@framecount = 0
@framecount = 0
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
numFrames = $1.to_i
delay = $2.to_i
delay = 10 if delay == 0
delay = $2.to_i
delay = 10 if delay == 0
raise "Invalid frame count in #{filename}" if numFrames <= 0
raise "Invalid frame delay in #{filename}" if delay <= 0
if panorama.width % numFrames != 0
@@ -72,8 +124,13 @@ class PngAnimatedBitmap
return @frames[index]
end
def width; self.bitmap.width; end
def height; self.bitmap.height; end
def width
self.bitmap.width;
end
def height
self.bitmap.height;
end
def deanimate
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.
def initialize(dir, filename, hue = 0)
@bitmap = nil
@bitmap = nil
@disposed = false
filename = "" if !filename
filename = "" if !filename
begin
@bitmap = RPG::Cache.load_bitmap(dir, filename, hue)
rescue
@@ -225,14 +282,14 @@ def pbGetTileBitmap(filename, tile_id, hue, width = 1, height = 1)
}
end
def pbGetTileset(name,hue=0)
def pbGetTileset(name, hue = 0)
return AnimatedBitmap.new("Graphics/Tilesets/" + name, hue).deanimate
end
def pbGetAutotile(name,hue=0)
def pbGetAutotile(name, hue = 0)
return AnimatedBitmap.new("Graphics/Autotiles/" + name, hue).deanimate
end
def pbGetAnimation(name,hue=0)
def pbGetAnimation(name, hue = 0)
return AnimatedBitmap.new("Graphics/Animations/" + name, hue).deanimate
end

View File

@@ -208,10 +208,10 @@ module GameData
else
if (index & 1) == 0 # Player's Pokémon
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
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
end
end

View File

@@ -44,7 +44,11 @@ module GameData
end
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
def self.player_front_sprite_filename(tr_type)

View File

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

View File

@@ -21,69 +21,69 @@
################################################################################
########################## You may edit any settings below this freely.
module RandomizedChallenge
Switch = 36 # switch ID to randomize a pokemon, if it's on then ALL
# pokemon will be randomized. No exceptions.
BlackListedPokemon = [] #[PBSpecies::MEW, PBSpecies::ARCEUS]
# Pokemon to Black List. Any pokemon in here will NEVER appear.
WhiteListedPokemon = []
# Leave this empty if all pokemon are allowed, otherwise only pokemon listed
# above will be selected.
end
######################### Do not edit anything below here.
class PokeBattle_Pokemon
alias randomized_init initialize
def initialize(species, level, player = nil, withMoves = true)
if $game_switches && $game_switches[RandomizedChallenge::Switch]
if $game_switches[991]
species = rand(PBSpecies.maxValue - 1) + 1
basestatsum = $pkmn_dex[species][5][0] # HP
basestatsum += $pkmn_dex[species][5][1] # Attack
basestatsum += $pkmn_dex[species][5][2] # Defense
basestatsum += $pkmn_dex[species][5][3] # Speed
basestatsum += $pkmn_dex[species][5][4] # Special Attack
basestatsum += $pkmn_dex[species][5][5] # Special Defense
while basestatsum > $game_variables[53] || basestatsum < $game_variables[87]
species = rand(PBSpecies.maxValue - 1) + 1
basestatsum = $pkmn_dex[species][5][0] # HP
basestatsum += $pkmn_dex[species][5][1] # Attack
basestatsum += $pkmn_dex[species][5][2] # Defense
basestatsum += $pkmn_dex[species][5][3] # Speed
basestatsum += $pkmn_dex[species][5][4] # Special Attack
basestatsum += $pkmn_dex[species][5][5] # Special Defense
end
#Kernel.pbMessage(_INTL("total = {1}, {2}",basestatsum, PBSpecies.getName(species)))
else
if $game_switches[841]
species = getRandomCustomSprite()
else
species = rand(PBSpecies.maxValue - 1) + 1
end
end
end
randomized_init(species, level, player, withMoves)
end
end
def getRandomCustomSprite()
filesList = Dir["./Graphics/CustomBattlers/*"]
i = rand(filesList.length - 1)
path = filesList[i]
file = File.basename(path, ".*")
splitPoke = file.split(".")
head = splitPoke[0].to_i
body = splitPoke[1].to_i
return (body * NB_POKEMON) + head
end
# module RandomizedChallenge
# Switch = 36 # switch ID to randomize a pokemon, if it's on then ALL
# # pokemon will be randomized. No exceptions.
#
# BlackListedPokemon = [] #[PBSpecies::MEW, PBSpecies::ARCEUS]
# # Pokemon to Black List. Any pokemon in here will NEVER appear.
#
# WhiteListedPokemon = []
# # Leave this empty if all pokemon are allowed, otherwise only pokemon listed
# # above will be selected.
# end
#
# ######################### Do not edit anything below here.
# class PokeBattle_Pokemon
#
# alias randomized_init initialize
#
# def initialize(species, level, player = nil, withMoves = true)
#
# if $game_switches && $game_switches[RandomizedChallenge::Switch]
# if $game_switches[991]
# species = rand(PBSpecies.maxValue - 1) + 1
# basestatsum = $pkmn_dex[species][5][0] # HP
# basestatsum += $pkmn_dex[species][5][1] # Attack
# basestatsum += $pkmn_dex[species][5][2] # Defense
# basestatsum += $pkmn_dex[species][5][3] # Speed
# basestatsum += $pkmn_dex[species][5][4] # Special Attack
# basestatsum += $pkmn_dex[species][5][5] # Special Defense
#
# while basestatsum > $game_variables[53] || basestatsum < $game_variables[87]
# species = rand(PBSpecies.maxValue - 1) + 1
# basestatsum = $pkmn_dex[species][5][0] # HP
# basestatsum += $pkmn_dex[species][5][1] # Attack
# basestatsum += $pkmn_dex[species][5][2] # Defense
# basestatsum += $pkmn_dex[species][5][3] # Speed
# basestatsum += $pkmn_dex[species][5][4] # Special Attack
# basestatsum += $pkmn_dex[species][5][5] # Special Defense
# end
# #Kernel.pbMessage(_INTL("total = {1}, {2}",basestatsum, PBSpecies.getName(species)))
# else
# if $game_switches[841]
# species = getRandomCustomSprite()
# else
# species = rand(PBSpecies.maxValue - 1) + 1
# end
# end
# end
#
# randomized_init(species, level, player, withMoves)
# end
# end
#
#
# def getRandomCustomSprite()
# filesList = Dir["./Graphics/CustomBattlers/*"]
# i = rand(filesList.length - 1)
# path = filesList[i]
# file = File.basename(path, ".*")
# splitPoke = file.split(".")
# head = splitPoke[0].to_i
# body = splitPoke[1].to_i
# return (body * NB_POKEMON) + head
# end
=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))
end
class PokemonEncounters
def setup(mapID)
@density=nil
@stepcount=0
@enctypes=[]
begin
data=load_data(getEncountersFilePath())
if data.is_a?(Hash) && data[mapID]
@density=data[mapID][0]
@enctypes=data[mapID][1]
else
@density=nil
@enctypes=[]
end
rescue
@density=nil
@enctypes=[]
end
end
def getEncountersFilePath()
if $game_switches[777] && $game_switches[778] #[777] = random-by-area [778] = wildpokerandom activated
return "Data/encounters_randomized.dat"
else
return "Data/encounters.dat"
end
end
def pbMapEncounter(mapID,enctype)
if enctype<0 || enctype>EncounterTypes::EnctypeChances.length
raise ArgumentError.new(_INTL("Encounter type out of range"))
end
data=load_data(getEncountersFilePath())
if data.is_a?(Hash) && data[mapID]
enctypes=data[mapID][1]
else
return nil
end
return nil if enctypes[enctype]==nil
chances=EncounterTypes::EnctypeChances[enctype]
chancetotal=0
chances.each {|a| chancetotal+=a}
rnd=rand(chancetotal)
chosenpkmn=0
chance=0
for i in 0...chances.length
chance+=chances[i]
if rnd<chance
chosenpkmn=i
break
end
end
encounter=enctypes[enctype][chosenpkmn]
level=encounter[1]+rand(1+encounter[2]-encounter[1])
return [encounter[0],level]
end
end
#
# class PokemonEncounters
#
# def setup(mapID)
# @density=nil
# @stepcount=0
# @enctypes=[]
# begin
#
# data=load_data(getEncountersFilePath())
# if data.is_a?(Hash) && data[mapID]
# @density=data[mapID][0]
# @enctypes=data[mapID][1]
# else
# @density=nil
# @enctypes=[]
# end
# rescue
# @density=nil
# @enctypes=[]
# end
# end
#
# def getEncountersFilePath()
# if $game_switches[777] && $game_switches[778] #[777] = random-by-area [778] = wildpokerandom activated
# return "Data/encounters_randomized.dat"
# else
# return "Data/encounters.dat"
# end
# end
#
# def pbMapEncounter(mapID,enctype)
# if enctype<0 || enctype>EncounterTypes::EnctypeChances.length
# raise ArgumentError.new(_INTL("Encounter type out of range"))
# end
# data=load_data(getEncountersFilePath())
# if data.is_a?(Hash) && data[mapID]
# enctypes=data[mapID][1]
# else
# return nil
# end
# return nil if enctypes[enctype]==nil
# chances=EncounterTypes::EnctypeChances[enctype]
# chancetotal=0
# chances.each {|a| chancetotal+=a}
# rnd=rand(chancetotal)
# chosenpkmn=0
# chance=0
# for i in 0...chances.length
# chance+=chances[i]
# if rnd<chance
# chosenpkmn=i
# break
# end
# end
# encounter=enctypes[enctype][chosenpkmn]
# level=encounter[1]+rand(1+encounter[2]-encounter[1])
# return [encounter[0],level]
# end
# end

View File

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

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