-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Hyper Training
To start off, special thanks to the following contributors:
- ShiraTheMogul for the initial write-up on this process
- VimesCarrot for the original DV-increasing script
Hyper Training is a mechanic introduced in Generation VII where you can exchange Bottle Caps with a "Mr. Hyper" NPC to change your Pokemon's IVs to perfect-31s. This tutorial ports that mechanic to RBY. Our "Mr. Hyper NPC" will boost your lead Pokemon's DV to all 15s; he will take Bottle Caps as payment, and for convenience he will NOT offer to boost a Pokemon that is already perfect.
Note: With this code as presented, he will ONLY offer to boost the Pokemon in your lead slot. Worry not; the text I've included for him makes this perfectly clear, and you can just rearrange your team accordingly to boost the desired team member. If anyone can include something to allow the player to choose which Pokemon gets boosted, I'd be all for it. I simply could NOT it to work that way, despite many attempts...
Also note: This process does not result in an immediate change in stats. You'll need to either level up your Pokemon or deposit it in the PC to get the stats to update properly. Again, Mr. Hyper's text will inform the player of this.
First, we'll need to create a Mr. Hyper NPC. For this tutorial I'm going to put him on the Celadon Mansion Roof, but of course you can choose to put him wherever you like!
We'll start off by going to data\maps\objects\CeladonMansionRoof and making the following additions:
+ object_const_def
+ const_export CELADON_MANSION_ROOF_SCIENTIST ; I used a Scientist sprite. Check `constants\sprite_constants.asm` for a full list of options
+
CeladonMansionRoof_Object:
db $9 ; border block
def_warp_events
warp_event 6, 1, CELADON_MANSION_3F, 2
warp_event 2, 1, CELADON_MANSION_3F, 3
warp_event 2, 7, CELADON_MANSION_ROOF_HOUSE, 1
def_bg_events
bg_event 3, 7, TEXT_CELADONMANSIONROOF_HOUSE_SIGN
def_object_events
+ object_event 1, 10, SPRITE_SCIENTIST, STAY, RIGHT, TEXT_CELADONMANSIONROOF_SCIENTIST ; He'll appear in the bottom-left corner of the map
def_warps_to CELADON_MANSION_ROOF
Here's where a lot of the heavy stuff happens. Go to scripts\CeladonMansionRoof and start by inserting the following:
...
CeladonMansionRoof_TextPointers:
def_text_pointers
+ dw_const CeladonMansionRoofMrHyperText, TEXT_CELADONMANSIONROOF_SCIENTIST
dw_const CeladonMansionRoofHouseSignText, TEXT_CELADONMANSIONROOF_HOUSE_SIGN
...Next, insert the following large block of code (heavily annotated for hopeful clarity):
...
dw_const CeladonMansionRoofHouseSignText, TEXT_CELADONMANSIONROOF_HOUSE_SIGN
+CeladonMansionRoofMrHyperText:
+ text_asm
+ ld hl, CeladonMansionRoofMrHyperIntroText ; Displays Mr. Hyper's generic IntroText
+ call PrintText
+ ld b, BOTTLE_CAP
+ call IsItemInBag ; Checks if there is a Bottle Cap in your bag
+ jp z, .StopByAnytime ; If not, the player is turned away. If so, begin preparing for following LeadMonText:
+ ld a, [wWhichPokemon] ; Loads a party Mon name (in this case, the last party slot) into register 'a'
+ ld bc, wPartyMon2 - wPartyMon1 ; Moves up through the party list
+ call AddNTimes ; Keeps us moving until the top (lead Mon) slot is reached
+ ld hl, wPartyMonNicks ; Loads in the Mon nickname
+ call GetPartyMonName ; Sets the name to be referenced by wNameBuffer in text\CeladonMansionRoof.asm
+ ld hl, CeladonMansionRoofMrHyperLeadMonText ; Now Mr. Hyper will mention your lead Mon here in his LeadMon text
+ call PrintText
+.CheckForPerfectDVs: ; This section of code will check to see if your lead Mon already has perfect DVs:
+ ld hl, wPartyMon1DVs ; Loads in lead Mon's full set of current DVs into register 'hl'
+ ld a, [hli] ; Loads Attack and Defense DVs into register 'a'
+ cp MAX_DVS ; Checks if Attack and Defense are already at max value (FF)
+ jr nz, .CeladonMansionRoofMrHyperOfferTraining ; If not, jump to where Mr. Hyper offers Hyper Training
+ ld a, [hl] ; If they are max value, load Speed and Special DVs into register 'a'
+ cp MAX_DVS ; Now checks if Speed and Special are already at max value
+ jp z, .NothingToDo ; If already max, the training is NOT offered. If not max, move on to OfferTrainingText
+.CeladonMansionRoofMrHyperOfferTraining:
+ ld hl, CeladonMansionRoofMrHyperOfferTrainingText
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jp nz, .RefusedTraining
+ ld hl, HandOverBottleCapText
+ call PrintText
+ ld a, BOTTLE_CAP ; Loads BOTTLE_CAP into register 'a'
+ ldh [hItemToRemoveID], a ; Prepares for item removal
+ farcall RemoveItemByID ; One Bottle Cap is removed from player inventory
+ ld hl, PlayerHandedOverBottleCapText
+ call PrintText
+ ld hl, NowWeBeginText
+ call PrintText
+ ld hl, wPartyMon1DVs ; Load lead Mon DVs into register 'hl'
+ ld a, $FF ; Load FF (for two perfect 15 DVs) into register 'a'
+ ld [hli], a ; Overwrite lead Mon's current Attack and Defense DVs with the FF in register 'a'
+ ld [hl], a ; Overwrite lead Mon's current Speed and Special DVs with the FF in register 'a'
+; You can insert some audio-visual fluff here. I've included some sample fluff as part of the tutorial. Tweak it to your liking!
+ ld hl, TrainingCompleteText ; Finally, display the end text
+ jr .done ; You're now free to leave and use your newly buffed Mon in battle
+.StopByAnytime
+ ld hl, .StopByAnytimeText
+ jr .done
+.NothingToDo
+ ld hl, .NothingToDoText
+ jr .done
+.RefusedTraining
+ ld hl, .RefusedTrainingText
+ jr .done
+.done
+ call PrintText
+ jp TextScriptEnd
+
+.StopByAnytimeText
+ text_far _StopByAnytimeText
+ text_end
+
+.NothingToDoText
+ text_far _NothingToDoText
+ text_end
+
+.RefusedTrainingText
+ text_far _RefusedTrainingText
+ text_end
+
+CeladonMansionRoofMrHyperIntroText:
+ text_far _CeladonMansionRoofMrHyperIntroText
+ text_end
+
+CeladonMansionRoofMrHyperLeadMonText:
+ text_far _CeladonMansionRoofMrHyperLeadMonText
+ text_end
+
+CeladonMansionRoofMrHyperOfferTrainingText:
+ text_far _CeladonMansionRoofMrHyperOfferTrainingText
+ text_end
+
+HandOverBottleCapText:
+ text_far _HandOverBottleCapText
+ text_end
+
+PlayerHandedOverBottleCapText:
+ text_far _PlayerHandedOverBottleCapText
+ sound_get_key_item
+ text_end
+
+NowWeBeginText:
+ text_far _NowWeBeginText
+ text_end
+
+TrainingCompleteText:
+ text_far _TrainingCompleteText
+ text_end
+
CeladonMansionRoofHouseSignText:
text_far _CeladonMansionRoofHouseSignText
text_endIf you noticed the comment line regarding "audio/visual fluff," you can take the following and paste it over that comment to make your Hyper Training Process look and sound a bit more polished. This is OPTIONAL, and not doing so will have no effect on the DV-boosting process:
...
ld hl, NowWeBeginText
call PrintText
ld hl, wPartyMon1DVs ; Load lead Mon DVs into register 'hl'
ld a, $FF ; Load FF (for two perfect 15 DVs) into register 'a'
ld [hli], a ; Overwrite lead Mon's current Attack and Defense DVs with the FF in register 'a'
ld [hl], a ; Overwrite lead Mon's current Speed and Special DVs with the FF in register 'a'
-; You can insert some audio-visual fluff here. I've included some sample fluff as part of the tutorial. Tweak it to your liking!
+ call GBFadeOutToBlack
+ ld c, 30 ; Loads a selected number into register 'c'
+ call DelayFrames ; Delays next effect by number of frames specified in register 'c' (60 frames = 1 second)
+ ld a, SFX_HEAL_HP ; Sound effect to be played (see \constants\music_constants.asm for full list of options)
+ call PlaySound ; plays sound effect or music specified in register 'a'
+ call WaitForSoundToFinish
+ ld c, 60
+ call DelayFrames
+ ld a, SFX_GET_ITEM_2
+ call PlaySound
+ call WaitForSoundToFinish
+ ld c, 30
+ call DelayFrames
+ call GBFadeInFromBlack
ld hl, TrainingCompleteText ; Finally, display the end text
jr .done ; You're now free to leave and use your newly buffed Mon in battle
...Now we need to wrap up one loose end before we move on: the game does not have a MAX_DVS to reference for the instruction cp MAX_DVS. Fortunately, it's extremely simple to address this. Head over to constants\battle_constants.asm and insert the following single line (around line 70 or so):
...
DEF MAX_STAT_VALUE EQU 999
+DEF MAX_DVS EQU $FF
; trainer dvs
DEF ATKDEFDV_TRAINER EQU $98
DEF SPDSPCDV_TRAINER EQU $88
...That's it for that! Now we decide exactly what Mr. Hyper will say to you...
Now open up text\CeladonMansionRoof.asm and paste in the following:
+_CeladonMansionRoofMrHyperIntroText::
+ text "Everyone calls me"
+ line "MR. HYPER."
+
+ para "I know how to"
+ line "HYPER TRAIN your"
+ cont "#MON to bring"
+ cont "out its full"
+ cont "potential."
+
+ para "I also love to"
+ line "collect BOTTLE"
+ cont "CAPS..."
+ prompt
+
+_StopByAnytimeText::
+ text "Stop by anytime"
+ line "with a BOTTLE"
+ cont "CAP and I'll be"
+ cont "happy to make"
+ cont "your lead #MON"
+ cont "stronger."
+ done
+
+_CeladonMansionRoofMrHyperLeadMonText::
+ text "Now let's have a"
+ line "look at your"
+ cont "@"
+ text_ram wNameBuffer
+ text "..."
+ prompt
+
+_NothingToDoText::
+ text "There's nothing"
+ line "more I can do."
+
+ para "This is what peak"
+ line "performance looks"
+ cont "like!"
+ done
+
+_CeladonMansionRoofMrHyperOfferTrainingText::
+ text "It looks like it"
+ line "could benefit"
+ cont "from some of my"
+ cont "specialized help."
+
+ para "In exchange for a"
+ line "BOTTLE CAP, would"
+ cont "you like me to"
+ cont "power up your"
+ cont "@"
+ text_ram wNameBuffer
+ text "?"
+ done
+
+_RefusedTrainingText::
+ text "Why? I promise"
+ line "it's totally safe!"
+ done
+
+_HandOverBottleCapText::
+ text "Excellent!"
+
+ para "Now, if you'd"
+ line "kindly hand over"
+ cont "a BOTTLE CAP..."
+ prompt
+
+_PlayerHandedOverBottleCapText::
+ text "<PLAYER> handed"
+ line "over a"
+ cont "BOTTLE CAP!@"
+ text_end
+
+_NowWeBeginText::
+ text "Now we begin! It"
+ line "won't take long."
+ prompt
+
+_TrainingCompleteText::
+ text "The training is"
+ line "complete."
+
+ para "Now, you may not"
+ line "notice any"
+ cont "immediate changes"
+ cont "in your #MON,"
+ cont "but don't worry."
+
+ para "With a little"
+ line "further training"
+ cont "its gains will"
+ cont "become obvious!"
+
+ para "Thanks for"
+ line "stopping by."
+ done
+
_CeladonMansionRoofHouseSignText::
text "I KNOW EVERYTHING!"
donePretty self-explanatory section. Now you'll need to create the Bottle Cap item. To keep this tutorial from getting TOO long I'll just refer you to the Item Creation Tutorial: https://github.com/pret/pokered/wiki/Add-a-new-item. I recommend following the UnusableItem tutorial.
Now you just need to add the Bottle Cap item to various maps around the region, and you'll have a way to pay for Hyper Training services!
Thanks for following along. I'm definitely a player who will spend an inordinate amount of time catching multiples of the same Pokemon in the hopes of getting one that excels in everything. With this option now available I can now boost a full team to perfection if I want (in my personal ROM hack I've added exactly 6 of these... better choose wisely!). Best of luck to you in your implementation of your own Mr. Hyper!