Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Pokémon Birthsigns - By Lucidious89
- # For -Pokémon Essentials v17-
- #
- #===============================================================================
- # 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 33 unique Birthsigns to choose from that can be grouped into
- # sets of 12 that act as a 12-month zodiac.
- #
- # You can swap between zodiacs by setting the "ZODIACSET" toggle to the desired
- # set number. You may also add a Birthsign to a Pokémon manually through scripts.
- #
- # Use the "WILDBIRTHSIGNS" toggle to give wild Pokemon birthsigns, too.
- #
- #===============================================================================
- # ~Installation~
- #===============================================================================
- # To install, insert a new section above Main, and paste this there. Name
- # this new section whatever you wish. 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
- #
- # And possibly a few others.
- #
- #===============================================================================
- # Add-Ons and optional scripts to further enhance Pokemon Birthsigns:
- #===============================================================================
- # Birthsigns Journal Script : https://pastebin.com/raw/XqQTbPcF
- #
- # Birthsign Events Script : https://pastebin.com/raw/2GKL2P6f
- #
- # Zodiac Powers Script : https://pastebin.com/raw/Vxj8yihR
- #
- # Debug_Pokemon Update : https://pastebin.com/raw/TqG1EtCP
- #
- # Debug_Menu Update : https://pastebin.com/raw/FR4RLhkc
- #===============================================================================
- # Birthsigns graphics & Pokegear Icon:
- # https://www.dropbox.com/sh/kyrxchab1hsu8m5/AAAFVCHiMtsBnkk-zLFiPhAba?dl=0
- #===============================================================================
- #########[SECTION 1 - CUSTOMIZATION]##########
- #===============================================================================
- # Compatibility with other scripts
- #===============================================================================
- SHOW_IV_STARS = false # Shows stars in summary/storage to indicate IV quality
- SHOW_EGG_GROUPS = false # Shows Egg Groups in the summary (Page 2)
- SHOW_SHINY_LEAF = false # Adds HGSS Shiny Leaf functionality
- SHOW_FAMILYTREE = false # Compatibility with FL's 'Family Tree' script
- INCLUDE_ZMOVES = false # Compatibility with AmethystRain's 'Z-Move' scripts
- #===============================================================================
- # Toggles the use and display of Zodiac Powers.
- #===============================================================================
- INCLUDE_ZPOWER = true
- #===============================================================================
- # The switch numbers used for Summons and Celestial Bosses
- #===============================================================================
- BOSS_SWITCH = 109
- SUMMON_SWITCH = 110
- #===============================================================================
- # Toggles birthsigns for wild Pokemon
- #===============================================================================
- # 0 = No signs
- # 1 = Current sign (Based on your active ZODIACSET)
- # 2 = Random Partner/Rival (Based on the current month and active ZODIACSET)
- # 3 = Random zodiac sign (Based on your active ZODIACSET)
- # 4 = Random birthsign (Out of all possible signs)
- #===============================================================================
- WILDBIRTHSIGNS = 0
- #===============================================================================
- # Toggles between different Zodiac Sets
- #===============================================================================
- # 0 = Null Set (No zodiac, but can still give signs through scripts)
- # 1 = Birthsigns Set 1 (Uses signs 1-12 to make a zodiac)
- # 2 = Birthsigns Set 2 (Uses signs 13-24 to make a zodiac)
- # 3 = Randomized Set (Compiles a random zodiac out of all signs)
- # 4+ = Custom Sets (Make your own zodiacs)
- #===============================================================================
- ZODIACSET = 1
- ################################################################################
- ################################################################################
- #===============================================================================
- # Creating a custom zodiac simply requires you to set each month's BIRTHSIGN to
- # a number corresponding to a birthsign. Here's a chart of all the sign numbers:
- #===============================================================================
- # 0 = Void 1 = Apprentice 2 = Companion 3 = Beacon 4 = Savage
- # 5 = Prodigy 6 = Martyr 7 = Maiden 8 = Gladiator 9 = Voyager
- # 10 = Thief 11 = Glutton 12 = Wishmaker 13 = Phoenix 14 = Scholar
- # 15 = Fugitive 16 = Aristocrat 17 = Cleric 18 = Monk 19 = Ancestor
- # 20 = Specialist 21 = Assassin 22 = Parent 23 = Hunter 24 = Eternal
- # 25 = Bard 26 = Empath 27 = Mirror 28 = Tactician 29 = Fool
- # 30 = Alchemist 31 = Vampire 32 = Soulmate 33 = Cultist
- #===============================================================================
- # Custom Set (4)
- #===============================================================================
- if ZODIACSET==4 # Renumber all the zeroes below with your desired sign numbers
- JAN_BIRTHSIGN = 0
- FEB_BIRTHSIGN = 0
- MAR_BIRTHSIGN = 0
- APR_BIRTHSIGN = 0
- MAY_BIRTHSIGN = 0
- JUN_BIRTHSIGN = 0
- JUL_BIRTHSIGN = 0
- AUG_BIRTHSIGN = 0
- SEP_BIRTHSIGN = 0
- OCT_BIRTHSIGN = 0
- NOV_BIRTHSIGN = 0
- DEC_BIRTHSIGN = 0
- end
- ################################################################################
- ################################################################################
- #===============================================================================
- # Null Set (0)
- #===============================================================================
- # Using this set means you won't have any birthsigns in your 12 month zodiac.
- # No Pokemon will naturally inherit any sign through breeding or in the wild.
- # However, you may still manually give Pokemon a sign.
- #===============================================================================
- if ZODIACSET==0
- JAN_BIRTHSIGN = 0
- FEB_BIRTHSIGN = 0
- MAR_BIRTHSIGN = 0
- APR_BIRTHSIGN = 0
- MAY_BIRTHSIGN = 0
- JUN_BIRTHSIGN = 0
- JUL_BIRTHSIGN = 0
- AUG_BIRTHSIGN = 0
- SEP_BIRTHSIGN = 0
- OCT_BIRTHSIGN = 0
- NOV_BIRTHSIGN = 0
- DEC_BIRTHSIGN = 0
- end
- #===============================================================================
- # Birthsigns Set 1 (1)
- #===============================================================================
- # Utilizes the original signs (1-12) to build a zodiac.
- #===============================================================================
- if ZODIACSET==1
- JAN_BIRTHSIGN = 1
- FEB_BIRTHSIGN = 2
- MAR_BIRTHSIGN = 3
- APR_BIRTHSIGN = 4
- MAY_BIRTHSIGN = 5
- JUN_BIRTHSIGN = 6
- JUL_BIRTHSIGN = 7
- AUG_BIRTHSIGN = 8
- SEP_BIRTHSIGN = 9
- OCT_BIRTHSIGN = 10
- NOV_BIRTHSIGN = 11
- DEC_BIRTHSIGN = 12
- end
- #===============================================================================
- # Birthsigns Set 2 (2)
- #===============================================================================
- # Utilizes the second set of signs (13-24) to build a zodiac
- #===============================================================================
- if ZODIACSET==2
- JAN_BIRTHSIGN = 13
- FEB_BIRTHSIGN = 14
- MAR_BIRTHSIGN = 15
- APR_BIRTHSIGN = 16
- MAY_BIRTHSIGN = 17
- JUN_BIRTHSIGN = 18
- JUL_BIRTHSIGN = 19
- AUG_BIRTHSIGN = 20
- SEP_BIRTHSIGN = 21
- OCT_BIRTHSIGN = 22
- NOV_BIRTHSIGN = 23
- DEC_BIRTHSIGN = 24
- end
- #===============================================================================
- # Randomized Set (3)
- #===============================================================================
- # Builds a semi-randomized zodiac out of all possible signs.
- # Ensures no duplicate signs are used, and avoids picking sign 0 (no sign).
- # This set will randomize EACH TIME you load up your game.
- #===============================================================================
- def getSignList(month)
- return [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
- 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33][month-1]
- end
- if ZODIACSET==3 # Zodiac uses random signs
- rndm=rand(32)
- JAN_BIRTHSIGN = getSignList(rndm)
- FEB_BIRTHSIGN = getSignList((rndm+6)%33)
- MAR_BIRTHSIGN = getSignList((rndm+11)%33)
- APR_BIRTHSIGN = getSignList((rndm+2)%33)
- MAY_BIRTHSIGN = getSignList((rndm+8)%33)
- JUN_BIRTHSIGN = getSignList((rndm+3)%33)
- JUL_BIRTHSIGN = getSignList((rndm+7)%33)
- AUG_BIRTHSIGN = getSignList((rndm+4)%33)
- SEP_BIRTHSIGN = getSignList((rndm+10)%33)
- OCT_BIRTHSIGN = getSignList((rndm+1)%33)
- NOV_BIRTHSIGN = getSignList((rndm+9)%33)
- DEC_BIRTHSIGN = getSignList((rndm+5)%33)
- end
- #===============================================================================
- # Birthsign Names
- #===============================================================================
- # You may rename signs here. They will be recognized by the rest of the script.
- #===============================================================================
- BIRTHSIGN_00 = _INTL("'The Void'")
- BIRTHSIGN_01 = _INTL("'The Apprentice'")
- BIRTHSIGN_02 = _INTL("'The Companion'")
- BIRTHSIGN_03 = _INTL("'The Beacon'")
- BIRTHSIGN_04 = _INTL("'The Savage'")
- BIRTHSIGN_05 = _INTL("'The Prodigy'")
- BIRTHSIGN_06 = _INTL("'The Martyr'")
- BIRTHSIGN_07 = _INTL("'The Maiden'")
- BIRTHSIGN_08 = _INTL("'The Gladiator'")
- BIRTHSIGN_09 = _INTL("'The Voyager'")
- BIRTHSIGN_10 = _INTL("'The Thief'")
- BIRTHSIGN_11 = _INTL("'The Glutton'")
- BIRTHSIGN_12 = _INTL("'The Wishmaker'")
- BIRTHSIGN_13 = _INTL("'The Phoenix'")
- BIRTHSIGN_14 = _INTL("'The Scholar'")
- BIRTHSIGN_15 = _INTL("'The Fugitive'")
- BIRTHSIGN_16 = _INTL("'The Aristocrat'")
- BIRTHSIGN_17 = _INTL("'The Cleric'")
- BIRTHSIGN_18 = _INTL("'The Monk'")
- BIRTHSIGN_19 = _INTL("'The Ancestor'")
- BIRTHSIGN_20 = _INTL("'The Specialist'")
- BIRTHSIGN_21 = _INTL("'The Assassin'")
- BIRTHSIGN_22 = _INTL("'The Parent'")
- BIRTHSIGN_23 = _INTL("'The Hunter'")
- BIRTHSIGN_24 = _INTL("'The Eternal'")
- BIRTHSIGN_25 = _INTL("'The Bard'")
- BIRTHSIGN_26 = _INTL("'The Empath'")
- BIRTHSIGN_27 = _INTL("'The Mirror'")
- BIRTHSIGN_28 = _INTL("'The Tactician'")
- BIRTHSIGN_29 = _INTL("'The Fool'")
- BIRTHSIGN_30 = _INTL("'The Alchemist'")
- BIRTHSIGN_31 = _INTL("'The Vampire'")
- BIRTHSIGN_32 = _INTL("'The Soulmate'")
- BIRTHSIGN_33 = _INTL("'The Cultist'")
- #===============================================================================
- # Zodiac Power Names
- #===============================================================================
- # The names for each Zodiac Power's effects in battle.
- #===============================================================================
- def pbGetPowerName(sign)
- return [_INTL("Empty Gesture"), #'The Void'
- _INTL("Understudy"), #'The Apprentice'
- _INTL("Friend Boost"), #'The Companion'
- _INTL("Blinding Light"), #'The Beacon'
- _INTL("Feral Frenzy"), #'The Savage'
- _INTL("Ability Whiz"), #'The Prodigy'
- _INTL("Self Sacrifice"), #'The Martyr'
- _INTL("Beauty Queen"), #'The Maiden'
- _INTL("Battle Cry"), #'The Gladiator'
- _INTL("Tour Guide"), #'The Voyager'
- _INTL("Hit & Run"), #'The Thief'
- _INTL("Pig Out"), #'The Glutton'
- _INTL("Lucky Boost"), #'The Wishmaker'
- _INTL("Last Stand"), #'The Phoenix'
- _INTL("Quick Study"), #'The Scholar'
- _INTL("Escape Artist"), #'The Fugitive'
- _INTL("Market Crash"), #'The Aristocrat'
- _INTL("Great Purge"), #'The Cleric'
- _INTL("Untouchable"), #'The Monk'
- _INTL("Spirit Guard"), #'The Ancestor'
- _INTL("Lock Down"), #'The Specialist'
- _INTL("Ambush"), #'The Assassin'
- _INTL("Bodyguard"), #'The Parent'
- _INTL("Corner Strike"), #'The Hunter'
- _INTL("Lottery"), #'The Eternal'
- _INTL("Stifling Song"), #'The Bard'
- _INTL("Solidarity"), #'The Empath'
- _INTL("Mirror Image"), #'The Mirror'
- _INTL("Table Turn"), #'The Tactician'
- _INTL("Big Gamble"), #'The Fool'
- _INTL("Transmogrify"), #'The Alchemist'
- _INTL("Life Drain"), #'The Vampire'
- _INTL("Star-Crossed"), #'The Soulmate'
- _INTL("Dark Pact")][sign] #'The Cultist'
- end
- # Used to get specific power names for the different effects of Stifling Song
- def pbGetSongName(value)
- return [_INTL("Stifling Song"),
- _INTL("Brittle Ballad"), # Lowers Attack
- _INTL("Silent Serenade"), # Lowers Sp.Atk
- _INTL("Lagging Lullaby")][value] # Lowers Speed
- end
- #===============================================================================
- # Celestial Boss Names
- #===============================================================================
- # The names for each sign's Celestial Boss.
- #===============================================================================
- def pbGetBossName(sign)
- return [_INTL("???"), #'The Void'
- _INTL("Zealos"), #'The Apprentice'
- _INTL("Deliphis"), #'The Companion'
- _INTL("Phobos"), #'The Beacon'
- _INTL("Reivolt"), #'The Savage'
- _INTL("Klevar"), #'The Prodigy'
- _INTL("Mediva"), #'The Martyr'
- _INTL("Damsella"), #'The Maiden'
- _INTL("Bat'aal"), #'The Gladiator'
- _INTL("Ragnarova"), #'The Voyager'
- _INTL("Swyndell"), #'The Thief'
- _INTL("Gorvus"), #'The Glutton'
- _INTL("Alistaar"), #'The Wishmaker'
- _INTL("Ashbeyard"), #'The Phoenix'
- _INTL("Astuvius"), #'The Scholar'
- _INTL("Eluzi"), #'The Fugitive'
- _INTL("Koynn"), #'The Aristocrat'
- _INTL("Quu'ral"), #'The Cleric'
- _INTL("Luminatta"), #'The Monk'
- _INTL("Artu'fak"), #'The Ancestor'
- _INTL("Dopple"), #'The Specialist'
- _INTL("Deimos"), #'The Assassin'
- _INTL("Matria"), #'The Parent'
- _INTL("Maulgriev"), #'The Hunter'
- _INTL("Astrol"), #'The Eternal'
- _INTL("Ballaborg"), #'The Bard'
- _INTL("Sentimus"), #'The Empath'
- _INTL("Xerok"), #'The Mirror'
- _INTL("Griddeous"), #'The Tactician'
- _INTL("Turvii"), #'The Fool'
- _INTL("Boddelgeuz"), #'The Alchemist'
- _INTL("Vladimorg"), #'The Vampire'
- _INTL("Vymm & Vygor"), #'The Soulmate'
- _INTL("Lucifus")][sign] #'The Cultist'
- end
- # Used to get individual boss names for 'The Soulmate' (0 or 1)
- def pbGetDoubleBoss(value)
- return [_INTL("Vymm"),_INTL("Vygor")][value]
- end
- #===============================================================================
- # Birthsign Descriptions
- #===============================================================================
- # Text for each birthsign's effect in the Summary.
- #===============================================================================
- def pbGetZodiacDesc(sign)
- return [_INTL("Unknown."),
- _INTL("The Pokémon gains twice as many EV's from battle."),
- _INTL("Wild encounters share in the Pokémon's increased joy."),
- _INTL("The Pokémon may brighten up dark areas with Starlight."),
- _INTL("The Pokémon has max IV's in offense & speed, but 0 HP."),
- _INTL("The Pokémon may swap to one of its other Abilities."),
- _INTL("The Pokémon may sacrifice HP to Rescue a hurt ally."),
- _INTL("The Pokémon has 150 Sp.Atk EV's. High female ratio."),
- _INTL("The Pokémon has 150 Attack EV's. High male ratio."),
- _INTL("The Pokémon may use the stars to Navigate to safety."),
- _INTL("The Pokémon may find wild Pokémon holding treasure."),
- _INTL("The Pokémon has max IV's in defenses & HP, but 0 speed."),
- _INTL("The Pokémon has higher odds of being shiny."),
- _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 to safety from dungeons."),
- _INTL("The Pokémon may find extra money while leading."),
- _INTL("The Pokémon may sacrifice HP to Cure an ally's status."),
- _INTL("The Pokémon may enter a Trance to relearn moves."),
- _INTL("The Pokémon may pass down its EV's to its progeny."),
- _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 earlier."),
- _INTL("The Pokémon raises capture rates by 20% when leading."),
- _INTL("The Pokémon may begin anew and Reincarnate itself."),
- _INTL("The Pokémon may Harmonize to lure/repel wild Pokémon."),
- _INTL("The Pokémon Bonds with allies & copies their nature."),
- _INTL("The Pokémon may find wild Pokémon with similar IV's."),
- _INTL("The Pokémon may use a Gambit to reallocate its EV's."),
- _INTL("The Pokémon may give away its levels with Lunacy."),
- _INTL("Items may be Transmuted by utilizing Stardust."),
- _INTL("Walking at night heals the Pokémon. Daylight burns."),
- _INTL("Wild Pokémon may share compatible partner signs."),
- _INTL("The Pokemon may Summon by sacrificing its stats.")][sign]
- end
- #===============================================================================
- # Birthsign Values
- #===============================================================================
- # The name and numbers that represent each birthsign.
- #===============================================================================
- module PBBirthsigns
- SIGN00 = 0 #'The Void'
- SIGN01 = 1 #'The Apprentice'
- SIGN02 = 2 #'The Companion'
- SIGN03 = 3 #'The Beacon'
- SIGN04 = 4 #'The Savage'
- SIGN05 = 5 #'The Prodigy'
- SIGN06 = 6 #'The Martyr'
- SIGN07 = 7 #'The Maiden'
- SIGN08 = 8 #'The Gladiator'
- SIGN09 = 9 #'The Voyager'
- SIGN10 = 10 #'The Thief'
- SIGN11 = 11 #'The Glutton'
- SIGN12 = 12 #'The Wishmaker'
- SIGN13 = 13 #'The Phoenix'
- SIGN14 = 14 #'The Scholar'
- SIGN15 = 15 #'The Fugitive'
- SIGN16 = 16 #'The Aristocrat'
- SIGN17 = 17 #'The Cleric'
- SIGN18 = 18 #'The Monk'
- SIGN19 = 19 #'The Ancestor'
- SIGN20 = 20 #'The Specialist'
- SIGN21 = 21 #'The Assassin'
- SIGN22 = 22 #'The Parent'
- SIGN23 = 23 #'The Hunter'
- SIGN24 = 24 #'The Eternal'
- SIGN25 = 25 #'The Bard'
- SIGN26 = 26 #'The Empath'
- SIGN27 = 27 #'The Mirror'
- SIGN28 = 28 #'The Tactician'
- SIGN29 = 29 #'The Fool'
- SIGN30 = 30 #'The Alchemist'
- SIGN31 = 31 #'The Vampire'
- SIGN32 = 32 #'The Soulmate'
- SIGN33 = 33 #'The Cultist'
- end
- def PBBirthsigns.maxValue; 33; end
- def PBBirthsigns.getCount; 34; end
- def PBBirthsigns.signValue(id)
- return (id)%34
- end
- def PBBirthsigns.getName(id)
- names=[
- BIRTHSIGN_00, #'The Void'
- BIRTHSIGN_01, #'The Apprentice'
- BIRTHSIGN_02, #'The Companion'
- BIRTHSIGN_03, #'The Beacon'
- BIRTHSIGN_04, #'The Savage'
- BIRTHSIGN_05, #'The Prodigy'
- BIRTHSIGN_06, #'The Martyr'
- BIRTHSIGN_07, #'The Maiden'
- BIRTHSIGN_08, #'The Gladiator'
- BIRTHSIGN_09, #'The Voyager'
- BIRTHSIGN_10, #'The Thief'
- BIRTHSIGN_11, #'The Glutton'
- BIRTHSIGN_12, #'The Wishmaker'
- BIRTHSIGN_13, #'The Phoenix'
- BIRTHSIGN_14, #'The Scholar'
- BIRTHSIGN_15, #'The Fugitive'
- BIRTHSIGN_16, #'The Aristocrat'
- BIRTHSIGN_17, #'The Cleric'
- BIRTHSIGN_18, #'The Monk'
- BIRTHSIGN_19, #'The Ancestor'
- BIRTHSIGN_20, #'The Specialist'
- BIRTHSIGN_21, #'The Assassin'
- BIRTHSIGN_22, #'The Parent'
- BIRTHSIGN_23, #'The Hunter'
- BIRTHSIGN_24, #'The Eternal'
- BIRTHSIGN_25, #'The Bard'
- BIRTHSIGN_26, #'The Empath'
- BIRTHSIGN_27, #'The Mirror'
- BIRTHSIGN_28, #'The Tactician'
- BIRTHSIGN_29, #'The Fool'
- BIRTHSIGN_30, #'The Alchemist'
- BIRTHSIGN_31, #'The Vampire'
- BIRTHSIGN_32, #'The Soulmate'
- BIRTHSIGN_33 #'The Cultist'
- ]
- return names[id]
- end
- # Used for Debug
- def pbChooseBirthsignList(default=0)
- commands = []
- for i in 1..PBBirthsigns.maxValue
- cname = getConstantName(PBBirthsigns,i) rescue nil
- commands.push([i,PBBirthsigns.getName(i)]) if cname
- end
- return pbChooseList(commands,default,-1)
- end
- #===============================================================================
- # Zodiac Values
- #===============================================================================
- # The name and numbers that represent each zodiac sign.
- #===============================================================================
- module PBZodiacsigns
- JAN = 1
- FEB = 2
- MAR = 3
- APR = 4
- MAY = 5
- JUN = 6
- JUL = 7
- AUG = 8
- SEP = 9
- OCT = 10
- NOV = 11
- DEC = 12
- end
- def PBZodiacsigns.maxValue; 12; end
- def PBZodiacsigns.getCount; 13; end
- def PBZodiacsigns.signValue(id)
- return (id)%13
- end
- def PBZodiacsigns.getName(id)
- names=[
- _INTL("-Clear Sign-"),
- PBBirthsigns.getName(JAN_BIRTHSIGN),
- PBBirthsigns.getName(FEB_BIRTHSIGN),
- PBBirthsigns.getName(MAR_BIRTHSIGN),
- PBBirthsigns.getName(APR_BIRTHSIGN),
- PBBirthsigns.getName(MAY_BIRTHSIGN),
- PBBirthsigns.getName(JUN_BIRTHSIGN),
- PBBirthsigns.getName(JUL_BIRTHSIGN),
- PBBirthsigns.getName(AUG_BIRTHSIGN),
- PBBirthsigns.getName(SEP_BIRTHSIGN),
- PBBirthsigns.getName(OCT_BIRTHSIGN),
- PBBirthsigns.getName(NOV_BIRTHSIGN),
- PBBirthsigns.getName(DEC_BIRTHSIGN)
- ]
- return names[id]
- end
- # Used for debug
- def pbChooseZodiacList(default=0)
- commands = []
- for i in 1..PBZodiacsigns.maxValue
- cname = getConstantName(PBZodiacsigns,i) rescue nil
- commands.push([i,PBZodiacsigns.getName(i)]) if cname
- end
- return pbChooseList(commands,default,-1)
- end
- #########[SECTION 2 - METHODS]##########
- #===============================================================================
- # Birthsign Checks
- #===============================================================================
- # Returns true if the Pokemon has any birthsign
- def hasBirthsign?
- if !(self.isShadow? rescue false) && !egg?
- if birthsign>0
- return true
- end
- end
- end
- # Returns true if the Pokemon has a zodiac sign
- def hasZodiacsign?
- if !(self.isShadow? rescue false) && !egg?
- if monthsign!=nil
- return true
- end
- end
- end
- #===============================================================================
- # Month Checks
- #===============================================================================
- # January
- def hasJanBirthsign?
- if birthsign==JAN_BIRTHSIGN
- return true
- end
- end
- # February
- def hasFebBirthsign?
- if birthsign==FEB_BIRTHSIGN
- return true
- end
- end
- # March
- def hasMarBirthsign?
- if birthsign==MAR_BIRTHSIGN
- return true
- end
- end
- # April
- def hasAprBirthsign?
- if birthsign==APR_BIRTHSIGN
- return true
- end
- end
- # May
- def hasMayBirthsign?
- if birthsign==MAY_BIRTHSIGN
- return true
- end
- end
- # June
- def hasJunBirthsign?
- if birthsign==JUN_BIRTHSIGN
- return true
- end
- end
- # July
- def hasJulBirthsign?
- if birthsign==JUL_BIRTHSIGN
- return true
- end
- end
- # August
- def hasAugBirthsign?
- if birthsign==AUG_BIRTHSIGN
- return true
- end
- end
- # September
- def hasSepBirthsign?
- if birthsign==SEP_BIRTHSIGN
- return true
- end
- end
- # October
- def hasOctBirthsign?
- if birthsign==OCT_BIRTHSIGN
- return true
- end
- end
- # November
- def hasNovBirthsign?
- if birthsign==NOV_BIRTHSIGN
- return true
- end
- end
- # December
- def hasDecBirthsign?
- if birthsign==DEC_BIRTHSIGN
- return true
- end
- end
- #===============================================================================
- # Relative Sign Checks
- #===============================================================================
- # Returns true if the Pokemon has the zodiac sign relative to the current month
- def hasCurrentsign?
- return true if getCalendarsign==Time.now.mon
- end
- # Returns true if a Pokemon has the Rival sign relative to (value)
- # Note: Don't set (value) to a Pokemon, use phShareRivalsign? instead
- def hasRivalsign?(value)
- return true if monthsign==zodiacOpposite(value-1)
- end
- # Returns true if a Pokemon has a Partner sign relative to (value)
- # Note: Don't set (value) to a Pokemon, use phSharePartnersign? instead
- def hasPartnersign?(value)
- value-=1
- return true if monthsign==(value+4)%12
- return true if monthsign==(value+8)%12
- end
- #===============================================================================
- # Sign Sharing Checks
- #===============================================================================
- # Returns true if pkmn1 and pkmn2 share a birthsign
- def pbShareBirthsign?(pkmn1,pkmn2)
- if pkmn1.birthsign==pkmn2.birthsign
- return true
- end
- end
- # Returns true if pkmn1 and pkmn2 share a zodiac sign
- def pbShareZodiacsign?(pkmn1,pkmn2)
- if pkmn1.monthsign==pkmn2.monthsign
- return true
- end
- end
- # Returns true if pkmn1 and pkmn2 share a Rival sign
- def pbShareRivalsign?(pkmn1,pkmn2)
- if pkmn1.monthsign==zodiacOpposite(pkmn2.monthsign)
- return true
- end
- end
- # Returns true if pkmn1 and pkmn2 share a Partner sign
- def pbSharePartnersign?(pkmn1,pkmn2)
- return true if pkmn1.monthsign==(pkmn2.monthsign+4)%12
- return true if pkmn1.monthsign==(pkmn2.monthsign+8)%12
- end
- #===============================================================================
- # Checking for a particular sign
- #===============================================================================
- # Returns the calander month number associated with a Pokemon's zodiac sign
- def getCalendarsign
- if monthsign!=nil
- return (1+monthsign)
- end
- end
- # Returns the calander month number associated with a Pokemon's rival sign
- def getRivalsign
- return (1+zodiacOpposite(self.monthsign))
- end
- # Returns the calander month numbers associated with a Pokemon's partner signs
- # Note: Set (num) to 1 or 2 to get the first or second partner, respectively
- def getPartnersign(num)
- return (1+((self.monthsign+4)%12)) if num==1
- return (1+((self.monthsign+8)%12)) if num==2
- end
- #===============================================================================
- # Checks for a particular sign number from a list
- #===============================================================================
- # Returns the internal month number for each zodiac sign
- def monthsign
- if hasJanBirthsign?
- return 0
- elsif hasFebBirthsign?
- return 1
- elsif hasMarBirthsign?
- return 2
- elsif hasAprBirthsign?
- return 3
- elsif hasMayBirthsign?
- return 4
- elsif hasJunBirthsign?
- return 5
- elsif hasJulBirthsign?
- return 6
- elsif hasAugBirthsign?
- return 7
- elsif hasSepBirthsign?
- return 8
- elsif hasOctBirthsign?
- return 9
- elsif hasNovBirthsign?
- return 10
- elsif hasDecBirthsign?
- return 11
- else
- return nil
- end
- end
- # Returns the birthsign number of a particular month's zodiac sign
- def getZodiacList(month)
- return [JAN_BIRTHSIGN,FEB_BIRTHSIGN,MAR_BIRTHSIGN,APR_BIRTHSIGN,MAY_BIRTHSIGN,
- JUN_BIRTHSIGN,JUL_BIRTHSIGN,AUG_BIRTHSIGN,SEP_BIRTHSIGN,OCT_BIRTHSIGN,
- NOV_BIRTHSIGN,DEC_BIRTHSIGN][month-1]
- end
- # Returns a zodiac gem out of a list, relative to (month) (0-11)
- def getZodiacGem(month)
- return [:JANZODICA,:FEBZODICA,:MARZODICA,:APRIZODICA,:MAYZODICA,:JUNZODICA,
- :JULZODICA,:AUGZODICA,:SEPZODICA,:OCTZODICA,:NOVIZODICA,:DECIZODICA][month]
- end
- #===============================================================================
- # Miscellaneous
- #===============================================================================
- # Returns true if the current day is the user's birthday. (Hatched Pokemon)
- def isBirthday?
- # Determines the current date
- year=Time.now.year
- month=Time.now.mon
- day=Time.now.day
- # Determines date of birth
- birthyear=timeEggHatched.year
- birthmonth=timeEggHatched.mon
- birthday=timeEggHatched.day
- # Determines if there is a match
- if obtainMode==1
- if (birthmonth==month) && (birthday==day) && (birthyear<year)
- return true
- end
- end
- end
- # Returns true if the current day is the anniversary of the Player's start time.
- def pbAnniversaryCheck
- # Determines the current date
- year=Time.now.year
- month=Time.now.mon
- day=Time.now.day
- # Determines date of start time
- startyear=$PokemonGlobal.startTime.year
- startmonth=$PokemonGlobal.startTime.mon
- startday=$PokemonGlobal.startTime.day
- # Determines if there is a match
- if (startmonth==month) && (startday==day) && (startyear<year)
- return true
- end
- end
- # Returns the name of a Pokemon's birthsign
- def pbGetBirthsignName
- PBBirthsigns.getName(self.birthsign)
- end
- # Returns the description of a Pokemon's birthsign effect (Summary)
- def pbGetBirthsignDesc
- pbGetZodiacDesc(self.birthsign)
- end
- # Returns the range of the zodiac month
- def pbLastMonthDay
- if hasZodiacsign?
- if hasFebBirthsign?
- return _INTL("1st - 28th")
- elsif hasAprBirthsign? ||
- hasJunBirthsign? ||
- hasSepBirthsign? ||
- hasNovBirthsign?
- return _INTL("1st - 30th")
- else
- return _INTL("1st - 31st")
- end
- else
- return _INTL("Unknown")
- end
- end
- # Resets celestial boss counter
- def pbBossCountReset
- for i in 0..12
- $Trainer.celestialcheck[i]=nil
- end
- end
- #===============================================================================
- # Zodiac Gems
- #===============================================================================
- # Defines Zodiac Gems as an item type
- def pbIsZodiacGem?(item)
- return $ItemData[item] && $ItemData[item][ITEMTYPE]==15
- end
- # Allows Zodiac Gems to be used by Fling
- class PokeBattle_Move_0F7 < PokeBattle_Move
- def pbMoveFailed(attacker,opponent)
- return true if attacker.item==0 ||
- @battle.pbIsUnlosableItem(attacker,attacker.item) ||
- pbIsPokeBall?(attacker.item) ||
- @battle.field.effects[PBEffects::MagicRoom]>0 ||
- attacker.hasWorkingAbility(:KLUTZ) ||
- attacker.effects[PBEffects::Embargo]>0
- for i in flingarray.keys
- if flingarray[i]
- for j in flingarray[i]
- return false if isConst?(attacker.item,PBItems,j)
- end
- end
- end
- return false if pbIsBerry?(attacker.item) &&
- !attacker.pbOpposing1.hasWorkingAbility(:UNNERVE) &&
- !attacker.pbOpposing2.hasWorkingAbility(:UNNERVE)
- return false if pbIsMegaStone?(attacker.item) && !pbIsUnlosableItem(attacker,item)
- return false if pbIsZodiacGem?(attacker.item)
- return true
- end
- def pbBaseDamage(basedmg,attacker,opponent)
- return 10 if pbIsBerry?(attacker.item)
- return 80 if pbIsMegaStone?(attacker.item) || pbIsZodiacGem?(attacker.item)
- for i in flingarray.keys
- if flingarray[i]
- for j in flingarray[i]
- return i if isConst?(attacker.item,PBItems,j)
- end
- end
- end
- return 1
- end
- end
- #===============================================================================
- # Birthsign Bonuses - Passive Effects
- #===============================================================================
- def applyBirthsignBonuses
- if hasBirthsign?
- # The Void
- if birthsign==0
- @shinyflag=nil
- @abilityflag=nil
- @genderflag=nil
- @zodiacflag=0
- end
- # The Companion
- if birthsign==2
- @happiness=@happiness*2
- end
- # The Savage
- if birthsign==4
- @iv[0]=0
- @iv[1]=31
- @iv[3]=31
- @iv[4]=31
- end
- # The Maiden
- if birthsign==7
- @ev=[0,0,0,0,150,0]
- if isSingleGendered?
- genderflag = nil
- elsif rand(100)<75 || $DEBUG
- makeFemale
- end
- end
- # The Gladiator
- if birthsign==8
- @ev=[0,150,0,0,0,0]
- if isSingleGendered?
- genderflag = nil
- elsif rand(100)<75 || $DEBUG
- makeMale
- end
- end
- # The Glutton
- if birthsign==11
- @iv[0]=31
- @iv[2]=31
- @iv[3]=0
- @iv[5]=31
- end
- # The Wishmaker
- if birthsign==12
- if (!isShiny? && rand(512)<1) || $DEBUG
- makeShiny
- end
- end
- end
- end
- #########[SECTION 3 - CORE MECHANICS]##########
- #===============================================================================
- # New Zodiac
- #===============================================================================
- # Overwrites the default zodiac in PField_Time.
- #===============================================================================
- def zodiac(month,day)
- time=[
- 1,1,1,31,
- 2,1,2,28,
- 3,1,3,31,
- 4,1,4,30,
- 5,1,5,31,
- 6,1,6,30,
- 7,1,7,31,
- 8,1,8,31,
- 9,1,9,30,
- 10,1,10,31,
- 11,1,11,30,
- 12,1,12,31
- ]
- 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
- #===============================================================================
- # Implementing Pokemon Flags - Birthsigns, Blessed, Celestial, Shiny Leaf
- #===============================================================================
- # The core components that the rest of the Birthsigns script is built on.
- # Overwrite sections in PokeBattle_Pokemon.
- #===============================================================================
- class PokeBattle_Pokemon
- attr_accessor(:zodiacflag)
- attr_accessor(:leafflag)
- attr_accessor(:celestial)
- attr_accessor(:blessed)
- #===============================================================================
- # Defining Blessed Pokemon
- #===============================================================================
- # Flags a Pokemon as blessed
- def makeBlessed
- if self.hasBirthsign?
- self.blessed=true
- end
- end
- # Unflags a Pokemon's blessing
- def makeUnblessed
- self.blessed=false
- end
- # Determines if the Pokemon is blessed
- def isBlessed?
- if self.blessed
- return true
- end
- end
- #===============================================================================
- # Defining Celestial Pokemon
- #===============================================================================
- # Makes a Pokemon into a Celestial species
- def makeCelestial
- if hasBirthsign?
- self.celestial=true
- self.makeBlessed
- self.form=30
- end
- end
- # Removes the Celestial flag from a Pokemon
- def removeCelestial
- self.celestial=false
- self.blessed=false
- self.form=0
- end
- # Determines whether a Pokemon is a Celestial species
- def isCelestial?
- if self.celestial
- return true
- end
- end
- #===============================================================================
- # Defining & Setting Birthsigns
- #===============================================================================
- # Defines birthsigns
- def birthsign
- return @zodiacflag if @zodiacflag!=nil
- return @personalID%34
- end
- # Sets a specific birthsign on a Pokemon (0-34)
- def setBirthsign(value)
- if !(self.isShadow? rescue false) && !egg? && !isBlessed?
- if value.is_a?(String) || value.is_a?(Symbol)
- value=getID(PBBirthsigns,value)
- end
- if value!=nil
- @zodiacflag=value
- applyBirthsignBonuses
- self.calcStats
- end
- else
- return false
- end
- end
- # Sets a random birthsign on a Pokemon (1-33)
- def setRandomsign
- randsign=(1+rand(33))
- setBirthsign(randsign)
- end
- # Sets a specific zodiac sign on a Pokemon (1-12)
- def setZodiacsign(value)
- if !(self.isShadow? rescue false) && !egg? && !isBlessed?
- if value.is_a?(String) || value.is_a?(Symbol)
- value=getID(PBZodiacsigns,value)
- end
- if value!=nil
- @zodiacflag=getZodiacList(value)
- applyBirthsignBonuses
- self.calcStats
- end
- else
- return false
- end
- end
- # Sets a random zodiac sign on a Pokemon
- def setRandomZodiac
- randsign=(1+rand(11))
- setZodiacsign(randsign)
- end
- # Sets a rival sign on a Pokemon relative to (value)
- def setRivalsign(value)
- if !(self.isShadow? rescue false) && !egg? && !isBlessed?
- if value.is_a?(String) || value.is_a?(Symbol)
- value=getID(PBZodiacsigns,value)
- end
- if value!=nil
- @zodiacflag=getZodiacList((value+6)%12)
- applyBirthsignBonuses
- self.calcStats
- end
- else
- return false
- end
- end
- # Sets a particular partner sign (num) on a Pokemon relative to (value)
- def setPartnersign(value,num=nil)
- if !(self.isShadow? rescue false) && !egg? && !isBlessed?
- if value.is_a?(String) || value.is_a?(Symbol)
- value=getID(PBZodiacsigns,value)
- end
- if value!=nil
- randsign=rand(10)
- case num
- when nil,0
- if randsign>5
- @zodiacflag=getZodiacList((value+4)%12)
- else
- @zodiacflag=getZodiacList((value+8)%12)
- end
- when 1
- @zodiacflag=getZodiacList((value+4)%12)
- when 2
- @zodiacflag=getZodiacList((value+8)%12)
- end
- applyBirthsignBonuses
- self.calcStats
- end
- else
- return false
- end
- end
- #===============================================================================
- # Defining Shiny Leaf
- #===============================================================================
- # Defines shiny leaf
- def shinyleaf
- return @leafflag if @leafflag!=nil
- end
- # Sets a number of shiny leaves on a Pokemon. 6 leaves make a crown.
- def setShinyLeaf(value)
- if !egg?
- @leafflag=value
- end
- end
- # Adds 1 shiny leaf to a Pokemon's total, up to 6.
- def addShinyLeaf
- if !egg?
- if @leafflag==nil
- setShinyLeaf(0)
- elsif @leafflag<0
- @leafflag+=-@leafflag
- end
- if @leafflag<6
- @leafflag+=1
- end
- end
- end
- # Subtracts 1 shiny leaf from a Pokemon's total, down to 0.
- def removeShinyLeaf
- if @leafflag==nil
- setShinyLeaf(0)
- elsif @leafflag>6
- @leafflag-=self.leafflag
- @leafflag+=6
- end
- if @leafflag>0
- @leafflag-=1
- end
- end
- # Checks to see if the Pokemon has a leaf crown.
- def hasLeafCrown?
- if @leafflag==6 || @leafflag>6
- return true
- end
- end
- #===============================================================================
- alias birthsign_initialize initialize
- def initialize(*args)
- birthsign_initialize(*args)
- #===========================================================================
- # Newly generated Pokemon have all flags set to neutral
- #===========================================================================
- @zodiacflag = 0
- @leafflag = 0
- @celestial = false
- @blessed = false
- #===========================================================================
- end
- end
- #===============================================================================
- # Birthsigns for Player and Trainers
- #===============================================================================
- class PokeBattle_Trainer
- attr_accessor(:zodiacflag)
- attr_accessor(:blessed)
- attr_accessor(:celestialcheck)
- #===============================================================================
- # Blessed Trainer Signs
- #===============================================================================
- def makeBlessed
- if self.birthsign>0
- self.blessed=true
- end
- end
- def makeUnblessed
- self.blessed=false
- end
- def isBlessed?
- if self.blessed
- return true
- end
- end
- #===============================================================================
- # Defining Trainer Signs
- #===============================================================================
- def birthsign
- return @zodiacflag if @zodiacflag!=nil
- end
- def setBirthsign(value)
- if !isBlessed?
- if value.is_a?(String) || value.is_a?(Symbol)
- value=getID(PBBirthsigns,value)
- end
- if value!=0 || value!=nil
- @zodiacflag=value
- end
- end
- end
- def setRandomsign
- randsign=(1+rand(33))
- setBirthsign(randsign)
- end
- def setZodiacsign(value)
- if !isBlessed?
- if value.is_a?(String) || value.is_a?(Symbol)
- value=getID(PBZodiacsigns,value)
- end
- if value!=0 || value!=nil
- @zodiacflag=getZodiacList(value)
- end
- end
- end
- def setRandomZodiac
- randsign=rand(12)
- setZodiacsign(randsign)
- end
- def setRivalsign(value)
- if !isBlessed?
- if value.is_a?(String) || value.is_a?(Symbol)
- value=getID(PBZodiacsigns,value)
- end
- if value!=0 || value!=nil
- @zodiacflag=getZodiacList((value+6)%12)
- end
- end
- end
- def setPartnersign(value,num=nil)
- if !isBlessed?
- if value.is_a?(String) || value.is_a?(Symbol)
- value=getID(PBZodiacsigns,value)
- end
- if value!=0 || value!=nil
- randsign=rand(10)
- case num
- when nil,0
- if randsign>5
- @zodiacflag=getZodiacList((value+4)%12)
- else
- @zodiacflag=getZodiacList((value+8)%12)
- end
- when 1
- @zodiacflag=getZodiacList((value+4)%12)
- when 2
- @zodiacflag=getZodiacList((value+8)%12)
- end
- end
- end
- end
- # Checks for any birthsign
- def hasBirthsign?
- if birthsign>0
- return true
- end
- end
- # Checks for any zodiac sign
- def hasZodiacsign?
- if monthsign!=nil
- return true
- end
- end
- # Trainer sign is set to adventure start month by default
- alias birthsign_initialize initialize
- def initialize(name,trainertype)
- birthsign_initialize(name,trainertype)
- @zodiacflag=$PokemonGlobal.startTime.mon
- @blessed=false
- @celestialcheck=[]
- for i in 0..12
- @celestialcheck[i]=nil
- end
- end
- end
- #===============================================================================
- # Trainer Card
- #===============================================================================
- # Display's the trainer's birthsign on their trainer card.
- #===============================================================================
- class PokemonTrainerCard_Scene
- alias birthsigns_TrainerCard pbDrawTrainerCardFront
- def pbDrawTrainerCardFront
- birthsigns_TrainerCard
- #===========================================================================
- # Birthsign Token graphic
- #===========================================================================
- overlay = @sprites["overlay"].bitmap
- imagePositions = []
- tokenpath1="Graphics/Pictures/Birthsigns/token%02d"
- tokenpath2="Graphics/Pictures/Birthsigns/bless_token%02d"
- if $Trainer.isBlessed?
- zodiactoken=sprintf(tokenpath2,PBBirthsigns.signValue($Trainer.birthsign))
- else
- zodiactoken=sprintf(tokenpath1,PBBirthsigns.signValue($Trainer.birthsign))
- end
- imagePositions.push([zodiactoken,425,251,0,0,-1,-1])
- #===========================================================================
- pbDrawImagePositions(overlay,imagePositions)
- end
- end
- #########[SECTION 4 - COMMAND SKILLS]##########
- #===============================================================================
- # Ritual Animation. Same as the Hidden Moves animation, with new graphics.
- #===============================================================================
- def pbRitualAnimation(pokemon)
- return false if !pokemon
- viewport=Viewport.new(0,0,0,0)
- viewport.z=99999
- bg=Sprite.new(viewport)
- bg.bitmap=BitmapCache.load_bitmap("Graphics/Pictures/Birthsigns/Other/ritualbg")
- sprite=PokemonSprite.new(viewport)
- sprite.setOffset(PictureOrigin::Center)
- sprite.setPokemonBitmap(pokemon)
- sprite.z=1
- sprite.visible=false
- strobebitmap=AnimatedBitmap.new("Graphics/Pictures/Birthsigns/Other/ritualStrobes")
- strobes=[]
- 15.times do |i|
- strobe=BitmapSprite.new(26*2,8*2,viewport)
- strobe.bitmap.blt(0,0,strobebitmap.bitmap,Rect.new(0,(i%2)*8*2,26*2,8*2))
- strobe.z=((i%2)==0 ? 2 : 0)
- strobe.visible=false
- strobes.push(strobe)
- end
- strobebitmap.dispose
- interp=RectInterpolator.new(
- Rect.new(0,Graphics.height/2,Graphics.width,0),
- Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),
- 10)
- ptinterp=nil
- phase=1
- frames=0
- begin
- Graphics.update
- Input.update
- sprite.update
- case phase
- when 1 # Expand viewport height from zero to full
- interp.update
- interp.set(viewport.rect)
- bg.oy=(bg.bitmap.height-viewport.rect.height)/2
- if interp.done?
- phase=2
- ptinterp=PointInterpolator.new(
- Graphics.width+(sprite.bitmap.width/2),bg.bitmap.height/2,
- Graphics.width/2,bg.bitmap.height/2,
- 16)
- end
- when 2 # Slide Pokémon sprite in from right to centre
- ptinterp.update
- sprite.x=ptinterp.x
- sprite.y=ptinterp.y
- sprite.visible=true
- if ptinterp.done?
- phase=3
- pbPlayCry(pokemon)
- frames=0
- end
- when 3 # Wait
- frames+=1
- if frames>30
- phase=4
- ptinterp=PointInterpolator.new(
- Graphics.width/2,bg.bitmap.height/2,
- -(sprite.bitmap.width/2),bg.bitmap.height/2,
- 16)
- frames=0
- end
- when 4 # Slide Pokémon sprite off from centre to left
- ptinterp.update
- sprite.x=ptinterp.x
- sprite.y=ptinterp.y
- if ptinterp.done?
- phase=5
- sprite.visible=false
- interp=RectInterpolator.new(
- Rect.new(0,(Graphics.height-bg.bitmap.height)/2,Graphics.width,bg.bitmap.height),
- Rect.new(0,Graphics.height/2,Graphics.width,0),
- 10)
- end
- when 5 # Shrink viewport height from full to zero
- interp.update
- interp.set(viewport.rect)
- bg.oy=(bg.bitmap.height-viewport.rect.height)/2
- phase=6 if interp.done?
- end
- for strobe in strobes
- strobe.ox=strobe.viewport.rect.x
- strobe.oy=strobe.viewport.rect.y
- if !strobe.visible
- randomY=16*(1+rand(bg.bitmap.height/16-2))
- strobe.y=randomY+(Graphics.height-bg.bitmap.height)/2
- strobe.x=rand(Graphics.width)
- strobe.visible=true
- elsif strobe.x<Graphics.width
- strobe.x+=32
- else
- randomY=16*(1+rand(bg.bitmap.height/16-2))
- strobe.y=randomY+(Graphics.height-bg.bitmap.height)/2
- strobe.x=-strobe.bitmap.width-rand(Graphics.width/4)
- end
- end
- pbUpdateSceneMap
- end while phase!=6
- sprite.dispose
- for strobe in strobes
- strobe.dispose
- end
- strobes.clear
- bg.dispose
- viewport.dispose
- return true
- end
- #===============================================================================
- # Birthsigns - Command & Event Resets
- #===============================================================================
- # Counts steps to reset certain birthsign effects.
- #===============================================================================
- class PokemonGlobalMetadata
- attr_accessor :resetBirthsignHarmonize
- attr_accessor :resetBirthsignIncubate
- attr_accessor :resetFortuneTeller
- attr_accessor :fortuneEqual
- attr_accessor :fortuneBad
- attr_accessor :fortuneGood
- alias new_initialize initialize
- def initialize
- new_initialize
- @resetBirthsignHarmonize = 0
- @resetBirthsignIncubate = 0
- @resetFortuneTeller = 0
- @fortuneEqual = false
- @fortuneBad = false
- @fortuneGood = false
- end
- end
- Events.onStepTaken+=proc {|sender,e|
- if $PokemonGlobal.resetBirthsignHarmonize && $PokemonGlobal.resetBirthsignHarmonize>0
- $PokemonGlobal.resetBirthsignHarmonize -= 1
- end
- if $PokemonGlobal.resetBirthsignIncubate && $PokemonGlobal.resetBirthsignIncubate>0
- $PokemonGlobal.resetBirthsignIncubate -= 1
- end
- if $PokemonGlobal.resetFortuneTeller && $PokemonGlobal.resetFortuneTeller>0
- $PokemonGlobal.resetFortuneTeller -= 1
- end
- }
- #===============================================================================
- # Sets the step counter for 'The Parent' to 1,000 steps on use.
- #===============================================================================
- def pbCanUseBirthsignIncubate?
- return true if $DEBUG && Input.press?(Input::CTRL)
- if $PokemonGlobal.resetBirthsignIncubate && $PokemonGlobal.resetBirthsignIncubate>0
- return false
- end
- return true
- end
- def pbUseBirthsignEffectIncubate
- if pbCanUseBirthsignIncubate?
- $PokemonGlobal.resetBirthsignIncubate = 1000
- return true
- end
- return false
- end
- #===============================================================================
- # Sets the step counter for 'The Bard' to 400 steps on use.
- #===============================================================================
- def pbCanUseBirthsignHarmonize?
- return true if $DEBUG && Input.press?(Input::CTRL)
- if $PokemonGlobal.resetBirthsignHarmonize && $PokemonGlobal.resetBirthsignHarmonize>0
- return false
- end
- return true
- end
- def pbUseBirthsignEffectHarmonize
- if pbCanUseBirthsignHarmonize?
- $PokemonGlobal.resetBirthsignHarmonize = 400
- return true
- end
- return false
- end
- #===============================================================================
- # Sets the step counter for the Fortune Teller effect to 2,500 steps on use.
- #===============================================================================
- def pbFortuneEffectActive?
- if $PokemonGlobal.resetFortuneTeller && $PokemonGlobal.resetFortuneTeller>0
- return true
- else
- return false
- end
- end
- def pbActivateFortuneEffect
- $PokemonGlobal.resetFortuneTeller = 2500
- end
- #===============================================================================
- # Birthsign Command Checks
- #===============================================================================
- # Returns true if the user has a particular command through a birthsign.
- # Used to eliminate redundant commands.
- #===============================================================================
- # The Beacon
- def hasStarlightCmd?
- if hasZodiacsign? && birthsign==3
- return true
- end
- end
- # The Martyr
- def hasRescueCmd?
- if hasZodiacsign? && birthsign==6
- return true
- end
- end
- # The Voyager
- def hasNavigateCmd?
- if hasZodiacsign? && birthsign==9
- return true
- end
- end
- # The Fugitive
- def hasEscapeCmd?
- if hasZodiacsign? && birthsign==15
- return true
- end
- end
- # The Bard
- def hasHarmonizeCmd?
- if hasZodiacsign? && birthsign==25
- return true
- end
- end
- #===============================================================================
- # Birthsign Commands
- #===============================================================================
- # This section overwrites the section in PScreen_Party that creates command
- # menu options.
- #===============================================================================
- class Window_CommandPokemonColor < Window_CommandPokemon
- def drawItem(index,count,rect)
- pbSetSystemFont(self.contents) if @starting
- rect = drawCursor(index,rect)
- base = self.baseColor
- shadow = self.shadowColor
- if @colorKey[index] && @colorKey[index]==1
- base = Color.new(0,80,160)
- shadow = Color.new(128,192,240)
- end
- #===========================================================================
- # Color coats birthsign commands
- #===========================================================================
- # Colors usable commands purple
- if @colorKey[index] && @colorKey[index]==2
- base = Color.new(149,33,246)
- shadow = Color.new(261,161,326)
- end
- # Colors unusable commands grey
- if @colorKey[index] && @colorKey[index]==3
- base = Color.new(184,184,184)
- shadow = Color.new(96,96,96)
- end
- #===========================================================================
- pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,@commands[index],base,shadow)
- end
- end
- class PokemonPartyScreen
- 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(false,-1,1)
- break if (pkmnid.is_a?(Numeric) && pkmnid<0) || (pkmnid.is_a?(Array) && pkmnid[1]<0)
- if pkmnid.is_a?(Array) && pkmnid[0]==1 # Switch
- @scene.pbSetHelpText(_INTL("Move to where?"))
- oldpkmnid = pkmnid[1]
- pkmnid = @scene.pbChoosePokemon(true,-1,2)
- if pkmnid>=0 && pkmnid!=oldpkmnid
- pbSwitch(oldpkmnid,pkmnid)
- end
- next
- end
- pkmn = @party[pkmnid]
- commands = []
- cmdSummary = -1
- cmdDebug = -1
- cmdMoves = [-1,-1,-1,-1]
- cmdSwitch = -1
- cmdMail = -1
- cmdItem = -1
- #=========================================================================
- # Celestial Commands
- #=========================================================================
- cmdBlessing = -1
- #=========================================================================
- # Birthsigns Commands
- #=========================================================================
- cmdStarlight = -1
- cmdAbilitySwap = -1
- cmdRescue = -1
- cmdNavigate = -1
- cmdRebirth = -1
- cmdEscape = -1
- cmdCure = -1
- cmdTrance = -1
- cmdInherit = -1
- cmdIncubate = -1
- cmdReroll = -1
- cmdReincarnate = -1
- cmdHarmonize = -1
- cmdBond = -1
- cmdGambit = -1
- cmdLunacy = -1
- cmdTransmute = -1
- cmdSummon = -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.egg? &&
- #=====================================================================
- # 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,:CHATTER) ||
- #=====================================================================
- # Unsupported commands as of Essentials v17.
- # 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.hasStarlightCmd?) ||
- # The Martyr
- (isConst?(move.id,PBMoves,:SOFTBOILED) && !pkmn.hasRescueCmd?) ||
- # The Voyager
- (isConst?(move.id,PBMoves,:TELEPORT) && !pkmn.hasNavigateCmd?) ||
- # The Fugitive
- (isConst?(move.id,PBMoves,:DIG) && !pkmn.hasEscapeCmd?) ||
- # The Bard
- (isConst?(move.id,PBMoves,:SWEETSCENT) && !pkmn.hasHarmonizeCmd?))
- #=====================================================================
- commands[cmdMoves[i] = commands.length] = [PBMoves.getName(move.id),1]
- end
- end
- # Pokemon Following compatibility
- if defined? pbToggleFollowingPokemon
- follower=($game_player.pbHasDependentEvents? && !$game_switches[Following_Activated_Switch])
- else
- follower=$game_player.pbHasDependentEvents?
- end
- #=========================================================================
- # Celestial Pokemon - Blessing Command
- #=========================================================================
- if pkmn.hasBirthsign? && pkmn.isCelestial?
- if $Trainer.party.length<=1
- commands[cmdBlessing = commands.length] = [_INTL("Blessing"),3]
- else
- commands[cmdBlessing = commands.length] = [_INTL("Blessing"),2]
- end
- end
- #=========================================================================
- # Birthsign Commands
- #=========================================================================
- # The Beacon
- if pkmn.hasBirthsign? && pkmn.birthsign==3
- if !pbGetMetadata($game_map.map_id,MetadataDarkMap) || $PokemonGlobal.flashUsed
- commands[cmdStarlight = commands.length] = [_INTL("Starlight"),3]
- else
- commands[cmdStarlight = commands.length] = [_INTL("Starlight"),2]
- end
- end
- # The Prodigy
- abils=pkmn.getAbilityList
- if pkmn.hasBirthsign? && pkmn.birthsign==5 && abils.length>1
- commands[cmdAbilitySwap = commands.length] = [_INTL("Ability Swap"),2]
- end
- # The Martyr
- if pkmn.hasBirthsign? && pkmn.birthsign==6
- if pkmn.hp<=(pkmn.totalhp/5).floor || $Trainer.party.length<=1
- commands[cmdRescue = commands.length] = [_INTL("Rescue"),3]
- else
- commands[cmdRescue = commands.length] = [_INTL("Rescue"),2]
- end
- end
- # The Voyager
- if pkmn.hasBirthsign? && pkmn.birthsign==9
- if !pbGetMetadata($game_map.map_id,MetadataOutdoor) || follower
- commands[cmdNavigate = commands.length] = [_INTL("Navigate"),3]
- else
- commands[cmdNavigate = commands.length] = [_INTL("Navigate"),2]
- end
- end
- # The Phoenix
- if pkmn.hasBirthsign? && pkmn.birthsign==13
- if !pkmn.fainted?
- commands[cmdRebirth = commands.length] = [_INTL("Rebirth"),3]
- else
- commands[cmdRebirth = commands.length] = [_INTL("Rebirth"),2]
- end
- end
- # The Fugitive
- if pkmn.hasBirthsign? && pkmn.birthsign==15
- escape=($PokemonGlobal.escapePoint rescue nil)
- outdoors=pbGetMetadata($game_map.map_id,MetadataOutdoor)
- if !escape || escape==[] || outdoors || follower
- commands[cmdEscape = commands.length] = [_INTL("Escape"),3]
- else
- commands[cmdEscape = commands.length] = [_INTL("Escape"),2]
- end
- end
- # The Cleric
- if pkmn.hasBirthsign? && pkmn.birthsign==17
- if pkmn.hp<=(pkmn.totalhp/5).floor || $Trainer.party.length<=1
- commands[cmdCure = commands.length] = [_INTL("Cure"),3]
- else
- commands[cmdCure = commands.length] = [_INTL("Cure"),2]
- end
- end
- # The Monk
- if pkmn.hasBirthsign? && pkmn.birthsign==18
- if pbGetRelearnableMoves(pkmn).length<=0
- commands[cmdTrance = commands.length] = [_INTL("Trance"),3]
- else
- commands[cmdTrance = commands.length] = [_INTL("Trance"),2]
- end
- end
- # The Ancestor
- dexdata=pbOpenDexData
- pbDexDataOffset(dexdata,pkmn.species,31)
- compat10=dexdata.fgetb
- compat11=dexdata.fgetb
- if pkmn.hasBirthsign? && pkmn.birthsign==19 && (pkmn.isCelestial? || compat10==0)
- totalev=0
- for k in 0...6
- totalev+=pkmn.ev[k]
- end
- if totalev==0 || pkmn.fainted?
- commands[cmdInherit = commands.length] = [_INTL("Inherit"),3]
- else
- commands[cmdInherit = commands.length] = [_INTL("Inherit"),2]
- end
- end
- # The Specialist
- if pkmn.hasBirthsign? && pkmn.birthsign==20
- if pkmn.fainted?
- commands[cmdReroll = commands.length] = [_INTL("Re-roll"),3]
- else
- commands[cmdReroll = commands.length] = [_INTL("Re-roll"),2]
- end
- end
- # The Parent
- if pkmn.hasBirthsign? && pkmn.birthsign==22
- if $Trainer.party.length<=1 || !pbCanUseBirthsignIncubate?
- commands[cmdIncubate = commands.length] = [_INTL("Incubate"),3]
- else
- commands[cmdIncubate = commands.length] = [_INTL("Incubate"),2]
- end
- end
- # The Eternal
- if pkmn.hasBirthsign? && pkmn.birthsign==24
- if pkmn.hasCurrentsign? && !pkmn.isCelestial
- commands[cmdReincarnate = commands.length] = [_INTL("Reincarnate"),3]
- else
- commands[cmdReincarnate = commands.length] = [_INTL("Reincarnate"),2]
- end
- end
- # The Bard
- if pkmn.hasBirthsign? && pkmn.birthsign==25
- if !pbCanUseBirthsignHarmonize? || $game_screen.weather_type!=PBFieldWeather::None ||
- !$PokemonEncounters.isEncounterPossibleHere?
- commands[cmdHarmonize = commands.length] = [_INTL("Harmonize"),3]
- else
- commands[cmdHarmonize = commands.length] = [_INTL("Harmonize"),2]
- end
- end
- # The Empath
- if pkmn.hasBirthsign? && pkmn.birthsign==26
- if $Trainer.party.length<=1
- commands[cmdBond = commands.length] = [_INTL("Bond"),3]
- else
- commands[cmdBond = commands.length] = [_INTL("Bond"),2]
- end
- end
- # The Tactician
- if pkmn.hasBirthsign? && pkmn.birthsign==28
- totalev=0
- for k in 0...6
- totalev+=pkmn.ev[k]
- end
- if totalev!=PokeBattle_Pokemon::EVLIMIT || pkmn.fainted?
- commands[cmdGambit = commands.length] = [_INTL("Gambit"),3]
- else
- commands[cmdGambit = commands.length] = [_INTL("Gambit"),2]
- end
- end
- # The Fool
- if pkmn.hasBirthsign? && pkmn.birthsign==29
- if pkmn.level<5 || pkmn.fainted? || $Trainer.party.length<=1
- commands[cmdLunacy = commands.length] = [_INTL("Lunacy"),3]
- else
- commands[cmdLunacy = commands.length] = [_INTL("Lunacy"),2]
- end
- end
- # The Alchemist
- if pkmn.hasBirthsign? && pkmn.birthsign==30
- if !pkmn.hasItem? || !$PokemonBag.pbHasItem?(:STARDUST)
- commands[cmdTransmute = commands.length] = [_INTL("Transmute"),3]
- else
- commands[cmdTransmute = commands.length] = [_INTL("Transmute"),2]
- end
- end
- # The Cultist
- totalIVs=(pkmn.iv[0]+pkmn.iv[1]+pkmn.iv[2]+pkmn.iv[3]+pkmn.iv[4]+pkmn.iv[5])
- if pkmn.hasBirthsign? && pkmn.birthsign==33
- if (!PBDayNight.isNight? && !$DEBUG) || totalIVs==0 || follower
- commands[cmdSummon = commands.length] = [_INTL("Summon"),3]
- else
- commands[cmdSummon = commands.length] = [_INTL("Summon"),2]
- end
- end
- #=========================================================================
- commands[cmdSwitch = commands.length] = _INTL("Switch") if @party.length>1
- if !pkmn.egg?
- 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)
- amt = [(pkmn.totalhp/5).floor,1].max
- if pkmn.hp<=amt
- 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]
- movename = PBMoves.getName(pkmn.moves[i].id)
- if pkmnid==oldpkmnid
- pbDisplay(_INTL("{1} can't use {2} on itself!",pkmn.name,movename))
- elsif newpkmn.egg?
- pbDisplay(_INTL("{1} can't be used on an Egg!",movename))
- elsif newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp
- pbDisplay(_INTL("{1} can't be used on that Pokémon.",movename))
- else
- pkmn.hp -= amt
- hpgain = pbItemRestoreHP(newpkmn,amt)
- @scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",newpkmn.name,hpgain))
- pbRefresh
- end
- break if pkmn.hp<=amt
- end
- @scene.pbSelect(oldpkmnid)
- pbRefresh
- break
- elsif Kernel.pbCanUseHiddenMove?(pkmn,pkmn.moves[i].id)
- if Kernel.pbConfirmUseHiddenMove(pkmn,pkmn.moves[i].id)
- @scene.pbEndScene
- if isConst?(pkmn.moves[i].id,PBMoves,:FLY)
- scene = PokemonRegionMap_Scene.new(-1,false)
- screen = PokemonRegionMapScreen.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]
- end
- else
- break
- end
- end
- end
- next if havecommand
- if cmdSummary>=0 && command==cmdSummary
- @scene.pbSummary(pkmnid)
- elsif cmdDebug>=0 && command==cmdDebug
- pbPokemonDebug(pkmn,pkmnid)
- 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
- #===============================================================================
- # Celestial Pokemon
- # Blessing Skill effect: Bestows the user's birthsign onto other party members.
- #===============================================================================
- elsif cmdBlessing>=0 && command==cmdBlessing
- if $Trainer.party.length<=1
- Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
- elsif !pkmn.hasBirthsign?
- Kernel.pbMessage(_INTL("Doesn't have a birthsign to bestow!"))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s power?",pkmn.name))
- Kernel.pbMessage(_INTL("Choose a Pokémon for {1} to bless.",pkmn.name))
- @scene.pbSetHelpText(_INTL("Bless with 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 bless itself!",pkmn.name))
- elsif newpkmn.egg?
- Kernel.pbMessage(_INTL("This power cannot be used on eggs!"))
- elsif (newpkmn.isShadow? rescue false)
- Kernel.pbMessage(_INTL("Shadow Pokémon cannot be blessed."))
- elsif newpkmn.isCelestial?
- Kernel.pbMessage(_INTL("Celestial Pokémon cannot be blessed."))
- elsif pbShareBirthsign?(pkmn,newpkmn)
- Kernel.pbMessage(_INTL("{1} already has that birthsign!",newpkmn.name))
- elsif newpkmn.isBlessed?
- Kernel.pbMessage(_INTL("{1} has already been blessed!",newpkmn.name))
- else
- if newpkmn.hasBirthsign?
- Kernel.pbMessage(_INTL("Using this power on {1} will replace its current birthsign, and prevent it from receiving another blessing.",newpkmn.name))
- pbWait(10)
- if Kernel.pbConfirmMessage(_INTL("Are you sure you want to bless {1}?",newpkmn.name))
- pbRitualAnimation(pkmn)
- pbWait(1)
- Kernel.pbMessage(_INTL("{1} lost the power of <c2=65467b14>{2}</c2>...",newpkmn.name,newpkmn.pbGetBirthsignName))
- Kernel.pbMessage(_INTL("And..."))
- newpkmn.setBirthsign(pkmn.birthsign)
- newpkmn.makeBlessed
- pbRefresh
- pbMEPlay("Evolution success")
- Kernel.pbMessage(_INTL("\\se[]{1} was blessed with the power of <c2=65467b14>{2}</c2>!\\wt[80]",
- newpkmn.name,newpkmn.pbGetBirthsignName))
- pbWait(2)
- end
- else
- Kernel.pbMessage(_INTL("Once blessed, {1} won't be able to receive another blessing.",newpkmn.name))
- if Kernel.pbConfirmMessage(_INTL("Are you sure you want to bless {1}?",newpkmn.name))
- pbRitualAnimation(pkmn)
- newpkmn.setBirthsign(pkmn.birthsign)
- newpkmn.makeBlessed
- pbRefresh
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1} was blessed with the power of <c2=65467b14>{2}</c2>!",
- newpkmn.name,newpkmn.pbGetBirthsignName))
- pbWait(2)
- end
- end
- end
- break
- end
- pbRefresh
- end
- end
- #===============================================================================
- # Birthsigns - The Beacon
- # Starlight Skill effect: Mimics the effect of 'Flash'.
- #===============================================================================
- elsif cmdStarlight>=0 && command==cmdStarlight
- if !pbGetMetadata($game_map.map_id,MetadataDarkMap) || $PokemonGlobal.flashUsed
- Kernel.pbMessage(_INTL("It's already well-lit here!"))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- @scene.pbEndScene
- darkness=$PokemonTemp.darknessSprite
- return false if !darkness || darkness.disposed?
- if !pbRitualAnimation(pkmn)
- Kernel.pbMessage(_INTL("A twinkling starlight surrounded {1}!",pkmn.name))
- end
- $PokemonGlobal.flashUsed=true
- pbWait(1)
- pbSEPlay("Vs flash")
- Kernel.pbMessage(_INTL("{1} brightened the area by using the power of <c2=65467b14>{2}</c2>!",
- pkmn.name,pkmn.pbGetBirthsignName))
- pbWait(2)
- while darkness.radius<176
- Graphics.update
- Input.update
- pbUpdateSceneMap
- darkness.radius+=4
- end
- pbRefresh
- break
- end
- end
- #===============================================================================
- # Birthsigns - The Prodigy
- # Ability Swap Skill effect: Swaps to another of the users's Abilities.
- #===============================================================================
- elsif cmdAbilitySwap>=0 && command==cmdAbilitySwap
- abils=pkmn.getAbilityList
- oldabil=PBAbilities.getName(pkmn.ability)
- if abils.length<=1
- Kernel.pbMessage(_INTL("But {1} only has the {2} ability!",
- pkmn.name,PBAbilities.getName(pkmn.ability)))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("Choose an ability to swap to."))
- cmd=0
- loop do
- commands=[]
- for i in abils
- commands.push((i[1]<2 ? "" : "(H) ")+PBAbilities.getName(i[0]))
- end
- commands.push(_INTL("Cancel"))
- msg=[_INTL("Active ability: \n{1}",oldabil),
- _INTL("Active ability: \n{1}",oldabil)][pkmn.abilityflag!=nil ? 1 : 0]
- cmd=@scene.pbShowCommands(msg,commands,cmd)
- break if cmd==-1
- if cmd>=0 && cmd<abils.length
- pkmn.setAbility(abils[cmd][1])
- pbRitualAnimation(pkmn)
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1} swapped abilities with the power of <c2=65467b14>{2}</c2>!",
- pkmn.name,pkmn.pbGetBirthsignName))
- pbWait(2)
- break
- end
- end
- end
- pbRefresh
- end
- #===============================================================================
- # Birthsigns - The Martyr
- # Rescue Skill effect: Mimics the effect of 'Soft-Boiled'.
- #===============================================================================
- elsif cmdRescue>=0 && command==cmdRescue
- if $Trainer.party.length<=1
- Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
- elsif pkmn.hp<=(pkmn.totalhp/5).floor
- Kernel.pbMessage(_INTL("{1} is too weak to rescue its allies!",pkmn.name))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- pbRitualAnimation(pkmn)
- Kernel.pbMessage(_INTL("Choose a Pokémon for {1} to rescue.",pkmn.name))
- @scene.pbSetHelpText(_INTL("Rescue 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 rescue itself!",pkmn.name))
- elsif newpkmn.egg?
- Kernel.pbMessage(_INTL("This power can't be used on eggs!"))
- elsif newpkmn.hp==0
- Kernel.pbMessage(_INTL("It's too late to rescue that Pokémon..."))
- elsif newpkmn.hp==newpkmn.totalhp
- Kernel.pbMessage(_INTL("That Pokémon doesn't need rescuing!"))
- else
- pkmn.hp-=(pkmn.totalhp/5).floor
- hpgain=pbItemRestoreHP(newpkmn,(pkmn.totalhp/5).floor)
- pbRefresh
- pbWait(1)
- pbMEPlay("Pkmn get")
- @scene.pbDisplay(_INTL("{1}'s HP was restored by the power of <c2=65467b14>{2}</c2>!",
- newpkmn.name,pkmn.pbGetBirthsignName))
- pbWait(20)
- end
- break if pkmn.hp<=(pkmn.totalhp/5).floor
- end
- pbRefresh
- end
- end
- #===============================================================================
- # Birthsigns - The Voyager
- # Navigate Skill effect: Mimics the effect of 'Teleport'.
- #===============================================================================
- elsif cmdNavigate>=0 && command==cmdNavigate
- if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
- Kernel.pbMessage(_INTL("{1} can't find any stars to navigate with in here!",pkmn.name))
- elsif follower
- Kernel.pbMessage(_INTL("This power can't be used when you have someone with you."))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- healing=$PokemonGlobal.healingSpot
- if !healing
- healing=pbGetMetadata(0,MetadataHome) # Home
- elsif healing
- mapname=pbGetMapNameFromId(healing[0])
- if Kernel.pbConfirmMessage(_INTL("Navigate to <c2=65467b14>{1}</c2>?",mapname))
- @scene.pbEndScene
- if !pbRitualAnimation(pkmn)
- pbWait(1)
- Kernel.pbMessage(_INTL("{1} led you to safety!",pkmn.name))
- end
- pbFadeOutIn(99999){
- pbSEPlay("Battle flee")
- 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
- pbWait(2)
- Kernel.pbMessage(_INTL("You returned to <c2=65467b14>{1}</c2> using the power of <c2=65467b14>{2}</c2>!",
- 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 !pkmn.fainted?
- Kernel.pbMessage(_INTL("{1} has no need for this power right now.",pkmn.name))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- hpgain=pbItemRestoreHP(pkmn,pkmn.totalhp/16.floor+1)
- pbRefresh
- pbRitualAnimation(pkmn)
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1} was revived by the power of <c2=65467b14>{2}</c2>!",
- pkmn.name,pkmn.pbGetBirthsignName))
- pbWait(2)
- end
- pbRefresh
- end
- #===============================================================================
- # Birthsigns - The Fugitive
- # Escape Skill effect: Mimics the effects of 'Dig' or 'Escape Rope'.
- #===============================================================================
- elsif cmdEscape>=0 && command==cmdEscape
- escape=($PokemonGlobal.escapePoint rescue nil)
- outdoors=pbGetMetadata($game_map.map_id,MetadataOutdoor)
- if !escape || escape==[] || outdoors
- Kernel.pbMessage(_INTL("But there's no where to escape to!"))
- elsif follower
- Kernel.pbMessage(_INTL("This power can't be used when you have someone with you."))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- mapname=pbGetMapNameFromId(escape[0])
- if Kernel.pbConfirmMessage(_INTL("Escape to <c2=65467b14>{1}</c2>?",mapname))
- if escape
- @scene.pbEndScene
- if !pbRitualAnimation(pkmn)
- pbWait(1)
- Kernel.pbMessage(_INTL("{1} led you to safety!",pkmn.name))
- end
- pbFadeOutIn(99999){
- pbSEPlay("Door exit")
- 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
- pbWait(2)
- Kernel.pbMessage(_INTL("You escaped to <c2=65467b14>{1}</c2> by using the power of <c2=65467b14>{2}</c2>!",
- mapname,pkmn.pbGetBirthsignName))
- pbRefresh
- break
- end
- end
- end
- end
- #===============================================================================
- # Birthsigns - The Cleric
- # Cure Skill effect: Heals the party's status conditions at the cost of HP.
- #===============================================================================
- elsif cmdCure>=0 && command==cmdCure
- if $Trainer.party.length<=1
- Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
- elsif pkmn.hp<=(pkmn.totalhp/5).floor
- Kernel.pbMessage(_INTL("{1} is too weak to cure its allies!",pkmn.name))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- pbRitualAnimation(pkmn)
- Kernel.pbMessage(_INTL("Choose a Pokémon for {1} to cure.",pkmn.name))
- @scene.pbSetHelpText(_INTL("Cure 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 cure itself!",pkmn.name))
- elsif newpkmn.egg?
- Kernel.pbMessage(_INTL("This power can't be used on eggs!"))
- elsif newpkmn.hp==0
- Kernel.pbMessage(_INTL("It's too late to cure that Pokémon..."))
- elsif newpkmn.status>0
- pkmn.hp-=(pkmn.totalhp/5).floor
- newpkmn.status=0
- newpkmn.statusCount=0
- pbRefresh
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1}'s condition was healed by the power of <c2=65467b14>{2}</c2>!",
- newpkmn.name,pkmn.pbGetBirthsignName))
- pbWait(2)
- else
- Kernel.pbMessage(_INTL("That Pokémon doesn't need to be cured!"))
- end
- break if pkmn.hp<=(pkmn.totalhp/5).floor
- end
- pbRefresh
- end
- end
- #===============================================================================
- # Birthsigns - The Monk
- # Trance Skill effect: Relearns old moves.
- #===============================================================================
- elsif cmdTrance>=0 && command==cmdTrance
- if pbGetRelearnableMoves(pkmn).length<=0
- Kernel.pbMessage(_INTL("But {1} has no moves to recall!",pkmn.name))
- else
- 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
- pbRitualAnimation(pkmn)
- pbRelearnMoveScreen(pkmn)
- else
- Kernel.pbMessage(_INTL("...but it couldn't recall anything."))
- end
- pbRefresh
- end
- end
- #===============================================================================
- # Birthsigns - The Ancestor
- # Inherit Skill effect: Passes along the user's EV spread.
- #===============================================================================
- elsif cmdInherit>=0 && command==cmdInherit
- totalev=0
- for k in 0...6
- totalev+=pkmn.ev[k]
- end
- if pkmn.fainted?
- Kernel.pbMessage(_INTL("{1} can't use this power while fainted!",pkmn.name))
- elsif totalev==0
- Kernel.pbMessage(_INTL("{1} needs to put in more effort before it can pass anything down!",pkmn.name))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("Activating this birthsign will transfer all of {1}'s effort points to a party member.",pkmn.name))
- pbWait(5)
- if Kernel.pbConfirmMessage(_INTL("Are you sure you want to activate this birthsign?"))
- Kernel.pbMessage(_INTL("Choose a Pokémon to inherit {1}'s effort points.",pkmn.name))
- @scene.pbSetHelpText(_INTL("Give to 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 inherit its own points!",pkmn.name))
- elsif newpkmn.egg?
- Kernel.pbMessage(_INTL("This power can't be used on eggs!"))
- elsif (newpkmn.isShadow? rescue false)
- Kernel.pbMessage(_INTL("Shadow Pokémon can't inherit anything."))
- else
- pbRitualAnimation(pkmn)
- newpkmn.ev[0]=pkmn.ev[0]
- newpkmn.ev[1]=pkmn.ev[1]
- newpkmn.ev[2]=pkmn.ev[2]
- newpkmn.ev[3]=pkmn.ev[3]
- newpkmn.ev[4]=pkmn.ev[4]
- newpkmn.ev[5]=pkmn.ev[5]
- Kernel.pbMessage(_INTL("{1} inherited effort points with the power of <c2=65467b14>{2}</c2>!",
- newpkmn.name,pkmn.pbGetBirthsignName))
- pkmn.ev=[0,0,0,0,0,0]
- newpkmn.calcStats
- pkmn.calcStats
- pbRefresh
- break
- end
- break if totalev==0
- end
- pbRefresh
- end
- end
- 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.
- #=======================================================================
- if pkmn.level>=100 # Lvl 100 Pokemon have IV's rolled between 30-31
- odd = 31
- evn = 30
- elsif pkmn.level>=50 # Lvl 50+ Pokemon have IV's rolled between 25-26
- odd = 25
- evn = 26
- else # All other Pokemon have IV's totally randomized
- odd = (rand(32)/2.floor*2+1)
- evn = (rand(32)/2.floor*2)
- end
- #=======================================================================
- if pkmn.fainted?
- Kernel.pbMessage(_INTL("{1} can't use this power while fainted!",pkmn.name))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("Please select a new Hidden Power type."))
- currentpower=pbHiddenPower(pkmn.iv)
- command=0
- loop do
- command=@scene.pbShowCommands(_INTL("Current Type: {1}",
- PBTypes.getName(currentpower[0])),[
- _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
- 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
- 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]))
- pbRitualAnimation(pkmn)
- pbRefresh
- pkmn.calcStats
- pkmn.hp=1 if pkmn.hp<=0
- pbWait(1)
- pbMEPlay("Pkmn get")
- newpower=pbHiddenPower(pkmn.iv)
- Kernel.pbMessage(_INTL("The power of <c2=65467b14>{1}</c2> changed {2}'s Hidden Power to <c2=65467b14>{3}</c2>!",
- pkmn.pbGetBirthsignName,pkmn.name,PBTypes.getName(newpower[0])))
- pbWait(2)
- pbRefresh
- break
- end
- end
- end
- #===============================================================================
- # Birthsigns - The Parent
- # Incubate Skill effect: Reduces an egg's stepcount to 1, instantly hatching it.
- #===============================================================================
- elsif cmdIncubate>=0 && command==cmdIncubate
- if $Trainer.party.length<=1
- Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
- elsif !pbCanUseBirthsignIncubate?
- Kernel.pbMessage(_INTL("This power needs recharging before it may be used again."))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("Choose an egg for {1} to incubate.",pkmn.name))
- @scene.pbSetHelpText(_INTL("Incubate which egg?"))
- 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.egg?
- pbRitualAnimation(pkmn)
- Kernel.pbMessage(_INTL("{1} incubated the egg with the power of <c2=65467b14>{2}</c2>!",
- pkmn.name,pkmn.pbGetBirthsignName))
- newpkmn.eggsteps=1
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("The egg is now ready to hatch!"))
- pbWait(2)
- pbUseBirthsignEffectIncubate
- break
- else
- Kernel.pbMessage(_INTL("This power only works on eggs!"))
- end
- end
- pbRefresh
- end
- end
- #===============================================================================
- # Birthsigns - The Eternal
- # Reincarnate Skill effect: Resets the user's birthsign and attributes.
- #===============================================================================
- elsif cmdReincarnate>=0 && command==cmdReincarnate
- if pkmn.hasCurrentsign? && !pkmn.isCelestial?
- Kernel.pbMessage(_INTL("This power won't work unless its a different month!"))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("Activating this birthsign may reset {1}'s zodiac sign, level,\nand many other attributes.",pkmn.name))
- pbWait(10)
- if Kernel.pbConfirmMessage(_INTL("Are you sure you want to activate this birthsign?"))
- pbRitualAnimation(pkmn)
- pkmn.hp=pkmn.totalhp
- pkmn.status=0
- pkmn.statusCount=0
- pkmn.level=EGGINITIALLEVEL
- pkmn.ev=[0,0,0,0,0,0]
- pkmn.happiness=120
- pkmn.pokerus=0
- pkmn.timeEggHatched=pbGetTimeNow
- pkmn.obtainText=_INTL("Reincarnated.")
- pkmn.giveRibbon(:SECONDSTEP)
- # Celestial Pokemon keep their trainer data
- if !pkmn.isCelestial?
- pkmn.trainerID = $Trainer.id
- pkmn.ot = $Trainer.name
- pkmn.otgender = $Trainer.gender
- end
- # Celestial Pokemon keep their sign
- if !pkmn.isCelestial? || !ZODIACSET==0
- pkmn.setZodiacsign(Time.now.mon)
- end
- pkmn.makeBlessed
- pkmn.calcStats
- pbMEPlay("Pkmn get") if pkmn.isCelestial?
- Kernel.pbMessage(_INTL("{1} was reincarnated by the power of <c2=65467b14>{2}</c2>!",
- pkmn.name,PBBirthsigns.getName(24)))
- if !pkmn.isCelestial?
- Kernel.pbMessage(_INTL("And..."))
- pbRefresh
- pbMEPlay("Evolution success")
- Kernel.pbMessage(_INTL("\\se[]{1} gained the power of\n<c2=65467b14>{2}</c2>!\\wt[80]",
- pkmn.name,pkmn.pbGetBirthsignName))
- 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
- end
- if pkmn.hasRibbon?(:SECONDSTEP)
- Kernel.pbMessage(_INTL("You put the <c2=65467b14>Second Step Ribbon</c2> on {1} to commemorate new life.",pkmn.name))
- end
- pbRefresh
- end
- end
- end
- #===============================================================================
- # Birthsigns - The Bard
- # Harmonize Skill effect: Choose from a list of songs with varying effects.
- #===============================================================================
- # Alluring Aria: Mimics the effect of 'White Flute', and lures a wild Pokemon.
- # Repellent Rapture: Mimics the effect of 'Black Flute', and repels wild Pokemon.
- # Mysterious Melody: Attempts to lure a wild Pokemon exclusive to the PokeRadar.
- #===============================================================================
- elsif cmdHarmonize>=0 && command==cmdHarmonize
- if !pbCanUseBirthsignHarmonize?
- Kernel.pbMessage(_INTL("This power needs recharging before it may be used again."))
- elsif !$PokemonEncounters.isEncounterPossibleHere?
- Kernel.pbMessage(_INTL("But there's nothing nearby to hear {1}'s tune...",pkmn.name))
- elsif $game_screen.weather_type!=PBFieldWeather::None
- Kernel.pbMessage(_INTL("{1}'s tune doesn't seem to travel well right now...",pkmn.name))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("Which song should {1} sing?",pkmn.name))
- command=0
- loop do
- command=@scene.pbShowCommands(_INTL("Choose a song."),[
- _INTL("Alluring Aria"),
- _INTL("Repellent Rapture"),
- _INTL("Mysterious Melody"),
- _INTL("Cancel")
- ],command)
- case command
- when -1, 3
- break
- when 0 # Alluring Aria
- @scene.pbEndScene
- pbUseBirthsignEffectHarmonize
- pbRitualAnimation(pkmn)
- pbWait(1)
- pbSEPlay("Anim/Sing")
- Kernel.pbMessage(_INTL("\\se[]With the power of <c2=65467b14>{1}</c2>, {2} emits an alluring tune...\\wt[80]",
- pkmn.pbGetBirthsignName,pkmn.name))
- $PokemonMap.whiteFluteUsed = true if $PokemonMap
- $PokemonMap.blackFluteUsed = false if $PokemonMap
- pbWait(10)
- encounter = nil
- enctype = $PokemonEncounters.pbEncounterType
- Kernel.pbMessage(_INTL("{1}'s tune seems to have attracted something!",pkmn.name))
- pbWait(10)
- if enctype<0 || !$PokemonEncounters.isEncounterPossibleHere? || !pbEncounter(enctype)
- Kernel.pbMessage(_INTL("{1}'s tune didn't seem to attract anything...",pkmn.name))
- end
- when 1 # Repellent Rapture
- @scene.pbEndScene
- pbUseBirthsignEffectHarmonize
- pbRitualAnimation(pkmn)
- pbWait(1)
- pbSEPlay("Anim/Sing")
- Kernel.pbMessage(_INTL("\\se[]With the power of <c2=65467b14>{1}</c2>, {2} emits a repulsive tune...\\wt[80]",
- pkmn.pbGetBirthsignName,pkmn.name))
- $PokemonMap.whiteFluteUsed = false if $PokemonMap
- $PokemonMap.blackFluteUsed = true if $PokemonMap
- pbWait(10)
- Kernel.pbMessage(_INTL("{1}'s tune seems to have scared away wild Pokémon!",pkmn.name))
- $PokemonGlobal.repel=250 if pkmn.level>50
- $PokemonGlobal.repel=200 if pkmn.level>25
- $PokemonGlobal.repel=100 if pkmn.level<25
- when 2 # Mysterious Melody
- @scene.pbEndScene
- pbUseBirthsignEffectHarmonize
- pbRitualAnimation(pkmn)
- pbWait(1)
- pbSEPlay("Anim/Sing")
- Kernel.pbMessage(_INTL("\\se[]With the power of <c2=65467b14>{1}</c2>, {2} emits an odd tune...\\wt[80]",
- pkmn.pbGetBirthsignName,pkmn.name))
- pbWait(10)
- enctype = $PokemonEncounters.pbEncounterType
- map = $game_map.map_id rescue 0
- array = []
- for enc in POKERADAREXCLUSIVES
- array.push(enc) if enc.length>=4 && enc[0]==map && getID(PBSpecies,enc[2])>0
- species=getID(PBSpecies,enc[2])
- end
- if array.length>0
- for enc in array
- upper = (enc[4]!=nil) ? enc[4] : enc[3]
- level = enc[3]+rand(1+upper-enc[3])
- if enctype<0 || !$PokemonEncounters.isEncounterPossibleHere?
- Kernel.pbMessage(_INTL("{1}'s tune didn't seem to attract anything...",pkmn.name))
- else
- Kernel.pbMessage(_INTL("{1}'s tune seems to have attracted something!",pkmn.name))
- pbWait(10)
- $PokemonTemp.forceSingleBattle = true
- pbWildBattle(species,level)
- end
- break
- end
- else
- Kernel.pbMessage(_INTL("{1}'s tune didn't seem to attract anything...",pkmn.name))
- end
- end
- break
- end
- break
- end
- end
- #===============================================================================
- # Birthsigns - The Empath
- # Bond Skill effect: Copies the nature of a party member.
- #===============================================================================
- elsif cmdBond>=0 && command==cmdBond
- if $Trainer.party.length<=1
- Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("Choose a Pokémon for {1} to bond with.",pkmn.name))
- @scene.pbSetHelpText(_INTL("Bond with 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 bond with itself!",pkmn.name))
- elsif newpkmn.egg?
- Kernel.pbMessage(_INTL("This power can't be used on eggs!"))
- elsif (newpkmn.isShadow? rescue false)
- Kernel.pbMessage(_INTL("That Pokémon doesn't seem willing to bond..."))
- elsif pkmn.nature==newpkmn.nature
- Kernel.pbMessage(_INTL("{1} doesn't seem interested in that Pokémon...",pkmn.name))
- else
- pbRitualAnimation(pkmn)
- pkmn.setNature(newpkmn.nature)
- pbRefresh
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1} is feeling <c2=65467b14>{2}</c2> by using the power of <c2=65467b14>{3}</c2>!",
- pkmn.name,PBNatures.getName(pkmn.nature),pkmn.pbGetBirthsignName))
- pbWait(2)
- end
- break
- end
- pbRefresh
- end
- end
- #===============================================================================
- # Birthsigns - The Tactician
- # Gambit Skill effect: Allows the user to reallocate EV's.
- #===============================================================================
- elsif cmdGambit>=0 && command==cmdGambit
- totalev=0
- for k in 0...6
- totalev+=pkmn.ev[k]
- end
- if pkmn.fainted?
- Kernel.pbMessage(_INTL("{1} can't use this power while fainted!",pkmn.name))
- elsif totalev!=PokeBattle_Pokemon::EVLIMIT
- Kernel.pbMessage(_INTL("{1} needs to put in more effort before it may use this power!",pkmn.name))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("Activating this birthsign will reset any accumulated effort points."))
- pbWait(5)
- if Kernel.pbConfirmMessage(_INTL("Are you sure you want to activate this birthsign?"))
- pkmn.ev=[0,0,0,0,0,0]
- Kernel.pbMessage(_INTL("Please reallocate {1}'s effort points.",pkmn.name))
- command = 0
- loop do
- totalev=0
- for k in 0...6
- totalev+=pkmn.ev[k]
- end
- evcommands = []
- for i in 0...6
- evcommands.push(PBStats.getName(i)+" (#{pkmn.ev[i]})")
- end
- evcommands.push(_INTL("-Done-"))
- evtotal=(PokeBattle_Pokemon::EVLIMIT-totalev)
- command=@scene.pbShowCommands(_INTL("{1} total points remaining.",evtotal),evcommands,command)
- if command>=0 && command<6
- remainder=(PokeBattle_Pokemon::EVLIMIT-PokeBattle_Pokemon::EVSTATLIMIT)
- if totalev<=remainder
- statcap=PokeBattle_Pokemon::EVSTATLIMIT
- elsif totalev>remainder
- statcap=(PokeBattle_Pokemon::EVLIMIT-totalev)
- end
- params = ChooseNumberParams.new
- params.setRange(0,statcap)
- params.setDefaultValue(pkmn.ev[command])
- params.setCancelValue(pkmn.ev[command])
- f = Kernel.pbMessageChooseNumber(_INTL("Set effort for {1}.\nPoints available: {2}",
- PBStats.getName(command),statcap),params) { @scene.update }
- if f!=pkmn.ev[command]
- pkmn.ev[command] = f
- pkmn.calcStats
- pkmn.hp=1 if pkmn.hp<=0
- pbRefreshSingle(pkmnid)
- end
- else
- if Kernel.pbConfirmMessage(_INTL("Are you sure you want this effort spread?"))
- pbRitualAnimation(pkmn)
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1} reallocated its effort points with the power of <c2=65467b14>{2}</c2>!",
- pkmn.name,pkmn.pbGetBirthsignName))
- pbWait(2)
- pbRefreshSingle(pkmnid)
- break
- else
- pkmn.ev=[0,0,0,0,0,0]
- Kernel.pbMessage(_INTL("Please reallocate {1}'s effort points.",pkmn.name))
- command=0
- end
- end
- pkmn.calcStats
- pbRefreshSingle(pkmnid)
- pbRefresh
- end
- end
- end
- end
- #===============================================================================
- # Birthsigns - The Fool
- # Lunacy Skill effect: Reduces the user's level to raise a party member's level.
- #===============================================================================
- elsif cmdLunacy>=0 && command==cmdLunacy
- if pkmn.fainted?
- Kernel.pbMessage(_INTL("{1} can't use this power while fainted!",pkmn.name))
- elsif pkmn.level<5
- Kernel.pbMessage(_INTL("{1} needs to be a higher level to use this power!",pkmn.name))
- elsif $Trainer.party.length<=1
- Kernel.pbMessage(_INTL("But there aren't any other Pokémon in the party!"))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("Using this power will lower {1}'s level by 3...",pkmn.name))
- pbWait(5)
- if Kernel.pbConfirmMessage(_INTL("Are you sure you want to activate this power?"))
- Kernel.pbMessage(_INTL("Choose a Pokémon for {1} to level up.",pkmn.name))
- @scene.pbSetHelpText(_INTL("Level up which Pokémon?"))
- oldpkmnid=pkmnid
- maxlevel=PBExperience::MAXLEVEL
- 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 this power to level itself!",pkmn.name))
- elsif newpkmn.egg?
- Kernel.pbMessage(_INTL("This power can't be used on eggs!"))
- elsif (newpkmn.isShadow? rescue false)
- Kernel.pbMessage(_INTL("This power won't work on that Pokémon."))
- elsif pkmn.level<newpkmn.level || newpkmn.level==maxlevel
- Kernel.pbMessage(_INTL("{1}'s level is too high for this power!",newpkmn.name))
- else
- pbRitualAnimation(pkmn)
- #=============================================================
- # De-leveling User
- #=============================================================
- pkmn.level-=3
- pkmn.calcStats
- pkmn.hp=1 if pkmn.hp<=0
- pbRefresh
- Kernel.pbMessage(_INTL("{1} fell to Level {2}...",pkmn.name,pkmn.level))
- Kernel.pbMessage(_INTL("But..."))
- #=============================================================
- # Leveling Ally
- #=============================================================
- attackdiff=newpkmn.attack
- defensediff=newpkmn.defense
- speeddiff=newpkmn.speed
- spatkdiff=newpkmn.spatk
- spdefdiff=newpkmn.spdef
- totalhpdiff=newpkmn.totalhp
- newpkmn.level+=(1+rand(5))
- newpkmn.changeHappiness("levelup")
- newpkmn.calcStats
- pbRefresh
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("The power of <c2=65467b14>{1}</c2> elevated {2} to Level {3}!",
- pkmn.pbGetBirthsignName,newpkmn.name,newpkmn.level))
- pbWait(2)
- attackdiff=newpkmn.attack-attackdiff
- defensediff=newpkmn.defense-defensediff
- speeddiff=newpkmn.speed-speeddiff
- spatkdiff=newpkmn.spatk-spatkdiff
- spdefdiff=newpkmn.spdef-spdefdiff
- totalhpdiff=newpkmn.totalhp-totalhpdiff
- pbTopRightWindow(_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
- totalhpdiff,attackdiff,defensediff,spatkdiff,spdefdiff,speeddiff))
- pbTopRightWindow(_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
- newpkmn.totalhp,newpkmn.attack,newpkmn.defense,newpkmn.spatk,newpkmn.spdef,newpkmn.speed))
- movelist=newpkmn.getMoveList
- for i in movelist
- if i[0]==newpkmn.level # Learned a new move
- pbLearnMove(newpkmn,i[1],true)
- end
- end
- newspecies=pbCheckEvolution(newpkmn)
- if newspecies>0
- pbFadeOutInWithMusic(99999){
- evo=PokemonEvolutionScene.new
- evo.pbStartScreen(newpkmn,newspecies)
- evo.pbEvolution
- evo.pbEndScreen
- }
- break
- end
- end
- break if pkmn.level<newpkmn.level
- end
- pbRefresh
- end
- end
- end
- #===============================================================================
- # Birthsigns - The Alchemist
- # Transmute Skill effect: Uses Stardust to morph held items into new ones.
- #===============================================================================
- elsif cmdTransmute>=0 && command==cmdTransmute
- # Items that should not be transmutable must be added to this list below
- nontransmutable = (pbIsKeyItem?(pkmn.item) ||
- pbIsMachine?(pkmn.item) ||
- pbIsMegaStone?(pkmn.item) ||
- (pbIsZCrystal?(pkmn.item) if INCLUDE_ZMOVES) ||
- (pbIsZCrystal2?(pkmn.item) if INCLUDE_ZMOVES) ||
- isConst?(pkmn.item,PBItems,:REDORB) ||
- isConst?(pkmn.item,PBItems,:BLUEORB) ||
- isConst?(pkmn.item,PBItems,:ADAMANTORB) ||
- isConst?(pkmn.item,PBItems,:LUSTROUSORB) ||
- isConst?(pkmn.item,PBItems,:GRISEOUSORB) ||
- isConst?(pkmn.item,PBItems,:SOULDEW) ||
- isConst?(pkmn.item,PBItems,:BURNDRIVE) ||
- isConst?(pkmn.item,PBItems,:CHILLDRIVE) ||
- isConst?(pkmn.item,PBItems,:SHOCKDRIVE) ||
- isConst?(pkmn.item,PBItems,:DOUSEDRIVE) ||
- isConst?(pkmn.item,PBItems,:RUSTEDSHIELD) ||
- isConst?(pkmn.item,PBItems,:RUSTEDSWORD) ||
- isConst?(pkmn.item,PBItems,:STARDUST) ||
- isConst?(pkmn.item,PBItems,:MASTERBALL))
- stardust=PBItems.getName(PBItems::STARDUST)
- if !pkmn.hasItem?
- Kernel.pbMessage(_INTL("{1} isn't holding an item to transmute!",pkmn.name))
- elsif nontransmutable
- Kernel.pbMessage(_INTL("{1} isn't a transmutable item!",PBItems.getName(pkmn.item)))
- elsif !$PokemonBag.pbHasItem?(:STARDUST)
- Kernel.pbMessage(_INTL("You need more <c2=65467b14>{1}</c2> to use this power!",stardust))
- else
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?",pkmn.name))
- Kernel.pbMessage(_INTL("Activating this birthsign will consume <c2=65467b14>{1}</c2>, and permanently change the item {2} is holding.",stardust,pkmn.name))
- if Kernel.pbConfirmMessage(_INTL("Should <c2=65467b14>{1}</c2> be transmuted?",PBItems.getName(pkmn.item)))
- #===============================================================================
- # Creation List
- #===============================================================================
- # Includes most items up to Gen 8; no consequences if all items aren't present.
- #===============================================================================
- excavation = [:HEATROCK,:ICYROCK,:DAMPROCK,:SMOOTHROCK,:LIGHTCLAY,:EVIOLITE,
- :ODDKEYSTONE,:HARDSTONE,:EVERSTONE,:FLOATSTONE,:OVALSTONE,:REDSHARD,
- :BLUESHARD,:YELLOWSHARD,:GREENSHARD,:COMETSHARD,:SHOALSHELL,:REVIVE,
- :MAXREVIVE,:NUGGET,:BIGNUGGET,:PEARL,:BIGPEARL,:SOFTSAND,:RAREBONE,
- :WISHINGPIECE]
- #26===============================================================
- mints = [:LONELYMINT,:ADAMANTMINT,:NAUGHTYMINT,:BRAVEMINT,:BOLDMINT,:IMPISHMINT,
- :LAXMINT,:RELAXEDMINT,:MODESTMINT,:MILDMINT,:RASHMINT,:QUIETMINT,:CALMMINT,
- :GENTLEMINT,:CAREFULMINT,:SASSYMINT,:TIMIDMINT,:HASTYMINT,:JOLLYMINT,
- :NAIVEMINT,:SERIOUSMINT]
- #21===============================================================
- beastparts = [:DEEPSEASCALE,:DRAGONSCALE,:HEARTSCALE,:PRISMSCALE,:DEEPSEATOOTH,
- :DRAGONFANG,:RAZORFANG,:GRIPCLAW,:QUICKCLAW,:RAZORCLAW,:LAGGINGTAIL,
- :SLOWPOKETAIL,:SHARPBEAK,:PRETTYWING,:POISONBARB,:STICKYBARB,
- :SHEDSHELL,:SHOALSHELL,:RAREBONE,:BERSERKGENE]
- #20===============================================================
- plates = [:FLAMEPLATE,:SPLASHPLATE,:ZAPPLATE,:MEADOWPLATE,:ICICLEPLATE,:FISTPLATE,
- :TOXICPLATE,:EARTHPLATE,:SKYPLATE,:MINDPLATE,:INSECTPLATE,:STONEPLATE,
- :SPOOKYPLATE,:DRACOPLATE,:DREADPLATE,:IRONPLATE,:PIXIEPLATE,
- :DIVINEPLATE,:FALSEPLATE]
- #19===============================================================
- memories = [:BUGMEMORY,:DARKMEMORY,:DRAGONMEMORY,:ELECTRICMEMORY,:FAIRYMEMORY,
- :FIGHTINGMEMORY,:FIREMEMORY,:FLYINGMEMORY,:GHOSTMEMORY,:GRASSMEMORY,
- :GROUNDMEMORY,:ICEMEMORY,:POISONMEMORY,:PSYCHICMEMORY,:ROCKMEMORY,
- :STEELMEMORY,:WATERMEMORY]
- #17===============================================================
- evostones = [:FIRESTONE,:WATERSTONE,:LEAFSTONE,:THUNDERSTONE,:MOONSTONE,:SUNSTONE,
- :DUSKSTONE,:DAWNSTONE,:SHINYSTONE,:REDSHARD,:BLUESHARD,:YELLOWSHARD,
- :GREENSHARD,:EVERSTONE,:EVIOLITE,:ICESTONE,:OVALSTONE]
- #17===============================================================
- gadgets = [:MAGNET,:RINGTARGET,:METRONOME,:EJECTBUTTON,:CELLBATTERY,:MACHOBRACE,
- :SOOTHEBELL,:UPGRADE,:DUBIOUSDISC,:ELECTIRIZER,:MAGMARIZER,:PROTECTOR,
- :EXPSHARE,:TERRAINEXTENDER,:ASSAULTVEST,:PROTECTIVEPADS,:EJECTPACK,
- :HEAVYDUTYBOOTS,:ROOMSERVICE,:UTILITYUMBRELLA]
- #20===============================================================
- clothing = [:CHOICESCARF,:CHOICEBAND,:EXPERTBELT,:MUSCLEBAND,:FOCUSBAND,:FOCUSSASH,
- :BINDINGBAND,:BLACKBELT,:SILKSCARF,:REDSCARF,:BLUESCARF,:PINKSCARF,
- :GREENSCARF,:YELLOWSCARF]
- #14===============================================================
- junkitem = [:SHOALSALT,:BRIGHTPOWDER,:SILVERPOWDER,:QUICKPOWDER,:ENERGYPOWDER,
- :HEALPOWDER,:GROWTHMULCH,:DAMPMULCH,:STABLEMULCH,:GOOEYMULCH,
- :SACREDASH,:CHARCOAL,:BLACKSLUDGE]
- #13===============================================================
- fossils = [:HELIXFOSSIL,:DOMEFOSSIL,:ROOTFOSSIL,:CLAWFOSSIL,:SKULLFOSSIL,
- :ARMORFOSSIL,:COVERFOSSIL,:PLUMEFOSSIL,:OLDAMBER,:SAILFOSSIL,
- :JAWFOSSIL,:FOSSILIZEDBIRD,:FOSSILIZEDDINO,:FOSSILIZEDDRAKE,
- :FOSSILIZEDFISH,:THICKCLUB,:SACREDASH]
- #17===============================================================
- zodiacgem = [:JANZODICA,:FEBZODICA,:MARZODICA,:APRIZODICA,:MAYZODICA,:JUNZODICA,
- :JULZODICA,:AUGZODICA,:SEPZODICA,:OCTZODICA,:NOVIZODICA,:DECIZODICA]
- #12===============================================================
- herbs = [:ENERGYROOT,:REVIVALHERB,:ABSORBBULB,:MENTALHERB,:POWERHERB,:WHITEHERB,
- :TINYMUSHROOM,:BIGMUSHROOM,:BALMMUSHROOM,:BIGROOT,:STICK,:LUMINOUSMOSS,
- :SWEETAPPLE,:TARTAPPLE,:LEFTOVERS]
- #15===============================================================
- treasure1 = [:RELICCOPPER,:RELICCOPPER,:RELICSILVER,:BOTTLECAP,:NUGGET,:BIGNUGGET,
- :STARPIECE,:SOFTSAND,:KINGSROCK,:REVIVE,:MAXREVIVE,:CRACKEDPOT]
- #12===============================================================
- treasure2 = [:RELICGOLD,:RELICGOLD,:RELICVASE,:RELICBAND,:RELICSTATUE,:KINGSROCK,
- :RELICCROWN,:AMULETCOIN,:BOTTLECAP,:BOTTLECAP,:GOLDBOTTLECAP,:CHIPPEDPOT]
- #12===============================================================
- incenses = [:LAXINCENSE,:FULLINCENSE,:LUCKINCENSE,:PUREINCENSE,:SEAINCENSE,
- :WAVEINCENSE,:ROSEINCENSE,:ODDINCENSE,:ROCKINCENSE,:SACHET]
- #10================================================================
- liquids = [:MYSTICWATER,:MYSTICWATER,:SODAPOP,:LEMONADE,:MOOMOOMILK,:BERRYJUICE,
- :NEVERMELTICE,:SNOWBALL,:THROATSPRAY]
- #9===============================================================
- vitamins = [:PPUP,:PPMAX,:HPUP,:PROTEIN,:IRON,:CALCIUM,:ZINC,:CARBOS,:ABILITYCAPSULE]
- #9================================================================
- apricorn = [:REDAPRICORN,:YLWAPRICORN,:BLUAPRICORN,:GRNAPRICORN,:PNKAPRICORN,
- :WHTAPRICORN,:BLKAPRICORN]
- #7================================================================
- orbs = [:LIFEORB,:LIGHTORB,:FLAMEORB,:TOXICORB,:SMOKEBALL,:IRONBALL,
- :PEARLSTRING,:ADRENALINEORB]
- #8================================================================
- glass = [:CHOICESPECS,:BLACKGLASSES,:WISEGLASSES,:SCOPELENS,:WIDELENS,
- :ZOOMLENS,:SAFETYGOGGLES,:BLACKFLUTE,:BLUEFLUTE,:REDFLUTE,
- :WHITEFLUTE,:YELLOWFLUTE]
- #12================================================================
- sweets = [:STRAWBERRYSWEET,:LOVESWEET,:BERRYSWEET,:CLOVERSWEET,:FLOWERSWEET,
- :STARSWEET,:RIBBONSWEET,:SWEETHEART,:CASTELIACONE,:OLDGATEAU,
- :LAVACOOKIE,:RAGECANDYBAR,:PEWTERCRUNCHIES,:WHIPPEDDREAM,:RARECANDY,
- :DYNAMAXCANDY]
- #16===============================================================
- expcandy = [:EXPCANDYXS,:EXPCANDYXS,:EXPCANDYS,:EXPCANDYS,:EXPCANDYM,:EXPCANDYM,
- :EXPCANDYL,:EXPCANDYXL,:RARECANDY,:DYNAMAXCANDY]
- #10===============================================================
- berryscrap = [:BERRYJUICE,:BERRYJUICE,:BLACKSLUDGE,:MIRACLESEED,:MIRACLESEED,:LEFTOVERS]
- #6================================================================
- poweritem = [:POWERWEIGHT,:POWERBRACER,:POWERBELT,:POWERLENS,:POWERBAND,:POWERANKLET]
- #6================================================================
- wings = [:HEALTHWING,:MUSCLEWING,:RESISTWING,:GENIUSWING,:CLEVERWING,:SWIFTWING]
- #6================================================================
- potions = [:POTION,:SUPERPOTION,:SUPERPOTION,:HYPERPOTION,:MAXPOTION,:FULLRESTORE]
- #6================================================================
- statusitem = [:ANTIDOTE,:BURNHEAL,:AWAKENING,:ICEHEAL,:PARALYZEHEAL,:FULLHEAL]
- #6================================================================
- paperitem = [:REDCARD,:CLEANSETAG,:CLEANSETAG,:SPELLTAG,:DISCOUNTCOUPON,
- :WEAKNESSPOLICY,:BLUNDERPOLICY]
- #7================================================================
- repels = [:REPEL,:REPEL,:SUPERREPEL,:SUPERREPEL,:MAXREPEL]
- #5================================================================
- #===============================================================================
- # Creates items
- #===============================================================================
- # CREATES ELEMENTAL MATERIALS
- if isConst?(pkmn.item,PBItems,:SACREDASH)
- pkmn.setItem(:MIRACLESEED) if rand(100)>75
- pkmn.setItem(:MYSTICWATER) if rand(100)>50
- pkmn.setItem(:CHARCOAL) if rand(100)>25
- pkmn.setItem(:RAREBONE) if rand(100)<25
- # CREATES FRESH WATER
- elsif (isConst?(pkmn.item,PBItems,:MYSTICWATER) ||
- isConst?(pkmn.item,PBItems,:NEVERMELTICE))
- pkmn.setItem(:FRESHWATER)
- # CREATES NEVER-MELT ICE
- elsif (isConst?(pkmn.item,PBItems,:CASTELIACONE) ||
- isConst?(pkmn.item,PBItems,:SNOWBALL))
- pkmn.setItem(:NEVERMELTICE)
- # CREATES HONEY
- elsif (isConst?(pkmn.item,PBItems,:BERRYJUICE) ||
- isConst?(pkmn.item,PBItems,:LEMONADE) ||
- isConst?(pkmn.item,PBItems,:SODAPOP) ||
- isConst?(pkmn.item,PBItems,:PINKNECTAR) ||
- isConst?(pkmn.item,PBItems,:PURPLENECTAR) ||
- isConst?(pkmn.item,PBItems,:REDNECTAR) ||
- isConst?(pkmn.item,PBItems,:YELLOWNECTAR))
- pkmn.setItem(:HONEY)
- # CREATES SEEDS & JUICE
- elsif isConst?(pkmn.item,PBItems,:RINDOBERRY)
- pkmn.setItem(:GRASSYSEED)
- elsif isConst?(pkmn.item,PBItems,:WACANBERRY)
- pkmn.setItem(:ELECTRICSEED)
- elsif isConst?(pkmn.item,PBItems,:PAYAPABERRY)
- pkmn.setItem(:PSYCHICSEED)
- elsif isConst?(pkmn.item,PBItems,:ROSELIBERRY)
- pkmn.setItem(:MISTYSEED)
- elsif pbIsBerry?(pkmn.item)
- pkmn.setItem(berryscrap[rand(5)])
- # CREATES HERBS & ROOTS
- elsif (isConst?(pkmn.item,PBItems,:MIRACLESEED) ||
- isConst?(pkmn.item,PBItems,:GRASSYSEED) ||
- isConst?(pkmn.item,PBItems,:ELECTRICSEED) ||
- isConst?(pkmn.item,PBItems,:PSYCHICSEED) ||
- isConst?(pkmn.item,PBItems,:MISTYSEED))
- pkmn.setItem(herbs[rand(14)])
- # CREATES MINTS
- elsif (isConst?(pkmn.item,PBItems,:REVIVALHERB) ||
- isConst?(pkmn.item,PBItems,:WHITEHERB) ||
- isConst?(pkmn.item,PBItems,:POWERHERB) ||
- isConst?(pkmn.item,PBItems,:MENTALHERB))
- pkmn.setItem(mints[rand(20)])
- # CREATES APRICORN
- elsif (isConst?(pkmn.item,PBItems,:LEVELBALL) ||
- isConst?(pkmn.item,PBItems,:REPEATBALL))
- pkmn.setItem(:REDAPRICORN)
- elsif (isConst?(pkmn.item,PBItems,:MOONBALL) ||
- isConst?(pkmn.item,PBItems,:QUICKBALL))
- pkmn.setItem(:YLWAPRICORN)
- elsif (isConst?(pkmn.item,PBItems,:LUREBALL) ||
- isConst?(pkmn.item,PBItems,:DIVEBALL) ||
- isConst?(pkmn.item,PBItems,:NETBALL))
- pkmn.setItem(:BLUAPRICORN)
- elsif (isConst?(pkmn.item,PBItems,:FRIENDBALL) ||
- isConst?(pkmn.item,PBItems,:NESTBALL))
- pkmn.setItem(:GRENAPRICORN)
- elsif (isConst?(pkmn.item,PBItems,:LOVEBALL) ||
- isConst?(pkmn.item,PBItems,:HEALBALL) ||
- isConst?(pkmn.item,PBItems,:DREAMBALL))
- pkmn.setItem(:PNKAPRICORN)
- elsif (isConst?(pkmn.item,PBItems,:FASTBALL) ||
- isConst?(pkmn.item,PBItems,:PREMIERBALL) ||
- isConst?(pkmn.item,PBItems,:TIMERBALL))
- pkmn.setItem(:WHTAPRICORN)
- elsif (isConst?(pkmn.item,PBItems,:HEAVYBALL) ||
- isConst?(pkmn.item,PBItems,:LUXURYBALL) ||
- isConst?(pkmn.item,PBItems,:DUSKBALL))
- pkmn.setItem(:BLKAPRICORN)
- elsif pbIsPokeBall?(pkmn.item)
- pkmn.setItem(apricorn[rand(6)])
- # CREATES INCENSE
- elsif (isConst?(pkmn.item,PBItems,:SHOALSALT) ||
- isConst?(pkmn.item,PBItems,:BRIGHTPOWDER) ||
- isConst?(pkmn.item,PBItems,:QUICKPOWDER) ||
- isConst?(pkmn.item,PBItems,:SILVERPOWDER))
- pkmn.setItem(incenses[rand(9)])
- # CREATES MONSTER PARTS
- elsif isConst?(pkmn.item,PBItems,:LUCKYEGG)
- pkmn.setItem(beastparts[rand(19)])
- # CREATES FOSSILS
- elsif isConst?(pkmn.item,PBItems,:RAREBONE)
- pkmn.setItem(fossils[rand(16)])
- # CREATES EXCAVATION ITEMS
- elsif isConst?(pkmn.item,PBItems,:FIRESTONE)
- pkmn.setItem(:HEATROCK)
- elsif isConst?(pkmn.item,PBItems,:WATERSTONE)
- pkmn.setItem(:DAMPROCK)
- elsif isConst?(pkmn.item,PBItems,:ICESTONE)
- pkmn.setItem(:ICYROCK)
- elsif pbIsFossil?(pkmn.item) || pbIsEvolutionStone?(pkmn.item)
- pkmn.setItem(excavation[rand(25)])
- # CREATES PLATES
- elsif (isConst?(pkmn.item,PBItems,:REDSHARD) ||
- isConst?(pkmn.item,PBItems,:BLUESHARD) ||
- isConst?(pkmn.item,PBItems,:GREENSHARD) ||
- isConst?(pkmn.item,PBItems,:YELLOWSHARD))
- pkmn.setItem(plates[rand(18)])
- # CREATES ORBS
- elsif (isConst?(pkmn.item,PBItems,:PEARL) ||
- isConst?(pkmn.item,PBItems,:BIGPEARL))
- pkmn.setItem(orbs[rand(7)])
- # CREATES TREASURE
- elsif (isConst?(pkmn.item,PBItems,:HARDSTONE) ||
- isConst?(pkmn.item,PBItems,:EVERSTONE) ||
- isConst?(pkmn.item,PBItems,:FLOATSTONE) ||
- isConst?(pkmn.item,PBItems,:OVALSTONE) ||
- isConst?(pkmn.item,PBItems,:CHARCOAL))
- pkmn.setItem(treasure1[rand(11)])
- elsif (isConst?(pkmn.item,PBItems,:NUGGET) ||
- isConst?(pkmn.item,PBItems,:BIGNUGGET))
- pkmn.setItem(treasure2[rand(11)])
- # CREATES EVOLUTION STONES
- elsif isConst?(pkmn.item,PBItems,:FIREGEM)
- pkmn.setItem(:FIRESTONE)
- elsif isConst?(pkmn.item,PBItems,:WATERGEM)
- pkmn.setItem(:WATERSTONE)
- elsif isConst?(pkmn.item,PBItems,:ELECTRICGEM)
- pkmn.setItem(:THUNDERSTONE)
- elsif isConst?(pkmn.item,PBItems,:GRASSGEM)
- pkmn.setItem(:LEAFSTONE)
- elsif isConst?(pkmn.item,PBItems,:ICEGEM)
- pkmn.setItem(:ICESTONE)
- elsif (isConst?(pkmn.item,PBItems,:DARKGEM) ||
- isConst?(pkmn.item,PBItems,:GHOSTGEM))
- pkmn.setItem(:DUSKSTONE)
- elsif (isConst?(pkmn.item,PBItems,:FAIRYGEM) ||
- isConst?(pkmn.item,PBItems,:NORMALGEM))
- pkmn.setItem(:SHINYSTONE)
- elsif (isConst?(pkmn.item,PBItems,:FIGHTINGGEM) ||
- isConst?(pkmn.item,PBItems,:PSYCHICGEM))
- pkmn.setItem(:DAWNSTONE)
- elsif pbIsGem?(pkmn.item)
- pkmn.setItem(evostones[rand(16)])
- # CREATES EVIOLITE
- elsif isConst?(pkmn.item,PBItems,:EVERSTONE)
- pkmn.setItem(:EVIOLITE)
- # CREATES SOFT SAND
- elsif (isConst?(pkmn.item,PBItems,:ROCKYHELMET) ||
- isConst?(pkmn.item,PBItems,:RELICSTATUE) ||
- isConst?(pkmn.item,PBItems,:RELICVASE) ||
- isConst?(pkmn.item,PBItems,:SMOOTHROCK) ||
- isConst?(pkmn.item,PBItems,:ODDKEYSTONE) ||
- isConst?(pkmn.item,PBItems,:LIGHTCLAY) ||
- isConst?(pkmn.item,PBItems,:STRANGESOUVENIR))
- pkmn.setItem(:SOFTSAND)
- # CREATES SHELL BELL
- elsif isConst?(pkmn.item,PBItems,:SHOALSHELL)
- pkmn.setItem(:SHELLBELL)
- # CREATES REPELS
- elsif (pbIsMulch?(pkmn.item) ||
- isConst?(pkmn.item,PBItems,:BLACKSLUDGE))
- pkmn.setItem(repels[rand(4)])
- # CREATES POTIONS
- elsif isConst?(pkmn.item,PBItems,:ENERGYPOWDER)
- pkmn.setItem(potions[rand(5)])
- # CREATES STATUS CURES
- elsif isConst?(pkmn.item,PBItems,:HEALPOWDER)
- pkmn.setItem(statusitem[rand(5)])
- # CREATES DRINKS
- elsif isConst?(pkmn.item,PBItems,:FRESHWATER)
- pkmn.setItem(liquids[rand(8)])
- # CREATES SWEETS
- elsif (isConst?(pkmn.item,PBItems,:HONEY) ||
- isConst?(pkmn.item,PBItems,:MOOMOOMILK))
- pkmn.setItem(sweets[rand(15)])
- # CREATES GROWTH CANDY
- elsif (isConst?(pkmn.item,PBItems,:SWEETHEART) ||
- isConst?(pkmn.item,PBItems,:RAGECANDYBAR) ||
- isConst?(pkmn.item,PBItems,:OLDGATEAU) ||
- isConst?(pkmn.item,PBItems,:LAVACOOKIE) ||
- isConst?(pkmn.item,PBItems,:CASTELIACONE) ||
- isConst?(pkmn.item,PBItems,:PEWTERCRUNCHIES) ||
- isConst?(pkmn.item,PBItems,:BIGMALASADA) ||
- isConst?(pkmn.item,PBItems,:LUMIOSEGALETTE) ||
- isConst?(pkmn.item,PBItems,:SHALOURSABLE))
- pkmn.setItem(expcandy[rand(9)])
- elsif (isConst?(pkmn.item,PBItems,:EXPCANDYXS) ||
- isConst?(pkmn.item,PBItems,:EXPCANDYS) ||
- isConst?(pkmn.item,PBItems,:EXPCANDYM) ||
- isConst?(pkmn.item,PBItems,:EXPCANDYXL) ||
- isConst?(pkmn.item,PBItems,:EXPCANDYXL) ||
- isConst?(pkmn.item,PBItems,:DYNAMAXCANDY))
- pkmn.setItem(:RARECANDY)
- # CREATES WING ITEMS
- elsif isConst?(pkmn.item,PBItems,:PRETTYWING)
- pkmn.setItem(wings[rand(5)])
- # CREATES VITAMINS
- elsif (isConst?(pkmn.item,PBItems,:XATTACK) ||
- isConst?(pkmn.item,PBItems,:XDEFENSE) ||
- isConst?(pkmn.item,PBItems,:XSPATK) ||
- isConst?(pkmn.item,PBItems,:XSPDEF) ||
- isConst?(pkmn.item,PBItems,:XSPEED) ||
- isConst?(pkmn.item,PBItems,:XACCURACY) ||
- isConst?(pkmn.item,PBItems,:DIREHIT) ||
- isConst?(pkmn.item,PBItems,:GUARDSPEC))
- pkmn.setItem(vitamins[rand(8)])
- # CREATES PP UP
- elsif (isConst?(pkmn.item,PBItems,:ETHER) ||
- isConst?(pkmn.item,PBItems,:MAXETHER))
- pkmn.setItem(:PPUP)
- # CREATES PP MAX
- elsif (isConst?(pkmn.item,PBItems,:ELIXIR) ||
- isConst?(pkmn.item,PBItems,:MAXELIXIR) ||
- isConst?(pkmn.item,PBItems,:RARECANDY) ||
- isConst?(pkmn.item,PBItems,:DYNAMAXCANDY) ||
- isConst?(pkmn.item,PBItems,:ABILITYCAPSULE) ||
- isConst?(pkmn.item,PBItems,:PPUP))
- pkmn.setItem(:PPMAX)
- # CREATES ABILITY CAPSULE
- elsif isConst?(pkmn.item,PBItems,:PPMAX)
- pkmn.setItem(:ABILITYCAPSULE)
- # CREATES PAPER ITEMS
- elsif pbIsMail?(pkmn.item)
- pkmn.setItem(paperitem[rand(6)])
- # CREATES GLASS ITEMS
- elsif isConst?(pkmn.item,PBItems,:SOFTSAND)
- pkmn.setItem(lenses[rand(11)])
- # CREATES GROWTH GEAR
- elsif (isConst?(pkmn.item,PBItems,:MACHOBRACE) ||
- isConst?(pkmn.item,PBItems,:EXPSHARE))
- pkmn.setItem(poweritem[rand(5)])
- # CREATES ASSAULT VEST
- elsif isConst?(pkmn.item,PBItems,:PROTECTOR)
- pkmn.setItem(:ASSAULTVEST)
- # CREATES ROCKY HELMET
- elsif (isConst?(pkmn.item,PBItems,:KINGSROCK) ||
- isConst?(pkmn.item,PBItems,:RELICCROWN))
- pkmn.setItem(:ROCKYHELMET)
- # CREATES CHIPPED POT
- elsif isConst?(pkmn.item,PBItems,:CRACKEDPOT)
- pkmn.setItem(:CHIPPEDPOT)
- # CREATES FABRIC & CLOTHING
- elsif (isConst?(pkmn.item,PBItems,:DESTINYKNOT) ||
- isConst?(pkmn.item,PBItems,:REAPERCLOTH))
- pkmn.setItem(clothing[rand(13)])
- elsif (isConst?(pkmn.item,PBItems,:REDSCARF) ||
- isConst?(pkmn.item,PBItems,:BLUESCARF) ||
- isConst?(pkmn.item,PBItems,:PINKSCARF) ||
- isConst?(pkmn.item,PBItems,:GREENSCARF) ||
- isConst?(pkmn.item,PBItems,:YELLOWSCARF) ||
- isConst?(pkmn.item,PBItems,:SILKSCARF) ||
- isConst?(pkmn.item,PBItems,:FOCUSSASH) ||
- isConst?(pkmn.item,PBItems,:POKEDOLL))
- pkmn.setItem(:REAPERCLOTH)
- elsif (isConst?(pkmn.item,PBItems,:EXPERTBELT) ||
- isConst?(pkmn.item,PBItems,:MUSCLEBAND) ||
- isConst?(pkmn.item,PBItems,:FOCUSBAND) ||
- isConst?(pkmn.item,PBItems,:BINDINGBAND) ||
- isConst?(pkmn.item,PBItems,:BLACKBELT) ||
- isConst?(pkmn.item,PBItems,:ESCAPEROPE) ||
- isConst?(pkmn.item,PBItems,:FLUFFYTAIL))
- pkmn.setItem(:DESTINYKNOT)
- # CREATES GADGETS & METALS
- elsif (isConst?(pkmn.item,PBItems,:METALCOAT) ||
- isConst?(pkmn.item,PBItems,:IRONBALL) ||
- isConst?(pkmn.item,PBItems,:LUCKYPUNCH) ||
- isConst?(pkmn.item,PBItems,:CELLBATTERY))
- pkmn.setItem(gadgets[rand(19)])
- elsif (isConst?(pkmn.item,PBItems,:SOOTHEBELL) ||
- isConst?(pkmn.item,PBItems,:RELICSILVER) ||
- isConst?(pkmn.item,PBItems,:RELICCOPPER) ||
- isConst?(pkmn.item,PBItems,:RELICGOLD) ||
- isConst?(pkmn.item,PBItems,:RELICBAND) ||
- isConst?(pkmn.item,PBItems,:TWISTEDSPOON))
- pkmn.setItem(:METALPOWDER)
- elsif isConst?(pkmn.item,PBItems,:METALPOWDER)
- pkmn.setItem(:METALCOAT)
- # CREATES CELL BATTERY
- elsif (isConst?(pkmn.item,PBItems,:EJECTBUTTON) ||
- isConst?(pkmn.item,PBItems,:ELECTIRIZER) ||
- isConst?(pkmn.item,PBItems,:EJECTPACK))
- pkmn.setItem(:CELLBATTERY)
- # CREATES MEMORIES
- elsif (isConst?(pkmn.item,PBItems,:UPGRADE) ||
- isConst?(pkmn.item,PBItems,:DUBIOUSDISC))
- pkmn.setItem(memories[rand(16)])
- # CREATES POKEBALLS
- elsif isConst?(pkmn.item,PBItems,:REDAPRICORN)
- pkmn.setItem(:LEVELBALL)
- elsif isConst?(pkmn.item,PBItems,:YLWAPRICORN)
- pkmn.setItem(:MOONBALL)
- elsif isConst?(pkmn.item,PBItems,:BLUAPRICORN)
- pkmn.setItem(:LUREBALL)
- elsif isConst?(pkmn.item,PBItems,:GRNAPRICORN)
- pkmn.setItem(:FRIENDBALL)
- elsif isConst?(pkmn.item,PBItems,:PNKAPRICORN)
- pkmn.setItem(:LOVEBALL)
- elsif isConst?(pkmn.item,PBItems,:WHTAPRICORN)
- pkmn.setItem(:FASTBALL)
- elsif isConst?(pkmn.item,PBItems,:BLKAPRICORN)
- pkmn.setItem(:HEAVYBALL)
- # CREATES ZODIAC GEMS
- elsif (isConst?(pkmn.item,PBItems,:STARPIECE) ||
- isConst?(pkmn.item,PBItems,:COMETSHARD) ||
- isConst?(pkmn.item,PBItems,:WISHINGPIECE))
- pkmn.setItem(zodiacgem[rand(11)])
- # CREATES STARDUST
- elsif pbIsZodiacGem?(pkmn.item)
- pkmn.setItem(:STARDUST)
- $PokemonBag.pbStoreItem(:STARDUST)
- else
- # CREATES POWDER
- pkmn.setItem(junkitem[rand(12)])
- end
- if !pkmn.hasItem? #Gives junk item if named item isn't present
- pkmn.setItem(junkitem[rand(12)])
- end
- pbRitualAnimation(pkmn)
- $PokemonBag.pbDeleteItem(:STARDUST)
- pbWait(1)
- pbMEPlay("Pkmn get")
- if isConst?(pkmn.item,PBItems,:LEFTOVERS)
- Kernel.pbMessage(_INTL("{1} created some <c2=65467b14>{2}</c2> using the power of <c2=65467b14>{3}</c2>!",
- pkmn.name,PBItems.getName(pkmn.item),pkmn.pbGetBirthsignName))
- elsif ['a','e','i','o','u'].include?(PBItems.getName(pkmn.item)[0,1].downcase)
- Kernel.pbMessage(_INTL("{1} created an <c2=65467b14>{2}</c2> using the power of <c2=65467b14>{3}</c2>!",
- pkmn.name,PBItems.getName(pkmn.item),pkmn.pbGetBirthsignName))
- else
- Kernel.pbMessage(_INTL("{1} created a <c2=65467b14>{2}</c2> using the power of <c2=65467b14>{3}</c2>!",
- pkmn.name,PBItems.getName(pkmn.item),pkmn.pbGetBirthsignName))
- end
- pbWait(2)
- end
- end
- end
- #===============================================================================
- # Birthsigns - The Cultist
- # Summon Skill effect: Spawns a wild Shadow Pokemon by sacrificing stats.
- #===============================================================================
- elsif cmdSummon>=0 && command==cmdSummon
- # The species list that may be summoned
- speciesS=[:MEWTWO,:LUGIA,:REGIGIGAS,:GIRATINA,:DARKRAI,:ARCEUS,:DIALGA,
- :PALKIA,:ZEKROM,:RESHIRAM]
- speciesA=[:GENGAR,:MISMAGIUS,:CHANDELURE,:COFAGRIGUS,:HYDREIGON,:GOLURK,
- :GOTHITELLE,:GLISCOR,:DUSKNOIR,:SPIRITOMB]
- speciesB=[:WEEZING,:BANNET,:DUSCLOPS,:ABSOL,:SWOOBAT,:LIEPARD,:ZWEILOUS,
- :ZOROARK,:SABLEYE,:GOTHORITA]
- speciesC=[:RATICATE,:ARBOK,:HYPNO,:GOLBAT,:MAROWAK,:HAUNTER,:ARIADOS,
- :GLIGAR,:LAMPENT,:HOUNDOOM]
- speciesD=[:KOFFING,:SHUPPET,:DUSKULL,:YAMASK,:WOOBAT,:PURRLOIN,:DEINO,
- :ZORUA,:GOLET,:GOTHITA]
- speciesE=[:RATTATA,:EKANS,:DROWZEE,:ZUBAT,:CUBONE,:GASTLY,:SPINARAK,
- :MISDREAVUS,:LITWICK,:HOUNDOUR]
- # The items that may be randomly held
- itemS=[:OLDAMBER,:COMETSHARD,:RELICSTATUE,:RELICCROWN,:LUCKYEGG,:LIFEORB,
- :ODDKEYSTONE,:REAPERCLOTH,:SACREDASH,:STARDUST]
- itemA=[:DUSKSTONE,:DAWNSTONE,:SHINYSTONE,:SKULLFOSSIL,:DOMEFOSSIL,
- :ODDKEYSTONE,:RELICBAND,:LUCKYEGG,:BIGNUGGET,:STARDUST]
- itemB=[:MOONSTONE,:SUNSTONE,:HELIXFOSSIL,:CLAWFOSSIL,:PLUMEFOSSIL,
- :LUCKYEGG,:RAREBONE,:NUGGET,:STARPIECE,:STARDUST]
- itemC=[:ROOTFOSSIL,:COVERFOSSIL,:ARMORFOSSIL,:SMOKEBALL,:STICKYBARB,
- :SPELLTAG,:STARPIECE,:STARDUST,:STARDUST,:STARDUST]
- itemD=[:REDSHARD,:YELLOWSHARD,:BLUESHARD,:GREENSHARD,:SMOKEBALL,
- :STICKYBARB,:CLEANSETAG,:STARDUST,:STARDUST,:STARDUST]
- itemE=[:ENERGYPOWDER,:HEALPOWDER,:CHARCOAL,:STICKYBARB,:EVERSTONE,
- :STARDUST,:STARDUST,:STARDUST,:STARDUST,:STARDUST]
- # The possible level ranges for each species rank
- levelS=[52,54,56,58,60,62,64,66,68,70]
- levelA=[40,41,42,43,44,45,46,47,48,49]
- levelB=[30,31,32,33,34,35,36,37,38,39]
- levelC=[20,21,22,23,24,25,26,27,28,29]
- levelD=[10,11,12,13,14,15,16,17,18,19]
- levelE=[2,3,4,4,5,5,6,7,8,9]
- if (!pbGetMetadata($game_map.map_id,MetadataOutdoor) || !PBDayNight.isNight?) && !$DEBUG
- Kernel.pbMessage(_INTL("This power can only be used under a night sky.",pkmn.name))
- elsif totalIVs==0
- Kernel.pbMessage(_INTL("{1}'s stats are too drained to summon anymore...",pkmn.name))
- elsif follower
- Kernel.pbMessage(_INTL("This power can't be used when you have someone with you."))
- else
- rank=["?","E","D","C","B","A","S"]
- if totalIVs>=180 && pkmn.level>=50 # Rank:S
- quality=6
- elsif totalIVs>=144 && pkmn.level>=40 # Rank:A
- quality=5
- elsif totalIVs>=108 && pkmn.level>=30 # Rank:B
- quality=4
- elsif totalIVs>=72 && pkmn.level>=20 # Rank:C
- quality=3
- elsif totalIVs>=36 && pkmn.level>=10 # Rank:D
- quality=2
- elsif totalIVs<36 || pkmn.level<10 # Rank:E
- quality=1
- end
- if Kernel.pbConfirmMessage(_INTL("Activate {1}'s birthsign?\n<c2=65467b14>Summon Rank: {2}</c2>",pkmn.name,rank[quality]))
- Kernel.pbMessage(_INTL("Activating this birthsign will drain {1}'s IV's.",pkmn.name))
- pbWait(10)
- if Kernel.pbConfirmMessage(_INTL("Continue summoning anyway?\n<c2=65467b14>Summon Rank: {1}</c2>",rank[quality]))
- Kernel.pbMessage(_INTL("{1}'s IV's were all reduced by {2}!",pkmn.name,quality))
- @scene.pbEndScene
- # Reduces user's IV's with each Summon
- pkmn.iv[0]-=quality
- pkmn.iv[0]=0 if pkmn.iv[0]<=0
- pkmn.iv[1]-=quality
- pkmn.iv[1]=0 if pkmn.iv[1]<=0
- pkmn.iv[2]-=quality
- pkmn.iv[2]=0 if pkmn.iv[2]<=0
- pkmn.iv[3]-=quality
- pkmn.iv[3]=0 if pkmn.iv[3]<=0
- pkmn.iv[4]-=quality
- pkmn.iv[4]=0 if pkmn.iv[4]<=0
- pkmn.iv[5]-=quality
- pkmn.iv[5]=0 if pkmn.iv[5]<=0
- pkmn.calcStats
- pkmn.hp=1 if pkmn.hp<=0
- pbRefresh
- pbRitualAnimation(pkmn)
- pbWait(10)
- Kernel.pbMessage(_INTL("A wild Pokémon was pulled from the void!"))
- Kernel.pbMessage(_INTL("The wild Pokémon attacked in a rage!"))
- pbWait(10)
- $game_switches[SUMMON_SWITCH]=true
- Events.onWildPokemonCreate+=proc {|sender,e|
- pokemon=e[0]
- if $game_switches[SUMMON_SWITCH]
- pokemon.iv=[31,31,31,31,31,31]
- pokemon.obtainText=_INTL("Summoned from the void.")
- pokemon.setAbility(2)
- pokemon.setBirthsign(0)
- pokemon.makeShadow
- if rand(100)>50
- pokemon.setItem(itemS[rand(9)]) if quality==6 # Rank:S
- pokemon.setItem(itemA[rand(9)]) if quality==5 # Rank:A
- pokemon.setItem(itemB[rand(9)]) if quality==4 # Rank:B
- pokemon.setItem(itemC[rand(9)]) if quality==3 # Rank:C
- pokemon.setItem(itemD[rand(9)]) if quality==2 # Rank:D
- pokemon.setItem(itemE[rand(9)]) if quality==1 # Rank:E
- end
- end
- }
- $PokemonGlobal.nextBattleBGM="Summon Battle"
- if quality==6 # Rank:S
- pbWildBattle(speciesS[rand(9)],levelS[rand(9)])
- elsif quality==5 # Rank:A
- pbWildBattle(speciesA[rand(9)],levelA[rand(9)])
- elsif quality==4 # Rank:B
- pbWildBattle(speciesB[rand(9)],levelB[rand(9)])
- elsif quality==3 # Rank:C
- pbWildBattle(speciesC[rand(9)],levelC[rand(9)])
- elsif quality==2 # Rank:D
- pbWildBattle(speciesD[rand(9)],levelD[rand(9)])
- elsif quality==1 # Rank:E
- pbWildBattle(speciesE[rand(9)],levelE[rand(9)])
- end
- $game_switches[SUMMON_SWITCH]=false
- end
- pbRefresh
- break
- end
- end
- #===============================================================================
- 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
- if pbTakeItemFromPokemon(pkmn,self)
- pbRefreshSingle(pkmnid)
- end
- end
- elsif cmdItem>=0 && command==cmdItem
- itemcommands = []
- cmdUseItem = -1
- cmdGiveItem = -1
- cmdTakeItem = -1
- cmdMoveItem = -1
- # Build the commands
- itemcommands[cmdUseItem=itemcommands.length] = _INTL("Use")
- itemcommands[cmdGiveItem=itemcommands.length] = _INTL("Give")
- itemcommands[cmdTakeItem=itemcommands.length] = _INTL("Take") if pkmn.hasItem?
- itemcommands[cmdMoveItem=itemcommands.length] = _INTL("Move") if pkmn.hasItem? && !pbIsMail?(pkmn.item)
- itemcommands[itemcommands.length] = _INTL("Cancel")
- command = @scene.pbShowCommands(_INTL("Do what with an item?"),itemcommands)
- if cmdUseItem>=0 && command==cmdUseItem # Use
- item = @scene.pbUseItem($PokemonBag,pkmn)
- if item>0
- pbUseItemOnPokemon(item,pkmn,self)
- pbRefreshSingle(pkmnid)
- end
- elsif cmdGiveItem>=0 && command==cmdGiveItem # Give
- item = @scene.pbChooseItem($PokemonBag)
- if item>0
- if pbGiveItemToPokemon(item,pkmn,self,pkmnid)
- pbRefreshSingle(pkmnid)
- end
- end
- elsif cmdTakeItem>=0 && command==cmdTakeItem # Take
- if pbTakeItemFromPokemon(pkmn,self)
- pbRefreshSingle(pkmnid)
- end
- elsif cmdMoveItem>=0 && command==cmdMoveItem # Move
- item = pkmn.item
- itemname = PBItems.getName(item)
- @scene.pbSetHelpText(_INTL("Move {1} to where?",itemname))
- oldpkmnid = pkmnid
- loop do
- @scene.pbPreSelect(oldpkmnid)
- pkmnid = @scene.pbChoosePokemon(true,pkmnid)
- break if pkmnid<0
- newpkmn = @party[pkmnid]
- if pkmnid==oldpkmnid
- break
- elsif newpkmn.egg?
- pbDisplay(_INTL("Eggs can't hold items."))
- elsif !newpkmn.hasItem?
- newpkmn.setItem(item)
- pkmn.setItem(0)
- @scene.pbClearSwitching
- pbRefresh
- pbDisplay(_INTL("{1} was given the {2} to hold.",newpkmn.name,itemname))
- break
- elsif pbIsMail?(newpkmn.item)
- pbDisplay(_INTL("{1}'s mail must be removed before giving it an item.",newpkmn.name))
- else
- newitem = newpkmn.item
- newitemname = PBItems.getName(newitem)
- if isConst?(newitem,PBItems,:LEFTOVERS)
- pbDisplay(_INTL("{1} is already holding some {2}.\1",newpkmn.name,newitemname))
- elsif ['a','e','i','o','u'].include?(newitemname[0,1].downcase)
- pbDisplay(_INTL("{1} is already holding an {2}.\1",newpkmn.name,newitemname))
- else
- pbDisplay(_INTL("{1} is already holding a {2}.\1",newpkmn.name,newitemname))
- end
- if pbConfirm(_INTL("Would you like to switch the two items?"))
- newpkmn.setItem(item)
- pkmn.setItem(newitem)
- @scene.pbClearSwitching
- pbRefresh
- pbDisplay(_INTL("{1} was given the {2} to hold.",newpkmn.name,itemname))
- pbDisplay(_INTL("{1} was given the {2} to hold.",pkmn.name,newitemname))
- break
- end
- end
- end
- end
- end
- end
- @scene.pbEndScene
- return nil
- end
- end
- #########[SECTION 5 - SUMMARY DISPLAY]##########
- #===============================================================================
- # Birthsigns Summary - Page rewrites
- #===============================================================================
- # Overwrites areas within the PScreen_Summary section.
- #===============================================================================
- class PokemonSummary_Scene
- #=============================================================================
- # Zodiac Token
- #=============================================================================
- def pbDisplaySummaryToken
- if @pokemon.hasBirthsign?
- overlay = @sprites["overlay"].bitmap
- imagepos=[]
- tokenpath1="Graphics/Pictures/Birthsigns/token%02d"
- tokenpath2="Graphics/Pictures/Birthsigns/bless_token%02d"
- if @pokemon.isBlessed?
- zodiactoken=sprintf(tokenpath2,PBBirthsigns.signValue(@pokemon.birthsign))
- else
- zodiactoken=sprintf(tokenpath1,PBBirthsigns.signValue(@pokemon.birthsign))
- end
- imagepos.push([zodiactoken,0,234,0,0,-1,-1])
- pbDrawImagePositions(overlay,imagepos)
- end
- end
- #===========================================================================
- # Birthsign Page Button
- #===========================================================================
- def pbDisplayZodiacButton
- if @pokemon.hasBirthsign?
- overlay = @sprites["overlay"].bitmap
- imagepos=[]
- button = sprintf("Graphics/Pictures/Birthsigns/Other/summarybutton")
- imagepos.push([button,158,316,0,0,-1,-1])
- pbDrawImagePositions(overlay,imagepos)
- end
- end
- #=============================================================================
- # Shiny Leaf - Shows Shiny Leaves or Crown
- #=============================================================================
- def pbDisplayShinyLeaf
- if SHOW_SHINY_LEAF
- leaf="Graphics/Pictures/Birthsigns/Other/leaf"
- leafcrown="Graphics/Pictures/Birthsigns/Other/leafcrown"
- overlay = @sprites["overlay"].bitmap
- imagepos=[]
- if @pokemon.leafflag!=nil && !@pokemon.egg?
- if @pokemon.shinyleaf==6 || @pokemon.shinyleaf>6
- imagepos.push([leafcrown,164,121,0,0,-1,-1])
- else
- imagepos.push([leaf,142,124,0,0,-1,-1]) if @pokemon.shinyleaf>4
- imagepos.push([leaf,152,124,0,0,-1,-1]) if @pokemon.shinyleaf>3
- imagepos.push([leaf,162,124,0,0,-1,-1]) if @pokemon.shinyleaf>2
- imagepos.push([leaf,172,124,0,0,-1,-1]) if @pokemon.shinyleaf>1
- imagepos.push([leaf,182,124,0,0,-1,-1]) if @pokemon.shinyleaf>0
- end
- end
- pbDrawImagePositions(overlay,imagepos)
- end
- end
- #=============================================================================
- # Egg Groups - Shows Pokemon's Egg Groups on Page 2 (Memo)
- #=============================================================================
- def pbDisplayEggGroups
- if SHOW_EGG_GROUPS
- if !@pokemon.egg?
- dexdata=pbOpenDexData
- pbDexDataOffset(dexdata,@pokemon.species,31)
- compat10=dexdata.fgetb
- compat11=dexdata.fgetb
- noGender=(@pokemon.isGenderless? && !isConst?(@pokemon.species,PBSpecies,:DITTO))
- eggGroupbitmap=AnimatedBitmap.new(_INTL("Graphics/Pictures/Birthsigns/Other/typesEgg"))
- eggGroup0rect=Rect.new(0,700,64,28)
- eggGroup1rect=Rect.new(0,compat10*28,64,28)
- eggGroup2rect=Rect.new(0,compat11*28,64,28)
- overlay = @sprites["overlay"].bitmap
- if (noGender && compat10!=0) || @pokemon.isCelestial?
- overlay.blt(364,336,eggGroupbitmap.bitmap,eggGroup0rect)
- elsif compat10==compat11
- overlay.blt(364,336,eggGroupbitmap.bitmap,eggGroup1rect)
- else
- overlay.blt(364,336,eggGroupbitmap.bitmap,eggGroup1rect)
- overlay.blt(432,336,eggGroupbitmap.bitmap,eggGroup2rect)
- end
- dexdata.close
- end
- if compat10>14 || @pokemon.isCelestial?
- textpos=[[_INTL("Egg Groups:"),234,334,0,Color.new(41,86,143),Color.new(150,177,210)]]
- else
- textpos=[[_INTL("Egg Groups:"),234,334,0,Color.new(64,64,64),Color.new(176,176,176)]]
- end
- pbDrawTextPositions(overlay,textpos)
- end
- end
- #=============================================================================
- # IV Stars - Shows IV Star ratings on Page 3 (Stats)
- #=============================================================================
- def pbDisplayIVStars
- if SHOW_IV_STARS
- nostar="Graphics/Pictures/Birthsigns/Other/starempty"
- lowstar="Graphics/Pictures/Birthsigns/Other/starlow"
- highstar="Graphics/Pictures/Birthsigns/Other/starhigh"
- perfectstar="Graphics/Pictures/Birthsigns/Other/starperfect"
- overlay = @sprites["overlay"].bitmap
- imagepos=[]
- imagepos.push([nostar,465,82,0,0,-1,-1])
- imagepos.push([nostar,465,126,0,0,-1,-1])
- imagepos.push([nostar,465,158,0,0,-1,-1])
- imagepos.push([nostar,465,190,0,0,-1,-1])
- imagepos.push([nostar,465,222,0,0,-1,-1])
- imagepos.push([nostar,465,254,0,0,-1,-1])
- #HP
- if @pokemon.iv[0]>30
- imagepos.push([perfectstar,465,82,0,0,-1,-1])
- elsif @pokemon.iv[0]>29
- imagepos.push([highstar,465,82,0,0,-1,-1])
- elsif @pokemon.iv[0]>0 && @pokemon.iv[0]<30
- imagepos.push([lowstar,465,82,0,0,-1,-1])
- end
- #Atk
- if @pokemon.iv[1]>30
- imagepos.push([perfectstar,465,126,0,0,-1,-1])
- elsif @pokemon.iv[1]>29
- imagepos.push([highstar,465,126,0,0,-1,-1])
- elsif @pokemon.iv[1]>0 && @pokemon.iv[1]<30
- imagepos.push([lowstar,465,126,0,0,-1,-1])
- end
- #Def
- if @pokemon.iv[2]>30
- imagepos.push([perfectstar,465,158,0,0,-1,-1])
- elsif @pokemon.iv[2]>29
- imagepos.push([highstar,465,158,0,0,-1,-1])
- elsif @pokemon.iv[2]>0 && @pokemon.iv[2]<30
- imagepos.push([lowstar,465,158,0,0,-1,-1])
- end
- #SpAtk
- if @pokemon.iv[4]>30
- imagepos.push([perfectstar,465,190,0,0,-1,-1])
- elsif @pokemon.iv[4]>29
- imagepos.push([highstar,465,190,0,0,-1,-1])
- elsif @pokemon.iv[4]>0 && @pokemon.iv[4]<30
- imagepos.push([lowstar,465,190,0,0,-1,-1])
- end
- #SpDef
- if @pokemon.iv[5]>30
- imagepos.push([perfectstar,465,222,0,0,-1,-1])
- elsif @pokemon.iv[5]>29
- imagepos.push([highstar,465,222,0,0,-1,-1])
- elsif @pokemon.iv[5]>0 && @pokemon.iv[5]<30
- imagepos.push([lowstar,465,222,0,0,-1,-1])
- end
- #Speed
- if @pokemon.iv[3]>30
- imagepos.push([perfectstar,465,254,0,0,-1,-1])
- elsif @pokemon.iv[3]>29
- imagepos.push([highstar,465,254,0,0,-1,-1])
- elsif @pokemon.iv[3]>0 && @pokemon.iv[3]<30
- imagepos.push([lowstar,465,254,0,0,-1,-1])
- end
- pbDrawImagePositions(overlay,imagepos)
- end
- end
- #=============================================================================
- def drawPage(page)
- if @pokemon.egg?
- drawPageOneEgg; return
- end
- @sprites["pokemon"].z = 255
- @sprites["itemicon"].item = @pokemon.item
- @sprites["itemicon"].visible = true
- overlay = @sprites["overlay"].bitmap
- overlay.clear
- base = Color.new(248,248,248)
- shadow = Color.new(104,104,104)
- # Set background image
- @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_#{page}")
- imagepos=[]
- # Show the Poké Ball containing the Pokémon
- ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%02d",@pokemon.ballused)
- imagepos.push([ballimage,14,60,0,0,-1,-1])
- # Show status/fainted/Pokérus infected icon
- status = -1
- status = 6 if @pokemon.pokerusStage==1
- status = @pokemon.status-1 if @pokemon.status>0
- status = 5 if @pokemon.hp==0
- if status>=0
- imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
- end
- # Show Pokérus cured icon
- if @pokemon.pokerusStage==2
- imagepos.push([sprintf("Graphics/Pictures/Summary/icon_pokerus"),176,100,0,0,-1,-1])
- end
- # Show shininess star
- if @pokemon.isShiny?
- imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
- end
- #===========================================================================
- # Page additions
- #===========================================================================
- pbDisplaySummaryToken
- pbDisplayShinyLeaf
- pbDisplayZodiacButton if @page==2
- pbDisplayEggGroups if @page==2
- pbDisplayIVStars if @page==3
- #===========================================================================
- # Draw all images
- pbDrawImagePositions(overlay,imagepos)
- textpos = []
- # Write various bits of text
- pagename = [_INTL("INFO"),
- _INTL("TRAINER MEMO"),
- _INTL("SKILLS"),
- _INTL("MOVES"),
- _INTL("RIBBONS"),
- # Family Tree compatibility
- if SHOW_FAMILYTREE
- _INTL("FAMILY TREE")
- end][page-1]
- textpos = [
- [pagename,26,16,0,base,shadow],
- [@pokemon.name,46,62,0,base,shadow],
- [@pokemon.level.to_s,46,92,0,Color.new(64,64,64),Color.new(176,176,176)],
- [_INTL("Item"),66,318,0,base,shadow]
- ]
- # Write the held item's name
- 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(192,200,208),Color.new(208,216,224)])
- end
- # Write the gender symbol
- 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
- # Draw all text
- pbDrawTextPositions(overlay,textpos)
- # Draw the Pokémon's markings
- drawMarkings(overlay,84,292)
- # Draw page-specific information
- case page
- when 1; drawPageOne
- when 2; drawPageTwo
- when 3; drawPageThree
- when 4; drawPageFour
- when 5; drawPageFive
- # Family Tree compatibility
- when 6; drawPageSix if SHOW_FAMILYTREE
- end
- end
- #===============================================================================
- # Page 1: Egg
- # Change: Item text is now hidden. Used for Partner Sign breeding effects.
- #===============================================================================
- def drawPageOneEgg
- @sprites["itemicon"].visible = false
- overlay = @sprites["overlay"].bitmap
- overlay.clear
- base = Color.new(248,248,248)
- shadow = Color.new(104,104,104)
- pbSetSystemFont(overlay)
- # Set background image
- @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_egg")
- imagepos = []
- # Show the Poké Ball containing the Pokémon
- ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%02d",@pokemon.ballused)
- imagepos.push([ballimage,14,60,0,0,-1,-1])
- # Draw all images
- pbDrawImagePositions(overlay,imagepos)
- # Write various bits of text
- textpos=[
- [_INTL("TRAINER MEMO"),26,16,0,base,shadow],
- [@pokemon.name,46,62,0,base,shadow]
- ]
- # Draw all text
- pbDrawTextPositions(overlay,textpos)
- memo = ""
- # Write date received
- if @pokemon.timeReceived
- date = @pokemon.timeReceived.day
- month = pbGetMonthName(@pokemon.timeReceived.mon)
- year = @pokemon.timeReceived.year
- memo += _INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",date,month,year)
- end
- # Write map name egg was received on
- mapname = pbGetMapNameFromId(@pokemon.obtainMap)
- if (@pokemon.obtainText rescue false) && @pokemon.obtainText!=""
- mapname=@pokemon.obtainText
- end
- if mapname && mapname!=""
- memo+=_INTL("<c3=404040,B0B0B0>A mysterious Pokémon Egg received from <c3=F83820,E09890>{1}<c3=404040,B0B0B0>.\n",mapname)
- else
- memo+=_INTL("<c3=404040,B0B0B0>A mysterious Pokémon Egg.\n",mapname)
- end
- memo+="\n" # Empty line
- # Write Egg Watch blurb
- memo += _INTL("<c3=404040,B0B0B0>\"The Egg Watch\"\n")
- eggstate = _INTL("It looks like this Egg will take a long time to hatch.")
- eggstate = _INTL("What will hatch from this? It doesn't seem close to hatching.") if @pokemon.eggsteps<10200
- eggstate = _INTL("It appears to move occasionally. It may be close to hatching.") if @pokemon.eggsteps<2550
- eggstate = _INTL("Sounds can be heard coming from inside! It will hatch soon!") if @pokemon.eggsteps<1275
- memo += sprintf("<c3=404040,B0B0B0>%s\n",eggstate)
- # Draw all text
- drawFormattedTextEx(overlay,232,78,268,memo)
- # Draw the Pokémon's markings
- drawMarkings(overlay,82,292)
- end
- #===============================================================================
- # Summary - Birthsign Page
- #===============================================================================
- # Draws the Birthsign Summary Page, accessible by pressing the confirm
- # button on the Memo Page (Page 2).
- #===============================================================================
- def drawBirthsignPage
- if @pokemon.hasBirthsign?
- overlay=@sprites["overlay"].bitmap
- overlay.clear
- imagepos=[]
- #=========================================================================
- # Images
- #=========================================================================
- bgpath="Graphics/Pictures/Birthsigns/birthsign%02d"
- zodiacimage=sprintf(bgpath,PBBirthsigns.signValue(@pokemon.birthsign))
- imagepos.push([zodiacimage,0,0,0,0,-1,-1])
- if SHOW_FAMILYTREE
- imagepos.push(["Graphics/Pictures/Birthsigns/Other/summaryFamilyTree",0,0,0,0,-1,-1])
- else
- imagepos.push(["Graphics/Pictures/Birthsigns/Other/summaryzboarder",0,0,0,0,-1,-1])
- end
- if @pokemon.isBirthday?
- imagepos.push(["Graphics/Pictures/Birthsigns/Other/bdayicon",190,316,0,0,-1,-1])
- end
- pbDrawImagePositions(overlay,imagepos)
- pbDisplaySummaryToken
- #=========================================================================
- # Text
- #=========================================================================
- zodiac=@pokemon.pbGetBirthsignName
- zodiacdesc=@pokemon.pbGetBirthsignDesc
- hatch=pbGetAbbrevMonthName(@pokemon.timeEggHatched.mon)
- if @pokemon.monthsign==nil
- month=pbGetAbbrevMonthName(0)
- else
- month=pbGetAbbrevMonthName(@pokemon.getCalendarsign)
- end
- 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} {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}",hatch,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,254,320,258,0,zodiacdesc,base,shadow)
- pbSetSystemFont(overlay)
- end
- end
- #===============================================================================
- # Family Tree compatibility
- #===============================================================================
- def pbGoToPrevious
- newindex = @partyindex
- while newindex>0
- newindex -= 1
- if @party[newindex] && (@page==1 || !@party[newindex].egg? ||
- (SHOW_FAMILYTREE && (@page==6 && SHOWFAMILYEGG)))
- @partyindex = newindex
- break
- end
- end
- end
- def pbGoToNext
- newindex = @partyindex
- while newindex<@party.length-1
- newindex += 1
- if @party[newindex] && (@page==1 || !@party[newindex].egg? ||
- (SHOW_FAMILYTREE && (@page==6 && SHOWFAMILYEGG)))
- @partyindex = newindex
- break
- end
- end
- end
- #===============================================================================
- # Summary Options
- # Hides item options for Eggs.
- #===============================================================================
- def pbOptions
- dorefresh = false
- commands = []
- cmdGiveItem = -1
- cmdTakeItem = -1
- cmdPokedex = -1
- cmdMark = -1
- if !@pokemon.egg?
- commands[cmdGiveItem = commands.length] = _INTL("Give item")
- commands[cmdTakeItem = commands.length] = _INTL("Take item") if @pokemon.hasItem?
- commands[cmdPokedex = commands.length] = _INTL("View Pokédex")
- end
- commands[cmdMark = commands.length] = _INTL("Mark")
- commands[commands.length] = _INTL("Cancel")
- command = pbShowCommands(commands)
- if cmdGiveItem>=0 && command==cmdGiveItem
- item = 0
- pbFadeOutIn(99999){
- scene = PokemonBag_Scene.new
- screen = PokemonBagScreen.new(scene,$PokemonBag)
- item = screen.pbChooseItemScreen(Proc.new{|item| pbCanHoldItem?(item) })
- }
- if item>0
- dorefresh = pbGiveItemToPokemon(item,@pokemon,self,@partyindex)
- end
- elsif cmdTakeItem>=0 && command==cmdTakeItem
- dorefresh = pbTakeItemFromPokemon(@pokemon,self)
- elsif cmdPokedex>=0 && command==cmdPokedex
- pbUpdateLastSeenForm(@pokemon)
- pbFadeOutIn(99999){
- scene = PokemonPokedexInfo_Scene.new
- screen = PokemonPokedexInfoScreen.new(scene)
- screen.pbStartSceneSingle(@pokemon.species)
- }
- dorefresh = true
- elsif cmdMark>=0 && command==cmdMark
- dorefresh = pbMarking(@pokemon)
- end
- return dorefresh
- end
- #===============================================================================
- # Summary - Page access
- #===============================================================================
- def pbScene
- pbPlayCry(@pokemon)
- loop do
- Graphics.update
- Input.update
- pbUpdate
- dorefresh = false
- # Family Tree compatibility
- if SHOW_FAMILYTREE
- handleInputsEgg
- end
- if Input.trigger?(Input::A)
- pbSEStop; pbPlayCry(@pokemon)
- elsif Input.trigger?(Input::B)
- pbPlayCancelSE
- break
- elsif Input.trigger?(Input::C)
- pbPlayDecisionSE
- #=======================================================================
- if @page==2 && @pokemon.hasBirthsign?
- drawBirthsignPage
- #=======================================================================
- elsif @page==4
- pbMoveSelection
- dorefresh = true
- elsif @page==5
- pbRibbonSelection
- dorefresh = true
- else
- dorefresh = pbOptions
- end
- elsif Input.trigger?(Input::UP) && @partyindex>0
- oldindex = @partyindex
- pbGoToPrevious
- if @partyindex!=oldindex
- @pokemon = @party[@partyindex]
- @sprites["pokemon"].setPokemonBitmap(@pokemon)
- @sprites["itemicon"].item = @pokemon.item
- pbSEStop; pbPlayCry(@pokemon)
- @ribbonOffset = 0
- # Family Tree compatibility
- if SHOW_FAMILYTREE
- if SHOWFAMILYEGG && @pokemon.isEgg? && @page==6
- dorefresh = false
- drawPageSix
- else
- dorefresh = true
- end
- else
- dorefresh = true
- end
- end
- elsif Input.trigger?(Input::DOWN) && @partyindex<@party.length-1
- oldindex = @partyindex
- pbGoToNext
- if @partyindex!=oldindex
- @pokemon = @party[@partyindex]
- @sprites["pokemon"].setPokemonBitmap(@pokemon)
- @sprites["itemicon"].item = @pokemon.item
- pbSEStop; pbPlayCry(@pokemon)
- @ribbonOffset = 0
- # Family Tree compatibility
- if SHOW_FAMILYTREE
- if SHOWFAMILYEGG && @pokemon.isEgg? && @page==6
- dorefresh = false
- drawPageSix
- else
- dorefresh = true
- end
- else
- dorefresh = true
- end
- end
- elsif Input.trigger?(Input::LEFT) && !@pokemon.egg?
- oldpage = @page
- @page -= 1
- @page = 1 if @page<1
- # Family Tree compatibility
- if SHOW_FAMILYTREE
- @page = 6 if @page>6
- else
- @page = 5 if @page>5
- end
- if @page!=oldpage # Move to next page
- pbPlayCursorSE
- @ribbonOffset = 0
- dorefresh = true
- end
- elsif Input.trigger?(Input::RIGHT) && !@pokemon.egg?
- oldpage = @page
- @page += 1
- @page = 1 if @page<1
- # Family Tree compatibility
- if SHOW_FAMILYTREE
- @page = 6 if @page>6
- else
- @page = 5 if @page>5
- end
- if @page!=oldpage # Move to next page
- pbPlayCursorSE
- @ribbonOffset = 0
- dorefresh = true
- end
- end
- if dorefresh
- drawPage(@page)
- end
- end
- return @partyindex
- end
- end
- #########[SECTION 6 - BREEDING MECHANICS]##########
- #===============================================================================
- # Birthsign Bonuses - Hatch effects
- #===============================================================================
- # Applies Birthsign effects to eggs.
- # Overwrites sections in PField_DayCare & PScreen_EggHatching
- #===============================================================================
- #===============================================================================
- # Legendary Breeding - Mew
- #===============================================================================
- # Defines Mew as a parent so that it may be used similarly to Ditto.
- #===============================================================================
- def pbIsMew?(pokemon)
- dexdata=pbOpenDexData
- pbDexDataOffset(dexdata,pokemon.species,31)
- compat10=dexdata.fgetb
- compat11=dexdata.fgetb
- dexdata.close
- return isConst?(compat10,PBEggGroups,:Ancestor) ||
- isConst?(compat11,PBEggGroups,:Ancestor)
- end
- #===============================================================================
- def pbDayCareGetCompat
- if pbDayCareDeposited==2
- pokemon1=$PokemonGlobal.daycare[0][0]
- pokemon2=$PokemonGlobal.daycare[1][0]
- return 0 if (pokemon1.isShadow? rescue false)
- return 0 if (pokemon2.isShadow? rescue false)
- #===========================================================================
- # Makes celestial species unbreedable
- #===========================================================================
- return 0 if pokemon1.isCelestial?
- return 0 if pokemon2.isCelestial?
- # Insert code here if certain forms of certain species cannot breed
- #===========================================================================
- # Legendary Breeding - Exceptions
- #===========================================================================
- # Prevents certain forms of legendaries from breeding.
- #===========================================================================
- return 0 if (isConst?(pokemon1.species,PBSpecies,:TORNADUS) && pokemon1.form!=1)
- return 0 if (isConst?(pokemon2.species,PBSpecies,:TORNADUS) && pokemon2.form!=1)
- return 0 if (isConst?(pokemon1.species,PBSpecies,:THUNDURUS) && pokemon1.form!=1)
- return 0 if (isConst?(pokemon2.species,PBSpecies,:THUNDURUS) && pokemon2.form!=1)
- return 0 if (isConst?(pokemon1.species,PBSpecies,:LANDORUS) && pokemon1.form!=1)
- return 0 if (isConst?(pokemon2.species,PBSpecies,:LANDORUS) && pokemon2.form!=1)
- return 0 if (isConst?(pokemon1.species,PBSpecies,:KYUREM) && pokemon1.form!=0)
- return 0 if (isConst?(pokemon2.species,PBSpecies,:KYUREM) && pokemon2.form!=0)
- return 0 if (isConst?(pokemon1.species,PBSpecies,:ZYGARDE) && pokemon1.form!=0)
- return 0 if (isConst?(pokemon2.species,PBSpecies,:ZYGARDE) && pokemon2.form!=0)
- return 0 if (isConst?(pokemon1.species,PBSpecies,:NECROZMA) && pokemon1.form!=0)
- return 0 if (isConst?(pokemon2.species,PBSpecies,:NECROZMA) && pokemon2.form!=0)
- #===========================================================================
- dexdata=pbOpenDexData
- pbDexDataOffset(dexdata,pokemon1.species,31)
- compat10=dexdata.fgetb
- compat11=dexdata.fgetb
- pbDexDataOffset(dexdata,pokemon2.species,31)
- compat20=dexdata.fgetb
- compat21=dexdata.fgetb
- dexdata.close
- if !isConst?(compat10,PBEggGroups,:Undiscovered) &&
- !isConst?(compat11,PBEggGroups,:Undiscovered) &&
- !isConst?(compat20,PBEggGroups,:Undiscovered) &&
- !isConst?(compat21,PBEggGroups,:Undiscovered)
- if compat10==compat20 || compat11==compat20 ||
- compat10==compat21 || compat11==compat21 ||
- #======================================================================
- # Legendary Breeding - Compatibility
- #======================================================================
- # Determines compatibility between Ditto/Mew and Legendaries/UB's.
- #======================================================================
- # Ditto can breed with any regular species.
- ((isConst?(compat10,PBEggGroups,:Ditto) ||
- isConst?(compat11,PBEggGroups,:Ditto) ||
- isConst?(compat20,PBEggGroups,:Ditto) ||
- isConst?(compat21,PBEggGroups,:Ditto)) &&
- # Ditto can't breed with legendary species or Ultra Beasts.
- !(isConst?(compat10,PBEggGroups,:Skycrest) ||
- isConst?(compat11,PBEggGroups,:Skycrest) ||
- isConst?(compat20,PBEggGroups,:Skycrest) ||
- isConst?(compat21,PBEggGroups,:Skycrest) ||
- isConst?(compat10,PBEggGroups,:Bestial) ||
- isConst?(compat11,PBEggGroups,:Bestial) ||
- isConst?(compat20,PBEggGroups,:Bestial) ||
- isConst?(compat21,PBEggGroups,:Bestial) ||
- isConst?(compat10,PBEggGroups,:Titan) ||
- isConst?(compat11,PBEggGroups,:Titan) ||
- isConst?(compat20,PBEggGroups,:Titan) ||
- isConst?(compat21,PBEggGroups,:Titan) ||
- isConst?(compat10,PBEggGroups,:Overlord) ||
- isConst?(compat11,PBEggGroups,:Overlord) ||
- isConst?(compat20,PBEggGroups,:Overlord) ||
- isConst?(compat21,PBEggGroups,:Overlord) ||
- isConst?(compat10,PBEggGroups,:Nebulous) ||
- isConst?(compat11,PBEggGroups,:Nebulous) ||
- isConst?(compat20,PBEggGroups,:Nebulous) ||
- isConst?(compat21,PBEggGroups,:Nebulous) ||
- isConst?(compat10,PBEggGroups,:Enchanted) ||
- isConst?(compat11,PBEggGroups,:Enchanted) ||
- isConst?(compat20,PBEggGroups,:Enchanted) ||
- isConst?(compat21,PBEggGroups,:Enchanted) ||
- isConst?(compat10,PBEggGroups,:Ancestor) ||
- isConst?(compat11,PBEggGroups,:Ancestor) ||
- isConst?(compat20,PBEggGroups,:Ancestor) ||
- isConst?(compat21,PBEggGroups,:Ancestor) ||
- isConst?(compat10,PBEggGroups,:Ultra) ||
- isConst?(compat11,PBEggGroups,:Ultra) ||
- isConst?(compat20,PBEggGroups,:Ultra) ||
- isConst?(compat21,PBEggGroups,:Ultra)
- )) ||
- # Mew can breed with any regular or legendary species.
- ((isConst?(compat10,PBEggGroups,:Ancestor) ||
- isConst?(compat11,PBEggGroups,:Ancestor) ||
- isConst?(compat20,PBEggGroups,:Ancestor) ||
- isConst?(compat21,PBEggGroups,:Ancestor)) &&
- # Mew cannot breed with Ditto or Ultra Beasts.
- !(isConst?(compat10,PBEggGroups,:Ditto) ||
- isConst?(compat11,PBEggGroups,:Ditto) ||
- isConst?(compat20,PBEggGroups,:Ditto) ||
- isConst?(compat21,PBEggGroups,:Ditto) ||
- isConst?(compat10,PBEggGroups,:Ultra) ||
- isConst?(compat11,PBEggGroups,:Ultra) ||
- isConst?(compat20,PBEggGroups,:Ultra) ||
- isConst?(compat21,PBEggGroups,:Ultra)
- ))
- #======================================================================
- if pbDayCareCompatibleGender(pokemon1,pokemon2)
- ret=1
- ret+=1 if pokemon1.species==pokemon2.species
- ret+=1 if pokemon1.trainerID!=pokemon2.trainerID
- return ret
- end
- end
- end
- end
- return 0
- end
- def pbDayCareGenerateEgg
- return if pbDayCareDeposited!=2
- if $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)
- #=============================================================================
- # Legendary Breeding - Egg Species
- #=============================================================================
- # Egg is always partner's species when breeding with Ditto or Mew.
- #=============================================================================
- mew0=pbIsMew?(pokemon0)
- mew1=pbIsMew?(pokemon1)
- if pokemon0.isFemale? || ditto0 || mew0
- babyspecies=(ditto0 || mew0) ? pokemon1.species : pokemon0.species
- mother=pokemon0
- father=pokemon1
- else
- babyspecies=(ditto1 || mew1) ? pokemon0.species : pokemon1.species
- mother=pokemon1
- father=pokemon0
- end
- #=============================================================================
- babyspecies=pbGetBabySpecies(babyspecies,mother.item,father.item)
- if (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)]
- #=============================================================================
- # Legendary Breeding - Baby Species
- #=============================================================================
- # Gets different species for legendary offsping under certain conditions.
- #=============================================================================
- # Manaphy produces Phione eggs unless mother is holding Mystic Water.
- elsif (isConst?(babyspecies,PBSpecies,:MANAPHY) && hasConst?(PBSpecies,:PHIONE) &&
- !isConst?(mother.item,PBItems,:MYSTICWATER))
- babyspecies=getConst(PBSpecies,:PHIONE)
- # Latias can produce Latias or Latios eggs.
- elsif (isConst?(babyspecies,PBSpecies,:LATIAS) && hasConst?(PBSpecies,:LATIOS)) ||
- (isConst?(babyspecies,PBSpecies,:LATIOS) && hasConst?(PBSpecies,:LATIAS))
- babyspecies=[getConst(PBSpecies,:LATIOS),
- getConst(PBSpecies,:LATIAS)][rand(2)]
- end
- # Mew can produce Mewtwo eggs while holding Berserk Gene.
- if (isConst?(mother.species,PBSpecies,:MEW) &&
- isConst?(father.species,PBSpecies,:MEW) &&
- isConst?(mother.item,PBItems,:BERSERKGENE))
- babyspecies=getConst(PBSpecies,:MEWTWO)
- # Regigigas can produce other Regi's eggs depending on held item.
- elsif (isConst?(mother.species,PBSpecies,:REGIGIGAS) &&
- isConst?(father.species,PBSpecies,:REGIGIGAS) &&
- isConst?(mother.item,PBItems,:HARDSTONE))
- babyspecies=getConst(PBSpecies,:REGIROCK)
- elsif (isConst?(mother.species,PBSpecies,:REGIGIGAS) &&
- isConst?(father.species,PBSpecies,:REGIGIGAS) &&
- isConst?(mother.item,PBItems,:NEVERMELTICE))
- babyspecies=getConst(PBSpecies,:REGICE)
- elsif (isConst?(mother.species,PBSpecies,:REGIGIGAS) &&
- isConst?(father.species,PBSpecies,:REGIGIGAS) &&
- isConst?(mother.item,PBItems,:IRONBALL))
- babyspecies=getConst(PBSpecies,:REGISTEEL)
- #=============================================================================
- 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) ||
- isConst?(babyspecies,PBSpecies,:FLABEBE) ||
- isConst?(babyspecies,PBSpecies,:PUMPKABOO) ||
- isConst?(babyspecies,PBSpecies,:ORICORIO) ||
- isConst?(babyspecies,PBSpecies,:MINIOR) ||
- #=============================================================================
- # Legendary Breeding - Form Inheritence
- #=============================================================================
- # Inherits mother's form, or partner's form if breeding with Ditto/Mew
- #=============================================================================
- isConst?(babyspecies,PBSpecies,:DEOXYS) ||
- isConst?(babyspecies,PBSpecies,:TORNADUS) ||
- isConst?(babyspecies,PBSpecies,:THUNDURUS) ||
- isConst?(babyspecies,PBSpecies,:LANDORUS)
- if pbIsDitto?(mother) || pbIsMew?(mother)
- egg.form=father.form
- else
- egg.form=mother.form
- end
- end
- # Zygarde always hatches in its 10% form
- if isConst?(babyspecies,PBSpecies,:ZYGARDE)
- egg.form=1 #Assumes form 0 is 50% Forme, and form 1 is 10% Forme.
- 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.hasMove?(k[1]) && father.hasMove?(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.hasMove?(atk)
- end
- end
- end
- # Inheriting Egg Moves
- if movefather.isMale?
- pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
- f.pos=(egg.fSpecies-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.hasMove?(atk)
- i+=1
- end
- end
- }
- end
- if USENEWBATTLEMECHANICS
- pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
- f.pos=(egg.fSpecies-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.hasMove?(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.pbHasItem?(:SHINYCHARM)
- 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]
- #=============================================================================
- # Birthsigns - The Ancestor
- # Passes down EV spreads of the parent to the offspring.
- #=============================================================================
- egg.ev=mother.ev if (mother.hasBirthsign? && mother.birthsign==19)
- egg.ev=father.ev if (father.hasBirthsign? && father.birthsign==19)
- if (mother.hasBirthsign? && mother.birthsign==19) &&
- (father.hasBirthsign? && father.birthsign==19)
- if rand(100)<50
- egg.ev=mother.ev
- else
- egg.ev=father.ev
- end
- end
- #=============================================================================
- 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
- #===============================================================================
- # Birthsigns - Partner & Rival sign bonuses
- #===============================================================================
- if ZODIACSET!=0
- rivalmatch = pbShareRivalsign?(mother,father)
- allymatch = pbSharePartnersign?(mother,father)
- allymonth = (mother.hasPartnersign?(Time.now.mon) || father.hasPartnersign?(Time.now.mon))
- mothergem = getZodiacGem(mother.monthsign)
- fathergem = getZodiacGem(father.monthsign)
- baseitem = [:STARDUST,:STARDUST,:STARDUST,:STARPIECE]
- rareitem = [:EVIOLITE,:SHEDSHELL,:LEFTOVERS,:LUCKYEGG]
- #===========================================================================
- # PARTNERS
- #===========================================================================
- # Has a 50% chance of inheriting only the parent's 30/31 IV's.
- # Egg steps required are halved, or even quartered.
- # Eggs sometimes hatch holding random item.
- #===========================================================================
- if allymatch
- # Passes down parent's IV's
- if rand(10)<5
- egg.iv[0]=mother.iv[0] if mother.iv[0]>29
- egg.iv[1]=mother.iv[1] if mother.iv[1]>29
- egg.iv[2]=mother.iv[2] if mother.iv[2]>29
- egg.iv[3]=mother.iv[3] if mother.iv[3]>29
- egg.iv[4]=mother.iv[4] if mother.iv[4]>29
- egg.iv[5]=mother.iv[5] if mother.iv[5]>29
- end
- if rand(10)<5
- egg.iv[0]=father.iv[0] if father.iv[0]>29
- egg.iv[1]=father.iv[1] if father.iv[1]>29
- egg.iv[2]=father.iv[2] if father.iv[2]>29
- egg.iv[3]=father.iv[3] if father.iv[3]>29
- egg.iv[4]=father.iv[4] if father.iv[4]>29
- egg.iv[5]=father.iv[5] if father.iv[5]>29
- end
- # Egg hatches with an item
- if rand(10)<5
- mothersign=(mother.monthsign)
- fathersign=(father.monthsign)
- egg.setItem(baseitem[rand(3)]) if rand(100)<=50
- if INCLUDE_ZPOWER
- egg.setItem(mothergem) if rand(100)<=25
- egg.setItem(fathergem) if rand(100)<=15
- end
- egg.setItem(rareitem[rand(3)]) if rand(100)<=5
- end
- # Egg steps are reduced
- if allymonth
- egg.eggsteps=eggsteps/4
- else
- egg.eggsteps=eggsteps/2
- end
- egg.calcStats
- end
- #===========================================================================
- # RIVALS
- #===========================================================================
- # Has a 50% chance of inheriting only the parent's 0 IV's.
- # Egg steps needed to hatch are increased.
- # Don't hatch with any bonus items.
- #===========================================================================
- if rivalmatch
- if rand(10)<5
- egg.iv[0]=mother.iv[0] if mother.iv[0]=0
- egg.iv[1]=mother.iv[1] if mother.iv[1]=0
- egg.iv[2]=mother.iv[2] if mother.iv[2]=0
- egg.iv[3]=mother.iv[3] if mother.iv[3]=0
- egg.iv[4]=mother.iv[4] if mother.iv[4]=0
- egg.iv[5]=mother.iv[5] if mother.iv[5]=0
- egg.iv[0]=father.iv[0] if father.iv[0]=0
- egg.iv[1]=father.iv[1] if father.iv[1]=0
- egg.iv[2]=father.iv[2] if father.iv[2]=0
- egg.iv[3]=father.iv[3] if father.iv[3]=0
- egg.iv[4]=father.iv[4] if father.iv[4]=0
- egg.iv[5]=father.iv[5] if father.iv[5]=0
- egg.calcStats
- end
- egg.eggsteps=eggsteps+1500
- end
- end
- #=============================================================================
- if rand(65536)<POKERUSCHANCE
- egg.givePokerus
- end
- # Family Tree compatibility
- if SHOW_FAMILYTREE
- egg.family = PokemonFamily.new(egg, father, mother)
- end
- $Trainer.party[$Trainer.party.length]=egg
- end
- #===============================================================================
- # Birthsigns - The Parent
- # Halves the steps needed to hatch an egg while in the party.
- #===============================================================================
- Events.onStepTaken+=proc {|sender,e|
- next if !$Trainer
- for egg in $Trainer.party
- if egg.eggsteps>0
- egg.eggsteps-=1
- for i in $Trainer.pokemonParty
- if isConst?(i.ability,PBAbilities,:FLAMEBODY) ||
- isConst?(i.ability,PBAbilities,:MAGMAARMOR) ||
- (i.hasBirthsign? && i.birthsign==22)
- egg.eggsteps-=1
- break
- end
- end
- if egg.eggsteps<=0
- egg.eggsteps=0
- pbHatch(egg)
- end
- end
- end
- }
- #===============================================================================
- # Legendary Breeding - Forming eggs with Arceus
- #===============================================================================
- def pbArceusEggSpawn
- if Kernel.pbConfirmMessage(_INTL("Would you like a Pokémon to form an egg?"))
- if $Trainer.party.length>=6
- Kernel.pbMessage(_INTL("There isn't enough space to carry an egg!"))
- else
- Kernel.pbMessage(_INTL("Please select a Pokémon."))
- pbChoosePokemon(1,3)
- poke=pbGetPokemon(1)
- if isConst?(poke.species,PBSpecies,:ARCEUS)
- if poke.egg?
- Kernel.pbMessage(_INTL("That Pokémon must be hatched before it can form an egg."))
- elsif (poke.isShadow? rescue false)
- Kernel.pbMessage(_INTL("{1} must be purified before it can form an egg.",poke.name))
- # Creates a Dialga egg
- elsif isConst?(poke.item,PBItems,:ADAMANTORB)
- Kernel.pbMessage(_INTL("{1} is radiating a mysterious energy...",poke.name))
- if Kernel.pbConfirmMessage(_INTL("Should {1} create an egg?",poke.name))
- pbRitualAnimation(poke)
- pbGenerateEgg(:DIALGA,_I("A Divine Force."))
- pkmn=$Trainer.lastParty
- pkmn.setItem(:ADAMANTORB)
- if poke.ballused!=4 && poke.ballused!=15
- pkmn.ballused=poke.ballused
- end
- pkmn.setNature(poke.nature) if rand(10)<5
- pkmn.iv[0]=poke.iv[0] if rand(10)<8
- pkmn.iv[1]=poke.iv[1] if rand(10)<8
- pkmn.iv[2]=poke.iv[2] if rand(10)<8
- pkmn.iv[3]=poke.iv[3] if rand(10)<8
- pkmn.iv[4]=poke.iv[4] if rand(10)<8
- pkmn.iv[5]=poke.iv[5] if rand(10)<8
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1} formed an egg!",poke.name))
- pbWait(5)
- Kernel.pbMessage(_INTL("{1}'s {2} fused with the egg!",
- poke.name,PBItems.getName(poke.item)))
- poke.item=0
- else
- Kernel.pbMessage(_INTL("You decided not to form an egg."))
- end
- # Creates a Palkia egg
- elsif isConst?(poke.item,PBItems,:LUSTROUSORB)
- Kernel.pbMessage(_INTL("{1} is radiating a mysterious energy...",poke.name))
- if Kernel.pbConfirmMessage(_INTL("Should {1} create an egg?",poke.name))
- pbRitualAnimation(poke)
- pbGenerateEgg(:PALKIA,_I("A Divine Force."))
- pkmn=$Trainer.lastParty
- pkmn.setItem(:LUSTROUSORB)
- if poke.ballused!=4 && poke.ballused!=15
- pkmn.ballused=poke.ballused
- end
- pkmn.setNature(poke.nature) if rand(10)<5
- pkmn.iv[0]=poke.iv[0] if rand(10)<8
- pkmn.iv[1]=poke.iv[1] if rand(10)<8
- pkmn.iv[2]=poke.iv[2] if rand(10)<8
- pkmn.iv[3]=poke.iv[3] if rand(10)<8
- pkmn.iv[4]=poke.iv[4] if rand(10)<8
- pkmn.iv[5]=poke.iv[5] if rand(10)<8
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1} formed an egg!",poke.name))
- pbWait(5)
- Kernel.pbMessage(_INTL("{1}'s {2} fused with the egg!",
- poke.name,PBItems.getName(poke.item)))
- poke.item=0
- else
- Kernel.pbMessage(_INTL("You decided not to form an egg."))
- end
- # Creates a Giratina egg
- elsif isConst?(poke.item,PBItems,:GRISEOUSORB)
- Kernel.pbMessage(_INTL("{1} is radiating a mysterious energy...",poke.name))
- if Kernel.pbConfirmMessage(_INTL("Should {1} create an egg?",poke.name))
- pbRitualAnimation(poke)
- pbGenerateEgg(:GIRATINA,_I("A Divine Force."))
- pkmn=$Trainer.lastParty
- pkmn.setItem(:GRISEOUSORB)
- if poke.ballused!=4 && poke.ballused!=15
- pkmn.ballused=poke.ballused
- end
- pkmn.setNature(poke.nature) if rand(10)<5
- pkmn.iv[0]=poke.iv[0] if rand(10)<8
- pkmn.iv[1]=poke.iv[1] if rand(10)<8
- pkmn.iv[2]=poke.iv[2] if rand(10)<8
- pkmn.iv[3]=poke.iv[3] if rand(10)<8
- pkmn.iv[4]=poke.iv[4] if rand(10)<8
- pkmn.iv[5]=poke.iv[5] if rand(10)<8
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1} formed an egg!",poke.name))
- pbWait(5)
- Kernel.pbMessage(_INTL("{1}'s {2} fused with the egg!",
- poke.name,PBItems.getName(poke.item)))
- poke.item=0
- else
- Kernel.pbMessage(_INTL("You decided not to form an egg."))
- end
- # Creates an Arceus egg
- elsif isConst?(poke.item,PBItems,:DIVINEPLATE)
- Kernel.pbMessage(_INTL("{1} is radiating a mysterious energy...",poke.name))
- if Kernel.pbConfirmMessage(_INTL("Should {1} create an egg?",poke.name))
- pbRitualAnimation(poke)
- pbGenerateEgg(:ARCEUS,_I("A Divine Force."))
- pkmn=$Trainer.lastParty
- if poke.ballused!=4 && poke.ballused!=15
- pkmn.ballused=poke.ballused
- end
- pkmn.setNature(poke.nature)
- pkmn.iv[0]=31
- pkmn.iv[1]=31
- pkmn.iv[2]=31
- pkmn.iv[3]=31
- pkmn.iv[4]=31
- pkmn.iv[5]=31
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1} formed an egg!",poke.name))
- pbWait(5)
- Kernel.pbMessage(_INTL("{1}'s {2} shattered!",
- poke.name,PBItems.getName(poke.item)))
- poke.item=0
- else
- Kernel.pbMessage(_INTL("You decided not to form an egg."))
- end
- # Creates a Type: Null egg
- elsif isConst?(poke.item,PBItems,:FALSEPLATE)
- Kernel.pbMessage(_INTL("{1} is radiating a mysterious energy...",poke.name))
- if Kernel.pbConfirmMessage(_INTL("Should {1} create an egg?",poke.name))
- pbRitualAnimation(poke)
- pbGenerateEgg(:TYPENULL,_I("A Corrupted Force."))
- pkmn=$Trainer.lastParty
- if poke.ballused!=4 && poke.ballused!=15
- pkmn.ballused=poke.ballused
- end
- pkmn.setNature(poke.nature)
- pkmn.iv[0]=poke.iv[0]
- pkmn.iv[1]=poke.iv[1]
- pkmn.iv[2]=poke.iv[2]
- pkmn.iv[3]=poke.iv[3]
- pkmn.iv[4]=poke.iv[4]
- pkmn.iv[5]=poke.iv[5]
- pbWait(1)
- pbMEPlay("Pkmn get")
- Kernel.pbMessage(_INTL("{1} formed an egg!",poke.name))
- pbWait(5)
- Kernel.pbMessage(_INTL("{1}'s {2} shattered!",
- poke.name,PBItems.getName(poke.item)))
- poke.item=0
- else
- Kernel.pbMessage(_INTL("You decided not to form an egg."))
- end
- else
- Kernel.pbMessage(_INTL("{1} isn't holding the correct item to form an egg.",poke.name))
- end
- elsif $game_variables[1]<0
- Kernel.pbMessage(_INTL("You decided not to form an egg."))
- elsif !isConst?(poke.species,PBSpecies,:ARCEUS)
- Kernel.pbMessage(_INTL("That Pokémon isn't capable of forming an egg."))
- end
- end
- $game_variables[1]=-1
- end
- end
- #===============================================================================
- alias birthsigns_hatch pbHatch
- def pbHatch(pokemon)
- birthsigns_hatch(pokemon)
- #=============================================================================
- # Applies corresponding Birthsign upon hatching
- #=============================================================================
- pokemon.setZodiacsign(Time.now.mon) if ZODIACSET!=0
- #=============================================================================
- end
- #===============================================================================
- # Birthsigns Bonuses - Shadow Pokemon
- #===============================================================================
- # Applies passive birthsign effects to a purified Shadow Pokemon if it was
- # obtained through an egg.
- #===============================================================================
- alias birthsigns_purify pbPurify
- def pbPurify(pokemon,scene)
- birthsigns_purify(pokemon,scene)
- #===========================================================================
- # Unlocks latent Birthsign on Shadow Pokemon
- #===========================================================================
- if pokemon.hasBirthsign?
- pokemon.applyBirthsignBonuses
- scene.pbDisplay(_INTL("{1} unlocked its birthsign!",pokemon.name))
- scene.pbDisplay(_INTL("{1} inherits the power of <c2=65467b14>{2}</c2>!",pokemon.name,pokemon.pbGetBirthsignName))
- end
- #===========================================================================
- end
- #########[SECTION 7 - BATTLE MECHANICS]##########
- #===============================================================================
- # Birthsign Bonuses - Battle Effects
- #===============================================================================
- # Applies Birthsign effects that alter conditions during or after battle.
- # Overwrites sections in PokeBattle_Battle & PField_Field.
- #===============================================================================
- def pbGenerateWildPokemon(species,level,isroamer=false)
- shadowpkmn=false
- genwildpoke = PokeBattle_Pokemon.new(species,level,$Trainer)
- items = genwildpoke.wildHoldItems
- firstpoke = $Trainer.firstPokemon
- chances = [50,5,1]
- chances = [60,20,5] if firstpoke && !firstpoke.egg? && 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
- #=============================================================================
- # Birthsigns - The Thief
- # Wild Pokemon have a chance of holding treasure when leading.
- #=============================================================================
- if genwildpoke.item==0
- baseloot = [:PEARL,:BIGPEARL,:RELICCOPPER,:NUGGET]
- rareloot = [:RELICSILVER,:PEARLSTRING,:RELICGOLD,:BIGNUGGET]
- epicloot = [:RELICVASE,:RELICBAND,:RELICSTATUE,:RELICCROWN]
- if firstpoke.hasBirthsign? && firstpoke.birthsign==10 && !firstpoke.fainted?
- genwildpoke.setItem(baseloot[rand(3)]) if rand(100)<=10
- genwildpoke.setItem(rareloot[rand(3)]) if rand(100)<=5
- genwildpoke.setItem(epicloot[rand(3)]) if rand(100)<1
- end
- end
- #=============================================================================
- # Birthsigns - The Companion
- # Wild Pokemon have a higher base happiness when leading.
- #=============================================================================
- if firstpoke.hasBirthsign? && firstpoke.birthsign==2 && !firstpoke.fainted?
- genwildpoke.happiness=genwildpoke.happiness*2
- end
- #=============================================================================
- # Birthsign - The Assassin
- # Wild Pokemon have a chance of being asleep for 1 turn when leading.
- #=============================================================================
- if firstpoke.hasBirthsign? && firstpoke.birthsign==21 && !firstpoke.fainted?
- if !isConst?(genwildpoke.ability,PBAbilities,:INSOMNIA) &&
- !isConst?(genwildpoke.ability,PBAbilities,:VITALSPIRIT) &&
- 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
- #=============================================================================
- # Birthsign - The Mirror
- # Wild Pokemon have a 50% chance of sharing each IV with the leading Pokemon.
- #=============================================================================
- if firstpoke.hasBirthsign? && firstpoke.birthsign==27 && !firstpoke.fainted?
- genwildpoke.iv[0]=firstpoke.iv[0] if !isroamer && rand(10)<5
- genwildpoke.iv[1]=firstpoke.iv[1] if !isroamer && rand(10)<5
- genwildpoke.iv[2]=firstpoke.iv[2] if !isroamer && rand(10)<5
- genwildpoke.iv[3]=firstpoke.iv[3] if !isroamer && rand(10)<5
- genwildpoke.iv[4]=firstpoke.iv[4] if !isroamer && rand(10)<5
- genwildpoke.iv[5]=firstpoke.iv[5] if !isroamer && rand(10)<5
- end
- #=============================================================================
- if hasConst?(PBItems,:SHINYCHARM) && $PokemonBag.pbHasItem?(:SHINYCHARM)
- 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
- if firstpoke && !firstpoke.egg?
- 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
- #=============================================================================
- # Fortune Teller Event
- #=============================================================================
- # Wild Pokemon spawn with a sign relative to the player's trainer sign.
- #=============================================================================
- if !genwildpoke.isBlessed?
- if pbFortuneEffectActive?
- if $PokemonGlobal.fortuneEqual==true
- genwildpoke.setZodiacsign($Trainer.getCalendarsign)
- elsif $PokemonGlobal.fortuneGood==true
- genwildpoke.setPartnersign($Trainer.getCalendarsign)
- genwildpoke.happiness=genwildpoke.happiness*1.5
- genwildpoke.setItem(getZodiacGem(genwildpoke.monthsign)) if rand(10)<5
- elsif $PokemonGlobal.fortuneBad==true
- genwildpoke.setRivalsign($Trainer.getCalendarsign)
- genwildpoke.happiness=genwildpoke.happiness/2
- end
- #=============================================================================
- # Birthsign - The Soulmate
- #=============================================================================
- # Wild Pokemon spawn with one of the user's Partner signs when leading.
- #=============================================================================
- elsif firstpoke.hasZodiacsign? && firstpoke.birthsign==32 && !firstpoke.fainted?
- genwildpoke.setPartnersign(firstpoke.getCalendarsign)
- else
- #=============================================================================
- # Birthsigns for wild encounters
- #=============================================================================
- if WILDBIRTHSIGNS==1
- # Generates wild Pokemon with the current month's sign
- genwildpoke.setZodiacsign(Time.now.mon)
- elsif WILDBIRTHSIGNS==2
- # Generates wild Pokemon with partner/rival signs of the current month
- randsign=rand(10)
- if randsign>5
- genwildpoke.setPartnersign(Time.now.mon)
- else
- genwildpoke.setRivalsign(Time.now.mon)
- end
- elsif WILDBIRTHSIGNS==3
- # Generates wild Pokemon with random zodiac signs
- genwildpoke.setRandomZodiac
- elsif WILDBIRTHSIGNS==4
- # Generates wild Pokemon with completely random signs
- genwildpoke.setRandomsign
- else
- # Generates wild Pokemon with no sign
- genwildpoke.setBirthsign(0)
- end
- 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
- # 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
- #=========================================================================
- # Birthsigns - The Apprentice
- # Doubles EV's gained from battles. Stacks with similar effects.
- #=========================================================================
- evgain*=2 if thispoke.birthsign==1 && !(thispoke.isShadow? rescue false)
- #=========================================================================
- 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
- # Gain experience
- 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.
- #===========================================================================
- if thispoke.birthsign==14 && !(thispoke.isShadow? rescue false)
- 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
- 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("levelup")
- 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
- # Gains 20% more prize money when leading.
- #=====================================================================
- firstpoke=$Trainer.party[0]
- if firstpoke.hasBirthsign? && firstpoke.birthsign==16 && !firstpoke.fainted?
- 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,pbCommaNumber(tmoney)))
- end
- end
- end
- #=========================================================================
- # Birthsign - The Aristocrat
- # Has a 50% chance of picking up spare change after wild battles.
- #=========================================================================
- firstpoke=$Trainer.party[0]
- if firstpoke.hasBirthsign? && firstpoke.birthsign==16 && !firstpoke.fainted?
- if rand(10)<5
- @extramoney+=5*firstpoke.level/2
- @extramoney=MAXMONEY if @extramoney>MAXMONEY
- end
- end
- #=========================================================================
- if @internalbattle && @extramoney>0
- @extramoney*=2 if @amuletcoin
- @extramoney*=2 if @doublemoney
- 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,pbCommaNumber(@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
- moneylost=pbMaxLevelFromIndex(0) # Player's Pokémon only, not partner's
- multiplier=[8,16,24,36,48,64,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("You lost against {1} and {2}!",@opponent[0].fullname,@opponent[1].fullname))
- else
- pbDisplayPaused(_INTL("You lost against\r\n{1}!",@opponent.fullname))
- end
- if moneylost>0
- pbDisplayPaused(_INTL("You gave ${1} to the winner...",pbCommaNumber(lostmoney)))
- end
- else
- pbDisplayPaused(_INTL("You have no more Pokémon that can fight!"))
- if moneylost>0
- pbDisplayPaused(_INTL("You panicked and dropped\r\n${1}...",pbCommaNumber(lostmoney)))
- end
- end
- pbDisplayPaused(_INTL("You blacked out!")) 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].pokerusStrain
- 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.fainted?
- battler=battler.pbPartner
- end
- pbDisplayBrief(_INTL("{1} threw one {2}!",self.pbPlayer.name,itemname))
- if battler.fainted?
- 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,pokemon.fSpecies,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% when leading.
- #=======================================================================
- firstpoke=$Trainer.party[0]
- if firstpoke.hasBirthsign? && firstpoke.birthsign==23 && !firstpoke.fainted?
- 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,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 if pokemon.isMega?) 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
- pokemon.forcedForm = false if MultipleForms.hasFunction?(pokemon.species,"getForm")
- @scene.pbHideCaptureBall
- if pbIsSnagBall?(ball) && @opponent
- pokemon.pbUpdateShadowMoves rescue nil
- @snaggedpokemon.push(pokemon)
- else
- pbStorePokemon(pokemon)
- end
- end
- end
- end
- end
- #===============================================================================
- # Birthsign - The Vampire
- #===============================================================================
- # Heals user while walking at night. Harms/Burns user while walking in daylight.
- #===============================================================================
- Events.onStepTakenTransferPossible+=proc {|sender,e|
- handled = e[0]
- next if handled[0]
- if $PokemonGlobal.stepcount%4==0
- flashed = false
- firstpoke=$Trainer.party[0]
- if $Trainer.party.length>0
- # Heals all users in the party with each step at night.
- if PBDayNight.isNight? && pbGetMetadata($game_map.map_id,MetadataOutdoor)
- for i in $Trainer.ablePokemonParty
- if i.birthsign==31
- i.hp += 1 if i.hp<i.totalhp
- i.healStatus
- end
- end
- end
- # Harms/Burns the user with each step outside during the day when leading.
- if (PBDayNight.isDay? && pbGetMetadata($game_map.map_id,MetadataOutdoor) &&
- firstpoke.birthsign==31 && !firstpoke.fainted?)
- if !flashed
- $game_screen.start_flash(Color.new(255,0,0,128), 4)
- flashed = true
- end
- firstpoke.hp -= 1 if firstpoke.hp>0
- # Immune to Burn effect if the user has the following Abilities/Type
- if (!firstpoke.isConst?(firstpoke.ability,PBAbilities,:WATERVEIL) &&
- !firstpoke.isConst?(firstpoke.ability,PBAbilities,:WATERBUBBLE) &&
- !firstpoke.isConst?(firstpoke.ability,PBAbilities,:COMATOSE) &&
- !firstpoke.pbHasType?(:FIRE))
- firstpoke.status = 3
- end
- if firstpoke.hp==0
- firstpoke.changeHappiness("faint")
- firstpoke.status = 0
- Kernel.pbMessage(_INTL("{1} fainted...",firstpoke.name))
- if defined? pbToggleFollowingPokemon
- $PokemonTemp.dependentEvents.refresh_sprite
- end
- end
- if pbAllFainted
- handled[0] = true
- pbCheckAllFainted
- end
- end
- end
- end
- }
- #===============================================================================
- # NPC Trainers - Party birthsigns
- #===============================================================================
- # Allows you to give birthsigns to NPC trainers' Pokemon.
- #
- # In the Trainer PBS file, you may add birthsigns to a trainer's Pokemon as the
- # 17th variable. Enter this sign in this format: "SIGN00" replacing the 00's
- # with the number of your desired birthsign (01-33).
- #
- # If you equip the appropriate Zodiac Gem to one of these Pokemon, they will
- # automatically activate its Zodiac Power on turn 1. Must have the Zodiac Power
- # add-on script installed for this to occur.
- #===============================================================================
- TPBIRTHSIGN = 17
- TPDEFAULTS = [0,10,0,0,0,0,0,nil,nil,0,false,nil,10,70,nil,false,0,0]
- def pbLoadTrainer(trainerid,trainername,partyid=0)
- if trainerid.is_a?(String) || trainerid.is_a?(Symbol)
- if !hasConst?(PBTrainers,trainerid)
- raise _INTL("Trainer type does not exist ({1}, {2}, ID {3})",trainerid,trainername,partyid)
- end
- trainerid=getID(PBTrainers,trainerid)
- end
- success=false
- items=[]
- party=[]
- opponent=nil
- trainers=load_data("Data/trainers.dat")
- for trainer in trainers
- name=trainer[1]
- thistrainerid=trainer[0]
- thispartyid=trainer[4]
- next if trainerid!=thistrainerid || name!=trainername || partyid!=thispartyid
- items=trainer[2].clone
- name=pbGetMessageFromHash(MessageTypes::TrainerNames,name)
- for i in RIVALNAMES
- if isConst?(trainerid,PBTrainers,i[0]) && $game_variables[i[1]]!=0
- name=$game_variables[i[1]]
- end
- end
- opponent=PokeBattle_Trainer.new(name,thistrainerid)
- opponent.setForeignID($Trainer) if $Trainer
- for poke in trainer[3]
- species=poke[TPSPECIES]
- level=poke[TPLEVEL]
- pokemon=PokeBattle_Pokemon.new(species,level,opponent)
- pokemon.forcedForm = true if poke[TPFORM]!=0 && MultipleForms.hasFunction?(pokemon.species,"getForm")
- pokemon.formNoCall=poke[TPFORM]
- pokemon.resetMoves
- pokemon.setItem(poke[TPITEM])
- if poke[TPMOVE1]>0 || poke[TPMOVE2]>0 || poke[TPMOVE3]>0 || poke[TPMOVE4]>0
- k=0
- for move in [TPMOVE1,TPMOVE2,TPMOVE3,TPMOVE4]
- pokemon.moves[k]=PBMove.new(poke[move])
- k+=1
- end
- pokemon.moves.compact!
- end
- pokemon.setAbility(poke[TPABILITY])
- pokemon.setGender(poke[TPGENDER])
- if poke[TPSHINY] # if this is a shiny Pokémon
- pokemon.makeShiny
- else
- pokemon.makeNotShiny
- end
- pokemon.setNature(poke[TPNATURE])
- iv=poke[TPIV]
- for i in 0...6
- pokemon.iv[i]=iv&0x1F
- pokemon.ev[i]=[85,level*3/2].min
- end
- pokemon.happiness=poke[TPHAPPINESS]
- pokemon.name=poke[TPNAME] if poke[TPNAME] && poke[TPNAME]!=""
- if poke[TPSHADOW] # if this is a Shadow Pokémon
- pokemon.makeShadow rescue nil
- pokemon.pbUpdateShadowMoves(true) rescue nil
- pokemon.makeNotShiny
- end
- pokemon.ballused=poke[TPBALL]
- pokemon.setBirthsign(poke[TPBIRTHSIGN])
- pokemon.calcStats
- party.push(pokemon)
- end
- success=true
- break
- end
- return success ? [opponent,items,party] : nil
- end
- #########[SECTION 8 - STORAGE DISPLAY]##########
- #===============================================================================
- # PC Modifications - Storage Scene
- #===============================================================================
- # Allows birthsign tokens to be displayed in the PC storage window.
- # Overwrites sections in PScreen_Storage.
- #===============================================================================
- class PokemonStorageScene
- def pbUpdateOverlay(selection,party=nil)
- overlay = @sprites["overlay"].bitmap
- overlay.clear
- buttonbase = Color.new(248,248,248)
- buttonshadow = Color.new(80,80,80)
- pbDrawTextPositions(overlay,[
- [_INTL("Party: {1}",(@storage.party.length rescue 0)),270,328,2,buttonbase,buttonshadow,1],
- [_INTL("Exit"),446,328,2,buttonbase,buttonshadow,1],
- ])
- 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"].z = 0
- base = Color.new(88,88,80)
- shadow = Color.new(168,184,184)
- nonbase = Color.new(208,208,208)
- nonshadow = Color.new(224,224,224)
- pokename = pokemon.name
- textstrings = [
- [pokename,10,8,false,base,shadow]
- ]
- if !pokemon.egg?
- imagepos = []
- 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
- imagepos.push(["Graphics/Pictures/Storage/overlay_lv",6,246,0,0,-1,-1])
- textstrings.push([pokemon.level.to_s,28,234,false,base,shadow])
- if pokemon.ability>0
- textstrings.push([PBAbilities.getName(pokemon.ability),86,306,2,base,shadow])
- else
- textstrings.push([_INTL("No ability"),86,306,2,nonbase,nonshadow])
- end
- if pokemon.item>0
- textstrings.push([PBItems.getName(pokemon.item),86,342,2,base,shadow])
- else
- textstrings.push([_INTL("No item"),86,342,2,nonbase,nonshadow])
- end
- if pokemon.isShiny?
- imagepos.push(["Graphics/Pictures/shiny",156,198,0,0,-1,-1])
- end
- #=========================================================================
- # Birthsigns - Token Display
- #=========================================================================
- if pokemon.birthsign>0 && !(pokemon.isShadow? rescue false) && !pokemon.egg?
- imagepos.push(["Graphics/Pictures/Birthsigns/Other/storagesign",142,161,0,0,-1,-1])
- tokenpath1="Graphics/Pictures/Birthsigns/token%02d"
- tokenpath2="Graphics/Pictures/Birthsigns/bless_token%02d"
- if pokemon.isBlessed?
- zodiactoken=sprintf(tokenpath2,PBBirthsigns.signValue(pokemon.birthsign))
- else
- zodiactoken=sprintf(tokenpath1,PBBirthsigns.signValue(pokemon.birthsign))
- end
- imagepos.push([zodiactoken,148,166,0,0,-1,-1])
- end
- #=========================================================================
- # Shiny Leaf
- #=========================================================================
- if SHOW_SHINY_LEAF
- leaf="Graphics/Pictures/Birthsigns/Other/leaf"
- leafcrown="Graphics/Pictures/Birthsigns/Other/leafcrown"
- if pokemon.leafflag!=nil
- if pokemon.shinyleaf==6 || pokemon.shinyleaf>6
- imagepos.push([leafcrown,140,47,0,0,-1,-1])
- else
- imagepos.push([leaf,118,50,0,0,-1,-1]) if pokemon.shinyleaf>4
- imagepos.push([leaf,128,50,0,0,-1,-1]) if pokemon.shinyleaf>3
- imagepos.push([leaf,138,50,0,0,-1,-1]) if pokemon.shinyleaf>2
- imagepos.push([leaf,148,50,0,0,-1,-1]) if pokemon.shinyleaf>1
- imagepos.push([leaf,158,50,0,0,-1,-1]) if pokemon.shinyleaf>0
- end
- end
- end
- #=========================================================================
- # IV Star Gauge
- #=========================================================================
- if SHOW_IV_STARS
- nostar="Graphics/Pictures/Birthsigns/Other/starempty"
- lowstar="Graphics/Pictures/Birthsigns/Other/starlow"
- highstar="Graphics/Pictures/Birthsigns/Other/starhigh"
- perfectstar="Graphics/Pictures/Birthsigns/Other/starperfect"
- #HP
- if pokemon.iv[0]>30
- imagepos.push([perfectstar,8,198,0,0,-1,-1])
- elsif pokemon.iv[0]>29
- imagepos.push([highstar,8,198,0,0,-1,-1])
- elsif pokemon.iv[0]>0 && pokemon.iv[0]<30
- imagepos.push([lowstar,8,198,0,0,-1,-1])
- else
- imagepos.push([nostar,8,198,0,0,-1,-1])
- end
- #Atk
- if pokemon.iv[1]>30
- imagepos.push([perfectstar,24,198,0,0,-1,-1])
- elsif pokemon.iv[1]>29
- imagepos.push([highstar,24,198,0,0,-1,-1])
- elsif pokemon.iv[1]>0 && pokemon.iv[1]<30
- imagepos.push([lowstar,24,198,0,0,-1,-1])
- else
- imagepos.push([nostar,24,198,0,0,-1,-1])
- end
- #Def
- if pokemon.iv[2]>30
- imagepos.push([perfectstar,40,198,0,0,-1,-1])
- elsif pokemon.iv[2]>29
- imagepos.push([highstar,40,198,0,0,-1,-1])
- elsif pokemon.iv[2]>0 && pokemon.iv[2]<30
- imagepos.push([lowstar,40,198,0,0,-1,-1])
- else
- imagepos.push([nostar,40,198,0,0,-1,-1])
- end
- #SpAtk
- if pokemon.iv[4]>30
- imagepos.push([perfectstar,56,198,0,0,-1,-1])
- elsif pokemon.iv[4]>29
- imagepos.push([highstar,56,198,0,0,-1,-1])
- elsif pokemon.iv[4]>0 && pokemon.iv[4]<30
- imagepos.push([lowstar,56,198,0,0,-1,-1])
- else
- imagepos.push([nostar,56,198,0,0,-1,-1])
- end
- #SpDef
- if pokemon.iv[5]>30
- imagepos.push([perfectstar,72,198,0,0,-1,-1])
- elsif pokemon.iv[5]>29
- imagepos.push([highstar,72,198,0,0,-1,-1])
- elsif pokemon.iv[5]>0 && pokemon.iv[5]<30
- imagepos.push([lowstar,72,198,0,0,-1,-1])
- else
- imagepos.push([nostar,72,198,0,0,-1,-1])
- end
- #Speed
- if pokemon.iv[3]>30
- imagepos.push([perfectstar,88,198,0,0,-1,-1])
- elsif pokemon.iv[3]>29
- imagepos.push([highstar,88,198,0,0,-1,-1])
- elsif pokemon.iv[3]>0 && pokemon.iv[3]<30
- imagepos.push([lowstar,88,198,0,0,-1,-1])
- else
- imagepos.push([nostar,88,198,0,0,-1,-1])
- end
- 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,70,240,128,20,pokemon.markings)
- pbDrawImagePositions(overlay,imagepos)
- end
- pbDrawTextPositions(overlay,textstrings)
- @sprites["pokemon"].setPokemonBitmap(pokemon)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement