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

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