mirror of https://github.com/pret/pokeemerald.git
Page:
Shop Items By Badge Count
Pages
Ability Switcher via special
Add A PokeVial Item
Add Ability to Avoid Battle Damage in Debug Menu
Add Ability to Swap Bikes Whenever
Add Choice Specs Scarf hold item effects
Add Description Submenu
Add Difficulty Mode
Add In‐Cart Rumble
Add Nuzlocke Challenge
Add PC Access in PokeNav
Add Physical Special Split
Add Sleep Mode
Add Thief Ball
Add a EV IV Stat Editor UI
Add a debug menu
Adding Multi region Support
Adding Support for Connectivity with Other Hacks Whilst Maintaining Connectivity with Vanilla
Adding Time Based Encounters
Adding Walking Animations to All NPCs
Adding a New Trainer Class
Adding a New Trainer Front Picture
Adding a Pokémon Type & Disabling the Mystery Type
Adding new event object or overworld sprites
All Trees Permanently Get Cut
Allow All Pokemon to Evolve Without Trading
Allow Both Latios and Latias Appear.
Allow Feebas to be caught on any Valid Fishing Spot in Route 119 rather than only Three
Allow Jumping Over Ledges with Acro Bike
Allow Move Relearner to Teach Moves that Pre Evolutions Know
Allow Running From Trainer Battles
Allow running indoors
Amulet Coin Effects If Anyone In Party is Holding It
Automatically make the keyboard switch to lowercase after the first character
Better White Out Money Calculation
Button Press to Skip Copyright Screen
Chain Fishing
Change Enemy Trainer Parties Depending on Difficulty
Change Someone's PC to Lanette's PC from the Start of the Game
Change Starter Pokémon
Change Time Based Evolution Times
Change initial PC items
Changing the Battle Music Depending on the Opponent
Colored stats by nature in summary screen
Converting to FR Tilesets
Custom Battle Mugshots
Custom Border Dimensions
Debugging using gdb (Windows, WSL2, Visual Studio Code mGBA)
Debugging using printf
Disable Bag Use In Battle
Disable Catching Pokemon
Disable Pokémon animation on Birch's intro Pokémon
Disabling Union Room check when entering Pokémon Centers
Dynamic Trade Names
Dynamic overworld palette system
Enable the Reset RTC Feature
Enable trade with FRLG without beating the game
Expanding The Metatile Count
Extra save space with three lines of code
Faster HP Drain
Feature Branches
Fish Will Now Always Get on Hook
Fix AI's Switch In Battle
Fix Snow Weather
Fixing the aspect ratio of the Pokémon logo on the title screen
Forcing Battle Animations for Major Battles
Full Screen Start Menu by Archie and Mudskip
Gen 6 Exp Share
Gen 6 style Exp. Share Alternative Option
Get Match Calls Only If Caller Wants a Rematch
Get Rid of Battery Run Dry Error Message
Get Rid of Pokemon Disobeying You
Holding Select Allows For A Second Register Item
Home
How the Game Works
How to Support Savefile Backwards Compatibility
How to add a new Pokémon species
How to add a new ability
How to add a new region map
How to create a new regular trainer battle
How to delete a map
Implement Missing Text Function RESET_FONT
Implementing Catch EXP
Implementing ipatix's High Quality Audio Mixer
Implementing the “textcolor” script command from FRLG and give object events their own text colour
Improve Partner Battle Code
Improve the Loading of Battle Terrain
Improving the WaitForVBlank function
Increase money limit
Infinite TM usage
Instead of Asking to Stop learning a New Move, You'll be Asked to Continue Learning
Item Automatically Goes to PC if Bag is Full
Keep the Camera from Making Waves
LGPE Style Bonus Premier Balls
Learn moves upon evolution
List Menu Text Coloring
Make Cleanse Tag Avoid All Wild Encounters and Usable If Held By Anyone in Your Party; Make PokeDoll Do the Same for Trainers Seeing You
Make Daycare Faster at Leveling Pokémon
Make Key Items That Cannot Be Used In The Field Not Show A Use or Register Option
Make L Button Be Turbo A When L=A Option Is Set
Make Ledge Jumps Check Collision
Make Move Relearner Teach Egg Moves With A Flag
Make Multiple Secret Bases
Make Norman's Slaking Have Ability Intimidate
Make Pokemon Not Heal When Going into PC
Make Pokemon that Require a Fateful Encounter to be Legal to Always Be Set to Legal
Make space for EWRAM Data for Summary screen
Make the Bag Able to Hold 120 Items Instead of 30
Make the Person in the Intro Match the the Save File
Map Based Trainer Battle Music
Move Item
Multipage Options Menu
Name Rater Allows Traded Pokemon to be Renamed
New Birch's Briefcase With Fully Custom Starters by Archie and Mudskip
New Custom Menu Border Themes (Basic)
New Main Menu UI With Mugshot by Archie and Mudskip
New Options Plus ‐ Multipage Options Menu with Faster Text, HP‐EXP Bar Speeds and Metric
Nickname your Pokémon from the party menu
Not showing dex entries until getting the Pokédex
Omnidirectional Jump
Optimization ‐ Remove Expensive and Redundant `BuildColorMaps()` Function
Option to Skip Copyright and Intro
Overview: Items and their Effects
Overview: The Party Menu
Overview∶ The Game Loop
Overview∶ The Task System
Per Shop\Mart Item Prices
Plural Giveitem
Pokecenters Disregard Eggs
Prompt for reusing Repels
Push B in wild battle moves to Run
Push B to Toggle Running Shoes
Pushing B When Asked To Stop Learning Move Will Cancel Teaching The Move
Quickly Run from a Battle by Holding Right While the Wild Pokémon's Name Appears
Raise Odds of Catching a Pokemon by Pressing B When the Ball Shakes
Random Info, Tips, and Tricks
Reflections
Remove 'Select' Sound From Specific Map Events
Remove Warp Fadescreen
Remove badge boosts
Remove the backup save file
Remove the extra save confirmation
Remove the functionally redundant move grammar tables
Repeated Field Medicine Use
Reuse filler save space for Variables and Flags
Revert Brendan May Sprites to Ruby Sapphire
Set Metatile IDs From Another Map
Set Up Item Balls on a Map Without Needing New Scripts
Shifting to Pokémon Already in Battle Exits the Shift Menu
Shiny Creation With a Flag
Shop Items By Badge Count
Show IVs EVs in Summary Screen
Show Species That You're Switching For in the Party Menu
Show Type Effectiveness In Battle Using Pre Existing Function and Disable in Option Menu
Show a throbber animation while the game is saving
Shuckle makes Berry Juice
Something doesn't work I need help etc.
Spawn Invisible Player
Speedy Nurse Joy
Spinda Second Frame Spot Addition
Stair Warps
Supplementary Scripting Macros
Surfing Dismount Ground Effects
Temporarily Replace Player or Enemy Party Pokemon
The Basics of Scripting
Toggle Trainer Sight
Trainer Backsprite Editing
Trainer Class Based Poké Balls
Trainer Scripts
Trainers No Longer Spin to Face You Right As You Pass Them
Trigger Map Scripts By Flag
Triple layer metatiles
Tutorials
Tweaking the count of health beeps
Uniquely Shuffle Array
Update Sitrus Berry's effect to Gen 4 standard
Use HMs Without Any Pokemon in your Party Knowing Them
Useful Modding Tools
Useful Scripting Specials
Why You Should (Almost) Always Be Using 32‐Bit Variables in Your Code
Why should I use this over binary hacking
4
Shop Items By Badge Count
LOuroboros edited this page 2021-05-21 17:17:14 -03:00
Shop Items By Badge Count
Credit to ghoulslash
Pokemart/Shop Items have been determined by the player's badge count for some time. So let's add this feature with Generation VIII items!
Add the item lists
Open src/shop.c. Add the following above sShopPurchaseYesNoFuncs
static const u16 sShopInventory_ZeroBadges[] = {
ITEM_POKE_BALL,
ITEM_POTION,
ITEM_ANTIDOTE,
ITEM_BURN_HEAL,
ITEM_ICE_HEAL,
ITEM_AWAKENING,
ITEM_PARALYZE_HEAL,
ITEM_REVIVE,
ITEM_NONE
};
static const u16 sShopInventory_OneBadge[] = {
ITEM_POKE_BALL,
ITEM_GREAT_BALL,
ITEM_POTION,
ITEM_SUPER_POTION,
ITEM_ANTIDOTE,
ITEM_BURN_HEAL,
ITEM_ICE_HEAL,
ITEM_AWAKENING,
ITEM_PARALYZE_HEAL,
ITEM_REVIVE,
ITEM_NONE
};
static const u16 sShopInventory_TwoBadges[] = {
ITEM_POKE_BALL,
ITEM_GREAT_BALL,
ITEM_POTION,
ITEM_SUPER_POTION,
ITEM_ANTIDOTE,
ITEM_BURN_HEAL,
ITEM_ICE_HEAL,
ITEM_AWAKENING,
ITEM_PARALYZE_HEAL,
ITEM_REVIVE,
ITEM_POKE_DOLL,
ITEM_NONE
};
static const u16 sShopInventory_ThreeBadges[] = {
ITEM_POKE_BALL,
ITEM_GREAT_BALL,
ITEM_POTION,
ITEM_SUPER_POTION,
ITEM_ANTIDOTE,
ITEM_BURN_HEAL,
ITEM_ICE_HEAL,
ITEM_AWAKENING,
ITEM_PARALYZE_HEAL,
ITEM_REVIVE,
ITEM_REPEL,
ITEM_POKE_DOLL,
ITEM_NONE
};
static const u16 sShopInventory_FourBadges[] = {
ITEM_POKE_BALL,
ITEM_GREAT_BALL,
ITEM_POTION,
ITEM_SUPER_POTION,
ITEM_HYPER_POTION,
ITEM_ANTIDOTE,
ITEM_BURN_HEAL,
ITEM_ICE_HEAL,
ITEM_AWAKENING,
ITEM_PARALYZE_HEAL,
ITEM_REVIVE,
ITEM_REPEL,
ITEM_POKE_DOLL,
ITEM_NONE
};
static const u16 sShopInventory_FiveBadges[] = {
ITEM_POKE_BALL,
ITEM_GREAT_BALL,
ITEM_ULTRA_BALL,
ITEM_POTION,
ITEM_SUPER_POTION,
ITEM_HYPER_POTION,
ITEM_ANTIDOTE,
ITEM_BURN_HEAL,
ITEM_ICE_HEAL,
ITEM_AWAKENING,
ITEM_PARALYZE_HEAL,
ITEM_REVIVE,
ITEM_REPEL,
ITEM_SUPER_REPEL,
ITEM_POKE_DOLL,
ITEM_NONE
};
static const u16 sShopInventory_SixBadges[] = {
ITEM_POKE_BALL,
ITEM_GREAT_BALL,
ITEM_ULTRA_BALL,
ITEM_POTION,
ITEM_SUPER_POTION,
ITEM_HYPER_POTION,
ITEM_ANTIDOTE,
ITEM_BURN_HEAL,
ITEM_ICE_HEAL,
ITEM_AWAKENING,
ITEM_PARALYZE_HEAL,
ITEM_FULL_HEAL,
ITEM_REVIVE,
ITEM_REPEL,
ITEM_SUPER_REPEL,
ITEM_POKE_DOLL,
ITEM_NONE
};
static const u16 sShopInventory_SevenBadges[] = {
ITEM_POKE_BALL,
ITEM_GREAT_BALL,
ITEM_ULTRA_BALL,
ITEM_POTION,
ITEM_SUPER_POTION,
ITEM_HYPER_POTION,
ITEM_MAX_POTION,
ITEM_ANTIDOTE,
ITEM_BURN_HEAL,
ITEM_ICE_HEAL,
ITEM_AWAKENING,
ITEM_PARALYZE_HEAL,
ITEM_FULL_HEAL,
ITEM_REVIVE,
ITEM_REPEL,
ITEM_SUPER_REPEL,
ITEM_MAX_REPEL,
ITEM_POKE_DOLL,
ITEM_NONE
};
static const u16 sShopInventory_EightBadges[] = {
ITEM_POKE_BALL,
ITEM_GREAT_BALL,
ITEM_ULTRA_BALL,
ITEM_POTION,
ITEM_SUPER_POTION,
ITEM_HYPER_POTION,
ITEM_MAX_POTION,
ITEM_FULL_RESTORE,
ITEM_ANTIDOTE,
ITEM_BURN_HEAL,
ITEM_ICE_HEAL,
ITEM_AWAKENING,
ITEM_PARALYZE_HEAL,
ITEM_FULL_HEAL,
ITEM_REVIVE,
ITEM_REPEL,
ITEM_SUPER_REPEL,
ITEM_MAX_REPEL,
ITEM_POKE_DOLL,
ITEM_NONE
};
static const u16 *const sShopInventories[] =
{
sShopInventory_ZeroBadges,
sShopInventory_OneBadge,
sShopInventory_TwoBadges,
sShopInventory_ThreeBadges,
sShopInventory_FourBadges,
sShopInventory_FiveBadges,
sShopInventory_SixBadges,
sShopInventory_SevenBadges,
sShopInventory_EightBadges
};
Make the file recognize the item definitions
In the same file, add #include "event_data.h"
at the top of the tile (above #include "event_object_movement.h"
is a good spot)
Make the game load our new item data
Edit the function, static void SetShopItemsForSale(const u16 *items)
, to the following
static void SetShopItemsForSale(const u16 *items)
{
u16 i = 0;
u8 badgeCount = GetNumberOfBadges();
if (items == NULL)
sMartInfo.itemList = sShopInventories[badgeCount];
else
sMartInfo.itemList = items;
sMartInfo.itemCount = 0;
while (sMartInfo.itemList[i])
{
sMartInfo.itemCount++;
i++;
}
}
Finally, add the function GetNumberOfBadges
somewhere above SetShopItemsForSale
(directly above is fine)
static u8 GetNumberOfBadges(void)
{
u16 badgeFlag;
u8 count = 0;
for (badgeFlag = FLAG_BADGE01_GET; badgeFlag < FLAG_BADGE01_GET + NUM_BADGES; badgeFlag++)
{
if (FlagGet(badgeFlag))
count++;
}
return count;
}
Usage
In any script, replace pokemart <itemList>
with pokemart 0
to load the items based on the player's badge count. And that's it!