¡Comienzan las votaciones del MPA o Mejor Proyecto del Año 2025!
¡Vota por tu proyecto favorito y recompensa el trabajo duro de los participantes!
El plazo concluye el 13 de marzo
He intentado de hacerlo pero no consigo que muestre el tercer tipo. ¿Supongo que en el PBS de Pokémon debo poner un TYPE3 ¿no? Me he dirigido a los scripts que me has comentado y he buscado las lineas donde sale type2 haciendo un copiar de estas partes y cambiando por type3 (definido justo debajo de type2). El juego carga perfectamente sin errores pero no muestra el icono del tercer tipo.Tal y como dices hay que tocar los scripts.
Añadir un tercer tipo es fácil, modificas la clase PokeBattle_Pokemon para añadir el tercer tipo y luego el summary para mostrar el tipo, pero si quieres tener tres tipos tengo que suponer que también querrás que el tercer tipo influya en batalla y no sea simplemente decorativo, esto sí que sería más complicado porque todo el sistema está montado para que funcione con dos tipos.
¿Podrías postear el código que has cambiado? Tanto en el PBS como en los scripts.He intentado de hacerlo pero no consigo que muestre el tercer tipo. ¿Supongo que en el PBS de Pokémon debo poner un TYPE3 ¿no? Me he dirigido a los scripts que me has comentado y he buscado las lineas donde sale type2 haciendo un copiar de estas partes y cambiando por type3 (definido justo debajo de type2). El juego carga perfectamente sin errores pero no muestra el icono del tercer tipo.
"Type2"=>[9,"e",PBTypes],
Me he metido dentro del Compiler y he puesto la linea del Type3 así:¿Podrías postear el código que has cambiado? Tanto en el PBS como en los scripts.
Ten en cuenta que los PBS se compilan por lo que si quieres añadir esos tercer tipo directamente al archivo PBS en vez de crear una excepción directamente en el script para determinadas especies tendrías que editar el script Compiler también.
Si buscas esto en el script creo que podrías comprender cómo hacerlo fácilmente:
Código:"Type2"=>[9,"e",PBTypes],
"Type3"=>[10,"e",PBTypes],
# This class stores data on each Pokemon. Refer to $Trainer.party for an array
# of each Pokemon in the Trainer's current party.
class PokeBattle_Pokemon
attr_reader(:totalhp) # Current Total HP
attr_reader(:attack) # Current Attack stat
attr_reader(:defense) # Current Defense stat
attr_reader(:speed) # Current Speed stat
attr_reader(:spatk) # Current Special Attack stat
attr_reader(:spdef) # Current Special Defense stat
attr_accessor(:iv) # Array of 6 Individual Values for HP, Atk, Def,
# Speed, Sp Atk, and Sp Def
attr_accessor(:ev) # Effort Values
attr_accessor(:species) # Species (National Pokedex number)
attr_accessor(:personalID) # Personal ID
attr_accessor(:trainerID) # 32-bit Trainer ID (the secret ID is in the upper
# 16 bits)
attr_accessor(:hp) # Current HP
attr_accessor(:pokerus) # Pokérus strain and infection time
attr_accessor(:item) # Held item
attr_accessor(:itemRecycle) # Consumed held item (used in battle only)
attr_accessor(:itemInitial) # Resulting held item (used in battle only)
attr_accessor(:mail) # Mail
attr_accessor(:fused) # The Pokémon fused into this one
attr_accessor(:name) # Nickname
attr_accessor(:exp) # Current experience points
attr_accessor(:happiness) # Current happiness
attr_accessor(:status) # Status problem (PBStatuses)
attr_accessor(:statusCount) # Sleep count/Toxic flag
attr_accessor(:eggsteps) # Steps to hatch egg, 0 if Pokémon is not an egg
attr_accessor(:moves) # Moves (PBMove)
attr_accessor(:firstmoves) # The moves known when this Pokémon was obtained
attr_accessor(:ballused) # Ball used
attr_accessor(:markings) # Markings
attr_accessor(:obtainMode) # Manner obtained:
# 0 - met, 1 - as egg, 2 - traded,
# 4 - fateful encounter
attr_accessor(:obtainMap) # Map where obtained
attr_accessor(:obtainText) # Replaces the obtain map's name if not nil
attr_accessor(:obtainLevel) # Level obtained
attr_accessor(:hatchedMap) # Map where an egg was hatched
attr_accessor(:language) # Language
attr_accessor(:ot) # Original Trainer's name
attr_accessor(:otgender) # Original Trainer's gender:
# 0 - male, 1 - female, 2 - mixed, 3 - unknown
# For information only, not used to verify
# ownership of the Pokemon
attr_accessor(:abilityflag) # Forces the first/second/hidden (0/1/2) ability
attr_accessor(:genderflag) # Forces male (0) or female (1)
attr_accessor(:natureflag) # Forces a particular nature
attr_accessor(:shinyflag) # Forces the shininess (true/false)
attr_accessor(:ribbons) # Array of ribbons
attr_accessor :cool,:beauty,:cute,:smart,:tough,:sheen # Contest stats
################################################################################
# Ownership, obtained information
################################################################################
# Returns the gender of this Pokémon's original trainer (2=unknown).
def otgender
@otgender=2 if !@otgender
return @otgender
end
# Returns whether the specified Trainer is NOT this Pokemon's original trainer.
def isForeign?(trainer)
return [MENTION=20076]trainer[/MENTION]ID!=trainer.id || @ot!=trainer.name
end
# Returns the public portion of the original trainer's ID.
def publicID
return [MENTION=20076]trainer[/MENTION]ID&0xFFFF
end
# Returns this Pokémon's level when this Pokémon was obtained.
def obtainLevel
@obtainLevel=0 if !@obtainLevel
return @obtainLevel
end
# Returns the time when this Pokémon was obtained.
def timeReceived
return @timeReceived ? Time.at(@timeReceived) : Time.gm(2000)
end
# Sets the time when this Pokémon was obtained.
def timeReceived=(value)
# Seconds since Unix epoch
if value.is_a?(Time)
@timeReceived=value.to_i
else
@timeReceived=value
end
end
# Returns the time when this Pokémon hatched.
def timeEggHatched
if obtainMode==1
return @timeEggHatched ? Time.at(@timeEggHatched) : Time.gm(2000)
else
return Time.gm(2000)
end
end
# Sets the time when this Pokémon hatched.
def timeEggHatched=(value)
# Seconds since Unix epoch
if value.is_a?(Time)
@timeEggHatched=value.to_i
else
@timeEggHatched=value
end
end
################################################################################
# Form Change Time
################################################################################
def form_change_time
if !@form_change_time
@form_change_time=Time.now
end
return @form_change_time
end
################################################################################
# Party Index
# Returns the index of the pokemon in the trainers party, if applicable
################################################################################
def partyIndex
ret=-1
return ret if !$Trainer || !($Trainer.party)
for i in 0...$Trainer.party.length
return i if $Trainer.party[i]==self
end
return ret
end
################################################################################
# Level
################################################################################
# Returns this Pokemon's level.
def level
return PBExperience.pbGetLevelFromExperience(@exp,self.growthrate)
end
# Sets this Pokemon's level by changing its Exp. Points.
def level=(value)
if value<1 || value>PBExperience::MAXLEVEL
raise ArgumentError.new(_INTL("The level number ({1}) is invalid.",value))
end
self.exp=PBExperience.pbGetStartExperience(value,self.growthrate)
end
# Returns whether this Pokemon is an egg.
def isEgg?
return @eggsteps>0
end
def egg?; return isEgg?; end # DEPRECATED
# Returns this Pokemon's growth rate.
def growthrate
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,20)
ret=dexdata.fgetb
dexdata.close
return ret
end
# Returns this Pokemon's base Experience value.
def baseExp
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,38)
ret=dexdata.fgetw
dexdata.close
return ret
end
################################################################################
# Gender
################################################################################
# Returns this Pokemon's gender. 0=male, 1=female, 2=genderless
def gender
return [MENTION=14521]Gender[/MENTION]flag if [MENTION=14521]Gender[/MENTION]flag!=nil
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,18)
genderbyte=dexdata.fgetb
dexdata.close
case genderbyte
when 255
return 2 # genderless
when 254
return 1 # always female
else
lowbyte=@personalID&0xFF
return PokeBattle_Pokemon.isFemale(lowbyte,genderbyte) ? 1 : 0
end
end
# Helper function that determines whether the input values would make a female.
def self.isFemale(b,genderRate)
return true if genderRate==254 # AlwaysFemale
return false if genderRate==255 # Genderless
return b<=genderRate
end
# Returns whether this Pokémon is male.
def isMale?
return self.gender==0
end
# Returns whether this Pokémon is female.
def isFemale?
return self.gender==1
end
# Sets this Pokémon's gender to a particular gender (if possible).
def setGender(value)
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,18)
genderbyte=dexdata.fgetb
dexdata.close
if genderbyte!=255 && genderbyte!=0 && genderbyte!=254
[MENTION=14521]Gender[/MENTION]flag=value
end
end
def makeMale; setGender(0); end
def makeFemale; setGender(1); end
################################################################################
# Ability
################################################################################
# Returns the index of this Pokémon's ability.
def abilityIndex
abil=@abilityflag!=nil ? @abilityflag : (@personalID&1)
return abil
end
# Returns the ID of this Pokemon's ability.
def ability
abil=abilityIndex
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,29)
ret1=dexdata.fgetb
ret2=dexdata.fgetb
pbDexDataOffset(dexdata,@species,40)
h1=dexdata.fgetb
h2=dexdata.fgetb
h3=dexdata.fgetb
h4=dexdata.fgetb
dexdata.close
ret=ret1
if abil==2
return h1 if h1>0
abil=(@personalID&1)
elsif abil==3
return h2 if h2>0
abil=(@personalID&1)
elsif abil==4
return h3 if h3>0
abil=(@personalID&1)
elsif abil==5
return h4 if h4>0
abil=(@personalID&1)
end
if abil==1
ret=ret2
ret=ret1 if ret2==0
end
return ret
end
# Sets this Pokémon's ability to a particular ability (if possible).
def setAbility(value)
@abilityflag=value
end
# Returns the list of abilities this Pokémon can have.
def getAbilityList
abils=[]; ret=[[],[]]
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,29)
abils.push(dexdata.fgetb)
abils.push(dexdata.fgetb)
pbDexDataOffset(dexdata,@species,40)
abils.push(dexdata.fgetb)
abils.push(dexdata.fgetb)
abils.push(dexdata.fgetb)
abils.push(dexdata.fgetb)
dexdata.close
for i in 0...abils.length
next if !abils[i] || abils[i]<=0
ret[0].push(abils[i]); ret[1].push(i)
end
return ret
end
################################################################################
# Nature
################################################################################
# Returns the ID of this Pokémon's nature.
def nature
return [MENTION=20184]Nat[/MENTION]ureflag if [MENTION=20184]Nat[/MENTION]ureflag!=nil
return @personalID%25
end
# Sets this Pokémon's nature to a particular nature.
def setNature(value)
if value.is_a?(String) || value.is_a?(Symbol)
value=getID(PBNatures,value)
end
[MENTION=20184]Nat[/MENTION]ureflag=value
self.calcStats
end
################################################################################
# Shininess
################################################################################
# Returns whether this Pokemon is shiny (differently colored).
def isShiny?
return [MENTION=31399]Shin[/MENTION]yflag if [MENTION=31399]Shin[/MENTION]yflag!=nil
a=@personalID [MENTION=20076]trainer[/MENTION]ID
b=a&0xFFFF
c=(a>>16)&0xFFFF
d=b^c
return (d<SHINYPOKEMONCHANCE)
end
# Makes this Pokemon shiny.
def makeShiny
[MENTION=31399]Shin[/MENTION]yflag=true
end
# Makes this Pokemon not shiny.
def makeNotShiny
[MENTION=31399]Shin[/MENTION]yflag=false
end
################################################################################
# Pokérus
################################################################################
# Gives this Pokemon Pokérus (either the specified strain or a random one).
def givePokerus(strain=0)
return if self.pokerusStage==2 # Can't re-infect a cured Pokémon
if strain<=0 || strain>=16
strain=1+rand(15)
end
time=1+(strain%4)
[MENTION=27942]Poker[/MENTION]us=time
[MENTION=27942]Poker[/MENTION]us|=strain<<4
end
# Resets the infection time for this Pokemon's Pokérus (even if cured).
def resetPokerusTime
return if [MENTION=27942]Poker[/MENTION]us==0
strain [MENTION=27942]Poker[/MENTION]us%16
time=1+(strain%4)
[MENTION=27942]Poker[/MENTION]us=time
[MENTION=27942]Poker[/MENTION]us|=strain<<4
end
# Reduces the time remaining for this Pokemon's Pokérus (if infected).
def lowerPokerusCount
return if self.pokerusStage!=1
[MENTION=27942]Poker[/MENTION]us-=1
end
# Returns the Pokérus infection stage for this Pokemon.
def pokerusStage
return 0 if [MENTION=27942]Poker[/MENTION]us || [MENTION=27942]Poker[/MENTION]us==0 # Not infected
return 2 if [MENTION=27942]Poker[/MENTION]us>0 && [MENTION=27942]Poker[/MENTION]us%16)==0 # Cured
return 1 # Infected
end
################################################################################
# Types
################################################################################
# Returns whether this Pokémon has the specified type.
def hasType?(type)
if type.is_a?(String) || type.is_a?(Symbol)
return isConst?(self.type1,PBTypes,type) || isConst?(self.type2,PBTypes,type) || isConst?(self.type3,PBTypes,type)
else
return self.type1==type || self.type2==type || self.type3==type
end
end
# Returns this Pokémon's first type.
def type1
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,8)
ret=dexdata.fgetb
dexdata.close
return ret
end
# Returns this Pokémon's second type.
def type2
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,9)
ret=dexdata.fgetb
dexdata.close
return ret
end
#Tercer tipo
def type3
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,10)
ret=dexdata.fgetb
dexdata.close
return ret
end
################################################################################
# Moves
################################################################################
# Returns the number of moves known by the Pokémon.
def numMoves
ret=0
for i in 0...4
ret+=1 if @moves[i].id!=0
end
return ret
end
# Returns true if the Pokémon knows the given move.
def knowsMove?(move)
if move.is_a?(String) || move.is_a?(Symbol)
move=getID(PBMoves,move)
end
return false if !move || move<=0
for i in 0...4
return true if @moves[i].id==move
end
return false
end
# Returns the list of moves this Pokémon can learn by levelling up.
def getMoveList
movelist=[]
atkdata=pbRgssOpen("Data/attacksRS.dat","rb")
offset=atkdata.getOffset(@species-1)
length=atkdata.getLength(@species-1)>>1
atkdata.pos=offset
for k in 0..length-1
level=atkdata.fgetw
move=atkdata.fgetw
movelist.push([level,move])
end
atkdata.close
return movelist
end
# Sets this Pokémon's movelist to the default movelist it originally had.
def resetMoves
moves=self.getMoveList
movelist=[]
for i in moves
if i[0]<=self.level
movelist[movelist.length]=i[1]
end
end
movelist|=[] # Remove duplicates
listend=movelist.length-4
listend=0 if listend<0
j=0
for i in listend...listend+4
moveid=(i>=movelist.length) ? 0 : movelist[i]
@moves[j]=PBMove.new(moveid)
j+=1
end
end
# Silently learns the given move. Will erase the first known move if it has to.
def pbLearnMove(move)
if move.is_a?(String) || move.is_a?(Symbol)
move=getID(PBMoves,move)
end
return if move<=0
for i in 0...4
if @moves[i].id==move
j=i+1; while j<4
break if @moves[j].id==0
tmp=@moves[j]
@moves[j]=@moves[j-1]
@moves[j-1]=tmp
j+=1
end
return
end
end
for i in 0...4
if @moves[i].id==0
@moves[i]=PBMove.new(move)
return
end
end
@moves[0]=@moves[1]
@moves[1]=@moves[2]
@moves[2]=@moves[3]
@moves[3]=PBMove.new(move)
end
# Deletes the given move from the Pokémon.
def pbDeleteMove(move)
if move.is_a?(String) || move.is_a?(Symbol)
move=getID(PBMoves,move)
end
return if !move || move<=0
newmoves=[]
for i in 0...4
newmoves.push(@moves[i]) if @moves[i].id!=move
end
newmoves.push(PBMove.new(0))
for i in 0...4
@moves[i]=newmoves[i]
end
end
# Deletes the move at the given index from the Pokémon.
def pbDeleteMoveAtIndex(index)
newmoves=[]
for i in 0...4
newmoves.push(@moves[i]) if i!=index
end
newmoves.push(PBMove.new(0))
for i in 0...4
@moves[i]=newmoves[i]
end
end
# Deletes all moves from the Pokémon.
def pbDeleteAllMoves
for i in 0...4
@moves[i]=PBMove.new(0)
end
end
# Copies currently known moves into a separate array, for Move Relearner.
def pbRecordFirstMoves
@firstmoves=[]
for i in 0...4
@firstmoves.push(@moves[i].id) if @moves[i].id>0
end
end
################################################################################
# Contest attributes, ribbons
################################################################################
def cool; @cool ? @cool : 0; end
def beauty; @beauty ? @beauty : 0; end
def cute; @cute ? @cute : 0; end
def smart; @smart ? @smart : 0; end
def tough; @tough ? @tough : 0; end
def sheen; @sheen ? @sheen : 0; end
# Returns the number of ribbons this Pokemon has.
def ribbonCount
@ribbons=[] if !@ribbons
return @ribbons.length
end
# Returns whether this Pokémon has the specified ribbon.
def hasRibbon?(ribbon)
@ribbons=[] if !@ribbons
ribbon=getID(PBRibbons,ribbon) if !ribbon.is_a?(Integer)
return false if ribbon==0
return @ribbons.include?(ribbon)
end
# Gives this Pokémon the specified ribbon.
def giveRibbon(ribbon)
@ribbons=[] if !@ribbons
ribbon=getID(PBRibbons,ribbon) if !ribbon.is_a?(Integer)
return if ribbon==0
@ribbons.push(ribbon) if [email protected]?(ribbon)
end
# Replaces one ribbon with the next one along, if possible.
def upgradeRibbon(*arg)
@ribbons=[] if !@ribbons
for i in 0...arg.length-1
for j in [email protected]
thisribbon=(arg[i].is_a?(Integer)) ? arg[i] : getID(PBRibbons,arg[i])
if @ribbons[j]==thisribbon
nextribbon=(arg[i+1].is_a?(Integer)) ? arg[i+1] : getID(PBRibbons,arg[i+1])
@ribbons[j]=nextribbon
return nextribbon
end
end
end
if !hasRibbon?(arg[arg.length-1])
firstribbon=(arg[0].is_a?(Integer)) ? arg[0] : getID(PBRibbons,arg[0])
giveRibbon(firstribbon)
return firstribbon
end
return 0
end
# Removes the specified ribbon from this Pokémon.
def takeRibbon(ribbon)
return if !@ribbons
ribbon=getID(PBRibbons,ribbon) if !ribbon.is_a?(Integer)
return if ribbon==0
for i in [email protected]
if @ribbons[i]==ribbon
@ribbons[i]=nil; break
end
end
@ribbons.compact!
end
# Removes all ribbons from this Pokémon.
def clearAllRibbons
@ribbons=[]
end
################################################################################
# Other
################################################################################
# Returns whether this Pokémon has a hold item.
def hasItem?(value=0)
if value==0
return self.item>0
else
if value.is_a?(String) || value.is_a?(Symbol)
value=getID(PBItems,value)
end
return self.item==value
end
return false
end
# Sets this Pokémon's item. Accepts symbols.
def setItem(value)
if value.is_a?(String) || value.is_a?(Symbol)
value=getID(PBItems,value)
end
self.item=value
end
# Returns the items this species can be found holding in the wild.
def wildHoldItems
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,48)
itemcommon=dexdata.fgetw
itemuncommon=dexdata.fgetw
itemrare=dexdata.fgetw
dexdata.close
itemcommon=0 if !itemcommon
itemuncommon=0 if !itemuncommon
itemrare=0 if !itemrare
return [itemcommon,itemuncommon,itemrare]
end
# Returns this Pokémon's mail.
def mail
return nil if !@mail
if @mail.item==0 || !self.hasItem? || @mail.item!=self.item
@mail=nil
return nil
end
return @mail
end
# Returns this Pokémon's language.
def language; @language ? @language : 0; end
# Returns the markings this Pokémon has.
def markings
@markings=0 if !@markings
return @markings
end
# Returns a string stating the Unown form of this Pokémon.
def unownShape
return "ABCDEFGHIJKLMNOPQRSTUVWXYZ?!"[@form,1]
end
# Returns the weight of this Pokémon.
def weight
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,35)
weight=dexdata.fgetw
dexdata.close
return weight
end
# Returns the EV yield of this Pokémon.
def evYield
ret=[]
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,23)
for i in 0...6
v=dexdata.fgetb
v=0 if !v
ret.push(v)
end
dexdata.close
return ret
end
# Sets this Pokémon's HP.
def hp=(value)
value=0 if value<0
@hp=value
if @hp==0
@status=0
@statusCount=0
end
end
# Heals all HP of this Pokémon.
def healHP
return if egg?
@hp=@totalhp
end
# Heals the status problem of this Pokémon.
def healStatus
return if egg?
@status=0
@statusCount=0
end
# Heals all PP of this Pokémon.
def healPP(index=-1)
return if egg?
if index>=0
@moves[index].pp=@moves[index].totalpp
else
for i in 0...4
@moves[i].pp=@moves[i].totalpp
end
end
end
# Heals all HP, PP, and status problems of this Pokémon.
def heal
return if egg?
healHP
healStatus
healPP
end
# Changes the happiness of this Pokémon depending on what happened to change it.
def changeHappiness(method)
gain=0; luxury=false
case method
when "walking"
gain=1
gain+=1 if @happiness<200
gain+=1 if @obtainMap==$game_map.map_id
luxury=true
when "level up"
gain=2
gain=3 if @happiness<200
gain=5 if @happiness<100
luxury=true
when "groom"
gain=4
gain=10 if @happiness<200
luxury=true
when "faint"
gain=-1
when "vitamin"
gain=2
gain=3 if @happiness<200
gain=5 if @happiness<100
when "EV berry"
gain=2
gain=5 if @happiness<200
gain=10 if @happiness<100
when "powder"
gain=-10
gain=-5 if @happiness<200
when "Energy Root"
gain=-15
gain=-10 if @happiness<200
when "Revival Herb"
gain=-20
gain=-15 if @happiness<200
else
Kernel.pbMessage(_INTL("Unknown happiness-changing method."))
end
gain+=1 if luxury && self.ballused==pbGetBallType(:LUXURYBALL)
if isConst?(self.item,PBItems,:SOOTHEBELL) && gain>0
gain=(gain*3.0/2).round
end
@happiness+=gain
@happiness=[[255,@happiness].min,0].max
end
################################################################################
# Stat calculations, Pokémon creation
################################################################################
# Returns this Pokémon's base stats. An array of six values.
def baseStats
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,10)
ret=[
dexdata.fgetb, # HP
dexdata.fgetb, # Attack
dexdata.fgetb, # Defense
dexdata.fgetb, # Speed
dexdata.fgetb, # Special Attack
dexdata.fgetb # Special Defense
]
dexdata.close
return ret
end
# Returns the maximum HP of this Pokémon.
def calcHP(base,level,iv,ev)
return 1 if base==1
return ((base*2+iv+(ev>>2))*level/100).floor+level+10
end
# Returns the specified stat of this Pokémon (not used for total HP).
def calcStat(base,level,iv,ev,pv)
return ((((base*2+iv+(ev>>2))*level/100).floor+5)*pv/100).floor
end
# Recalculates this Pokémon's stats.
def calcStats
nature=self.nature
stats=[]
pvalues=[100,100,100,100,100]
nd5=(nature/5).floor
nm5=(nature%5).floor
if nd5!=nm5
pvalues[nd5]=110
pvalues[nm5]=90
end
level=self.level
bs=self.baseStats
for i in 0..5
base=bs[i]
if i==PBStats::HP
stats[i]=calcHP(base,level,@iv[i],@ev[i])
else
stats[i]=calcStat(base,level,@iv[i],@ev[i],pvalues[i-1])
end
end
diff=@totalhp-@hp
@totalhp=stats[0]
if @hp>0
@hp=@totalhp-diff
@hp=1 if @hp<=0
@hp=@totalhp if @hp>@totalhp
end
@attack=stats[1]
@defense=stats[2]
@speed=stats[3]
@spatk=stats[4]
@spdef=stats[5]
end
# Creates a new Pokémon object.
# species - Pokémon species.
# level - Pokémon level.
# player - PokeBattle_Trainer object for the original trainer.
# withMoves - If false, this Pokémon has no moves.
def initialize(species,level,player=nil,withMoves=true)
if species.is_a?(String) || species.is_a?(Symbol)
species=getID(PBSpecies,species)
end
cname=getConstantName(PBSpecies,species) rescue nil
if !species || species<1 || species>PBSpecies.maxValue || !cname
raise ArgumentError.new(_INTL("The species number (no. {1} of {2}) is invalid.",
species,PBSpecies.maxValue))
return nil
end
time=pbGetTimeNow
@timeReceived=time.getgm.to_i # Use GMT
@form_change_time=pbGetTimeNow
@species=species
# Individual Values
@personalID=rand(256)
@personalID|=rand(256)<<8
@personalID|=rand(256)<<16
@personalID|=rand(256)<<24
@hp=1
@totalhp=1
@ev=[0,0,0,0,0,0]
@iv=[]
@iv[0]=rand(32)
@iv[1]=rand(32)
@iv[2]=rand(32)
@iv[3]=rand(32)
@iv[4]=rand(32)
@iv[5]=rand(32)
if player
[MENTION=20076]trainer[/MENTION]ID=player.id
@ot=player.name
@otgender=player.gender
@language=player.language
else
[MENTION=20076]trainer[/MENTION]ID=0
@ot=""
@otgender=2
end
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,19)
@happiness=dexdata.fgetb
dexdata.close
@name=PBSpecies.getName(@species)
@eggsteps=0
@status=0
@statusCount=0
@item=0
@mail=nil
@fused=nil
@ribbons=[]
@moves=[]
self.ballused=0
self.level=level
calcStats
@hp=@totalhp
if $game_map
@obtainMap=$game_map.map_id
@obtainText=nil
@obtainLevel=level
else
@obtainMap=0
@obtainText=nil
@obtainLevel=level
end
@obtainMode=0 # Met
@obtainMode=4 if $game_switches && $game_switches[FATEFUL_ENCOUNTER_SWITCH]
@hatchedMap=0
if withMoves
atkdata=pbRgssOpen("Data/attacksRS.dat","rb")
offset=atkdata.getOffset(species-1)
length=atkdata.getLength(species-1)>>1
atkdata.pos=offset
# Generating move list
movelist=[]
for i in 0..length-1
alevel=atkdata.fgetw
move=atkdata.fgetw
if alevel<=level
movelist[movelist.length]=move
end
end
atkdata.close
movelist|=[] # Remove duplicates
# Use the last 4 items in the move list
listend=movelist.length-4
listend=0 if listend<0
j=0
for i in listend...listend+4
moveid=(i>=movelist.length) ? 0 : movelist[i]
@moves[j]=PBMove.new(moveid)
j+=1
end
end
end
end
class MoveSelectionSprite < SpriteWrapper
attr_reader :preselected
attr_reader :index
def initialize(viewport=nil,fifthmove=false)
super(viewport)
@movesel=AnimatedBitmap.new("Graphics/Pictures/summarymovesel")
[MENTION=19010]Frame[/MENTION]=0
@index=0
@fifthmove=fifthmove
@preselected=false
@updating=false
[MENTION=24071]Sprite[/MENTION]Visible=true
refresh
end
def dispose
@movesel.dispose
super
end
def index=(value)
@index=value
refresh
end
def preselected=(value)
@preselected=value
refresh
end
def visible=(value)
super
[MENTION=24071]Sprite[/MENTION]Visible=value if !@updating
end
def refresh
[email protected]
[email protected]/2
self.x=240
self.y=92+(self.index*64)
self.y-=76 if @fifthmove
self.y+=20 if @fifthmove && self.index==4
[email protected]
if self.preselected
self.src_rect.set(0,h,w,h)
else
self.src_rect.set(0,0,w,h)
end
end
def update
@updating=true
super
@movesel.update
@updating=false
refresh
end
end
class PokemonSummaryScene
def pbPokerus(pkmn)
return pkmn.pokerusStage
end
def pbUpdate
pbUpdateSpriteHash [MENTION=24071]Sprite[/MENTION]s)
end
def pbStartScene(party,partyindex)
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@viewport2=Viewport.new(0,220,Graphics.width,Graphics.height)
@viewport2.z=99999+1
@party=party
@partyindex=partyindex
[MENTION=12671]pokemon[/MENTION]=@party[@partyindex]
[MENTION=24071]Sprite[/MENTION]s={}
@typebitmap=AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
[MENTION=24071]Sprite[/MENTION]s["background"]=IconSprite.new(0,0,@viewport)
[MENTION=24071]Sprite[/MENTION]s["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
[MENTION=24071]Sprite[/MENTION]s["overlay2"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport2)
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"]=IconSprite.new(0,0,@viewport)
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"].visible=false
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"].z [MENTION=24071]Sprite[/MENTION]s["background"].z+1
[MENTION=24071]Sprite[/MENTION]s["pokemon"]=PokemonBattlerSprite.new(false,0,@viewport)
[MENTION=24071]Sprite[/MENTION]s["pokemon"].setPokemonBitmap [MENTION=12671]pokemon[/MENTION])
[MENTION=24071]Sprite[/MENTION]s["pokemon"].mirror=false
[MENTION=24071]Sprite[/MENTION]s["pokemon"].color=Color.new(0,0,0,0)
[MENTION=24071]Sprite[/MENTION]s["pokemon"].visible=true
pbPositionPokemonSprite [MENTION=24071]Sprite[/MENTION]s["pokemon"],40,144)
[MENTION=24071]Sprite[/MENTION]s["pokeicon"]=PokemonBoxIcon.new [MENTION=12671]pokemon[/MENTION],@viewport)
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].x=14
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].y=52
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].mirror=false
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].visible=false
[MENTION=24071]Sprite[/MENTION]s["movepresel"]=MoveSelectionSprite.new(@viewport)
[MENTION=24071]Sprite[/MENTION]s["movepresel"].visible=false
[MENTION=24071]Sprite[/MENTION]s["movepresel"].preselected=true
[MENTION=24071]Sprite[/MENTION]s["movesel"]=MoveSelectionSprite.new(@viewport)
[MENTION=24071]Sprite[/MENTION]s["movesel"].visible=false
[MENTION=25630]Page[/MENTION]=0
drawPageOne [MENTION=12671]pokemon[/MENTION])
pbFadeInAndShow [MENTION=24071]Sprite[/MENTION]s) { pbUpdate }
end
def pbStartForgetScene(party,partyindex,moveToLearn)
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@viewport2=Viewport.new(0,220,Graphics.width,Graphics.height)
@viewport2.z=99999+1
@party=party
@partyindex=partyindex
[MENTION=12671]pokemon[/MENTION]=@party[@partyindex]
[MENTION=24071]Sprite[/MENTION]s={}
[MENTION=25630]Page[/MENTION]=3
@typebitmap=AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
[MENTION=24071]Sprite[/MENTION]s["background"]=IconSprite.new(0,0,@viewport)
[MENTION=24071]Sprite[/MENTION]s["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
[MENTION=24071]Sprite[/MENTION]s["overlay2"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport2)
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"]=IconSprite.new(0,0,@viewport)
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"].visible=false
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"].z [MENTION=24071]Sprite[/MENTION]s["background"].z+1
[MENTION=24071]Sprite[/MENTION]s["pokeicon"]=PokemonBoxIcon.new [MENTION=12671]pokemon[/MENTION],@viewport)
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].x=14
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].y=52
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].mirror=false
[MENTION=24071]Sprite[/MENTION]s["movesel"]=MoveSelectionSprite.new(@viewport,moveToLearn>0)
[MENTION=24071]Sprite[/MENTION]s["movesel"].visible=false
[MENTION=24071]Sprite[/MENTION]s["movesel"].visible=true
[MENTION=24071]Sprite[/MENTION]s["movesel"].index=0
drawSelectedMove [MENTION=12671]pokemon[/MENTION],moveToLearn [MENTION=12671]pokemon[/MENTION].moves[0].id)
pbFadeInAndShow [MENTION=24071]Sprite[/MENTION]s)
end
def pbEndScene
pbFadeOutAndHide [MENTION=24071]Sprite[/MENTION]s) { pbUpdate }
pbDisposeSpriteHash [MENTION=24071]Sprite[/MENTION]s)
@typebitmap.dispose
@viewport.dispose
end
def drawMarkings(bitmap,x,y,width,height,markings)
totaltext=""
oldfontname=bitmap.font.name
oldfontsize=bitmap.font.size
oldfontcolor=bitmap.font.color
bitmap.font.size=24
bitmap.font.name="Arial"
PokemonStorage::MARKINGCHARS.each{|item| totaltext+=item }
totalsize=bitmap.text_size(totaltext)
realX=x+(width/2)-(totalsize.width/2)
realY=y+(height/2)-(totalsize.height/2)
i=0
PokemonStorage::MARKINGCHARS.each{|item|
marked=(markings&(1<<i))!=0
bitmap.font.color=(marked) ? Color.new(72,64,56) : Color.new(184,184,160)
itemwidth=bitmap.text_size(item).width
bitmap.draw_text(realX,realY,itemwidth+2,totalsize.height,item)
realX+=itemwidth
i+=1
}
bitmap.font.name=oldfontname
bitmap.font.size=oldfontsize
bitmap.font.color=oldfontcolor
end
def drawPageOne(pokemon)
if pokemon.isEgg?
drawPageOneEgg(pokemon)
return
end
overlay [MENTION=24071]Sprite[/MENTION]s["overlay"].bitmap
overlay.clear
[MENTION=24071]Sprite[/MENTION]s["background"].setBitmap("Graphics/Pictures/summary1")
imagepos=[]
if pbPokerus(pokemon)==1 || pokemon.hp==0 || [MENTION=12671]pokemon[/MENTION].status>0
status=6 if pbPokerus(pokemon)==1
status [MENTION=12671]pokemon[/MENTION].status-1 if [MENTION=12671]pokemon[/MENTION].status>0
status=5 if pokemon.hp==0
imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
end
if pokemon.isShiny?
imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
end
if pbPokerus(pokemon)==2
imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),176,100,0,0,-1,-1])
end
ballused [MENTION=12671]pokemon[/MENTION].ballused ? [MENTION=12671]pokemon[/MENTION].ballused : 0
ballimage=sprintf("Graphics/Pictures/summaryball%02d" [MENTION=12671]pokemon[/MENTION].ballused)
imagepos.push([ballimage,14,60,0,0,-1,-1])
if (pokemon.isShadow? rescue false)
imagepos.push(["Graphics/Pictures/summaryShadow",224,240,0,0,-1,-1])
shadowfract=pokemon.heartgauge*1.0/PokeBattle_Pokemon::HEARTGAUGESIZE
imagepos.push(["Graphics/Pictures/summaryShadowBar",242,280,0,0,(shadowfract*248).floor,-1])
end
pbDrawImagePositions(overlay,imagepos)
base=Color.new(248,248,248)
shadow=Color.new(104,104,104)
pbSetSystemFont(overlay)
numberbase=(pokemon.isShiny?) ? Color.new(248,56,32) : Color.new(64,64,64)
numbershadow=(pokemon.isShiny?) ? Color.new(224,152,144) : Color.new(176,176,176)
publicID=pokemon.publicID
speciesname=PBSpecies.getName(pokemon.species)
itemname=pokemon.hasItem? ? PBItems.getName(pokemon.item) : _INTL("None")
growthrate=pokemon.growthrate
startexp=PBExperience.pbGetStartExperience(pokemon.level,growthrate)
endexp=PBExperience.pbGetStartExperience(pokemon.level+1,growthrate)
pokename [MENTION=12671]pokemon[/MENTION].name
textpos=[
[_INTL("INFO"),26,16,0,base,shadow],
[pokename,46,62,0,base,shadow],
[pokemon.level.to_s,46,92,0,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Item"),16,320,0,base,shadow],
[itemname,16,352,0,Color.new(64,64,64),Color.new(176,176,176)],
[_ISPRINTF("Dex No."),238,80,0,base,shadow],
[sprintf("%03d",pokemon.species),435,80,2,numberbase,numbershadow],
[_INTL("Species"),238,112,0,base,shadow],
[speciesname,435,112,2,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Type"),238,144,0,base,shadow],
[_INTL("OT"),238,176,0,base,shadow],
[_INTL("ID No."),238,208,0,base,shadow],
]
if (pokemon.isShadow? rescue false)
textpos.push([_INTL("Heart Gauge"),238,240,0,base,shadow])
heartmessage=[_INTL("The door to its heart is open! Undo the final lock!"),
_INTL("The door to its heart is almost fully open."),
_INTL("The door to its heart is nearly open."),
_INTL("The door to its heart is opening wider."),
_INTL("The door to its heart is opening up."),
_INTL("The door to its heart is tightly shut.")
][pokemon.heartStage]
memo=sprintf("<c3=404040,B0B0B0>%s\n",heartmessage)
drawFormattedTextEx(overlay,238,304,276,memo)
else
textpos.push([_INTL("Exp. Points"),238,240,0,base,shadow])
textpos.push([sprintf("%d",pokemon.exp),488,272,1,Color.new(64,64,64),Color.new(176,176,176)])
textpos.push([_INTL("To Next Lv."),238,304,0,base,shadow])
textpos.push([sprintf("%d",endexp-pokemon.exp),488,336,1,Color.new(64,64,64),Color.new(176,176,176)])
end
idno=(pokemon.ot=="") ? "?????" : sprintf("%05d",publicID)
textpos.push([idno,435,208,2,Color.new(64,64,64),Color.new(176,176,176)])
if pokemon.ot==""
textpos.push([_INTL("RENTAL"),435,176,2,Color.new(64,64,64),Color.new(176,176,176)])
else
ownerbase=Color.new(64,64,64)
ownershadow=Color.new(176,176,176)
if pokemon.otgender==0 # male OT
ownerbase=Color.new(24,112,216)
ownershadow=Color.new(136,168,208)
elsif pokemon.otgender==1 # female OT
ownerbase=Color.new(248,56,32)
ownershadow=Color.new(224,152,144)
end
textpos.push([pokemon.ot,435,176,2,ownerbase,ownershadow])
end
if pokemon.isMale?
textpos.push([_INTL("♂"),178,62,0,Color.new(24,112,216),Color.new(136,168,208)])
elsif pokemon.isFemale?
textpos.push([_INTL("♀"),178,62,0,Color.new(248,56,32),Color.new(224,152,144)])
end
pbDrawTextPositions(overlay,textpos)
drawMarkings(overlay,15,291,72,20,pokemon.markings)
type1rect=Rect.new(0,pokemon.type1*28,64,28)
type2rect=Rect.new(0,pokemon.type2*28,64,28)
# Tercer tipo
type3rect=Rect.new(0,pokemon.type3*28,64,28)
if pokemon.type1==pokemon.type2
overlay.blt(402,146,@typebitmap.bitmap,type1rect)
else
overlay.blt(370,146,@typebitmap.bitmap,type1rect)
overlay.blt(436,146,@typebitmap.bitmap,type2rect)
# Tercer tipo
overlay.blt(300,146,@typebitmap.bitmap,type3rect)
end
if pokemon.level<PBExperience::MAXLEVEL
overlay.fill_rect(362,372,(pokemon.exp-startexp)*128/(endexp-startexp),2,Color.new(72,120,160))
overlay.fill_rect(362,374,(pokemon.exp-startexp)*128/(endexp-startexp),4,Color.new(24,144,248))
end
end
def drawPageOneEgg(pokemon)
overlay [MENTION=24071]Sprite[/MENTION]s["overlay"].bitmap
overlay.clear
[MENTION=24071]Sprite[/MENTION]s["background"].setBitmap("Graphics/Pictures/summaryEgg")
imagepos=[]
ballused [MENTION=12671]pokemon[/MENTION].ballused ? [MENTION=12671]pokemon[/MENTION].ballused : 0
ballimage=sprintf("Graphics/Pictures/summaryball%02d" [MENTION=12671]pokemon[/MENTION].ballused)
imagepos.push([ballimage,14,60,0,0,-1,-1])
pbDrawImagePositions(overlay,imagepos)
base=Color.new(248,248,248)
shadow=Color.new(104,104,104)
pbSetSystemFont(overlay)
itemname=pokemon.hasItem? ? PBItems.getName(pokemon.item) : _INTL("None")
textpos=[
[_INTL("TRAINER MEMO"),26,16,0,base,shadow],
[pokemon.name,46,62,0,base,shadow],
[_INTL("Item"),16,320,0,base,shadow],
[itemname,16,352,0,Color.new(64,64,64),Color.new(176,176,176)],
]
pbDrawTextPositions(overlay,textpos)
memo=""
if pokemon.timeReceived
month=pbGetAbbrevMonthName(pokemon.timeReceived.mon)
date=pokemon.timeReceived.day
year=pokemon.timeReceived.year
memo+=_INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",month,date,year)
end
mapname=pbGetMapNameFromId(pokemon.obtainMap)
if (pokemon.obtainText rescue false) && pokemon.obtainText!=""
mapname=pokemon.obtainText
end
if mapname && mapname!=""
memo+=_INTL("<c3=404040,B0B0B0>A mysterious Pokémon Egg received from <c3=F83820,E09890>{1}<c3=404040,B0B0B0>.\n",mapname)
end
memo+="<c3=404040,B0B0B0>\n"
memo+=_INTL("<c3=404040,B0B0B0>"The Egg Watch"\n")
eggstate=_INTL("It looks like this Egg will take a long time to hatch.")
eggstate=_INTL("What will hatch from this? It doesn't seem close to hatching.") if pokemon.eggsteps<10200
eggstate=_INTL("It appears to move occasionally. It may be close to hatching.") if pokemon.eggsteps<2550
eggstate=_INTL("Sounds can be heard coming from inside! It will hatch soon!") if pokemon.eggsteps<1275
memo+=sprintf("<c3=404040,B0B0B0>%s\n",eggstate)
drawFormattedTextEx(overlay,232,78,276,memo)
drawMarkings(overlay,15,291,72,20,pokemon.markings)
end
def drawPageTwo(pokemon)
overlay [MENTION=24071]Sprite[/MENTION]s["overlay"].bitmap
overlay.clear
[MENTION=24071]Sprite[/MENTION]s["background"].setBitmap("Graphics/Pictures/summary2")
imagepos=[]
if pbPokerus(pokemon)==1 || pokemon.hp==0 || [MENTION=12671]pokemon[/MENTION].status>0
status=6 if pbPokerus(pokemon)==1
status [MENTION=12671]pokemon[/MENTION].status-1 if [MENTION=12671]pokemon[/MENTION].status>0
status=5 if pokemon.hp==0
imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
end
if pokemon.isShiny?
imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
end
if pbPokerus(pokemon)==2
imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),176,100,0,0,-1,-1])
end
ballused [MENTION=12671]pokemon[/MENTION].ballused ? [MENTION=12671]pokemon[/MENTION].ballused : 0
ballimage=sprintf("Graphics/Pictures/summaryball%02d" [MENTION=12671]pokemon[/MENTION].ballused)
imagepos.push([ballimage,14,60,0,0,-1,-1])
pbDrawImagePositions(overlay,imagepos)
base=Color.new(248,248,248)
shadow=Color.new(104,104,104)
pbSetSystemFont(overlay)
naturename=PBNatures.getName(pokemon.nature)
itemname=pokemon.hasItem? ? PBItems.getName(pokemon.item) : _INTL("None")
pokename [MENTION=12671]pokemon[/MENTION].name
textpos=[
[_INTL("TRAINER MEMO"),26,16,0,base,shadow],
[pokename,46,62,0,base,shadow],
[pokemon.level.to_s,46,92,0,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Item"),16,320,0,base,shadow],
[itemname,16,352,0,Color.new(64,64,64),Color.new(176,176,176)],
]
if pokemon.isMale?
textpos.push([_INTL("♂"),178,62,0,Color.new(24,112,216),Color.new(136,168,208)])
elsif pokemon.isFemale?
textpos.push([_INTL("♀"),178,62,0,Color.new(248,56,32),Color.new(224,152,144)])
end
pbDrawTextPositions(overlay,textpos)
memo=""
shownature=(!(pokemon.isShadow? rescue false)) || pokemon.heartStage<=3
if shownature
memo+=_INTL("<c3=F83820,E09890>{1}<c3=404040,B0B0B0> nature.\n",naturename)
end
if pokemon.timeReceived
month=pbGetAbbrevMonthName(pokemon.timeReceived.mon)
date=pokemon.timeReceived.day
year=pokemon.timeReceived.year
memo+=_INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",month,date,year)
end
mapname=pbGetMapNameFromId(pokemon.obtainMap)
if (pokemon.obtainText rescue false) && pokemon.obtainText!=""
mapname=pokemon.obtainText
end
if mapname && mapname!=""
memo+=sprintf("<c3=F83820,E09890>%s\n",mapname)
else
memo+=_INTL("<c3=F83820,E09890>Faraway place\n")
end
if pokemon.obtainMode
mettext=[_INTL("Met at Lv. {1}.",pokemon.obtainLevel),
_INTL("Egg received."),
_INTL("Traded at Lv. {1}.",pokemon.obtainLevel),
"",
_INTL("Had a fateful encounter at Lv. {1}.",pokemon.obtainLevel)
][pokemon.obtainMode]
memo+=sprintf("<c3=404040,B0B0B0>%s\n",mettext)
if pokemon.obtainMode==1 # hatched
if pokemon.timeEggHatched
month=pbGetAbbrevMonthName(pokemon.timeEggHatched.mon)
date=pokemon.timeEggHatched.day
year=pokemon.timeEggHatched.year
memo+=_INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",month,date,year)
end
mapname=pbGetMapNameFromId(pokemon.hatchedMap)
if mapname && mapname!=""
memo+=sprintf("<c3=F83820,E09890>%s\n",mapname)
else
memo+=_INTL("<c3=F83820,E09890>Faraway place\n")
end
memo+=_INTL("<c3=404040,B0B0B0>Egg hatched.\n")
else
memo+="<c3=404040,B0B0B0>\n"
end
end
if shownature
bestiv=0
tiebreaker=pokemon.personalID%6
for i in 0...6
if pokemon.iv[i]==pokemon.iv[bestiv]
bestiv=i if i>=tiebreaker && bestiv<tiebreaker
elsif pokemon.iv[i]>pokemon.iv[bestiv]
bestiv=i
end
end
characteristic=[_INTL("Loves to eat."),
_INTL("Often dozes off."),
_INTL("Often scatters things."),
_INTL("Scatters things often."),
_INTL("Likes to relax."),
_INTL("Proud of its power."),
_INTL("Likes to thrash about."),
_INTL("A little quick tempered."),
_INTL("Likes to fight."),
_INTL("Quick tempered."),
_INTL("Sturdy body."),
_INTL("Capable of taking hits."),
_INTL("Highly persistent."),
_INTL("Good endurance."),
_INTL("Good perseverance."),
_INTL("Likes to run."),
_INTL("Alert to sounds."),
_INTL("Impetuous and silly."),
_INTL("Somewhat of a clown."),
_INTL("Quick to flee."),
_INTL("Highly curious."),
_INTL("Mischievous."),
_INTL("Thoroughly cunning."),
_INTL("Often lost in thought."),
_INTL("Very finicky."),
_INTL("Strong willed."),
_INTL("Somewhat vain."),
_INTL("Strongly defiant."),
_INTL("Hates to lose."),
_INTL("Somewhat stubborn.")
][bestiv*5+pokemon.iv[bestiv]%5]
memo+=sprintf("<c3=404040,B0B0B0>%s\n",characteristic)
end
drawFormattedTextEx(overlay,232,78,276,memo)
drawMarkings(overlay,15,291,72,20,pokemon.markings)
end
def drawPageThree(pokemon)
overlay [MENTION=24071]Sprite[/MENTION]s["overlay"].bitmap
overlay.clear
[MENTION=24071]Sprite[/MENTION]s["background"].setBitmap("Graphics/Pictures/summary3")
imagepos=[]
if pbPokerus(pokemon)==1 || pokemon.hp==0 || [MENTION=12671]pokemon[/MENTION].status>0
status=6 if pbPokerus(pokemon)==1
status [MENTION=12671]pokemon[/MENTION].status-1 if [MENTION=12671]pokemon[/MENTION].status>0
status=5 if pokemon.hp==0
imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
end
if pokemon.isShiny?
imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
end
if pbPokerus(pokemon)==2
imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),176,100,0,0,-1,-1])
end
ballused [MENTION=12671]pokemon[/MENTION].ballused ? [MENTION=12671]pokemon[/MENTION].ballused : 0
ballimage=sprintf("Graphics/Pictures/summaryball%02d" [MENTION=12671]pokemon[/MENTION].ballused)
imagepos.push([ballimage,14,60,0,0,-1,-1])
pbDrawImagePositions(overlay,imagepos)
base=Color.new(248,248,248)
shadow=Color.new(104,104,104)
statshadows=[]
for i in 0...5; statshadows[i]=shadow; end
if !(pokemon.isShadow? rescue false) || pokemon.heartStage<=3
natup=(pokemon.nature/5).floor
natdn=(pokemon.nature%5).floor
statshadows[natup]=Color.new(136,96,72) if natup!=natdn
statshadows[natdn]=Color.new(64,120,152) if natup!=natdn
end
pbSetSystemFont(overlay)
abilityname=PBAbilities.getName(pokemon.ability)
abilitydesc=pbGetMessage(MessageTypes::AbilityDescs,pokemon.ability)
itemname=pokemon.hasItem? ? PBItems.getName(pokemon.item) : _INTL("None")
pokename [MENTION=12671]pokemon[/MENTION].name
textpos=[
[_INTL("SKILLS"),26,16,0,base,shadow],
[pokename,46,62,0,base,shadow],
[pokemon.level.to_s,46,92,0,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Item"),16,320,0,base,shadow],
[itemname,16,352,0,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("HP"),292,76,2,base,shadow],
[sprintf("%3d/%3d",pokemon.hp,pokemon.totalhp),462,76,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Attack"),248,120,0,base,statshadows[0]],
[sprintf("%d",pokemon.attack),456,120,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Defense"),248,152,0,base,statshadows[1]],
[sprintf("%d",pokemon.defense),456,152,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Sp. Atk"),248,184,0,base,statshadows[3]],
[sprintf("%d",pokemon.spatk),456,184,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Sp. Def"),248,216,0,base,statshadows[4]],
[sprintf("%d",pokemon.spdef),456,216,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Speed"),248,248,0,base,statshadows[2]],
[sprintf("%d",pokemon.speed),456,248,1,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Ability"),224,284,0,base,shadow],
[abilityname,362,284,0,Color.new(64,64,64),Color.new(176,176,176)],
]
if pokemon.isMale?
textpos.push([_INTL("♂"),178,62,0,Color.new(24,112,216),Color.new(136,168,208)])
elsif pokemon.isFemale?
textpos.push([_INTL("♀"),178,62,0,Color.new(248,56,32),Color.new(224,152,144)])
end
pbDrawTextPositions(overlay,textpos)
drawTextEx(overlay,224,316,282,2,abilitydesc,Color.new(64,64,64),Color.new(176,176,176))
drawMarkings(overlay,15,291,72,20,pokemon.markings)
if pokemon.hp>0
hpcolors=[
Color.new(24,192,32),Color.new(0,144,0), # Green
Color.new(248,184,0),Color.new(184,112,0), # Orange
Color.new(240,80,32),Color.new(168,48,56) # Red
]
hpzone=0
hpzone=1 if pokemon.hp<= [MENTION=12671]pokemon[/MENTION].totalhp/2).floor
hpzone=2 if pokemon.hp<= [MENTION=12671]pokemon[/MENTION].totalhp/4).floor
overlay.fill_rect(360,110,pokemon.hp*96/pokemon.totalhp,2,hpcolors[hpzone*2+1])
overlay.fill_rect(360,112,pokemon.hp*96/pokemon.totalhp,4,hpcolors[hpzone*2])
end
end
def drawPageFour(pokemon)
overlay [MENTION=24071]Sprite[/MENTION]s["overlay"].bitmap
overlay.clear
overlay2 [MENTION=24071]Sprite[/MENTION]s["overlay2"].bitmap
overlay2.clear
[MENTION=24071]Sprite[/MENTION]s["background"].setBitmap("Graphics/Pictures/summary4")
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"].visible=false
[MENTION=24071]Sprite[/MENTION]s["pokemon"].visible=true
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].visible=false
imagepos=[]
if pbPokerus(pokemon)==1 || pokemon.hp==0 || [MENTION=12671]pokemon[/MENTION].status>0
status=6 if pbPokerus(pokemon)==1
status [MENTION=12671]pokemon[/MENTION].status-1 if [MENTION=12671]pokemon[/MENTION].status>0
status=5 if pokemon.hp==0
imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
end
if pokemon.isShiny?
imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
end
if pbPokerus(pokemon)==2
imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),176,100,0,0,-1,-1])
end
ballused [MENTION=12671]pokemon[/MENTION].ballused ? [MENTION=12671]pokemon[/MENTION].ballused : 0
ballimage=sprintf("Graphics/Pictures/summaryball%02d" [MENTION=12671]pokemon[/MENTION].ballused)
imagepos.push([ballimage,14,60,0,0,-1,-1])
pbDrawImagePositions(overlay,imagepos)
base=Color.new(248,248,248)
shadow=Color.new(104,104,104)
pbSetSystemFont(overlay)
itemname=pokemon.hasItem? ? PBItems.getName(pokemon.item) : _INTL("None")
pokename [MENTION=12671]pokemon[/MENTION].name
textpos=[
[_INTL("MOVES"),26,16,0,base,shadow],
[pokename,46,62,0,base,shadow],
[pokemon.level.to_s,46,92,0,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Item"),16,320,0,base,shadow],
[itemname,16,352,0,Color.new(64,64,64),Color.new(176,176,176)],
]
if pokemon.isMale?
textpos.push([_INTL("♂"),178,62,0,Color.new(24,112,216),Color.new(136,168,208)])
elsif pokemon.isFemale?
textpos.push([_INTL("♀"),178,62,0,Color.new(248,56,32),Color.new(224,152,144)])
end
pbDrawTextPositions(overlay,textpos)
imagepos=[]
yPos=98
for i in 0...pokemon.moves.length
if pokemon.moves[i].id>0
imagepos.push(["Graphics/Pictures/types",248,yPos+2,0,
pokemon.moves[i].type*28,64,28])
textpos.push([PBMoves.getName(pokemon.moves[i].id),316,yPos,0,
Color.new(64,64,64),Color.new(176,176,176)])
if pokemon.moves[i].totalpp>0
textpos.push([_ISPRINTF("PP"),342,yPos+32,0,
Color.new(64,64,64),Color.new(176,176,176)])
textpos.push([sprintf("%d/%d",pokemon.moves[i].pp,pokemon.moves[i].totalpp),
460,yPos+32,1,Color.new(64,64,64),Color.new(176,176,176)])
end
else
textpos.push(["-",316,yPos,0,Color.new(64,64,64),Color.new(176,176,176)])
textpos.push(["--",442,yPos+32,1,Color.new(64,64,64),Color.new(176,176,176)])
end
yPos+=64
end
pbDrawTextPositions(overlay,textpos)
pbDrawImagePositions(overlay,imagepos)
drawMarkings(overlay,15,291,72,20,pokemon.markings)
end
def drawSelectedMove(pokemon,moveToLearn,moveid)
overlay [MENTION=24071]Sprite[/MENTION]s["overlay"].bitmap
overlay2 [MENTION=24071]Sprite[/MENTION]s["overlay2"].bitmap
overlay2.clear
[MENTION=24071]Sprite[/MENTION]s["overlay2"].y=0
[MENTION=24071]Sprite[/MENTION]s["pokemon"].visible=false if [MENTION=24071]Sprite[/MENTION]s["pokemon"]
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].setBitmap(pbPokemonIconFile(pokemon))
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].src_rect=Rect.new(0,0,64,64)
[MENTION=24071]Sprite[/MENTION]s["pokeicon"].visible=true
movedata=PBMoveData.new(moveid)
basedamage=movedata.basedamage
type=movedata.type
category=movedata.category
accuracy=movedata.accuracy
drawMoveSelection(pokemon,moveToLearn)
pbSetSystemFont(overlay)
pbSetSystemFont(overlay2)
move=moveid
textpos=[
[basedamage<=1 ? basedamage==1 ? "???" : "---" : sprintf("%d",basedamage),
216,154,1,Color.new(64,64,64),Color.new(176,176,176)],
[accuracy==0 ? "---" : sprintf("%d",accuracy),
216,186,1,Color.new(64,64,64),Color.new(176,176,176)]
]
pbDrawTextPositions(overlay,textpos)
imagepos=[["Graphics/Pictures/category",166,124,0,category*28,64,28]]
pbDrawImagePositions(overlay,imagepos)
desclength=pbGetMessage(MessageTypes::MoveDescriptions,moveid)
desclength=getLineBrokenChunks(overlay2,desclength,238,nil,true)
$desclength=desclength.collect{|x| x[1]}.grep(0).size
drawTextEx(overlay2,4,0,238,$desclength,
pbGetMessage(MessageTypes::MoveDescriptions,moveid),
Color.new(64,64,64),Color.new(176,176,176))
end
def drawMoveSelection(pokemon,moveToLearn)
overlay [MENTION=24071]Sprite[/MENTION]s["overlay"].bitmap
overlay.clear
overlay2 [MENTION=24071]Sprite[/MENTION]s["overlay2"].bitmap
overlay2.clear
base=Color.new(248,248,248)
shadow=Color.new(104,104,104)
[MENTION=24071]Sprite[/MENTION]s["background"].setBitmap("Graphics/Pictures/summary4details")
if moveToLearn!=0
[MENTION=24071]Sprite[/MENTION]s["background"].setBitmap("Graphics/Pictures/summary4learning")
end
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"].setBitmap("Graphics/Pictures/summary4overlay")
pbSetSystemFont(overlay)
pbSetSystemFont(overlay2)
textpos=[
[_INTL("MOVES"),26,16,0,base,shadow],
[_INTL("CATEGORY"),20,122,0,base,shadow],
[_INTL("POWER"),20,154,0,base,shadow],
[_INTL("ACCURACY"),20,186,0,base,shadow]
]
type1rect=Rect.new(0,pokemon.type1*28,64,28)
type2rect=Rect.new(0,pokemon.type2*28,64,28)
# Tercer tipo
type3rect=Rect.new(0,pokemon.type3*28,64,28)
if pokemon.type1==pokemon.type2
overlay.blt(130,78,@typebitmap.bitmap,type1rect)
else
overlay.blt(96,78,@typebitmap.bitmap,type1rect)
overlay.blt(166,78,@typebitmap.bitmap,type2rect)
# Tercer tipo
overlay.blt(60,78,@typebitmap.bitmap,type3rect)
end
imagepos=[]
yPos=98
yPos-=76 if moveToLearn!=0
for i in 0...5
moveobject=nil
if i==4
moveobject=PBMove.new(moveToLearn) if moveToLearn!=0
yPos+=20
else
moveobject=pokemon.moves[i]
end
if moveobject
if moveobject.id!=0
imagepos.push(["Graphics/Pictures/types",248,yPos+2,0,
moveobject.type*28,64,28])
textpos.push([PBMoves.getName(moveobject.id),316,yPos,0,
Color.new(64,64,64),Color.new(176,176,176)])
if moveobject.totalpp>0
textpos.push([_ISPRINTF("PP"),342,yPos+32,0,
Color.new(64,64,64),Color.new(176,176,176)])
textpos.push([sprintf("%d/%d",moveobject.pp,moveobject.totalpp),
460,yPos+32,1,Color.new(64,64,64),Color.new(176,176,176)])
end
else
textpos.push(["-",316,yPos,0,Color.new(64,64,64),Color.new(176,176,176)])
textpos.push(["--",442,yPos+32,1,Color.new(64,64,64),Color.new(176,176,176)])
end
end
yPos+=64
end
pbDrawTextPositions(overlay,textpos)
pbDrawImagePositions(overlay,imagepos)
end
def drawPageFive(pokemon)
overlay [MENTION=24071]Sprite[/MENTION]s["overlay"].bitmap
overlay.clear
overlay2 [MENTION=24071]Sprite[/MENTION]s["overlay2"].bitmap
overlay2.clear
[MENTION=24071]Sprite[/MENTION]s["background"].setBitmap("Graphics/Pictures/summary5")
imagepos=[]
if pbPokerus(pokemon)==1 || pokemon.hp==0 || [MENTION=12671]pokemon[/MENTION].status>0
status=6 if pbPokerus(pokemon)==1
status [MENTION=12671]pokemon[/MENTION].status-1 if [MENTION=12671]pokemon[/MENTION].status>0
status=5 if pokemon.hp==0
imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
end
if pokemon.isShiny?
imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
end
if pbPokerus(pokemon)==2
imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),176,100,0,0,-1,-1])
end
ballused [MENTION=12671]pokemon[/MENTION].ballused ? [MENTION=12671]pokemon[/MENTION].ballused : 0
ballimage=sprintf("Graphics/Pictures/summaryball%02d" [MENTION=12671]pokemon[/MENTION].ballused)
imagepos.push([ballimage,14,60,0,0,-1,-1])
pbDrawImagePositions(overlay,imagepos)
base=Color.new(248,248,248)
shadow=Color.new(104,104,104)
pbSetSystemFont(overlay)
itemname=pokemon.hasItem? ? PBItems.getName(pokemon.item) : _INTL("None")
pokename [MENTION=12671]pokemon[/MENTION].name
textpos=[
[_INTL("RIBBONS"),26,16,0,base,shadow],
[pokename,46,62,0,base,shadow],
[pokemon.level.to_s,46,92,0,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("Item"),16,320,0,base,shadow],
[itemname,16,352,0,Color.new(64,64,64),Color.new(176,176,176)],
[_INTL("No. of Ribbons:"),234,342,0,Color.new(64,64,64),Color.new(176,176,176)],
[pokemon.ribbonCount.to_s,450,342,1,Color.new(64,64,64),Color.new(176,176,176)],
]
if pokemon.isMale?
textpos.push([_INTL("♂"),178,62,0,Color.new(24,112,216),Color.new(136,168,208)])
elsif pokemon.isFemale?
textpos.push([_INTL("♀"),178,62,0,Color.new(248,56,32),Color.new(224,152,144)])
end
pbDrawTextPositions(overlay,textpos)
imagepos=[]
coord=0
if pokemon.ribbons
for i in pokemon.ribbons
ribn=i-1
imagepos.push(["Graphics/Pictures/ribbons",236+64*(coord%4),86+80*(coord/4).floor,
64*(ribn%8),64*(ribn/8).floor,64,64])
coord+=1
break if coord>=12
end
end
pbDrawImagePositions(overlay,imagepos)
drawMarkings(overlay,15,291,72,20,pokemon.markings)
end
def pbChooseMoveToForget(moveToLearn)
selmove=0
ret=0
descpos=0
maxmove=(moveToLearn>0) ? 4 : 3
loop do
Graphics.update
Input.update
pbUpdate
if Input.trigger?(Input::B)
ret=4
break
end
if Input.trigger?(Input::C)
break
end
if Input.trigger?(Input::DOWN)
descpos=0
selmove+=1
if selmove<4 && selmove> [MENTION=12671]pokemon[/MENTION].numMoves
selmove=(moveToLearn>0) ? maxmove : 0
end
selmove=0 if selmove>maxmove
[MENTION=24071]Sprite[/MENTION]s["movesel"].index=selmove
newmove=(selmove==4) ? moveToLearn : [MENTION=12671]pokemon[/MENTION].moves[selmove].id
drawSelectedMove [MENTION=12671]pokemon[/MENTION],moveToLearn,newmove)
ret=selmove
end
if Input.trigger?(Input::UP)
descpos=0
selmove-=1
selmove=maxmove if selmove<0
if selmove<4 && selmove> [MENTION=12671]pokemon[/MENTION].numMoves
selmove [MENTION=12671]pokemon[/MENTION].numMoves-1
end
[MENTION=24071]Sprite[/MENTION]s["movesel"].index=selmove
newmove=(selmove==4) ? moveToLearn : [MENTION=12671]pokemon[/MENTION].moves[selmove].id
drawSelectedMove [MENTION=12671]pokemon[/MENTION],moveToLearn,newmove)
ret=selmove
end
if Input.trigger?(Input::L) || Input.repeat?(Input::L)
if descpos>0
descpos-=1
[MENTION=24071]Sprite[/MENTION]s["overlay2"].y+=32
end
end
if Input.trigger?(Input::R) || Input.repeat?(Input::R)
if descpos<$desclength-5 && descpos>=0 && $desclength>5
descpos+=1
[MENTION=24071]Sprite[/MENTION]s["overlay2"].y-=32
end
end
if descpos %2 == 1
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"].visible=true
else
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"].visible=false
end
end
return (ret==4) ? -1 : ret
end
def pbMoveSelection
[MENTION=24071]Sprite[/MENTION]s["movesel"].visible=true
[MENTION=24071]Sprite[/MENTION]s["movesel"].index=0
selmove=0
oldselmove=0
switching=false
drawSelectedMove [MENTION=12671]pokemon[/MENTION],0 [MENTION=12671]pokemon[/MENTION].moves[selmove].id)
descpos=0
loop do
Graphics.update
Input.update
pbUpdate
if [MENTION=24071]Sprite[/MENTION]s["movepresel"].index= [MENTION=24071]Sprite[/MENTION]s["movesel"].index
[MENTION=24071]Sprite[/MENTION]s["movepresel"].z [MENTION=24071]Sprite[/MENTION]s["movesel"].z+1
else
[MENTION=24071]Sprite[/MENTION]s["movepresel"].z [MENTION=24071]Sprite[/MENTION]s["movesel"].z
end
if Input.trigger?(Input::B)
break if !switching
[MENTION=24071]Sprite[/MENTION]s["movepresel"].visible=false
switching=false
end
if Input.trigger?(Input::C)
if selmove==4
break if !switching
[MENTION=24071]Sprite[/MENTION]s["movepresel"].visible=false
switching=false
else
if ! [MENTION=12671]pokemon[/MENTION].isShadow? rescue false)
if !switching
[MENTION=24071]Sprite[/MENTION]s["movepresel"].index=selmove
oldselmove=selmove
[MENTION=24071]Sprite[/MENTION]s["movepresel"].visible=true
switching=true
else
tmpmove [MENTION=12671]pokemon[/MENTION].moves[oldselmove]
[MENTION=12671]pokemon[/MENTION].moves[oldselmove] [MENTION=12671]pokemon[/MENTION].moves[selmove]
[MENTION=12671]pokemon[/MENTION].moves[selmove]=tmpmove
[MENTION=24071]Sprite[/MENTION]s["movepresel"].visible=false
switching=false
drawSelectedMove [MENTION=12671]pokemon[/MENTION],0 [MENTION=12671]pokemon[/MENTION].moves[selmove].id)
end
end
end
end
if Input.trigger?(Input::DOWN)
descpos=0
selmove+=1
selmove=0 if selmove<4 && selmove> [MENTION=12671]pokemon[/MENTION].numMoves
selmove=0 if selmove>=4
selmove=4 if selmove<0
[MENTION=24071]Sprite[/MENTION]s["movesel"].index=selmove
newmove [MENTION=12671]pokemon[/MENTION].moves[selmove].id
pbPlayCursorSE()
drawSelectedMove [MENTION=12671]pokemon[/MENTION],0 [MENTION=12671]pokemon[/MENTION].moves[selmove].id)
end
if Input.trigger?(Input::UP)
descpos=0
selmove-=1
if selmove<4 && selmove> [MENTION=12671]pokemon[/MENTION].numMoves
selmove [MENTION=12671]pokemon[/MENTION].numMoves-1
end
selmove=0 if selmove>=4
selmove [MENTION=12671]pokemon[/MENTION].numMoves-1 if selmove<0
[MENTION=24071]Sprite[/MENTION]s["movesel"].index=selmove
newmove [MENTION=12671]pokemon[/MENTION].moves[selmove].id
pbPlayCursorSE()
drawSelectedMove [MENTION=12671]pokemon[/MENTION],0 [MENTION=12671]pokemon[/MENTION].moves[selmove].id)
end
if Input.trigger?(Input::L) || Input.repeat?(Input::L)
if descpos>0
descpos-=1
[MENTION=24071]Sprite[/MENTION]s["overlay2"].y+=32
end
end
if Input.trigger?(Input::R) || Input.repeat?(Input::R)
if descpos<$desclength-5 && descpos>=0 && $desclength>5
descpos+=1
[MENTION=24071]Sprite[/MENTION]s["overlay2"].y-=32
end
end
if descpos %2 == 1
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"].visible=true
else
[MENTION=24071]Sprite[/MENTION]s["overlaytxt"].visible=false
end
end
[MENTION=24071]Sprite[/MENTION]s["movesel"].visible=false
end
def pbGoToPrevious
if [MENTION=25630]Page[/MENTION]!=0
newindex=@partyindex
while newindex>0
newindex-=1
if @party[newindex] && !@party[newindex].isEgg?
@partyindex=newindex
break
end
end
else
newindex=@partyindex
while newindex>0
newindex-=1
if @party[newindex]
@partyindex=newindex
break
end
end
end
end
def pbGoToNext
if [MENTION=25630]Page[/MENTION]!=0
newindex=@partyindex
while newindex<@party.length-1
newindex+=1
if @party[newindex] && !@party[newindex].isEgg?
@partyindex=newindex
break
end
end
else
newindex=@partyindex
while newindex<@party.length-1
newindex+=1
if @party[newindex]
@partyindex=newindex
break
end
end
end
end
def pbScene
pbPlayCry [MENTION=12671]pokemon[/MENTION])
loop do
Graphics.update
Input.update
pbUpdate
if Input.trigger?(Input::B)
break
end
dorefresh=false
if Input.trigger?(Input::C)
if [MENTION=25630]Page[/MENTION]==0
break
elsif [MENTION=25630]Page[/MENTION]==3
pbMoveSelection
dorefresh=true
drawPageFour [MENTION=12671]pokemon[/MENTION])
end
end
if Input.trigger?(Input::UP) && @partyindex>0
pbGoToPrevious
[MENTION=12671]pokemon[/MENTION]=@party[@partyindex]
[MENTION=24071]Sprite[/MENTION]s["pokemon"].setPokemonBitmap [MENTION=12671]pokemon[/MENTION])
[MENTION=24071]Sprite[/MENTION]s["pokemon"].color=Color.new(0,0,0,0)
pbPositionPokemonSprite [MENTION=24071]Sprite[/MENTION]s["pokemon"],40,144)
dorefresh=true
pbPlayCry [MENTION=12671]pokemon[/MENTION])
end
if Input.trigger?(Input::DOWN) && @partyindex<@party.length-1
pbGoToNext
[MENTION=12671]pokemon[/MENTION]=@party[@partyindex]
[MENTION=24071]Sprite[/MENTION]s["pokemon"].setPokemonBitmap [MENTION=12671]pokemon[/MENTION])
[MENTION=24071]Sprite[/MENTION]s["pokemon"].color=Color.new(0,0,0,0)
pbPositionPokemonSprite [MENTION=24071]Sprite[/MENTION]s["pokemon"],40,144)
dorefresh=true
pbPlayCry [MENTION=12671]pokemon[/MENTION])
end
if Input.trigger?(Input::LEFT) && [MENTION=12671]pokemon[/MENTION].isEgg?
oldpage [MENTION=25630]Page[/MENTION]
[MENTION=25630]Page[/MENTION]-=1
[MENTION=25630]Page[/MENTION]=0 if [MENTION=25630]Page[/MENTION]<0
[MENTION=25630]Page[/MENTION]=4 if [MENTION=25630]Page[/MENTION]>4
dorefresh=true
if [MENTION=25630]Page[/MENTION]!=oldpage # Move to next page
pbPlayCursorSE()
dorefresh=true
end
end
if Input.trigger?(Input::RIGHT) && [MENTION=12671]pokemon[/MENTION].isEgg?
oldpage [MENTION=25630]Page[/MENTION]
[MENTION=25630]Page[/MENTION]+=1
[MENTION=25630]Page[/MENTION]=0 if [MENTION=25630]Page[/MENTION]<0
[MENTION=25630]Page[/MENTION]=4 if [MENTION=25630]Page[/MENTION]>4
if [MENTION=25630]Page[/MENTION]!=oldpage # Move to next page
pbPlayCursorSE()
dorefresh=true
end
end
if dorefresh
case [MENTION=25630]Page[/MENTION]
when 0
drawPageOne [MENTION=12671]pokemon[/MENTION])
when 1
drawPageTwo [MENTION=12671]pokemon[/MENTION])
when 2
drawPageThree [MENTION=12671]pokemon[/MENTION])
when 3
drawPageFour [MENTION=12671]pokemon[/MENTION])
when 4
drawPageFive [MENTION=12671]pokemon[/MENTION])
end
end
end
return @partyindex
end
end
class PokemonSummary
def initialize(scene)
@scene=scene
end
def pbStartScreen(party,partyindex)
@scene.pbStartScene(party,partyindex)
[email protected]
@scene.pbEndScene
return ret
end
def pbStartForgetScreen(party,partyindex,moveToLearn)
ret=-1
@scene.pbStartForgetScene(party,partyindex,moveToLearn)
loop do
[email protected](moveToLearn)
if ret>=0 && moveToLearn!=0 && pbIsHiddenMove?(party[partyindex].moves[ret].id) && !$DEBUG
Kernel.pbMessage(_INTL("HM moves can't be forgotten now.")){ @scene.pbUpdate }
else
break
end
end
@scene.pbEndScene
return ret
end
def pbStartChooseMoveScreen(party,partyindex,message)
ret=-1
@scene.pbStartForgetScene(party,partyindex,0)
Kernel.pbMessage(message){ @scene.pbUpdate }
loop do
[email protected](0)
if ret<0
Kernel.pbMessage(_INTL("You must choose a move!")){ @scene.pbUpdate }
else
break
end
end
@scene.pbEndScene
return ret
end
end
thirdTypePokes = []
# push(species, id del tipo)
thirdTypePokes.push([1, 6])
# Esto incluiría el tipo número 6 a Bulbasaur
def type3
@thirdType = thirdTypePokes.detect{ |pkmn, extraType| pkmn == @species}
if [email protected]?
return @thirdType[1]
end
return self.type1
end
Supongo que con esto solo mostraría el tipo pero no influiría en pantalla ¿verdad? En cuanto tenga un rato lo pruebo a ver.El código de Summary y PokeBattle_Pokemon está bien, pero probablemente siga habiendo problemas con el compilador. No soy muy partidario de modificarlo la verdad. Si sólo has incluído esa parte simplemente sigue buscando "type2" y haz copia y pega cambiándolo por type3.
De todas formas, yo lo del type3 lo haría con un array dentro de los scripts, por ejemplo en Settings.
Y en PokeBattle_PokemonCódigo:thirdTypePokes = [] # push(species, id del tipo) thirdTypePokes.push([1, 6]) # Esto incluiría el tipo número 6 a Bulbasaur
Código:def type3 @thirdType = thirdTypePokes.detect{ |pkmn, extraType| pkmn == @species} if [email protected]? return @thirdType[1] end return self.type1 end
Exacto.Supongo que con esto solo mostraría el tipo pero no influiría en pantalla ¿verdad? En cuanto tenga un rato lo pruebo a ver.