Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Pokémon Birthsigns - By Lucidious89
- # For -Pokémon Essentials-
- #
- #===============================================================================
- # This script intends to add a new mechanic known as "Birthsigns" to
- # Pokémon breeding. Each month of the year corresponds to a different sign,
- # and a Pokémon born under these signs will be infused with their bonuses.
- #
- # These scripts add 24 unique Birthsigns to choose from that come in two
- # sets of 12.
- #
- # You can swap between the two sets by setting "BIRTHSIGNS_SET_2" below to
- # true or false.
- #
- # You may also add a Birthsign to a Pokémon manually through scripts,
- # events, or through the debug menu on the party screen.
- #===============================================================================
- # ~Installation~
- #===============================================================================
- # To install, insert a new section above Main, and paste this there. Name
- # this new section "PokemonBirthsigns". This is a plug-n-play addition, and
- # doesn't require any other changes.
- #
- # However, several areas of the default scripts are overwritten here to
- # allow Pokémon Birthsigns to work. So it's recommended that this be
- # installed in a fresh copy of Essentials.
- #
- # These overwritten sections include:
- # -PField_Time
- # -PokeBattle_Pokemon
- # -PScreen_Party
- # -PScreen_Summary
- # -PField_DayCare
- # -PScreen_EggHatching
- # -PokeBattle_Battle
- # -PField_Field
- # -PScreen_Storage
- #
- # Add-Ons and optional scripts to further enhance Pokemon Birthsigns:
- #===========================================#
- # PBRibbons Update (for 'The Eternal' sign) #
- #===========================================#
- # http://pastebin.com/raw/fDZVLFnm #
- #===========================================#
- # Birthsigns Journal Script #
- #===========================================#
- # http://pastebin.com/raw/XqQTbPcF #
- #===========================================#
- # Birthsign Events Script #
- #===========================================#
- # http://pastebin.com/raw/2GKL2P6f #
- #===========================================#
- #
- # Links to required graphics:
- #===========================================#
- # Birthsigns graphics #
- #===========================================#
- # https://www.dropbox.com/sh/kyrxchab1hsu8m5/AAAFVCHiMtsBnkk-zLFiPhAba?dl=0
- #===========================================#
- # New Ribbons graphic #
- #===========================================#
- # https://www.dropbox.com/s/ln0opj4s5ck6cnq/ribbons.png?dl=0
- #
- #===============================================================================
- # ~Navigation~
- #===============================================================================
- # Since so many areas of the script must be overwritten, this script is
- # very long. To make navigating it easier, I've made added commented out
- # markers to quickly jump around the script using CTRL+F.
- #
- # They are as follows:
- # #TAG1 - Birthsign Set switch (true/false) && Set birthsign names
- # #TAG2 - Birthsign names (hatched)
- # #TAG3 - Birthsign names (manual)
- # #TAG4 - Birthsign descriptions (both hatched & manual)
- # #TAG5 - Birthsign values (manual)
- # #TAG6 - Various methods (for use in scripts or events)
- # #TAG7 - Birthsign Bonuses (passive buffs)
- # #TAG8 - Birthsign Bonuses (battle effects)
- # #TAG9 - Birthsign Bonuses (command options)
- # #TAG10- Birthsign definitions
- # #TAG11- Debug Menu (party screen)
- # #TAG12- Debug Menu (storage screen)
- # #TAG13- Summary Screen revamps
- # #TAG14- PC Storage Screen revamps
- # #TAG15- 'The Ancestor' Effect (alters egg steps)
- # #TAG16- 'The Assassin' Effect (alters odds of sleeping encounters)
- # #TAG17- 'The Scholar' Effect (alters bonus exp yield)
- # #TAG18- 'The Aristocrat' Effect (alters amount of bonus money)
- # #TAG19- 'The Hunter' Effect (alters capture rate)
- # #TAG20- 'The Specialist' Effect (change Hidden Power spreads)
- #
- #===============================================================================
- # Everything below is written for Pokémon Essentials v.16.1
- #===============================================================================
- #########[SECTION 1]##########
- #===============================================================================
- # Toggles between Birthsign set 1 (false) or 2 (true).
- # #TAG1
- #===============================================================================
- BIRTHSIGNS_SET_2 = false
- #===============================================================================
- # Sets the names for each of the birthsigns. If you want to change the name
- # of a birthsign, you may do so here.
- # The rest of the script will recognize whatever name you enter here, along
- # with the Birthsigns Journal and Birthsign Events scripts.
- #===============================================================================
- if !BIRTHSIGNS_SET_2
- # Names for Set 1
- JAN_BIRTHSIGN = _INTL("'El Aprendiz'")
- FEB_BIRTHSIGN = _INTL("'El Acompañante'")
- MAR_BIRTHSIGN = _INTL("'El Iluminado'")
- APR_BIRTHSIGN = _INTL("'El Salvaje'")
- MAY_BIRTHSIGN = _INTL("'El Prodigio'")
- JUN_BIRTHSIGN = _INTL("'El Martir'")
- JUL_BIRTHSIGN = _INTL("'El Sirviente'")
- AUG_BIRTHSIGN = _INTL("'El Gladiador'")
- SEP_BIRTHSIGN = _INTL("'El Viajero'")
- OCT_BIRTHSIGN = _INTL("'El Ladrón'")
- NOV_BIRTHSIGN = _INTL("'El Gloton'")
- DEC_BIRTHSIGN = _INTL("'El Genio'")
- else
- # Names for Set 2
- JAN_BIRTHSIGN = _INTL("'The Phoenix'")
- FEB_BIRTHSIGN = _INTL("'The Scholar'")
- MAR_BIRTHSIGN = _INTL("'The Fugitive'")
- APR_BIRTHSIGN = _INTL("'The Aristocrat'")
- MAY_BIRTHSIGN = _INTL("'The Cleric'")
- JUN_BIRTHSIGN = _INTL("'The Monk'")
- JUL_BIRTHSIGN = _INTL("'The Ancestor'")
- AUG_BIRTHSIGN = _INTL("'The Specialist'")
- SEP_BIRTHSIGN = _INTL("'The Assassin'")
- OCT_BIRTHSIGN = _INTL("'The Parent'")
- NOV_BIRTHSIGN = _INTL("'The Hunter'")
- DEC_BIRTHSIGN = _INTL("'The Eternal'")
- end
- #===============================================================================
- # New Zodiac
- #===============================================================================
- # Overwrites the default zodiac in PField_Time.
- #===============================================================================
- def zodiac(month,day)
- time=[
- 1,1,1,31, # The Apprentice || The Phoenix
- 2,1,2,28, # The Companion || The Scholar
- 3,1,3,31, # The Beacon || The Fugitive
- 4,1,4,30, # The Savage || The Aristocrat
- 5,1,5,31, # The Prodigy || The Cleric
- 6,1,6,30, # The Martyr || The Monk
- 7,1,7,31, # The Maiden || The Ancestor
- 8,1,8,31, # The Gladiator || The Specialist
- 9,1,9,30, # The Voyager || The Assassin
- 10,1,10,31, # The Thief || The Parent
- 11,1,11,30, # The Glutton || The Hunter
- 12,1,12,31 # The Wishmaker || The Eternal
- ]
- for i in 0...12
- return i if month==time[i*4] && day>=time[i*4+1]
- return i if month==time[i*4+2] && day<=time[i*4+2]
- end
- return 0
- end
- def zodiacValue(sign)
- return (sign)%13
- end
- #===============================================================================
- # Birthsigns Zodiac - Names
- #===============================================================================
- # Calls the birthsign names set for hatched Pokemon. These names may be
- # altered near the top of this script.
- # #TAG2
- #===============================================================================
- def pbGetZodiacName(sign)
- return [_INTL(""), # Null
- JAN_BIRTHSIGN, # The Apprentice || The Phoenix
- FEB_BIRTHSIGN, # The Companion || The Scholar
- MAR_BIRTHSIGN, # The Beacon || The Fugitive
- APR_BIRTHSIGN, # The Savage || The Aristocrat
- MAY_BIRTHSIGN, # The Prodigy || The Cleric
- JUN_BIRTHSIGN, # The Martyr || The Monk
- JUL_BIRTHSIGN, # The Maiden || The Ancestor
- AUG_BIRTHSIGN, # The Gladiator || The Specialist
- SEP_BIRTHSIGN, # The Voyager || The Assassin
- OCT_BIRTHSIGN, # The Thief || The Parent
- NOV_BIRTHSIGN, # The Glutton || The Hunter
- DEC_BIRTHSIGN][sign] # The Wishmaker || The Eternal
- end
- #===============================================================================
- # Birthsigns Zodiac - Descriptions
- # #TAG5
- #===============================================================================
- def pbGetZodiacDesc(sign)
- if !BIRTHSIGNS_SET_2
- # Set 1
- return [_INTL(""),
- _INTL("The Pokémon starts off immunized to Pokérus."),
- _INTL("The Pokémon has the highest affection for its trainer."),
- _INTL("The Pokémon may use Flash without the move."),
- _INTL("The Pokémon has max IV's in offense & speed, but 0 HP."),
- _INTL("The Pokémon always has its Hidden Ability, if available."),
- _INTL("The Pokémon may use Soft-Boiled without the move."),
- _INTL("The Pokémon will always be female, if possible."),
- _INTL("The Pokémon starts off with 100 EV's in Atk & Sp.Atk."),
- _INTL("The Pokémon may use Teleport without the move."),
- _INTL("The Pokémon starts off with maximum EV's in speed."),
- _INTL("The Pokémon has max IV's in defenses & HP, but 0 speed."),
- _INTL("The Pokémon is always shiny.")][sign]
- else
- # Set 2
- return [_INTL(""),
- _INTL("The Pokémon may revive itself from the party menu."),
- _INTL("The Pokémon gains 20% more exp. points from battles."),
- _INTL("The Pokémon may escape dungeons from the menu."),
- _INTL("The Pokémon doubles prize money won when leading."),
- _INTL("The Pokémon may cure its status from the party menu."),
- _INTL("The Pokémon may relearn past moves when in a trance."),
- _INTL("The Pokémon yields eggs that hatch twice as fast."),
- _INTL("The Pokémon may re-roll for a new Hidden Power."),
- _INTL("The Pokémon may sneak up on sleeping wild Pokémon."),
- _INTL("The Pokémon may incubate eggs to hatch them sooner."),
- _INTL("The Pokémon raises capture rates by 20% when leading."),
- _INTL("The Pokémon may begin anew by reincarnating itself.")][sign]
- end
- end
- #===============================================================================
- # Manual Birthsigns - Values
- #===============================================================================
- # The list of birthsigns that may be applied through scripts/events.
- # #TAG4
- #===============================================================================
- module PBBirthsigns
- NONE = 0 # Null
- JAN = 1 # The Apprentice || The Phoenix
- FEB = 2 # The Companion || The Scholar
- MAR = 3 # The Beacon || The Fugitive
- APR = 4 # The Savage || The Aristocrat
- MAY = 5 # The Prodigy || The Cleric
- JUN = 6 # The Martyr || The Monk
- JUL = 7 # The Maiden || The Ancestor
- AUG = 8 # The Gladiator || The Specialist
- SEP = 9 # The Voyager || The Assassin
- OCT = 10 # The Thief || The Parent
- NOV = 11 # The Glutton || The Hunter
- DEC = 12 # The Wishmaker || The Eternal
- end
- def PBBirthsigns.maxValue; 13; end
- def PBBirthsigns.getCount; 13; end
- def PBBirthsigns.signValue(id)
- return (id)%13
- end
- #===============================================================================
- # Manual Birthsigns - Names
- #===============================================================================
- # Calls the birthsign names for the debug menu and when applied manually on
- # a Pokemon. These names may be altered near the top of this script.
- # #TAG3
- #===============================================================================
- def PBBirthsigns.getName(id)
- names=[
- _INTL("No sign"), # Null
- JAN_BIRTHSIGN, # The Apprentice || The Phoenix
- FEB_BIRTHSIGN, # The Companion || The Scholar
- MAR_BIRTHSIGN, # The Beacon || The Fugitive
- APR_BIRTHSIGN, # The Savage || The Aristocrat
- MAY_BIRTHSIGN, # The Prodigy || The Cleric
- JUN_BIRTHSIGN, # The Martyr || The Monk
- JUL_BIRTHSIGN, # The Maiden || The Ancestor
- AUG_BIRTHSIGN, # The Gladiator || The Specialist
- SEP_BIRTHSIGN, # The Voyager || The Assassin
- OCT_BIRTHSIGN, # The Thief || The Parent
- NOV_BIRTHSIGN, # The Glutton || The Hunter
- DEC_BIRTHSIGN # The Wishmaker || The Eternal
- ]
- return names[id]
- end
- #########[SECTION 2]##########
- #===============================================================================
- # Birthsign Checks
- #===============================================================================
- # Returns true if a certain birthsign is active on the user.
- # #TAG6
- #===============================================================================
- # January
- def hasJanBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==1
- return true
- end
- end
- end
- # February
- def hasFebBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==2
- return true
- end
- end
- end
- # March
- def hasMarBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==3
- return true
- end
- end
- end
- # April
- def hasAprBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==4
- return true
- end
- end
- end
- # May
- def hasMayBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==5
- return true
- end
- end
- end
- # June
- def hasJunBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==6
- return true
- end
- end
- end
- # July
- def hasJulBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==7
- return true
- end
- end
- end
- # August
- def hasAugBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==8
- return true
- end
- end
- end
- # September
- def hasSepBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==9
- return true
- end
- end
- end
- # October
- def hasOctBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==10
- return true
- end
- end
- end
- # November
- def hasNovBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==11
- return true
- end
- end
- end
- # December
- def hasDecBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign==12
- return true
- end
- end
- end
- # Has ANY Birthsign
- def hasBirthsign?
- if !isEgg? && !(self.isShadow? rescue false)
- if birthsign>0
- return true
- end
- end
- end
- # Null
- def hasNoSign?
- if isEgg? || (self.isShadow? rescue false)
- return true
- elsif obtainMode!=1 && (zodiacflag==0 || zodiacflag==nil)
- return true
- end
- end
- #===============================================================================
- # Current Sign Check
- #===============================================================================
- # Returns true if the user has the current month's sign.
- #===============================================================================
- def hasCurrentSign?
- if Time.now.mon==1 && hasJanBirthsign?
- return true
- elsif Time.now.mon==2 && hasFebBirthsign?
- return true
- elsif Time.now.mon==3 && hasMarBirthsign?
- return true
- elsif Time.now.mon==4 && hasAprBirthsign?
- return true
- elsif Time.now.mon==5 && hasMayBirthsign?
- return true
- elsif Time.now.mon==6 && hasJunBirthsign?
- return true
- elsif Time.now.mon==7 && hasJulBirthsign?
- return true
- elsif Time.now.mon==8 && hasAugBirthsign?
- return true
- elsif Time.now.mon==9 && hasSepBirthsign?
- return true
- elsif Time.now.mon==10 && hasOctBirthsign?
- return true
- elsif Time.now.mon==11 && hasNovBirthsign?
- return true
- elsif Time.now.mon==12 && hasDecBirthsign?
- return true
- end
- end
- #===============================================================================
- # Birthday Check
- #===============================================================================
- # Returns true if the current day is the user's birthday.
- # Only applies to hatched Pokemon.
- #===============================================================================
- def isBirthday?
- # Determines the current date
- thisyear=Time.now.year
- month=Time.now.mon
- date=Time.now.day
- today=(month && date)
- # Determines date of birth
- birthyear=timeEggHatched.year
- birthmonth=timeEggHatched.mon
- birthdate=timeEggHatched.day
- birthday=(birthmonth && birthdate)
- # Determines if there is a match
- if obtainMode==1
- if (birthday==today) && (birthyear<thisyear)
- return true
- end
- end
- end
- #===============================================================================
- # Birthsigns - Name & Descriptions
- #===============================================================================
- # Returns the name or description of a user's birthsign, regardless of
- # whether they were hatched or manually given one.
- #===============================================================================
- def pbGetBirthsignName
- if self.obtainMode==1
- pbGetZodiacName(self.birthsign)
- else
- PBBirthsigns.getName(self.birthsign)
- end
- end
- def pbGetBirthsignDesc
- pbGetZodiacDesc(self.birthsign)
- end
- #===============================================================================
- # Birthsign Command Checks
- #===============================================================================
- # Returns true if the user has a particular command through a birthsign.
- # Used to eliminate redundant commands.
- #===============================================================================
- # The Beacon
- def hasFlashCmd?
- if !BIRTHSIGNS_SET_2
- if hasMarBirthsign?
- return true
- end
- end
- end
- # The Martyr
- def hasSoftboiledCmd?
- if !BIRTHSIGNS_SET_2
- if hasJunBirthsign?
- return true
- end
- end
- end
- # The Voyager
- def hasTeleportCmd?
- if !BIRTHSIGNS_SET_2
- if hasSepBirthsign?
- return true
- end
- end
- end
- # The Fugitive
- def hasEscapeCmd?
- if BIRTHSIGNS_SET_2
- if hasMarBirthsign?
- return true
- end
- end
- end
- #===============================================================================
- # Last Month Day
- #===============================================================================
- # Returns the final day of the month of the user's sign. (28th, 30th, 31st)
- # Used to display date ranges on the Birthsigns page.
- #===============================================================================
- def is30DayMon?
- if hasAprBirthsign? ||
- hasJunBirthsign? ||
- hasSepBirthsign? ||
- hasNovBirthsign?
- return true
- end
- end
- def pbLastMonthDay
- if hasNoSign?
- return _INTL("???")
- elsif hasFebBirthsign?
- return _INTL("28th")
- elsif is30DayMon?
- return _INTL("30th")
- else
- return _INTL("31st")
- end
- end
- #===============================================================================
- # Birthsign Bonuses - Passive Effects
- #===============================================================================
- # Applies passive birthsign bonuses.
- # #TAG7
- #===============================================================================
- def applyBirthsignBonuses
- if !isEgg?
- if !BIRTHSIGNS_SET_2
- #=========================================================================
- # Birthsign effects for Set 1
- #=========================================================================
- # The Apprentice
- if hasJanBirthsign?
- @pokerus=16
- end
- # The Companion
- if hasFebBirthsign?
- @happiness=255
- end
- # The Savage
- if hasAprBirthsign?
- @iv[0]=0
- @iv[1]=31
- @iv[3]=31
- @iv[4]=31
- end
- # The Prodigy
- if hasMayBirthsign?
- @abilityflag=2
- end
- # The Maiden
- if hasJulBirthsign?
- @genderflag=1
- end
- # The Gladiator
- if hasAugBirthsign?
- @ev=[0,100,0,0,100,0]
- end
- # The Thief
- if hasOctBirthsign?
- @ev=[0,0,0,252,0,0]
- end
- # The Glutton
- if hasNovBirthsign?
- @iv[0]=31
- @iv[2]=31
- @iv[3]=0
- @iv[5]=31
- end
- # The Wishmaker
- if hasDecBirthsign?
- @shinyflag=true
- end
- else
- #=========================================================================
- # Birthsign effects for Set 2.
- #=========================================================================
- # (add here if customizing)
- end
- # Resets flags if null sign is applied.
- if hasNoSign?
- @shinyflag=nil
- @abilityflag=nil
- @genderflag=nil
- @zodiacflag=0
- end
- end
- end
- #########[SECTION 3]##########
- #===============================================================================
- # Defining Birthsigns
- #===============================================================================
- # The core codes that the rest of the Birthsigns script is built on.
- # Overwrite sections in PokeBattle_Pokemon.
- # #TAG10
- #===============================================================================
- class PokeBattle_Pokemon
- attr_accessor(:zodiacflag)
- # Defines birthsigns
- def birthsign
- if obtainMode==1
- return zodiacValue(timeEggHatched.mon)
- else
- return @zodiacflag if @zodiacflag!=nil
- end
- return @personalID%13
- end
- # Manually sets a Pokémon's birthsign through a script or event.
- def setBirthsign(value)
- if value.is_a?(String) || value.is_a?(Symbol)
- if isEgg?
- Kernel.pbMessage(_INTL("Eggs must be hatched first to inherit a birthsign!"))
- value=nil
- elsif (self.isShadow? rescue false)
- Kernel.pbMessage(_INTL("Shadow Pokémon can't have birthsigns!"))
- value=nil
- elsif obtainMode==1 || hasRibbon?(:SECONDSTEP)
- Kernel.pbMessage(_INTL("That Pokémon can't inherit a new birthsign!"))
- value=nil
- else
- value=getID(PBBirthsigns,value)
- end
- end
- @zodiacflag=value
- applyBirthsignBonuses
- self.calcStats
- 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.
- #===============================================================================
- # zodiacflag- Sets birthsign to "no sign" by default.
- #===============================================================================
- 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
- @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
- @trainerID=player.id
- @ot=player.name
- @otgender=player.gender
- @language=player.language
- else
- @trainerID=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
- #===========================================================================
- # Sets flag to 0 on newly generated Pokemon, ensuring that random
- # birthsign effects are not applied when no birthsign is present.
- #===========================================================================
- self.zodiacflag=0
- #===========================================================================
- 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
- #########[SECTION 4]##########
- #===============================================================================
- # Party Screen - Debug Menu
- #===============================================================================
- # Updates the debug menu to allow Birthsigns to be applied manually.
- # This section overwrites the debug menu found in PScreen_Party.
- # #TAG11
- #===============================================================================
- class PokemonScreen
- def pbPokemonDebug(pkmn,pkmnid)
- command=0
- loop do
- command=@scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),[
- _INTL("HP/Status"),
- _INTL("Level"),
- _INTL("Species"),
- _INTL("Moves"),
- _INTL("Gender"),
- _INTL("Ability"),
- _INTL("Nature"),
- _INTL("Horoscopo"),
- _INTL("Shininess"),
- _INTL("Form"),
- _INTL("Happiness"),
- _INTL("EV/IV/pID"),
- _INTL("Pokérus"),
- _INTL("Ownership"),
- _INTL("Nickname"),
- _INTL("Poké Ball"),
- _INTL("Ribbons"),
- _INTL("Egg"),
- _INTL("Shadow Pokémon"),
- _INTL("Make Mystery Gift"),
- _INTL("Duplicate"),
- _INTL("Delete"),
- _INTL("Cancel")
- ],command)
- case command
- ### Cancel ###
- when -1, 22
- break
- ### HP/Status ###
- when 0
- cmd=0
- loop do
- cmd=@scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),[
- _INTL("Set HP"),
- _INTL("Status: Sleep"),
- _INTL("Status: Poison"),
- _INTL("Status: Burn"),
- _INTL("Status: Paralysis"),
- _INTL("Status: Frozen"),
- _INTL("Fainted"),
- _INTL("Heal")
- ],cmd)
- # Break
- if cmd==-1
- break
- # Set HP
- elsif cmd==0
- params=ChooseNumberParams.new
- params.setRange(0,pkmn.totalhp)
- params.setDefaultValue(pkmn.hp)
- newhp=Kernel.pbMessageChooseNumber(
- _INTL("Set the Pokémon's HP (max. {1}).",pkmn.totalhp),params) { @scene.update }
- if newhp!=pkmn.hp
- pkmn.hp=newhp
- pbDisplay(_INTL("{1}'s HP was set to {2}.",pkmn.name,pkmn.hp))
- pbRefreshSingle(pkmnid)
- end
- # Set status
- elsif cmd>=1 && cmd<=5
- if pkmn.hp>0
- pkmn.status=cmd
- pkmn.statusCount=0
- if pkmn.status==PBStatuses::SLEEP
- params=ChooseNumberParams.new
- params.setRange(0,9)
- params.setDefaultValue(0)
- sleep=Kernel.pbMessageChooseNumber(
- _INTL("Set the Pokémon's sleep count."),params) { @scene.update }
- pkmn.statusCount=sleep
- end
- pbDisplay(_INTL("{1}'s status was changed.",pkmn.name))
- pbRefreshSingle(pkmnid)
- else
- pbDisplay(_INTL("{1}'s status could not be changed.",pkmn.name))
- end
- # Faint
- elsif cmd==6
- pkmn.hp=0
- pbDisplay(_INTL("{1}'s HP was set to 0.",pkmn.name))
- pbRefreshSingle(pkmnid)
- # Heal
- elsif cmd==7
- pkmn.heal
- pbDisplay(_INTL("{1} was fully healed.",pkmn.name))
- pbRefreshSingle(pkmnid)
- end
- end
- ### Level ###
- when 1
- params=ChooseNumberParams.new
- params.setRange(1,PBExperience::MAXLEVEL)
- params.setDefaultValue(pkmn.level)
- level=Kernel.pbMessageChooseNumber(
- _INTL("Set the Pokémon's level (max. {1}).",PBExperience::MAXLEVEL),params) { @scene.update }
- if level!=pkmn.level
- pkmn.level=level
- pkmn.calcStats
- pbDisplay(_INTL("{1}'s level was set to {2}.",pkmn.name,pkmn.level))
- pbRefreshSingle(pkmnid)
- end
- ### Species ###
- when 2
- species=pbChooseSpecies(pkmn.species)
- if species!=0
- oldspeciesname=PBSpecies.getName(pkmn.species)
- pkmn.species=species
- pkmn.calcStats
- oldname=pkmn.name
- pkmn.name=PBSpecies.getName(pkmn.species) if pkmn.name==oldspeciesname
- pbDisplay(_INTL("{1}'s species was changed to {2}.",oldname,PBSpecies.getName(pkmn.species)))
- pbSeenForm(pkmn)
- pbRefreshSingle(pkmnid)
- end
- ### Moves ###
- when 3
- cmd=0
- loop do
- cmd=@scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),[
- _INTL("Teach move"),
- _INTL("Forget move"),
- _INTL("Reset movelist"),
- _INTL("Reset initial moves")],cmd)
- # Break
- if cmd==-1
- break
- # Teach move
- elsif cmd==0
- move=pbChooseMoveList
- if move!=0
- pbLearnMove(pkmn,move)
- pbRefreshSingle(pkmnid)
- end
- # Forget move
- elsif cmd==1
- move=pbChooseMove(pkmn,_INTL("Choose move to forget."))
- if move>=0
- movename=PBMoves.getName(pkmn.moves[move].id)
- pbDeleteMove(pkmn,move)
- pbDisplay(_INTL("{1} forgot {2}.",pkmn.name,movename))
- pbRefreshSingle(pkmnid)
- end
- # Reset movelist
- elsif cmd==2
- pkmn.resetMoves
- pbDisplay(_INTL("{1}'s moves were reset.",pkmn.name))
- pbRefreshSingle(pkmnid)
- # Reset initial moves
- elsif cmd==3
- pkmn.pbRecordFirstMoves
- pbDisplay(_INTL("{1}'s moves were set as its first-known moves.",pkmn.name))
- pbRefreshSingle(pkmnid)
- end
- end
- ### Gender ###
- when 4
- if pkmn.gender==2
- pbDisplay(_INTL("{1} is genderless.",pkmn.name))
- else
- cmd=0
- loop do
- oldgender=(pkmn.isMale?) ? _INTL("male") : _INTL("female")
- msg=[_INTL("Gender {1} is natural.",oldgender),
- _INTL("Gender {1} is being forced.",oldgender)][pkmn.genderflag ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Make male"),
- _INTL("Make female"),
- _INTL("Remove override")],cmd)
- # Break
- if cmd==-1
- break
- # Make male
- elsif cmd==0
- pkmn.setGender(0)
- if pkmn.isMale?
- pbDisplay(_INTL("{1} is now male.",pkmn.name))
- else
- pbDisplay(_INTL("{1}'s gender couldn't be changed.",pkmn.name))
- end
- # Make female
- elsif cmd==1
- pkmn.setGender(1)
- if pkmn.isFemale?
- pbDisplay(_INTL("{1} is now female.",pkmn.name))
- else
- pbDisplay(_INTL("{1}'s gender couldn't be changed.",pkmn.name))
- end
- # Remove override
- elsif cmd==2
- pkmn.genderflag=nil
- pbDisplay(_INTL("Gender override removed."))
- end
- pbSeenForm(pkmn)
- pbRefreshSingle(pkmnid)
- end
- end
- ### Ability ###
- when 5
- cmd=0
- loop do
- abils=pkmn.getAbilityList
- oldabil=PBAbilities.getName(pkmn.ability)
- commands=[]
- for i in abils
- commands.push((i[1]<2 ? "" : "(H) ")+PBAbilities.getName(i[0]))
- end
- commands.push(_INTL("Remove override"))
- msg=[_INTL("Ability {1} is natural.",oldabil),
- _INTL("Ability {1} is being forced.",oldabil)][pkmn.abilityflag!=nil ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,commands,cmd)
- # Break
- if cmd==-1
- break
- # Set ability override
- elsif cmd>=0 && cmd<abils.length
- pkmn.setAbility(abils[cmd][1])
- # Remove override
- elsif cmd==abils.length
- pkmn.abilityflag=nil
- end
- pbRefreshSingle(pkmnid)
- end
- ### Nature ###
- when 6
- cmd=0
- loop do
- oldnature=PBNatures.getName(pkmn.nature)
- commands=[]
- (PBNatures.getCount).times do |i|
- commands.push(PBNatures.getName(i))
- end
- commands.push(_INTL("Remove override"))
- msg=[_INTL("Nature {1} is natural.",oldnature),
- _INTL("Nature {1} is being forced.",oldnature)][pkmn.natureflag ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,commands,cmd)
- # Break
- if cmd==-1
- break
- # Set nature override
- elsif cmd>=0 && cmd<PBNatures.getCount
- pkmn.setNature(cmd)
- pkmn.calcStats
- # Remove override
- elsif cmd==PBNatures.getCount
- pkmn.natureflag=nil
- end
- pbRefreshSingle(pkmnid)
- end
- ### Birthsign ###
- when 7
- cmd=0
- if pkmn.isEgg?
- pbDisplay(_INTL("Eggs must be hatched first to inherit a birthsign!"))
- break
- elsif (pkmn.isShadow? rescue false)
- pbDisplay(_INTL("Shadow Pokémon can't have a birthsign!"))
- break
- elsif pkmn.obtainMode==1 || pkmn.hasRibbon?(:SECONDSTEP)
- pbDisplay(_INTL("That Pokémon can't change its birthsign."))
- break
- end
- loop do
- oldsign=PBBirthsigns.getName(pkmn.birthsign)
- commands=[]
- (PBBirthsigns.getCount).times do |i|
- commands.push(PBBirthsigns.getName(i))
- end
- msg=[_INTL("Change birthsigns."),
- _INTL("{1} is active.",oldsign)][pkmn.zodiacflag ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,commands,cmd)
- # Break
- if cmd==-1
- break
- # Set birthsign override
- elsif cmd>=0 && cmd<PBBirthsigns.getCount
- pkmn.setBirthsign(cmd)
- pkmn.calcStats
- # Remove override
- elsif cmd==PBBirthsigns.getCount
- pkmn.zodiacflag=0
- end
- pbRefreshSingle(pkmnid)
- end
- ### Shininess ###
- when 8
- cmd=0
- loop do
- oldshiny=(pkmn.isShiny?) ? _INTL("shiny") : _INTL("normal")
- msg=[_INTL("Shininess ({1}) is natural.",oldshiny),
- _INTL("Shininess ({1}) is being forced.",oldshiny)][pkmn.shinyflag!=nil ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Make shiny"),
- _INTL("Make normal"),
- _INTL("Remove override")],cmd)
- # Break
- if cmd==-1
- break
- # Make shiny
- elsif cmd==0
- pkmn.makeShiny
- # Make normal
- elsif cmd==1
- pkmn.makeNotShiny
- # Remove override
- elsif cmd==2
- pkmn.shinyflag=nil
- end
- pbRefreshSingle(pkmnid)
- end
- ### Form ###
- when 9
- params=ChooseNumberParams.new
- params.setRange(0,100)
- params.setDefaultValue(pkmn.form)
- f=Kernel.pbMessageChooseNumber(
- _INTL("Set the Pokémon's form."),params) { @scene.update }
- if f!=pkmn.form
- pkmn.form=f
- pbDisplay(_INTL("{1}'s form was set to {2}.",pkmn.name,pkmn.form))
- pbSeenForm(pkmn)
- pbRefreshSingle(pkmnid)
- end
- ### Happiness ###
- when 10
- params=ChooseNumberParams.new
- params.setRange(0,255)
- params.setDefaultValue(pkmn.happiness)
- h=Kernel.pbMessageChooseNumber(
- _INTL("Set the Pokémon's happiness (max. 255)."),params) { @scene.update }
- if h!=pkmn.happiness
- pkmn.happiness=h
- pbDisplay(_INTL("{1}'s happiness was set to {2}.",pkmn.name,pkmn.happiness))
- pbRefreshSingle(pkmnid)
- end
- ### EV/IV/pID ###
- when 11
- stats=[_INTL("HP"),_INTL("Attack"),_INTL("Defense"),
- _INTL("Speed"),_INTL("Sp. Attack"),_INTL("Sp. Defense")]
- cmd=0
- loop do
- persid=sprintf("0x%08X",pkmn.personalID)
- cmd=@scene.pbShowCommands(_INTL("Personal ID is {1}.",persid),[
- _INTL("Set EVs"),
- _INTL("Set IVs"),
- _INTL("Randomise pID")],cmd)
- case cmd
- # Break
- when -1
- break
- # Set EVs
- when 0
- cmd2=0
- loop do
- evcommands=[]
- for i in 0...stats.length
- evcommands.push(stats[i]+" (#{pkmn.ev[i]})")
- end
- cmd2=@scene.pbShowCommands(_INTL("Change which EV?"),evcommands,cmd2)
- if cmd2==-1
- break
- elsif cmd2>=0 && cmd2<stats.length
- params=ChooseNumberParams.new
- params.setRange(0,255)
- params.setDefaultValue(pkmn.ev[cmd2])
- params.setCancelValue(pkmn.ev[cmd2])
- f=Kernel.pbMessageChooseNumber(
- _INTL("Set the EV for {1} (max. 255).",stats[cmd2]),params) { @scene.update }
- pkmn.ev[cmd2]=f
- pkmn.totalhp
- pkmn.calcStats
- pbRefreshSingle(pkmnid)
- end
- end
- # Set IVs
- when 1
- cmd2=0
- loop do
- hiddenpower=pbHiddenPower(pkmn.iv)
- msg=_INTL("Hidden Power:\n{1}, power {2}.",PBTypes.getName(hiddenpower[0]),hiddenpower[1])
- ivcommands=[]
- for i in 0...stats.length
- ivcommands.push(stats[i]+" (#{pkmn.iv[i]})")
- end
- ivcommands.push(_INTL("Randomise all"))
- cmd2=@scene.pbShowCommands(msg,ivcommands,cmd2)
- if cmd2==-1
- break
- elsif cmd2>=0 && cmd2<stats.length
- params=ChooseNumberParams.new
- params.setRange(0,31)
- params.setDefaultValue(pkmn.iv[cmd2])
- params.setCancelValue(pkmn.iv[cmd2])
- f=Kernel.pbMessageChooseNumber(
- _INTL("Set the IV for {1} (max. 31).",stats[cmd2]),params) { @scene.update }
- pkmn.iv[cmd2]=f
- pkmn.calcStats
- pbRefreshSingle(pkmnid)
- elsif cmd2==ivcommands.length-1
- pkmn.iv[0]=rand(32)
- pkmn.iv[1]=rand(32)
- pkmn.iv[2]=rand(32)
- pkmn.iv[3]=rand(32)
- pkmn.iv[4]=rand(32)
- pkmn.iv[5]=rand(32)
- pkmn.calcStats
- pbRefreshSingle(pkmnid)
- end
- end
- # Randomise pID
- when 2
- pkmn.personalID=rand(256)
- pkmn.personalID|=rand(256)<<8
- pkmn.personalID|=rand(256)<<16
- pkmn.personalID|=rand(256)<<24
- pkmn.calcStats
- pbRefreshSingle(pkmnid)
- end
- end
- ### Pokérus ###
- when 12
- cmd=0
- loop do
- pokerus=(pkmn.pokerus) ? pkmn.pokerus : 0
- msg=[_INTL("{1} doesn't have Pokérus.",pkmn.name),
- _INTL("Has strain {1}, infectious for {2} more days.",pokerus/16,pokerus%16),
- _INTL("Has strain {1}, not infectious.",pokerus/16)][pkmn.pokerusStage]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Give random strain"),
- _INTL("Make not infectious"),
- _INTL("Clear Pokérus")],cmd)
- # Break
- if cmd==-1
- break
- # Give random strain
- elsif cmd==0
- pkmn.givePokerus
- # Make not infectious
- elsif cmd==1
- strain=pokerus/16
- p=strain<<4
- pkmn.pokerus=p
- # Clear Pokérus
- elsif cmd==2
- pkmn.pokerus=0
- end
- end
- ### Ownership ###
- when 13
- cmd=0
- loop do
- gender=[_INTL("Male"),_INTL("Female"),_INTL("Unknown")][pkmn.otgender]
- msg=[_INTL("Player's Pokémon\n{1}\n{2}\n{3} ({4})",pkmn.ot,gender,pkmn.publicID,pkmn.trainerID),
- _INTL("Foreign Pokémon\n{1}\n{2}\n{3} ({4})",pkmn.ot,gender,pkmn.publicID,pkmn.trainerID)
- ][pkmn.isForeign?($Trainer) ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Make player's"),
- _INTL("Set OT's name"),
- _INTL("Set OT's gender"),
- _INTL("Random foreign ID"),
- _INTL("Set foreign ID")],cmd)
- # Break
- if cmd==-1
- break
- # Make player's
- elsif cmd==0
- pkmn.trainerID=$Trainer.id
- pkmn.ot=$Trainer.name
- pkmn.otgender=$Trainer.gender
- # Set OT's name
- elsif cmd==1
- newot=pbEnterPlayerName(_INTL("{1}'s OT's name?",pkmn.name),1,7)
- pkmn.ot=newot
- # Set OT's gender
- elsif cmd==2
- cmd2=@scene.pbShowCommands(_INTL("Set OT's gender."),
- [_INTL("Male"),_INTL("Female"),_INTL("Unknown")])
- pkmn.otgender=cmd2 if cmd2>=0
- # Random foreign ID
- elsif cmd==3
- pkmn.trainerID=$Trainer.getForeignID
- # Set foreign ID
- elsif cmd==4
- params=ChooseNumberParams.new
- params.setRange(0,65535)
- params.setDefaultValue(pkmn.publicID)
- val=Kernel.pbMessageChooseNumber(
- _INTL("Set the new ID (max. 65535)."),params) { @scene.update }
- pkmn.trainerID=val
- pkmn.trainerID|=val<<16
- end
- end
- ### Nickname ###
- when 14
- cmd=0
- loop do
- speciesname=PBSpecies.getName(pkmn.species)
- msg=[_INTL("{1} has the nickname {2}.",speciesname,pkmn.name),
- _INTL("{1} has no nickname.",speciesname)][pkmn.name==speciesname ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Rename"),
- _INTL("Erase name")],cmd)
- # Break
- if cmd==-1
- break
- # Rename
- elsif cmd==0
- newname=pbEnterPokemonName(_INTL("{1}'s nickname?",speciesname),0,10,"",pkmn)
- pkmn.name=(newname=="") ? speciesname : newname
- pbRefreshSingle(pkmnid)
- # Erase name
- elsif cmd==1
- pkmn.name=speciesname
- end
- end
- ### Poké Ball ###
- when 15
- cmd=0
- loop do
- oldball=PBItems.getName(pbBallTypeToBall(pkmn.ballused))
- commands=[]; balls=[]
- for key in $BallTypes.keys
- item=getID(PBItems,$BallTypes[key])
- balls.push([key,PBItems.getName(item)]) if item && item>0
- end
- balls.sort! {|a,b| a[1]<=>b[1]}
- for i in 0...commands.length
- cmd=i if pkmn.ballused==balls[i][0]
- end
- for i in balls
- commands.push(i[1])
- end
- cmd=@scene.pbShowCommands(_INTL("{1} used.",oldball),commands,cmd)
- if cmd==-1
- break
- else
- pkmn.ballused=balls[cmd][0]
- end
- end
- ### Ribbons ###
- when 16
- cmd=0
- loop do
- commands=[]
- for i in 1..PBRibbons.maxValue
- commands.push(_INTL("{1} {2}",
- pkmn.hasRibbon?(i) ? "[X]" : "[ ]",PBRibbons.getName(i)))
- end
- cmd=@scene.pbShowCommands(_INTL("{1} ribbons.",pkmn.ribbonCount),commands,cmd)
- if cmd==-1
- break
- elsif cmd>=0 && cmd<commands.length
- if pkmn.hasRibbon?(cmd+1)
- pkmn.takeRibbon(cmd+1)
- else
- pkmn.giveRibbon(cmd+1)
- end
- end
- end
- ### Egg ###
- when 17
- cmd=0
- loop do
- msg=[_INTL("Not an egg"),
- _INTL("Egg with eggsteps: {1}.",pkmn.eggsteps)][pkmn.isEgg? ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Make egg"),
- _INTL("Make Pokémon"),
- _INTL("Set eggsteps to 1")],cmd)
- # Break
- if cmd==-1
- break
- # Make egg
- elsif cmd==0
- if pbHasEgg?(pkmn.species) ||
- pbConfirm(_INTL("{1} cannot be an egg. Make egg anyway?",PBSpecies.getName(pkmn.species)))
- pkmn.level=EGGINITIALLEVEL
- pkmn.zodiacflag==0
- pkmn.calcStats
- pkmn.name=_INTL("Egg")
- dexdata=pbOpenDexData
- pbDexDataOffset(dexdata,pkmn.species,21)
- pkmn.eggsteps=dexdata.fgetw
- dexdata.close
- pkmn.hatchedMap=0
- pkmn.obtainMode=1
- pbRefreshSingle(pkmnid)
- end
- # Make Pokémon
- elsif cmd==1
- pkmn.name=PBSpecies.getName(pkmn.species)
- pkmn.eggsteps=0
- pkmn.hatchedMap=0
- pkmn.obtainMode=0
- pbRefreshSingle(pkmnid)
- # Set eggsteps to 1
- elsif cmd==2
- pkmn.eggsteps=1 if pkmn.eggsteps>0
- end
- end
- ### Shadow Pokémon ###
- when 18
- cmd=0
- loop do
- msg=[_INTL("Not a Shadow Pokémon."),
- _INTL("Heart gauge is {1}.",pkmn.heartgauge)][(pkmn.isShadow? rescue false) ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Make Shadow"),
- _INTL("Lower heart gauge")],cmd)
- # Break
- if cmd==-1
- break
- # Make Shadow
- elsif cmd==0
- if !(pkmn.isShadow? rescue false) && pkmn.respond_to?("makeShadow")
- if pkmn.obtainMode==1
- pbDisplay(_INTL("Pokémon born with a birthsign can't be made into Shadow Pokémon.",pkmn.name))
- else
- pkmn.setBirthsign(0)
- pkmn.makeShadow
- pbDisplay(_INTL("{1} is now a Shadow Pokémon.",pkmn.name))
- end
- pbRefreshSingle(pkmnid)
- else
- pbDisplay(_INTL("{1} is already a Shadow Pokémon.",pkmn.name))
- end
- # Lower heart gauge
- elsif cmd==1
- if (pkmn.isShadow? rescue false)
- prev=pkmn.heartgauge
- pkmn.adjustHeart(-700)
- Kernel.pbMessage(_INTL("{1}'s heart gauge was lowered from {2} to {3} (now stage {4}).",
- pkmn.name,prev,pkmn.heartgauge,pkmn.heartStage))
- pbReadyToPurify(pkmn)
- else
- Kernel.pbMessage(_INTL("{1} is not a Shadow Pokémon.",pkmn.name))
- end
- end
- end
- ### Make Mystery Gift ###
- when 19
- pbCreateMysteryGift(0,pkmn)
- ### Duplicate ###
- when 20
- if pbConfirm(_INTL("Are you sure you want to copy this Pokémon?"))
- clonedpkmn=pkmn.clone
- clonedpkmn.iv=pkmn.iv.clone
- clonedpkmn.ev=pkmn.ev.clone
- pbStorePokemon(clonedpkmn)
- pbHardRefresh
- pbDisplay(_INTL("The Pokémon was duplicated."))
- break
- end
- ### Delete ###
- when 21
- if pbConfirm(_INTL("Are you sure you want to delete this Pokémon?"))
- @party[pkmnid]=nil
- @party.compact!
- pbHardRefresh
- pbDisplay(_INTL("The Pokémon was deleted."))
- break
- end
- ###
- end
- end
- end
- #===============================================================================
- # Birthsign Commands
- #===============================================================================
- # This section overwrites the section in PScreen_Party that creates command
- # menu options.
- # #TAG9
- #===============================================================================
- def pbPokemonScreen
- @scene.pbStartScene(@party,@party.length>1 ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."),nil)
- loop do
- @scene.pbSetHelpText(@party.length>1 ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
- pkmnid=@scene.pbChoosePokemon
- break if pkmnid<0
- pkmn=@party[pkmnid]
- commands=[]
- cmdSummary=-1
- cmdDebug=-1
- cmdMoves=[-1,-1,-1,-1]
- cmdSwitch=-1
- cmdMail=-1
- cmdItem=-1
- #=========================================================================
- # Birthsigns Set 1
- #=========================================================================
- cmdFlash=-1
- cmdSoftboiled=-1
- cmdTeleport=-1
- #=========================================================================
- # Birthsigns Set 2
- #=========================================================================
- cmdRebirth=-1
- cmdEscape=-1
- cmdCure=-1
- cmdTrance=-1
- cmdIncubate=-1
- cmdReroll=-1
- cmdReincarnate=-1
- #=========================================================================
- # Build the commands
- commands[cmdSummary=commands.length]=_INTL("Summary")
- commands[cmdDebug=commands.length]=_INTL("Debug") if $DEBUG
- for i in 0...pkmn.moves.length
- move=pkmn.moves[i]
- # Check for hidden moves and add any that were found
- if !pkmn.isEgg? &&
- #=====================================================================
- # HM's - Creates commands for HM moves in the party menu.
- #=====================================================================
- (isConst?(move.id,PBMoves,:CUT) ||
- isConst?(move.id,PBMoves,:FLY) ||
- isConst?(move.id,PBMoves,:SURF) ||
- isConst?(move.id,PBMoves,:STRENGTH) ||
- isConst?(move.id,PBMoves,:ROCKSMASH) ||
- isConst?(move.id,PBMoves,:WATERFALL) ||
- isConst?(move.id,PBMoves,:DIVE) ||
- #=====================================================================
- # Other field commands - Creates commands for other field moves.
- #=====================================================================
- isConst?(move.id,PBMoves,:MILKDRINK) ||
- isConst?(move.id,PBMoves,:HEADBUTT) ||
- isConst?(move.id,PBMoves,:SWEETSCENT) ||
- isConst?(move.id,PBMoves,:CHATTER) ||
- #=====================================================================
- # Unsupported commands as of Essentials v16.
- # Remove comment tag from field moves you've added yourself.
- # Any custom field moves must be added to this list.
- #=====================================================================
- #isConst?(move.id,PBMoves,:WHIRLPOOL) ||
- #isConst?(move.id,PBMoves,:ROCKCLIMB) ||
- #isConst?(move.id,PBMoves,:SECRETPOWER) ||
- #isConst?(move.id,PBMoves,:DEFOG) ||
- #=====================================================================
- # Birthsign commands - Hides redundant birthsign commands.
- # Adds field commands otherwise.
- #=====================================================================
- # The Beacon
- (isConst?(move.id,PBMoves,:FLASH) && !pkmn.hasFlashCmd?) ||
- # The Martyr
- (isConst?(move.id,PBMoves,:SOFTBOILED) && !pkmn.hasSoftboiledCmd?) ||
- # The Voyager
- (isConst?(move.id,PBMoves,:TELEPORT) && !pkmn.hasTeleportCmd?) ||
- # The Fugitive
- (isConst?(move.id,PBMoves,:DIG) && !pkmn.hasEscapeCmd?))
- #=====================================================================
- commands[cmdMoves[i]=commands.length]=PBMoves.getName(move.id)
- end
- end
- #=========================================================================
- #Birthsigns Set 1
- #=========================================================================
- # The Beacon
- if !BIRTHSIGNS_SET_2 && pkmn.hasMarBirthsign?
- commands[cmdFlash=commands.length]=_INTL("Flash")
- end
- # The Martyr
- if !BIRTHSIGNS_SET_2 && pkmn.hasJunBirthsign?
- commands[cmdSoftboiled=commands.length]=_INTL("Soft-Boiled")
- end
- # The Voyager
- if !BIRTHSIGNS_SET_2 && pkmn.hasSepBirthsign?
- commands[cmdTeleport=commands.length]=_INTL("Teleport")
- end
- #=========================================================================
- #Birthsigns Set 2
- #=========================================================================
- # The Phoenix
- if BIRTHSIGNS_SET_2 && pkmn.hasJanBirthsign?
- commands[cmdRebirth=commands.length]=_INTL("Rebirth")
- end
- # The Fugitive
- if BIRTHSIGNS_SET_2 && pkmn.hasMarBirthsign?
- commands[cmdEscape=commands.length]=_INTL("Escape")
- end
- # The Cleric
- if BIRTHSIGNS_SET_2 && pkmn.hasMayBirthsign?
- commands[cmdCure=commands.length]=_INTL("Cure")
- end
- # The Monk
- if BIRTHSIGNS_SET_2 && pkmn.hasJunBirthsign?
- commands[cmdTrance=commands.length]=_INTL("Trance")
- end
- # The Specialist
- if BIRTHSIGNS_SET_2 && pkmn.hasAugBirthsign?
- commands[cmdReroll=commands.length]=_INTL("Re-roll")
- end
- # The Parent
- if BIRTHSIGNS_SET_2 && pkmn.hasOctBirthsign?
- commands[cmdIncubate=commands.length]=_INTL("Incubate")
- end
- # The Eternal
- if BIRTHSIGNS_SET_2 && pkmn.hasDecBirthsign?
- # The Reincarnate skill is only displayed if it isn't December.
- if Time.now.mon!=12
- commands[cmdReincarnate=commands.length]=_INTL("Reincarnate")
- end
- end
- #=========================================================================
- commands[cmdSwitch=commands.length]=_INTL("Switch") if @party.length>1
- if !pkmn.isEgg?
- if pkmn.mail
- commands[cmdMail=commands.length]=_INTL("Mail")
- else
- commands[cmdItem=commands.length]=_INTL("Item")
- end
- end
- commands[commands.length]=_INTL("Cancel")
- command=@scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),commands)
- havecommand=false
- for i in 0...4
- if cmdMoves[i]>=0 && command==cmdMoves[i]
- havecommand=true
- if isConst?(pkmn.moves[i].id,PBMoves,:SOFTBOILED) ||
- isConst?(pkmn.moves[i].id,PBMoves,:MILKDRINK)
- if pkmn.hp<=(pkmn.totalhp/5).floor
- pbDisplay(_INTL("Not enough HP..."))
- break
- end
- @scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
- oldpkmnid=pkmnid
- loop do
- @scene.pbPreSelect(oldpkmnid)
- pkmnid=@scene.pbChoosePokemon(true,pkmnid)
- break if pkmnid<0
- newpkmn=@party[pkmnid]
- if pkmnid==oldpkmnid
- pbDisplay(_INTL("{1} can't use {2} on itself!",pkmn.name,PBMoves.getName(pkmn.moves[i].id)))
- elsif newpkmn.isEgg?
- pbDisplay(_INTL("{1} can't be used on an Egg!",PBMoves.getName(pkmn.moves[i].id)))
- elsif newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp
- pbDisplay(_INTL("{1} can't be used on that Pokémon.",PBMoves.getName(pkmn.moves[i].id)))
- else
- pkmn.hp-=(pkmn.totalhp/5).floor
- hpgain=pbItemRestoreHP(newpkmn,(pkmn.totalhp/5).floor)
- @scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",newpkmn.name,hpgain))
- pbRefresh
- end
- break if pkmn.hp<=(pkmn.totalhp/5).floor
- end
- break
- elsif Kernel.pbCanUseHiddenMove?(pkmn,pkmn.moves[i].id)
- @scene.pbEndScene
- if isConst?(pkmn.moves[i].id,PBMoves,:FLY)
- scene=PokemonRegionMapScene.new(-1,false)
- screen=PokemonRegionMap.new(scene)
- ret=screen.pbStartFlyScreen
- if ret
- $PokemonTemp.flydata=ret
- return [pkmn,pkmn.moves[i].id]
- end
- @scene.pbStartScene(@party,
- @party.length>1 ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
- break
- end
- return [pkmn,pkmn.moves[i].id]
- else
- break
- end
- end
- end
- next if havecommand
- if cmdSummary>=0 && command==cmdSummary
- @scene.pbSummary(pkmnid)
- #===============================================================================
- # Birthsigns - The Beacon
- # Flash Skill effect: Mimics the effect of 'Flash'.
- #===============================================================================
- elsif cmdFlash>=0 && command==cmdFlash
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- if !pbGetMetadata($game_map.map_id,MetadataDarkMap)
- Kernel.pbMessage(_INTL("That can't be used here."))
- elsif $PokemonGlobal.flashUsed
- Kernel.pbMessage(_INTL("This is in use already."))
- else
- darkness=$PokemonTemp.darknessSprite
- return false if !darkness || darkness.disposed?
- if !pbHiddenMoveAnimation(pkmn)
- Kernel.pbMessage(_INTL("{1} used Flash!",pkmn.name))
- end
- $PokemonGlobal.flashUsed=true
- Kernel.pbMessage(_INTL("{1} lit up the area by using the power of {2}!",
- pkmn.name,pkmn.pbGetBirthsignName))
- while darkness.radius<176
- Graphics.update
- Input.update
- pbUpdateSceneMap
- darkness.radius+=4
- end
- pbRefresh
- break
- end
- end
- #===============================================================================
- # Birthsigns - The Martyr
- # Soft-Boiled Skill effect: Mimics the effect of 'Soft-Boiled'.
- #===============================================================================
- elsif cmdSoftboiled>=0 && command==cmdSoftboiled
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- if pkmn.hp<=(pkmn.totalhp/5).floor
- Kernel.pbMessage(_INTL("Not enough HP..."))
- break
- end
- @scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
- oldpkmnid=pkmnid
- loop do
- @scene.pbPreSelect(oldpkmnid)
- pkmnid=@scene.pbChoosePokemon(true,pkmnid)
- break if pkmnid<0
- newpkmn=@party[pkmnid]
- if pkmnid==oldpkmnid
- Kernel.pbMessage(_INTL("{1} can't use that power on itself!",pkmn.name))
- elsif newpkmn.isEgg?
- Kernel.pbMessage(_INTL("That power can't be used on an Egg!"))
- elsif newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp
- Kernel.pbMessage(_INTL("That power can't be used on an uninjured Pokémon."))
- else
- pkmn.hp-=(pkmn.totalhp/5).floor
- hpgain=pbItemRestoreHP(newpkmn,(pkmn.totalhp/5).floor)
- @scene.pbDisplay(_INTL("{1}'s HP was restored by the power of {2}!",
- newpkmn.name,pkmn.pbGetBirthsignName))
- pbRefresh
- end
- break if pkmn.hp<=(pkmn.totalhp/5).floor
- end
- pbRefresh
- end
- #===============================================================================
- # Birthsigns - The Voyager
- # Teleport Skill effect: Mimics the effect of 'Teleport'.
- #===============================================================================
- elsif cmdTeleport>=0 && command==cmdTeleport
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
- Kernel.pbMessage(_INTL("That power can only be used outdoors."))
- elsif $game_player.pbHasDependentEvents?
- Kernel.pbMessage(_INTL("That power can't be used when you have someone with you."))
- else
- healing=$PokemonGlobal.healingSpot
- if !healing
- healing=pbGetMetadata(0,MetadataHome) # Home
- elsif healing
- mapname=pbGetMapNameFromId(healing[0])
- if Kernel.pbConfirmMessage(_INTL("Do you want to return to {1}?",mapname))
- if !pbHiddenMoveAnimation(pkmn)
- Kernel.pbMessage(_INTL("{1} used Teleport!",pkmn.name))
- end
- pbFadeOutIn(99999){
- Kernel.pbCancelVehicles
- $game_temp.player_new_map_id=healing[0]
- $game_temp.player_new_x=healing[1]
- $game_temp.player_new_y=healing[2]
- $game_temp.player_new_direction=2
- $scene.transfer_player
- $game_map.autoplay
- $game_map.refresh
- }
- pbEraseEscapePoint
- Kernel.pbMessage(_INTL("Returned to {1} using the power of {2}!",
- mapname,pkmn.pbGetBirthsignName))
- pbRefresh
- break
- end
- end
- end
- end
- #===============================================================================
- # Birthsigns - The Phoenix
- # Rebirth Skill effect: Revives the user with roughly 1/16th its max hp.
- #===============================================================================
- elsif cmdRebirth>=0 && command==cmdRebirth
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- if pkmn.hp==0
- hpgain=pbItemRestoreHP(pkmn,pkmn.totalhp/16.floor+1)
- pbRefresh
- pbSEPlay("ItemGet")
- Kernel.pbMessage(_INTL("{1} was revived by the power of {2}!",
- pkmn.name,pkmn.pbGetBirthsignName))
- else
- Kernel.pbMessage(_INTL("It won't have any effect."))
- end
- pbRefresh
- end
- #===============================================================================
- # Birthsigns - The Fugitive
- # Escape Skill effect: Mimics the effects of 'Dig' or 'Escape Rope'.
- #===============================================================================
- elsif cmdEscape>=0 && command==cmdEscape
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- escape=($PokemonGlobal.escapePoint rescue nil)
- outdoors=pbGetMetadata($game_map.map_id,MetadataOutdoor)
- if !escape || escape==[] || outdoors
- Kernel.pbMessage(_INTL("That power can't be used here."))
- elsif $game_player.pbHasDependentEvents?
- Kernel.pbMessage(_INTL("That power can't be used when you have someone with you."))
- else
- mapname=pbGetMapNameFromId(escape[0])
- if Kernel.pbConfirmMessage(_INTL("Want to escape from here and return to {1}?",mapname))
- if escape
- if !pbHiddenMoveAnimation(pkmn)
- Kernel.pbMessage(_INTL("{1} used Escape!",pkmn.name))
- end
- pbFadeOutIn(99999){
- Kernel.pbCancelVehicles
- $game_temp.player_new_map_id=escape[0]
- $game_temp.player_new_x=escape[1]
- $game_temp.player_new_y=escape[2]
- $game_temp.player_new_direction=escape[3]
- $scene.transfer_player
- $game_map.autoplay
- $game_map.refresh
- }
- pbEraseEscapePoint
- Kernel.pbMessage(_INTL("Escaped to {1} by using the power of {2}!",
- mapname,pkmn.pbGetBirthsignName))
- pbRefresh
- break
- end
- end
- end
- end
- #===============================================================================
- # Birthsigns - The Cleric
- # Cure Skill effect: Heals the user's status conditions.
- #===============================================================================
- elsif cmdCure>=0 && command==cmdCure
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- if pkmn.status>0 && pkmn.hp>0
- pkmn.status=0
- pkmn.statusCount=0
- pbRefresh
- pbSEPlay("ItemGet")
- Kernel.pbMessage(_INTL("{1}'s condition was healed by the power of {2}!",
- pkmn.name,pkmn.pbGetBirthsignName))
- else
- Kernel.pbMessage(_INTL("It won't have any effect."))
- end
- pbRefresh
- end
- #===============================================================================
- # Birthsigns - The Monk
- # Trance Skill effect: Relearns old moves.
- #===============================================================================
- elsif cmdTrance>=0 && command==cmdTrance
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("{1} entered a deep trance...",pkmn.name))
- if pbGetRelearnableMoves(pkmn).length>0
- pbRelearnMoveScreen(pkmn)
- else
- Kernel.pbMessage(_INTL("...but it couldn't recall anything."))
- end
- pbRefresh
- end
- #===============================================================================
- # Birthsigns - The Specialist
- # Re-roll Skill effect: IV's are reset to yield a new Hidden Power.
- #===============================================================================
- elsif cmdReroll>=0 && command==cmdReroll
- #=======================================================================
- # IV Settings
- # The IV numbers set to odd and even that determines hidden power.
- # #TAG20
- #=======================================================================
- #Set to any odd-numbered IV you desire.
- #Set to rand(32)/2.floor*2+1 if you want a random odd number.
- odd = 25
- #=======================================================================
- #Set to any even-numbered IV you desire.
- #Set to rand(32)/2.floor*2 if you want a random even number.
- evn = 26
- #=======================================================================
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- pbRefresh
- pbDisplay(_INTL("{1} can change its Hidden Power type!",pkmn.name))
- command=0
- loop do
- command=@scene.pbShowCommands(_INTL("Choose a new Hidden Power."),[
- _INTL("Grass"),
- _INTL("Fire"),
- _INTL("Water"),
- _INTL("Electric"),
- _INTL("Ice"),
- _INTL("Fighting"),
- _INTL("Flying"),
- _INTL("Poison"),
- _INTL("Ground"),
- _INTL("Rock"),
- _INTL("Bug"),
- _INTL("Ghost"),
- _INTL("Steel"),
- _INTL("Psychic"),
- _INTL("Dragon"),
- _INTL("Dark"),
- _INTL("Fairy"),
- _INTL("*Random*"),
- _INTL("Cancel")
- ],command)
- case command
- when -1, 18
- break
- #Re-rolls the user's IV's for a new Hidden Power.
- when 0 # Grass
- pkmn.iv=[odd,odd,evn,odd,evn,odd]
- when 1 # Fire
- pkmn.iv=[odd,odd,evn,evn,evn,odd]
- when 2 # Water
- pkmn.iv=[odd,odd,odd,evn,evn,odd]
- when 3 # Electric
- pkmn.iv=[odd,odd,odd,odd,evn,odd]
- when 4 # Ice
- pkmn.iv=[odd,odd,odd,evn,odd,odd]
- when 5 # Fighting
- pkmn.iv=[odd,odd,evn,evn,evn,evn]
- when 6 # Flying
- pkmn.iv=[odd,odd,odd,evn,evn,evn]
- when 7 # Poison
- pkmn.iv=[odd,odd,evn,odd,evn,evn]
- when 8 # Ground
- pkmn.iv=[odd,odd,odd,odd,evn,evn]
- when 9 # Rock
- pkmn.iv=[odd,odd,evn,evn,odd,evn]
- when 10# Bug
- pkmn.iv=[odd,odd,odd,evn,odd,evn]
- when 11# Ghost
- pkmn.iv=[odd,odd,evn,odd,odd,evn]
- when 12# Steel
- pkmn.iv=[odd,odd,odd,odd,odd,evn]
- when 13# Psychic
- pkmn.iv=[odd,odd,evn,evn,odd,odd]
- when 14# Dragon
- pkmn.iv=[odd,odd,evn,odd,odd,odd]
- #=====================================================================
- # Types PBS file must include Fairy type for the below to work.
- # Otherwise it will just return HP Dragon.
- #=====================================================================
- when 15# Dark
- pkmn.iv=[odd,evn,odd,odd,odd,odd]
- #=====================================================================
- # Types PBS file must include Fairy type for the below to work.
- # Otherwise it will just return HP Dark.
- #=====================================================================
- when 16# Fairy
- pkmn.iv=[odd,odd,odd,odd,odd,odd]
- #=====================================================================
- # Randomizes the user's IV's and returns their new values.
- #=====================================================================
- when 17# Randomize
- if pkmn.level>49
- #Users level 50 and higher have better IV rolls.
- pkmn.iv[0]=25+rand(7)
- pkmn.iv[1]=25+rand(7)
- pkmn.iv[2]=25+rand(7)
- pkmn.iv[3]=25+rand(7)
- pkmn.iv[4]=25+rand(7)
- pkmn.iv[5]=25+rand(7)
- else
- #Users level 49 and lower have completely random IV rolls.
- pkmn.iv[0]=rand(32)
- pkmn.iv[1]=rand(32)
- pkmn.iv[2]=rand(32)
- pkmn.iv[3]=rand(32)
- pkmn.iv[4]=rand(32)
- pkmn.iv[5]=rand(32)
- end
- Kernel.pbMessage(_INTL("Re-roll:\n{1}/{2}/{3}/{4}/{5}/{6}",
- pkmn.iv[0],pkmn.iv[1],pkmn.iv[2],pkmn.iv[4],pkmn.iv[5],pkmn.iv[3]))
- end
- #=====================================================================
- pbRefresh
- pkmn.calcStats
- hiddenpower=pbHiddenPower(pkmn.iv)
- pbSEPlay("ItemGet")
- Kernel.pbMessage(_INTL("The power of {1} changed {2}'s Hidden Power to {3}!",
- pkmn.pbGetBirthsignName,pkmn.name,PBTypes.getName(hiddenpower[0])))
- break
- end
- end
- #===============================================================================
- # Birthsigns - The Parent
- # Incubate Skill effect: Eggs with <1000 steps left will be reduced to 1.
- #===============================================================================
- elsif cmdIncubate>=0 && command==cmdIncubate
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- @scene.pbSetHelpText(_INTL("Which egg to incubate?"))
- oldpkmnid=pkmnid
- loop do
- @scene.pbPreSelect(oldpkmnid)
- pkmnid=@scene.pbChoosePokemon(true,pkmnid)
- break if pkmnid<0
- newpkmn=@party[pkmnid]
- if Input.trigger?(Input::B)
- break
- elsif !newpkmn.isEgg?
- Kernel.pbMessage(_INTL("This power only works on eggs!"))
- elsif newpkmn.isEgg? && newpkmn.eggsteps>1000
- Kernel.pbMessage(_INTL("That egg still has {1} steps to go!",newpkmn.eggsteps))
- elsif newpkmn.isEgg? && newpkmn.eggsteps<1000
- newpkmn.eggsteps=1
- Kernel.pbMessage(_INTL("{1} incubated the egg with the power of {2}!",
- pkmn.name,pkmn.pbGetBirthsignName))
- Kernel.pbMessage(_INTL("The egg is now ready to hatch!"))
- end
- end
- pbRefresh
- end
- #===============================================================================
- # Birthsigns - The Eternal
- # Reincarnate Skill effect: Resets the user's birthsign and attributes.
- #===============================================================================
- elsif cmdReincarnate>=0 && command==cmdReincarnate
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- if Time.now.mon==12 && pkmn.hasCurrentSign?
- Kernel.pbMessage(_INTL("This power doesn't work unless its a different month!"))
- break
- end
- Kernel.pbMessage(_INTL("Activating this birthsign will reset {1}'s birthsign, level,\nand many other attributes.",pkmn.name))
- pbWait(10)
- if Kernel.pbConfirmMessage(_INTL("Are you sure you want to activate this birthsign?"))
- pkmn.level=EGGINITIALLEVEL
- pkmn.ev=[0,0,0,0,0,0]
- pkmn.happiness=120
- pkmn.pokerus=0
- pkmn.timeEggHatched=pbGetTimeNow
- pkmn.obtainText=_INTL("From a previous life.")
- if pkmn.obtainMode!=1
- pkmn.setBirthsign(Time.now.mon)
- end
- Kernel.pbMessage(_INTL("{1} was reincarnated by the power of {2}!",pkmn.name,PBBirthsigns.getName(12)))
- Kernel.pbMessage(_INTL("And..."))
- pbSEPlay("ItemGet")
- Kernel.pbMessage(_INTL("{1} gained the power of\n{2}!",pkmn.name,pkmn.pbGetBirthsignName))
- pkmn.calcStats
- pbRefresh
- if Kernel.pbConfirmMessage(_INTL("Would you like to rename the reincarnated Pokémon?"))
- species=PBSpecies.getName(pkmn.species)
- nickname=pbEnterPokemonName(_INTL("{1}'s new name?",pkmn.name),0,10,"",pkmn)
- pkmn.name=nickname if nickname!=""
- pbRefresh
- end
- if !pkmn.hasRibbon?(:SECONDSTEP)
- pkmn.giveRibbon(:SECONDSTEP)
- Kernel.pbMessage(_INTL("You put the Second Step Ribbon on {1} to commemorate new life.",pkmn.name))
- end
- pbRefresh
- end
- end
- #===============================================================================
- elsif cmdSwitch>=0 && command==cmdSwitch
- @scene.pbSetHelpText(_INTL("Move to where?"))
- oldpkmnid=pkmnid
- pkmnid=@scene.pbChoosePokemon(true)
- if pkmnid>=0 && pkmnid!=oldpkmnid
- pbSwitch(oldpkmnid,pkmnid)
- end
- elsif cmdDebug>=0 && command==cmdDebug
- pbPokemonDebug(pkmn,pkmnid)
- elsif cmdMail>=0 && command==cmdMail
- command=@scene.pbShowCommands(_INTL("Do what with the mail?"),[_INTL("Read"),_INTL("Take"),_INTL("Cancel")])
- case command
- when 0 # Read
- pbFadeOutIn(99999){
- pbDisplayMail(pkmn.mail,pkmn)
- }
- when 1 # Take
- pbTakeMail(pkmn)
- pbRefreshSingle(pkmnid)
- end
- elsif cmdItem>=0 && command==cmdItem
- command=@scene.pbShowCommands(_INTL("Do what with an item?"),[_INTL("Give"),_INTL("Take"),_INTL("Cancel")])
- case command
- when 0 # Give
- item=@scene.pbChooseItem($PokemonBag)
- if item>0
- pbGiveMail(item,pkmn,pkmnid)
- pbRefreshSingle(pkmnid)
- end
- when 1 # Take
- pbTakeMail(pkmn)
- pbRefreshSingle(pkmnid)
- end
- end
- end
- @scene.pbEndScene
- return nil
- end
- end
- #########[SECTION 5]##########
- #===============================================================================
- # Birthsigns Summary - Page rewrites
- #===============================================================================
- # Overwrites areas within the PScreen_Summary section.
- # Adds zodiac tokens and other tweaks to the summary pages.
- # #TAG13
- #===============================================================================
- class PokemonSummaryScene
- #===============================================================================
- # Birthsigns - Zodiac Token
- # The token image displayed on each summary page.
- #===============================================================================
- def pbDisplaySummaryToken
- tokenpath1="Graphics/Pictures/Birthsigns/token%02d"
- tokenpath2="Graphics/Pictures/Birthsigns/Birthsigns2/token%02d"
- if @pokemon.obtainMode==1
- if !BIRTHSIGNS_SET_2
- sprintf(tokenpath1,zodiacValue(@pokemon.birthsign))
- else
- sprintf(tokenpath2,zodiacValue(@pokemon.birthsign))
- end
- else
- if !BIRTHSIGNS_SET_2
- sprintf(tokenpath1,PBBirthsigns.signValue(@pokemon.birthsign))
- else
- sprintf(tokenpath2,PBBirthsigns.signValue(@pokemon.birthsign))
- end
- end
- end
- #===============================================================================
- # Page 1: Info
- #===============================================================================
- def drawPageOne(pokemon)
- if pokemon.isEgg?
- drawPageOneEgg(pokemon)
- return
- end
- overlay=@sprites["overlay"].bitmap
- overlay.clear
- @sprites["background"].setBitmap("Graphics/Pictures/summary1")
- imagepos=[]
- if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
- status=6 if pbPokerus(pokemon)==1
- status=@pokemon.status-1 if @pokemon.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=@pokemon.ballused ? @pokemon.ballused : 0
- ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
- imagepos.push([ballimage,14,60,0,0,-1,-1])
- #===========================================================================
- # Birthsigns - Zodiac Token
- #===========================================================================
- if !(@pokemon.isShadow? rescue false)
- zodiactoken=pbDisplaySummaryToken
- imagepos.push([zodiactoken,150,260,0,0,-1,-1])
- end
- #===========================================================================
- 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)
- growthrate=pokemon.growthrate
- startexp=PBExperience.pbGetStartExperience(pokemon.level,growthrate)
- endexp=PBExperience.pbGetStartExperience(pokemon.level+1,growthrate)
- pokename=@pokemon.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],
- [_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.hasItem?
- textpos.push([PBItems.getName(pokemon.item),16,352,0,Color.new(64,64,64),Color.new(176,176,176)])
- else
- textpos.push([_INTL("None"),16,352,0,Color.new(184,184,160),Color.new(208,208,200)])
- end
- 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)
- 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)
- 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
- #===============================================================================
- # Page 2: Memo
- # The Birthsigns page is accessible here by pressing the confirm button.
- #===============================================================================
- def drawPageTwo(pokemon)
- overlay=@sprites["overlay"].bitmap
- overlay.clear
- @sprites["background"].setBitmap("Graphics/Pictures/summary2")
- imagepos=[]
- if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
- status=6 if pbPokerus(pokemon)==1
- status=@pokemon.status-1 if @pokemon.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=@pokemon.ballused ? @pokemon.ballused : 0
- ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
- imagepos.push([ballimage,14,60,0,0,-1,-1])
- #===========================================================================
- # Birthsigns - Zodiac Token
- #===========================================================================
- if !(@pokemon.isShadow? rescue false)
- zodiactoken=pbDisplaySummaryToken
- imagepos.push([zodiactoken,150,260,0,0,-1,-1])
- end
- #===========================================================================
- pbDrawImagePositions(overlay,imagepos)
- base=Color.new(248,248,248)
- shadow=Color.new(104,104,104)
- pbSetSystemFont(overlay)
- naturename=PBNatures.getName(pokemon.nature)
- pokename=@pokemon.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],
- ]
- if pokemon.hasItem?
- textpos.push([PBItems.getName(pokemon.item),16,352,0,Color.new(64,64,64),Color.new(176,176,176)])
- else
- textpos.push([_INTL("None"),16,352,0,Color.new(184,184,160),Color.new(208,208,200)])
- 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)
- 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),
- #=================================================================
- # Birthsigns - The Eternal
- # Changes met text for reincarnated Pokemon.
- #=================================================================
- if pokemon.hasRibbon?(:SECONDSTEP)
- _INTL("Reincarnated.")
- else
- _INTL("Egg received.")
- end,
- #=================================================================
- _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
- #===============================================================================
- # Page 3: Stats
- #===============================================================================
- def drawPageThree(pokemon)
- overlay=@sprites["overlay"].bitmap
- overlay.clear
- @sprites["background"].setBitmap("Graphics/Pictures/summary3")
- imagepos=[]
- if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
- status=6 if pbPokerus(pokemon)==1
- status=@pokemon.status-1 if @pokemon.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=@pokemon.ballused ? @pokemon.ballused : 0
- ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
- imagepos.push([ballimage,14,60,0,0,-1,-1])
- #===========================================================================
- # Birthsigns - Zodiac Token
- #===========================================================================
- if !(@pokemon.isShadow? rescue false)
- zodiactoken=pbDisplaySummaryToken
- imagepos.push([zodiactoken,150,260,0,0,-1,-1])
- end
- #===========================================================================
- 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)
- pokename=@pokemon.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],
- [_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.hasItem?
- textpos.push([PBItems.getName(pokemon.item),16,352,0,Color.new(64,64,64),Color.new(176,176,176)])
- else
- textpos.push([_INTL("None"),16,352,0,Color.new(184,184,160),Color.new(208,208,200)])
- 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)
- 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<=(@pokemon.totalhp/2).floor
- hpzone=2 if pokemon.hp<=(@pokemon.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
- #===============================================================================
- # Page 4: Moves
- #===============================================================================
- def drawPageFour(pokemon)
- overlay=@sprites["overlay"].bitmap
- overlay.clear
- @sprites["background"].setBitmap("Graphics/Pictures/summary4")
- @sprites["pokemon"].visible=true
- @sprites["pokeicon"].visible=false
- imagepos=[]
- if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
- status=6 if pbPokerus(pokemon)==1
- status=@pokemon.status-1 if @pokemon.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=@pokemon.ballused ? @pokemon.ballused : 0
- ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
- imagepos.push([ballimage,14,60,0,0,-1,-1])
- #===========================================================================
- # Birthsigns - Zodiac Token
- #===========================================================================
- if !(@pokemon.isShadow? rescue false)
- zodiactoken=pbDisplaySummaryToken
- imagepos.push([zodiactoken,150,260,0,0,-1,-1])
- end
- #===========================================================================
- pbDrawImagePositions(overlay,imagepos)
- base=Color.new(248,248,248)
- shadow=Color.new(104,104,104)
- pbSetSystemFont(overlay)
- pokename=@pokemon.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],
- ]
- if pokemon.hasItem?
- textpos.push([PBItems.getName(pokemon.item),16,352,0,Color.new(64,64,64),Color.new(176,176,176)])
- else
- textpos.push([_INTL("None"),16,352,0,Color.new(184,184,160),Color.new(208,208,200)])
- 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)
- 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
- #===============================================================================
- # Page 5: Ribbons
- #===============================================================================
- def drawPageFive(pokemon)
- overlay=@sprites["overlay"].bitmap
- overlay.clear
- @sprites["background"].setBitmap("Graphics/Pictures/summary5")
- imagepos=[]
- if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
- status=6 if pbPokerus(pokemon)==1
- status=@pokemon.status-1 if @pokemon.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=@pokemon.ballused ? @pokemon.ballused : 0
- ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
- imagepos.push([ballimage,14,60,0,0,-1,-1])
- #===========================================================================
- # Birthsigns - Zodiac Token
- #===========================================================================
- if !(@pokemon.isShadow? rescue false)
- zodiactoken=pbDisplaySummaryToken
- imagepos.push([zodiactoken,150,260,0,0,-1,-1])
- end
- #===========================================================================
- pbDrawImagePositions(overlay,imagepos)
- base=Color.new(248,248,248)
- shadow=Color.new(104,104,104)
- pbSetSystemFont(overlay)
- pokename=@pokemon.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],
- [_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.hasItem?
- textpos.push([PBItems.getName(pokemon.item),16,352,0,Color.new(64,64,64),Color.new(176,176,176)])
- else
- textpos.push([_INTL("None"),16,352,0,Color.new(184,184,160),Color.new(208,208,200)])
- 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)
- 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
- #===============================================================================
- # Summary - Birthsign Page
- #===============================================================================
- # Draws the Birthsign Summary Page, accessible by pressing the confirm
- # button on the Memo Page (Page 2).
- #===============================================================================
- def drawBirthsignPage(pokemon)
- overlay=@sprites["overlay"].bitmap
- overlay.clear
- imagepos=[]
- #=========================================================================
- # Images
- #=========================================================================
- bgpath1="Graphics/Pictures/Birthsigns/birthsign%02d"
- bgpath2="Graphics/Pictures/Birthsigns/Birthsigns2/birthsign%02d"
- if @pokemon.obtainMode==1
- if !BIRTHSIGNS_SET_2
- zodiacimage=sprintf(bgpath1,zodiacValue(@pokemon.birthsign))
- else
- zodiacimage=sprintf(bgpath2,zodiacValue(@pokemon.birthsign))
- end
- else
- if !BIRTHSIGNS_SET_2
- zodiacimage=sprintf(bgpath1,PBBirthsigns.signValue(@pokemon.birthsign))
- else
- zodiacimage=sprintf(bgpath2,PBBirthsigns.signValue(@pokemon.birthsign))
- end
- end
- zodiactoken=pbDisplaySummaryToken
- imagepos.push([zodiacimage,0,0,0,0,-1,-1])
- imagepos.push(["Graphics/Pictures/Birthsigns/Other/summaryzboarder",0,0,0,0,-1,-1])
- imagepos.push([zodiactoken,4,122,0,0,-1,-1])
- if @pokemon.isBirthday?
- imagepos.push(["Graphics/Pictures/Birthsigns/Other/bdayicon",190,316,0,0,-1,-1])
- end
- pbDrawImagePositions(overlay,imagepos)
- #=========================================================================
- # Text
- #=========================================================================
- zodiac=@pokemon.pbGetBirthsignName
- zodiacdesc=@pokemon.pbGetBirthsignDesc
- month=pbGetAbbrevMonthName(pokemon.birthsign)
- lastday=pokemon.pbLastMonthDay
- pokename=@pokemon.name
- # White Text
- base=Color.new(248,248,248)
- shadow=Color.new(104,104,104)
- # Black Text
- base2=Color.new(64,64,64)
- shadow2=Color.new(176,176,176)
- # Birthday Text
- bdaycolor1=Color.new(255,215,0)
- bdaycolor2=Color.new(0,0,125)
- pbSetSystemFont(overlay)
- textpos=[
- [_INTL("BIRTHSIGN"),26,16,0,base,shadow],
- [_INTL("{1}'s Birthsign",pokename),123,60,2,base,shadow],
- [zodiac,121,90,2,base2,shadow2],
- [_INTL("Sign: {1} 1st - {2}",month,lastday),4,352,0,base2,shadow2]
- ]
- if pokemon.obtainMode==1
- if pokemon.timeEggHatched
- date=pokemon.timeEggHatched.day
- year=pokemon.timeEggHatched.year
- if pokemon.isBirthday?
- textpos.push([_INTL("Happy Birthday!"),22,320,0,bdaycolor1,bdaycolor2])
- else
- textpos.push([_INTL("Birthday: {1} {2}, {3}",month,date,year),4,320,0,base,shadow])
- end
- end
- else
- textpos.push([_INTL("Birthday: Unknown"),4,320,0,base,shadow])
- end
- pbDrawTextPositions(overlay,textpos)
- pbSetSmallFont(overlay)
- drawTextEx(overlay,260,320,258,0,zodiacdesc,base,shadow)
- loop do
- Input.update
- Graphics.update
- if Input.trigger?(Input::B)
- Input.update
- break
- end
- pbUpdate
- end
- end
- #===============================================================================
- # Summary - Page access
- #===============================================================================
- # Overwrites the section in PScreen_Summary that changes pages in the Summary.
- #===============================================================================
- def pbScene
- pbPlayCry(@pokemon)
- loop do
- Graphics.update
- Input.update
- pbUpdate
- if Input.trigger?(Input::B)
- break
- end
- dorefresh=false
- if Input.trigger?(Input::C)
- if @page==0
- break
- elsif @page==3
- pbMoveSelection
- dorefresh=true
- drawPageFour(@pokemon)
- #=========================================================================
- # Birthsigns page access
- #=========================================================================
- elsif @page==1 && @pokemon.hasBirthsign?
- drawBirthsignPage(@pokemon)
- drawPageTwo(@pokemon)
- #=========================================================================
- end
- end
- if Input.trigger?(Input::UP) && @partyindex>0
- oldindex=@partyindex
- pbGoToPrevious
- if @partyindex!=oldindex
- @pokemon=@party[@partyindex]
- @sprites["pokemon"].setPokemonBitmap(@pokemon)
- @sprites["pokemon"].color=Color.new(0,0,0,0)
- pbPositionPokemonSprite(@sprites["pokemon"],40,144)
- dorefresh=true
- pbPlayCry(@pokemon)
- end
- end
- if Input.trigger?(Input::DOWN) && @partyindex<@party.length-1
- oldindex=@partyindex
- pbGoToNext
- if @partyindex!=oldindex
- @pokemon=@party[@partyindex]
- @sprites["pokemon"].setPokemonBitmap(@pokemon)
- @sprites["pokemon"].color=Color.new(0,0,0,0)
- pbPositionPokemonSprite(@sprites["pokemon"],40,144)
- dorefresh=true
- pbPlayCry(@pokemon)
- end
- end
- if Input.trigger?(Input::LEFT) && !@pokemon.isEgg?
- oldpage=@page
- @page-=1
- @page=0 if @page<0
- @page=4 if @page>4
- dorefresh=true
- if @page!=oldpage # Move to next page
- pbPlayCursorSE()
- dorefresh=true
- end
- end
- if Input.trigger?(Input::RIGHT) && !@pokemon.isEgg?
- oldpage=@page
- @page+=1
- @page=0 if @page<0
- @page=4 if @page>4
- if @page!=oldpage # Move to next page
- pbPlayCursorSE()
- dorefresh=true
- end
- end
- if dorefresh
- case @page
- when 0
- drawPageOne(@pokemon)
- when 1
- drawPageTwo(@pokemon)
- when 2
- drawPageThree(@pokemon)
- when 3
- drawPageFour(@pokemon)
- when 4
- drawPageFive(@pokemon)
- end
- end
- end
- return @partyindex
- end
- end
- #########[SECTION 6]##########
- #===============================================================================
- # Birthsign Bonuses - Hatch effects
- #===============================================================================
- # Applies Birthsign effects upon hatching or recieving and Egg that alter
- # the Pokemon in some way.
- # Overwrites sections in PField_DayCare & PScreen_EggHatching
- #===============================================================================
- def pbDayCareGenerateEgg
- if pbDayCareDeposited!=2
- return
- elsif $Trainer.party.length>=6
- raise _INTL("Can't store the egg")
- end
- pokemon0=$PokemonGlobal.daycare[0][0]
- pokemon1=$PokemonGlobal.daycare[1][0]
- mother=nil
- father=nil
- babyspecies=0
- ditto0=pbIsDitto?(pokemon0)
- ditto1=pbIsDitto?(pokemon1)
- if (pokemon0.isFemale? || ditto0)
- babyspecies=(ditto0) ? pokemon1.species : pokemon0.species
- mother=pokemon0
- father=pokemon1
- else
- babyspecies=(ditto1) ? pokemon0.species : pokemon1.species
- mother=pokemon1
- father=pokemon0
- end
- babyspecies=pbGetBabySpecies(babyspecies,mother.item,father.item)
- if isConst?(babyspecies,PBSpecies,:MANAPHY) && hasConst?(PBSpecies,:PHIONE)
- babyspecies=getConst(PBSpecies,:PHIONE)
- elsif (isConst?(babyspecies,PBSpecies,:NIDORANfE) && hasConst?(PBSpecies,:NIDORANmA)) ||
- (isConst?(babyspecies,PBSpecies,:NIDORANmA) && hasConst?(PBSpecies,:NIDORANfE))
- babyspecies=[getConst(PBSpecies,:NIDORANmA),
- getConst(PBSpecies,:NIDORANfE)][rand(2)]
- elsif (isConst?(babyspecies,PBSpecies,:VOLBEAT) && hasConst?(PBSpecies,:ILLUMISE)) ||
- (isConst?(babyspecies,PBSpecies,:ILLUMISE) && hasConst?(PBSpecies,:VOLBEAT))
- babyspecies=[getConst(PBSpecies,:VOLBEAT),
- getConst(PBSpecies,:ILLUMISE)][rand(2)]
- end
- # Generate egg
- egg=PokeBattle_Pokemon.new(babyspecies,EGGINITIALLEVEL,$Trainer)
- # Randomise personal ID
- pid=rand(65536)
- pid|=(rand(65536)<<16)
- egg.personalID=pid
- # Inheriting form
- if isConst?(babyspecies,PBSpecies,:BURMY) ||
- isConst?(babyspecies,PBSpecies,:SHELLOS) ||
- isConst?(babyspecies,PBSpecies,:BASCULIN)
- egg.form=mother.form
- end
- # Inheriting Moves
- moves=[]
- othermoves=[]
- movefather=father; movemother=mother
- if pbIsDitto?(movefather) && !mother.isFemale?
- movefather=mother; movemother=father
- end
- # Initial Moves
- initialmoves=egg.getMoveList
- for k in initialmoves
- if k[0]<=EGGINITIALLEVEL
- moves.push(k[1])
- else
- othermoves.push(k[1]) if mother.knowsMove?(k[1]) && father.knowsMove?(k[1])
- end
- end
- # Inheriting Natural Moves
- for move in othermoves
- moves.push(move)
- end
- # Inheriting Machine Moves
- if !USENEWBATTLEMECHANICS
- for i in 0...$ItemData.length
- next if !$ItemData[i]
- atk=$ItemData[i][ITEMMACHINE]
- next if !atk || atk==0
- if egg.isCompatibleWithMove?(atk)
- moves.push(atk) if movefather.knowsMove?(atk)
- end
- end
- end
- # Inheriting Egg Moves
- if movefather.isMale?
- pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
- f.pos=(babyspecies-1)*8
- offset=f.fgetdw
- length=f.fgetdw
- if length>0
- f.pos=offset
- i=0; loop do break unless i<length
- atk=f.fgetw
- moves.push(atk) if movefather.knowsMove?(atk)
- i+=1
- end
- end
- }
- end
- if USENEWBATTLEMECHANICS
- pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
- f.pos=(babyspecies-1)*8
- offset=f.fgetdw
- length=f.fgetdw
- if length>0
- f.pos=offset
- i=0; loop do break unless i<length
- atk=f.fgetw
- moves.push(atk) if movemother.knowsMove?(atk)
- i+=1
- end
- end
- }
- end
- # Volt Tackle
- lightball=false
- if (isConst?(father.species,PBSpecies,:PIKACHU) ||
- isConst?(father.species,PBSpecies,:RAICHU)) &&
- isConst?(father.item,PBItems,:LIGHTBALL)
- lightball=true
- end
- if (isConst?(mother.species,PBSpecies,:PIKACHU) ||
- isConst?(mother.species,PBSpecies,:RAICHU)) &&
- isConst?(mother.item,PBItems,:LIGHTBALL)
- lightball=true
- end
- if lightball && isConst?(babyspecies,PBSpecies,:PICHU) &&
- hasConst?(PBMoves,:VOLTTACKLE)
- moves.push(getConst(PBMoves,:VOLTTACKLE))
- end
- moves|=[] # remove duplicates
- # Assembling move list
- finalmoves=[]
- listend=moves.length-4
- listend=0 if listend<0
- j=0
- for i in listend..listend+3
- moveid=(i>=moves.length) ? 0 : moves[i]
- finalmoves[j]=PBMove.new(moveid)
- j+=1
- end
- # Inheriting Individual Values
- ivs=[]
- for i in 0...6
- ivs[i]=rand(32)
- end
- ivinherit=[]
- for i in 0...2
- parent=[mother,father][i]
- ivinherit[i]=PBStats::HP if isConst?(parent.item,PBItems,:POWERWEIGHT)
- ivinherit[i]=PBStats::ATTACK if isConst?(parent.item,PBItems,:POWERBRACER)
- ivinherit[i]=PBStats::DEFENSE if isConst?(parent.item,PBItems,:POWERBELT)
- ivinherit[i]=PBStats::SPEED if isConst?(parent.item,PBItems,:POWERANKLET)
- ivinherit[i]=PBStats::SPATK if isConst?(parent.item,PBItems,:POWERLENS)
- ivinherit[i]=PBStats::SPDEF if isConst?(parent.item,PBItems,:POWERBAND)
- end
- num=0; r=rand(2)
- for i in 0...2
- if ivinherit[r]!=nil
- parent=[mother,father][r]
- ivs[ivinherit[r]]=parent.iv[ivinherit[r]]
- num+=1
- break
- end
- r=(r+1)%2
- end
- stats=[PBStats::HP,PBStats::ATTACK,PBStats::DEFENSE,
- PBStats::SPEED,PBStats::SPATK,PBStats::SPDEF]
- limit=(USENEWBATTLEMECHANICS && (isConst?(mother.item,PBItems,:DESTINYKNOT) ||
- isConst?(father.item,PBItems,:DESTINYKNOT))) ? 5 : 3
- loop do
- freestats=[]
- for i in stats
- freestats.push(i) if !ivinherit.include?(i)
- end
- break if freestats.length==0
- r=freestats[rand(freestats.length)]
- parent=[mother,father][rand(2)]
- ivs[r]=parent.iv[r]
- ivinherit.push(r)
- num+=1
- break if num>=limit
- end
- # Inheriting nature
- newnatures=[]
- newnatures.push(mother.nature) if isConst?(mother.item,PBItems,:EVERSTONE)
- newnatures.push(father.nature) if isConst?(father.item,PBItems,:EVERSTONE)
- if newnatures.length>0
- egg.setNature(newnatures[rand(newnatures.length)])
- end
- # Masuda method and Shiny Charm
- shinyretries=0
- shinyretries+=5 if father.language!=mother.language
- shinyretries+=2 if hasConst?(PBItems,:SHINYCHARM) &&
- $PokemonBag.pbQuantity(:SHINYCHARM)>0
- if shinyretries>0
- for i in 0...shinyretries
- break if egg.isShiny?
- egg.personalID=rand(65536)|(rand(65536)<<16)
- end
- end
- # Inheriting ability from the mother
- if (!ditto0 && !ditto1)
- if mother.hasHiddenAbility?
- egg.setAbility(mother.abilityIndex) if rand(10)<6
- else
- if rand(10)<8
- egg.setAbility(mother.abilityIndex)
- else
- egg.setAbility((mother.abilityIndex+1)%2)
- end
- end
- elsif ((!ditto0 && ditto1) || (!ditto1 && ditto0)) && USENEWBATTLEMECHANICS
- parent=(!ditto0) ? mother : father
- if parent.hasHiddenAbility?
- egg.setAbility(parent.abilityIndex) if rand(10)<6
- end
- end
- # Inheriting Poké Ball from the mother
- if mother.isFemale? &&
- !isConst?(pbBallTypeToBall(mother.ballused),PBItems,:MASTERBALL) &&
- !isConst?(pbBallTypeToBall(mother.ballused),PBItems,:CHERISHBALL)
- egg.ballused=mother.ballused
- end
- egg.iv[0]=ivs[0]
- egg.iv[1]=ivs[1]
- egg.iv[2]=ivs[2]
- egg.iv[3]=ivs[3]
- egg.iv[4]=ivs[4]
- egg.iv[5]=ivs[5]
- egg.moves[0]=finalmoves[0]
- egg.moves[1]=finalmoves[1]
- egg.moves[2]=finalmoves[2]
- egg.moves[3]=finalmoves[3]
- egg.calcStats
- egg.obtainText=_INTL("Day-Care Couple")
- egg.name=_INTL("Egg")
- dexdata=pbOpenDexData
- pbDexDataOffset(dexdata,babyspecies,21)
- eggsteps=dexdata.fgetw
- dexdata.close
- egg.eggsteps=eggsteps
- #===============================================================================
- # Birthsign - The Ancestor
- # 1/2 eggsteps if one parent has sign. 1/4 the steps if both do.
- # #TAG15
- #===============================================================================
- if BIRTHSIGNS_SET_2
- mothersign=mother.hasJulBirthsign?
- fathersign=father.hasJulBirthsign?
- if mothersign || fathersign
- egg.eggsteps=eggsteps/2
- if mothersign && fathersign
- egg.eggsteps=eggsteps/4
- end
- end
- end
- #===============================================================================
- if rand(65536)<POKERUSCHANCE
- egg.givePokerus
- end
- $Trainer.party[$Trainer.party.length]=egg
- end
- def pbHatch(pokemon)
- speciesname=PBSpecies.getName(pokemon.species)
- pokemon.name=speciesname
- pokemon.trainerID=$Trainer.id
- pokemon.ot=$Trainer.name
- pokemon.happiness=120
- pokemon.timeEggHatched=pbGetTimeNow
- pokemon.obtainMode=1
- pokemon.hatchedMap=$game_map.map_id
- #===============================================================================
- # Birthsigns Bonuses - Passive Effects
- #===============================================================================
- pokemon.applyBirthsignBonuses
- pokemon.zodiacflag=nil
- #===============================================================================
- $Trainer.seen[pokemon.species]=true
- $Trainer.owned[pokemon.species]=true
- pbSeenForm(pokemon)
- pokemon.pbRecordFirstMoves
- if !pbHatchAnimation(pokemon)
- Kernel.pbMessage(_INTL("Huh?\1"))
- Kernel.pbMessage(_INTL("...\1"))
- Kernel.pbMessage(_INTL("... .... .....\1"))
- Kernel.pbMessage(_INTL("{1} hatched from the Egg!",speciesname))
- if Kernel.pbConfirmMessage(_INTL("Would you like to nickname the newly hatched {1}?",speciesname))
- species=PBSpecies.getName(pokemon.species)
- nickname=pbEnterPokemonName(_INTL("{1}'s nickname?",speciesname),0,10,"",pokemon)
- pokemon.name=nickname if nickname!=""
- end
- end
- end
- #===============================================================================
- # Birthsigns Bonuses - Shadow Pokemon
- #===============================================================================
- # Applies passive birthsign effects to a purified Shadow Pokemon if it was
- # obtained through an egg.
- #===============================================================================
- def pbPurify(pokemon,scene)
- if pokemon.heartgauge==0 && pokemon.shadow
- return if !pokemon.savedev && !pokemon.savedexp
- pokemon.shadow=false
- pokemon.giveRibbon(PBRibbons::NATIONAL)
- scene.pbDisplay(_INTL("{1} opened the door to its heart!",pokemon.name))
- oldmoves=[]
- for i in 0...4; oldmoves.push(pokemon.moves[i].id); end
- pokemon.pbUpdateShadowMoves()
- for i in 0...4
- if pokemon.moves[i].id!=0 && pokemon.moves[i].id!=oldmoves[i]
- scene.pbDisplay(_INTL("{1} regained the move \n{2}!",
- pokemon.name,PBMoves.getName(pokemon.moves[i].id)))
- end
- end
- pokemon.pbRecordFirstMoves
- if pokemon.savedev
- for i in 0...6
- pbApplyEVGain(pokemon,i,pokemon.savedev[i])
- end
- pokemon.savedev=nil
- end
- newexp=PBExperience.pbAddExperience(pokemon.exp,pokemon.savedexp||0,pokemon.growthrate)
- pokemon.savedexp=nil
- newlevel=PBExperience.pbGetLevelFromExperience(newexp,pokemon.growthrate)
- curlevel=pokemon.level
- if newexp!=pokemon.exp
- scene.pbDisplay(_INTL("{1} regained {2} Exp. Points!",pokemon.name,newexp-pokemon.exp))
- end
- if newlevel==curlevel
- pokemon.exp=newexp
- pokemon.calcStats
- else
- pbChangeLevel(pokemon,newlevel,scene) # for convenience
- pokemon.exp=newexp
- end
- #===========================================================================
- # Birthsigns Bonuses - Passive Effects
- #===========================================================================
- if pokemon.hasBirthsign?
- pokemon.applyBirthsignBonuses
- pokemon.zodiacflag=nil
- scene.pbDisplay(_INTL("{1} unlocked the power of its birthsign!",pokemon.name))
- scene.pbDisplay(_INTL("{1} inherits the power of {2}!",pokemon.name,pokemon.pbGetBirthsignName))
- end
- #===========================================================================
- speciesname=PBSpecies.getName(pokemon.species)
- if scene.pbConfirm(_INTL("Would you like to give a nickname to {1}?",speciesname))
- helptext=_INTL("{1}'s nickname?",speciesname)
- newname=pbEnterPokemonName(helptext,0,10,"",pokemon)
- pokemon.name=newname if newname!=""
- end
- end
- end
- #########[SECTION 7]##########
- #===============================================================================
- # Birthsign Bonuses - Battle Effects
- #===============================================================================
- # Applies Birthsign effects that alter conditions during or after battle.
- # Overwrites sections in PokeBattle_Battle & PField_Field.
- # #TAG8
- #===============================================================================
- def pbGenerateWildPokemon(species,level,isroamer=false)
- genwildpoke=PokeBattle_Pokemon.new(species,level,$Trainer)
- items=genwildpoke.wildHoldItems
- firstpoke=$Trainer.firstParty
- chances=[50,5,1]
- chances=[60,20,5] if firstpoke && !firstpoke.isEgg? &&
- isConst?(firstpoke.ability,PBAbilities,:COMPOUNDEYES)
- itemrnd=rand(100)
- if itemrnd<chances[0] || (items[0]==items[1] && items[1]==items[2])
- genwildpoke.setItem(items[0])
- elsif itemrnd<(chances[0]+chances[1])
- genwildpoke.setItem(items[1])
- elsif itemrnd<(chances[0]+chances[1]+chances[2])
- genwildpoke.setItem(items[2])
- end
- if hasConst?(PBItems,:SHINYCHARM) && $PokemonBag.pbQuantity(:SHINYCHARM)>0
- for i in 0...2 # 3 times as likely
- break if genwildpoke.isShiny?
- genwildpoke.personalID=rand(65536)|(rand(65536)<<16)
- end
- end
- if rand(65536)<POKERUSCHANCE
- genwildpoke.givePokerus
- end
- #===============================================================================
- # Birthsign - The Assassin
- # Wild Pokemon have a chance of being asleep for 1 turn when encountered.
- # #TAG16
- #===============================================================================
- if $Trainer.party[0].hasSepBirthsign? && BIRTHSIGNS_SET_2
- if genwildpoke.status=0
- # The odds of encountering sleeping Pokemon at night (70%)
- if PBDayNight.isNight?(pbGetTimeNow) && rand(100)<70
- genwildpoke.status=1
- genwildpoke.statusCount=2
- # The odds of encountering sleeping Pokemon in day (30%)
- elsif PBDayNight.isDay?(pbGetTimeNow) && rand(100)<30
- genwildpoke.status=1
- genwildpoke.statusCount=2
- end
- end
- end
- #===============================================================================
- if firstpoke && !firstpoke.isEgg?
- if isConst?(firstpoke.ability,PBAbilities,:CUTECHARM) &&
- !genwildpoke.isSingleGendered?
- if firstpoke.isMale?
- (rand(3)<2) ? genwildpoke.makeFemale : genwildpoke.makeMale
- elsif firstpoke.isFemale?
- (rand(3)<2) ? genwildpoke.makeMale : genwildpoke.makeFemale
- end
- elsif isConst?(firstpoke.ability,PBAbilities,:SYNCHRONIZE)
- genwildpoke.setNature(firstpoke.nature) if !isroamer && rand(10)<5
- end
- end
- Events.onWildPokemonCreate.trigger(nil,genwildpoke)
- return genwildpoke
- end
- class PokeBattle_Battle
- def pbGainExpOne(index,defeated,partic,expshare,haveexpall,showmessages=true)
- thispoke=@party1[index]
- # Original species, not current species
- level=defeated.level
- baseexp=defeated.pokemon.baseExp
- evyield=defeated.pokemon.evYield
- ispartic=0
- ispartic=1 if defeated.participants.include?(index)
- haveexpshare=(isConst?(thispoke.item,PBItems,:EXPSHARE) ||
- isConst?(thispoke.itemInitial,PBItems,:EXPSHARE)) ? 1 : 0
- exp=0
- if expshare>0
- if partic==0 # No participants, all Exp goes to Exp Share holders
- exp=(level*baseexp).floor
- exp=(exp/(NOSPLITEXP ? 1 : expshare)).floor*haveexpshare
- else
- if NOSPLITEXP
- exp=(level*baseexp).floor*ispartic
- exp=(level*baseexp/2).floor*haveexpshare if ispartic==0
- else
- exp=(level*baseexp/2).floor
- exp=(exp/partic).floor*ispartic + (exp/expshare).floor*haveexpshare
- end
- end
- elsif ispartic==1
- exp=(level*baseexp/(NOSPLITEXP ? 1 : partic)).floor
- elsif haveexpall
- exp=(level*baseexp/2).floor
- end
- return if exp<=0
- #===============================================================================
- # Birthsign - The Scholar
- # The Pokemon gains 20% more exp. than normal.
- # #TAG17
- #===============================================================================
- if thispoke.hasFebBirthsign? && BIRTHSIGNS_SET_2
- exp=(exp*3/2.5).floor
- end
- #===============================================================================
- exp=(exp*3/2).floor if @opponent
- if USESCALEDEXPFORMULA
- exp=(exp/5).floor
- leveladjust=(2*level+10.0)/(level+thispoke.level+10.0)
- leveladjust=leveladjust**5
- leveladjust=Math.sqrt(leveladjust)
- exp=(exp*leveladjust).floor
- exp+=1 if ispartic>0 || haveexpshare>0
- else
- exp=(exp/7).floor
- end
- isOutsider=(thispoke.trainerID!=self.pbPlayer.id ||
- (thispoke.language!=0 && thispoke.language!=self.pbPlayer.language))
- if isOutsider
- if thispoke.language!=0 && thispoke.language!=self.pbPlayer.language
- exp=(exp*1.7).floor
- else
- exp=(exp*3/2).floor
- end
- end
- exp=(exp*3/2).floor if isConst?(thispoke.item,PBItems,:LUCKYEGG) ||
- isConst?(thispoke.itemInitial,PBItems,:LUCKYEGG)
- growthrate=thispoke.growthrate
- newexp=PBExperience.pbAddExperience(thispoke.exp,exp,growthrate)
- exp=newexp-thispoke.exp
- if exp>0
- if showmessages
- if isOutsider
- pbDisplayPaused(_INTL("{1} gained a boosted {2} Exp. Points!",thispoke.name,exp))
- else
- pbDisplayPaused(_INTL("{1} gained {2} Exp. Points!",thispoke.name,exp))
- end
- end
- # Gain effort value points, using RS effort values
- totalev=0
- for k in 0...6
- totalev+=thispoke.ev[k]
- end
- for k in 0...6
- evgain=evyield[k]
- evgain*=2 if isConst?(thispoke.item,PBItems,:MACHOBRACE) ||
- isConst?(thispoke.itemInitial,PBItems,:MACHOBRACE)
- case k
- when PBStats::HP
- evgain+=4 if isConst?(thispoke.item,PBItems,:POWERWEIGHT) ||
- isConst?(thispoke.itemInitial,PBItems,:POWERWEIGHT)
- when PBStats::ATTACK
- evgain+=4 if isConst?(thispoke.item,PBItems,:POWERBRACER) ||
- isConst?(thispoke.itemInitial,PBItems,:POWERBRACER)
- when PBStats::DEFENSE
- evgain+=4 if isConst?(thispoke.item,PBItems,:POWERBELT) ||
- isConst?(thispoke.itemInitial,PBItems,:POWERBELT)
- when PBStats::SPATK
- evgain+=4 if isConst?(thispoke.item,PBItems,:POWERLENS) ||
- isConst?(thispoke.itemInitial,PBItems,:POWERLENS)
- when PBStats::SPDEF
- evgain+=4 if isConst?(thispoke.item,PBItems,:POWERBAND) ||
- isConst?(thispoke.itemInitial,PBItems,:POWERBAND)
- when PBStats::SPEED
- evgain+=4 if isConst?(thispoke.item,PBItems,:POWERANKLET) ||
- isConst?(thispoke.itemInitial,PBItems,:POWERANKLET)
- end
- evgain*=2 if thispoke.pokerusStage>=1 # Infected or cured
- if evgain>0
- # Can't exceed overall limit
- evgain-=totalev+evgain-PokeBattle_Pokemon::EVLIMIT if totalev+evgain>PokeBattle_Pokemon::EVLIMIT
- # Can't exceed stat limit
- evgain-=thispoke.ev[k]+evgain-PokeBattle_Pokemon::EVSTATLIMIT if thispoke.ev[k]+evgain>PokeBattle_Pokemon::EVSTATLIMIT
- # Add EV gain
- thispoke.ev[k]+=evgain
- if thispoke.ev[k]>PokeBattle_Pokemon::EVSTATLIMIT
- print "Single-stat EV limit #{PokeBattle_Pokemon::EVSTATLIMIT} exceeded.\r\nStat: #{k} EV gain: #{evgain} EVs: #{thispoke.ev.inspect}"
- thispoke.ev[k]=PokeBattle_Pokemon::EVSTATLIMIT
- end
- totalev+=evgain
- if totalev>PokeBattle_Pokemon::EVLIMIT
- print "EV limit #{PokeBattle_Pokemon::EVLIMIT} exceeded.\r\nTotal EVs: #{totalev} EV gain: #{evgain} EVs: #{thispoke.ev.inspect}"
- end
- end
- end
- newlevel=PBExperience.pbGetLevelFromExperience(newexp,growthrate)
- tempexp=0
- curlevel=thispoke.level
- if newlevel<curlevel
- debuginfo="#{thispoke.name}: #{thispoke.level}/#{newlevel} | #{thispoke.exp}/#{newexp} | gain: #{exp}"
- raise RuntimeError.new(_INTL("The new level ({1}) is less than the Pokémon's\r\ncurrent level ({2}), which shouldn't happen.\r\n[Debug: {3}]",
- newlevel,curlevel,debuginfo))
- return
- end
- if thispoke.respond_to?("isShadow?") && thispoke.isShadow?
- thispoke.exp+=exp
- else
- tempexp1=thispoke.exp
- tempexp2=0
- # Find battler
- battler=pbFindPlayerBattler(index)
- loop do
- # EXP Bar animation
- startexp=PBExperience.pbGetStartExperience(curlevel,growthrate)
- endexp=PBExperience.pbGetStartExperience(curlevel+1,growthrate)
- tempexp2=(endexp<newexp) ? endexp : newexp
- thispoke.exp=tempexp2
- @scene.pbEXPBar(thispoke,battler,startexp,endexp,tempexp1,tempexp2)
- tempexp1=tempexp2
- curlevel+=1
- if curlevel>newlevel
- thispoke.calcStats
- battler.pbUpdate(false) if battler
- @scene.pbRefresh
- break
- end
- oldtotalhp=thispoke.totalhp
- oldattack=thispoke.attack
- olddefense=thispoke.defense
- oldspeed=thispoke.speed
- oldspatk=thispoke.spatk
- oldspdef=thispoke.spdef
- if battler && battler.pokemon && @internalbattle
- battler.pokemon.changeHappiness("level up")
- end
- thispoke.calcStats
- battler.pbUpdate(false) if battler
- @scene.pbRefresh
- pbDisplayPaused(_INTL("{1} grew to Level {2}!",thispoke.name,curlevel))
- @scene.pbLevelUp(thispoke,battler,oldtotalhp,oldattack,
- olddefense,oldspeed,oldspatk,oldspdef)
- # Finding all moves learned at this level
- movelist=thispoke.getMoveList
- for k in movelist
- if k[0]==thispoke.level # Learned a new move
- pbLearnMove(index,k[1])
- end
- end
- end
- end
- end
- end
- def pbEndOfBattle(canlose=false)
- case @decision
- ##### WIN #####
- when 1
- PBDebug.log("")
- PBDebug.log("***Player won***")
- if @opponent
- @scene.pbTrainerBattleSuccess
- if @opponent.is_a?(Array)
- pbDisplayPaused(_INTL("{1} defeated {2} and {3}!",self.pbPlayer.name,@opponent[0].fullname,@opponent[1].fullname))
- else
- pbDisplayPaused(_INTL("{1} defeated\r\n{2}!",self.pbPlayer.name,@opponent.fullname))
- end
- @scene.pbShowOpponent(0)
- pbDisplayPaused(@endspeech.gsub(/\\[Pp][Nn]/,self.pbPlayer.name))
- if @opponent.is_a?(Array)
- @scene.pbHideOpponent
- @scene.pbShowOpponent(1)
- pbDisplayPaused(@endspeech2.gsub(/\\[Pp][Nn]/,self.pbPlayer.name))
- end
- # Calculate money gained for winning
- if @internalbattle
- tmoney=0
- if @opponent.is_a?(Array) # Double battles
- maxlevel1=0; maxlevel2=0; limit=pbSecondPartyBegin(1)
- for i in 0...limit
- if @party2[i]
- maxlevel1=@party2[i].level if maxlevel1<@party2[i].level
- end
- if @party2[i+limit]
- maxlevel2=@party2[i+limit].level if maxlevel1<@party2[i+limit].level
- end
- end
- tmoney+=maxlevel1*@opponent[0].moneyEarned
- tmoney+=maxlevel2*@opponent[1].moneyEarned
- else
- maxlevel=0
- for i in @party2
- next if !i
- maxlevel=i.level if maxlevel<i.level
- end
- tmoney+=maxlevel*@opponent.moneyEarned
- end
- # If Amulet Coin/Luck Incense's effect applies, double money earned
- tmoney*=2 if @amuletcoin
- # If Happy Hour's effect applies, double money earned
- tmoney*=2 if @doublemoney
- #===============================================================================
- # Birthsign - The Aristocrat
- # Doubles prize money when leading the party.
- # #TAG18
- #===============================================================================
- if $Trainer.party[0].hasAprBirthsign? && BIRTHSIGNS_SET_2
- tmoney=(tmoney*3/2.5).floor
- end
- #===============================================================================
- oldmoney=self.pbPlayer.money
- self.pbPlayer.money+=tmoney
- moneygained=self.pbPlayer.money-oldmoney
- if moneygained>0
- pbDisplayPaused(_INTL("{1} got ${2}\r\nfor winning!",self.pbPlayer.name,tmoney))
- end
- end
- end
- if @internalbattle && @extramoney>0
- @extramoney*=2 if @amuletcoin
- @extramoney*=2 if @doublemoney
- #===============================================================================
- # Birthsign - The Aristocrat
- # Doubles Pay Day money when leading the party.
- #===============================================================================
- if $Trainer.party[0].hasAprBirthsign? && BIRTHSIGNS_SET_2
- @extramoney*=2
- end
- #===============================================================================
- oldmoney=self.pbPlayer.money
- self.pbPlayer.money+=@extramoney
- moneygained=self.pbPlayer.money-oldmoney
- if moneygained>0
- pbDisplayPaused(_INTL("{1} picked up ${2}!",self.pbPlayer.name,@extramoney))
- end
- end
- for pkmn in @snaggedpokemon
- pbStorePokemon(pkmn)
- self.pbPlayer.shadowcaught=[] if !self.pbPlayer.shadowcaught
- self.pbPlayer.shadowcaught[pkmn.species]=true
- end
- @snaggedpokemon.clear
- ##### LOSE, DRAW #####
- when 2, 5
- PBDebug.log("")
- PBDebug.log("***Player lost***") if @decision==2
- PBDebug.log("***Player drew with opponent***") if @decision==5
- if @internalbattle
- pbDisplayPaused(_INTL("{1} is out of usable Pokémon!",self.pbPlayer.name))
- moneylost=pbMaxLevelFromIndex(0) # Player's Pokémon only, not partner's
- multiplier=[8,16,24,36,48,60,80,100,120]
- moneylost*=multiplier[[multiplier.length-1,self.pbPlayer.numbadges].min]
- moneylost=self.pbPlayer.money if moneylost>self.pbPlayer.money
- moneylost=0 if $game_switches[NO_MONEY_LOSS]
- oldmoney=self.pbPlayer.money
- self.pbPlayer.money-=moneylost
- lostmoney=oldmoney-self.pbPlayer.money
- if @opponent
- if @opponent.is_a?(Array)
- pbDisplayPaused(_INTL("{1} lost against {2} and {3}!",self.pbPlayer.name,@opponent[0].fullname,@opponent[1].fullname))
- else
- pbDisplayPaused(_INTL("{1} lost against\r\n{2}!",self.pbPlayer.name,@opponent.fullname))
- end
- if moneylost>0
- pbDisplayPaused(_INTL("{1} paid ${2}\r\nas the prize money...",self.pbPlayer.name,lostmoney))
- pbDisplayPaused(_INTL("...")) if !canlose
- end
- else
- if moneylost>0
- pbDisplayPaused(_INTL("{1} panicked and lost\r\n${2}...",self.pbPlayer.name,lostmoney))
- pbDisplayPaused(_INTL("...")) if !canlose
- end
- end
- pbDisplayPaused(_INTL("{1} blacked out!",self.pbPlayer.name)) if !canlose
- elsif @decision==2
- @scene.pbShowOpponent(0)
- pbDisplayPaused(@endspeechwin.gsub(/\\[Pp][Nn]/,self.pbPlayer.name))
- if @opponent.is_a?(Array)
- @scene.pbHideOpponent
- @scene.pbShowOpponent(1)
- pbDisplayPaused(@endspeechwin2.gsub(/\\[Pp][Nn]/,self.pbPlayer.name))
- end
- end
- end
- # Pass on Pokérus within the party
- infected=[]
- for i in 0...$Trainer.party.length
- if $Trainer.party[i].pokerusStage==1
- infected.push(i)
- end
- end
- if infected.length>=1
- for i in infected
- strain=$Trainer.party[i].pokerus/16
- if i>0 && $Trainer.party[i-1].pokerusStage==0
- $Trainer.party[i-1].givePokerus(strain) if rand(3)==0
- end
- if i<$Trainer.party.length-1 && $Trainer.party[i+1].pokerusStage==0
- $Trainer.party[i+1].givePokerus(strain) if rand(3)==0
- end
- end
- end
- @scene.pbEndBattle(@decision)
- for i in @battlers
- i.pbResetForm
- if i.hasWorkingAbility(:NATURALCURE)
- i.status=0
- end
- end
- for i in $Trainer.party
- i.setItem(i.itemInitial)
- i.itemInitial=i.itemRecycle=0
- i.belch=false
- end
- return @decision
- end
- end
- module PokeBattle_BattleCommon
- def pbThrowPokeBall(idxPokemon,ball,rareness=nil,showplayer=false)
- itemname=PBItems.getName(ball)
- battler=nil
- if pbIsOpposing?(idxPokemon)
- battler=self.battlers[idxPokemon]
- else
- battler=self.battlers[idxPokemon].pbOppositeOpposing
- end
- if battler.isFainted?
- battler=battler.pbPartner
- end
- pbDisplayBrief(_INTL("{1} threw one {2}!",self.pbPlayer.name,itemname))
- if battler.isFainted?
- pbDisplay(_INTL("But there was no target..."))
- return
- end
- if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
- @scene.pbThrowAndDeflect(ball,1)
- pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
- else
- pokemon=battler.pokemon
- species=pokemon.species
- if $DEBUG && Input.press?(Input::CTRL)
- shakes=4
- else
- if !rareness
- dexdata=pbOpenDexData
- pbDexDataOffset(dexdata,species,16)
- rareness=dexdata.fgetb # Get rareness from dexdata file
- dexdata.close
- end
- a=battler.totalhp
- b=battler.hp
- rareness=BallHandlers.modifyCatchRate(ball,rareness,self,battler)
- x=(((a*3-b*2)*rareness)/(a*3)).floor
- if battler.status==PBStatuses::SLEEP || battler.status==PBStatuses::FROZEN
- x=(x*2.5).floor
- elsif battler.status!=0
- x=(x*1.5).floor
- end
- c=0
- if $Trainer
- if $Trainer.pokedexOwned>600
- c=(x*2.5/6).floor
- elsif $Trainer.pokedexOwned>450
- c=(x*2/6).floor
- elsif $Trainer.pokedexOwned>300
- c=(x*1.5/6).floor
- elsif $Trainer.pokedexOwned>150
- c=(x*1/6).floor
- elsif $Trainer.pokedexOwned>30
- c=(x*0.5/6).floor
- end
- end
- #===============================================================================
- # Birthsign - The Hunter
- # Increases the capture rate by 20% if leading the party.
- # #TAG19
- #===============================================================================
- if $Trainer.party[0].hasNovBirthsign? && BIRTHSIGNS_SET_2
- x=(x*3/2.5).floor
- #x=(x*255).floor #Makes catch rate 100%. Used for testing.
- end
- #===============================================================================
- shakes=0; critical=false
- if x>255 || BallHandlers.isUnconditional?(ball,self,battler)
- shakes=4
- else
- x=1 if x<1
- y = ( 65536 / ((255.0/x)**0.1875) ).floor
- if USECRITICALCAPTURE && pbRandom(256)<c
- critical=true
- shakes=4 if pbRandom(65536)<y
- else
- shakes+=1 if pbRandom(65536)<y
- shakes+=1 if pbRandom(65536)<y && shakes==1
- shakes+=1 if pbRandom(65536)<y && shakes==2
- shakes+=1 if pbRandom(65536)<y && shakes==3
- end
- end
- end
- PBDebug.log("[Threw Poké Ball] #{itemname}, #{shakes} shakes (4=capture)")
- @scene.pbThrow(ball,(critical) ? 1 : shakes,critical,battler.index,showplayer)
- case shakes
- when 0
- pbDisplay(_INTL("Oh no! The Pokémon broke free!"))
- BallHandlers.onFailCatch(ball,self,battler)
- when 1
- pbDisplay(_INTL("Aww... It appeared to be caught!"))
- BallHandlers.onFailCatch(ball,self,battler)
- when 2
- pbDisplay(_INTL("Aargh! Almost had it!"))
- BallHandlers.onFailCatch(ball,self,battler)
- when 3
- pbDisplay(_INTL("Gah! It was so close, too!"))
- BallHandlers.onFailCatch(ball,self,battler)
- when 4
- pbDisplayBrief(_INTL("Gotcha! {1} was caught!",pokemon.name))
- @scene.pbThrowSuccess
- if pbIsSnagBall?(ball) && @opponent
- pbRemoveFromParty(battler.index,battler.pokemonIndex)
- battler.pbReset
- battler.participants=[]
- else
- @decision=4
- end
- if pbIsSnagBall?(ball)
- pokemon.ot=self.pbPlayer.name
- pokemon.trainerID=self.pbPlayer.id
- end
- BallHandlers.onCatch(ball,self,pokemon)
- pokemon.ballused=pbGetBallType(ball)
- pokemon.makeUnmega rescue nil
- pokemon.makeUnprimal rescue nil
- pokemon.pbRecordFirstMoves
- if GAINEXPFORCAPTURE
- battler.captured=true
- pbGainEXP
- battler.captured=false
- end
- if !self.pbPlayer.hasOwned?(species)
- self.pbPlayer.setOwned(species)
- if $Trainer.pokedex
- pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.",pokemon.name))
- @scene.pbShowPokedex(species)
- end
- end
- @scene.pbHideCaptureBall
- if pbIsSnagBall?(ball) && @opponent
- pokemon.pbUpdateShadowMoves rescue nil
- @snaggedpokemon.push(pokemon)
- else
- pbStorePokemon(pokemon)
- end
- end
- end
- end
- end
- #########[SECTION 8]##########
- #===============================================================================
- # PC Modifications - Debug Menu
- #===============================================================================
- # Allows the debug tool to let you change birthsigns while in the PC.
- # Overwrites sections in PScreen_Storage.
- # #TAG12
- #===============================================================================
- class PokemonStorageScreen
- def debugMenu(selected,pkmn,heldpoke)
- command=0
- loop do
- command=@scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),[
- _INTL("Level"),
- _INTL("Species"),
- _INTL("Moves"),
- _INTL("Gender"),
- _INTL("Ability"),
- _INTL("Nature"),
- _INTL("Birthsign"),
- _INTL("Shininess"),
- _INTL("Form"),
- _INTL("Happiness"),
- _INTL("EV/IV/pID"),
- _INTL("Pokérus"),
- _INTL("Ownership"),
- _INTL("Nickname"),
- _INTL("Poké Ball"),
- _INTL("Ribbons"),
- _INTL("Egg"),
- _INTL("Shadow Pokémon"),
- _INTL("Make Mystery Gift"),
- _INTL("Duplicate"),
- _INTL("Delete"),
- _INTL("Cancel")
- ],command)
- case command
- ### Cancel ###
- when -1, 21
- break
- ### Level ###
- when 0
- params=ChooseNumberParams.new
- params.setRange(1,PBExperience::MAXLEVEL)
- params.setDefaultValue(pkmn.level)
- level=Kernel.pbMessageChooseNumber(
- _INTL("Set the Pokémon's level (max. {1}).",PBExperience::MAXLEVEL),params)
- if level!=pkmn.level
- pkmn.level=level
- pkmn.calcStats
- pbDisplay(_INTL("{1}'s level was set to {2}.",pkmn.name,pkmn.level))
- @scene.pbHardRefresh
- end
- ### Species ###
- when 1
- species=pbChooseSpecies(pkmn.species)
- if species!=0
- oldspeciesname=PBSpecies.getName(pkmn.species)
- pkmn.species=species
- pkmn.calcStats
- oldname=pkmn.name
- pkmn.name=PBSpecies.getName(pkmn.species) if pkmn.name==oldspeciesname
- pbDisplay(_INTL("{1}'s species was changed to {2}.",oldname,PBSpecies.getName(pkmn.species)))
- pbSeenForm(pkmn)
- @scene.pbHardRefresh
- end
- ### Moves ###
- when 2
- cmd=0
- loop do
- cmd=@scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),[
- _INTL("Teach move"),
- _INTL("Forget move"),
- _INTL("Reset movelist"),
- _INTL("Reset initial moves")],cmd)
- # Break
- if cmd==-1
- break
- # Teach move
- elsif cmd==0
- move=pbChooseMoveList
- if move!=0
- pbLearnMove(pkmn,move)
- @scene.pbHardRefresh
- end
- # Forget Move
- elsif cmd==1
- pbChooseMove(pkmn,1,2)
- if pbGet(1)>=0
- pbDeleteMove(pkmn,pbGet(1))
- pbDisplay(_INTL("{1} forgot {2}.",pkmn.name,pbGet(2)))
- @scene.pbHardRefresh
- end
- # Reset Movelist
- elsif cmd==2
- pkmn.resetMoves
- pbDisplay(_INTL("{1}'s moves were reset.",pkmn.name))
- @scene.pbHardRefresh
- # Reset initial moves
- elsif cmd==3
- pkmn.pbRecordFirstMoves
- pbDisplay(_INTL("{1}'s moves were set as its first-known moves.",pkmn.name))
- @scene.pbHardRefresh
- end
- end
- ### Gender ###
- when 3
- if pkmn.gender==2
- pbDisplay(_INTL("{1} is genderless.",pkmn.name))
- else
- cmd=0
- loop do
- oldgender=(pkmn.isMale?) ? _INTL("male") : _INTL("female")
- msg=[_INTL("Gender {1} is natural.",oldgender),
- _INTL("Gender {1} is being forced.",oldgender)][pkmn.genderflag ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Make male"),
- _INTL("Make female"),
- _INTL("Remove override")],cmd)
- # Break
- if cmd==-1
- break
- # Make male
- elsif cmd==0
- pkmn.setGender(0)
- if pkmn.isMale?
- pbDisplay(_INTL("{1} is now male.",pkmn.name))
- else
- pbDisplay(_INTL("{1}'s gender couldn't be changed.",pkmn.name))
- end
- # Make female
- elsif cmd==1
- pkmn.setGender(1)
- if pkmn.isFemale?
- pbDisplay(_INTL("{1} is now female.",pkmn.name))
- else
- pbDisplay(_INTL("{1}'s gender couldn't be changed.",pkmn.name))
- end
- # Remove override
- elsif cmd==2
- pkmn.genderflag=nil
- pbDisplay(_INTL("Gender override removed."))
- end
- pbSeenForm(pkmn)
- @scene.pbHardRefresh
- end
- end
- ### Ability ###
- when 4
- cmd=0
- loop do
- abils=pkmn.getAbilityList
- oldabil=PBAbilities.getName(pkmn.ability)
- commands=[]
- for i in abils
- commands.push((i[1]<2 ? "" : "(H) ")+PBAbilities.getName(i[0]))
- end
- commands.push(_INTL("Remove override"))
- msg=[_INTL("Ability {1} is natural.",oldabil),
- _INTL("Ability {1} is being forced.",oldabil)][pkmn.abilityflag!=nil ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,commands,cmd)
- # Break
- if cmd==-1
- break
- # Set ability override
- elsif cmd>=0 && cmd<abils.length
- pkmn.setAbility(abils[cmd][1])
- # Remove override
- elsif cmd==abils.length
- pkmn.abilityflag=nil
- end
- @scene.pbHardRefresh
- end
- ### Nature ###
- when 5
- cmd=0
- loop do
- oldnature=PBNatures.getName(pkmn.nature)
- commands=[]
- (PBNatures.getCount).times do |i|
- commands.push(PBNatures.getName(i))
- end
- commands.push(_INTL("Remove override"))
- msg=[_INTL("Nature {1} is natural.",oldnature),
- _INTL("Nature {1} is being forced.",oldnature)][pkmn.natureflag ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,commands,cmd)
- # Break
- if cmd==-1
- break
- # Set nature override
- elsif cmd>=0 && cmd<PBNatures.getCount
- pkmn.setNature(cmd)
- pkmn.calcStats
- # Remove override
- elsif cmd==PBNatures.getCount
- pkmn.natureflag=nil
- end
- @scene.pbHardRefresh
- end
- ### Birthsign ###
- when 6
- cmd=0
- if pkmn.isEgg?
- pbDisplay(_INTL("Eggs must be hatched first to inherit a birthsign!"))
- break
- elsif (pkmn.isShadow? rescue false)
- pbDisplay(_INTL("Shadow Pokémon can't have a birthsign!"))
- break
- elsif pkmn.obtainMode==1 || pkmn.hasRibbon?(:SECONDSTEP)
- pbDisplay(_INTL("That Pokémon can't change its birthsign."))
- break
- end
- loop do
- oldsign=PBBirthsigns.getName(pkmn.birthsign)
- commands=[]
- (PBBirthsigns.getCount).times do |i|
- commands.push(PBBirthsigns.getName(i))
- end
- msg=[_INTL("Change birthsigns."),
- _INTL("{1} is active.",oldsign)][pkmn.zodiacflag ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,commands,cmd)
- # Break
- if cmd==-1
- break
- # Set birthsign override
- elsif cmd>=0 && cmd<PBBirthsigns.getCount
- pkmn.setBirthsign(cmd)
- pkmn.calcStats
- # Remove override
- elsif cmd==PBBirthsigns.getCount
- pkmn.zodiacflag=0
- end
- @scene.pbHardRefresh
- end
- ### Shininess ###
- when 7
- cmd=0
- loop do
- oldshiny=(pkmn.isShiny?) ? _INTL("shiny") : _INTL("normal")
- msg=[_INTL("Shininess ({1}) is natural.",oldshiny),
- _INTL("Shininess ({1}) is being forced.",oldshiny)][pkmn.shinyflag!=nil ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Make shiny"),
- _INTL("Make normal"),
- _INTL("Remove override")],cmd)
- # Break
- if cmd==-1
- break
- # Make shiny
- elsif cmd==0
- pkmn.makeShiny
- # Make normal
- elsif cmd==1
- pkmn.makeNotShiny
- # Remove override
- elsif cmd==2
- pkmn.shinyflag=nil
- end
- @scene.pbHardRefresh
- end
- ### Form ###
- when 8
- params=ChooseNumberParams.new
- params.setRange(0,100)
- params.setDefaultValue(pkmn.form)
- f=Kernel.pbMessageChooseNumber(_INTL("Set the Pokémon's form."),params)
- if f!=pkmn.form
- pkmn.form=f
- pbDisplay(_INTL("{1}'s form was set to {2}.",pkmn.name,pkmn.form))
- pbSeenForm(pkmn)
- @scene.pbHardRefresh
- end
- ### Happiness ###
- when 9
- params=ChooseNumberParams.new
- params.setRange(0,255)
- params.setDefaultValue(pkmn.happiness)
- h=Kernel.pbMessageChooseNumber(
- _INTL("Set the Pokémon's happiness (max. 255)."),params)
- if h!=pkmn.happiness
- pkmn.happiness=h
- pbDisplay(_INTL("{1}'s happiness was set to {2}.",pkmn.name,pkmn.happiness))
- @scene.pbHardRefresh
- end
- ### EV/IV/pID ###
- when 10
- stats=[_INTL("HP"),_INTL("Attack"),_INTL("Defense"),
- _INTL("Speed"),_INTL("Sp. Attack"),_INTL("Sp. Defense")]
- cmd=0
- loop do
- persid=sprintf("0x%08X",pkmn.personalID)
- cmd=@scene.pbShowCommands(_INTL("Personal ID is {1}.",persid),[
- _INTL("Set EVs"),
- _INTL("Set IVs"),
- _INTL("Randomise pID")],cmd)
- case cmd
- # Break
- when -1
- break
- # Set EVs
- when 0
- cmd2=0
- loop do
- evcommands=[]
- for i in 0...stats.length
- evcommands.push(stats[i]+" (#{pkmn.ev[i]})")
- end
- cmd2=@scene.pbShowCommands(_INTL("Change which EV?"),evcommands,cmd2)
- if cmd2==-1
- break
- elsif cmd2>=0 && cmd2<stats.length
- params=ChooseNumberParams.new
- params.setRange(0,255)
- params.setDefaultValue(pkmn.ev[cmd2])
- params.setCancelValue(pkmn.ev[cmd2])
- f=Kernel.pbMessageChooseNumber(
- _INTL("Set the EV for {1} (max. 255).",stats[cmd2]),params)
- pkmn.ev[cmd2]=f
- pkmn.calcStats
- @scene.pbHardRefresh
- end
- end
- # Set IVs
- when 1
- cmd2=0
- loop do
- hiddenpower=pbHiddenPower(pkmn.iv)
- msg=_INTL("Hidden Power:\n{1}, power {2}.",PBTypes.getName(hiddenpower[0]),hiddenpower[1])
- ivcommands=[]
- for i in 0...stats.length
- ivcommands.push(stats[i]+" (#{pkmn.iv[i]})")
- end
- ivcommands.push(_INTL("Randomise all"))
- cmd2=@scene.pbShowCommands(msg,ivcommands,cmd2)
- if cmd2==-1
- break
- elsif cmd2>=0 && cmd2<stats.length
- params=ChooseNumberParams.new
- params.setRange(0,31)
- params.setDefaultValue(pkmn.iv[cmd2])
- params.setCancelValue(pkmn.iv[cmd2])
- f=Kernel.pbMessageChooseNumber(
- _INTL("Set the IV for {1} (max. 31).",stats[cmd2]),params)
- pkmn.iv[cmd2]=f
- pkmn.calcStats
- @scene.pbHardRefresh
- elsif cmd2==ivcommands.length-1
- pkmn.iv[0]=rand(32)
- pkmn.iv[1]=rand(32)
- pkmn.iv[2]=rand(32)
- pkmn.iv[3]=rand(32)
- pkmn.iv[4]=rand(32)
- pkmn.iv[5]=rand(32)
- pkmn.calcStats
- @scene.pbHardRefresh
- end
- end
- # Randomise pID
- when 2
- pkmn.personalID=rand(256)
- pkmn.personalID|=rand(256)<<8
- pkmn.personalID|=rand(256)<<16
- pkmn.personalID|=rand(256)<<24
- pkmn.calcStats
- @scene.pbHardRefresh
- end
- end
- ### Pokérus ###
- when 11
- cmd=0
- loop do
- pokerus=(pkmn.pokerus) ? pkmn.pokerus : 0
- msg=[_INTL("{1} doesn't have Pokérus.",pkmn.name),
- _INTL("Has strain {1}, infectious for {2} more days.",pokerus/16,pokerus%16),
- _INTL("Has strain {1}, not infectious.",pokerus/16)][pkmn.pokerusStage]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Give random strain"),
- _INTL("Make not infectious"),
- _INTL("Clear Pokérus")],cmd)
- # Break
- if cmd==-1
- break
- # Give random strain
- elsif cmd==0
- pkmn.givePokerus
- # Make not infectious
- elsif cmd==1
- strain=pokerus/16
- p=strain<<4
- pkmn.pokerus=p
- # Clear Pokérus
- elsif cmd==2
- pkmn.pokerus=0
- end
- end
- ### Ownership ###
- when 12
- cmd=0
- loop do
- gender=[_INTL("Male"),_INTL("Female"),_INTL("Unknown")][pkmn.otgender]
- msg=[_INTL("Player's Pokémon\n{1}\n{2}\n{3} ({4})",pkmn.ot,gender,pkmn.publicID,pkmn.trainerID),
- _INTL("Foreign Pokémon\n{1}\n{2}\n{3} ({4})",pkmn.ot,gender,pkmn.publicID,pkmn.trainerID)
- ][pkmn.isForeign?($Trainer) ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Make player's"),
- _INTL("Set OT's name"),
- _INTL("Set OT's gender"),
- _INTL("Random foreign ID"),
- _INTL("Set foreign ID")],cmd)
- # Break
- if cmd==-1
- break
- # Make player's
- elsif cmd==0
- pkmn.trainerID=$Trainer.id
- pkmn.ot=$Trainer.name
- pkmn.otgender=$Trainer.gender
- # Set OT's name
- elsif cmd==1
- newot=pbEnterPlayerName(_INTL("{1}'s OT's name?",pkmn.name),1,7)
- pkmn.ot=newot
- # Set OT's gender
- elsif cmd==2
- cmd2=@scene.pbShowCommands(_INTL("Set OT's gender."),
- [_INTL("Male"),_INTL("Female"),_INTL("Unknown")])
- pkmn.otgender=cmd2 if cmd2>=0
- # Random foreign ID
- elsif cmd==3
- pkmn.trainerID=$Trainer.getForeignID
- # Set foreign ID
- elsif cmd==4
- params=ChooseNumberParams.new
- params.setRange(0,65535)
- params.setDefaultValue(pkmn.publicID)
- val=Kernel.pbMessageChooseNumber(
- _INTL("Set the new ID (max. 65535)."),params)
- pkmn.trainerID=val
- pkmn.trainerID|=val<<16
- end
- end
- ### Nickname ###
- when 13
- cmd=0
- loop do
- speciesname=PBSpecies.getName(pkmn.species)
- msg=[_INTL("{1} has the nickname {2}.",speciesname,pkmn.name),
- _INTL("{1} has no nickname.",speciesname)][pkmn.name==speciesname ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Rename"),
- _INTL("Erase name")],cmd)
- # Break
- if cmd==-1
- break
- # Rename
- elsif cmd==0
- newname=pbEnterPokemonName(_INTL("{1}'s nickname?",speciesname),0,10,"",pkmn)
- pkmn.name=(newname=="") ? speciesname : newname
- @scene.pbHardRefresh
- # Erase name
- elsif cmd==1
- pkmn.name=speciesname
- end
- end
- ### Poké Ball ###
- when 14
- cmd=0
- loop do
- oldball=PBItems.getName(pbBallTypeToBall(pkmn.ballused))
- commands=[]; balls=[]
- for key in $BallTypes.keys
- item=getID(PBItems,$BallTypes[key])
- balls.push([key,PBItems.getName(item)]) if item && item>0
- end
- balls.sort! {|a,b| a[1]<=>b[1]}
- for i in 0...commands.length
- cmd=i if pkmn.ballused==balls[i][0]
- end
- for i in balls
- commands.push(i[1])
- end
- cmd=@scene.pbShowCommands(_INTL("{1} used.",oldball),commands,cmd)
- if cmd==-1
- break
- else
- pkmn.ballused=balls[cmd][0]
- end
- end
- ### Ribbons ###
- when 15
- cmd=0
- loop do
- commands=[]
- for i in 1..PBRibbons.maxValue
- commands.push(_INTL("{1} {2}",
- pkmn.hasRibbon?(i) ? "[X]" : "[ ]",PBRibbons.getName(i)))
- end
- cmd=@scene.pbShowCommands(_INTL("{1} ribbons.",pkmn.ribbonCount),commands,cmd)
- if cmd==-1
- break
- elsif cmd>=0 && cmd<commands.length
- if pkmn.hasRibbon?(cmd+1)
- pkmn.takeRibbon(cmd+1)
- else
- pkmn.giveRibbon(cmd+1)
- end
- end
- end
- ### Egg ###
- when 16
- cmd=0
- loop do
- msg=[_INTL("Not an egg"),
- _INTL("Egg with eggsteps: {1}.",pkmn.eggsteps)][pkmn.isEgg? ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Make egg"),
- _INTL("Make Pokémon"),
- _INTL("Set eggsteps to 1")],cmd)
- # Break
- if cmd==-1
- break
- # Make egg
- elsif cmd==0
- if pbHasEgg?(pkmn.species) ||
- pbConfirm(_INTL("{1} cannot be an egg. Make egg anyway?",PBSpecies.getName(pkmn.species)))
- pkmn.level=EGGINITIALLEVEL
- pkmn.zodiacflag==0
- pkmn.calcStats
- pkmn.name=_INTL("Egg")
- dexdata=pbOpenDexData
- pbDexDataOffset(dexdata,pkmn.species,21)
- pkmn.eggsteps=dexdata.fgetw
- dexdata.close
- pkmn.hatchedMap=0
- pkmn.obtainMode=1
- @scene.pbHardRefresh
- end
- # Make Pokémon
- elsif cmd==1
- pkmn.name=PBSpecies.getName(pkmn.species)
- pkmn.eggsteps=0
- pkmn.hatchedMap=0
- pkmn.obtainMode=0
- @scene.pbHardRefresh
- # Set eggsteps to 1
- elsif cmd==2
- pkmn.eggsteps=1 if pkmn.eggsteps>0
- end
- end
- ### Shadow Pokémon ###
- when 17
- cmd=0
- loop do
- msg=[_INTL("Not a Shadow Pokémon."),
- _INTL("Heart gauge is {1}.",pkmn.heartgauge)][(pkmn.isShadow? rescue false) ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,[
- _INTL("Make Shadow"),
- _INTL("Lower heart gauge")],cmd)
- # Break
- if cmd==-1
- break
- # Make Shadow
- elsif cmd==0
- if !(pkmn.isShadow? rescue false) && pkmn.respond_to?("makeShadow")
- if pkmn.obtainMode==1
- pbDisplay(_INTL("Pokémon born with a birthsign can't be made into Shadow Pokémon.",pkmn.name))
- else
- pkmn.setBirthsign(0)
- pkmn.makeShadow
- pbDisplay(_INTL("{1} is now a Shadow Pokémon.",pkmn.name))
- end
- @scene.pbHardRefresh
- else
- pbDisplay(_INTL("{1} is already a Shadow Pokémon.",pkmn.name))
- end
- # Lower heart gauge
- elsif cmd==1
- if (pkmn.isShadow? rescue false)
- prev=pkmn.heartgauge
- pkmn.adjustHeart(-700)
- Kernel.pbMessage(_INTL("{1}'s heart gauge was lowered from {2} to {3} (now stage {4}).",
- pkmn.name,prev,pkmn.heartgauge,pkmn.heartStage))
- pbReadyToPurify(pkmn)
- else
- Kernel.pbMessage(_INTL("{1} is not a Shadow Pokémon.",pkmn.name))
- end
- end
- end
- ### Make Mystery Gift ###
- when 18
- pbCreateMysteryGift(0,pkmn)
- ### Duplicate ###
- when 19
- if pbConfirm(_INTL("Are you sure you want to copy this Pokémon?"))
- clonedpkmn=pkmn.clone
- clonedpkmn.iv=pkmn.iv.clone
- clonedpkmn.ev=pkmn.ev.clone
- if @storage.pbMoveCaughtToParty(clonedpkmn)
- if selected[0]!=-1
- pbDisplay(_INTL("The duplicated Pokémon was moved to your party."))
- end
- else
- oldbox=@storage.currentBox
- newbox=@storage.pbStoreCaught(clonedpkmn)
- if newbox<0
- pbDisplay(_INTL("All boxes are full."))
- elsif newbox!=oldbox
- pbDisplay(_INTL("The duplicated Pokémon was moved to box \"{1}.\"",@storage[newbox].name))
- @storage.currentBox=oldbox
- end
- end
- @scene.pbHardRefresh
- break
- end
- ### Delete ###
- when 20
- if pbConfirm(_INTL("Are you sure you want to delete this Pokémon?"))
- @scene.pbRelease(selected,heldpoke)
- if heldpoke
- @heldpkmn=nil
- else
- @storage.pbDelete(selected[0],selected[1])
- end
- @scene.pbRefresh
- pbDisplay(_INTL("The Pokémon was deleted."))
- break
- end
- end
- end
- end
- end
- #===============================================================================
- # PC Modifications - Storage Scene
- #===============================================================================
- # Allows birthsign tokens to be displayed in the PC storage window.
- # Overwrites sections in PScreen_Storage.
- # #TAG14
- #===============================================================================
- class PokemonStorageScene
- def pbUpdateOverlay(selection,party=nil)
- overlay=@sprites["overlay"].bitmap
- overlay.clear
- pokemon=nil
- if @screen.pbHeldPokemon
- pokemon=@screen.pbHeldPokemon
- elsif selection>=0
- pokemon=(party) ? party[selection] : @storage[@storage.currentBox,selection]
- end
- if !pokemon
- @sprites["pokemon"].visible=false
- return
- end
- @sprites["pokemon"].visible=true
- #@sprites["pokemon"].mirror=true #Uncomment this line to mirror sprites.
- speciesname=PBSpecies.getName(pokemon.species)
- itemname="No item"
- if pokemon.item>0
- itemname=PBItems.getName(pokemon.item)
- end
- abilityname="No ability"
- if pokemon.ability>0
- abilityname=PBAbilities.getName(pokemon.ability)
- end
- base=Color.new(88,88,80)
- shadow=Color.new(168,184,184)
- pokename=pokemon.name
- textstrings=[
- [pokename,10,8,false,base,shadow]
- ]
- if !pokemon.isEgg?
- if pokemon.isMale?
- textstrings.push([_INTL("♂"),148,8,false,Color.new(24,112,216),Color.new(136,168,208)])
- elsif pokemon.isFemale?
- textstrings.push([_INTL("♀"),148,8,false,Color.new(248,56,32),Color.new(224,152,144)])
- end
- textstrings.push([_INTL("{1}",pokemon.level),36,234,false,base,shadow])
- textstrings.push([_INTL("{1}",abilityname),85,306,2,base,shadow])
- textstrings.push([_INTL("{1}",itemname),85,342,2,base,shadow])
- end
- pbSetSystemFont(overlay)
- pbDrawTextPositions(overlay,textstrings)
- textstrings.clear
- if !pokemon.isEgg?
- textstrings.push([_INTL("Lv."),10,238,false,base,shadow])
- end
- pbSetSmallFont(overlay)
- pbDrawTextPositions(overlay,textstrings)
- if pokemon.isShiny? && !pokemon.isEgg?
- imagepos=[(["Graphics/Pictures/shiny",12,198,0,0,-1,-1])]
- pbDrawImagePositions(overlay,imagepos)
- end
- #===============================================================================
- # Birthsigns - Token Display Window
- #===============================================================================
- if pokemon.hasBirthsign?
- imagepos=[(["Graphics/Pictures/Birthsigns/Other/storagesign",142,161,0,0,-1,-1])]
- pbDrawImagePositions(overlay,imagepos)
- #===============================================================================
- # Birthsigns - Zodiac Token
- #===============================================================================
- tokenpath1="Graphics/Pictures/Birthsigns/token%02d"
- tokenpath2="Graphics/Pictures/Birthsigns/Birthsigns2/token%02d"
- if pokemon.obtainMode==1
- if !BIRTHSIGNS_SET_2
- zodiactoken=sprintf(tokenpath1,zodiacValue(pokemon.birthsign))
- else
- zodiactoken=sprintf(tokenpath2,zodiacValue(pokemon.birthsign))
- end
- else
- if !BIRTHSIGNS_SET_2
- zodiactoken=sprintf(tokenpath1,PBBirthsigns.signValue(pokemon.birthsign))
- else
- zodiactoken=sprintf(tokenpath2,PBBirthsigns.signValue(pokemon.birthsign))
- end
- end
- imagepos=[([zodiactoken,148,166,0,0,-1,-1])]
- pbDrawImagePositions(overlay,imagepos)
- end
- #===============================================================================
- typebitmap=AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
- type1rect=Rect.new(0,pokemon.type1*28,64,28)
- type2rect=Rect.new(0,pokemon.type2*28,64,28)
- if pokemon.type1==pokemon.type2
- overlay.blt(52,272,typebitmap.bitmap,type1rect)
- else
- overlay.blt(18,272,typebitmap.bitmap,type1rect)
- overlay.blt(88,272,typebitmap.bitmap,type2rect)
- end
- drawMarkings(overlay,66,240,128,20,pokemon.markings)
- @sprites["pokemon"].setPokemonBitmap(pokemon)
- pbPositionPokemonSprite(@sprites["pokemon"],26,70)
- end
- def pbDropDownPartyTab
- begin
- Graphics.update
- Input.update
- @sprites["boxparty"].y-=16
- pbUpdateSpriteHash(@sprites)
- end until @sprites["boxparty"].y<=Graphics.height-352
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement