mirror of https://github.com/pret/pokeemerald.git
Page:
Add Ability to Avoid Battle Damage in Debug Menu
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
Removing the Animation Affines
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
2
Add Ability to Avoid Battle Damage in Debug Menu
voloved edited this page 2023-01-09 22:15:41 -05:00
By devolov
Goal: Avoid getting battle damage during debugging. I saw myself wasting time fainting in some of my tests, so I added a toggle to stop getting battle damage.
This addition is built entirely of TheXaman's Debug Menu.
-------------------------- include/constants/flags.h --------------------------
index 282acfcd9..d81570df6 100644
@@ -47,9 +47,9 @@
#define FLAG_SYS_NO_BAG_USE 0x23 // Unused Flag //DEBUG
#define FLAG_SYS_NO_CATCHING 0x24 // Unused Flag //DEBUG
#define FLAG_SYS_PC_FROM_DEBUG_MENU 0x25 // Unused Flag //DEBUG
#define FLAG_SYS_PC_FROM_POKENAV 0x26
-#define FLAG_UNUSED_0x027 0x27 // Unused Flag
+#define FLAG_SYS_NO_BATTLE_DMG 0x27 // Unused Flag //DEBUG
#define FLAG_UNUSED_0x028 0x28 // Unused Flag
#define FLAG_UNUSED_0x029 0x29 // Unused Flag
#define FLAG_UNUSED_0x02A 0x2A // Unused Flag
#define FLAG_UNUSED_0x02B 0x2B // Unused Flag
------------------------- src/battle_script_commands.c -------------------------
index 9b47e5e86..5bcdcef68 100644
@@ -52,8 +52,10 @@
#include "constants/party_menu.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/trainers.h"
+#include "constants/flags.h"
+#include "debug.h"
extern const u8 *const gBattleScriptsForMoveEffects[];
#define DEFENDER_IS_PROTECTED ((gProtectStructs[gBattlerTarget].protected) && (gBattleMoves[gCurrentMove].flags & FLAG_PROTECT_AFFECTED))
@@ -1807,9 +1809,17 @@ static void Cmd_waitanimation(void)
gBattlescriptCurrInstr++;
}
static void Cmd_healthbarupdate(void)
{
+ #if TX_DEBUG_SYSTEM_ENABLE == TRUE
+ u8 side = GetBattlerSide(gBattlerTarget);
+ if (FlagGet(FLAG_SYS_NO_BATTLE_DMG) && side == B_SIDE_PLAYER)
+ {
+ gMoveResultFlags |= MOVE_RESULT_NO_EFFECT;
+ }
+ #endif
+
if (gBattleControllerExecFlags)
return;
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
--------------------------------- src/debug.c ---------------------------------
index 3f0773b6a..b57c2dc68 100644
@@ -111,8 +111,9 @@ enum { // Flags and Vars
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS,
+ DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BATTLE_DMG,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE,
@@ -330,8 +331,9 @@ static void DebugAction_FlagsVars_SwitchNatDex(u8 taskId);
static void DebugAction_FlagsVars_SwitchPokeNav(u8 taskId);
static void DebugAction_FlagsVars_ToggleFlyFlags(u8 taskId);
static void DebugAction_FlagsVars_ToggleBadgeFlags(u8 taskId);
static void DebugAction_FlagsVars_ToggleFrontierPass(u8 taskId);
+static void DebugAction_FlagsVars_BattleDmgOnOff(u8 taskId);
static void DebugAction_FlagsVars_CollisionOnOff(u8 taskId);
static void DebugAction_FlagsVars_EncounterOnOff(u8 taskId);
static void DebugAction_FlagsVars_TrainerSeeOnOff(u8 taskId);
static void DebugAction_FlagsVars_BagUseOnOff(u8 taskId);
@@ -460,8 +462,9 @@ static const u8 sDebugText_FlagsVars_SwitchPokeNav[] = _("Toggle {STR_V
static const u8 sDebugText_FlagsVars_RunningShoes[] = _("Toggle {STR_VAR_1}Running Shoes");
static const u8 sDebugText_FlagsVars_ToggleFlyFlags[] = _("Toggle {STR_VAR_1}Fly Flags");
static const u8 sDebugText_FlagsVars_ToggleAllBadges[] = _("Toggle {STR_VAR_1}All badges");
static const u8 sDebugText_FlagsVars_ToggleFrontierPass[] = _("Toggle {STR_VAR_1}Frontier Pass");
+static const u8 sDebugText_FlagsVars_BattleDmg[] = _("Toggle {STR_VAR_1}BattleDmg OFF");
static const u8 sDebugText_FlagsVars_SwitchCollision[] = _("Toggle {STR_VAR_1}Collision OFF");
static const u8 sDebugText_FlagsVars_SwitchEncounter[] = _("Toggle {STR_VAR_1}Encounter OFF");
static const u8 sDebugText_FlagsVars_SwitchTrainerSee[] = _("Toggle {STR_VAR_1}TrainerSee OFF");
static const u8 sDebugText_FlagsVars_SwitchBagUse[] = _("Toggle {STR_VAR_1}BagUse OFF");
@@ -640,8 +643,9 @@ static const struct ListMenuItem sDebugMenu_Items_FlagsVars[] =
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES] = {sDebugText_FlagsVars_RunningShoes, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS] = {sDebugText_FlagsVars_ToggleFlyFlags, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL] = {sDebugText_FlagsVars_ToggleAllBadges, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS] = {sDebugText_FlagsVars_ToggleFrontierPass, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS},
+ [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BATTLE_DMG] = {sDebugText_FlagsVars_BattleDmg, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BATTLE_DMG},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION] = {sDebugText_FlagsVars_SwitchCollision, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER] = {sDebugText_FlagsVars_SwitchEncounter, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE] = {sDebugText_FlagsVars_SwitchTrainerSee, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE] = {sDebugText_FlagsVars_SwitchBagUse, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE},
@@ -774,8 +778,9 @@ static void (*const sDebugMenu_Actions_Flags[])(u8) =
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES] = DebugAction_FlagsVars_RunningShoes,
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS] = DebugAction_FlagsVars_ToggleFlyFlags,
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL] = DebugAction_FlagsVars_ToggleBadgeFlags,
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS] = DebugAction_FlagsVars_ToggleFrontierPass,
+ [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BATTLE_DMG] = DebugAction_FlagsVars_BattleDmgOnOff,
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION] = DebugAction_FlagsVars_CollisionOnOff,
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER] = DebugAction_FlagsVars_EncounterOnOff,
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE] = DebugAction_FlagsVars_TrainerSeeOnOff,
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE] = DebugAction_FlagsVars_BagUseOnOff,
@@ -1074,8 +1079,11 @@ static u8 Debug_CheckToggleFlags(u8 id)
break;
case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS:
result = FlagGet(FLAG_SYS_FRONTIER_PASS);
break;
+ case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BATTLE_DMG:
+ result = FlagGet(FLAG_SYS_NO_BATTLE_DMG);
+ break;
case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION:
result = FlagGet(FLAG_SYS_NO_COLLISION);
break;
case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER:
@@ -2442,8 +2450,16 @@ static void DebugAction_FlagsVars_ToggleFrontierPass(u8 taskId)
else
PlaySE(SE_PC_LOGIN);
FlagToggle(FLAG_SYS_FRONTIER_PASS);
}
+static void DebugAction_FlagsVars_BattleDmgOnOff(u8 taskId)
+{
+ if (FlagGet(FLAG_SYS_NO_BATTLE_DMG))
+ PlaySE(SE_PC_OFF);
+ else
+ PlaySE(SE_PC_LOGIN);
+ FlagToggle(FLAG_SYS_NO_BATTLE_DMG);
+}
static void DebugAction_FlagsVars_CollisionOnOff(u8 taskId)
{
if (FlagGet(FLAG_SYS_NO_COLLISION))
PlaySE(SE_PC_OFF);