From 6456009a44cd8721a74acbf434da2e3a136da858 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Sat, 26 Sep 2020 00:51:02 +0200 Subject: [PATCH 001/155] Implementation if Pyredrid and AsparagusEduardo debug menu plus huge rewrite and tons of additions V2: Fly, Warp, Flags, Vars, give items, give pkm 2 versions Improved cheats, reworked the vars system vars function now starts at VARS_START and end VARS_END Figured out how to display FieldMessages, reimplemented CheckSafeBlock, cleanup DebugAction_DestroyExtraWindow instead of multiple, renamed text variables cleanup + pokemon simple give pokemon complex nearly done Complex pkm works, items now with icons if statement cleanup alter build tools to include maps per map group Warp functionallity added hex value to flags and vars cleanup Credits --- .gitignore | 1 + Makefile | 6 + data/event_scripts.s | 2 + data/scripts/debug.inc | 60 + include/constants/flags.h | 12 +- include/constants/map_groups.h | 2 + include/debug.h | 8 + include/event_data.h | 2 + ld_script.txt | 2 + src/battle_main.c | 2 +- src/debug.c | 2008 ++++++++++++++++++++++++++++++++ src/event_data.c | 16 + src/event_object_movement.c | 6 + src/field_control_avatar.c | 44 +- src/item_use.c | 6 +- src/new_game.c | 2 +- src/trainer_see.c | 5 + tools/mapjson/mapjson.cpp | 14 +- 18 files changed, 2187 insertions(+), 11 deletions(-) create mode 100644 data/scripts/debug.inc create mode 100644 include/debug.h create mode 100644 src/debug.c diff --git a/.gitignore b/.gitignore index ebf507247b..4a446ae79a 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ porymap.project.cfg .vscode/ *.a .fuse_hidden* +mgba.sh diff --git a/Makefile b/Makefile index 99a93718bd..68e9603e69 100644 --- a/Makefile +++ b/Makefile @@ -248,6 +248,12 @@ ifeq ($(DINFO),1) override CFLAGS += -g endif +# DebugMenu +ifeq ($(DDEBUG),1) +override ASFLAGS += --defsym DEBUG=1 +override CPPFLAGS += -D DEBUG=1 +endif + $(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep) @$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i @$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s diff --git a/data/event_scripts.s b/data/event_scripts.s index 8039be6876..2159c939b5 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -576,6 +576,8 @@ gStdScripts_End:: @ 81DC2CC .include "data/scripts/new_game.inc" .include "data/scripts/hall_of_fame.inc" + .include "data/scripts/debug.inc" + EventScript_WhiteOut:: @ 8271857 call EverGrandeCity_HallOfFame_EventScript_ResetEliteFour goto EventScript_ResetMrBriney diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc new file mode 100644 index 0000000000..9d46ea5fff --- /dev/null +++ b/data/scripts/debug.inc @@ -0,0 +1,60 @@ +Debug_ShowFieldMessageStringVar4:: + special ShowFieldMessageStringVar4 + waitmessage + waitbuttonpress + releaseall + end + +Debug_CheckWeekDay_Text: + .string "Aaaaah, yes!\l" + .string "{STR_VAR_1}s are made for dads!\l" + .string "And dad's car!$" + +Debug_CheatStart:: + lockall + setflag FLAG_SYS_POKEMON_GET + setflag FLAG_RESCUED_BIRCH + setflag FLAG_HIDE_ROUTE_101_BIRCH_ZIGZAGOON_BATTLE + clearflag FLAG_HIDE_LITTLEROOT_TOWN_BIRCHS_LAB_BIRCH + setflag FLAG_HIDE_ROUTE_101_BIRCH_STARTERS_BAG + setvar VAR_BIRCH_LAB_STATE, 2 + setvar VAR_ROUTE101_STATE, 3 + givemon SPECIES_TREECKO, 20, ITEM_NONE + givemon SPECIES_TORCHIC, 20, ITEM_NONE + givemon SPECIES_MUDKIP, 20, ITEM_NONE + setflag FLAG_SYS_POKEDEX_GET + special SetUnlockedPokedexFlags + setflag FLAG_RECEIVED_POKEDEX_FROM_BIRCH + setvar VAR_CABLE_CLUB_TUTORIAL_STATE, 1 + @ setflag FLAG_SYS_NATIONAL_DEX + @ special EnableNationalPokedex + setflag FLAG_RECEIVED_RUNNING_SHOES + setflag FLAG_SYS_B_DASH + setvar VAR_LITTLEROOT_TOWN_STATE, 4 @ 4: Received Running Shoes + setvar VAR_LITTLEROOT_INTRO_STATE, 7 @ 7: Told to go meet rival + setvar VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 2 @ 2: Met Rival's Mom (and is corresponding gender) + setvar VAR_LITTLEROOT_HOUSES_STATE_MAY, 2 @ 2: Met Rival's Mom (and is corresponding gender) + setvar VAR_LITTLEROOT_RIVAL_STATE, 4 @ 4: Received Pokedex + setflag FLAG_RECEIVED_BIKE + giveitem ITEM_ACRO_BIKE + setvar VAR_BRINEY_HOUSE_STATE, 1 + setvar VAR_ROUTE116_STATE, 2 + setflag FLAG_HIDE_ROUTE_116_MR_BRINEY + clearflag FLAG_HIDE_BRINEYS_HOUSE_MR_BRINEY + clearflag FLAG_HIDE_BRINEYS_HOUSE_PEEKO + @ additem ITEM_MAX_REPEL, 10 + @ giveitem ITEM_EON_TICKET + @ setflag FLAG_SYS_HAS_EON_TICKET + @ setvar VAR_DISTRIBUTE_EON_TICKET, 0 + @ giveitem ITEM_MYSTIC_TICKET + @ setflag FLAG_ENABLE_SHIP_NAVEL_ROCK + @ setflag FLAG_RECEIVED_MYSTIC_TICKET + @ giveitem ITEM_AURORA_TICKET + @ setflag FLAG_ENABLE_SHIP_BIRTH_ISLAND + @ setflag FLAG_RECEIVED_AURORA_TICKET + @ setflag FLAG_BADGE06_GET @ Badge for flying filed move + @ setweather WEATHER_VOLCANIC_ASH + @ doweather + closemessage + release + end diff --git a/include/constants/flags.h b/include/constants/flags.h index a562b0670e..a3e6584def 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -40,12 +40,12 @@ #define FLAG_TEMP_1E (TEMP_FLAGS_START + 0x1E) #define FLAG_TEMP_1F (TEMP_FLAGS_START + 0x1F) #define TEMP_FLAGS_END FLAG_TEMP_1F - -#define FLAG_UNUSED_0x020 0x20 // Unused Flag -#define FLAG_UNUSED_0x021 0x21 // Unused Flag -#define FLAG_UNUSED_0x022 0x22 // Unused Flag -#define FLAG_UNUSED_0x023 0x23 // Unused Flag -#define FLAG_UNUSED_0x024 0x24 // Unused Flag + +#define FLAG_SYS_NO_COLLISION 0x20 // Unused Flag //DEBUG +#define FLAG_SYS_NO_ENCOUNTER 0x21 // Unused Flag //DEBUG +#define FLAG_SYS_NO_TRAINER_SEE 0x22 // Unused Flag //DEBUG +#define FLAG_SYS_NO_BAG_USE 0x23 // Unused Flag //DEBUG +#define FLAG_SYS_NO_CATCHING 0x24 // Unused Flag //DEBUG #define FLAG_UNUSED_0x025 0x25 // Unused Flag #define FLAG_UNUSED_0x026 0x26 // Unused Flag #define FLAG_UNUSED_0x027 0x27 // Unused Flag diff --git a/include/constants/map_groups.h b/include/constants/map_groups.h index 69355635b3..c5334bf6c5 100755 --- a/include/constants/map_groups.h +++ b/include/constants/map_groups.h @@ -593,4 +593,6 @@ #define MAP_GROUPS_COUNT 34 +// static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; + #endif // GUARD_CONSTANTS_MAP_GROUPS_H diff --git a/include/debug.h b/include/debug.h new file mode 100644 index 0000000000..0d78632e63 --- /dev/null +++ b/include/debug.h @@ -0,0 +1,8 @@ +#ifndef GUARD_DEBUG_H +#define GUARD_DEBUG_H + +#if DEBUG +void Debug_ShowMainMenu(void); +#endif + +#endif // GUARD_DEBUG_H \ No newline at end of file diff --git a/include/event_data.h b/include/event_data.h index 8b4510e39b..e4792c7f63 100644 --- a/include/event_data.h +++ b/include/event_data.h @@ -20,10 +20,12 @@ void EnableResetRTC(void); bool32 CanResetRTC(void); u16 *GetVarPointer(u16 id); u16 VarGet(u16 id); +u16 VarGetIfExist(u16 id); bool8 VarSet(u16 id, u16 value); u8 VarGetObjectEventGraphicsId(u8 id); u8 *GetFlagPointer(u16 id); u8 FlagSet(u16 id); +u8 FlagToggle(u16 id); u8 FlagClear(u16 id); bool8 FlagGet(u16 id); diff --git a/ld_script.txt b/ld_script.txt index 0b8702d966..dee404843e 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -99,6 +99,7 @@ SECTIONS { src/random.o(.text); src/util.o(.text); src/daycare.o(.text); + src/debug.o(.text); src/egg_hatch.o(.text); src/battle_interface.o(.text); src/battle_anim_smokescreen.o(.text); @@ -482,6 +483,7 @@ SECTIONS { src/trig.o(.rodata); src/util.o(.rodata); src/daycare.o(.rodata); + src/debug.o(.rodata); src/egg_hatch.o(.rodata); src/battle_gfx_sfx_util.o(.rodata); src/battle_interface.o(.rodata); diff --git a/src/battle_main.c b/src/battle_main.c index 193fffaf22..0574bae0b7 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4259,7 +4259,7 @@ static void HandleTurnActionSelectionState(void) } break; case B_ACTION_USE_ITEM: - if (gBattleTypeFlags & (BATTLE_TYPE_LINK + if (FlagGet(FLAG_SYS_NO_BAG_USE) || gBattleTypeFlags & (BATTLE_TYPE_LINK //DEBUG | BATTLE_TYPE_FRONTIER_NO_PYRAMID | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_x2000000)) diff --git a/src/debug.c b/src/debug.c new file mode 100644 index 0000000000..84388b34f4 --- /dev/null +++ b/src/debug.c @@ -0,0 +1,2008 @@ +#if DEBUG +//CREDITS +//TheXaman: https://github.com/TheXaman/pokeemerald/tree/tx_debug_system +//CODE USED FROM: +//ketsuban: https://github.com/pret/pokeemerald/wiki/Add-a-debug-menu +//Pyredrid: https://github.com/Pyredrid/pokeemerald/tree/debugmenu +//AsparagusEduardo: https://github.com/AsparagusEduardo/pokeemerald/tree/InfusedEmerald_v2 +//Ghoulslash: https://github.com/ghoulslash/pokeemerald +#include "debug.h" +#include "global.h" +#include "data.h" +#include "event_data.h" +#include "event_object_movement.h" +#include "event_scripts.h" +#include "field_message_box.h" +#include "field_screen_effect.h" +#include "international_string_util.h" +#include "item.h" +#include "item_icon.h" +#include "list_menu.h" +#include "main.h" +#include "map_name_popup.h" +#include "menu.h" +#include "overworld.h" +#include "pokedex.h" +#include "pokemon.h" +#include "pokemon_icon.h" +#include "pokemon_storage_system.h" +#include "random.h" +#include "region_map.h" +#include "script.h" +#include "script_pokemon_util.h" +#include "sound.h" +#include "strings.h" +#include "string_util.h" +#include "task.h" +#include "pokemon_summary_screen.h" +#include "constants/abilities.h" +#include "constants/flags.h" +#include "constants/items.h" +#include "constants/map_groups.h" +#include "constants/songs.h" +#include "constants/species.h" + +// Constants +#define DEBUG_MAIN_MENU_WIDTH 13 +#define DEBUG_MAIN_MENU_HEIGHT 8 + +#define DEBUG_NUMBER_DISPLAY_WIDTH 10 +#define DEBUG_NUMBER_DISPLAY_HEIGHT 4 + +#define DEBUG_NUMBER_DIGITS_FLAGS 4 +#define DEBUG_NUMBER_DIGITS_VARIABLES 5 +#define DEBUG_NUMBER_DIGITS_VARIABLE_VALUE 5 +#define DEBUG_NUMBER_DIGITS_ITEMS 4 +#define DEBUG_NUMBER_DIGITS_ITEM_QUANTITY 2 + +#define DEBUG_NUMBER_ICON_X 210 +#define DEBUG_NUMBER_ICON_Y 50 + +// Define functions +static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate); +void Debug_ShowMainMenu(void); +static void Debug_DestroyMenu(u8); +static void DebugAction_Cancel(u8); +static void DebugAction_DestroyExtraWindow(u8 taskId); + +static void DebugAction_OpenUtilitiesMenu(u8); +static void DebugAction_OpenFlagsMenu(u8); +static void DebugAction_OpenVariablesMenu(u8); +static void DebugAction_OpenGiveMenu(u8); +static void DebugTask_HandleMenuInput_Main(u8); +static void DebugTask_HandleMenuInput_Utilities(u8); +static void DebugTask_HandleMenuInput_Flags(u8); +static void DebugTask_HandleMenuInput_Vars(u8); +static void DebugTask_HandleMenuInput_Give(u8); + +static void DebugAction_Util_HealParty(u8 taskId); +static void DebugAction_Util_Fly(u8 taskId); +static void DebugAction_Util_Warp_Warp(u8 taskId); +static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId); +static void DebugAction_Util_Warp_SelectMap(u8 taskId); +static void DebugAction_Util_Warp_SelectWarp(u8 taskId); +static void DebugAction_Util_CheckSaveBlock(u8); +static void DebugAction_Util_CheckWallClock(u8); +static void DebugAction_Util_SetWallClock(u8); +static void DebugAction_Util_CheckWeekDay(u8); + +static void DebugAction_Flags_Flags(u8 taskId); +static void DebugAction_Flags_FlagsSelect(u8 taskId); + +static void DebugAction_Flags_SetPokedexFlags(u8); +static void DebugAction_Flags_SwitchDex(u8); +static void DebugAction_Flags_SwitchNatDex(u8); +static void DebugAction_Flags_SwitchPokeNav(u8); +static void DebugAction_Flags_ToggleFlyFlags(u8); +static void DebugAction_Flags_ToggleBadgeFlags(u8); +static void DebugAction_Flags_CollisionOnOff(u8); +static void DebugAction_Flags_EncounterOnOff(u8); +static void DebugAction_Flags_TrainerSeeOnOff(u8); +static void DebugAction_Flags_BagUseOnOff(u8); +static void DebugAction_Flags_CatchingOnOff(u8); + +static void DebugAction_Vars_Vars(u8 taskId); +static void DebugAction_Vars_Select(u8 taskId); +static void DebugAction_Vars_SetValue(u8 taskId); + +static void DebugAction_Give_Item(u8 taskId); +static void DebugAction_Give_Item_SelectId(u8 taskId); +static void DebugAction_Give_Item_SelectQuantity(u8 taskId); +static void DebugAction_Give_PokemonSimple(u8 taskId); +static void DebugAction_Give_PokemonComplex(u8 taskId); +static void DebugAction_Give_Pokemon_SelectId(u8 taskId); +static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId); +static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId); +static void DebugAction_Give_Pokemon_SelectNature(u8 taskId); +static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId); +static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId); +static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId); +static void DebugAction_Give_CHEAT(u8 taskId); +static void DebugAction_AccessPC(u8 taskId); + +static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)); +static void DebugAction_OpenSubMenu(u8 taskId, struct ListMenuTemplate LMtemplate); + +extern u8 Debug_ShowFieldMessageStringVar4[]; +extern u8 Debug_CheatStart[]; +extern u8 PlayersHouse_2F_EventScript_SetWallClock[]; +extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; +#define ABILITY_NAME_LENGTH 12 +extern const u8 gAbilityNames[][ABILITY_NAME_LENGTH + 1]; + +// ******************************* +// Enums +enum { // Main + DEBUG_MENU_ITEM_UTILITIES, + DEBUG_MENU_ITEM_FLAGS, + DEBUG_MENU_ITEM_VARS, + DEBUG_MENU_ITEM_GIVE, + DEBUG_MENU_ITEM_CANCEL +}; +enum { // Util + DEBUG_UTIL_MENU_ITEM_HEAL_PARTY, + DEBUG_UTIL_MENU_ITEM_FLY, + DEBUG_UTIL_MENU_ITEM_WARP, + DEBUG_UTIL_MENU_ITEM_SAVEBLOCK, + DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK, + DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK, + DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY, +}; +enum { // Flags + DEBUG_FLAG_MENU_ITEM_FLAGS, + DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS, + DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF, + DEBUG_FLAG_MENU_ITEM_NATDEXONOFF, + DEBUG_FLAG_MENU_ITEM_POKENAVONOFF, + DEBUG_FLAG_MENU_ITEM_FLYANYWHERE, + DEBUG_FLAG_MENU_ITEM_GETALLBADGES, + DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF, + DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF, + DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF, + DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF, + DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF, +}; +enum { // Vars + DEBUG_VARS_MENU_ITEM_VARS, +}; +enum { // Give + DEBUG_GIVE_MENU_ITEM_ITEM, + DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE, + DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX, + DEBUG_GIVE_MENU_ITEM_CHEAT, + //DEBUG_MENU_ITEM_ACCESS_PC, +}; + +// ******************************* +//Maps per map group COPY FROM /include/constants/map_groups.h + static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; + +// Text +// Main Menu +static const u8 gDebugText_Utilities[] = _("Utilities"); +static const u8 gDebugText_Flags[] = _("Flags"); +static const u8 gDebugText_Vars[] = _("Variables"); +static const u8 gDebugText_Give[] = _("Give X"); +static const u8 gDebugText_Cancel[] = _("Cancel"); +// Util Menu +static const u8 gDebugText_Util_HealParty[] = _("Heal Party"); +static const u8 gDebugText_Util_Fly[] = _("Fly to map"); +static const u8 gDebugText_Util_WarpToMap[] = _("Warp to map warp"); +static const u8 gDebugText_Util_WarpToMap_SelectMapGroup[] =_("Group: {STR_VAR_1} \n \n\n{STR_VAR_3} "); +static const u8 gDebugText_Util_WarpToMap_SelectMap[] = _("Map: {STR_VAR_1} \nMapSec: \n{STR_VAR_2} \n{STR_VAR_3} "); +static const u8 gDebugText_Util_WarpToMap_SelectWarp[] = _("Warp: \n{STR_VAR_1} \n \n{STR_VAR_3} "); +static const u8 gDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}"); +static const u8 gDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); +static const u8 gDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); +static const u8 gDebugText_Util_SetWallClock[] = _("Set Wall Clock"); +static const u8 gDebugText_Util_CheckWeekDay[] = _("Check Week Day"); +// Flags Menu +static const u8 gDebugText_Flags_Flags[] = _("Set Flag XXXX"); +static const u8 gDebugText_Flags_SetPokedexFlags[] = _("All Pokédex Flags"); +static const u8 gDebugText_Flags_SwitchDex[] = _("Pokédex ON/OFF"); +static const u8 gDebugText_Flags_SwitchNationalDex[] = _("NatDex ON/OFF"); +static const u8 gDebugText_Flags_SwitchPokeNav[] = _("PokéNav ON/OFF"); +static const u8 gDebugText_Flags_ToggleFlyFlags[] = _("Fly Flags ON/OFF"); +static const u8 gDebugText_Flags_ToggleAllBadges[] = _("All badges ON/OFF"); +static const u8 gDebugText_Flags_SwitchCollision[] = _("Collision ON/OFF"); +static const u8 gDebugText_Flags_SwitchEncounter[] = _("Encounter ON/OFF"); +static const u8 gDebugText_Flags_SwitchTrainerSee[] = _("TrainerSee ON/OFF"); +static const u8 gDebugText_Flags_SwitchBagUse[] = _("BagUse ON/OFF"); +static const u8 gDebugText_Flags_SwitchCatching[] = _("Catching ON/OFF"); +static const u8 gDebugText_Flag[] = _("Flag: {STR_VAR_1} \n{STR_VAR_2} \n{STR_VAR_3}"); +static const u8 gDebugText_FlagHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); +static const u8 gDebugText_FlagSet[] = _("TRUE"); +static const u8 gDebugText_FlagUnset[] = _("FALSE"); +// Variables Menu +static const u8 gDebugText_Vars_Vars[] = _("Set Vars XXXX"); +static const u8 gDebugText_VariableHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); +static const u8 gDebugText_Variable[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); +static const u8 gDebugText_VariableValueSet[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); +// Give Menu +static const u8 gDebugText_Give_GiveItem[] = _("Give item XXXX"); +static const u8 gDebugText_ItemQuantity[] = _("Quantity: \n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_ItemID[] = _("Item ID: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_Give_GivePokemonSimple[] = _("Pkm (ID,lvl)"); +static const u8 gDebugText_Give_GivePokemonComplex[] = _("Pkm (ID,lvl,shi,nat,ab,IVs)"); +static const u8 gDebugText_PokemonID[] = _("ID: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_PokemonLevel[] = _("Level: \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonShiny[] = _("Shiny: \n {STR_VAR_2} \n \n "); +static const u8 gDebugText_PokemonNature[] = _("ID: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonAbility[] = _("ID: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonIVs[] = _("All IVs: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT start"); +// static const u8 gDebugText_Give_AccessPC[] = _("Access PC"); +// static const u8 gDebugText_Give_GiveAllTMs[] = _("Give All TMs"); + +static const u8 digitInidicator_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); +static const u8 digitInidicator_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); +static const u8 digitInidicator_100[] = _("{LEFT_ARROW}+100{RIGHT_ARROW} "); +static const u8 digitInidicator_1000[] = _("{LEFT_ARROW}+1000{RIGHT_ARROW} "); +static const u8 digitInidicator_10000[] = _("{LEFT_ARROW}+10000{RIGHT_ARROW} "); +static const u8 digitInidicator_100000[] = _("{LEFT_ARROW}+100000{RIGHT_ARROW} "); +static const u8 digitInidicator_1000000[] = _("{LEFT_ARROW}+1000000{RIGHT_ARROW} "); +static const u8 digitInidicator_10000000[] = _("{LEFT_ARROW}+10000000{RIGHT_ARROW} "); +const u8 * const gText_DigitIndicator[] = +{ + digitInidicator_1, + digitInidicator_10, + digitInidicator_100, + digitInidicator_1000, + digitInidicator_10000, + digitInidicator_100000, + digitInidicator_1000000, + digitInidicator_10000000 +}; +static const s32 sPowersOfTen[] = +{ + 1, + 10, + 100, + 1000, + 10000, + 100000, + 1000000, + 10000000, + 100000000, + 1000000000, +}; + +// ******************************* +// List Menu Items +static const struct ListMenuItem sDebugMenu_Items_Main[] = +{ + [DEBUG_MENU_ITEM_UTILITIES] = {gDebugText_Utilities, DEBUG_MENU_ITEM_UTILITIES}, + [DEBUG_MENU_ITEM_FLAGS] = {gDebugText_Flags, DEBUG_MENU_ITEM_FLAGS}, + [DEBUG_MENU_ITEM_VARS] = {gDebugText_Vars, DEBUG_MENU_ITEM_VARS}, + [DEBUG_MENU_ITEM_GIVE] = {gDebugText_Give, DEBUG_MENU_ITEM_GIVE}, + [DEBUG_MENU_ITEM_CANCEL] = {gDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} +}; +static const struct ListMenuItem sDebugMenu_Items_Utilities[] = +{ + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {gDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, + [DEBUG_UTIL_MENU_ITEM_FLY] = {gDebugText_Util_Fly, DEBUG_UTIL_MENU_ITEM_FLY}, + [DEBUG_UTIL_MENU_ITEM_WARP] = {gDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {gDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {gDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {gDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY] = {gDebugText_Util_CheckWeekDay, DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY}, +}; +static const struct ListMenuItem sDebugMenu_Items_Flags[] = +{ + [DEBUG_FLAG_MENU_ITEM_FLAGS] = {gDebugText_Flags_Flags, DEBUG_FLAG_MENU_ITEM_FLAGS}, + [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = {gDebugText_Flags_SetPokedexFlags, DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS}, + [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = {gDebugText_Flags_SwitchDex, DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF}, + [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = {gDebugText_Flags_SwitchNationalDex, DEBUG_FLAG_MENU_ITEM_NATDEXONOFF}, + [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = {gDebugText_Flags_SwitchPokeNav, DEBUG_FLAG_MENU_ITEM_POKENAVONOFF}, + [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = {gDebugText_Flags_ToggleFlyFlags, DEBUG_FLAG_MENU_ITEM_FLYANYWHERE}, + [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = {gDebugText_Flags_ToggleAllBadges, DEBUG_FLAG_MENU_ITEM_GETALLBADGES}, + [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = {gDebugText_Flags_SwitchCollision, DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = {gDebugText_Flags_SwitchEncounter, DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF]= {gDebugText_Flags_SwitchTrainerSee, DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = {gDebugText_Flags_SwitchBagUse, DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = {gDebugText_Flags_SwitchCatching, DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF}, +}; +static const struct ListMenuItem sDebugMenu_Items_Vars[] = +{ + [DEBUG_VARS_MENU_ITEM_VARS] = {gDebugText_Vars_Vars, DEBUG_FLAG_MENU_ITEM_FLAGS}, +}; +static const struct ListMenuItem sDebugMenu_Items_Give[] = +{ + [DEBUG_GIVE_MENU_ITEM_ITEM] = {gDebugText_Give_GiveItem, DEBUG_GIVE_MENU_ITEM_ITEM}, + [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {gDebugText_Give_GivePokemonSimple, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE}, + [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {gDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, + [DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, + //[DEBUG_MENU_ITEM_GIVE_ALLTMS] = {gDebugText_GiveAllTMs, DEBUG_MENU_ITEM_GIVE_ALLTMS}, + //[DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, +}; + +// ******************************* +// Menu Actions +static void (*const sDebugMenu_Actions_Main[])(u8) = +{ + [DEBUG_MENU_ITEM_UTILITIES] = DebugAction_OpenUtilitiesMenu, + [DEBUG_MENU_ITEM_FLAGS] = DebugAction_OpenFlagsMenu, + [DEBUG_MENU_ITEM_VARS] = DebugAction_OpenVariablesMenu, + [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, + [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel +}; +static void (*const sDebugMenu_Actions_Utilities[])(u8) = +{ + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = DebugAction_Util_HealParty, + [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, + [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, + [DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY] = DebugAction_Util_CheckWeekDay, +}; +static void (*const sDebugMenu_Actions_Flags[])(u8) = +{ + [DEBUG_FLAG_MENU_ITEM_FLAGS] = DebugAction_Flags_Flags, + [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = DebugAction_Flags_SetPokedexFlags, + [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = DebugAction_Flags_SwitchDex, + [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = DebugAction_Flags_SwitchNatDex, + [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = DebugAction_Flags_SwitchPokeNav, + [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = DebugAction_Flags_ToggleFlyFlags, + [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = DebugAction_Flags_ToggleBadgeFlags, + [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = DebugAction_Flags_CollisionOnOff, + [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = DebugAction_Flags_EncounterOnOff, + [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF]= DebugAction_Flags_TrainerSeeOnOff, + [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = DebugAction_Flags_BagUseOnOff, + [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = DebugAction_Flags_CatchingOnOff, +}; +static void (*const sDebugMenu_Actions_Vars[])(u8) = +{ + [DEBUG_VARS_MENU_ITEM_VARS] = DebugAction_Vars_Vars, +}; +static void (*const sDebugMenu_Actions_Give[])(u8) = +{ + [DEBUG_GIVE_MENU_ITEM_ITEM] = DebugAction_Give_Item, + [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = DebugAction_Give_PokemonSimple, + [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = DebugAction_Give_PokemonComplex, + [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, + //[DEBUG_MENU_ITEM_GIVE_ALLTMS] = DebugAction_GiveAllTMs, + //[DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, +}; + + +// ******************************* +// Windows +static const struct WindowTemplate sDebugMenuWindowTemplate = +{ + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = DEBUG_MAIN_MENU_WIDTH, + .height = 2 * DEBUG_MAIN_MENU_HEIGHT, + .paletteNum = 15, + .baseBlock = 1, +}; +static const struct WindowTemplate sDebugNumberDisplayWindowTemplate = +{ + .bg = 0, + .tilemapLeft = 6 + DEBUG_MAIN_MENU_WIDTH, + .tilemapTop = 1, + .width = DEBUG_NUMBER_DISPLAY_WIDTH, + .height = 2 * DEBUG_NUMBER_DISPLAY_HEIGHT, + .paletteNum = 15, + .baseBlock = 1, +}; + +// ******************************* +// List Menu Templates +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Main = +{ + .items = sDebugMenu_Items_Main, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Main), +}; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Utilities = +{ + .items = sDebugMenu_Items_Utilities, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Utilities), +}; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Flags = +{ + .items = sDebugMenu_Items_Flags, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Flags), +}; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Vars = +{ + .items = sDebugMenu_Items_Vars, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Vars), +}; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Give = +{ + .items = sDebugMenu_Items_Give, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Give), +}; + + +// ******************************* +// Functions universal +void Debug_ShowMainMenu(void) +{ + Debug_ShowMenu(DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); +} +static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate) +{ + struct ListMenuTemplate menuTemplate; + u8 windowId; + u8 menuTaskId; + u8 inputTaskId; + + // create window + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugMenuWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + // create list menu + menuTemplate = LMtemplate; + menuTemplate.maxShowed = DEBUG_MAIN_MENU_HEIGHT; + menuTemplate.windowId = windowId; + menuTemplate.header_X = 0; + menuTemplate.item_X = 8; + menuTemplate.cursor_X = 0; + menuTemplate.upText_Y = 1; + menuTemplate.cursorPal = 2; + menuTemplate.fillValue = 1; + menuTemplate.cursorShadowPal = 3; + menuTemplate.lettersSpacing = 1; + menuTemplate.itemVerticalPadding = 0; + menuTemplate.scrollMultiple = LIST_NO_MULTIPLE_SCROLL; + menuTemplate.fontId = 1; + menuTemplate.cursorKind = 0; + menuTaskId = ListMenuInit(&menuTemplate, 0, 0); + + // draw everything + CopyWindowToVram(windowId, 3); + + // create input handler task + inputTaskId = CreateTask(HandleInput, 3); + gTasks[inputTaskId].data[0] = menuTaskId; + gTasks[inputTaskId].data[1] = windowId; +} +static void Debug_DestroyMenu(u8 taskId) +{ + DestroyListMenuTask(gTasks[taskId].data[0], NULL, NULL); + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + DestroyTask(taskId); +} +static void DebugAction_Cancel(u8 taskId) +{ + Debug_DestroyMenu(taskId); + EnableBothScriptContexts(); +} +static void DebugAction_DestroyExtraWindow(u8 taskId) +{ + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + + ClearStdWindowAndFrame(gTasks[taskId].data[2], TRUE); + RemoveWindow(gTasks[taskId].data[2]); + + DestroyTask(taskId); + EnableBothScriptContexts(); +} + + +// ******************************* +// Handle Inputs +static void DebugTask_HandleMenuInput_Main(u8 taskId) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if ((func = sDebugMenu_Actions_Main[input]) != NULL) + func(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + EnableBothScriptContexts(); + } +} +static void DebugTask_HandleMenuInput_Utilities(u8 taskId) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if ((func = sDebugMenu_Actions_Utilities[input]) != NULL) + func(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ShowMainMenu(); + } +} +static void DebugTask_HandleMenuInput_Flags(u8 taskId) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if ((func = sDebugMenu_Actions_Flags[input]) != NULL) + func(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ShowMainMenu(); + } +} +static void DebugTask_HandleMenuInput_Vars(u8 taskId) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if ((func = sDebugMenu_Actions_Vars[input]) != NULL) + func(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ShowMainMenu(); + } +} +static void DebugTask_HandleMenuInput_Give(u8 taskId) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if ((func = sDebugMenu_Actions_Give[input]) != NULL) + func(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ShowMainMenu(); + } +} + +// ******************************* +// Open sub-menus +static void DebugAction_OpenUtilitiesMenu(u8 taskId) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Utilities, sDebugMenu_ListTemplate_Utilities); +} +static void DebugAction_OpenFlagsMenu(u8 taskId) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Flags, sDebugMenu_ListTemplate_Flags); +} +static void DebugAction_OpenVariablesMenu(u8 taskId) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Vars, sDebugMenu_ListTemplate_Vars); +} +static void DebugAction_OpenGiveMenu(u8 taskId) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Give, sDebugMenu_ListTemplate_Give); +} + + +// ******************************* +// Actions Utilities +static void DebugAction_Util_HealParty(u8 taskId) +{ + PlaySE(SE_USE_ITEM); + HealPlayerParty(); + Debug_DestroyMenu(taskId); +} +static void DebugAction_Util_Fly(u8 taskId) +{ + FlagSet(FLAG_VISITED_LITTLEROOT_TOWN); + FlagSet(FLAG_VISITED_OLDALE_TOWN); + FlagSet(FLAG_VISITED_DEWFORD_TOWN); + FlagSet(FLAG_VISITED_LAVARIDGE_TOWN); + FlagSet(FLAG_VISITED_FALLARBOR_TOWN); + FlagSet(FLAG_VISITED_VERDANTURF_TOWN); + FlagSet(FLAG_VISITED_PACIFIDLOG_TOWN); + FlagSet(FLAG_VISITED_PETALBURG_CITY); + FlagSet(FLAG_VISITED_SLATEPORT_CITY); + FlagSet(FLAG_VISITED_MAUVILLE_CITY); + FlagSet(FLAG_VISITED_RUSTBORO_CITY); + FlagSet(FLAG_VISITED_FORTREE_CITY); + FlagSet(FLAG_VISITED_LILYCOVE_CITY); + FlagSet(FLAG_VISITED_MOSSDEEP_CITY); + FlagSet(FLAG_VISITED_SOOTOPOLIS_CITY); + FlagSet(FLAG_VISITED_EVER_GRANDE_CITY); + FlagSet(FLAG_LANDMARK_POKEMON_LEAGUE); + FlagSet(FLAG_LANDMARK_BATTLE_FRONTIER); + Debug_DestroyMenu(taskId); + SetMainCallback2(CB2_OpenFlyMap); +} + +static void DebugAction_Util_Warp_Warp(u8 taskId) +{ + u8 windowId; + + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + CopyWindowToVram(windowId, 3); + + + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + ConvertIntToDecimalStringN(gStringVar2, MAP_GROUPS_COUNT-1, STR_CONV_MODE_LEADING_ZEROS, 2); + StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); + StringCopy(gStringVar3, gText_DigitIndicator[0]); + StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMapGroup); + AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Util_Warp_SelectMapGroup; + gTasks[taskId].data[2] = windowId; + gTasks[taskId].data[3] = 0; //Current Flag + gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[5] = 0; //Map Group + gTasks[taskId].data[6] = 0; //Map + gTasks[taskId].data[7] = 0; //warp +} +static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > MAP_GROUPS_COUNT-1) + gTasks[taskId].data[3] = MAP_GROUPS_COUNT-1; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 0) + gTasks[taskId].data[3] = 0; + } + if(gMain.newKeys & DPAD_LEFT) + { + if(gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if(gMain.newKeys & DPAD_RIGHT) + { + if(gTasks[taskId].data[4] < 2) + gTasks[taskId].data[4] += 1; + } + + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + ConvertIntToDecimalStringN(gStringVar2, MAP_GROUPS_COUNT-1, STR_CONV_MODE_LEADING_ZEROS, 2); + StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); + StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMapGroup); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[5] = gTasks[taskId].data[3]; + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 0; + + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]]-1, STR_CONV_MODE_LEADING_ZEROS, 2); + StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); + GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0); + StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMap); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Util_Warp_SelectMap; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} +static void DebugAction_Util_Warp_SelectMap(u8 taskId) +{ + u8 max_value = MAP_GROUP_COUNT[gTasks[taskId].data[5]]; //maps in the selected map group + + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > max_value-1) + gTasks[taskId].data[3] = max_value-1; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 0) + gTasks[taskId].data[3] = 0; + } + if(gMain.newKeys & DPAD_LEFT) + { + if(gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if(gMain.newKeys & DPAD_RIGHT) + { + if(gTasks[taskId].data[4] < 2) + gTasks[taskId].data[4] += 1; + } + + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]]-1, STR_CONV_MODE_LEADING_ZEROS, 2); + StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); + GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0); + StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMap); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[6] = gTasks[taskId].data[3]; + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 0; + + StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectWarp); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + gTasks[taskId].func = DebugAction_Util_Warp_SelectWarp; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} +static void DebugAction_Util_Warp_SelectWarp(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > 10) + gTasks[taskId].data[3] = 10; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 0) + gTasks[taskId].data[3] = 0; + } + + StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectWarp); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[7] = gTasks[taskId].data[3]; + //WARP + SetWarpDestinationToMapWarp(gTasks[taskId].data[5], gTasks[taskId].data[6], gTasks[taskId].data[7]); //If not warp with the number available -> center of map + DoWarp(); + ResetInitialPlayerAvatarState(); + DebugAction_DestroyExtraWindow(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} + +static void DebugAction_Util_CheckSaveBlock(u8 taskId) +{ + static const u8 gDebugText_SaveBlockSize[] = _("SaveBlock1 is {STR_VAR_1} bytes long.\nMax size is 15872 bytes.\pSaveBlock2 is {STR_VAR_2} bytes long.\nMax size is 3968 bytes.\pPokemonStorage is {STR_VAR_3} bytes long.\nMax size is 35712 bytes."); + + ConvertIntToDecimalStringN(gStringVar1, sizeof(struct SaveBlock1), STR_CONV_MODE_LEFT_ALIGN, 6); + ConvertIntToDecimalStringN(gStringVar2, sizeof(struct SaveBlock2), STR_CONV_MODE_LEFT_ALIGN, 6); + ConvertIntToDecimalStringN(gStringVar3, sizeof(struct PokemonStorage), STR_CONV_MODE_LEFT_ALIGN, 6); + StringExpandPlaceholders(gStringVar4, gDebugText_SaveBlockSize); + + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(Debug_ShowFieldMessageStringVar4); +} +static void DebugAction_Util_CheckWallClock(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(PlayersHouse_2F_EventScript_CheckWallClock); +} +static void DebugAction_Util_SetWallClock(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(PlayersHouse_2F_EventScript_SetWallClock); +} +static void DebugAction_Util_CheckWeekDay(u8 taskId) +{ + //StringCopy(gStringVar4, GetDayOfWeekString(gLocalTime.dayOfWeek)); + Debug_DestroyMenu(taskId); + //ScriptContext2_Enable(); + //ScriptContext1_SetupScript(Debug_ShowFieldMessageStringVar4); + EnableBothScriptContexts(); +} + + +// ******************************* +// Actions Flags +static void DebugAction_Flags_Flags(u8 taskId) +{ + u8 windowId; + + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + CopyWindowToVram(windowId, 3); + + //Display initial Flag + ConvertIntToDecimalStringN(gStringVar1, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); + ConvertIntToHexStringN(gStringVar2, 0, STR_CONV_MODE_LEFT_ALIGN, 3); + StringExpandPlaceholders(gStringVar1, gDebugText_FlagHex); + if(FlagGet(0) == TRUE) + StringCopyPadded(gStringVar2, gDebugText_FlagSet, CHAR_SPACE, 15); + else + StringCopyPadded(gStringVar2, gDebugText_FlagUnset, CHAR_SPACE, 15); + StringCopy(gStringVar3, gText_DigitIndicator[0]); + StringExpandPlaceholders(gStringVar4, gDebugText_Flag); + AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Flags_FlagsSelect; + gTasks[taskId].data[2] = windowId; + gTasks[taskId].data[3] = 0; //Current Flag + gTasks[taskId].data[4] = 0; //Digit Selected +} +static void DebugAction_Flags_FlagsSelect(u8 taskId) +{ + if (gMain.newKeys & A_BUTTON) + FlagToggle(gTasks[taskId].data[3]); + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + return; + } + + if(gMain.newKeys & DPAD_UP) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] >= FLAGS_COUNT){ + gTasks[taskId].data[3] = FLAGS_COUNT - 1; + } + } + if(gMain.newKeys & DPAD_DOWN) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 0){ + gTasks[taskId].data[3] = 0; + } + } + if(gMain.newKeys & DPAD_LEFT) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[4] -= 1; + if(gTasks[taskId].data[4] < 0) + { + gTasks[taskId].data[4] = 0; + } + } + if(gMain.newKeys & DPAD_RIGHT) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[4] += 1; + if(gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_FLAGS-1) + { + gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_FLAGS-1; + } + } + + if (gMain.newKeys & DPAD_ANY || gMain.newKeys & A_BUTTON) + { + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); + ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 3); + StringExpandPlaceholders(gStringVar1, gDebugText_FlagHex); + if(FlagGet(gTasks[taskId].data[3]) == TRUE) + StringCopyPadded(gStringVar2, gDebugText_FlagSet, CHAR_SPACE, 15); + else + StringCopyPadded(gStringVar2, gDebugText_FlagUnset, CHAR_SPACE, 15); + StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringExpandPlaceholders(gStringVar4, gDebugText_Flag); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } +} + +static void DebugAction_Flags_SetPokedexFlags(u8 taskId) +{ + u16 i; + for (i = 0; i < NATIONAL_DEX_COUNT; i++) + { + GetSetPokedexFlag(i + 1, FLAG_SET_CAUGHT); + GetSetPokedexFlag(i + 1, FLAG_SET_SEEN); + } + Debug_DestroyMenu(taskId); + EnableBothScriptContexts(); +} +static void DebugAction_Flags_SwitchDex(u8 taskId) +{ + if(FlagGet(FLAG_SYS_POKEDEX_GET)) + { + FlagClear(FLAG_SYS_POKEDEX_GET); + PlaySE(SE_PC_OFF); + }else{ + FlagSet(FLAG_SYS_POKEDEX_GET); + PlaySE(SE_PC_LOGIN); + } +} +static void DebugAction_Flags_SwitchNatDex(u8 taskId) +{ + if(IsNationalPokedexEnabled()) + { + DisableNationalPokedex(); + PlaySE(SE_PC_OFF); + }else{ + EnableNationalPokedex(); + PlaySE(SE_PC_LOGIN); + } +} +static void DebugAction_Flags_SwitchPokeNav(u8 taskId) +{ + if(FlagGet(FLAG_SYS_POKENAV_GET)) + { + FlagClear(FLAG_SYS_POKENAV_GET); + PlaySE(SE_PC_OFF); + }else{ + FlagSet(FLAG_SYS_POKENAV_GET); + PlaySE(SE_PC_LOGIN); + } +} +static void DebugAction_Flags_ToggleFlyFlags(u8 taskId) +{ + // Sound effect + if(FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_VISITED_LITTLEROOT_TOWN); + FlagToggle(FLAG_VISITED_OLDALE_TOWN); + FlagToggle(FLAG_VISITED_DEWFORD_TOWN); + FlagToggle(FLAG_VISITED_LAVARIDGE_TOWN); + FlagToggle(FLAG_VISITED_FALLARBOR_TOWN); + FlagToggle(FLAG_VISITED_VERDANTURF_TOWN); + FlagToggle(FLAG_VISITED_PACIFIDLOG_TOWN); + FlagToggle(FLAG_VISITED_PETALBURG_CITY); + FlagToggle(FLAG_VISITED_SLATEPORT_CITY); + FlagToggle(FLAG_VISITED_MAUVILLE_CITY); + FlagToggle(FLAG_VISITED_RUSTBORO_CITY); + FlagToggle(FLAG_VISITED_FORTREE_CITY); + FlagToggle(FLAG_VISITED_LILYCOVE_CITY); + FlagToggle(FLAG_VISITED_MOSSDEEP_CITY); + FlagToggle(FLAG_VISITED_SOOTOPOLIS_CITY); + FlagToggle(FLAG_VISITED_EVER_GRANDE_CITY); + FlagToggle(FLAG_LANDMARK_POKEMON_LEAGUE); + FlagToggle(FLAG_LANDMARK_BATTLE_FRONTIER); +} +static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId) +{ + // Sound effect + if(FlagGet(FLAG_BADGE08_GET)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_BADGE01_GET); + FlagToggle(FLAG_BADGE02_GET); + FlagToggle(FLAG_BADGE03_GET); + FlagToggle(FLAG_BADGE04_GET); + FlagToggle(FLAG_BADGE05_GET); + FlagToggle(FLAG_BADGE06_GET); + FlagToggle(FLAG_BADGE07_GET); + FlagToggle(FLAG_BADGE08_GET); +} +static void DebugAction_Flags_CollisionOnOff(u8 taskId) +{ + if(FlagGet(FLAG_SYS_NO_COLLISION)) + { + FlagClear(FLAG_SYS_NO_COLLISION); + PlaySE(SE_PC_OFF); + }else{ + FlagSet(FLAG_SYS_NO_COLLISION); + PlaySE(SE_PC_LOGIN); + } +} +static void DebugAction_Flags_EncounterOnOff(u8 taskId) +{ + if(FlagGet(FLAG_SYS_NO_ENCOUNTER)) + { + FlagClear(FLAG_SYS_NO_ENCOUNTER); + PlaySE(SE_PC_OFF); + }else{ + FlagSet(FLAG_SYS_NO_ENCOUNTER); + PlaySE(SE_PC_LOGIN); + } +} +static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) +{ + if(FlagGet(FLAG_SYS_NO_TRAINER_SEE)) + { + FlagClear(FLAG_SYS_NO_TRAINER_SEE); + PlaySE(SE_PC_OFF); + }else{ + FlagSet(FLAG_SYS_NO_TRAINER_SEE); + PlaySE(SE_PC_LOGIN); + } +} +static void DebugAction_Flags_BagUseOnOff(u8 taskId) +{ + if(FlagGet(FLAG_SYS_NO_BAG_USE)) + { + FlagClear(FLAG_SYS_NO_BAG_USE); + PlaySE(SE_PC_OFF); + }else{ + FlagSet(FLAG_SYS_NO_BAG_USE); + PlaySE(SE_PC_LOGIN); + } +} +static void DebugAction_Flags_CatchingOnOff(u8 taskId) +{ + if(FlagGet(FLAG_SYS_NO_CATCHING)) + { + FlagClear(FLAG_SYS_NO_CATCHING); + PlaySE(SE_PC_OFF); + }else{ + FlagSet(FLAG_SYS_NO_CATCHING); + PlaySE(SE_PC_LOGIN); + } +} + +// ******************************* +// Actions Variables +static void DebugAction_Vars_Vars(u8 taskId) +{ + u8 windowId; + + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + CopyWindowToVram(windowId, 3); + + //Display initial Variable + ConvertIntToDecimalStringN(gStringVar1, VARS_START, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); + ConvertIntToHexStringN(gStringVar2, VARS_START, STR_CONV_MODE_LEFT_ALIGN, 4); + StringExpandPlaceholders(gStringVar1, gDebugText_VariableHex); + ConvertIntToDecimalStringN(gStringVar3, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringCopy(gStringVar2, gText_DigitIndicator[0]); + StringExpandPlaceholders(gStringVar4, gDebugText_Variable); + AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Vars_Select; + gTasks[taskId].data[2] = windowId; + gTasks[taskId].data[3] = VARS_START; //Current Variable + gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[5] = 0; //Current Variable VALUE +} + +static void DebugAction_Vars_Select(u8 taskId) +{ + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > VARS_END){ + gTasks[taskId].data[3] = VARS_END; + } + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < VARS_START){ + gTasks[taskId].data[3] = VARS_START; + } + } + if(gMain.newKeys & DPAD_LEFT) + { + gTasks[taskId].data[4] -= 1; + if(gTasks[taskId].data[4] < 0) + { + gTasks[taskId].data[4] = 0; + } + } + if(gMain.newKeys & DPAD_RIGHT) + { + gTasks[taskId].data[4] += 1; + if(gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_VARIABLES-1) + { + gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_VARIABLES-1; + } + } + + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); + ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); + StringExpandPlaceholders(gStringVar1, gDebugText_VariableHex); + if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value, if 65535 the value hasnt been set + gTasks[taskId].data[5] = 0; + else + gTasks[taskId].data[5] = VarGet(gTasks[taskId].data[3]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[5], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit + + //Combine str's to full window string + StringExpandPlaceholders(gStringVar4, gDebugText_Variable); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[4] = 0; + + PlaySE(SE_SELECT); + + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); + ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); + StringExpandPlaceholders(gStringVar1, gDebugText_VariableHex); + if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value if 65535 the value hasnt been set + gTasks[taskId].data[5] = 0; + else + gTasks[taskId].data[5] = VarGet(gTasks[taskId].data[3]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[5], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit + StringExpandPlaceholders(gStringVar4, gDebugText_VariableValueSet); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].data[6] = gTasks[taskId].data[5]; //New value selector + gTasks[taskId].func = DebugAction_Vars_SetValue; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + return; + } +} +static void DebugAction_Vars_SetValue(u8 taskId) +{ + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[6] >= 100){ + gTasks[taskId].data[6] = 99; + } + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[6] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[6] < 0){ + gTasks[taskId].data[6] = 0; + } + } + if(gMain.newKeys & DPAD_LEFT) + { + gTasks[taskId].data[4] -= 1; + if(gTasks[taskId].data[4] < 0) + { + gTasks[taskId].data[4] = 0; + } + } + if(gMain.newKeys & DPAD_RIGHT) + { + gTasks[taskId].data[4] += 1; + if(gTasks[taskId].data[4] > 2) + { + gTasks[taskId].data[4] = 2; + } + } + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + VarSet(gTasks[taskId].data[3], gTasks[taskId].data[5]); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + return; + } + + if (gMain.newKeys & DPAD_ANY || gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); + ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); + StringExpandPlaceholders(gStringVar1, gDebugText_VariableHex); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[6], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit + StringExpandPlaceholders(gStringVar4, gDebugText_VariableValueSet); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } +} + + +// ******************************* +// Actions Give +#define ITEM_TAG 0xFDF3 +static void DebugAction_Give_Item(u8 taskId) +{ + u8 windowId; + + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + CopyWindowToVram(windowId, 3); + + //Display initial ID + StringCopy(gStringVar2, gText_DigitIndicator[0]); + ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); + CopyItemName(1, gStringVar1); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_ItemID); + AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Item_SelectId; + gTasks[taskId].data[2] = windowId; + gTasks[taskId].data[3] = 1; //Current ID + gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[6] = AddItemIconSprite(ITEM_TAG, ITEM_TAG, gTasks[taskId].data[3]); + gSprites[gTasks[taskId].data[6]].pos2.x = DEBUG_NUMBER_ICON_X+10; + gSprites[gTasks[taskId].data[6]].pos2.y = DEBUG_NUMBER_ICON_Y+10; + gSprites[gTasks[taskId].data[6]].oam.priority = 0; +} +static void DebugAction_Give_Item_SelectId(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] >= ITEMS_COUNT) + gTasks[taskId].data[3] = ITEMS_COUNT - 1; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 1) + gTasks[taskId].data[3] = 1; + } + if(gMain.newKeys & DPAD_LEFT) + { + if(gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if(gMain.newKeys & DPAD_RIGHT) + { + if(gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS-1) + gTasks[taskId].data[4] += 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + CopyItemName(gTasks[taskId].data[3], gStringVar1); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); + StringExpandPlaceholders(gStringVar4, gDebugText_ItemID); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon + FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon + FreeSpriteOamMatrix(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon + DestroySprite(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon + gTasks[taskId].data[6] = AddItemIconSprite(ITEM_TAG, ITEM_TAG, gTasks[taskId].data[3]); + gSprites[gTasks[taskId].data[6]].pos2.x = DEBUG_NUMBER_ICON_X+10; + gSprites[gTasks[taskId].data[6]].pos2.y = DEBUG_NUMBER_ICON_Y+10; + gSprites[gTasks[taskId].data[6]].oam.priority = 0; + } + + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[5] = gTasks[taskId].data[3]; + gTasks[taskId].data[3] = 1; + gTasks[taskId].data[4] = 0; + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_ItemQuantity); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Item_SelectQuantity; + } + else if (gMain.newKeys & B_BUTTON) + { + FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon + FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon + FreeSpriteOamMatrix(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon + DestroySprite(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon + + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} +static void DebugAction_Give_Item_SelectQuantity(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] >= 100) + gTasks[taskId].data[3] = 99; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 1) + gTasks[taskId].data[3] = 1; + } + if(gMain.newKeys & DPAD_LEFT) + { + if(gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if(gMain.newKeys & DPAD_RIGHT) + { + if(gTasks[taskId].data[4] < 2) + gTasks[taskId].data[4] += 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_ItemQuantity); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon + FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon + FreeSpriteOamMatrix(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon + DestroySprite(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon + + PlaySE(MUS_OBTAIN_ITEM); + AddBagItem(gTasks[taskId].data[5], gTasks[taskId].data[3]); + DebugAction_DestroyExtraWindow(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon + FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon + FreeSpriteOamMatrix(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon + DestroySprite(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon + + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} + +//Pokemon +static void DebugAction_Give_PokemonSimple(u8 taskId) +{ + u8 windowId; + + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + CopyWindowToVram(windowId, 3); + + //Display initial ID + StringCopy(gStringVar2, gText_DigitIndicator[0]); + ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 3); + StringCopy(gStringVar1, gSpeciesNames[1]); //CopyItemName(1, gStringVar1); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID); + AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); + + + gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId; + gTasks[taskId].data[2] = windowId; + gTasks[taskId].data[3] = 1; //Current ID + gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[5] = 1; //Species ID + gTasks[taskId].data[6] = CreateMonIcon(1, SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite + gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID + LoadMonIconPalettes(); + gTasks[taskId].data[7] = 0; //Simple 0 or complex 1 + gTasks[taskId].data[8] = 0; //Level + gTasks[taskId].data[9] = 0; //Shiny: no 0, yes 1 + gTasks[taskId].data[10] = 0; //Nature ID + gTasks[taskId].data[11] = 0; //Ability + gTasks[taskId].data[12] = 0; //IVs +} +static void DebugAction_Give_PokemonComplex(u8 taskId) +{ + u8 windowId; + + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + CopyWindowToVram(windowId, 3); + + //Display initial ID + StringCopy(gStringVar2, gText_DigitIndicator[0]); + ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 3); + StringCopy(gStringVar1, gSpeciesNames[1]); //CopyItemName(1, gStringVar1); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID); + AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); + + + gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId; + gTasks[taskId].data[2] = windowId; + gTasks[taskId].data[3] = 1; //Current ID + gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[5] = 1; //Species ID + gTasks[taskId].data[6] = CreateMonIcon(1, SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite + gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID + LoadMonIconPalettes(); + gTasks[taskId].data[7] = 1; //Simple 0 or complex 1 + gTasks[taskId].data[8] = 0; //Level + gTasks[taskId].data[9] = 0; //Shiny: no 0, yes 1 + gTasks[taskId].data[10] = 0; //Nature ID + gTasks[taskId].data[11] = 0; //Ability + gTasks[taskId].data[12] = 0; //IVs +} + +static void DebugAction_Give_Pokemon_SelectId(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > SPECIES_CELEBI && gTasks[taskId].data[3] < SPECIES_TREECKO) + gTasks[taskId].data[3] = SPECIES_TREECKO; + if(gTasks[taskId].data[3] >= NUM_SPECIES - 1) + gTasks[taskId].data[3] = NUM_SPECIES - 2; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < SPECIES_TREECKO && gTasks[taskId].data[3] > SPECIES_CELEBI) + gTasks[taskId].data[3] = SPECIES_CELEBI; + if(gTasks[taskId].data[3] < 1) + gTasks[taskId].data[3] = 1; + } + if(gMain.newKeys & DPAD_LEFT) + { + if(gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if(gMain.newKeys & DPAD_RIGHT) + { + if(gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS-1) + gTasks[taskId].data[4] += 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringCopy(gStringVar1, gSpeciesNames[gTasks[taskId].data[3]]); //CopyItemName(gTasks[taskId].data[3], gStringVar1); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create new pokemon sprite + gSprites[gTasks[taskId].data[6]].oam.priority = 0; + //LoadMonIconPalettes(); + } + + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[5] = gTasks[taskId].data[3]; //Species ID + gTasks[taskId].data[3] = 1; + gTasks[taskId].data[4] = 0; + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonLevel); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Pokemon_SelectLevel; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite + DebugAction_DestroyExtraWindow(taskId); + } +} +static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > 100) + gTasks[taskId].data[3] = 100; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 1) + gTasks[taskId].data[3] = 1; + } + if(gMain.newKeys & DPAD_LEFT) + { + if(gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if(gMain.newKeys & DPAD_RIGHT) + { + if(gTasks[taskId].data[4] < 2) + gTasks[taskId].data[4] += 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonLevel); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite + if (gTasks[taskId].data[7] == 0) + { + PlaySE(MUS_LEVEL_UP); + ScriptGiveMon(gTasks[taskId].data[5], gTasks[taskId].data[3], ITEM_NONE, 0,0,0); + DebugAction_DestroyExtraWindow(taskId); + }else{ + gTasks[taskId].data[8] = gTasks[taskId].data[3]; //Level + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 0; + + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, gDebugText_FlagUnset, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonShiny); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Pokemon_SelectShiny; + } + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite + DebugAction_DestroyExtraWindow(taskId); + } +} +//If complex +static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > 1) + gTasks[taskId].data[3] = 1; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 0) + gTasks[taskId].data[3] = 0; + } + + if(gTasks[taskId].data[3] == 1) + StringCopyPadded(gStringVar2, gDebugText_FlagSet, CHAR_SPACE, 15); + else + StringCopyPadded(gStringVar2, gDebugText_FlagUnset, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonShiny); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[9] = gTasks[taskId].data[3]; //isShiny + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 0; + + //("ID: {STR_VAR_3}\nNature: {STR_VAR_1}\n\n{STR_VAR_2}"); + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringCopy(gStringVar1, gNatureNamePointers[0]); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonNature); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Pokemon_SelectNature; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} +static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > NUM_NATURES-1) + gTasks[taskId].data[3] = NUM_NATURES-1; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 0) + gTasks[taskId].data[3] = 0; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringCopy(gStringVar1, gNatureNamePointers[gTasks[taskId].data[3]]); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonNature); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[10] = gTasks[taskId].data[3]; //Nature + gTasks[taskId].data[3] = 1; + gTasks[taskId].data[4] = 0; + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringCopy(gStringVar1, gAbilityNames[gTasks[taskId].data[3]]); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonAbility); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Pokemon_SelectAbility; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} +static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > ABILITIES_COUNT-1) + gTasks[taskId].data[3] = ABILITIES_COUNT-1; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 1) + gTasks[taskId].data[3] = 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringCopy(gStringVar1, gAbilityNames[gTasks[taskId].data[3]]); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonAbility); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[11] = gTasks[taskId].data[3]; //Ability + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 0; + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIVs); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} +static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > 31) + gTasks[taskId].data[3] = 31; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 0) + gTasks[taskId].data[3] = 0; + } + if(gMain.newKeys & DPAD_LEFT) + { + if(gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if(gMain.newKeys & DPAD_RIGHT) + { + if(gTasks[taskId].data[4] < 2) + gTasks[taskId].data[4] += 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIVs); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + gTasks[taskId].data[12] = gTasks[taskId].data[3]; //IVs + + PlaySE(MUS_LEVEL_UP); + gTasks[taskId].func = DebugAction_Give_Pokemon_ComplexCreateMon; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} +static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://github.com/ghoulslash/pokeemerald/tree/custom-givemon +{ + u16 nationalDexNum; + int sentToPc; + struct Pokemon mon; + u8 i; + u16 species = gTasks[taskId].data[5]; //species ID + u8 level = gTasks[taskId].data[8]; //Level + u8 isShiny = gTasks[taskId].data[9]; //Shiny: no 0, yes 1 + u8 nature = gTasks[taskId].data[10]; //Nature ID + u8 abilityNum = gTasks[taskId].data[11]; //Ability ID + u8 iv_val = gTasks[taskId].data[12]; //IVs + + if (nature == NUM_NATURES || nature == 0xFF) + nature = Random() % NUM_NATURES; + + if (isShiny == 1) + { + u32 personality; + u32 otid = gSaveBlock2Ptr->playerTrainerId[0] + | (gSaveBlock2Ptr->playerTrainerId[1] << 8) + | (gSaveBlock2Ptr->playerTrainerId[2] << 16) + | (gSaveBlock2Ptr->playerTrainerId[3] << 24); + + do + { + personality = Random32(); + personality = ((((Random() % 8) ^ (HIHALF(otid) ^ LOHALF(otid))) ^ LOHALF(personality)) << 16) | LOHALF(personality); + } while (nature != GetNatureFromPersonality(personality)); + + CreateMon(&mon, species, level, 32, 1, personality, OT_ID_PRESET, otid); + } + else + CreateMonWithNature(&mon, species, level, 32, nature); + + for (i = 0; i < NUM_STATS; i++) + { + // ev + // if (evs[i] != 0xFF && evTotal < 510) + // { + // // only up to 510 evs + // if ((evTotal + evs[i]) > 510) + // evs[i] = (510 - evTotal); + + // evTotal += evs[i]; + // SetMonData(&mon, MON_DATA_HP_EV + i, &evs[i]); + // } + + // iv + if (iv_val != 32 && iv_val != 0xFF) + SetMonData(&mon, MON_DATA_HP_IV + i, &iv_val); + } + CalculateMonStats(&mon); + + // for (i = 0; i < MAX_MON_MOVES; i++) + // { + // if (moves[i] == 0 || moves[i] == 0xFF || moves[i] > MOVES_COUNT) + // continue; + + // SetMonMoveSlot(&mon, moves[i], i); + // } + + //ability + if (abilityNum == 0xFF || GetAbilityBySpecies(species, abilityNum) == 0) + { + do { + abilityNum = Random() % 3; // includes hidden abilities + } while (GetAbilityBySpecies(species, abilityNum) == 0); + } + + SetMonData(&mon, MON_DATA_ABILITY_NUM, &abilityNum); + + //ball + // if (ball <= POKEBALL_COUNT) + // SetMonData(&mon, MON_DATA_POKEBALL, &ball); + + //item + // heldItem[0] = item; + // heldItem[1] = item >> 8; + // SetMonData(&mon, MON_DATA_HELD_ITEM, heldItem); + + // give player the mon + //sentToPc = GiveMonToPlayer(&mon); + SetMonData(&mon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName); + SetMonData(&mon, MON_DATA_OT_GENDER, &gSaveBlock2Ptr->playerGender); + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) == SPECIES_NONE) + break; + } + + if (i >= PARTY_SIZE) + sentToPc = SendMonToPC(&mon); + else + { + sentToPc = MON_GIVEN_TO_PARTY; + CopyMon(&gPlayerParty[i], &mon, sizeof(mon)); + gPlayerPartyCount = i + 1; + } + + nationalDexNum = SpeciesToNationalPokedexNum(species); + switch(sentToPc) + { + case MON_GIVEN_TO_PARTY: + case MON_GIVEN_TO_PC: + GetSetPokedexFlag(nationalDexNum, FLAG_SET_SEEN); + GetSetPokedexFlag(nationalDexNum, FLAG_SET_CAUGHT); + break; + case MON_CANT_GIVE: + break; + } + + DebugAction_DestroyExtraWindow(taskId); //return sentToPc; +} + +static void DebugAction_Give_CHEAT(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(Debug_CheatStart); +} + +// static void DebugAction_AccessPC(u8 taskId) +// { +// Debug_DestroyMenu(taskId); +// PlaySE(SE_PC_ON); +// ScriptContext1_SetupScript(EventScript_PC); +// } + + + + + +// Additional functions +/* +static void DebugAction_OpenSubMenu(u8 taskId, struct ListMenuTemplate LMtemplate) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput, LMtemplate); +} +static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if ((func = HandleInput[input]) != NULL) + func(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + EnableBothScriptContexts(); + } +} +*/ + + +#endif diff --git a/src/event_data.c b/src/event_data.c index 2bde09012d..96156d8a65 100644 --- a/src/event_data.c +++ b/src/event_data.c @@ -184,6 +184,14 @@ u16 VarGet(u16 id) return *ptr; } +u16 VarGetIfExist(u16 id) +{ + u16 *ptr = GetVarPointer(id); + if (!ptr) + return 65535; + return *ptr; +} + bool8 VarSet(u16 id, u16 value) { u16 *ptr = GetVarPointer(id); @@ -216,6 +224,14 @@ u8 FlagSet(u16 id) return 0; } +u8 FlagToggle(u16 id) +{ + u8 *ptr = GetFlagPointer(id); + if (ptr) + *ptr ^= 1 << (id & 7); + return 0; +} + u8 FlagClear(u16 id) { u8 *ptr = GetFlagPointer(id); diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 72de880c85..e09379d0ce 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4723,6 +4723,12 @@ static u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction) u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) { u8 direction = dir; + +#if DEBUG //DEBUG + if (FlagGet(FLAG_SYS_NO_COLLISION)) + return COLLISION_NONE; +#endif // + if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y)) return COLLISION_OUTSIDE_RANGE; else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction)) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index fab14c5776..c586656fb1 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -3,6 +3,7 @@ #include "bike.h" #include "coord_event_weather.h" #include "daycare.h" +#include "debug.h" #include "faraway_island.h" #include "event_data.h" #include "event_object_movement.h" @@ -130,6 +131,35 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) input->dpadDirection = DIR_WEST; else if (heldKeys & DPAD_RIGHT) input->dpadDirection = DIR_EAST; + + + //DEBUG + if (heldKeys & R_BUTTON) + { + if(input->pressedSelectButton) + { + input->input_field_1_0 = TRUE; + input->pressedSelectButton = FALSE; + }else if(input->pressedStartButton) + { + input->input_field_1_2 = TRUE; + input->pressedStartButton = FALSE; + } + } + if (heldKeys & L_BUTTON) + { + if(input->pressedSelectButton) + { + input->input_field_1_1 = TRUE; + input->pressedSelectButton = FALSE; + }else if(input->pressedStartButton) + { + input->input_field_1_3 = TRUE; + input->pressedStartButton = FALSE; + } + } + // + } int ProcessPlayerFieldInput(struct FieldInput *input) @@ -189,6 +219,15 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE) return TRUE; +#if DEBUG + if (input->input_field_1_2) + { + PlaySE(SE_WIN_OPEN); + Debug_ShowMainMenu(); + return TRUE; + } +#endif + return FALSE; } @@ -668,6 +707,9 @@ void RestartWildEncounterImmunitySteps(void) static bool8 CheckStandardWildEncounter(u16 metatileBehavior) { + if (FlagGet(FLAG_SYS_NO_ENCOUNTER)) //DEBUG + return FALSE;// + if (sWildEncounterImmunitySteps < 4) { sWildEncounterImmunitySteps++; @@ -683,7 +725,7 @@ static bool8 CheckStandardWildEncounter(u16 metatileBehavior) } sPreviousPlayerMetatileBehavior = metatileBehavior; - return FALSE; + return FALSE; } static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8 direction) diff --git a/src/item_use.c b/src/item_use.c index f9d1ff824b..64e0eac0a8 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -938,7 +938,11 @@ void ItemUseOutOfBattle_EvolutionStone(u8 taskId) void ItemUseInBattle_PokeBall(u8 taskId) { - if (IsPlayerPartyAndPokemonStorageFull() == FALSE) // have room for mon? + if (FlagGet(FLAG_SYS_NO_CATCHING)){ //DEBUG + static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p"); + DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, BagMenu_InitListsMenu); + } // + else if (IsPlayerPartyAndPokemonStorageFull() == FALSE) // have room for mon? { RemoveBagItem(gSpecialVar_ItemId, 1); if (!InBattlePyramid()) diff --git a/src/new_game.c b/src/new_game.c index 55a568132e..7fee212fbe 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -94,7 +94,7 @@ static void InitPlayerTrainerId(void) // L=A isnt set here for some reason. static void SetDefaultOptions(void) { - gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_MID; + gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_FAST; gSaveBlock2Ptr->optionsWindowFrameType = 0; gSaveBlock2Ptr->optionsSound = OPTIONS_SOUND_MONO; gSaveBlock2Ptr->optionsBattleStyle = OPTIONS_BATTLE_STYLE_SHIFT; diff --git a/src/trainer_see.c b/src/trainer_see.c index c37f372627..d5b25b0c59 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -177,6 +177,11 @@ bool8 CheckForTrainersWantingBattle(void) { u8 i; +#if DEBUG //DEBUG + if (FlagGet(FLAG_SYS_NO_TRAINER_SEE)) + return FALSE; +#endif // + gNoOfApproachingTrainers = 0; gApproachingTrainerId = 0; diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index 5e246ff249..47cc52cee9 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -393,11 +393,14 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n//\n\n"; int group_num = 0; + vector map_count_vec; //DEBUG for (auto &group : groups_data["group_order"].array_items()) { text << "// Map Group " << group_num << "\n"; vector map_ids; - size_t max_length = 0; + + size_t max_length = 0; //DEBUG + int map_count = 0; //DEBUG for (auto &map_name : groups_data[group.string_value()].array_items()) { string header_filepath = file_dir + map_name.string_value() + dir_separator + "map.json"; @@ -406,6 +409,7 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { map_ids.push_back(map_data["id"]); if (map_data["id"].string_value().length() > max_length) max_length = map_data["id"].string_value().length(); + map_count++; //DEBUG } int map_id_num = 0; @@ -416,9 +420,17 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { text << "\n"; group_num++; + map_count_vec.push_back(map_count); //DEBUG } text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n"; + + text << "// static const u8 MAP_GROUP_COUNT[] = {"; //DEBUG + for(int i=0; i Date: Wed, 21 Oct 2020 19:36:08 +0200 Subject: [PATCH 002/155] removed ability --- src/debug.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/debug.c b/src/debug.c index 84388b34f4..644e1aed8d 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1733,14 +1733,21 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) gTasks[taskId].data[3] = 1; gTasks[taskId].data[4] = 0; + // StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + // ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + // StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + // StringCopy(gStringVar1, gAbilityNames[gTasks[taskId].data[3]]); + // StringExpandPlaceholders(gStringVar4, gDebugText_PokemonAbility); + // AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + // gTasks[taskId].func = DebugAction_Give_Pokemon_SelectAbility; StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringCopy(gStringVar1, gAbilityNames[gTasks[taskId].data[3]]); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonAbility); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIVs); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); - gTasks[taskId].func = DebugAction_Give_Pokemon_SelectAbility; + gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; } else if (gMain.newKeys & B_BUTTON) { From 698886463162622c8d522716f4c87c9712cf0e47 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Mon, 26 Oct 2020 21:12:18 +0100 Subject: [PATCH 003/155] Fixed the wrong palettes for the mon icons with the help of Nadia and ghoulslash --- src/debug.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/debug.c b/src/debug.c index 84388b34f4..457c284248 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1505,9 +1505,10 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) gTasks[taskId].data[3] = 1; //Current ID gTasks[taskId].data[4] = 0; //Digit Selected gTasks[taskId].data[5] = 1; //Species ID - gTasks[taskId].data[6] = CreateMonIcon(1, SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite + FreeMonIconPalettes(); //Free space for new palletes + LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID - LoadMonIconPalettes(); gTasks[taskId].data[7] = 1; //Simple 0 or complex 1 gTasks[taskId].data[8] = 0; //Level gTasks[taskId].data[9] = 0; //Shiny: no 0, yes 1 @@ -1557,9 +1558,10 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); + FreeMonIconPalettes(); //Free space for new pallete + LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create new pokemon sprite gSprites[gTasks[taskId].data[6]].oam.priority = 0; - //LoadMonIconPalettes(); } if (gMain.newKeys & A_BUTTON) @@ -1579,6 +1581,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); + FreeMonIconPalettes(); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite DebugAction_DestroyExtraWindow(taskId); } @@ -1621,6 +1624,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) if (gMain.newKeys & A_BUTTON) { + FreeMonIconPalettes(); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite if (gTasks[taskId].data[7] == 0) { @@ -1644,6 +1648,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); + FreeMonIconPalettes(); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite DebugAction_DestroyExtraWindow(taskId); } From d380932e46a5d694747c646d98924a257c055c22 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Tue, 27 Oct 2020 09:07:06 +0100 Subject: [PATCH 004/155] Fixed forgotten PokemonSimple, thx to AsparagusEduardo --- src/debug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/debug.c b/src/debug.c index 4f589cc97d..4a246052b0 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1467,9 +1467,10 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) gTasks[taskId].data[3] = 1; //Current ID gTasks[taskId].data[4] = 0; //Digit Selected gTasks[taskId].data[5] = 1; //Species ID - gTasks[taskId].data[6] = CreateMonIcon(1, SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite + FreeMonIconPalettes(); //Free space for new pallete + LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID - LoadMonIconPalettes(); gTasks[taskId].data[7] = 0; //Simple 0 or complex 1 gTasks[taskId].data[8] = 0; //Level gTasks[taskId].data[9] = 0; //Shiny: no 0, yes 1 From 6422164d31549eacdd5873baa4227a5211b0a44a Mon Sep 17 00:00:00 2001 From: TheXaman Date: Mon, 16 Nov 2020 10:32:17 +0100 Subject: [PATCH 005/155] Added moves, trainer edits and fixed abilities, now only possible ones including hidden when using PE Give all TMs, watch credits, change trainer name/gender/id implemented moves --- include/main_menu.h | 1 + src/debug.c | 327 +++++++++++++++++++++++++++++++++++--------- src/main_menu.c | 4 +- 3 files changed, 265 insertions(+), 67 deletions(-) diff --git a/include/main_menu.h b/include/main_menu.h index 1944f4ecc5..790c9d10ec 100644 --- a/include/main_menu.h +++ b/include/main_menu.h @@ -3,5 +3,6 @@ void CB2_InitMainMenu(void); void CreateYesNoMenuParameterized(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f); +void NewGameBirchSpeech_SetDefaultPlayerName(u8); #endif // GUARD_MAIN_MENU_H diff --git a/src/debug.c b/src/debug.c index 4a246052b0..dc884b77fb 100644 --- a/src/debug.c +++ b/src/debug.c @@ -6,8 +6,8 @@ //Pyredrid: https://github.com/Pyredrid/pokeemerald/tree/debugmenu //AsparagusEduardo: https://github.com/AsparagusEduardo/pokeemerald/tree/InfusedEmerald_v2 //Ghoulslash: https://github.com/ghoulslash/pokeemerald -#include "debug.h" #include "global.h" +#include "credits.h" #include "data.h" #include "event_data.h" #include "event_object_movement.h" @@ -19,8 +19,11 @@ #include "item_icon.h" #include "list_menu.h" #include "main.h" +#include "main_menu.h" #include "map_name_popup.h" #include "menu.h" +#include "naming_screen.h" +#include "new_game.h" #include "overworld.h" #include "pokedex.h" #include "pokemon.h" @@ -85,6 +88,10 @@ static void DebugAction_Util_CheckSaveBlock(u8); static void DebugAction_Util_CheckWallClock(u8); static void DebugAction_Util_SetWallClock(u8); static void DebugAction_Util_CheckWeekDay(u8); +static void DebugAction_Util_WatchCredits(u8); +static void DebugAction_Util_Trainer_Name(u8); +static void DebugAction_Util_Trainer_Gender(u8); +static void DebugAction_Util_Trainer_Id(u8); static void DebugAction_Flags_Flags(u8 taskId); static void DebugAction_Flags_FlagsSelect(u8 taskId); @@ -108,6 +115,7 @@ static void DebugAction_Vars_SetValue(u8 taskId); static void DebugAction_Give_Item(u8 taskId); static void DebugAction_Give_Item_SelectId(u8 taskId); static void DebugAction_Give_Item_SelectQuantity(u8 taskId); +static void DebugAction_Give_AllTMs(u8 taskId); static void DebugAction_Give_PokemonSimple(u8 taskId); static void DebugAction_Give_PokemonComplex(u8 taskId); static void DebugAction_Give_Pokemon_SelectId(u8 taskId); @@ -117,6 +125,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId); static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId); static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId); static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId); +static void DebugAction_Give_Pokemon_Move(u8 taskId); static void DebugAction_Give_CHEAT(u8 taskId); static void DebugAction_AccessPC(u8 taskId); @@ -147,6 +156,10 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK, DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY, + DEBUG_UTIL_MENU_ITEM_WATCHCREDITS, + DEBUG_UTIL_MENU_ITEM_TRAINER_NAME, + DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER, + DEBUG_UTIL_MENU_ITEM_TRAINER_ID, }; enum { // Flags DEBUG_FLAG_MENU_ITEM_FLAGS, @@ -163,10 +176,11 @@ enum { // Flags DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF, }; enum { // Vars - DEBUG_VARS_MENU_ITEM_VARS, + DEBUG_VARS_MENU_ITEM_VARS, }; enum { // Give DEBUG_GIVE_MENU_ITEM_ITEM, + DEBUG_MENU_ITEM_GIVE_ALLTMS, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX, DEBUG_GIVE_MENU_ITEM_CHEAT, @@ -196,6 +210,10 @@ static const u8 gDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space") static const u8 gDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); static const u8 gDebugText_Util_SetWallClock[] = _("Set Wall Clock"); static const u8 gDebugText_Util_CheckWeekDay[] = _("Check Week Day"); +static const u8 gDebugText_Util_WatchCredits[] = _("Watch Credits"); +static const u8 gDebugText_Util_Trainer_Name[] = _("Trainer name"); +static const u8 gDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); +static const u8 gDebugText_Util_Trainer_Id[] = _("New Trainer Id"); // Flags Menu static const u8 gDebugText_Flags_Flags[] = _("Set Flag XXXX"); static const u8 gDebugText_Flags_SetPokedexFlags[] = _("All Pokédex Flags"); @@ -219,20 +237,24 @@ static const u8 gDebugText_VariableHex[] = _("{STR_VAR_1} \n static const u8 gDebugText_Variable[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); static const u8 gDebugText_VariableValueSet[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); // Give Menu -static const u8 gDebugText_Give_GiveItem[] = _("Give item XXXX"); -static const u8 gDebugText_ItemQuantity[] = _("Quantity: \n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 gDebugText_ItemID[] = _("Item ID: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 gDebugText_Give_GivePokemonSimple[] = _("Pkm (ID,lvl)"); -static const u8 gDebugText_Give_GivePokemonComplex[] = _("Pkm (ID,lvl,shi,nat,ab,IVs)"); -static const u8 gDebugText_PokemonID[] = _("ID: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 gDebugText_PokemonLevel[] = _("Level: \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonShiny[] = _("Shiny: \n {STR_VAR_2} \n \n "); -static const u8 gDebugText_PokemonNature[] = _("ID: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonAbility[] = _("ID: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonIVs[] = _("All IVs: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT start"); +static const u8 gDebugText_Give_GiveItem[] = _("Give item XXXX"); +static const u8 gDebugText_ItemQuantity[] = _("Quantity: \n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_ItemID[] = _("Item Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_Give_AllTMs[] = _("Give all TMs"); +static const u8 gDebugText_Give_GivePokemonSimple[] = _("Pkm(lvl)"); +static const u8 gDebugText_Give_GivePokemonComplex[] = _("Pkm(l,s,n,a,IV,mov)"); +static const u8 gDebugText_PokemonID[] = _("Species: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_PokemonLevel[] = _("Level: \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonShiny[] = _("Shiny: \n {STR_VAR_2} \n \n "); +static const u8 gDebugText_PokemonNature[] = _("NatureId: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonAbility[] = _("AbilityNum: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonIVs[] = _("All IVs: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT start"); // static const u8 gDebugText_Give_AccessPC[] = _("Access PC"); -// static const u8 gDebugText_Give_GiveAllTMs[] = _("Give All TMs"); static const u8 digitInidicator_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); static const u8 digitInidicator_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); @@ -286,6 +308,10 @@ static const struct ListMenuItem sDebugMenu_Items_Utilities[] = [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {gDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {gDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, [DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY] = {gDebugText_Util_CheckWeekDay, DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY}, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {gDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = {gDebugText_Util_Trainer_Name, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {gDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {gDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, }; static const struct ListMenuItem sDebugMenu_Items_Flags[] = { @@ -309,10 +335,10 @@ static const struct ListMenuItem sDebugMenu_Items_Vars[] = static const struct ListMenuItem sDebugMenu_Items_Give[] = { [DEBUG_GIVE_MENU_ITEM_ITEM] = {gDebugText_Give_GiveItem, DEBUG_GIVE_MENU_ITEM_ITEM}, + [DEBUG_MENU_ITEM_GIVE_ALLTMS] = {gDebugText_Give_AllTMs, DEBUG_MENU_ITEM_GIVE_ALLTMS}, [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {gDebugText_Give_GivePokemonSimple, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE}, [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {gDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, [DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, - //[DEBUG_MENU_ITEM_GIVE_ALLTMS] = {gDebugText_GiveAllTMs, DEBUG_MENU_ITEM_GIVE_ALLTMS}, //[DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, }; @@ -335,6 +361,10 @@ static void (*const sDebugMenu_Actions_Utilities[])(u8) = [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, [DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY] = DebugAction_Util_CheckWeekDay, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, + [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = DebugAction_Util_Trainer_Name, + [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = DebugAction_Util_Trainer_Gender, + [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id, }; static void (*const sDebugMenu_Actions_Flags[])(u8) = { @@ -358,10 +388,10 @@ static void (*const sDebugMenu_Actions_Vars[])(u8) = static void (*const sDebugMenu_Actions_Give[])(u8) = { [DEBUG_GIVE_MENU_ITEM_ITEM] = DebugAction_Give_Item, + [DEBUG_MENU_ITEM_GIVE_ALLTMS] = DebugAction_Give_AllTMs, [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = DebugAction_Give_PokemonSimple, [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = DebugAction_Give_PokemonComplex, [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, - //[DEBUG_MENU_ITEM_GIVE_ALLTMS] = DebugAction_GiveAllTMs, //[DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, }; @@ -860,7 +890,33 @@ static void DebugAction_Util_CheckWeekDay(u8 taskId) //ScriptContext1_SetupScript(Debug_ShowFieldMessageStringVar4); EnableBothScriptContexts(); } - +static void DebugAction_Util_WatchCredits(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + Debug_DestroyMenu(taskId); + SetMainCallback2(CB2_StartCreditsSequence); +} +static void DebugAction_Util_Trainer_Name(u8 taskId) +{ + NewGameBirchSpeech_SetDefaultPlayerName(Random() % 20); + DoNamingScreen(0, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldContinueScript); +} +static void DebugAction_Util_Trainer_Gender(u8 taskId) +{ + if(gSaveBlock2Ptr->playerGender == 0) // 0 Male, 1 Female + gSaveBlock2Ptr->playerGender = 1; + else + gSaveBlock2Ptr->playerGender = 0; + Debug_DestroyMenu(taskId); + EnableBothScriptContexts(); +} +static void DebugAction_Util_Trainer_Id(u8 taskId) +{ + u32 trainerId = (Random() << 0x10) | GetGeneratedTrainerIdLower(); + SetTrainerId(trainerId, gSaveBlock2Ptr->playerTrainerId); + Debug_DestroyMenu(taskId); + EnableBothScriptContexts(); +} // ******************************* // Actions Flags @@ -1438,6 +1494,16 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId) } } +//TMs +static void DebugAction_Give_AllTMs(u8 taskId) +{ + u16 i; + PlayFanfare(MUS_OBTAIN_TMHM); + for (i = ITEM_TM01; i <= ITEM_TM50; i++) + if(!CheckBagHasItem(i, 1)) + AddBagItem(i, 1); +} + //Pokemon static void DebugAction_Give_PokemonSimple(u8 taskId) { @@ -1471,12 +1537,7 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID - gTasks[taskId].data[7] = 0; //Simple 0 or complex 1 - gTasks[taskId].data[8] = 0; //Level - gTasks[taskId].data[9] = 0; //Shiny: no 0, yes 1 - gTasks[taskId].data[10] = 0; //Nature ID - gTasks[taskId].data[11] = 0; //Ability - gTasks[taskId].data[12] = 0; //IVs + gTasks[taskId].data[7] = 1; //Level } static void DebugAction_Give_PokemonComplex(u8 taskId) { @@ -1510,12 +1571,12 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID - gTasks[taskId].data[7] = 1; //Simple 0 or complex 1 - gTasks[taskId].data[8] = 0; //Level - gTasks[taskId].data[9] = 0; //Shiny: no 0, yes 1 - gTasks[taskId].data[10] = 0; //Nature ID - gTasks[taskId].data[11] = 0; //Ability - gTasks[taskId].data[12] = 0; //IVs + gTasks[taskId].data[7] = 0; //Level + gTasks[taskId].data[8] = 0; //Shiny: no 0, yes 1 + gTasks[taskId].data[9] = 0; //Nature ID + gTasks[taskId].data[10] = 0; //Ability + gTasks[taskId].data[11] = 0; //IVs + gTasks[taskId].data[12] = 0; //Move 0 } static void DebugAction_Give_Pokemon_SelectId(u8 taskId) @@ -1627,13 +1688,13 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) { FreeMonIconPalettes(); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite - if (gTasks[taskId].data[7] == 0) + if (gTasks[taskId].data[7] == 1) { PlaySE(MUS_LEVEL_UP); ScriptGiveMon(gTasks[taskId].data[5], gTasks[taskId].data[3], ITEM_NONE, 0,0,0); DebugAction_DestroyExtraWindow(taskId); }else{ - gTasks[taskId].data[8] = gTasks[taskId].data[3]; //Level + gTasks[taskId].data[7] = gTasks[taskId].data[3]; //Level gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; @@ -1686,7 +1747,7 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) if (gMain.newKeys & A_BUTTON) { - gTasks[taskId].data[9] = gTasks[taskId].data[3]; //isShiny + gTasks[taskId].data[8] = gTasks[taskId].data[3]; //isShiny gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; @@ -1735,25 +1796,21 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) if (gMain.newKeys & A_BUTTON) { - gTasks[taskId].data[10] = gTasks[taskId].data[3]; //Nature - gTasks[taskId].data[3] = 1; + u8 abilityId; + gTasks[taskId].data[9] = gTasks[taskId].data[3]; //NatureId + gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; - // StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); - // ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); - // StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - // StringCopy(gStringVar1, gAbilityNames[gTasks[taskId].data[3]]); - // StringExpandPlaceholders(gStringVar4, gDebugText_PokemonAbility); - // AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); - // gTasks[taskId].func = DebugAction_Give_Pokemon_SelectAbility; StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIVs); + abilityId = GetAbilityBySpecies(gTasks[taskId].data[5], 0); + StringCopy(gStringVar1, gAbilityNames[abilityId]); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonAbility); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); - gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; + gTasks[taskId].func = DebugAction_Give_Pokemon_SelectAbility; } else if (gMain.newKeys & B_BUTTON) { @@ -1763,6 +1820,14 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) } static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) { + u8 abilityId; + u8 abilityCount = 0; + if (gBaseStats[gTasks[taskId].data[5]].abilities[1] != ABILITY_NONE) + abilityCount++; + #ifdef POKEMON_EXPANSION + if (gBaseStats[gTasks[taskId].data[5]].abilityHidden != ABILITY_NONE) + abilityCount++; + #endif if (gMain.newKeys & DPAD_ANY) { PlaySE(SE_SELECT); @@ -1770,27 +1835,28 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) if(gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > ABILITIES_COUNT-1) - gTasks[taskId].data[3] = ABILITIES_COUNT-1; + if(gTasks[taskId].data[3] > abilityCount) + gTasks[taskId].data[3] = abilityCount; } if(gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 1) - gTasks[taskId].data[3] = 1; + if(gTasks[taskId].data[3] < 0) + gTasks[taskId].data[3] = 0; } + abilityId = GetAbilityBySpecies(gTasks[taskId].data[5], gTasks[taskId].data[3]); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringCopy(gStringVar1, gAbilityNames[gTasks[taskId].data[3]]); + StringCopy(gStringVar1, gAbilityNames[abilityId]); StringExpandPlaceholders(gStringVar4, gDebugText_PokemonAbility); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } if (gMain.newKeys & A_BUTTON) { - gTasks[taskId].data[11] = gTasks[taskId].data[3]; //Ability + gTasks[taskId].data[10] = gTasks[taskId].data[3]; //AbilityNum gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; @@ -1846,10 +1912,131 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) if (gMain.newKeys & A_BUTTON) { - gTasks[taskId].data[12] = gTasks[taskId].data[3]; //IVs + gTasks[taskId].data[11] = gTasks[taskId].data[3]; //IVs + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 0; + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_0); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Pokemon_Move; + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} +static void DebugAction_Give_Pokemon_Move(u8 taskId) +{ + u8 j; + for(j=12; j<15; j++) + { + if (gTasks[taskId].data[j] == 0) + break; + } + + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > MOVES_COUNT) + gTasks[taskId].data[3] = MOVES_COUNT; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 0) + gTasks[taskId].data[3] = 0; + } + if(gMain.newKeys & DPAD_LEFT) + { + if(gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if(gMain.newKeys & DPAD_RIGHT) + { + if(gTasks[taskId].data[4] < 3) + gTasks[taskId].data[4] += 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); + switch (j) + { + case 12: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_0); + break; + case 13: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_1); + break; + case 14: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_2); + break; + case 15: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_3); + break; + } + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + + if (gTasks[taskId].data[3] == 0) + j = 15; + else + gTasks[taskId].data[j] = gTasks[taskId].data[3]; //Move ID + + + // If last move or selected MOVE_NONE make mon, else ask for next move + if (j < 15) + { + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 0; + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); + switch (j+1) + { + case 12: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_0); + break; + case 13: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_1); + break; + case 14: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_2); + break; + case 15: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_3); + break; + } + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Pokemon_Move; + } + else + { + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 0; + + PlaySE(MUS_LEVEL_UP); + gTasks[taskId].func = DebugAction_Give_Pokemon_ComplexCreateMon; + } + - PlaySE(MUS_LEVEL_UP); - gTasks[taskId].func = DebugAction_Give_Pokemon_ComplexCreateMon; } else if (gMain.newKeys & B_BUTTON) { @@ -1863,16 +2050,23 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu int sentToPc; struct Pokemon mon; u8 i; + u16 moves[4]; u16 species = gTasks[taskId].data[5]; //species ID - u8 level = gTasks[taskId].data[8]; //Level - u8 isShiny = gTasks[taskId].data[9]; //Shiny: no 0, yes 1 - u8 nature = gTasks[taskId].data[10]; //Nature ID - u8 abilityNum = gTasks[taskId].data[11]; //Ability ID - u8 iv_val = gTasks[taskId].data[12]; //IVs + u8 level = gTasks[taskId].data[7]; //Level + u8 isShiny = gTasks[taskId].data[8]; //Shiny: no 0, yes 1 + u8 nature = gTasks[taskId].data[9]; //Nature ID + u8 abilityNum = gTasks[taskId].data[10]; //Ability ID + u8 iv_val = gTasks[taskId].data[11]; //IVs + moves[0] = gTasks[taskId].data[12]; //Move 0 + moves[1] = gTasks[taskId].data[13]; //Move 1 + moves[2] = gTasks[taskId].data[14]; //Move 2 + moves[3] = gTasks[taskId].data[15]; //Move 3 + //Nature if (nature == NUM_NATURES || nature == 0xFF) nature = Random() % NUM_NATURES; + //Shinyness if (isShiny == 1) { u32 personality; @@ -1892,6 +2086,7 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu else CreateMonWithNature(&mon, species, level, 32, nature); + //EVs/IVs for (i = 0; i < NUM_STATS; i++) { // ev @@ -1911,15 +2106,16 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu } CalculateMonStats(&mon); - // for (i = 0; i < MAX_MON_MOVES; i++) - // { - // if (moves[i] == 0 || moves[i] == 0xFF || moves[i] > MOVES_COUNT) - // continue; + //Moves + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] == 0 || moves[i] == 0xFF || moves[i] > MOVES_COUNT) + continue; - // SetMonMoveSlot(&mon, moves[i], i); - // } + SetMonMoveSlot(&mon, moves[i], i); + } - //ability + //Ability if (abilityNum == 0xFF || GetAbilityBySpecies(species, abilityNum) == 0) { do { @@ -1957,6 +2153,7 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu gPlayerPartyCount = i + 1; } + //Pokedex entry nationalDexNum = SpeciesToNationalPokedexNum(species); switch(sentToPc) { diff --git a/src/main_menu.c b/src/main_menu.c index e8403cdb17..78d3fbeb00 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -13,6 +13,7 @@ #include "international_string_util.h" #include "link.h" #include "main.h" +#include "main_menu.h" #include "menu.h" #include "list_menu.h" #include "mystery_event_menu.h" @@ -228,7 +229,6 @@ static void Task_NewGameBirchSpeech_WaitForWhatsYourNameToPrint(u8); static void Task_NewGameBirchSpeech_WaitPressBeforeNameChoice(u8); static void Task_NewGameBirchSpeech_StartNamingScreen(u8); static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void); -static void NewGameBirchSpeech_SetDefaultPlayerName(u8); static void Task_NewGameBirchSpeech_CreateNameYesNo(u8); static void Task_NewGameBirchSpeech_ProcessNameYesNoMenu(u8); void CreateYesNoMenuParameterized(u8, u8, u16, u16, u8, u8); @@ -2110,7 +2110,7 @@ static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void) return Menu_ProcessInputNoWrap(); } -static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) +void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) { const u8* name; u8 i; From 549381f336a8053149f13b50944ce858b031873d Mon Sep 17 00:00:00 2001 From: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> Date: Tue, 17 Nov 2020 02:44:30 -0600 Subject: [PATCH 006/155] Add debug makefile targets (#2) Thanks to Expo --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 52000c570a..cee566d78d 100644 --- a/Makefile +++ b/Makefile @@ -111,7 +111,7 @@ MAKEFLAGS += --no-print-directory # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) berry_fix libagbsyscall modern +.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) berry_fix libagbsyscall modern debug modern_debug infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) @@ -339,3 +339,7 @@ berry_fix: libagbsyscall: @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) + +debug: ; @$(MAKE) DDEBUG=1 DINFO=1 + +modern_debug: ; @$(MAKE) MODERN=1 DDEBUG=1 DINFO=1 From 174867c612f80e3bb07291c4d5bdca682a144336 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Fri, 27 Nov 2020 21:12:35 +0100 Subject: [PATCH 007/155] added individual IVs and reworked how data is stored to a struct --- src/debug.c | 450 ++++++++++++++++++++++++++++++++++---------------- sym_ewram.txt | 1 + 2 files changed, 306 insertions(+), 145 deletions(-) diff --git a/src/debug.c b/src/debug.c index dc884b77fb..f83acb7735 100644 --- a/src/debug.c +++ b/src/debug.c @@ -20,6 +20,7 @@ #include "list_menu.h" #include "main.h" #include "main_menu.h" +#include "malloc.h" #include "map_name_popup.h" #include "menu.h" #include "naming_screen.h" @@ -45,6 +46,57 @@ #include "constants/songs.h" #include "constants/species.h" + +// ******************************* +// Enums +enum { // Main + DEBUG_MENU_ITEM_UTILITIES, + DEBUG_MENU_ITEM_FLAGS, + DEBUG_MENU_ITEM_VARS, + DEBUG_MENU_ITEM_GIVE, + DEBUG_MENU_ITEM_CANCEL +}; +enum { // Util + DEBUG_UTIL_MENU_ITEM_HEAL_PARTY, + DEBUG_UTIL_MENU_ITEM_FLY, + DEBUG_UTIL_MENU_ITEM_WARP, + DEBUG_UTIL_MENU_ITEM_SAVEBLOCK, + DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK, + DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK, + DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY, + DEBUG_UTIL_MENU_ITEM_WATCHCREDITS, + DEBUG_UTIL_MENU_ITEM_TRAINER_NAME, + DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER, + DEBUG_UTIL_MENU_ITEM_TRAINER_ID, +}; +enum { // Flags + DEBUG_FLAG_MENU_ITEM_FLAGS, + DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS, + DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF, + DEBUG_FLAG_MENU_ITEM_NATDEXONOFF, + DEBUG_FLAG_MENU_ITEM_POKENAVONOFF, + DEBUG_FLAG_MENU_ITEM_FLYANYWHERE, + DEBUG_FLAG_MENU_ITEM_GETALLBADGES, + DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF, + DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF, + DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF, + DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF, + DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF, +}; +enum { // Vars + DEBUG_VARS_MENU_ITEM_VARS, +}; +enum { // Give + DEBUG_GIVE_MENU_ITEM_ITEM, + DEBUG_MENU_ITEM_GIVE_ALLTMS, + DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE, + DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX, + DEBUG_GIVE_MENU_ITEM_CHEAT, + //DEBUG_MENU_ITEM_ACCESS_PC, +}; + + +// ******************************* // Constants #define DEBUG_MAIN_MENU_WIDTH 13 #define DEBUG_MAIN_MENU_HEIGHT 8 @@ -61,6 +113,32 @@ #define DEBUG_NUMBER_ICON_X 210 #define DEBUG_NUMBER_ICON_Y 50 +// EWRAM +static EWRAM_DATA struct DebugMonData *sDebugMonData = NULL; + + +// ******************************* +struct DebugMonData +{ + u16 mon_speciesId; + u8 mon_level; + u8 isShiny; + u16 mon_natureId; + u16 mon_abilityNum; + u8 mon_iv_hp; + u8 mon_iv_atk; + u8 mon_iv_def; + u8 mon_iv_speed; + u8 mon_iv_satk; + u8 mon_iv_sdef; + u16 mon_move_0; + u16 mon_move_1; + u16 mon_move_2; + u16 mon_move_3; +}; + + +// ******************************* // Define functions static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate); void Debug_ShowMainMenu(void); @@ -139,53 +217,6 @@ extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; #define ABILITY_NAME_LENGTH 12 extern const u8 gAbilityNames[][ABILITY_NAME_LENGTH + 1]; -// ******************************* -// Enums -enum { // Main - DEBUG_MENU_ITEM_UTILITIES, - DEBUG_MENU_ITEM_FLAGS, - DEBUG_MENU_ITEM_VARS, - DEBUG_MENU_ITEM_GIVE, - DEBUG_MENU_ITEM_CANCEL -}; -enum { // Util - DEBUG_UTIL_MENU_ITEM_HEAL_PARTY, - DEBUG_UTIL_MENU_ITEM_FLY, - DEBUG_UTIL_MENU_ITEM_WARP, - DEBUG_UTIL_MENU_ITEM_SAVEBLOCK, - DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK, - DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK, - DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY, - DEBUG_UTIL_MENU_ITEM_WATCHCREDITS, - DEBUG_UTIL_MENU_ITEM_TRAINER_NAME, - DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER, - DEBUG_UTIL_MENU_ITEM_TRAINER_ID, -}; -enum { // Flags - DEBUG_FLAG_MENU_ITEM_FLAGS, - DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS, - DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF, - DEBUG_FLAG_MENU_ITEM_NATDEXONOFF, - DEBUG_FLAG_MENU_ITEM_POKENAVONOFF, - DEBUG_FLAG_MENU_ITEM_FLYANYWHERE, - DEBUG_FLAG_MENU_ITEM_GETALLBADGES, - DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF, - DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF, - DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF, - DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF, - DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF, -}; -enum { // Vars - DEBUG_VARS_MENU_ITEM_VARS, -}; -enum { // Give - DEBUG_GIVE_MENU_ITEM_ITEM, - DEBUG_MENU_ITEM_GIVE_ALLTMS, - DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE, - DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX, - DEBUG_GIVE_MENU_ITEM_CHEAT, - //DEBUG_MENU_ITEM_ACCESS_PC, -}; // ******************************* //Maps per map group COPY FROM /include/constants/map_groups.h @@ -249,6 +280,12 @@ static const u8 gDebugText_PokemonShiny[] = _("Shiny: static const u8 gDebugText_PokemonNature[] = _("NatureId: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); static const u8 gDebugText_PokemonAbility[] = _("AbilityNum: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); static const u8 gDebugText_PokemonIVs[] = _("All IVs: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_0[] = _("IV HP: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_1[] = _("IV Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_2[] = _("IV Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_3[] = _("IV Speed: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_4[] = _("IV Sp. Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_5[] = _("IV Sp. Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); static const u8 gDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); static const u8 gDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); static const u8 gDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); @@ -1505,10 +1542,29 @@ static void DebugAction_Give_AllTMs(u8 taskId) } //Pokemon +static void ResetMonDataStruct(struct DebugMonData *sDebugMonData) +{ + sDebugMonData->mon_speciesId = 1; + sDebugMonData->mon_level = 1; + sDebugMonData->isShiny = 0; + sDebugMonData->mon_natureId = 0; + sDebugMonData->mon_abilityNum = 0; + sDebugMonData->mon_iv_hp = 0; + sDebugMonData->mon_iv_atk = 0; + sDebugMonData->mon_iv_def = 0; + sDebugMonData->mon_iv_speed = 0; + sDebugMonData->mon_iv_satk = 0; + sDebugMonData->mon_iv_sdef = 0; +} static void DebugAction_Give_PokemonSimple(u8 taskId) { u8 windowId; + //Mon data struct + sDebugMonData = AllocZeroed(sizeof(struct DebugMonData)); + ResetMonDataStruct(sDebugMonData); + + //Window initialization ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); RemoveWindow(gTasks[taskId].data[1]); @@ -1522,27 +1578,31 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) //Display initial ID StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 3); - StringCopy(gStringVar1, gSpeciesNames[1]); //CopyItemName(1, gStringVar1); + StringCopy(gStringVar1, gSpeciesNames[1]); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); - + //Set task data gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId; gTasks[taskId].data[2] = windowId; gTasks[taskId].data[3] = 1; //Current ID gTasks[taskId].data[4] = 0; //Digit Selected - gTasks[taskId].data[5] = 1; //Species ID - FreeMonIconPalettes(); //Free space for new pallete + gTasks[taskId].data[5] = 0; //Complex? + FreeMonIconPalettes(); //Free space for new pallete LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID - gTasks[taskId].data[7] = 1; //Level } static void DebugAction_Give_PokemonComplex(u8 taskId) { u8 windowId; + //Mon data struct + sDebugMonData = AllocZeroed(sizeof(struct DebugMonData)); + ResetMonDataStruct(sDebugMonData); + + //Window initialization ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); RemoveWindow(gTasks[taskId].data[1]); @@ -1555,8 +1615,8 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) //Display initial ID StringCopy(gStringVar2, gText_DigitIndicator[0]); - ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 3); - StringCopy(gStringVar1, gSpeciesNames[1]); //CopyItemName(1, gStringVar1); + ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 4); + StringCopy(gStringVar1, gSpeciesNames[1]); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); @@ -1566,17 +1626,12 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) gTasks[taskId].data[2] = windowId; gTasks[taskId].data[3] = 1; //Current ID gTasks[taskId].data[4] = 0; //Digit Selected - gTasks[taskId].data[5] = 1; //Species ID - FreeMonIconPalettes(); //Free space for new palletes + gTasks[taskId].data[5] = 1; //Complex? + FreeMonIconPalettes(); //Free space for new palletes LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID - gTasks[taskId].data[7] = 0; //Level - gTasks[taskId].data[8] = 0; //Shiny: no 0, yes 1 - gTasks[taskId].data[9] = 0; //Nature ID - gTasks[taskId].data[10] = 0; //Ability - gTasks[taskId].data[11] = 0; //IVs - gTasks[taskId].data[12] = 0; //Move 0 + gTasks[taskId].data[7] = 0; //iterator } static void DebugAction_Give_Pokemon_SelectId(u8 taskId) @@ -1615,7 +1670,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); StringCopy(gStringVar1, gSpeciesNames[gTasks[taskId].data[3]]); //CopyItemName(gTasks[taskId].data[3], gStringVar1); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 4); StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -1628,7 +1683,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) if (gMain.newKeys & A_BUTTON) { - gTasks[taskId].data[5] = gTasks[taskId].data[3]; //Species ID + sDebugMonData->mon_speciesId = gTasks[taskId].data[3]; //Species ID gTasks[taskId].data[3] = 1; gTasks[taskId].data[4] = 0; @@ -1643,6 +1698,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); + Free(sDebugMonData); //Frees EWRAM of MonData Struct FreeMonIconPalettes(); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite DebugAction_DestroyExtraWindow(taskId); @@ -1688,13 +1744,16 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) { FreeMonIconPalettes(); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite - if (gTasks[taskId].data[7] == 1) + if (gTasks[taskId].data[5] == 0) { PlaySE(MUS_LEVEL_UP); - ScriptGiveMon(gTasks[taskId].data[5], gTasks[taskId].data[3], ITEM_NONE, 0,0,0); + ScriptGiveMon(sDebugMonData->mon_speciesId, gTasks[taskId].data[3], ITEM_NONE, 0,0,0); + Free(sDebugMonData); //Frees EWRAM of MonData Struct DebugAction_DestroyExtraWindow(taskId); - }else{ - gTasks[taskId].data[7] = gTasks[taskId].data[3]; //Level + } + else + { + sDebugMonData->mon_level = gTasks[taskId].data[3]; //Level gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; @@ -1710,6 +1769,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); + Free(sDebugMonData); //Frees EWRAM of MonData Struct FreeMonIconPalettes(); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite DebugAction_DestroyExtraWindow(taskId); @@ -1747,11 +1807,10 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) if (gMain.newKeys & A_BUTTON) { - gTasks[taskId].data[8] = gTasks[taskId].data[3]; //isShiny + sDebugMonData->isShiny = gTasks[taskId].data[3]; //isShiny gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; - //("ID: {STR_VAR_3}\nNature: {STR_VAR_1}\n\n{STR_VAR_2}"); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); @@ -1764,6 +1823,7 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); + Free(sDebugMonData); //Frees EWRAM of MonData Struct DebugAction_DestroyExtraWindow(taskId); } } @@ -1797,15 +1857,14 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) if (gMain.newKeys & A_BUTTON) { u8 abilityId; - gTasks[taskId].data[9] = gTasks[taskId].data[3]; //NatureId + sDebugMonData->mon_natureId = gTasks[taskId].data[3]; //NatureId gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - abilityId = GetAbilityBySpecies(gTasks[taskId].data[5], 0); + abilityId = GetAbilityBySpecies(sDebugMonData->mon_speciesId, 0); StringCopy(gStringVar1, gAbilityNames[abilityId]); StringExpandPlaceholders(gStringVar4, gDebugText_PokemonAbility); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -1815,6 +1874,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); + Free(sDebugMonData); //Frees EWRAM of MonData Struct DebugAction_DestroyExtraWindow(taskId); } } @@ -1822,10 +1882,10 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) { u8 abilityId; u8 abilityCount = 0; - if (gBaseStats[gTasks[taskId].data[5]].abilities[1] != ABILITY_NONE) + if (gBaseStats[sDebugMonData->mon_speciesId].abilities[1] != ABILITY_NONE) abilityCount++; #ifdef POKEMON_EXPANSION - if (gBaseStats[gTasks[taskId].data[5]].abilityHidden != ABILITY_NONE) + if (gBaseStats[sDebugMonData->mon_speciesId].abilityHidden != ABILITY_NONE) abilityCount++; #endif if (gMain.newKeys & DPAD_ANY) @@ -1845,7 +1905,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) gTasks[taskId].data[3] = 0; } - abilityId = GetAbilityBySpecies(gTasks[taskId].data[5], gTasks[taskId].data[3]); + abilityId = GetAbilityBySpecies(sDebugMonData->mon_speciesId, gTasks[taskId].data[3]); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); @@ -1856,14 +1916,14 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) if (gMain.newKeys & A_BUTTON) { - gTasks[taskId].data[10] = gTasks[taskId].data[3]; //AbilityNum + sDebugMonData->mon_abilityNum = gTasks[taskId].data[3]; //AbilityNum gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIVs); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_0); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; @@ -1871,6 +1931,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); + Free(sDebugMonData); //Frees EWRAM of MonData Struct DebugAction_DestroyExtraWindow(taskId); } } @@ -1906,40 +1967,115 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIVs); + switch (gTasks[taskId].data[7]) + { + case 0: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_0); + break; + case 1: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_1); + break; + case 2: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_2); + break; + case 3: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_3); + break; + case 4: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_4); + break; + case 5: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_5); + break; + } AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } + //If A or B button if (gMain.newKeys & A_BUTTON) { - gTasks[taskId].data[11] = gTasks[taskId].data[3]; //IVs - gTasks[taskId].data[3] = 0; - gTasks[taskId].data[4] = 0; + switch (gTasks[taskId].data[7]) + { + case 0: + sDebugMonData->mon_iv_hp = gTasks[taskId].data[3]; + break; + case 1: + sDebugMonData->mon_iv_atk = gTasks[taskId].data[3]; + break; + case 2: + sDebugMonData->mon_iv_def = gTasks[taskId].data[3]; + break; + case 3: + sDebugMonData->mon_iv_speed = gTasks[taskId].data[3]; + break; + case 4: + sDebugMonData->mon_iv_satk = gTasks[taskId].data[3]; + break; + case 5: + sDebugMonData->mon_iv_sdef = gTasks[taskId].data[3]; + break; + } - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]); - StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_0); - AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + //Check if all IVs set + if (gTasks[taskId].data[7] != 5) + { + gTasks[taskId].data[7] += 1; + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 0; - gTasks[taskId].func = DebugAction_Give_Pokemon_Move; + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + switch (gTasks[taskId].data[7]) + { + case 0: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_0); + break; + case 1: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_1); + break; + case 2: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_2); + break; + case 3: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_3); + break; + case 4: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_4); + break; + case 5: + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_5); + break; + } + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; + } + else + { + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 0; + gTasks[taskId].data[7] = 0; //Reset iterator + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); + StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_0); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Give_Pokemon_Move; + } } else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); + Free(sDebugMonData); //Frees EWRAM of MonData Struct DebugAction_DestroyExtraWindow(taskId); } } static void DebugAction_Give_Pokemon_Move(u8 taskId) { - u8 j; - for(j=12; j<15; j++) - { - if (gTasks[taskId].data[j] == 0) - break; - } - if (gMain.newKeys & DPAD_ANY) { PlaySE(SE_SELECT); @@ -1971,18 +2107,18 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); - switch (j) + switch (gTasks[taskId].data[7]) { - case 12: + case 0: StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_0); break; - case 13: + case 1: StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_1); break; - case 14: + case 2: StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_2); break; - case 15: + case 3: StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_3); break; } @@ -1991,16 +2127,31 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) if (gMain.newKeys & A_BUTTON) { - + //If MOVE_NONE selected, stop asking for additional moves if (gTasks[taskId].data[3] == 0) - j = 15; - else - gTasks[taskId].data[j] = gTasks[taskId].data[3]; //Move ID + gTasks[taskId].data[7] = 4; - - // If last move or selected MOVE_NONE make mon, else ask for next move - if (j < 15) + //Set current value + switch (gTasks[taskId].data[7]) { + case 0: + sDebugMonData->mon_move_0 = gTasks[taskId].data[3]; + break; + case 1: + sDebugMonData->mon_move_1 = gTasks[taskId].data[3]; + break; + case 2: + sDebugMonData->mon_move_2 = gTasks[taskId].data[3]; + break; + case 3: + sDebugMonData->mon_move_3 = gTasks[taskId].data[3]; + break; + } + + //If NOT last move or selected MOVE_NONE ask for next move, else make mon + if (gTasks[taskId].data[7] < 3) + { + gTasks[taskId].data[7] += 1; gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; @@ -2008,18 +2159,18 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); - switch (j+1) + switch (gTasks[taskId].data[7]) { - case 12: + case 0: StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_0); break; - case 13: + case 1: StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_1); break; - case 14: + case 2: StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_2); break; - case 15: + case 3: StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_3); break; } @@ -2035,12 +2186,11 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) PlaySE(MUS_LEVEL_UP); gTasks[taskId].func = DebugAction_Give_Pokemon_ComplexCreateMon; } - - } else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); + Free(sDebugMonData); //Frees EWRAM of MonData Struct DebugAction_DestroyExtraWindow(taskId); } } @@ -2051,16 +2201,24 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu struct Pokemon mon; u8 i; u16 moves[4]; - u16 species = gTasks[taskId].data[5]; //species ID - u8 level = gTasks[taskId].data[7]; //Level - u8 isShiny = gTasks[taskId].data[8]; //Shiny: no 0, yes 1 - u8 nature = gTasks[taskId].data[9]; //Nature ID - u8 abilityNum = gTasks[taskId].data[10]; //Ability ID - u8 iv_val = gTasks[taskId].data[11]; //IVs - moves[0] = gTasks[taskId].data[12]; //Move 0 - moves[1] = gTasks[taskId].data[13]; //Move 1 - moves[2] = gTasks[taskId].data[14]; //Move 2 - moves[3] = gTasks[taskId].data[15]; //Move 3 + u8 IVs[6]; + u8 iv_val; + u16 species = sDebugMonData->mon_speciesId; + u8 level = sDebugMonData->mon_level; + u8 isShiny = sDebugMonData->isShiny; //Shiny: no 0, yes 1 + u8 nature = sDebugMonData->mon_natureId; + u8 abilityNum = sDebugMonData->mon_abilityNum; + moves[0] = sDebugMonData->mon_move_0; + moves[1] = sDebugMonData->mon_move_1; + moves[2] = sDebugMonData->mon_move_2; + moves[3] = sDebugMonData->mon_move_3; + IVs[0] = sDebugMonData->mon_iv_hp; + IVs[1] = sDebugMonData->mon_iv_atk; + IVs[2] = sDebugMonData->mon_iv_def; + IVs[3] = sDebugMonData->mon_iv_speed; + IVs[4] = sDebugMonData->mon_iv_satk; + IVs[5] = sDebugMonData->mon_iv_sdef; + //Nature if (nature == NUM_NATURES || nature == 0xFF) @@ -2068,21 +2226,21 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu //Shinyness if (isShiny == 1) + { + u32 personality; + u32 otid = gSaveBlock2Ptr->playerTrainerId[0] + | (gSaveBlock2Ptr->playerTrainerId[1] << 8) + | (gSaveBlock2Ptr->playerTrainerId[2] << 16) + | (gSaveBlock2Ptr->playerTrainerId[3] << 24); + + do { - u32 personality; - u32 otid = gSaveBlock2Ptr->playerTrainerId[0] - | (gSaveBlock2Ptr->playerTrainerId[1] << 8) - | (gSaveBlock2Ptr->playerTrainerId[2] << 16) - | (gSaveBlock2Ptr->playerTrainerId[3] << 24); + personality = Random32(); + personality = ((((Random() % 8) ^ (HIHALF(otid) ^ LOHALF(otid))) ^ LOHALF(personality)) << 16) | LOHALF(personality); + } while (nature != GetNatureFromPersonality(personality)); - do - { - personality = Random32(); - personality = ((((Random() % 8) ^ (HIHALF(otid) ^ LOHALF(otid))) ^ LOHALF(personality)) << 16) | LOHALF(personality); - } while (nature != GetNatureFromPersonality(personality)); - - CreateMon(&mon, species, level, 32, 1, personality, OT_ID_PRESET, otid); - } + CreateMon(&mon, species, level, 32, 1, personality, OT_ID_PRESET, otid); + } else CreateMonWithNature(&mon, species, level, 32, nature); @@ -2101,6 +2259,7 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu // } // iv + iv_val = IVs[i]; if (iv_val != 32 && iv_val != 0xFF) SetMonData(&mon, MON_DATA_HP_IV + i, &iv_val); } @@ -2157,15 +2316,16 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu nationalDexNum = SpeciesToNationalPokedexNum(species); switch(sentToPc) { - case MON_GIVEN_TO_PARTY: - case MON_GIVEN_TO_PC: - GetSetPokedexFlag(nationalDexNum, FLAG_SET_SEEN); - GetSetPokedexFlag(nationalDexNum, FLAG_SET_CAUGHT); - break; - case MON_CANT_GIVE: - break; + case MON_GIVEN_TO_PARTY: + case MON_GIVEN_TO_PC: + GetSetPokedexFlag(nationalDexNum, FLAG_SET_SEEN); + GetSetPokedexFlag(nationalDexNum, FLAG_SET_CAUGHT); + break; + case MON_CANT_GIVE: + break; } + Free(sDebugMonData); //Frees EWRAM of MonData Struct DebugAction_DestroyExtraWindow(taskId); //return sentToPc; } diff --git a/sym_ewram.txt b/sym_ewram.txt index 88c4461cb0..fb9765b20d 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -148,3 +148,4 @@ .include "src/faraway_island.o" .include "src/trainer_hill.o" .include "src/rayquaza_scene.o" + .include "src/debug.o" From 5bb92efa5b0d80341c9c6d56867b88864f1bd191 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Sat, 28 Nov 2020 00:51:38 +0100 Subject: [PATCH 008/155] now closes debug windows after giving all TMs --- src/debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/debug.c b/src/debug.c index f83acb7735..c4d5b1ecf9 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1539,6 +1539,8 @@ static void DebugAction_Give_AllTMs(u8 taskId) for (i = ITEM_TM01; i <= ITEM_TM50; i++) if(!CheckBagHasItem(i, 1)) AddBagItem(i, 1); + Debug_DestroyMenu(taskId); + EnableBothScriptContexts(); } //Pokemon From edc476f863fedf9ec43d9005a08edf3e0e61e3c2 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Mon, 30 Nov 2020 11:29:13 +0100 Subject: [PATCH 009/155] fixed heal party bug, thanks to jaizu for poitning it out --- src/debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index c4d5b1ecf9..e0db6988ef 100644 --- a/src/debug.c +++ b/src/debug.c @@ -683,6 +683,7 @@ static void DebugAction_Util_HealParty(u8 taskId) { PlaySE(SE_USE_ITEM); HealPlayerParty(); + EnableBothScriptContexts(); Debug_DestroyMenu(taskId); } static void DebugAction_Util_Fly(u8 taskId) @@ -944,8 +945,8 @@ static void DebugAction_Util_Trainer_Gender(u8 taskId) gSaveBlock2Ptr->playerGender = 1; else gSaveBlock2Ptr->playerGender = 0; - Debug_DestroyMenu(taskId); EnableBothScriptContexts(); + Debug_DestroyMenu(taskId); } static void DebugAction_Util_Trainer_Id(u8 taskId) { From c15138fdbbf7dca956ad0a0b6ef3be1fd17ca515 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Fri, 29 Jan 2021 11:39:09 +0100 Subject: [PATCH 010/155] Fixed problems with changed Deoxys handling in RHH's pokeexpansion, thanks to "Subzero Eclipse" for pointing it out --- src/debug.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/debug.c b/src/debug.c index e0db6988ef..f1672632d4 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1594,7 +1594,12 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) gTasks[taskId].data[5] = 0; //Complex? FreeMonIconPalettes(); //Free space for new pallete LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon - gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite + #ifndef POKEMON_EXPANSION + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite + #endif + #ifdef POKEMON_EXPANSION + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite + #endif gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID } static void DebugAction_Give_PokemonComplex(u8 taskId) @@ -1632,7 +1637,12 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) gTasks[taskId].data[5] = 1; //Complex? FreeMonIconPalettes(); //Free space for new palletes LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon - gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite + #ifndef POKEMON_EXPANSION + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite + #endif + #ifdef POKEMON_EXPANSION + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite + #endif gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID gTasks[taskId].data[7] = 0; //iterator } @@ -1680,7 +1690,12 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); FreeMonIconPalettes(); //Free space for new pallete LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon - gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create new pokemon sprite + #ifndef POKEMON_EXPANSION + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite + #endif + #ifdef POKEMON_EXPANSION + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite + #endif gSprites[gTasks[taskId].data[6]].oam.priority = 0; } From 27a99323da2b5e0767f1c2b1a7777cb6d4d60dd4 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Thu, 4 Feb 2021 16:33:01 +0100 Subject: [PATCH 011/155] WIP reset makefile to new default --- Makefile | 54 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index cee566d78d..98da1e17a1 100644 --- a/Makefile +++ b/Makefile @@ -63,13 +63,13 @@ ASFLAGS := -mcpu=arm7tdmi --defsym MODERN=$(MODERN) ifeq ($(MODERN),0) CC1 := tools/agbcc/bin/agbcc$(EXE) -override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm +override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm -g ROM := pokeemerald.gba OBJ_DIR := build/emerald LIBPATH := -L ../../tools/agbcc/lib else CC1 = $(shell $(CC) --print-prog-name=cc1) -quiet -override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mcpu=arm7tdmi -fno-toplevel-reorder -Wno-pointer-to-int-cast +override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -g ROM := pokeemerald_modern.gba OBJ_DIR := build/modern LIBPATH := -L "$(dir $(shell $(CC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(CC) -mthumb -print-file-name=libc.a))" @@ -111,7 +111,7 @@ MAKEFLAGS += --no-print-directory # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) berry_fix libagbsyscall modern debug modern_debug +.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) berry_fix libagbsyscall modern infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) @@ -136,6 +136,9 @@ C_ASM_OBJS := $(patsubst $(C_SUBDIR)/%.s,$(C_BUILDDIR)/%.o,$(C_ASM_SRCS)) ASM_SRCS := $(wildcard $(ASM_SUBDIR)/*.s) ASM_OBJS := $(patsubst $(ASM_SUBDIR)/%.s,$(ASM_BUILDDIR)/%.o,$(ASM_SRCS)) +# get all the data/*.s files EXCEPT the ones with specific rules +REGULAR_DATA_ASM_SRCS := $(filter-out $(DATA_ASM_SUBDIR)/maps.s $(DATA_ASM_SUBDIR)/map_events.s, $(wildcard $(DATA_ASM_SUBDIR)/*.s)) + DATA_ASM_SRCS := $(wildcard $(DATA_ASM_SUBDIR)/*.s) DATA_ASM_OBJS := $(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o,$(DATA_ASM_SRCS)) @@ -178,7 +181,7 @@ mostlyclean: tidy rm -f $(SAMPLE_SUBDIR)/*.bin rm -f $(CRY_SUBDIR)/*.bin rm -f $(MID_SUBDIR)/*.s - find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + + find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + rm -f $(DATA_ASM_SUBDIR)/layouts/layouts.inc $(DATA_ASM_SUBDIR)/layouts/layouts_table.inc rm -f $(DATA_ASM_SUBDIR)/maps/connections.inc $(DATA_ASM_SUBDIR)/maps/events.inc $(DATA_ASM_SUBDIR)/maps/groups.inc $(DATA_ASM_SUBDIR)/maps/headers.inc find $(DATA_ASM_SUBDIR)/maps \( -iname 'connections.inc' -o -iname 'events.inc' -o -iname 'header.inc' \) -exec rm {} + @@ -248,12 +251,6 @@ ifeq ($(DINFO),1) override CFLAGS += -g endif -# DebugMenu -ifeq ($(DDEBUG),1) -override ASFLAGS += --defsym DEBUG=1 -override CPPFLAGS += -D DEBUG=1 -endif - $(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep) @$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i @$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s @@ -281,23 +278,32 @@ endif $(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.s $$(c_asm_dep) $(AS) $(ASFLAGS) -o $@ $< -ifeq ($(NODEP),1) -$(ASM_BUILDDIR)/%.o: asm_dep := -else -$(ASM_BUILDDIR)/%.o: asm_dep = $(shell $(SCANINC) -I "" $(ASM_SUBDIR)/$*.s) -endif +# The dep rules have to be explicit or else missing files won't be reported. +# As a side effect, they're evaluated immediately instead of when the rule is invoked. +# It doesn't look like $(shell) can be deferred so there might not be a better way. -$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s $$(asm_dep) + +ifeq ($(NODEP),1) +$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s $(AS) $(ASFLAGS) -o $@ $< - -ifeq ($(NODEP),1) -$(DATA_ASM_BUILDDIR)/%.o: data_dep := else -$(DATA_ASM_BUILDDIR)/%.o: data_dep = $(shell $(SCANINC) -I include -I "" $(DATA_ASM_SUBDIR)/$*.s) +define ASM_DEP +$1: $2 $$(shell $(SCANINC) -I include -I "" $2) + $$(AS) $$(ASFLAGS) -o $$@ $$< +endef +$(foreach src, $(ASM_SRCS), $(eval $(call ASM_DEP,$(patsubst $(ASM_SUBDIR)/%.s,$(ASM_BUILDDIR)/%.o, $(src)),$(src)))) endif -$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep) +ifeq ($(NODEP),1) +$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $(PREPROC) $< charmap.txt | $(CPP) -I include | $(AS) $(ASFLAGS) -o $@ +else +define DATA_ASM_DEP +$1: $2 $$(shell $(SCANINC) -I include -I "" $2) + $$(PREPROC) $$< charmap.txt | $$(CPP) -I include | $$(AS) $$(ASFLAGS) -o $$@ +endef +$(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call DATA_ASM_DEP,$(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o, $(src)),$(src)))) +endif $(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s $(AS) $(ASFLAGS) -I sound -o $@ $< @@ -338,8 +344,4 @@ berry_fix: @$(MAKE) -C berry_fix COMPARE=$(COMPARE) TOOLCHAIN=$(TOOLCHAIN) libagbsyscall: - @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) - -debug: ; @$(MAKE) DDEBUG=1 DINFO=1 - -modern_debug: ; @$(MAKE) MODERN=1 DDEBUG=1 DINFO=1 + @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) \ No newline at end of file From 965bcfa29d2ea0fea3e181253eb241fa70744f3b Mon Sep 17 00:00:00 2001 From: TheXaman Date: Thu, 4 Feb 2021 18:04:00 +0100 Subject: [PATCH 012/155] Added newest Makefile and fixed making from clean --- Makefile | 16 +++++++++++++--- include/debug.h | 2 +- src/debug.c | 2 +- src/event_object_movement.c | 2 +- src/field_control_avatar.c | 2 +- src/trainer_see.c | 2 +- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 98da1e17a1..7ea5bdb926 100644 --- a/Makefile +++ b/Makefile @@ -111,13 +111,13 @@ MAKEFLAGS += --no-print-directory # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) berry_fix libagbsyscall modern +.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) berry_fix libagbsyscall modern debugging debugging_modern infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) # Build tools when building the rom # Disable dependency scanning for clean/tidy/tools -ifeq (,$(filter-out all rom compare modern berry_fix libagbsyscall,$(MAKECMDGOALS))) +ifeq (,$(filter-out all rom compare modern debugging debugging_modern berry_fix libagbsyscall,$(MAKECMDGOALS))) $(call infoshell, $(MAKE) tools) else NODEP := 1 @@ -251,6 +251,12 @@ ifeq ($(DINFO),1) override CFLAGS += -g endif +# Debug menu +ifeq ($(DDEBUGGING),1) +override ASFLAGS += --defsym DEBUGGING=1 +override CPPFLAGS += -D DEBUGGING=1 +endif + $(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep) @$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i @$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s @@ -344,4 +350,8 @@ berry_fix: @$(MAKE) -C berry_fix COMPARE=$(COMPARE) TOOLCHAIN=$(TOOLCHAIN) libagbsyscall: - @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) \ No newline at end of file + @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) + +# Debug menu +debugging: ; @$(MAKE) DDEBUGGING=1 DINFO=1 +debugging_modern: ; @$(MAKE) MODERN=1 DDEBUGGING=1 DINFO=1 diff --git a/include/debug.h b/include/debug.h index 0d78632e63..4c9c3fffcb 100644 --- a/include/debug.h +++ b/include/debug.h @@ -1,7 +1,7 @@ #ifndef GUARD_DEBUG_H #define GUARD_DEBUG_H -#if DEBUG +#if DEBUGGING void Debug_ShowMainMenu(void); #endif diff --git a/src/debug.c b/src/debug.c index f1672632d4..ec5a4f81ac 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1,4 +1,4 @@ -#if DEBUG +#if DEBUGGING //CREDITS //TheXaman: https://github.com/TheXaman/pokeemerald/tree/tx_debug_system //CODE USED FROM: diff --git a/src/event_object_movement.c b/src/event_object_movement.c index ba90eca7e0..de17be1254 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4724,7 +4724,7 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) { u8 direction = dir; -#if DEBUG //DEBUG +#if DEBUGGING //DEBUG if (FlagGet(FLAG_SYS_NO_COLLISION)) return COLLISION_NONE; #endif // diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index c586656fb1..fa607cd42e 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -219,7 +219,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE) return TRUE; -#if DEBUG +#if DEBUGGING if (input->input_field_1_2) { PlaySE(SE_WIN_OPEN); diff --git a/src/trainer_see.c b/src/trainer_see.c index d5b25b0c59..83783469c1 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -177,7 +177,7 @@ bool8 CheckForTrainersWantingBattle(void) { u8 i; -#if DEBUG //DEBUG +#if DEBUGGING //DEBUG if (FlagGet(FLAG_SYS_NO_TRAINER_SEE)) return FALSE; #endif // From 40ebd6608497dfcfc5b57e226a94afac661b20bf Mon Sep 17 00:00:00 2001 From: TheXaman Date: Thu, 25 Mar 2021 10:21:27 +0100 Subject: [PATCH 013/155] Fixed setting vars not working, thanks to AmbientDinosaur and BSBob for reaching out --- src/debug.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/debug.c b/src/debug.c index ec5a4f81ac..df05735744 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1310,9 +1310,12 @@ static void DebugAction_Vars_SetValue(u8 taskId) { if(gMain.newKeys & DPAD_UP) { - gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[6] >= 100){ - gTasks[taskId].data[6] = 99; + if (gTasks[taskId].data[6] + sPowersOfTen[gTasks[taskId].data[4]] <= 32000) + gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]]; + else + gTasks[taskId].data[6] = 32000-1; + if(gTasks[taskId].data[6] >= 32000){ + gTasks[taskId].data[6] = 32000-1; } } if(gMain.newKeys & DPAD_DOWN) @@ -1333,16 +1336,16 @@ static void DebugAction_Vars_SetValue(u8 taskId) if(gMain.newKeys & DPAD_RIGHT) { gTasks[taskId].data[4] += 1; - if(gTasks[taskId].data[4] > 2) + if(gTasks[taskId].data[4] > 4) { - gTasks[taskId].data[4] = 2; + gTasks[taskId].data[4] = 4; } } if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - VarSet(gTasks[taskId].data[3], gTasks[taskId].data[5]); + VarSet(gTasks[taskId].data[3], gTasks[taskId].data[6]); } else if (gMain.newKeys & B_BUTTON) { From c8c81e41560d88ff80f15fe6712c13798ae6bfb4 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Fri, 7 May 2021 10:31:59 +0200 Subject: [PATCH 014/155] Fixed "new trainer id" option, thanks to Lunos and Deokishisu --- src/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index df05735744..29a0d06d68 100644 --- a/src/debug.c +++ b/src/debug.c @@ -950,7 +950,7 @@ static void DebugAction_Util_Trainer_Gender(u8 taskId) } static void DebugAction_Util_Trainer_Id(u8 taskId) { - u32 trainerId = (Random() << 0x10) | GetGeneratedTrainerIdLower(); + u32 trainerId = ((Random() << 16) | Random()); SetTrainerId(trainerId, gSaveBlock2Ptr->playerTrainerId); Debug_DestroyMenu(taskId); EnableBothScriptContexts(); From 19cf846ba9e29f1b9a8ec9159ff732321155a763 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Fri, 7 May 2021 11:44:03 +0200 Subject: [PATCH 015/155] Added: Toggle running shoes, Poison all mons, Max money, Max coins, Trigger daycare egg, Fill PC CREDITS: @Sierraffinity --- src/debug.c | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index 29a0d06d68..173711a113 100644 --- a/src/debug.c +++ b/src/debug.c @@ -7,8 +7,11 @@ //AsparagusEduardo: https://github.com/AsparagusEduardo/pokeemerald/tree/InfusedEmerald_v2 //Ghoulslash: https://github.com/ghoulslash/pokeemerald #include "global.h" +#include "battle.h" +#include "coins.h" #include "credits.h" #include "data.h" +#include "daycare.h" #include "event_data.h" #include "event_object_movement.h" #include "event_scripts.h" @@ -23,6 +26,7 @@ #include "malloc.h" #include "map_name_popup.h" #include "menu.h" +#include "money.h" #include "naming_screen.h" #include "new_game.h" #include "overworld.h" @@ -60,6 +64,8 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_HEAL_PARTY, DEBUG_UTIL_MENU_ITEM_FLY, DEBUG_UTIL_MENU_ITEM_WARP, + DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES, + DEBUG_UTIL_MENU_ITEM_POISON_MONS, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK, @@ -91,6 +97,10 @@ enum { // Give DEBUG_MENU_ITEM_GIVE_ALLTMS, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX, + DEBUG_GIVE_MENU_ITEM_MAX_MONEY, + DEBUG_GIVE_MENU_ITEM_MAX_COINS, + DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG, + DEBUG_GIVE_MENU_ITEM_FILL_PC, DEBUG_GIVE_MENU_ITEM_CHEAT, //DEBUG_MENU_ITEM_ACCESS_PC, }; @@ -162,6 +172,8 @@ static void DebugAction_Util_Warp_Warp(u8 taskId); static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId); static void DebugAction_Util_Warp_SelectMap(u8 taskId); static void DebugAction_Util_Warp_SelectWarp(u8 taskId); +static void DebugAction_Util_RunningShoes(u8 taskId); +static void DebugAction_Util_PoisonMons(u8 taskId); static void DebugAction_Util_CheckSaveBlock(u8); static void DebugAction_Util_CheckWallClock(u8); static void DebugAction_Util_SetWallClock(u8); @@ -204,6 +216,10 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId); static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId); static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId); static void DebugAction_Give_Pokemon_Move(u8 taskId); +static void DebugAction_Give_MaxMoney(u8 taskId); +static void DebugAction_Give_MaxCoins(u8 taskId); +static void DebugAction_Give_DayCareEgg(u8 taskId); +static void DebugAction_Give_FillPC(u8 taskId); static void DebugAction_Give_CHEAT(u8 taskId); static void DebugAction_AccessPC(u8 taskId); @@ -237,6 +253,8 @@ static const u8 gDebugText_Util_WarpToMap_SelectMapGroup[] =_("Group: {STR_VAR_1 static const u8 gDebugText_Util_WarpToMap_SelectMap[] = _("Map: {STR_VAR_1} \nMapSec: \n{STR_VAR_2} \n{STR_VAR_3} "); static const u8 gDebugText_Util_WarpToMap_SelectWarp[] = _("Warp: \n{STR_VAR_1} \n \n{STR_VAR_3} "); static const u8 gDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}"); +static const u8 gDebugText_Util_RunningShoes[] = _("Toggle Running Shoes"); +static const u8 gDebugText_Util_PoisonMons[] = _("Poison all mons"); static const u8 gDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); static const u8 gDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); static const u8 gDebugText_Util_SetWallClock[] = _("Set Wall Clock"); @@ -290,7 +308,11 @@ static const u8 gDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3} static const u8 gDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); static const u8 gDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); static const u8 gDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT start"); +static const u8 gDebugText_Give_MaxMoney[] = _("Max Money"); +static const u8 gDebugText_Give_MaxCoins[] = _("Max Coins"); +static const u8 gDebugText_Give_DaycareEgg[] = _("Daycare Egg"); +static const u8 gDebugText_Give_FillPc[] = _("Fill Pc"); +static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); // static const u8 gDebugText_Give_AccessPC[] = _("Access PC"); static const u8 digitInidicator_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); @@ -341,6 +363,8 @@ static const struct ListMenuItem sDebugMenu_Items_Utilities[] = [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {gDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, [DEBUG_UTIL_MENU_ITEM_FLY] = {gDebugText_Util_Fly, DEBUG_UTIL_MENU_ITEM_FLY}, [DEBUG_UTIL_MENU_ITEM_WARP] = {gDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, + [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = {gDebugText_Util_RunningShoes, DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES}, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {gDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {gDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {gDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {gDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, @@ -375,6 +399,10 @@ static const struct ListMenuItem sDebugMenu_Items_Give[] = [DEBUG_MENU_ITEM_GIVE_ALLTMS] = {gDebugText_Give_AllTMs, DEBUG_MENU_ITEM_GIVE_ALLTMS}, [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {gDebugText_Give_GivePokemonSimple, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE}, [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {gDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, + [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = {gDebugText_Give_MaxMoney, DEBUG_GIVE_MENU_ITEM_MAX_MONEY}, + [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = {gDebugText_Give_MaxCoins, DEBUG_GIVE_MENU_ITEM_MAX_COINS}, + [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {gDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, + [DEBUG_GIVE_MENU_ITEM_FILL_PC] = {gDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC}, [DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, //[DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, }; @@ -394,6 +422,8 @@ static void (*const sDebugMenu_Actions_Utilities[])(u8) = [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = DebugAction_Util_HealParty, [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, + [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = DebugAction_Util_RunningShoes, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, @@ -428,6 +458,10 @@ static void (*const sDebugMenu_Actions_Give[])(u8) = [DEBUG_MENU_ITEM_GIVE_ALLTMS] = DebugAction_Give_AllTMs, [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = DebugAction_Give_PokemonSimple, [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = DebugAction_Give_PokemonComplex, + [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = DebugAction_Give_MaxMoney, + [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = DebugAction_Give_MaxCoins, + [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg, + [DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC, [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, //[DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, }; @@ -895,6 +929,36 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId) } } +static void DebugAction_Util_RunningShoes(u8 taskId) +{ + if (FlagGet(FLAG_SYS_B_DASH)) + { + FlagClear(FLAG_SYS_B_DASH); + PlaySE(SE_PC_OFF); + } + else + { + FlagSet(FLAG_SYS_B_DASH); + PlaySE(SE_PC_LOGIN); + } +} + +static void DebugAction_Util_PoisonMons(u8 taskId) +{ + int i; + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, 0) + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) + { + u32 curStatus = STATUS1_POISON; + SetMonData(&gPlayerParty[i], MON_DATA_STATUS, &curStatus); + } + } + PlaySE(SE_FIELD_POISON); +} + static void DebugAction_Util_CheckSaveBlock(u8 taskId) { static const u8 gDebugText_SaveBlockSize[] = _("SaveBlock1 is {STR_VAR_1} bytes long.\nMax size is 15872 bytes.\pSaveBlock2 is {STR_VAR_2} bytes long.\nMax size is 3968 bytes.\pPokemonStorage is {STR_VAR_3} bytes long.\nMax size is 35712 bytes."); @@ -2350,6 +2414,50 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu DebugAction_DestroyExtraWindow(taskId); //return sentToPc; } +static void DebugAction_Give_MaxMoney(u8 taskId) +{ + SetMoney(&gSaveBlock1Ptr->money, 999999); +} + +static void DebugAction_Give_MaxCoins(u8 taskId) +{ + SetCoins(9999); +} + +static void DebugAction_Give_DayCareEgg(u8 taskId) +{ + TriggerPendingDaycareEgg(); +} + +static void DebugAction_Give_FillPC(u8 taskId) //Credit: Sierraffinity +{ + int boxId, boxPosition; + u32 personality; + struct BoxPokemon boxMon; + + personality = Random32(); + + CreateBoxMon(&boxMon, + SPECIES_DEOXYS, + 100, + 32, + personality, + 0, + OT_ID_PLAYER_ID, + 0); + + for (boxId = 0; boxId < TOTAL_BOXES_COUNT; boxId++) + { + for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++) + { + if (!GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES)) + { + gPokemonStoragePtr->boxes[boxId][boxPosition] = boxMon; + } + } + } +} + static void DebugAction_Give_CHEAT(u8 taskId) { Debug_DestroyMenu(taskId); From 822a6c42608248a4a71199fe94c8d984edc6584b Mon Sep 17 00:00:00 2001 From: TheXaman Date: Fri, 7 May 2021 11:52:51 +0200 Subject: [PATCH 016/155] Formatting --- src/debug.c | 90 ++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/src/debug.c b/src/debug.c index 173711a113..28402da5d6 100644 --- a/src/debug.c +++ b/src/debug.c @@ -93,8 +93,8 @@ enum { // Vars DEBUG_VARS_MENU_ITEM_VARS, }; enum { // Give - DEBUG_GIVE_MENU_ITEM_ITEM, - DEBUG_MENU_ITEM_GIVE_ALLTMS, + DEBUG_GIVE_MENU_ITEM_ITEM_X, + DEBUG_GIVE_MENU_ITEM_ALLTMS, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX, DEBUG_GIVE_MENU_ITEM_MAX_MONEY, @@ -264,27 +264,27 @@ static const u8 gDebugText_Util_Trainer_Name[] = _("Trainer name"); static const u8 gDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); static const u8 gDebugText_Util_Trainer_Id[] = _("New Trainer Id"); // Flags Menu -static const u8 gDebugText_Flags_Flags[] = _("Set Flag XXXX"); -static const u8 gDebugText_Flags_SetPokedexFlags[] = _("All Pokédex Flags"); -static const u8 gDebugText_Flags_SwitchDex[] = _("Pokédex ON/OFF"); -static const u8 gDebugText_Flags_SwitchNationalDex[] = _("NatDex ON/OFF"); -static const u8 gDebugText_Flags_SwitchPokeNav[] = _("PokéNav ON/OFF"); -static const u8 gDebugText_Flags_ToggleFlyFlags[] = _("Fly Flags ON/OFF"); -static const u8 gDebugText_Flags_ToggleAllBadges[] = _("All badges ON/OFF"); -static const u8 gDebugText_Flags_SwitchCollision[] = _("Collision ON/OFF"); -static const u8 gDebugText_Flags_SwitchEncounter[] = _("Encounter ON/OFF"); -static const u8 gDebugText_Flags_SwitchTrainerSee[] = _("TrainerSee ON/OFF"); -static const u8 gDebugText_Flags_SwitchBagUse[] = _("BagUse ON/OFF"); -static const u8 gDebugText_Flags_SwitchCatching[] = _("Catching ON/OFF"); -static const u8 gDebugText_Flag[] = _("Flag: {STR_VAR_1} \n{STR_VAR_2} \n{STR_VAR_3}"); -static const u8 gDebugText_FlagHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); -static const u8 gDebugText_FlagSet[] = _("TRUE"); -static const u8 gDebugText_FlagUnset[] = _("FALSE"); +static const u8 gDebugText_Flags_Flags[] = _("Set Flag XXXX"); +static const u8 gDebugText_Flags_SetPokedexFlags[] = _("All Pokédex Flags"); +static const u8 gDebugText_Flags_SwitchDex[] = _("Pokédex ON/OFF"); +static const u8 gDebugText_Flags_SwitchNationalDex[] = _("NatDex ON/OFF"); +static const u8 gDebugText_Flags_SwitchPokeNav[] = _("PokéNav ON/OFF"); +static const u8 gDebugText_Flags_ToggleFlyFlags[] = _("Fly Flags ON/OFF"); +static const u8 gDebugText_Flags_ToggleAllBadges[] = _("All badges ON/OFF"); +static const u8 gDebugText_Flags_SwitchCollision[] = _("Collision ON/OFF"); +static const u8 gDebugText_Flags_SwitchEncounter[] = _("Encounter ON/OFF"); +static const u8 gDebugText_Flags_SwitchTrainerSee[] = _("TrainerSee ON/OFF"); +static const u8 gDebugText_Flags_SwitchBagUse[] = _("BagUse ON/OFF"); +static const u8 gDebugText_Flags_SwitchCatching[] = _("Catching ON/OFF"); +static const u8 gDebugText_Flags_Flag[] = _("Flag: {STR_VAR_1} \n{STR_VAR_2} \n{STR_VAR_3}"); +static const u8 gDebugText_Flags_FlagHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); +static const u8 gDebugText_Flags_FlagSet[] = _("TRUE"); +static const u8 gDebugText_Flags_FlagUnset[] = _("FALSE"); // Variables Menu -static const u8 gDebugText_Vars_Vars[] = _("Set Vars XXXX"); -static const u8 gDebugText_VariableHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); -static const u8 gDebugText_Variable[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); -static const u8 gDebugText_VariableValueSet[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); +static const u8 gDebugText_Vars_Vars[] = _("Set Vars XXXX"); +static const u8 gDebugText_Vars_VariableHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); +static const u8 gDebugText_Vars_Variable[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); +static const u8 gDebugText_Vars_VariableValueSet[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); // Give Menu static const u8 gDebugText_Give_GiveItem[] = _("Give item XXXX"); static const u8 gDebugText_ItemQuantity[] = _("Quantity: \n{STR_VAR_1} \n\n{STR_VAR_2}"); @@ -395,8 +395,8 @@ static const struct ListMenuItem sDebugMenu_Items_Vars[] = }; static const struct ListMenuItem sDebugMenu_Items_Give[] = { - [DEBUG_GIVE_MENU_ITEM_ITEM] = {gDebugText_Give_GiveItem, DEBUG_GIVE_MENU_ITEM_ITEM}, - [DEBUG_MENU_ITEM_GIVE_ALLTMS] = {gDebugText_Give_AllTMs, DEBUG_MENU_ITEM_GIVE_ALLTMS}, + [DEBUG_GIVE_MENU_ITEM_ITEM_X] = {gDebugText_Give_GiveItem, DEBUG_GIVE_MENU_ITEM_ITEM_X}, + [DEBUG_GIVE_MENU_ITEM_ALLTMS] = {gDebugText_Give_AllTMs, DEBUG_GIVE_MENU_ITEM_ALLTMS}, [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {gDebugText_Give_GivePokemonSimple, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE}, [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {gDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = {gDebugText_Give_MaxMoney, DEBUG_GIVE_MENU_ITEM_MAX_MONEY}, @@ -454,8 +454,8 @@ static void (*const sDebugMenu_Actions_Vars[])(u8) = }; static void (*const sDebugMenu_Actions_Give[])(u8) = { - [DEBUG_GIVE_MENU_ITEM_ITEM] = DebugAction_Give_Item, - [DEBUG_MENU_ITEM_GIVE_ALLTMS] = DebugAction_Give_AllTMs, + [DEBUG_GIVE_MENU_ITEM_ITEM_X] = DebugAction_Give_Item, + [DEBUG_GIVE_MENU_ITEM_ALLTMS] = DebugAction_Give_AllTMs, [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = DebugAction_Give_PokemonSimple, [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = DebugAction_Give_PokemonComplex, [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = DebugAction_Give_MaxMoney, @@ -1039,13 +1039,13 @@ static void DebugAction_Flags_Flags(u8 taskId) //Display initial Flag ConvertIntToDecimalStringN(gStringVar1, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); ConvertIntToHexStringN(gStringVar2, 0, STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar1, gDebugText_FlagHex); + StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex); if(FlagGet(0) == TRUE) - StringCopyPadded(gStringVar2, gDebugText_FlagSet, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, gDebugText_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); StringCopy(gStringVar3, gText_DigitIndicator[0]); - StringExpandPlaceholders(gStringVar4, gDebugText_Flag); + StringExpandPlaceholders(gStringVar4, gDebugText_Flags_Flag); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Flags_FlagsSelect; @@ -1103,13 +1103,13 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) { ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar1, gDebugText_FlagHex); + StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex); if(FlagGet(gTasks[taskId].data[3]) == TRUE) - StringCopyPadded(gStringVar2, gDebugText_FlagSet, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, gDebugText_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringExpandPlaceholders(gStringVar4, gDebugText_Flag); + StringExpandPlaceholders(gStringVar4, gDebugText_Flags_Flag); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } } @@ -1275,11 +1275,11 @@ static void DebugAction_Vars_Vars(u8 taskId) //Display initial Variable ConvertIntToDecimalStringN(gStringVar1, VARS_START, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, VARS_START, STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, gDebugText_VariableHex); + StringExpandPlaceholders(gStringVar1, gDebugText_Vars_VariableHex); ConvertIntToDecimalStringN(gStringVar3, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[0]); - StringExpandPlaceholders(gStringVar4, gDebugText_Variable); + StringExpandPlaceholders(gStringVar4, gDebugText_Vars_Variable); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Vars_Select; @@ -1328,7 +1328,7 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, gDebugText_VariableHex); + StringExpandPlaceholders(gStringVar1, gDebugText_Vars_VariableHex); if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value, if 65535 the value hasnt been set gTasks[taskId].data[5] = 0; else @@ -1337,7 +1337,7 @@ static void DebugAction_Vars_Select(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit //Combine str's to full window string - StringExpandPlaceholders(gStringVar4, gDebugText_Variable); + StringExpandPlaceholders(gStringVar4, gDebugText_Vars_Variable); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -1349,7 +1349,7 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, gDebugText_VariableHex); + StringExpandPlaceholders(gStringVar1, gDebugText_Vars_VariableHex); if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value if 65535 the value hasnt been set gTasks[taskId].data[5] = 0; else @@ -1357,7 +1357,7 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[5], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit - StringExpandPlaceholders(gStringVar4, gDebugText_VariableValueSet); + StringExpandPlaceholders(gStringVar4, gDebugText_Vars_VariableValueSet); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].data[6] = gTasks[taskId].data[5]; //New value selector @@ -1424,12 +1424,12 @@ static void DebugAction_Vars_SetValue(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, gDebugText_VariableHex); + StringExpandPlaceholders(gStringVar1, gDebugText_Vars_VariableHex); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[6], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit - StringExpandPlaceholders(gStringVar4, gDebugText_VariableValueSet); + StringExpandPlaceholders(gStringVar4, gDebugText_Vars_VariableValueSet); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } } @@ -1844,7 +1844,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringCopyPadded(gStringVar2, gDebugText_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, gDebugText_PokemonShiny); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -1881,9 +1881,9 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) } if(gTasks[taskId].data[3] == 1) - StringCopyPadded(gStringVar2, gDebugText_FlagSet, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, gDebugText_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, gDebugText_PokemonShiny); From c92c3456b1a6fee9d298c903927bc5aa80dcfa44 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Mon, 24 May 2021 10:19:22 +0200 Subject: [PATCH 017/155] Fixed bug not beeing able to select last species, thanks to Lunos for finding it --- src/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug.c b/src/debug.c index 28402da5d6..36102339e1 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1725,8 +1725,8 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if(gTasks[taskId].data[3] > SPECIES_CELEBI && gTasks[taskId].data[3] < SPECIES_TREECKO) gTasks[taskId].data[3] = SPECIES_TREECKO; - if(gTasks[taskId].data[3] >= NUM_SPECIES - 1) - gTasks[taskId].data[3] = NUM_SPECIES - 2; + if(gTasks[taskId].data[3] >= NUM_SPECIES) + gTasks[taskId].data[3] = NUM_SPECIES - 1; } if(gMain.newKeys & DPAD_DOWN) { From 4e98c268c1ba507bbcd18eddf153bab47bb9abdf Mon Sep 17 00:00:00 2001 From: Jaizu Date: Wed, 9 Jun 2021 23:07:05 +0200 Subject: [PATCH 018/155] Small change to hidden ability (#3) --- src/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index 36102339e1..c6bc23fb34 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1970,7 +1970,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) if (gBaseStats[sDebugMonData->mon_speciesId].abilities[1] != ABILITY_NONE) abilityCount++; #ifdef POKEMON_EXPANSION - if (gBaseStats[sDebugMonData->mon_speciesId].abilityHidden != ABILITY_NONE) + if (gBaseStats[sDebugMonData->mon_speciesId].abilities[2] != ABILITY_NONE) abilityCount++; #endif if (gMain.newKeys & DPAD_ANY) From 20ca83bb2001f6ef0188392b0c5b557479a8fba1 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Sun, 20 Jun 2021 15:48:44 +0200 Subject: [PATCH 019/155] Added menu to run custom scripts easily, credit: @Jaizu --- data/scripts/debug.inc | 24 +++++++ src/debug.c | 146 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+) diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index 9d46ea5fff..70401564e9 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -58,3 +58,27 @@ Debug_CheatStart:: closemessage release end + +Debug_Script_1:: + end + +Debug_Script_2:: + end + +Debug_Script_3:: + end + +Debug_Script_4:: + end + +Debug_Script_5:: + end + +Debug_Script_6:: + end + +Debug_Script_7:: + end + +Debug_Script_8:: + end diff --git a/src/debug.c b/src/debug.c index c6bc23fb34..2de9d8f904 100644 --- a/src/debug.c +++ b/src/debug.c @@ -6,6 +6,7 @@ //Pyredrid: https://github.com/Pyredrid/pokeemerald/tree/debugmenu //AsparagusEduardo: https://github.com/AsparagusEduardo/pokeemerald/tree/InfusedEmerald_v2 //Ghoulslash: https://github.com/ghoulslash/pokeemerald +//Jaizu: https://hastebin.com/raw/rikegejore #include "global.h" #include "battle.h" #include "coins.h" @@ -55,6 +56,7 @@ // Enums enum { // Main DEBUG_MENU_ITEM_UTILITIES, + DEBUG_MENU_ITEM_SCRIPTS, DEBUG_MENU_ITEM_FLAGS, DEBUG_MENU_ITEM_VARS, DEBUG_MENU_ITEM_GIVE, @@ -75,6 +77,16 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER, DEBUG_UTIL_MENU_ITEM_TRAINER_ID, }; +enum { + DEBUG_UTIL_MENU_ITEM_SCRIPT_1, + DEBUG_UTIL_MENU_ITEM_SCRIPT_2, + DEBUG_UTIL_MENU_ITEM_SCRIPT_3, + DEBUG_UTIL_MENU_ITEM_SCRIPT_4, + DEBUG_UTIL_MENU_ITEM_SCRIPT_5, + DEBUG_UTIL_MENU_ITEM_SCRIPT_6, + DEBUG_UTIL_MENU_ITEM_SCRIPT_7, + DEBUG_UTIL_MENU_ITEM_SCRIPT_8, +}; enum { // Flags DEBUG_FLAG_MENU_ITEM_FLAGS, DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS, @@ -156,12 +168,23 @@ static void Debug_DestroyMenu(u8); static void DebugAction_Cancel(u8); static void DebugAction_DestroyExtraWindow(u8 taskId); +static void DebugAction_Util_Script_1(u8); +static void DebugAction_Util_Script_2(u8); +static void DebugAction_Util_Script_3(u8); +static void DebugAction_Util_Script_4(u8); +static void DebugAction_Util_Script_5(u8); +static void DebugAction_Util_Script_6(u8); +static void DebugAction_Util_Script_7(u8); +static void DebugAction_Util_Script_8(u8); + static void DebugAction_OpenUtilitiesMenu(u8); +static void DebugAction_OpenScriptsMenu(u8); static void DebugAction_OpenFlagsMenu(u8); static void DebugAction_OpenVariablesMenu(u8); static void DebugAction_OpenGiveMenu(u8); static void DebugTask_HandleMenuInput_Main(u8); static void DebugTask_HandleMenuInput_Utilities(u8); +static void DebugTask_HandleMenuInput_Scripts(u8); static void DebugTask_HandleMenuInput_Flags(u8); static void DebugTask_HandleMenuInput_Vars(u8); static void DebugTask_HandleMenuInput_Give(u8); @@ -226,6 +249,15 @@ static void DebugAction_AccessPC(u8 taskId); static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)); static void DebugAction_OpenSubMenu(u8 taskId, struct ListMenuTemplate LMtemplate); +extern u8 Debug_Script_1[]; +extern u8 Debug_Script_2[]; +extern u8 Debug_Script_3[]; +extern u8 Debug_Script_4[]; +extern u8 Debug_Script_5[]; +extern u8 Debug_Script_6[]; +extern u8 Debug_Script_7[]; +extern u8 Debug_Script_8[]; + extern u8 Debug_ShowFieldMessageStringVar4[]; extern u8 Debug_CheatStart[]; extern u8 PlayersHouse_2F_EventScript_SetWallClock[]; @@ -241,10 +273,20 @@ extern const u8 gAbilityNames[][ABILITY_NAME_LENGTH + 1]; // Text // Main Menu static const u8 gDebugText_Utilities[] = _("Utilities"); +static const u8 gDebugText_Scripts[] = _("Scripts"); static const u8 gDebugText_Flags[] = _("Flags"); static const u8 gDebugText_Vars[] = _("Variables"); static const u8 gDebugText_Give[] = _("Give X"); static const u8 gDebugText_Cancel[] = _("Cancel"); +// Script menu +static const u8 gDebugText_Util_Script_1[] = _("Script 1"); +static const u8 gDebugText_Util_Script_2[] = _("Script 2"); +static const u8 gDebugText_Util_Script_3[] = _("Script 3"); +static const u8 gDebugText_Util_Script_4[] = _("Script 4"); +static const u8 gDebugText_Util_Script_5[] = _("Script 5"); +static const u8 gDebugText_Util_Script_6[] = _("Script 6"); +static const u8 gDebugText_Util_Script_7[] = _("Script 7"); +static const u8 gDebugText_Util_Script_8[] = _("Script 8"); // Util Menu static const u8 gDebugText_Util_HealParty[] = _("Heal Party"); static const u8 gDebugText_Util_Fly[] = _("Fly to map"); @@ -353,6 +395,7 @@ static const s32 sPowersOfTen[] = static const struct ListMenuItem sDebugMenu_Items_Main[] = { [DEBUG_MENU_ITEM_UTILITIES] = {gDebugText_Utilities, DEBUG_MENU_ITEM_UTILITIES}, + [DEBUG_MENU_ITEM_SCRIPTS] = {gDebugText_Scripts, DEBUG_MENU_ITEM_SCRIPTS}, [DEBUG_MENU_ITEM_FLAGS] = {gDebugText_Flags, DEBUG_MENU_ITEM_FLAGS}, [DEBUG_MENU_ITEM_VARS] = {gDebugText_Vars, DEBUG_MENU_ITEM_VARS}, [DEBUG_MENU_ITEM_GIVE] = {gDebugText_Give, DEBUG_MENU_ITEM_GIVE}, @@ -374,6 +417,17 @@ static const struct ListMenuItem sDebugMenu_Items_Utilities[] = [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {gDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER}, [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {gDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, }; +static const struct ListMenuItem sDebugMenu_Items_Scripts[] = +{ + [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = {gDebugText_Util_Script_1, DEBUG_UTIL_MENU_ITEM_SCRIPT_1}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = {gDebugText_Util_Script_2, DEBUG_UTIL_MENU_ITEM_SCRIPT_2}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = {gDebugText_Util_Script_3, DEBUG_UTIL_MENU_ITEM_SCRIPT_3}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = {gDebugText_Util_Script_4, DEBUG_UTIL_MENU_ITEM_SCRIPT_4}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = {gDebugText_Util_Script_5, DEBUG_UTIL_MENU_ITEM_SCRIPT_5}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = {gDebugText_Util_Script_6, DEBUG_UTIL_MENU_ITEM_SCRIPT_6}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = {gDebugText_Util_Script_7, DEBUG_UTIL_MENU_ITEM_SCRIPT_7}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = {gDebugText_Util_Script_8, DEBUG_UTIL_MENU_ITEM_SCRIPT_8}, +}; static const struct ListMenuItem sDebugMenu_Items_Flags[] = { [DEBUG_FLAG_MENU_ITEM_FLAGS] = {gDebugText_Flags_Flags, DEBUG_FLAG_MENU_ITEM_FLAGS}, @@ -412,6 +466,7 @@ static const struct ListMenuItem sDebugMenu_Items_Give[] = static void (*const sDebugMenu_Actions_Main[])(u8) = { [DEBUG_MENU_ITEM_UTILITIES] = DebugAction_OpenUtilitiesMenu, + [DEBUG_MENU_ITEM_SCRIPTS] = DebugAction_OpenScriptsMenu, [DEBUG_MENU_ITEM_FLAGS] = DebugAction_OpenFlagsMenu, [DEBUG_MENU_ITEM_VARS] = DebugAction_OpenVariablesMenu, [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, @@ -433,6 +488,17 @@ static void (*const sDebugMenu_Actions_Utilities[])(u8) = [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = DebugAction_Util_Trainer_Gender, [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id, }; +static void (*const sDebugMenu_Actions_Scripts[])(u8) = +{ + [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = DebugAction_Util_Script_1, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = DebugAction_Util_Script_2, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = DebugAction_Util_Script_3, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = DebugAction_Util_Script_4, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = DebugAction_Util_Script_5, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = DebugAction_Util_Script_6, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = DebugAction_Util_Script_7, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = DebugAction_Util_Script_8, +}; static void (*const sDebugMenu_Actions_Flags[])(u8) = { [DEBUG_FLAG_MENU_ITEM_FLAGS] = DebugAction_Flags_Flags, @@ -504,6 +570,12 @@ static const struct ListMenuTemplate sDebugMenu_ListTemplate_Utilities = .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .totalItems = ARRAY_COUNT(sDebugMenu_Items_Utilities), }; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Scripts = +{ + .items = sDebugMenu_Items_Scripts, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Scripts), +}; static const struct ListMenuTemplate sDebugMenu_ListTemplate_Flags = { .items = sDebugMenu_Items_Flags, @@ -632,6 +704,24 @@ static void DebugTask_HandleMenuInput_Utilities(u8 taskId) Debug_ShowMainMenu(); } } +static void DebugTask_HandleMenuInput_Scripts(u8 taskId) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if ((func = sDebugMenu_Actions_Scripts[input]) != NULL) + func(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ShowMainMenu(); + } +} static void DebugTask_HandleMenuInput_Flags(u8 taskId) { void (*func)(u8); @@ -694,6 +784,11 @@ static void DebugAction_OpenUtilitiesMenu(u8 taskId) Debug_DestroyMenu(taskId); Debug_ShowMenu(DebugTask_HandleMenuInput_Utilities, sDebugMenu_ListTemplate_Utilities); } +static void DebugAction_OpenScriptsMenu(u8 taskId) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Scripts, sDebugMenu_ListTemplate_Scripts); +} static void DebugAction_OpenFlagsMenu(u8 taskId) { Debug_DestroyMenu(taskId); @@ -1020,6 +1115,57 @@ static void DebugAction_Util_Trainer_Id(u8 taskId) EnableBothScriptContexts(); } +// ******************************* +// Actions Scripts +static void DebugAction_Util_Script_1(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(Debug_Script_1); +} +static void DebugAction_Util_Script_2(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(Debug_Script_2); +} +static void DebugAction_Util_Script_3(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(Debug_Script_3); +} +static void DebugAction_Util_Script_4(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(Debug_Script_4); +} +static void DebugAction_Util_Script_5(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(Debug_Script_5); +} +static void DebugAction_Util_Script_6(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(Debug_Script_6); +} +static void DebugAction_Util_Script_7(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(Debug_Script_7); +} +static void DebugAction_Util_Script_8(u8 taskId) +{ + Debug_DestroyMenu(taskId); + ScriptContext2_Enable(); + ScriptContext1_SetupScript(Debug_Script_8); +} + // ******************************* // Actions Flags static void DebugAction_Flags_Flags(u8 taskId) From 9708ee074427de0160084c6d8ca7eabca501fc69 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Sun, 20 Jun 2021 16:57:34 +0200 Subject: [PATCH 020/155] fixed credit link --- src/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index 2de9d8f904..abd3c4d455 100644 --- a/src/debug.c +++ b/src/debug.c @@ -6,7 +6,7 @@ //Pyredrid: https://github.com/Pyredrid/pokeemerald/tree/debugmenu //AsparagusEduardo: https://github.com/AsparagusEduardo/pokeemerald/tree/InfusedEmerald_v2 //Ghoulslash: https://github.com/ghoulslash/pokeemerald -//Jaizu: https://hastebin.com/raw/rikegejore +//Jaizu: https://jaizu.moe/ #include "global.h" #include "battle.h" #include "coins.h" From defd7d9e07a22ee1cc1fb69216aaf4c886dd1267 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Tue, 22 Jun 2021 12:38:00 +0200 Subject: [PATCH 021/155] Added Sound menu for SE and MUS --- include/constants/songs.h | 3 + src/debug.c | 214 +++++++++++++++++++++++++++++++++++++- 2 files changed, 216 insertions(+), 1 deletion(-) diff --git a/include/constants/songs.h b/include/constants/songs.h index a78ee6fafe..8067557449 100644 --- a/include/constants/songs.h +++ b/include/constants/songs.h @@ -276,8 +276,10 @@ #define SE_PIKE_CURTAIN_CLOSE 267 // SE_CURTAIN #define SE_PIKE_CURTAIN_OPEN 268 // SE_CURTAIN1 #define SE_SUDOWOODO_SHAKE 269 // SE_USSOKI +#define END_SE SE_SUDOWOODO_SHAKE // Music +#define START_MUS 350 #define MUS_LITTLEROOT_TEST 350 // MUS_TETSUJI #define MUS_GSC_ROUTE38 351 // MUS_FIELD13 #define MUS_CAUGHT 352 // MUS_KACHI22 @@ -488,6 +490,7 @@ #define MUS_RG_TRAINER_TOWER 556 // MUS_RG_T_TOWER #define MUS_RG_SLOW_PALLET 557 // MUS_RG_SLOWMASARA #define MUS_RG_TEACHY_TV_MENU 558 // MUS_RG_TVNOIZE +#define END_MUS MUS_RG_TEACHY_TV_MENU #define PH_TRAP_BLEND 559 #define PH_TRAP_HELD 560 diff --git a/src/debug.c b/src/debug.c index abd3c4d455..0bd9c7cbbd 100644 --- a/src/debug.c +++ b/src/debug.c @@ -60,6 +60,7 @@ enum { // Main DEBUG_MENU_ITEM_FLAGS, DEBUG_MENU_ITEM_VARS, DEBUG_MENU_ITEM_GIVE, + DEBUG_MENU_ITEM_SOUND, DEBUG_MENU_ITEM_CANCEL }; enum { // Util @@ -77,7 +78,7 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER, DEBUG_UTIL_MENU_ITEM_TRAINER_ID, }; -enum { +enum { // Scripts DEBUG_UTIL_MENU_ITEM_SCRIPT_1, DEBUG_UTIL_MENU_ITEM_SCRIPT_2, DEBUG_UTIL_MENU_ITEM_SCRIPT_3, @@ -116,6 +117,10 @@ enum { // Give DEBUG_GIVE_MENU_ITEM_CHEAT, //DEBUG_MENU_ITEM_ACCESS_PC, }; +enum { //Sound + DEBUG_SOUND_MENU_ITEM_SE, + DEBUG_SOUND_MENU_ITEM_MUS, +}; // ******************************* @@ -182,12 +187,14 @@ static void DebugAction_OpenScriptsMenu(u8); static void DebugAction_OpenFlagsMenu(u8); static void DebugAction_OpenVariablesMenu(u8); static void DebugAction_OpenGiveMenu(u8); +static void DebugAction_OpenSoundMenu(u8); static void DebugTask_HandleMenuInput_Main(u8); static void DebugTask_HandleMenuInput_Utilities(u8); static void DebugTask_HandleMenuInput_Scripts(u8); static void DebugTask_HandleMenuInput_Flags(u8); static void DebugTask_HandleMenuInput_Vars(u8); static void DebugTask_HandleMenuInput_Give(u8); +static void DebugTask_HandleMenuInput_Sound(u8); static void DebugAction_Util_HealParty(u8 taskId); static void DebugAction_Util_Fly(u8 taskId); @@ -246,6 +253,11 @@ static void DebugAction_Give_FillPC(u8 taskId); static void DebugAction_Give_CHEAT(u8 taskId); static void DebugAction_AccessPC(u8 taskId); +static void DebugAction_Sound_SE(u8 taskId); +static void DebugAction_Sound_SE_SelectId(u8 taskId); +static void DebugAction_Sound_MUS(u8 taskId); +static void DebugAction_Sound_MUS_SelectId(u8 taskId); + static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)); static void DebugAction_OpenSubMenu(u8 taskId, struct ListMenuTemplate LMtemplate); @@ -277,6 +289,7 @@ static const u8 gDebugText_Scripts[] = _("Scripts"); static const u8 gDebugText_Flags[] = _("Flags"); static const u8 gDebugText_Vars[] = _("Variables"); static const u8 gDebugText_Give[] = _("Give X"); +static const u8 gDebugText_Sound[] = _("Sound"); static const u8 gDebugText_Cancel[] = _("Cancel"); // Script menu static const u8 gDebugText_Util_Script_1[] = _("Script 1"); @@ -356,6 +369,12 @@ static const u8 gDebugText_Give_DaycareEgg[] = _("Daycare Egg"); static const u8 gDebugText_Give_FillPc[] = _("Fill Pc"); static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); // static const u8 gDebugText_Give_AccessPC[] = _("Access PC"); +// Sound Mneu +static const u8 gDebugText_Sound_SE[] = _("Effects"); +static const u8 gDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_Sound_MUS[] = _("Music"); +static const u8 gDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_Sound_Empty[] = _(""); static const u8 digitInidicator_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); static const u8 digitInidicator_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); @@ -399,6 +418,7 @@ static const struct ListMenuItem sDebugMenu_Items_Main[] = [DEBUG_MENU_ITEM_FLAGS] = {gDebugText_Flags, DEBUG_MENU_ITEM_FLAGS}, [DEBUG_MENU_ITEM_VARS] = {gDebugText_Vars, DEBUG_MENU_ITEM_VARS}, [DEBUG_MENU_ITEM_GIVE] = {gDebugText_Give, DEBUG_MENU_ITEM_GIVE}, + [DEBUG_MENU_ITEM_SOUND] = {gDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, [DEBUG_MENU_ITEM_CANCEL] = {gDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} }; static const struct ListMenuItem sDebugMenu_Items_Utilities[] = @@ -460,6 +480,11 @@ static const struct ListMenuItem sDebugMenu_Items_Give[] = [DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, //[DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, }; +static const struct ListMenuItem sDebugMenu_Items_Sound[] = +{ + [DEBUG_SOUND_MENU_ITEM_SE] = {gDebugText_Sound_SE, DEBUG_SOUND_MENU_ITEM_SE}, + [DEBUG_SOUND_MENU_ITEM_MUS] = {gDebugText_Sound_MUS, DEBUG_SOUND_MENU_ITEM_MUS}, +}; // ******************************* // Menu Actions @@ -470,6 +495,7 @@ static void (*const sDebugMenu_Actions_Main[])(u8) = [DEBUG_MENU_ITEM_FLAGS] = DebugAction_OpenFlagsMenu, [DEBUG_MENU_ITEM_VARS] = DebugAction_OpenVariablesMenu, [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, + [DEBUG_MENU_ITEM_SOUND] = DebugAction_OpenSoundMenu, [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel }; static void (*const sDebugMenu_Actions_Utilities[])(u8) = @@ -531,6 +557,11 @@ static void (*const sDebugMenu_Actions_Give[])(u8) = [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, //[DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, }; +static void (*const sDebugMenu_Actions_Sound[])(u8) = +{ + [DEBUG_SOUND_MENU_ITEM_SE] = DebugAction_Sound_SE, + [DEBUG_SOUND_MENU_ITEM_MUS] = DebugAction_Sound_MUS, +}; // ******************************* @@ -594,6 +625,12 @@ static const struct ListMenuTemplate sDebugMenu_ListTemplate_Give = .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .totalItems = ARRAY_COUNT(sDebugMenu_Items_Give), }; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Sound = +{ + .items = sDebugMenu_Items_Sound, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Sound), +}; // ******************************* @@ -776,6 +813,24 @@ static void DebugTask_HandleMenuInput_Give(u8 taskId) Debug_ShowMainMenu(); } } +static void DebugTask_HandleMenuInput_Sound(u8 taskId) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if ((func = sDebugMenu_Actions_Sound[input]) != NULL) + func(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ShowMainMenu(); + } +} // ******************************* // Open sub-menus @@ -804,6 +859,11 @@ static void DebugAction_OpenGiveMenu(u8 taskId) Debug_DestroyMenu(taskId); Debug_ShowMenu(DebugTask_HandleMenuInput_Give, sDebugMenu_ListTemplate_Give); } +static void DebugAction_OpenSoundMenu(u8 taskId) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Sound, sDebugMenu_ListTemplate_Sound); +} // ******************************* @@ -2619,8 +2679,160 @@ static void DebugAction_Give_CHEAT(u8 taskId) // } +// ******************************* +// Sound Scripts +static void DebugAction_Sound_SE(u8 taskId) +{ + u8 windowId; + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + CopyWindowToVram(windowId, 3); + + //Display initial ID + StringCopy(gStringVar2, gText_DigitIndicator[0]); + ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); + StringCopyPadded(gStringVar1, gDebugText_Sound_Empty, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_Sound_SE_ID); + AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); + + StopMapMusic(); //Stop map music to better hear sounds + + gTasks[taskId].func = DebugAction_Sound_SE_SelectId; + gTasks[taskId].data[2] = windowId; + gTasks[taskId].data[3] = 1; //Current ID + gTasks[taskId].data[4] = 0; //Digit Selected +} +static void DebugAction_Sound_SE_SelectId(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > END_SE) + gTasks[taskId].data[3] = END_SE; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < 1) + gTasks[taskId].data[3] = 1; + } + if(gMain.newKeys & DPAD_LEFT) + { + if(gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if(gMain.newKeys & DPAD_RIGHT) + { + if(gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS-1) + gTasks[taskId].data[4] += 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringCopyPadded(gStringVar1, gDebugText_Sound_Empty, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); + StringExpandPlaceholders(gStringVar4, gDebugText_Sound_SE_ID); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(gTasks[taskId].data[3]); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + MapMusicMain(); + DebugAction_DestroyExtraWindow(taskId); + } +} + +static void DebugAction_Sound_MUS(u8 taskId) +{ + u8 windowId; + + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + CopyWindowToVram(windowId, 3); + + //Display initial ID + StringCopy(gStringVar2, gText_DigitIndicator[0]); + ConvertIntToDecimalStringN(gStringVar3, START_MUS, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); + StringCopyPadded(gStringVar1, gDebugText_Sound_Empty, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, gDebugText_Sound_MUS_ID); + AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); + + StopMapMusic(); //Stop map music to better hear new music + + gTasks[taskId].func = DebugAction_Sound_MUS_SelectId; + gTasks[taskId].data[2] = windowId; + gTasks[taskId].data[3] = START_MUS; //Current ID + gTasks[taskId].data[4] = 0; //Digit Selected +} +static void DebugAction_Sound_MUS_SelectId(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if(gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] > END_MUS) + gTasks[taskId].data[3] = END_MUS; + } + if(gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if(gTasks[taskId].data[3] < START_MUS) + gTasks[taskId].data[3] = START_MUS; + } + if(gMain.newKeys & DPAD_LEFT) + { + if(gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if(gMain.newKeys & DPAD_RIGHT) + { + if(gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS-1) + gTasks[taskId].data[4] += 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringCopyPadded(gStringVar1, gDebugText_Sound_Empty, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); + StringExpandPlaceholders(gStringVar4, gDebugText_Sound_MUS_ID); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + StopMapMusic(); + PlayNewMapMusic(gTasks[taskId].data[3]); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + MapMusicMain(); + DebugAction_DestroyExtraWindow(taskId); + } +} // Additional functions /* From 81d7986d34992e8f26166e14da7da69c7e2f03ee Mon Sep 17 00:00:00 2001 From: TheXaman Date: Tue, 22 Jun 2021 15:57:02 +0200 Subject: [PATCH 022/155] added SE and MUS names --- src/debug.c | 776 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 768 insertions(+), 8 deletions(-) diff --git a/src/debug.c b/src/debug.c index 0bd9c7cbbd..49bef794f7 100644 --- a/src/debug.c +++ b/src/debug.c @@ -130,6 +130,8 @@ enum { //Sound #define DEBUG_NUMBER_DISPLAY_WIDTH 10 #define DEBUG_NUMBER_DISPLAY_HEIGHT 4 +#define DEBUG_NUMBER_DISPLAY_SOUND_WIDTH 20 +#define DEBUG_NUMBER_DISPLAY_SOUND_HEIGHT 6 #define DEBUG_NUMBER_DIGITS_FLAGS 4 #define DEBUG_NUMBER_DIGITS_VARIABLES 5 @@ -371,9 +373,9 @@ static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); // static const u8 gDebugText_Give_AccessPC[] = _("Access PC"); // Sound Mneu static const u8 gDebugText_Sound_SE[] = _("Effects"); -static const u8 gDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); static const u8 gDebugText_Sound_MUS[] = _("Music"); -static const u8 gDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); static const u8 gDebugText_Sound_Empty[] = _(""); static const u8 digitInidicator_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); @@ -586,6 +588,16 @@ static const struct WindowTemplate sDebugNumberDisplayWindowTemplate = .paletteNum = 15, .baseBlock = 1, }; +static const struct WindowTemplate sDebugNumberDisplayLargeWindowTemplate = +{ + .bg = 0, + .tilemapLeft = 30 - DEBUG_NUMBER_DISPLAY_SOUND_WIDTH -1, + .tilemapTop = 1, + .width = DEBUG_NUMBER_DISPLAY_SOUND_WIDTH, + .height = DEBUG_NUMBER_DISPLAY_SOUND_HEIGHT, + .paletteNum = 15, + .baseBlock = 1, +}; // ******************************* // List Menu Templates @@ -2681,6 +2693,8 @@ static void DebugAction_Give_CHEAT(u8 taskId) // ******************************* // Sound Scripts +static const u8 *const gBGMNames[]; +static const u8 *const gSENames[]; static void DebugAction_Sound_SE(u8 taskId) { u8 windowId; @@ -2690,7 +2704,7 @@ static void DebugAction_Sound_SE(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugNumberDisplayLargeWindowTemplate); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -2698,7 +2712,7 @@ static void DebugAction_Sound_SE(u8 taskId) //Display initial ID StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - StringCopyPadded(gStringVar1, gDebugText_Sound_Empty, CHAR_SPACE, 15); + StringCopyPadded(gStringVar1, gSENames[0], CHAR_SPACE, 35); StringExpandPlaceholders(gStringVar4, gDebugText_Sound_SE_ID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); @@ -2739,7 +2753,7 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId) } StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringCopyPadded(gStringVar1, gDebugText_Sound_Empty, CHAR_SPACE, 15); + StringCopyPadded(gStringVar1, gSENames[gTasks[taskId].data[3]-1], CHAR_SPACE, 35); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringExpandPlaceholders(gStringVar4, gDebugText_Sound_SE_ID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -2766,7 +2780,7 @@ static void DebugAction_Sound_MUS(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugNumberDisplayLargeWindowTemplate); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -2774,7 +2788,7 @@ static void DebugAction_Sound_MUS(u8 taskId) //Display initial ID StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, START_MUS, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - StringCopyPadded(gStringVar1, gDebugText_Sound_Empty, CHAR_SPACE, 15); + StringCopyPadded(gStringVar1, gBGMNames[0], CHAR_SPACE, 35); StringExpandPlaceholders(gStringVar4, gDebugText_Sound_MUS_ID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); @@ -2815,7 +2829,7 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) } StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringCopyPadded(gStringVar1, gDebugText_Sound_Empty, CHAR_SPACE, 15); + StringCopyPadded(gStringVar1, gBGMNames[gTasks[taskId].data[3]-START_MUS], CHAR_SPACE, 35); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringExpandPlaceholders(gStringVar4, gDebugText_Sound_MUS_ID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -2834,6 +2848,752 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) } } +#define SOUND_LIST_BGM \ + X(MUS_LITTLEROOT_TEST, "MUS-LITTLEROOT-TEST") \ + X(MUS_GSC_ROUTE38, "MUS-GSC-ROUTE38") \ + X(MUS_CAUGHT, "MUS-CAUGHT") \ + X(MUS_VICTORY_WILD, "MUS-VICTORY-WILD") \ + X(MUS_VICTORY_GYM_LEADER, "MUS-VICTORY-GYM-LEADER") \ + X(MUS_VICTORY_LEAGUE, "MUS-VICTORY-LEAGUE") \ + X(MUS_C_COMM_CENTER, "MUS-C-COMM-CENTER") \ + X(MUS_GSC_PEWTER, "MUS-GSC-PEWTER") \ + X(MUS_C_VS_LEGEND_BEAST, "MUS-C-VS-LEGEND-BEAST") \ + X(MUS_ROUTE101, "MUS-ROUTE101") \ + X(MUS_ROUTE110, "MUS-ROUTE110") \ + X(MUS_ROUTE120, "MUS-ROUTE120") \ + X(MUS_PETALBURG, "MUS-PETALBURG") \ + X(MUS_OLDALE, "MUS-OLDALE") \ + X(MUS_GYM, "MUS-GYM") \ + X(MUS_SURF, "MUS-SURF") \ + X(MUS_PETALBURG_WOODS, "MUS-PETALBURG-WOODS") \ + X(MUS_LEVEL_UP, "MUS-LEVEL-UP") \ + X(MUS_HEAL, "MUS-HEAL") \ + X(MUS_OBTAIN_BADGE, "MUS-OBTAIN-BADGE") \ + X(MUS_OBTAIN_ITEM, "MUS-OBTAIN-ITEM") \ + X(MUS_EVOLVED, "MUS-EVOLVED") \ + X(MUS_OBTAIN_TMHM, "MUS-OBTAIN-TMHM") \ + X(MUS_LILYCOVE_MUSEUM, "MUS-LILYCOVE-MUSEUM") \ + X(MUS_ROUTE122, "MUS-ROUTE122") \ + X(MUS_OCEANIC_MUSEUM, "MUS-OCEANIC-MUSEUM") \ + X(MUS_EVOLUTION_INTRO, "MUS-EVOLUTION-INTRO") \ + X(MUS_EVOLUTION, "MUS-EVOLUTION") \ + X(MUS_MOVE_DELETED, "MUS-MOVE-DELETED") \ + X(MUS_ENCOUNTER_GIRL, "MUS-ENCOUNTER-GIRL") \ + X(MUS_ENCOUNTER_MALE, "MUS-ENCOUNTER-MALE") \ + X(MUS_ABANDONED_SHIP, "MUS-ABANDONED-SHIP") \ + X(MUS_FORTREE, "MUS-FORTREE") \ + X(MUS_BIRCH_LAB, "MUS-BIRCH-LAB") \ + X(MUS_B_TOWER_RS, "MUS-B-TOWER-RS") \ + X(MUS_ENCOUNTER_SWIMMER, "MUS-ENCOUNTER-SWIMMER") \ + X(MUS_CAVE_OF_ORIGIN, "MUS-CAVE-OF-ORIGIN") \ + X(MUS_OBTAIN_BERRY, "MUS-OBTAIN-BERRY") \ + X(MUS_AWAKEN_LEGEND, "MUS-AWAKEN-LEGEND") \ + X(MUS_SLOTS_JACKPOT, "MUS-SLOTS-JACKPOT") \ + X(MUS_SLOTS_WIN, "MUS-SLOTS-WIN") \ + X(MUS_TOO_BAD, "MUS-TOO-BAD") \ + X(MUS_ROULETTE, "MUS-ROULETTE") \ + X(MUS_LINK_CONTEST_P1, "MUS-LINK-CONTEST-P1") \ + X(MUS_LINK_CONTEST_P2, "MUS-LINK-CONTEST-P2") \ + X(MUS_LINK_CONTEST_P3, "MUS-LINK-CONTEST-P3") \ + X(MUS_LINK_CONTEST_P4, "MUS-LINK-CONTEST-P4") \ + X(MUS_ENCOUNTER_RICH, "MUS-ENCOUNTER-RICH") \ + X(MUS_VERDANTURF, "MUS-VERDANTURF") \ + X(MUS_RUSTBORO, "MUS-RUSTBORO") \ + X(MUS_POKE_CENTER, "MUS-POKE-CENTER") \ + X(MUS_ROUTE104, "MUS-ROUTE104") \ + X(MUS_ROUTE119, "MUS-ROUTE119") \ + X(MUS_CYCLING, "MUS-CYCLING") \ + X(MUS_POKE_MART, "MUS-POKE-MART") \ + X(MUS_LITTLEROOT, "MUS-LITTLEROOT") \ + X(MUS_MT_CHIMNEY, "MUS-MT-CHIMNEY") \ + X(MUS_ENCOUNTER_FEMALE, "MUS-ENCOUNTER-FEMALE") \ + X(MUS_LILYCOVE, "MUS-LILYCOVE") \ + X(MUS_ROUTE111, "MUS-ROUTE111") \ + X(MUS_HELP, "MUS-HELP") \ + X(MUS_UNDERWATER, "MUS-UNDERWATER") \ + X(MUS_VICTORY_TRAINER, "MUS-VICTORY-TRAINER") \ + X(MUS_TITLE, "MUS-TITLE") \ + X(MUS_INTRO, "MUS-INTRO") \ + X(MUS_ENCOUNTER_MAY, "MUS-ENCOUNTER-MAY") \ + X(MUS_ENCOUNTER_INTENSE, "MUS-ENCOUNTER-INTENSE") \ + X(MUS_ENCOUNTER_COOL, "MUS-ENCOUNTER-COOL") \ + X(MUS_ROUTE113, "MUS-ROUTE113") \ + X(MUS_ENCOUNTER_AQUA, "MUS-ENCOUNTER-AQUA") \ + X(MUS_FOLLOW_ME, "MUS-FOLLOW-ME") \ + X(MUS_ENCOUNTER_BRENDAN, "MUS-ENCOUNTER-BRENDAN") \ + X(MUS_EVER_GRANDE, "MUS-EVER-GRANDE") \ + X(MUS_ENCOUNTER_SUSPICIOUS, "MUS-ENCOUNTER-SUSPICIOUS") \ + X(MUS_VICTORY_AQUA_MAGMA, "MUS-VICTORY-AQUA-MAGMA") \ + X(MUS_CABLE_CAR, "MUS-CABLE-CAR") \ + X(MUS_GAME_CORNER, "MUS-GAME-CORNER") \ + X(MUS_DEWFORD, "MUS-DEWFORD") \ + X(MUS_SAFARI_ZONE, "MUS-SAFARI-ZONE") \ + X(MUS_VICTORY_ROAD, "MUS-VICTORY-ROAD") \ + X(MUS_AQUA_MAGMA_HIDEOUT, "MUS-AQUA-MAGMA-HIDEOUT") \ + X(MUS_SAILING, "MUS-SAILING") \ + X(MUS_MT_PYRE, "MUS-MT-PYRE") \ + X(MUS_SLATEPORT, "MUS-SLATEPORT") \ + X(MUS_MT_PYRE_EXTERIOR, "MUS-MT-PYRE-EXTERIOR") \ + X(MUS_SCHOOL, "MUS-SCHOOL") \ + X(MUS_HALL_OF_FAME, "MUS-HALL-OF-FAME") \ + X(MUS_FALLARBOR, "MUS-FALLARBOR") \ + X(MUS_SEALED_CHAMBER, "MUS-SEALED-CHAMBER") \ + X(MUS_CONTEST_WINNER, "MUS-CONTEST-WINNER") \ + X(MUS_CONTEST, "MUS-CONTEST") \ + X(MUS_ENCOUNTER_MAGMA, "MUS-ENCOUNTER-MAGMA") \ + X(MUS_INTRO_BATTLE, "MUS-INTRO-BATTLE") \ + X(MUS_WEATHER_KYOGRE, "MUS-WEATHER-KYOGRE") \ + X(MUS_WEATHER_GROUDON, "MUS-WEATHER-GROUDON") \ + X(MUS_SOOTOPOLIS, "MUS-SOOTOPOLIS") \ + X(MUS_CONTEST_RESULTS, "MUS-CONTEST-RESULTS") \ + X(MUS_HALL_OF_FAME_ROOM, "MUS-HALL-OF-FAME-ROOM") \ + X(MUS_TRICK_HOUSE, "MUS-TRICK-HOUSE") \ + X(MUS_ENCOUNTER_TWINS, "MUS-ENCOUNTER-TWINS") \ + X(MUS_ENCOUNTER_ELITE_FOUR, "MUS-ENCOUNTER-ELITE-FOUR") \ + X(MUS_ENCOUNTER_HIKER, "MUS-ENCOUNTER-HIKER") \ + X(MUS_CONTEST_LOBBY, "MUS-CONTEST-LOBBY") \ + X(MUS_ENCOUNTER_INTERVIEWER, "MUS-ENCOUNTER-INTERVIEWER") \ + X(MUS_ENCOUNTER_CHAMPION, "MUS-ENCOUNTER-CHAMPION") \ + X(MUS_CREDITS, "MUS-CREDITS") \ + X(MUS_END, "MUS-END") \ + X(MUS_B_FRONTIER, "MUS-B-FRONTIER") \ + X(MUS_B_ARENA, "MUS-B-ARENA") \ + X(MUS_OBTAIN_B_POINTS, "MUS-OBTAIN-B-POINTS") \ + X(MUS_REGISTER_MATCH_CALL, "MUS-REGISTER-MATCH-CALL") \ + X(MUS_B_PYRAMID, "MUS-B-PYRAMID") \ + X(MUS_B_PYRAMID_TOP, "MUS-B-PYRAMID-TOP") \ + X(MUS_B_PALACE, "MUS-B-PALACE") \ + X(MUS_RAYQUAZA_APPEARS, "MUS-RAYQUAZA-APPEARS") \ + X(MUS_B_TOWER, "MUS-B-TOWER") \ + X(MUS_OBTAIN_SYMBOL, "MUS-OBTAIN-SYMBOL") \ + X(MUS_B_DOME, "MUS-B-DOME") \ + X(MUS_B_PIKE, "MUS-B-PIKE") \ + X(MUS_B_FACTORY, "MUS-B-FACTORY") \ + X(MUS_VS_RAYQUAZA, "MUS-VS-RAYQUAZA") \ + X(MUS_VS_FRONTIER_BRAIN, "MUS-VS-FRONTIER-BRAIN") \ + X(MUS_VS_MEW, "MUS-VS-MEW") \ + X(MUS_B_DOME_LOBBY, "MUS-B-DOME-LOBBY") \ + X(MUS_VS_WILD, "MUS-VS-WILD") \ + X(MUS_VS_AQUA_MAGMA, "MUS-VS-AQUA-MAGMA") \ + X(MUS_VS_TRAINER, "MUS-VS-TRAINER") \ + X(MUS_VS_GYM_LEADER, "MUS-VS-GYM-LEADER") \ + X(MUS_VS_CHAMPION, "MUS-VS-CHAMPION") \ + X(MUS_VS_REGI, "MUS-VS-REGI") \ + X(MUS_VS_KYOGRE_GROUDON, "MUS-VS-KYOGRE-GROUDON") \ + X(MUS_VS_RIVAL, "MUS-VS-RIVAL") \ + X(MUS_VS_ELITE_FOUR, "MUS-VS-ELITE-FOUR") \ + X(MUS_VS_AQUA_MAGMA_LEADER, "MUS-VS-AQUA-MAGMA-LEADER") \ + X(MUS_RG_FOLLOW_ME, "MUS-RG-FOLLOW-ME") \ + X(MUS_RG_GAME_CORNER, "MUS-RG-GAME-CORNER") \ + X(MUS_RG_ROCKET_HIDEOUT, "MUS-RG-ROCKET-HIDEOUT") \ + X(MUS_RG_GYM, "MUS-RG-GYM") \ + X(MUS_RG_JIGGLYPUFF, "MUS-RG-JIGGLYPUFF") \ + X(MUS_RG_INTRO_FIGHT, "MUS-RG-INTRO-FIGHT") \ + X(MUS_RG_TITLE, "MUS-RG-TITLE") \ + X(MUS_RG_CINNABAR, "MUS-RG-CINNABAR") \ + X(MUS_RG_LAVENDER, "MUS-RG-LAVENDER") \ + X(MUS_RG_HEAL, "MUS-RG-HEAL") \ + X(MUS_RG_CYCLING, "MUS-RG-CYCLING") \ + X(MUS_RG_ENCOUNTER_ROCKET, "MUS-RG-ENCOUNTER-ROCKET") \ + X(MUS_RG_ENCOUNTER_GIRL, "MUS-RG-ENCOUNTER-GIRL") \ + X(MUS_RG_ENCOUNTER_BOY, "MUS-RG-ENCOUNTER-BOY") \ + X(MUS_RG_HALL_OF_FAME, "MUS-RG-HALL-OF-FAME") \ + X(MUS_RG_VIRIDIAN_FOREST, "MUS-RG-VIRIDIAN-FOREST") \ + X(MUS_RG_MT_MOON, "MUS-RG-MT-MOON") \ + X(MUS_RG_POKE_MANSION, "MUS-RG-POKE-MANSION") \ + X(MUS_RG_CREDITS, "MUS-RG-CREDITS") \ + X(MUS_RG_ROUTE1, "MUS-RG-ROUTE1") \ + X(MUS_RG_ROUTE24, "MUS-RG-ROUTE24") \ + X(MUS_RG_ROUTE3, "MUS-RG-ROUTE3") \ + X(MUS_RG_ROUTE11, "MUS-RG-ROUTE11") \ + X(MUS_RG_VICTORY_ROAD, "MUS-RG-VICTORY-ROAD") \ + X(MUS_RG_VS_GYM_LEADER, "MUS-RG-VS-GYM-LEADER") \ + X(MUS_RG_VS_TRAINER, "MUS-RG-VS-TRAINER") \ + X(MUS_RG_VS_WILD, "MUS-RG-VS-WILD") \ + X(MUS_RG_VS_CHAMPION, "MUS-RG-VS-CHAMPION") \ + X(MUS_RG_PALLET, "MUS-RG-PALLET") \ + X(MUS_RG_OAK_LAB, "MUS-RG-OAK-LAB") \ + X(MUS_RG_OAK, "MUS-RG-OAK") \ + X(MUS_RG_POKE_CENTER, "MUS-RG-POKE-CENTER") \ + X(MUS_RG_SS_ANNE, "MUS-RG-SS-ANNE") \ + X(MUS_RG_SURF, "MUS-RG-SURF") \ + X(MUS_RG_POKE_TOWER, "MUS-RG-POKE-TOWER") \ + X(MUS_RG_SILPH, "MUS-RG-SILPH") \ + X(MUS_RG_FUCHSIA, "MUS-RG-FUCHSIA") \ + X(MUS_RG_CELADON, "MUS-RG-CELADON") \ + X(MUS_RG_VICTORY_TRAINER, "MUS-RG-VICTORY-TRAINER") \ + X(MUS_RG_VICTORY_WILD, "MUS-RG-VICTORY-WILD") \ + X(MUS_RG_VICTORY_GYM_LEADER, "MUS-RG-VICTORY-GYM-LEADER") \ + X(MUS_RG_VERMILLION, "MUS-RG-VERMILLION") \ + X(MUS_RG_PEWTER, "MUS-RG-PEWTER") \ + X(MUS_RG_ENCOUNTER_RIVAL, "MUS-RG-ENCOUNTER-RIVAL") \ + X(MUS_RG_RIVAL_EXIT, "MUS-RG-RIVAL-EXIT") \ + X(MUS_RG_DEX_RATING, "MUS-RG-DEX-RATING") \ + X(MUS_RG_OBTAIN_KEY_ITEM, "MUS-RG-OBTAIN-KEY-ITEM") \ + X(MUS_RG_CAUGHT_INTRO, "MUS-RG-CAUGHT-INTRO") \ + X(MUS_RG_PHOTO, "MUS-RG-PHOTO") \ + X(MUS_RG_GAME_FREAK, "MUS-RG-GAME-FREAK") \ + X(MUS_RG_CAUGHT, "MUS-RG-CAUGHT") \ + X(MUS_RG_NEW_GAME_INSTRUCT, "MUS-RG-NEW-GAME-INSTRUCT") \ + X(MUS_RG_NEW_GAME_INTRO, "MUS-RG-NEW-GAME-INTRO") \ + X(MUS_RG_NEW_GAME_EXIT, "MUS-RG-NEW-GAME-EXIT") \ + X(MUS_RG_POKE_JUMP, "MUS-RG-POKE-JUMP") \ + X(MUS_RG_UNION_ROOM, "MUS-RG-UNION-ROOM") \ + X(MUS_RG_NET_CENTER, "MUS-RG-NET-CENTER") \ + X(MUS_RG_MYSTERY_GIFT, "MUS-RG-MYSTERY-GIFT") \ + X(MUS_RG_BERRY_PICK, "MUS-RG-BERRY-PICK") \ + X(MUS_RG_SEVII_CAVE, "MUS-RG-SEVII-CAVE") \ + X(MUS_RG_TEACHY_TV_SHOW, "MUS-RG-TEACHY-TV-SHOW") \ + X(MUS_RG_SEVII_ROUTE, "MUS-RG-SEVII-ROUTE") \ + X(MUS_RG_SEVII_DUNGEON, "MUS-RG-SEVII-DUNGEON") \ + X(MUS_RG_SEVII_123, "MUS-RG-SEVII-123") \ + X(MUS_RG_SEVII_45, "MUS-RG-SEVII-45") \ + X(MUS_RG_SEVII_67, "MUS-RG-SEVII-67") \ + X(MUS_RG_POKE_FLUTE, "MUS-RG-POKE-FLUTE") \ + X(MUS_RG_VS_DEOXYS, "MUS-RG-VS-DEOXYS") \ + X(MUS_RG_VS_MEWTWO, "MUS-RG-VS-MEWTWO") \ + X(MUS_RG_VS_LEGEND, "MUS-RG-VS-LEGEND") \ + X(MUS_RG_ENCOUNTER_GYM_LEADER, "MUS-RG-ENCOUNTER-GYM-LEADER") \ + X(MUS_RG_ENCOUNTER_DEOXYS, "MUS-RG-ENCOUNTER-DEOXYS") \ + X(MUS_RG_TRAINER_TOWER, "MUS-RG-TRAINER-TOWER") \ + X(MUS_RG_SLOW_PALLET, "MUS-RG-SLOW-PALLET") \ + X(MUS_RG_TEACHY_TV_MENU, "MUS-RG-TEACHY-TV-MENU") \ + X(DP_SEQ_TITLE00 , "DP-SEQ-TITLE00") \ + X(DP_SEQ_TITLE01 , "DP-SEQ-TITLE01") \ + X(DP_SEQ_OPENING , "DP-SEQ-OPENING") \ + X(DP_SEQ_TV_HOUSOU , "DP-SEQ-TV-HOUSOU") \ + X(DP_SEQ_TV_END , "DP-SEQ-TV-END") \ + X(DP_SEQ_TOWN01_D , "DP-SEQ-TOWN01-D") \ + X(DP_SEQ_TOWN01_N , "DP-SEQ-TOWN01-N") \ + X(DP_SEQ_THE_RIV , "DP-SEQ-THE-RIV") \ + X(DP_SEQ_ROAD_A_D , "DP-SEQ-ROAD-A-D") \ + X(DP_SEQ_ROAD_A_N , "DP-SEQ-ROAD-A-N") \ + X(DP_SEQ_D_LAKE , "DP-SEQ-D-LAKE") \ + X(DP_SEQ_THE_EVENT01, "DP-SEQ-THE-EVENT01") \ + X(DP_SEQ_BA_POKE , "DP-SEQ-BA-POKE") \ + X(DP_SEQ_WINPOKE , "DP-SEQ-WINPOKE") \ + X(DP_SEQ_THE_GIRL , "DP-SEQ-THE-GIRL") \ + X(DP_SEQ_THE_BOY , "DP-SEQ-THE-BOY") \ + X(DP_SEQ_FANFA4 , "DP-SEQ-FANFA4") \ + X(DP_SEQ_TOWN02_D , "DP-SEQ-TOWN02-D") \ + X(DP_SEQ_TOWN02_N , "DP-SEQ-TOWN02-N") \ + X(DP_SEQ_KENKYUJO , "DP-SEQ-KENKYUJO") \ + X(DP_SEQ_TSURETEKE , "DP-SEQ-TSURETEKE") \ + X(DP_SEQ_PC_01 , "DP-SEQ-PC-01") \ + X(DP_SEQ_PC_02 , "DP-SEQ-PC-02") \ + X(DP_SEQ_ASA , "DP-SEQ-ASA") \ + X(DP_SEQ_EYE_BOY , "DP-SEQ-EYE-BOY") \ + X(DP_SEQ_EYE_GIRL , "DP-SEQ-EYE-GIRL") \ + X(DP_SEQ_BA_TRAIN , "DP-SEQ-BA-TRAIN") \ + X(DP_SEQ_WINTRAIN , "DP-SEQ-WINTRAIN") \ + X(DP_SEQ_CITY01_D , "DP-SEQ-CITY01-D") \ + X(DP_SEQ_CITY01_N , "DP-SEQ-CITY01-N") \ + X(DP_SEQ_FANFA3 , "DP-SEQ-FANFA3") \ + X(DP_SEQ_FS , "DP-SEQ-FS") \ + X(DP_SEQ_ROAD_B_D , "DP-SEQ-ROAD-B-D") \ + X(DP_SEQ_ROAD_B_N , "DP-SEQ-ROAD-B-N") \ + X(DP_SEQ_BA_RIVAL , "DP-SEQ-BA-RIVAL") \ + X(DP_SEQ_D_05 , "DP-SEQ-D-05") \ + X(DP_SEQ_WAZA , "DP-SEQ-WAZA") \ + X(DP_SEQ_CITY03_D , "DP-SEQ-CITY03-D") \ + X(DP_SEQ_CITY03_N , "DP-SEQ-CITY03-N") \ + X(DP_SEQ_D_04 , "DP-SEQ-D-04") \ + X(DP_SEQ_GYM , "DP-SEQ-GYM") \ + X(DP_SEQ_BA_GYM , "DP-SEQ-BA-GYM") \ + X(DP_SEQ_WINTGYM , "DP-SEQ-WINTGYM") \ + X(DP_SEQ_BADGE , "DP-SEQ-BADGE") \ + X(DP_SEQ_EYE_KID , "DP-SEQ-EYE-KID") \ + X(DP_SEQ_FANFA1 , "DP-SEQ-FANFA1") \ + X(DP_SEQ_TOWN03_D , "DP-SEQ-TOWN03-D") \ + X(DP_SEQ_TOWN03_N , "DP-SEQ-TOWN03-N") \ + X(DP_SEQ_KINOMI , "DP-SEQ-KINOMI") \ + X(DP_SEQ_ROAD_C_D , "DP-SEQ-ROAD-C-D") \ + X(DP_SEQ_ROAD_C_N , "DP-SEQ-ROAD-C-N") \ + X(DP_SEQ_EYE_GINGA , "DP-SEQ-EYE-GINGA") \ + X(DP_SEQ_BA_GINGA , "DP-SEQ-BA-GINGA") \ + X(DP_SEQ_D_02 , "DP-SEQ-D-02") \ + X(DP_SEQ_GONIN , "DP-SEQ-GONIN") \ + X(DP_SEQ_CITY04_D , "DP-SEQ-CITY04-D") \ + X(DP_SEQ_CITY04_N , "DP-SEQ-CITY04-N") \ + X(DP_SEQ_D_GINLOBBY , "DP-SEQ-D-GINLOBBY") \ + X(DP_SEQ_BA_GINGA3 , "DP-SEQ-BA-GINGA3") \ + X(DP_SEQ_WINGINGA , "DP-SEQ-WINGINGA") \ + X(DP_SEQ_SHINKA , "DP-SEQ-SHINKA") \ + X(DP_SEQ_FANFA5 , "DP-SEQ-FANFA5") \ + X(DP_SEQ_BICYCLE , "DP-SEQ-BICYCLE") \ + X(DP_SEQ_EYE_SPORT , "DP-SEQ-EYE-SPORT") \ + X(DP_SEQ_ROAD_D_D , "DP-SEQ-ROAD-D-D") \ + X(DP_SEQ_ROAD_D_N , "DP-SEQ-ROAD-D-N") \ + X(DP_SEQ_CITY05_D , "DP-SEQ-CITY05-D") \ + X(DP_SEQ_CITY05_N , "DP-SEQ-CITY05-N") \ + X(DP_SEQ_ROAD_E_D , "DP-SEQ-ROAD-E-D") \ + X(DP_SEQ_ROAD_E_N , "DP-SEQ-ROAD-E-N") \ + X(DP_SEQ_EYE_MOUNT , "DP-SEQ-EYE-MOUNT") \ + X(DP_SEQ_TOWN04_D , "DP-SEQ-TOWN04-D") \ + X(DP_SEQ_TOWN04_N , "DP-SEQ-TOWN04-N") \ + X(DP_SEQ_POCKETCH , "DP-SEQ-POCKETCH") \ + X(DP_SEQ_ROAD_F_D , "DP-SEQ-ROAD-F-D") \ + X(DP_SEQ_ROAD_F_N , "DP-SEQ-ROAD-F-N") \ + X(DP_SEQ_CITY07_D , "DP-SEQ-CITY07-D") \ + X(DP_SEQ_CITY07_N , "DP-SEQ-CITY07-N") \ + X(DP_SEQ_TOWN07_D , "DP-SEQ-TOWN07-D") \ + X(DP_SEQ_TOWN07_N , "DP-SEQ-TOWN07-N") \ + X(DP_SEQ_CITY02_D , "DP-SEQ-CITY02-D") \ + X(DP_SEQ_CITY02_N , "DP-SEQ-CITY02-N") \ + X(DP_SEQ_ROAD_SNOW_D , "DP-SEQ-ROAD-SNOW-D") \ + X(DP_SEQ_ROAD_SNOW_N , "DP-SEQ-ROAD-SNOW-N") \ + X(DP_SEQ_CITY09_D , "DP-SEQ-CITY09-D") \ + X(DP_SEQ_CITY09_N , "DP-SEQ-CITY09-N") \ + X(DP_SEQ_D_AGITO , "DP-SEQ-D-AGITO") \ + X(DP_SEQ_BA_AGAKI , "DP-SEQ-BA-AGAKI") \ + X(DP_SEQ_THE_EVENT04 , "DP-SEQ-THE-EVENT04") \ + X(DP_SEQ_D_MOUNT1 , "DP-SEQ-D-MOUNT1") \ + X(DP_SEQ_D_MOUNT2 , "DP-SEQ-D-MOUNT2") \ + X(DP_SEQ_THE_EVENT02 , "DP-SEQ-THE-EVENT02") \ + X(DP_SEQ_THE_EVENT03 , "DP-SEQ-THE-EVENT03") \ + X(DP_SEQ_BA_DPOKE2 , "DP-SEQ-BA-DPOKE2") \ + X(DP_SEQ_CITY08_D , "DP-SEQ-CITY08-D") \ + X(DP_SEQ_CITY08_N , "DP-SEQ-CITY08-N") \ + X(DP_SEQ_D_01 , "DP-SEQ-D-01") \ + X(DP_SEQ_EYE_ELITE , "DP-SEQ-EYE-ELITE") \ + X(DP_SEQ_CITY10_D , "DP-SEQ-CITY10-D") \ + X(DP_SEQ_CITY10_N , "DP-SEQ-CITY10-N") \ + X(DP_SEQ_CITY11_D , "DP-SEQ-CITY11-D") \ + X(DP_SEQ_CITY11_N , "DP-SEQ-CITY11-N") \ + X(DP_SEQ_TOWN06_D , "DP-SEQ-TOWN06-D") \ + X(DP_SEQ_TOWN06_N , "DP-SEQ-TOWN06-N") \ + X(DP_SEQ_ROAD_BZA_D , "DP-SEQ-ROAD-BZA-D") \ + X(DP_SEQ_ROAD_BZA_N , "DP-SEQ-ROAD-BZA-N") \ + X(DP_SEQ_WIFILOBBY , "DP-SEQ-WIFILOBBY") \ + X(DP_SEQ_BLD_TV , "DP-SEQ-BLD-TV") \ + X(DP_SEQ_BLD_BLD_GTC , "DP-SEQ-BLD-BLD-GTC") \ + X(DP_SEQ_NAMINORI , "DP-SEQ-NAMINORI") \ + X(DP_SEQ_WASURE , "DP-SEQ-WASURE") \ + X(DP_SEQ_EYE_FIGHT , "DP-SEQ-EYE-FIGHT") \ + X(DP_SEQ_EYE_ENKA , "DP-SEQ-EYE-ENKA") \ + X(DP_SEQ_TANKOU , "DP-SEQ-TANKOU") \ + X(DP_SEQ_HATANIGE , "DP-SEQ-HATANIGE") \ + X(DP_SEQ_EYE_LADY , "DP-SEQ-EYE-LADY") \ + X(DP_SEQ_D_03 , "DP-SEQ-D-03") \ + X(DP_SEQ_D_SAFARI , "DP-SEQ-D-SAFARI") \ + X(DP_SEQ_EYE_MYS , "DP-SEQ-EYE-MYS") \ + X(DP_SEQ_BLD_GAME , "DP-SEQ-BLD-GAME") \ + X(DP_SEQ_SLOT_ATARI , "DP-SEQ-SLOT-ATARI") \ + X(DP_SEQ_SLOT_OOATARI , "DP-SEQ-SLOT-OOATARI") \ + X(DP_SEQ_EYE_RICH , "DP-SEQ-EYE-RICH") \ + X(DP_SEQ_D_RYAYHY , "DP-SEQ-D-RYAYHY") \ + X(DP_SEQ_BA_DPOKE1 , "DP-SEQ-BA-DPOKE1") \ + X(DP_SEQ_KUSAGASA , "DP-SEQ-KUSAGASA") \ + X(DP_SEQ_EYE_FUN , "DP-SEQ-EYE-FUN") \ + X(DP_SEQ_D_KOUEN , "DP-SEQ-D-KOUEN") \ + X(DP_SEQ_ACCE , "DP-SEQ-ACCE") \ + X(DP_SEQ_BLD_CON , "DP-SEQ-BLD-CON") \ + X(DP_SEQ_KINOMI1 , "DP-SEQ-KINOMI1") \ + X(DP_SEQ_CON_TEST , "DP-SEQ-CON-TEST") \ + X(DP_SEQ_CO_DRESS , "DP-SEQ-CO-DRESS") \ + X(DP_SEQ_CO_KASHI , "DP-SEQ-CO-KASHI") \ + X(DP_SEQ_CO_TAKUMA , "DP-SEQ-CO-TAKUMA") \ + X(DP_SEQ_CO_KEKKA , "DP-SEQ-CO-KEKKA") \ + X(DP_SEQ_CO_FANFA , "DP-SEQ-CO-FANFA") \ + X(DP_SEQ_BF_TOWWER , "DP-SEQ-BF-TOWWER") \ + X(DP_SEQ_D_06 , "DP-SEQ-D-06") \ + X(DP_SEQ_BA_SECRET2 , "DP-SEQ-BA-SECRET2") \ + X(DP_SEQ_PRESENT , "DP-SEQ-PRESENT") \ + X(DP_SEQ_D_LEAGUE , "DP-SEQ-D-LEAGUE") \ + X(DP_SEQ_EYE_TENNO , "DP-SEQ-EYE-TENNO") \ + X(DP_SEQ_BA_TENNO , "DP-SEQ-BA-TENNO") \ + X(DP_SEQ_WINTENNO , "DP-SEQ-WINTENNO") \ + X(DP_SEQ_EYE_CHAMP , "DP-SEQ-EYE-CHAMP") \ + X(DP_SEQ_BA_CHANP , "DP-SEQ-BA-CHANP") \ + X(DP_SEQ_WINCHAMP , "DP-SEQ-WINCHAMP") \ + X(DP_SEQ_BLD_DENDO , "DP-SEQ-BLD-DENDO") \ + X(DP_SEQ_BLD_EV_DENDO2 , "DP-SEQ-BLD-EV-DENDO2") \ + X(DP_SEQ_BLD_ENDING , "DP-SEQ-BLD-ENDING") \ + X(DP_SEQ_FUE , "DP-SEQ-FUE") \ + X(DP_SEQ_AUS , "DP-SEQ-AUS") \ + X(DP_SEQ_BA_SECRET1 , "DP-SEQ-BA-SECRET1") \ + X(PL_SEQ_TITLE00 , "PL-SEQ-TITLE00") \ + X(PL_SEQ_TITLE01 , "PL-SEQ-TITLE01") \ + X(PL_SEQ_TV_HOUSOU , "PL-SEQ-TV-HOUSOU") \ + X(PL_SEQ_TV_END , "PL-SEQ-TV-END") \ + X(PL_SEQ_PL_HANDSOME , "PL-SEQ-PL-HANDSOME") \ + X(PL_SEQ_PL_WIFITOWER , "PL-SEQ-PL-WIFITOWER") \ + X(PL_SEQ_PL_WIFIUNION , "PL-SEQ-PL-WIFIUNION") \ + X(PL_SEQ_PL_WIFIGAME , "PL-SEQ-PL-WIFIGAME") \ + X(PL_SEQ_PL_WINMINI2 , "PL-SEQ-PL-WINMINI2") \ + X(PL_SEQ_PL_WIFIPARADE , "PL-SEQ-PL-WIFIPARADE") \ + X(PL_SEQ_PL_EV_GIRA , "PL-SEQ-PL-EV-GIRA") \ + X(PL_SEQ_PL_EV_GIRA2 , "PL-SEQ-PL-EV-GIRA2") \ + X(PL_SEQ_PL_D_GIRATINA , "PL-SEQ-PL-D-GIRATINA") \ + X(PL_SEQ_PL_BA_GIRA , "PL-SEQ-PL-BA-GIRA") \ + X(PL_SEQ_PL_GURUGURU , "PL-SEQ-PL-GURUGURU") \ + X(PL_SEQ_PL_PTHAIFU , "PL-SEQ-PL-PTHAIFU") \ + X(PL_SEQ_PL_MTKAWA , "PL-SEQ-PL-MTKAWA") \ + X(PL_SEQ_PL_MTKAKKO , "PL-SEQ-PL-MTKAKKO") \ + X(PL_SEQ_PL_MTTAKMA , "PL-SEQ-PL-MTTAKMA") \ + X(PL_SEQ_PL_MTUTSUK , "PL-SEQ-PL-MTUTSUK") \ + X(PL_SEQ_PL_MTKASHI , "PL-SEQ-PL-MTKASHI") \ + X(PL_SEQ_PL_TOWN02 , "PL-SEQ-PL-TOWN02") \ + X(PL_SEQ_PL_AUDIO , "PL-SEQ-PL-AUDIO") \ + X(PL_SEQ_CITY11_D , "PL-SEQ-CITY11-D") \ + X(PL_SEQ_PL_BF_ROULETTE , "PL-SEQ-PL-BF-ROULETTE") \ + X(PL_SEQ_PL_DON2 , "PL-SEQ-PL-DON2") \ + X(PL_SEQ_PL_BF_STAGE , "PL-SEQ-PL-BF-STAGE") \ + X(PL_SEQ_PL_BF_FACTORY , "PL-SEQ-PL-BF-FACTORY") \ + X(PL_SEQ_PL_BF_CASTLE , "PL-SEQ-PL-BF-CASTLE") \ + X(PL_SEQ_PL_FRO , "PL-SEQ-PL-FRO") \ + X(PL_SEQ_PL_POINTGET3 , "PL-SEQ-PL-POINTGET3") \ + X(PL_SEQ_PL_BA_BRAIN , "PL-SEQ-PL-BA-BRAIN") \ + X(PL_SEQ_PL_WINBRAIN , "PL-SEQ-PL-WINBRAIN") \ + X(PL_SEQ_PL_BA_REGI , "PL-SEQ-PL-BA-REGI") \ + X(PH_TRAP_BLEND, "PH-TRAP-BLEND") \ + X(PH_TRAP_HELD, "PH-TRAP-HELD") \ + X(PH_TRAP_SOLO, "PH-TRAP-SOLO") \ + X(PH_FACE_BLEND, "PH-FACE-BLEND") \ + X(PH_FACE_HELD, "PH-FACE-HELD") \ + X(PH_FACE_SOLO, "PH-FACE-SOLO") \ + X(PH_CLOTH_BLEND, "PH-CLOTH-BLEND") \ + X(PH_CLOTH_HELD, "PH-CLOTH-HELD") \ + X(PH_CLOTH_SOLO, "PH-CLOTH-SOLO") \ + X(PH_DRESS_BLEND, "PH-DRESS-BLEND") \ + X(PH_DRESS_HELD, "PH-DRESS-HELD") \ + X(PH_DRESS_SOLO, "PH-DRESS-SOLO") \ + X(PH_FLEECE_BLEND, "PH-FLEECE-BLEND") \ + X(PH_FLEECE_HELD, "PH-FLEECE-HELD") \ + X(PH_FLEECE_SOLO, "PH-FLEECE-SOLO") \ + X(PH_KIT_BLEND, "PH-KIT-BLEND") \ + X(PH_KIT_HELD, "PH-KIT-HELD") \ + X(PH_KIT_SOLO, "PH-KIT-SOLO") \ + X(PH_PRICE_BLEND, "PH-PRICE-BLEND") \ + X(PH_PRICE_HELD, "PH-PRICE-HELD") \ + X(PH_PRICE_SOLO, "PH-PRICE-SOLO") \ + X(PH_LOT_BLEND, "PH-LOT-BLEND") \ + X(PH_LOT_HELD, "PH-LOT-HELD") \ + X(PH_LOT_SOLO, "PH-LOT-SOLO") \ + X(PH_GOAT_BLEND, "PH-GOAT-BLEND") \ + X(PH_GOAT_HELD, "PH-GOAT-HELD") \ + X(PH_GOAT_SOLO, "PH-GOAT-SOLO") \ + X(PH_THOUGHT_BLEND, "PH-THOUGHT-BLEND") \ + X(PH_THOUGHT_HELD, "PH-THOUGHT-HELD") \ + X(PH_THOUGHT_SOLO, "PH-THOUGHT-SOLO") \ + X(PH_CHOICE_BLEND, "PH-CHOICE-BLEND") \ + X(PH_CHOICE_HELD, "PH-CHOICE-HELD") \ + X(PH_CHOICE_SOLO, "PH-CHOICE-SOLO") \ + X(PH_MOUTH_BLEND, "PH-MOUTH-BLEND") \ + X(PH_MOUTH_HELD, "PH-MOUTH-HELD") \ + X(PH_MOUTH_SOLO, "PH-MOUTH-SOLO") \ + X(PH_FOOT_BLEND, "PH-FOOT-BLEND") \ + X(PH_FOOT_HELD, "PH-FOOT-HELD") \ + X(PH_FOOT_SOLO, "PH-FOOT-SOLO") \ + X(PH_GOOSE_BLEND, "PH-GOOSE-BLEND") \ + X(PH_GOOSE_HELD, "PH-GOOSE-HELD") \ + X(PH_GOOSE_SOLO, "PH-GOOSE-SOLO") \ + X(PH_STRUT_BLEND, "PH-STRUT-BLEND") \ + X(PH_STRUT_HELD, "PH-STRUT-HELD") \ + X(PH_STRUT_SOLO, "PH-STRUT-SOLO") \ + X(PH_CURE_BLEND, "PH-CURE-BLEND") \ + X(PH_CURE_HELD, "PH-CURE-HELD") \ + X(PH_CURE_SOLO, "PH-CURE-SOLO") \ + X(PH_NURSE_BLEND, "PH-NURSE-BLEND") \ + X(PH_NURSE_HELD, "PH-NURSE-HELD") \ + X(PH_NURSE_SOLO, "PH-NURSE-SOLO") \ + +#define SOUND_LIST_SE \ + X(SE_USE_ITEM, "SE-USE-ITEM") \ + X(SE_PC_LOGIN, "SE-PC-LOGIN") \ + X(SE_PC_OFF, "SE-PC-OFF") \ + X(SE_PC_ON, "SE-PC-ON") \ + X(SE_SELECT, "SE-SELECT") \ + X(SE_WIN_OPEN, "SE-WIN-OPEN") \ + X(SE_WALL_HIT, "SE-WALL-HIT") \ + X(SE_DOOR, "SE-DOOR") \ + X(SE_EXIT, "SE-EXIT") \ + X(SE_LEDGE, "SE-LEDGE") \ + X(SE_BIKE_BELL, "SE-BIKE-BELL") \ + X(SE_NOT_EFFECTIVE, "SE-NOT-EFFECTIVE") \ + X(SE_EFFECTIVE, "SE-EFFECTIVE") \ + X(SE_SUPER_EFFECTIVE, "SE-SUPER-EFFECTIVE") \ + X(SE_BALL_OPEN, "SE-BALL-OPEN") \ + X(SE_FAINT, "SE-FAINT") \ + X(SE_FLEE, "SE-FLEE") \ + X(SE_SLIDING_DOOR, "SE-SLIDING-DOOR") \ + X(SE_SHIP, "SE-SHIP") \ + X(SE_BANG, "SE-BANG") \ + X(SE_PIN, "SE-PIN") \ + X(SE_BOO, "SE-BOO") \ + X(SE_BALL, "SE-BALL") \ + X(SE_CONTEST_PLACE, "SE-CONTEST-PLACE") \ + X(SE_A, "SE-A") \ + X(SE_I, "SE-I") \ + X(SE_U, "SE-U") \ + X(SE_E, "SE-E") \ + X(SE_O, "SE-O") \ + X(SE_N, "SE-N") \ + X(SE_SUCCESS, "SE-SUCCESS") \ + X(SE_FAILURE, "SE-FAILURE") \ + X(SE_EXP, "SE-EXP") \ + X(SE_BIKE_HOP, "SE-BIKE-HOP") \ + X(SE_SWITCH, "SE-SWITCH") \ + X(SE_CLICK, "SE-CLICK") \ + X(SE_FU_ZAKU, "SE-FU-ZAKU") \ + X(SE_CONTEST_CONDITION_LOSE, "SE-CONTEST-CONDITION-LOSE") \ + X(SE_LAVARIDGE_FALL_WARP, "SE-LAVARIDGE-FALL-WARP") \ + X(SE_ICE_STAIRS, "SE-ICE-STAIRS") \ + X(SE_ICE_BREAK, "SE-ICE-BREAK") \ + X(SE_ICE_CRACK, "SE-ICE-CRACK") \ + X(SE_FALL, "SE-FALL") \ + X(SE_UNLOCK, "SE-UNLOCK") \ + X(SE_WARP_IN, "SE-WARP-IN") \ + X(SE_WARP_OUT, "SE-WARP-OUT") \ + X(SE_REPEL, "SE-REPEL") \ + X(SE_ROTATING_GATE, "SE-ROTATING-GATE") \ + X(SE_TRUCK_MOVE, "SE-TRUCK-MOVE") \ + X(SE_TRUCK_STOP, "SE-TRUCK-STOP") \ + X(SE_TRUCK_UNLOAD, "SE-TRUCK-UNLOAD") \ + X(SE_TRUCK_DOOR, "SE-TRUCK-DOOR") \ + X(SE_BERRY_BLENDER, "SE-BERRY-BLENDER") \ + X(SE_CARD, "SE-CARD") \ + X(SE_SAVE, "SE-SAVE") \ + X(SE_BALL_BOUNCE_1, "SE-BALL-BOUNCE-1") \ + X(SE_BALL_BOUNCE_2, "SE-BALL-BOUNCE-2") \ + X(SE_BALL_BOUNCE_3, "SE-BALL-BOUNCE-3") \ + X(SE_BALL_BOUNCE_4, "SE-BALL-BOUNCE-4") \ + X(SE_BALL_TRADE, "SE-BALL-TRADE") \ + X(SE_BALL_THROW, "SE-BALL-THROW") \ + X(SE_NOTE_C, "SE-NOTE-C") \ + X(SE_NOTE_D, "SE-NOTE-D") \ + X(SE_NOTE_E, "SE-NOTE-E") \ + X(SE_NOTE_F, "SE-NOTE-F") \ + X(SE_NOTE_G, "SE-NOTE-G") \ + X(SE_NOTE_A, "SE-NOTE-A") \ + X(SE_NOTE_B, "SE-NOTE-B") \ + X(SE_NOTE_C_HIGH, "SE-NOTE-C-HIGH") \ + X(SE_PUDDLE, "SE-PUDDLE") \ + X(SE_BRIDGE_WALK, "SE-BRIDGE-WALK") \ + X(SE_ITEMFINDER, "SE-ITEMFINDER") \ + X(SE_DING_DONG, "SE-DING-DONG") \ + X(SE_BALLOON_RED, "SE-BALLOON-RED") \ + X(SE_BALLOON_BLUE, "SE-BALLOON-BLUE") \ + X(SE_BALLOON_YELLOW, "SE-BALLOON-YELLOW") \ + X(SE_BREAKABLE_DOOR, "SE-BREAKABLE-DOOR") \ + X(SE_MUD_BALL, "SE-MUD-BALL") \ + X(SE_FIELD_POISON, "SE-FIELD-POISON") \ + X(SE_ESCALATOR, "SE-ESCALATOR") \ + X(SE_THUNDERSTORM, "SE-THUNDERSTORM") \ + X(SE_THUNDERSTORM_STOP, "SE-THUNDERSTORM-STOP") \ + X(SE_DOWNPOUR, "SE-DOWNPOUR") \ + X(SE_DOWNPOUR_STOP, "SE-DOWNPOUR-STOP") \ + X(SE_RAIN, "SE-RAIN") \ + X(SE_RAIN_STOP, "SE-RAIN-STOP") \ + X(SE_THUNDER, "SE-THUNDER") \ + X(SE_THUNDER2, "SE-THUNDER2") \ + X(SE_ELEVATOR, "SE-ELEVATOR") \ + X(SE_LOW_HEALTH, "SE-LOW-HEALTH") \ + X(SE_EXP_MAX, "SE-EXP-MAX") \ + X(SE_ROULETTE_BALL, "SE-ROULETTE-BALL") \ + X(SE_ROULETTE_BALL2, "SE-ROULETTE-BALL2") \ + X(SE_TAILLOW_WING_FLAP, "SE-TAILLOW-WING-FLAP") \ + X(SE_SHOP, "SE-SHOP") \ + X(SE_CONTEST_HEART, "SE-CONTEST-HEART") \ + X(SE_CONTEST_CURTAIN_RISE, "SE-CONTEST-CURTAIN-RISE") \ + X(SE_CONTEST_CURTAIN_FALL, "SE-CONTEST-CURTAIN-FALL") \ + X(SE_CONTEST_ICON_CHANGE, "SE-CONTEST-ICON-CHANGE") \ + X(SE_CONTEST_ICON_CLEAR, "SE-CONTEST-ICON-CLEAR") \ + X(SE_CONTEST_MONS_TURN, "SE-CONTEST-MONS-TURN") \ + X(SE_SHINY, "SE-SHINY") \ + X(SE_INTRO_BLAST, "SE-INTRO-BLAST") \ + X(SE_MUGSHOT, "SE-MUGSHOT") \ + X(SE_APPLAUSE, "SE-APPLAUSE") \ + X(SE_VEND, "SE-VEND") \ + X(SE_ORB, "SE-ORB") \ + X(SE_DEX_SCROLL, "SE-DEX-SCROLL") \ + X(SE_DEX_PAGE, "SE-DEX-PAGE") \ + X(SE_POKENAV_ON, "SE-POKENAV-ON") \ + X(SE_POKENAV_OFF, "SE-POKENAV-OFF") \ + X(SE_DEX_SEARCH, "SE-DEX-SEARCH") \ + X(SE_EGG_HATCH, "SE-EGG-HATCH") \ + X(SE_BALL_TRAY_ENTER, "SE-BALL-TRAY-ENTER") \ + X(SE_BALL_TRAY_BALL, "SE-BALL-TRAY-BALL") \ + X(SE_BALL_TRAY_EXIT, "SE-BALL-TRAY-EXIT") \ + X(SE_GLASS_FLUTE, "SE-GLASS-FLUTE") \ + X(SE_M_THUNDERBOLT, "SE-M-THUNDERBOLT") \ + X(SE_M_THUNDERBOLT2, "SE-M-THUNDERBOLT2") \ + X(SE_M_HARDEN, "SE-M-HARDEN") \ + X(SE_M_NIGHTMARE, "SE-M-NIGHTMARE") \ + X(SE_M_VITAL_THROW, "SE-M-VITAL-THROW") \ + X(SE_M_VITAL_THROW2, "SE-M-VITAL-THROW2") \ + X(SE_M_BUBBLE, "SE-M-BUBBLE") \ + X(SE_M_BUBBLE2, "SE-M-BUBBLE2") \ + X(SE_M_BUBBLE3, "SE-M-BUBBLE3") \ + X(SE_M_RAIN_DANCE, "SE-M-RAIN-DANCE") \ + X(SE_M_CUT, "SE-M-CUT") \ + X(SE_M_STRING_SHOT, "SE-M-STRING-SHOT") \ + X(SE_M_STRING_SHOT2, "SE-M-STRING-SHOT2") \ + X(SE_M_ROCK_THROW, "SE-M-ROCK-THROW") \ + X(SE_M_GUST, "SE-M-GUST") \ + X(SE_M_GUST2, "SE-M-GUST2") \ + X(SE_M_DOUBLE_SLAP, "SE-M-DOUBLE-SLAP") \ + X(SE_M_DOUBLE_TEAM, "SE-M-DOUBLE-TEAM") \ + X(SE_M_RAZOR_WIND, "SE-M-RAZOR-WIND") \ + X(SE_M_ICY_WIND, "SE-M-ICY-WIND") \ + X(SE_M_THUNDER_WAVE, "SE-M-THUNDER-WAVE") \ + X(SE_M_COMET_PUNCH, "SE-M-COMET-PUNCH") \ + X(SE_M_MEGA_KICK, "SE-M-MEGA-KICK") \ + X(SE_M_MEGA_KICK2, "SE-M-MEGA-KICK2") \ + X(SE_M_CRABHAMMER, "SE-M-CRABHAMMER") \ + X(SE_M_JUMP_KICK, "SE-M-JUMP-KICK") \ + X(SE_M_FLAME_WHEEL, "SE-M-FLAME-WHEEL") \ + X(SE_M_FLAME_WHEEL2, "SE-M-FLAME-WHEEL2") \ + X(SE_M_FLAMETHROWER, "SE-M-FLAMETHROWER") \ + X(SE_M_FIRE_PUNCH, "SE-M-FIRE-PUNCH") \ + X(SE_M_TOXIC, "SE-M-TOXIC") \ + X(SE_M_SACRED_FIRE, "SE-M-SACRED-FIRE") \ + X(SE_M_SACRED_FIRE2, "SE-M-SACRED-FIRE2") \ + X(SE_M_EMBER, "SE-M-EMBER") \ + X(SE_M_TAKE_DOWN, "SE-M-TAKE-DOWN") \ + X(SE_M_BLIZZARD, "SE-M-BLIZZARD") \ + X(SE_M_BLIZZARD2, "SE-M-BLIZZARD2") \ + X(SE_M_SCRATCH, "SE-M-SCRATCH") \ + X(SE_M_VICEGRIP, "SE-M-VICEGRIP") \ + X(SE_M_WING_ATTACK, "SE-M-WING-ATTACK") \ + X(SE_M_FLY, "SE-M-FLY") \ + X(SE_M_SAND_ATTACK, "SE-M-SAND-ATTACK") \ + X(SE_M_RAZOR_WIND2, "SE-M-RAZOR-WIND2") \ + X(SE_M_BITE, "SE-M-BITE") \ + X(SE_M_HEADBUTT, "SE-M-HEADBUTT") \ + X(SE_M_SURF, "SE-M-SURF") \ + X(SE_M_HYDRO_PUMP, "SE-M-HYDRO-PUMP") \ + X(SE_M_WHIRLPOOL, "SE-M-WHIRLPOOL") \ + X(SE_M_HORN_ATTACK, "SE-M-HORN-ATTACK") \ + X(SE_M_TAIL_WHIP, "SE-M-TAIL-WHIP") \ + X(SE_M_MIST, "SE-M-MIST") \ + X(SE_M_POISON_POWDER, "SE-M-POISON-POWDER") \ + X(SE_M_BIND, "SE-M-BIND") \ + X(SE_M_DRAGON_RAGE, "SE-M-DRAGON-RAGE") \ + X(SE_M_SING, "SE-M-SING") \ + X(SE_M_PERISH_SONG, "SE-M-PERISH-SONG") \ + X(SE_M_PAY_DAY, "SE-M-PAY-DAY") \ + X(SE_M_DIG, "SE-M-DIG") \ + X(SE_M_DIZZY_PUNCH, "SE-M-DIZZY-PUNCH") \ + X(SE_M_SELF_DESTRUCT, "SE-M-SELF-DESTRUCT") \ + X(SE_M_EXPLOSION, "SE-M-EXPLOSION") \ + X(SE_M_ABSORB_2, "SE-M-ABSORB-2") \ + X(SE_M_ABSORB, "SE-M-ABSORB") \ + X(SE_M_SCREECH, "SE-M-SCREECH") \ + X(SE_M_BUBBLE_BEAM, "SE-M-BUBBLE-BEAM") \ + X(SE_M_BUBBLE_BEAM2, "SE-M-BUBBLE-BEAM2") \ + X(SE_M_SUPERSONIC, "SE-M-SUPERSONIC") \ + X(SE_M_BELLY_DRUM, "SE-M-BELLY-DRUM") \ + X(SE_M_METRONOME, "SE-M-METRONOME") \ + X(SE_M_BONEMERANG, "SE-M-BONEMERANG") \ + X(SE_M_LICK, "SE-M-LICK") \ + X(SE_M_PSYBEAM, "SE-M-PSYBEAM") \ + X(SE_M_FAINT_ATTACK, "SE-M-FAINT-ATTACK") \ + X(SE_M_SWORDS_DANCE, "SE-M-SWORDS-DANCE") \ + X(SE_M_LEER, "SE-M-LEER") \ + X(SE_M_SWAGGER, "SE-M-SWAGGER") \ + X(SE_M_SWAGGER2, "SE-M-SWAGGER2") \ + X(SE_M_HEAL_BELL, "SE-M-HEAL-BELL") \ + X(SE_M_CONFUSE_RAY, "SE-M-CONFUSE-RAY") \ + X(SE_M_SNORE, "SE-M-SNORE") \ + X(SE_M_BRICK_BREAK, "SE-M-BRICK-BREAK") \ + X(SE_M_GIGA_DRAIN, "SE-M-GIGA-DRAIN") \ + X(SE_M_PSYBEAM2, "SE-M-PSYBEAM2") \ + X(SE_M_SOLAR_BEAM, "SE-M-SOLAR-BEAM") \ + X(SE_M_PETAL_DANCE, "SE-M-PETAL-DANCE") \ + X(SE_M_TELEPORT, "SE-M-TELEPORT") \ + X(SE_M_MINIMIZE, "SE-M-MINIMIZE") \ + X(SE_M_SKETCH, "SE-M-SKETCH") \ + X(SE_M_SWIFT, "SE-M-SWIFT") \ + X(SE_M_REFLECT, "SE-M-REFLECT") \ + X(SE_M_BARRIER, "SE-M-BARRIER") \ + X(SE_M_DETECT, "SE-M-DETECT") \ + X(SE_M_LOCK_ON, "SE-M-LOCK-ON") \ + X(SE_M_MOONLIGHT, "SE-M-MOONLIGHT") \ + X(SE_M_CHARM, "SE-M-CHARM") \ + X(SE_M_CHARGE, "SE-M-CHARGE") \ + X(SE_M_STRENGTH, "SE-M-STRENGTH") \ + X(SE_M_HYPER_BEAM, "SE-M-HYPER-BEAM") \ + X(SE_M_WATERFALL, "SE-M-WATERFALL") \ + X(SE_M_REVERSAL, "SE-M-REVERSAL") \ + X(SE_M_ACID_ARMOR, "SE-M-ACID-ARMOR") \ + X(SE_M_SANDSTORM, "SE-M-SANDSTORM") \ + X(SE_M_TRI_ATTACK, "SE-M-TRI-ATTACK") \ + X(SE_M_TRI_ATTACK2, "SE-M-TRI-ATTACK2") \ + X(SE_M_ENCORE, "SE-M-ENCORE") \ + X(SE_M_ENCORE2, "SE-M-ENCORE2") \ + X(SE_M_BATON_PASS, "SE-M-BATON-PASS") \ + X(SE_M_MILK_DRINK, "SE-M-MILK-DRINK") \ + X(SE_M_ATTRACT, "SE-M-ATTRACT") \ + X(SE_M_ATTRACT2, "SE-M-ATTRACT2") \ + X(SE_M_MORNING_SUN, "SE-M-MORNING-SUN") \ + X(SE_M_FLATTER, "SE-M-FLATTER") \ + X(SE_M_SAND_TOMB, "SE-M-SAND-TOMB") \ + X(SE_M_GRASSWHISTLE, "SE-M-GRASSWHISTLE") \ + X(SE_M_SPIT_UP, "SE-M-SPIT-UP") \ + X(SE_M_DIVE, "SE-M-DIVE") \ + X(SE_M_EARTHQUAKE, "SE-M-EARTHQUAKE") \ + X(SE_M_TWISTER, "SE-M-TWISTER") \ + X(SE_M_SWEET_SCENT, "SE-M-SWEET-SCENT") \ + X(SE_M_YAWN, "SE-M-YAWN") \ + X(SE_M_SKY_UPPERCUT, "SE-M-SKY-UPPERCUT") \ + X(SE_M_STAT_INCREASE, "SE-M-STAT-INCREASE") \ + X(SE_M_HEAT_WAVE, "SE-M-HEAT-WAVE") \ + X(SE_M_UPROAR, "SE-M-UPROAR") \ + X(SE_M_HAIL, "SE-M-HAIL") \ + X(SE_M_COSMIC_POWER, "SE-M-COSMIC-POWER") \ + X(SE_M_TEETER_DANCE, "SE-M-TEETER-DANCE") \ + X(SE_M_STAT_DECREASE, "SE-M-STAT-DECREASE") \ + X(SE_M_HAZE, "SE-M-HAZE") \ + X(SE_M_HYPER_BEAM2, "SE-M-HYPER-BEAM2") \ + X(SE_RG_DOOR, "SE-RG-DOOR") \ + X(SE_RG_CARD_FLIP, "SE-RG-CARD-FLIP") \ + X(SE_RG_CARD_FLIPPING, "SE-RG-CARD-FLIPPING") \ + X(SE_RG_CARD_OPEN, "SE-RG-CARD-OPEN") \ + X(SE_RG_BAG_CURSOR, "SE-RG-BAG-CURSOR") \ + X(SE_RG_BAG_POCKET, "SE-RG-BAG-POCKET") \ + X(SE_RG_BALL_CLICK, "SE-RG-BALL-CLICK") \ + X(SE_RG_SHOP, "SE-RG-SHOP") \ + X(SE_RG_SS_ANNE_HORN, "SE-RG-SS-ANNE-HORN") \ + X(SE_RG_HELP_OPEN, "SE-RG-HELP-OPEN") \ + X(SE_RG_HELP_CLOSE, "SE-RG-HELP-CLOSE") \ + X(SE_RG_HELP_ERROR, "SE-RG-HELP-ERROR") \ + X(SE_RG_DEOXYS_MOVE, "SE-RG-DEOXYS-MOVE") \ + X(SE_RG_POKE_JUMP_SUCCESS, "SE-RG-POKE-JUMP-SUCCESS") \ + X(SE_RG_POKE_JUMP_FAILURE, "SE-RG-POKE-JUMP-FAILURE") \ + X(SE_PHONE_CALL, "SE-PHONE-CALL") \ + X(SE_PHONE_CLICK, "SE-PHONE-CLICK") \ + X(SE_ARENA_TIMEUP1, "SE-ARENA-TIMEUP1") \ + X(SE_ARENA_TIMEUP2, "SE-ARENA-TIMEUP2") \ + X(SE_PIKE_CURTAIN_CLOSE, "SE-PIKE-CURTAIN-CLOSE") \ + X(SE_PIKE_CURTAIN_OPEN, "SE-PIKE-CURTAIN-OPEN") \ + X(SE_SUDOWOODO_SHAKE, "SE-SUDOWOODO-SHAKE") \ + +// Create BGM list +#define X(songId, name) static const u8 sBGMName_##songId[] = _(name); +SOUND_LIST_BGM +#undef X + +#define X(songId, name) sBGMName_##songId, +static const u8 *const gBGMNames[] = +{ +SOUND_LIST_BGM +}; +#undef X + +// Create SE list +#define X(songId, name) static const u8 sSEName_##songId[] = _(name); +SOUND_LIST_SE +#undef X + +#define X(songId, name) sSEName_##songId, +static const u8 *const gSENames[] = +{ +SOUND_LIST_SE +}; +#undef X + + // Additional functions /* static void DebugAction_OpenSubMenu(u8 taskId, struct ListMenuTemplate LMtemplate) From 010c1b5d824cf03d7a6410886388522be36f1b7d Mon Sep 17 00:00:00 2001 From: TheXaman Date: Tue, 22 Jun 2021 18:29:04 +0200 Subject: [PATCH 023/155] fixed some songs not properly stopping and overlapping others, thanks to @Lunos for reporting --- src/debug.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/debug.c b/src/debug.c index 49bef794f7..abed662460 100644 --- a/src/debug.c +++ b/src/debug.c @@ -22,6 +22,7 @@ #include "item.h" #include "item_icon.h" #include "list_menu.h" +#include "m4a.h" #include "main.h" #include "main_menu.h" #include "malloc.h" @@ -2720,8 +2721,9 @@ static void DebugAction_Sound_SE(u8 taskId) gTasks[taskId].func = DebugAction_Sound_SE_SelectId; gTasks[taskId].data[2] = windowId; - gTasks[taskId].data[3] = 1; //Current ID - gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[3] = 1; //Current ID + gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[5] = gTasks[taskId].data[3]; //Last song played (for stopping) } static void DebugAction_Sound_SE_SelectId(u8 taskId) { @@ -2761,12 +2763,14 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId) if (gMain.newKeys & A_BUTTON) { - PlaySE(gTasks[taskId].data[3]); + m4aSongNumStop(gTasks[taskId].data[5]); + gTasks[taskId].data[5] = gTasks[taskId].data[3]; + m4aSongNumStart(gTasks[taskId].data[3]); } else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); - MapMusicMain(); + m4aSongNumStop(gTasks[taskId].data[5]); DebugAction_DestroyExtraWindow(taskId); } } @@ -2796,8 +2800,9 @@ static void DebugAction_Sound_MUS(u8 taskId) gTasks[taskId].func = DebugAction_Sound_MUS_SelectId; gTasks[taskId].data[2] = windowId; - gTasks[taskId].data[3] = START_MUS; //Current ID - gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[3] = START_MUS; //Current ID + gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[5] = gTasks[taskId].data[3]; //Last song played (for stopping) } static void DebugAction_Sound_MUS_SelectId(u8 taskId) { @@ -2837,13 +2842,14 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) if (gMain.newKeys & A_BUTTON) { - StopMapMusic(); - PlayNewMapMusic(gTasks[taskId].data[3]); + m4aSongNumStop(gTasks[taskId].data[5]); + gTasks[taskId].data[5] = gTasks[taskId].data[3]; + m4aSongNumStart(gTasks[taskId].data[3]); } else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); - MapMusicMain(); + // m4aSongNumStop(gTasks[taskId].data[5]); //Uncomment if music should stop after leaving menu DebugAction_DestroyExtraWindow(taskId); } } From 45012a66d74e8c475e08b04054ed26517c4ab8eb Mon Sep 17 00:00:00 2001 From: TheXaman Date: Tue, 22 Jun 2021 19:04:39 +0200 Subject: [PATCH 024/155] fixes PlaySE overwriting some "music tracks" like MUS_MOVE_DELETED --- src/debug.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/debug.c b/src/debug.c index abed662460..7fbeec4d84 100644 --- a/src/debug.c +++ b/src/debug.c @@ -2729,8 +2729,6 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId) { if (gMain.newKeys & DPAD_ANY) { - PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; @@ -2808,8 +2806,6 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) { if (gMain.newKeys & DPAD_ANY) { - PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; From a663742ebaefe364bd3b909ef27c2e82fff41423 Mon Sep 17 00:00:00 2001 From: TheXaman Date: Wed, 30 Jun 2021 10:44:09 +0200 Subject: [PATCH 025/155] fixed a bug not showing hidden abilities (POKEMON_EXPANSION) if the second ability was ABILITY_NONE, thanks to Syreldar --- src/debug.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/debug.c b/src/debug.c index 7fbeec4d84..8cb5ddbaca 100644 --- a/src/debug.c +++ b/src/debug.c @@ -2185,13 +2185,12 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) { u8 abilityId; - u8 abilityCount = 0; - if (gBaseStats[sDebugMonData->mon_speciesId].abilities[1] != ABILITY_NONE) - abilityCount++; + u8 abilityCount = 2 - 1; //-1 for proper iteration + u8 i = 0; #ifdef POKEMON_EXPANSION - if (gBaseStats[sDebugMonData->mon_speciesId].abilities[2] != ABILITY_NONE) - abilityCount++; + abilityCount = NUM_ABILITY_SLOTS - 1; #endif + if (gMain.newKeys & DPAD_ANY) { PlaySE(SE_SELECT); @@ -2209,7 +2208,11 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) gTasks[taskId].data[3] = 0; } - abilityId = GetAbilityBySpecies(sDebugMonData->mon_speciesId, gTasks[taskId].data[3]); + while (GetAbilityBySpecies(sDebugMonData->mon_speciesId, gTasks[taskId].data[3] - i) == ABILITY_NONE) + { + i++; + } + abilityId = GetAbilityBySpecies(sDebugMonData->mon_speciesId, gTasks[taskId].data[3] - i); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); @@ -2220,7 +2223,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) if (gMain.newKeys & A_BUTTON) { - sDebugMonData->mon_abilityNum = gTasks[taskId].data[3]; //AbilityNum + sDebugMonData->mon_abilityNum = gTasks[taskId].data[3] - i; //AbilityNum gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; From af355fcb1211b0fb3eebdd852e04aacf361f5d3c Mon Sep 17 00:00:00 2001 From: TheXaman Date: Fri, 2 Jul 2021 11:49:32 +0200 Subject: [PATCH 026/155] added Debug to StartMenu via DEBUG_MENU option --- include/debug.h | 2 ++ src/field_control_avatar.c | 6 ++-- src/start_menu.c | 69 +++++++++++++++++++++++++++++++++++--- 3 files changed, 69 insertions(+), 8 deletions(-) diff --git a/include/debug.h b/include/debug.h index 4c9c3fffcb..864176e4f3 100644 --- a/include/debug.h +++ b/include/debug.h @@ -5,4 +5,6 @@ void Debug_ShowMainMenu(void); #endif +#define DEBUG_MENU FALSE + #endif // GUARD_DEBUG_H \ No newline at end of file diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index fa607cd42e..916287b0b7 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -132,7 +132,7 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) else if (heldKeys & DPAD_RIGHT) input->dpadDirection = DIR_EAST; - +#if DEBUGGING && !DEBUG_MENU //DEBUG if (heldKeys & R_BUTTON) { @@ -158,7 +158,7 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) input->pressedStartButton = FALSE; } } - // +#endif } @@ -219,7 +219,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE) return TRUE; -#if DEBUGGING +#if DEBUGGING && !DEBUG_MENU if (input->input_field_1_2) { PlaySE(SE_WIN_OPEN); diff --git a/src/start_menu.c b/src/start_menu.c index fa51766e8e..b765761513 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -3,6 +3,7 @@ #include "battle_pyramid.h" #include "battle_pyramid_bag.h" #include "bg.h" +#include "debug.h" #include "event_data.h" #include "event_object_movement.h" #include "event_object_lock.h" @@ -61,7 +62,8 @@ enum MENU_ACTION_PLAYER_LINK, MENU_ACTION_REST_FRONTIER, MENU_ACTION_RETIRE_FRONTIER, - MENU_ACTION_PYRAMID_BAG + MENU_ACTION_PYRAMID_BAG, + MENU_ACTION_DEBUG, }; // Save status @@ -102,6 +104,7 @@ static bool8 StartMenuSafariZoneRetireCallback(void); static bool8 StartMenuLinkModePlayerNameCallback(void); static bool8 StartMenuBattlePyramidRetireCallback(void); static bool8 StartMenuBattlePyramidBagCallback(void); +static bool8 StartMenuDebugCallback(void); // Menu callbacks static bool8 SaveStartCallback(void); @@ -153,6 +156,8 @@ static const u8* const sPyramindFloorNames[] = static const struct WindowTemplate sPyramidFloorWindowTemplate_2 = {0, 1, 1, 0xA, 4, 0xF, 8}; static const struct WindowTemplate sPyramidFloorWindowTemplate_1 = {0, 1, 1, 0xC, 4, 0xF, 8}; +static const u8 gText_MenuDebug[] = _("DEBUG"); + static const struct MenuAction sStartMenuItems[] = { {gText_MenuPokedex, {.u8_void = StartMenuPokedexCallback}}, @@ -167,7 +172,8 @@ static const struct MenuAction sStartMenuItems[] = {gText_MenuPlayer, {.u8_void = StartMenuLinkModePlayerNameCallback}}, {gText_MenuRest, {.u8_void = StartMenuSaveCallback}}, {gText_MenuRetire, {.u8_void = StartMenuBattlePyramidRetireCallback}}, - {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}} + {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}}, + {gText_MenuDebug, {.u8_void = StartMenuDebugCallback}}, }; static const struct BgTemplate sUnknown_085105A8[] = @@ -195,6 +201,7 @@ static const struct WindowTemplate sSaveInfoWindowTemplate = {0, 1, 1, 0xE, 0xA, static void BuildStartMenuActions(void); static void AddStartMenuAction(u8 action); static void BuildNormalStartMenu(void); +static void BuildDebugStartMenu(void); static void BuildSafariZoneStartMenu(void); static void BuildLinkModeStartMenu(void); static void BuildUnionRoomStartMenu(void); @@ -223,6 +230,7 @@ static void CB2_SaveAfterLinkBattle(void); static void ShowSaveInfoWindow(void); static void RemoveSaveInfoWindow(void); static void HideStartMenuWindow(void); +static void HideStartMenuDebug(void); void SetDexPokemonPokenavFlags(void) // unused { @@ -259,10 +267,17 @@ static void BuildStartMenuActions(void) { BuildMultiPartnerRoomStartMenu(); } + #if DEBUGGING && DEBUG_MENU + else + { + BuildDebugStartMenu(); + } + #else else - { - BuildNormalStartMenu(); - } + { + BuildNormalStartMenu(); + } + #endif } static void AddStartMenuAction(u8 action) @@ -294,6 +309,30 @@ static void BuildNormalStartMenu(void) AddStartMenuAction(MENU_ACTION_EXIT); } +static void BuildDebugStartMenu(void) +{ + if (FlagGet(FLAG_SYS_POKEDEX_GET) == TRUE) + { + AddStartMenuAction(MENU_ACTION_POKEDEX); + } + if (FlagGet(FLAG_SYS_POKEMON_GET) == TRUE) + { + AddStartMenuAction(MENU_ACTION_POKEMON); + } + + AddStartMenuAction(MENU_ACTION_BAG); + + if (FlagGet(FLAG_SYS_POKENAV_GET) == TRUE) + { + AddStartMenuAction(MENU_ACTION_POKENAV); + } + + AddStartMenuAction(MENU_ACTION_PLAYER); + AddStartMenuAction(MENU_ACTION_SAVE); + AddStartMenuAction(MENU_ACTION_OPTION); + AddStartMenuAction(MENU_ACTION_DEBUG); +} + static void BuildSafariZoneStartMenu(void) { AddStartMenuAction(MENU_ACTION_RETIRE_SAFARI); @@ -575,6 +614,7 @@ static bool8 HandleStartMenuInput(void) if (gMenuCallback != StartMenuSaveCallback && gMenuCallback != StartMenuExitCallback + && gMenuCallback != StartMenuDebugCallback && gMenuCallback != StartMenuSafariZoneRetireCallback && gMenuCallback != StartMenuBattlePyramidRetireCallback) { @@ -710,6 +750,18 @@ static bool8 StartMenuExitCallback(void) return TRUE; } +static bool8 StartMenuDebugCallback(void) +{ + RemoveExtraStartMenuWindows(); + HideStartMenuDebug(); // Hide start menu without enabling movement + + #if DEBUGGING + Debug_ShowMainMenu(); + #endif + + return TRUE; +} + static bool8 StartMenuSafariZoneRetireCallback(void) { RemoveExtraStartMenuWindows(); @@ -719,6 +771,13 @@ static bool8 StartMenuSafariZoneRetireCallback(void) return TRUE; } +static void HideStartMenuDebug(void) +{ + PlaySE(SE_SELECT); + ClearStdWindowAndFrame(GetStartMenuWindowId(), TRUE); + RemoveStartMenuWindow(); +} + static bool8 StartMenuLinkModePlayerNameCallback(void) { if (!gPaletteFade.active) From 5104293344cb469379dae051eb92d007f6fc7c5d Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Thu, 18 Nov 2021 15:09:06 +0100 Subject: [PATCH 027/155] Changed to TX_DEBUGGING define instead of makefile DEBUGGING option --- Makefile | 54 +++++++++------------------- include/debug.h | 9 ++--- src/debug.c | 3 -- src/event_object_movement.c | 8 ++--- src/field_control_avatar.c | 71 ++++++++++++++++++++----------------- src/start_menu.c | 14 +++++--- src/trainer_see.c | 8 ++--- 7 files changed, 76 insertions(+), 91 deletions(-) diff --git a/Makefile b/Makefile index 7ea5bdb926..ca282d07e6 100644 --- a/Makefile +++ b/Makefile @@ -63,13 +63,13 @@ ASFLAGS := -mcpu=arm7tdmi --defsym MODERN=$(MODERN) ifeq ($(MODERN),0) CC1 := tools/agbcc/bin/agbcc$(EXE) -override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm -g +override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm ROM := pokeemerald.gba OBJ_DIR := build/emerald LIBPATH := -L ../../tools/agbcc/lib else CC1 = $(shell $(CC) --print-prog-name=cc1) -quiet -override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -g +override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mcpu=arm7tdmi -fno-toplevel-reorder -Wno-pointer-to-int-cast ROM := pokeemerald_modern.gba OBJ_DIR := build/modern LIBPATH := -L "$(dir $(shell $(CC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(CC) -mthumb -print-file-name=libc.a))" @@ -111,13 +111,13 @@ MAKEFLAGS += --no-print-directory # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) berry_fix libagbsyscall modern debugging debugging_modern +.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) berry_fix libagbsyscall modern infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) # Build tools when building the rom # Disable dependency scanning for clean/tidy/tools -ifeq (,$(filter-out all rom compare modern debugging debugging_modern berry_fix libagbsyscall,$(MAKECMDGOALS))) +ifeq (,$(filter-out all rom compare modern berry_fix libagbsyscall,$(MAKECMDGOALS))) $(call infoshell, $(MAKE) tools) else NODEP := 1 @@ -136,9 +136,6 @@ C_ASM_OBJS := $(patsubst $(C_SUBDIR)/%.s,$(C_BUILDDIR)/%.o,$(C_ASM_SRCS)) ASM_SRCS := $(wildcard $(ASM_SUBDIR)/*.s) ASM_OBJS := $(patsubst $(ASM_SUBDIR)/%.s,$(ASM_BUILDDIR)/%.o,$(ASM_SRCS)) -# get all the data/*.s files EXCEPT the ones with specific rules -REGULAR_DATA_ASM_SRCS := $(filter-out $(DATA_ASM_SUBDIR)/maps.s $(DATA_ASM_SUBDIR)/map_events.s, $(wildcard $(DATA_ASM_SUBDIR)/*.s)) - DATA_ASM_SRCS := $(wildcard $(DATA_ASM_SUBDIR)/*.s) DATA_ASM_OBJS := $(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o,$(DATA_ASM_SRCS)) @@ -181,7 +178,7 @@ mostlyclean: tidy rm -f $(SAMPLE_SUBDIR)/*.bin rm -f $(CRY_SUBDIR)/*.bin rm -f $(MID_SUBDIR)/*.s - find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + + find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + rm -f $(DATA_ASM_SUBDIR)/layouts/layouts.inc $(DATA_ASM_SUBDIR)/layouts/layouts_table.inc rm -f $(DATA_ASM_SUBDIR)/maps/connections.inc $(DATA_ASM_SUBDIR)/maps/events.inc $(DATA_ASM_SUBDIR)/maps/groups.inc $(DATA_ASM_SUBDIR)/maps/headers.inc find $(DATA_ASM_SUBDIR)/maps \( -iname 'connections.inc' -o -iname 'events.inc' -o -iname 'header.inc' \) -exec rm {} + @@ -251,12 +248,6 @@ ifeq ($(DINFO),1) override CFLAGS += -g endif -# Debug menu -ifeq ($(DDEBUGGING),1) -override ASFLAGS += --defsym DEBUGGING=1 -override CPPFLAGS += -D DEBUGGING=1 -endif - $(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep) @$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i @$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s @@ -284,33 +275,24 @@ endif $(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.s $$(c_asm_dep) $(AS) $(ASFLAGS) -o $@ $< -# The dep rules have to be explicit or else missing files won't be reported. -# As a side effect, they're evaluated immediately instead of when the rule is invoked. -# It doesn't look like $(shell) can be deferred so there might not be a better way. - - ifeq ($(NODEP),1) -$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s +$(ASM_BUILDDIR)/%.o: asm_dep := +else +$(ASM_BUILDDIR)/%.o: asm_dep = $(shell $(SCANINC) -I "" $(ASM_SUBDIR)/$*.s) +endif + +$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s $$(asm_dep) $(AS) $(ASFLAGS) -o $@ $< -else -define ASM_DEP -$1: $2 $$(shell $(SCANINC) -I include -I "" $2) - $$(AS) $$(ASFLAGS) -o $$@ $$< -endef -$(foreach src, $(ASM_SRCS), $(eval $(call ASM_DEP,$(patsubst $(ASM_SUBDIR)/%.s,$(ASM_BUILDDIR)/%.o, $(src)),$(src)))) -endif ifeq ($(NODEP),1) -$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s - $(PREPROC) $< charmap.txt | $(CPP) -I include | $(AS) $(ASFLAGS) -o $@ +$(DATA_ASM_BUILDDIR)/%.o: data_dep := else -define DATA_ASM_DEP -$1: $2 $$(shell $(SCANINC) -I include -I "" $2) - $$(PREPROC) $$< charmap.txt | $$(CPP) -I include | $$(AS) $$(ASFLAGS) -o $$@ -endef -$(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call DATA_ASM_DEP,$(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o, $(src)),$(src)))) +$(DATA_ASM_BUILDDIR)/%.o: data_dep = $(shell $(SCANINC) -I include -I "" $(DATA_ASM_SUBDIR)/$*.s) endif +$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep) + $(PREPROC) $< charmap.txt | $(CPP) -I include | $(AS) $(ASFLAGS) -o $@ + $(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s $(AS) $(ASFLAGS) -I sound -o $@ $< @@ -351,7 +333,3 @@ berry_fix: libagbsyscall: @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) - -# Debug menu -debugging: ; @$(MAKE) DDEBUGGING=1 DINFO=1 -debugging_modern: ; @$(MAKE) MODERN=1 DDEBUGGING=1 DINFO=1 diff --git a/include/debug.h b/include/debug.h index 864176e4f3..1014690a5a 100644 --- a/include/debug.h +++ b/include/debug.h @@ -1,10 +1,11 @@ #ifndef GUARD_DEBUG_H #define GUARD_DEBUG_H -#if DEBUGGING -void Debug_ShowMainMenu(void); -#endif +#define TX_DEBUGGING +#define TX_DEBUG_MENU_OPTION FALSE + + +void Debug_ShowMainMenu(void); -#define DEBUG_MENU FALSE #endif // GUARD_DEBUG_H \ No newline at end of file diff --git a/src/debug.c b/src/debug.c index 8cb5ddbaca..ae3ff02e0b 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1,4 +1,3 @@ -#if DEBUGGING //CREDITS //TheXaman: https://github.com/TheXaman/pokeemerald/tree/tx_debug_system //CODE USED FROM: @@ -3626,5 +3625,3 @@ static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)) } */ - -#endif diff --git a/src/event_object_movement.c b/src/event_object_movement.c index de17be1254..44686fefe7 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4724,10 +4724,10 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) { u8 direction = dir; -#if DEBUGGING //DEBUG - if (FlagGet(FLAG_SYS_NO_COLLISION)) - return COLLISION_NONE; -#endif // + #ifdef TX_DEBUGGING //DEBUG + if (FlagGet(FLAG_SYS_NO_COLLISION)) + return COLLISION_NONE; + #endif // if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y)) return COLLISION_OUTSIDE_RANGE; diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 916287b0b7..3089c13671 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -132,34 +132,36 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) else if (heldKeys & DPAD_RIGHT) input->dpadDirection = DIR_EAST; -#if DEBUGGING && !DEBUG_MENU //DEBUG - if (heldKeys & R_BUTTON) - { - if(input->pressedSelectButton) + #ifdef TX_DEBUGGING + if (!TX_DEBUG_MENU_OPTION) { - input->input_field_1_0 = TRUE; - input->pressedSelectButton = FALSE; - }else if(input->pressedStartButton) - { - input->input_field_1_2 = TRUE; - input->pressedStartButton = FALSE; + if (heldKeys & R_BUTTON) + { + if(input->pressedSelectButton) + { + input->input_field_1_0 = TRUE; + input->pressedSelectButton = FALSE; + }else if(input->pressedStartButton) + { + input->input_field_1_2 = TRUE; + input->pressedStartButton = FALSE; + } + } + if (heldKeys & L_BUTTON) + { + if(input->pressedSelectButton) + { + input->input_field_1_1 = TRUE; + input->pressedSelectButton = FALSE; + }else if(input->pressedStartButton) + { + input->input_field_1_3 = TRUE; + input->pressedStartButton = FALSE; + } + } } - } - if (heldKeys & L_BUTTON) - { - if(input->pressedSelectButton) - { - input->input_field_1_1 = TRUE; - input->pressedSelectButton = FALSE; - }else if(input->pressedStartButton) - { - input->input_field_1_3 = TRUE; - input->pressedStartButton = FALSE; - } - } -#endif - + #endif } int ProcessPlayerFieldInput(struct FieldInput *input) @@ -219,14 +221,17 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE) return TRUE; -#if DEBUGGING && !DEBUG_MENU - if (input->input_field_1_2) - { - PlaySE(SE_WIN_OPEN); - Debug_ShowMainMenu(); - return TRUE; - } -#endif + #ifdef TX_DEBUGGING + if (!TX_DEBUG_MENU_OPTION) + { + if (input->input_field_1_2) + { + PlaySE(SE_WIN_OPEN); + Debug_ShowMainMenu(); + return TRUE; + } + } + #endif return FALSE; } diff --git a/src/start_menu.c b/src/start_menu.c index b765761513..75bdc618a0 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -267,16 +267,20 @@ static void BuildStartMenuActions(void) { BuildMultiPartnerRoomStartMenu(); } - #if DEBUGGING && DEBUG_MENU - else + #ifdef TX_DEBUGGING + if (TX_DEBUG_MENU_OPTION) { BuildDebugStartMenu(); } - #else - else + else { BuildNormalStartMenu(); } + #else + else + { + BuildNormalStartMenu(); + } #endif } @@ -755,7 +759,7 @@ static bool8 StartMenuDebugCallback(void) RemoveExtraStartMenuWindows(); HideStartMenuDebug(); // Hide start menu without enabling movement - #if DEBUGGING + #ifdef TX_DEBUGGING Debug_ShowMainMenu(); #endif diff --git a/src/trainer_see.c b/src/trainer_see.c index 83783469c1..4ca19cd7f0 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -177,10 +177,10 @@ bool8 CheckForTrainersWantingBattle(void) { u8 i; -#if DEBUGGING //DEBUG - if (FlagGet(FLAG_SYS_NO_TRAINER_SEE)) - return FALSE; -#endif // + #ifdef TX_DEBUGGING //DEBUG + if (FlagGet(FLAG_SYS_NO_TRAINER_SEE)) + return FALSE; + #endif // gNoOfApproachingTrainers = 0; gApproachingTrainerId = 0; From 578056000725b370e57bee22de8967ed658ec66d Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Sun, 28 Nov 2021 20:28:54 +0100 Subject: [PATCH 028/155] fixed some bugs, thanks to cbt --- include/pokemon.h | 1 + src/debug.c | 8 ++++---- src/event_object_movement.c | 1 + src/item_use.c | 2 +- src/pokemon.c | 3 +-- src/trainer_see.c | 1 + 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index 315416c383..f3f7586888 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -348,6 +348,7 @@ void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg); void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg); void CopyMon(void *dest, void *src, size_t size); u8 GiveMonToPlayer(struct Pokemon *mon); +u8 SendMonToPC(struct Pokemon* mon); u8 CalculatePlayerPartyCount(void); u8 CalculateEnemyPartyCount(void); u8 GetMonsStateToDoubles(void); diff --git a/src/debug.c b/src/debug.c index ae3ff02e0b..ec8c1251ff 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1683,8 +1683,8 @@ static void DebugAction_Give_Item(u8 taskId) gTasks[taskId].data[3] = 1; //Current ID gTasks[taskId].data[4] = 0; //Digit Selected gTasks[taskId].data[6] = AddItemIconSprite(ITEM_TAG, ITEM_TAG, gTasks[taskId].data[3]); - gSprites[gTasks[taskId].data[6]].pos2.x = DEBUG_NUMBER_ICON_X+10; - gSprites[gTasks[taskId].data[6]].pos2.y = DEBUG_NUMBER_ICON_Y+10; + gSprites[gTasks[taskId].data[6]].x2 = DEBUG_NUMBER_ICON_X+10; + gSprites[gTasks[taskId].data[6]].y2 = DEBUG_NUMBER_ICON_Y+10; gSprites[gTasks[taskId].data[6]].oam.priority = 0; } static void DebugAction_Give_Item_SelectId(u8 taskId) @@ -1728,8 +1728,8 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) FreeSpriteOamMatrix(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon DestroySprite(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon gTasks[taskId].data[6] = AddItemIconSprite(ITEM_TAG, ITEM_TAG, gTasks[taskId].data[3]); - gSprites[gTasks[taskId].data[6]].pos2.x = DEBUG_NUMBER_ICON_X+10; - gSprites[gTasks[taskId].data[6]].pos2.y = DEBUG_NUMBER_ICON_Y+10; + gSprites[gTasks[taskId].data[6]].x2 = DEBUG_NUMBER_ICON_X+10; + gSprites[gTasks[taskId].data[6]].y2 = DEBUG_NUMBER_ICON_Y+10; gSprites[gTasks[taskId].data[6]].oam.priority = 0; } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index a782872d69..054f1d233d 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -2,6 +2,7 @@ #include "malloc.h" #include "battle_pyramid.h" #include "berry.h" +#include "debug.h" #include "decoration.h" #include "event_data.h" #include "event_object_movement.h" diff --git a/src/item_use.c b/src/item_use.c index b875b19103..de14e3ab9e 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -943,7 +943,7 @@ void ItemUseInBattle_PokeBall(u8 taskId) { if (FlagGet(FLAG_SYS_NO_CATCHING)){ //DEBUG static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p"); - DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, BagMenu_InitListsMenu); + DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage); } // else if (IsPlayerPartyAndPokemonStorageFull() == FALSE) // have room for mon? { diff --git a/src/pokemon.c b/src/pokemon.c index 1607e1a40f..0cbb127a6d 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -61,7 +61,6 @@ static void Task_PlayMapChosenOrBattleBGM(u8 taskId); static bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId); static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move); static bool8 ShouldSkipFriendshipChange(void); -static u8 SendMonToPC(struct Pokemon* mon); EWRAM_DATA static u8 sLearningMoveTableID = 0; EWRAM_DATA u8 gPlayerPartyCount = 0; @@ -4385,7 +4384,7 @@ u8 GiveMonToPlayer(struct Pokemon *mon) return MON_GIVEN_TO_PARTY; } -static u8 SendMonToPC(struct Pokemon* mon) +u8 SendMonToPC(struct Pokemon* mon) { s32 boxNo, boxPos; diff --git a/src/trainer_see.c b/src/trainer_see.c index b3f4a77bd0..dfc898cf76 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -1,5 +1,6 @@ #include "global.h" #include "battle_setup.h" +#include "debug.h" #include "event_data.h" #include "event_object_movement.h" #include "field_effect.h" From df8dfd9a6520828488e9a7da972bf65b04110daa Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Sun, 28 Nov 2021 20:53:23 +0100 Subject: [PATCH 029/155] added #ifdef TX_DEBUGGING for wild encounter, bag use and catching flags --- src/battle_main.c | 9 +++++++++ src/field_control_avatar.c | 2 ++ src/item_use.c | 10 +++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index 944efd1639..133daa1963 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -15,6 +15,7 @@ #include "berry.h" #include "bg.h" #include "data.h" +#include "debug.h" #include "decompress.h" #include "dma3.h" #include "event_data.h" @@ -4187,11 +4188,19 @@ static void HandleTurnActionSelectionState(void) } break; case B_ACTION_USE_ITEM: + #ifdef TX_DEBUGGING if (FlagGet(FLAG_SYS_NO_BAG_USE) || gBattleTypeFlags & (BATTLE_TYPE_LINK //DEBUG | BATTLE_TYPE_FRONTIER_NO_PYRAMID | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_RECORDED_LINK)) { + #else + if (gBattleTypeFlags & (BATTLE_TYPE_LINK //DEBUG + | BATTLE_TYPE_FRONTIER_NO_PYRAMID + | BATTLE_TYPE_EREADER_TRAINER + | BATTLE_TYPE_RECORDED_LINK)) + { + #endif RecordedBattle_ClearBattlerAction(gActiveBattler, 1); gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed; gBattleCommunication[gActiveBattler] = STATE_SELECTION_SCRIPT; diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 1e25f89b33..1916d60ff2 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -713,8 +713,10 @@ void RestartWildEncounterImmunitySteps(void) static bool8 CheckStandardWildEncounter(u16 metatileBehavior) { + #ifdef TX_DEBUGGING if (FlagGet(FLAG_SYS_NO_ENCOUNTER)) //DEBUG return FALSE;// + #endif if (sWildEncounterImmunitySteps < 4) { diff --git a/src/item_use.c b/src/item_use.c index de14e3ab9e..6e33dad33e 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -8,6 +8,7 @@ #include "bike.h" #include "coins.h" #include "data.h" +#include "debug.h" #include "event_data.h" #include "event_object_lock.h" #include "event_object_movement.h" @@ -941,11 +942,14 @@ void ItemUseOutOfBattle_EvolutionStone(u8 taskId) void ItemUseInBattle_PokeBall(u8 taskId) { + #ifdef TX_DEBUGGING if (FlagGet(FLAG_SYS_NO_CATCHING)){ //DEBUG static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p"); - DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage); - } // - else if (IsPlayerPartyAndPokemonStorageFull() == FALSE) // have room for mon? + DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage); + return; + } + #endif + if (IsPlayerPartyAndPokemonStorageFull() == FALSE) // have room for mon? { RemoveBagItem(gSpecialVar_ItemId, 1); if (!InBattlePyramid()) From 224b9a15493c6c734425980cca26289e34409d71 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 21 Feb 2022 20:29:46 -0300 Subject: [PATCH 030/155] Fixed softlock when pressing the start button while in link room --- src/start_menu.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/start_menu.c b/src/start_menu.c index 71fb78f68d..a9ecb2c47b 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -283,21 +283,17 @@ static void BuildStartMenuActions(void) { BuildMultiPartnerRoomStartMenu(); } - #ifdef TX_DEBUGGING - if (TX_DEBUG_MENU_OPTION) - { - BuildDebugStartMenu(); - } - else - { - BuildNormalStartMenu(); - } - #else - else - { - BuildNormalStartMenu(); - } - #endif +#if defined(TX_DEBUGGING) && TX_DEBUG_MENU_OPTION + else + { + BuildDebugStartMenu(); + } +#else + else + { + BuildNormalStartMenu(); + } +#endif } static void AddStartMenuAction(u8 action) From e0885523981048f0f97ec5f1c413e0481f73c189 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 7 Mar 2022 21:17:31 -0300 Subject: [PATCH 031/155] Fixed going out of bounds when choosing a move for detailed Give Mon --- src/debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debug.c b/src/debug.c index ec8c1251ff..255ac335fd 100644 --- a/src/debug.c +++ b/src/debug.c @@ -2389,8 +2389,8 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) if(gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > MOVES_COUNT) - gTasks[taskId].data[3] = MOVES_COUNT; + if(gTasks[taskId].data[3] >= MOVES_COUNT) + gTasks[taskId].data[3] = MOVES_COUNT - 1; } if(gMain.newKeys & DPAD_DOWN) { @@ -2574,7 +2574,7 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu //Moves for (i = 0; i < MAX_MON_MOVES; i++) { - if (moves[i] == 0 || moves[i] == 0xFF || moves[i] > MOVES_COUNT) + if (moves[i] == 0 || moves[i] == 0xFF || moves[i] >= MOVES_COUNT) continue; SetMonMoveSlot(&mon, moves[i], i); From 315813d186733b2cf8784d9270e4300213b00757 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 16 Mar 2022 10:38:07 -0300 Subject: [PATCH 032/155] Update debug.c --- src/debug.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/debug.c b/src/debug.c index 255ac335fd..9fa7d73213 100644 --- a/src/debug.c +++ b/src/debug.c @@ -276,7 +276,11 @@ extern u8 Debug_ShowFieldMessageStringVar4[]; extern u8 Debug_CheatStart[]; extern u8 PlayersHouse_2F_EventScript_SetWallClock[]; extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; +#ifdef BATTLE_ENGINE +#define ABILITY_NAME_LENGTH 16 +#else #define ABILITY_NAME_LENGTH 12 +#endif extern const u8 gAbilityNames[][ABILITY_NAME_LENGTH + 1]; From 0036a4dc36c766fd3de8ea6484cc46679548b0a6 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 18 Mar 2022 13:30:08 -0400 Subject: [PATCH 033/155] pc acccess --- include/constants/flags.h | 2 +- include/pokemon_storage_system.h | 2 ++ src/debug.c | 33 ++++++++++++++++++++++---------- src/pokemon_storage_system.c | 15 +++++++++------ 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/include/constants/flags.h b/include/constants/flags.h index 4d5a7c1166..cab8b51e5f 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -46,7 +46,7 @@ #define FLAG_SYS_NO_TRAINER_SEE 0x22 // Unused Flag //DEBUG #define FLAG_SYS_NO_BAG_USE 0x23 // Unused Flag //DEBUG #define FLAG_SYS_NO_CATCHING 0x24 // Unused Flag //DEBUG -#define FLAG_UNUSED_0x025 0x25 // Unused Flag +#define FLAG_SYS_PC_FROM_DEBUG_MENU 0x25 // Unused Flag //DEBUG #define FLAG_UNUSED_0x026 0x26 // Unused Flag #define FLAG_UNUSED_0x027 0x27 // Unused Flag #define FLAG_UNUSED_0x028 0x28 // Unused Flag diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index b7fca23311..a4575ac9ab 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -72,4 +72,6 @@ u8 *GetWaldaPhrasePtr(void); void SetWaldaPhrase(const u8 *src); bool32 IsWaldaPhraseEmpty(void); +void EnterPokeStorage(u8 boxOption); + #endif // GUARD_POKEMON_STORAGE_SYSTEM_H diff --git a/src/debug.c b/src/debug.c index 9fa7d73213..0e464fa8b9 100644 --- a/src/debug.c +++ b/src/debug.c @@ -31,6 +31,7 @@ #include "naming_screen.h" #include "new_game.h" #include "overworld.h" +#include "palette.h" #include "pokedex.h" #include "pokemon.h" #include "pokemon_icon.h" @@ -48,6 +49,7 @@ #include "constants/flags.h" #include "constants/items.h" #include "constants/map_groups.h" +#include "constants/rgb.h" #include "constants/songs.h" #include "constants/species.h" @@ -61,6 +63,7 @@ enum { // Main DEBUG_MENU_ITEM_VARS, DEBUG_MENU_ITEM_GIVE, DEBUG_MENU_ITEM_SOUND, + DEBUG_MENU_ITEM_ACCESS_PC, DEBUG_MENU_ITEM_CANCEL }; enum { // Util @@ -115,7 +118,6 @@ enum { // Give DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG, DEBUG_GIVE_MENU_ITEM_FILL_PC, DEBUG_GIVE_MENU_ITEM_CHEAT, - //DEBUG_MENU_ITEM_ACCESS_PC, }; enum { //Sound DEBUG_SOUND_MENU_ITEM_SE, @@ -374,7 +376,7 @@ static const u8 gDebugText_Give_MaxCoins[] = _("Max Coins"); static const u8 gDebugText_Give_DaycareEgg[] = _("Daycare Egg"); static const u8 gDebugText_Give_FillPc[] = _("Fill Pc"); static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); -// static const u8 gDebugText_Give_AccessPC[] = _("Access PC"); +static const u8 gDebugText_AccessPC[] = _("Access PC"); // Sound Mneu static const u8 gDebugText_Sound_SE[] = _("Effects"); static const u8 gDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); @@ -425,6 +427,7 @@ static const struct ListMenuItem sDebugMenu_Items_Main[] = [DEBUG_MENU_ITEM_VARS] = {gDebugText_Vars, DEBUG_MENU_ITEM_VARS}, [DEBUG_MENU_ITEM_GIVE] = {gDebugText_Give, DEBUG_MENU_ITEM_GIVE}, [DEBUG_MENU_ITEM_SOUND] = {gDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, + [DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, [DEBUG_MENU_ITEM_CANCEL] = {gDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} }; static const struct ListMenuItem sDebugMenu_Items_Utilities[] = @@ -484,7 +487,6 @@ static const struct ListMenuItem sDebugMenu_Items_Give[] = [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {gDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, [DEBUG_GIVE_MENU_ITEM_FILL_PC] = {gDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC}, [DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, - //[DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, }; static const struct ListMenuItem sDebugMenu_Items_Sound[] = { @@ -502,6 +504,7 @@ static void (*const sDebugMenu_Actions_Main[])(u8) = [DEBUG_MENU_ITEM_VARS] = DebugAction_OpenVariablesMenu, [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, [DEBUG_MENU_ITEM_SOUND] = DebugAction_OpenSoundMenu, + [DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel }; static void (*const sDebugMenu_Actions_Utilities[])(u8) = @@ -561,7 +564,6 @@ static void (*const sDebugMenu_Actions_Give[])(u8) = [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg, [DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC, [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, - //[DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, }; static void (*const sDebugMenu_Actions_Sound[])(u8) = { @@ -2690,12 +2692,23 @@ static void DebugAction_Give_CHEAT(u8 taskId) ScriptContext1_SetupScript(Debug_CheatStart); } -// static void DebugAction_AccessPC(u8 taskId) -// { -// Debug_DestroyMenu(taskId); -// PlaySE(SE_PC_ON); -// ScriptContext1_SetupScript(EventScript_PC); -// } +static void Task_WaitFadeAccessPC(u8 taskId) +{ + if (!gPaletteFade.active) + { + DestroyTask(taskId); + FlagSet(FLAG_SYS_PC_FROM_DEBUG_MENU); + EnterPokeStorage(2); + } +} + +static void DebugAction_AccessPC(u8 taskId) +{ + Debug_DestroyMenu(taskId); + CleanupOverworldWindowsAndTilemaps(); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + CreateTask(Task_WaitFadeAccessPC, 0); +} // ******************************* diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index f18dc68d13..62966e8e09 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -571,7 +571,6 @@ EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; EWRAM_DATA static bool8 sAutoActionOn = 0; // Main tasks -static void EnterPokeStorage(u8); static void Task_InitPokeStorage(u8); static void Task_PlaceMon(u8); static void Task_ChangeScreen(u8); @@ -1676,10 +1675,14 @@ static void FieldTask_ReturnToPcMenu(void) MainCallback vblankCb = gMain.vblankCallback; SetVBlankCallback(NULL); - taskId = CreateTask(Task_PCMainMenu, 80); - gTasks[taskId].tState = 0; - gTasks[taskId].tSelectedOption = sPreviousBoxOption; - Task_PCMainMenu(taskId); + if (!FlagGet(FLAG_SYS_PC_FROM_DEBUG_MENU)) { + taskId = CreateTask(Task_PCMainMenu, 80); + gTasks[taskId].tState = 0; + gTasks[taskId].tSelectedOption = sPreviousBoxOption; + Task_PCMainMenu(taskId); + } else { + FlagClear(FLAG_SYS_PC_FROM_DEBUG_MENU); + } SetVBlankCallback(vblankCb); FadeInFromBlack(); } @@ -2009,7 +2012,7 @@ static void CB2_PokeStorage(void) BuildOamBuffer(); } -static void EnterPokeStorage(u8 boxOption) +void EnterPokeStorage(u8 boxOption) { ResetTasks(); sCurrentBoxOption = boxOption; From 192969c492d4df5be40f9b1860f9e9f22e89011e Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Fri, 18 Mar 2022 20:47:12 +0100 Subject: [PATCH 034/155] small fix --- src/pokemon_storage_system.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 62966e8e09..4ead75965e 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1682,6 +1682,7 @@ static void FieldTask_ReturnToPcMenu(void) Task_PCMainMenu(taskId); } else { FlagClear(FLAG_SYS_PC_FROM_DEBUG_MENU); + EnableBothScriptContexts(); } SetVBlankCallback(vblankCb); FadeInFromBlack(); From 0cb6529ae217bfb510fb105842578ba3eba9b992 Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Fri, 6 May 2022 14:53:16 -0700 Subject: [PATCH 035/155] functional but not perfect implementation --- data/battle_scripts_1.s | 6 ++++ include/battle_scripts.h | 1 + src/battle_message.c | 2 +- src/battle_script_commands.c | 53 ++++++++++++++++++++++++++++++++++-- 4 files changed, 59 insertions(+), 3 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 6574e26ab3..13a96c89a5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -9560,3 +9560,9 @@ BattleScript_MagicianActivates:: call BattleScript_AbilityPopUp call BattleScript_ItemSteal return + +BattleScript_SymbiosisActivates:: + call BattleScript_AbilityPopUp + printstring STRINGID_SYMBIOSISITEMPASS + waitmessage B_WAIT_TIME_LONG + return diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 740d27148a..f77431e99a 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -419,5 +419,6 @@ extern const u8 BattleScript_MagicianActivates[]; extern const u8 BattleScript_BeakBlastSetUp[]; extern const u8 BattleScript_BeakBlastBurn[]; extern const u8 BattleScript_DefDownSpeedUp[]; +extern const u8 BattleScript_SymbiosisActivates[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/src/battle_message.c b/src/battle_message.c index 3e2d9abd92..d2b02e341f 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -601,7 +601,7 @@ static const u8 sText_HarvestBerry[] = _("{B_ATK_NAME_WITH_PREFIX} harvested\nit static const u8 sText_LastAbilityRaisedBuff1[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}\nraised its {B_BUFF1}!"); static const u8 sText_MagicBounceActivates[] = _("The {B_DEF_NAME_WITH_PREFIX} bounced the\n{B_ATK_NAME_WITH_PREFIX} back!"); static const u8 sText_ProteanTypeChange[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY} transformed\nit into the {B_BUFF1} type!"); -static const u8 sText_SymbiosisItemPass[] = _("{B_ATK_NAME_WITH_PREFIX} passed its {B_LAST_ITEM}\nto {B_SCR_ACTIVE_NAME_WITH_PREFIX} through {B_ATK_ABILITY}!"); +static const u8 sText_SymbiosisItemPass[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} passed its {B_LAST_ITEM}\nto {B_DEF_NAME_WITH_PREFIX} through {B_LAST_ABILITY}!"); static const u8 sText_StealthRockDmg[] = _("Pointed stones dug into\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}!"); static const u8 sText_ToxicSpikesAbsorbed[] = _("The poison spikes disappeared\nfrom around the opposing team's feet!"); static const u8 sText_ToxicSpikesPoisoned[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} was poisoned!"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d6edb0ab2d..6657aa9c04 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7030,6 +7030,53 @@ static bool32 TryCheekPouch(u32 battlerId, u32 itemId) return FALSE; } +// Notes: +// Symbiosis applies before a move and after a gem is used in Gen 6. +// Symbiosis applies if an ally consumes a berry through Bug Bite / Pluck and doesn't have an item. +// Symbiosis does not apply if an ally has an item stolen, knocked off, or destroyed by Incinerate. +// Symbiosis does not apply after Eject Button (except in Gen 6, where it is bugged). +// Symbiosis does not apply if an ally tricks away their item and does not receive one in return. + +//itemId is used to check Eject Button or Eject Pack +static bool32 TrySymbiosis(u32 battler, u32 itemId) +{ + u32 ally = battler ^ BIT_FLANK; + + if (!gBattleStruct->itemStolen[gBattlerPartyIndexes[battler]].stolen + && gBattleStruct->changedItems[battler] == ITEM_NONE + && ItemId_GetHoldEffect(itemId) != HOLD_EFFECT_EJECT_BUTTON + && ItemId_GetHoldEffect(itemId) != HOLD_EFFECT_EJECT_PACK + && GetBattlerAbility(ally) == ABILITY_SYMBIOSIS + && gBattleMons[battler].item == ITEM_NONE + && gBattleMons[ally].item != ITEM_NONE + && CanBattlerGetOrLoseItem(battler, gBattleMons[ally].item) + && CanBattlerGetOrLoseItem(ally, gBattleMons[ally].item) + && gBattleMons[battler].hp != 0 + && gBattleMons[ally].hp != 0) + { + gLastUsedItem = gBattleMons[ally].item; + + gActiveBattler = ally; + gBattleMons[ally].item = ITEM_NONE; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[battler].item), &gBattleMons[battler].item); + MarkBattlerForControllerExec(ally); + + gActiveBattler = battler; + gBattleMons[battler].item = gLastUsedItem; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[battler].item), &gBattleMons[battler].item); + MarkBattlerForControllerExec(battler); + gBattleResources->flags->flags[battler] &= ~RESOURCE_FLAG_UNBURDEN; + + gLastUsedAbility = gBattleMons[ally].ability; + gBattleScripting.battler = gBattlerAbility = ally; + gBattlerTarget = battler; + BattleScriptPush(gBattlescriptCurrInstr + 2); + gBattlescriptCurrInstr = BattleScript_SymbiosisActivates; + return TRUE; + } + return FALSE; +} + static void Cmd_removeitem(void) { u16 itemId = 0; @@ -7048,7 +7095,7 @@ static void Cmd_removeitem(void) MarkBattlerForControllerExec(gActiveBattler); ClearBattlerItemEffectHistory(gActiveBattler); - if (!TryCheekPouch(gActiveBattler, itemId)) + if (!TryCheekPouch(gActiveBattler, itemId) && !TrySymbiosis(gActiveBattler, itemId)) gBattlescriptCurrInstr += 2; } @@ -8830,7 +8877,8 @@ static void Cmd_various(void) MarkBattlerForControllerExec(gActiveBattler); gBattleResources->flags->flags[gBattlerTarget] &= ~RESOURCE_FLAG_UNBURDEN; - gBattlescriptCurrInstr += 7; + if (!TrySymbiosis(gBattlerAttacker, gLastUsedItem)) + gBattlescriptCurrInstr += 7; } return; case VARIOUS_ARGUMENT_TO_MOVE_EFFECT: @@ -12623,6 +12671,7 @@ static void Cmd_tryswapitems(void) // trick else { CheckSetUnburden(gBattlerAttacker); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_GIVEN; // attacker's item -> <- nothing } } From 542a0f07b438f2c36c16bf0631db5d1ca332bb26 Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Fri, 6 May 2022 22:07:25 -0700 Subject: [PATCH 036/155] fixed bug bite / bestow --- asm/macros/battle_script.inc | 5 ++ data/battle_scripts_1.s | 2 + include/constants/battle_script_commands.h | 1 + src/battle_script_commands.c | 86 +++++++++++----------- 4 files changed, 51 insertions(+), 43 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index b434332054..5136f70218 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -2128,3 +2128,8 @@ .macro skydropyawn various 0, VARIOUS_SKY_DROP_YAWN .endm + + @ Used by effects that may proc Symbiosis but do not call removeitem. + .macro trysymbiosis + various BS_ATTACKER, VARIOUS_TRY_SYMBIOSIS + .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 13a96c89a5..b8345a9176 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1307,6 +1307,7 @@ BattleScript_MoveEffectBugBite:: consumeberry BS_ATTACKER, TRUE @ consume the berry, then restore the item from changedItems bicword gHitMarker, HITMARKER_NO_ANIMATIONS setbyte sBERRY_OVERRIDE, FALSE + trysymbiosis return BattleScript_EffectCoreEnforcer: @@ -1678,6 +1679,7 @@ BattleScript_EffectBestow: waitanimation printstring STRINGID_BESTOWITEMGIVING waitmessage B_WAIT_TIME_LONG + trysymbiosis goto BattleScript_MoveEnd BattleScript_EffectAfterYou: diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index da44714e21..e89875f66c 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -241,6 +241,7 @@ #define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 150 #define VARIOUS_SET_BEAK_BLAST 151 #define VARIOUS_SWAP_SIDE_STATUSES 152 +#define VARIOUS_TRY_SYMBIOSIS 153 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6657aa9c04..1b53b0c4e7 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7030,14 +7030,34 @@ static bool32 TryCheekPouch(u32 battlerId, u32 itemId) return FALSE; } -// Notes: -// Symbiosis applies before a move and after a gem is used in Gen 6. -// Symbiosis applies if an ally consumes a berry through Bug Bite / Pluck and doesn't have an item. -// Symbiosis does not apply if an ally has an item stolen, knocked off, or destroyed by Incinerate. -// Symbiosis does not apply after Eject Button (except in Gen 6, where it is bugged). -// Symbiosis does not apply if an ally tricks away their item and does not receive one in return. +#define SYMBIOSIS_CHECK(battler, ally) \ + GetBattlerAbility(ally) == ABILITY_SYMBIOSIS \ + && gBattleMons[battler].item == ITEM_NONE \ + && gBattleMons[ally].item != ITEM_NONE \ + && CanBattlerGetOrLoseItem(battler, gBattleMons[ally].item) \ + && CanBattlerGetOrLoseItem(ally, gBattleMons[ally].item) \ + && gBattleMons[battler].hp != 0 \ + && gBattleMons[ally].hp != 0 -//itemId is used to check Eject Button or Eject Pack +// Used by Bestow and Symbiosis to take an item from one battler and give to another. +static void BestowItem(u32 battlerAtk, u32 battlerDef) +{ + gLastUsedItem = gBattleMons[battlerAtk].item; + + gActiveBattler = battlerAtk; + gBattleMons[battlerAtk].item = ITEM_NONE; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[battlerAtk].item), &gBattleMons[battlerAtk].item); + MarkBattlerForControllerExec(battlerAtk); + CheckSetUnburden(battlerAtk); + + gActiveBattler = battlerDef; + gBattleMons[battlerDef].item = gLastUsedItem; + BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[battlerDef].item), &gBattleMons[battlerDef].item); + MarkBattlerForControllerExec(battlerDef); + gBattleResources->flags->flags[battlerDef] &= ~RESOURCE_FLAG_UNBURDEN; +} + +// Called by Cmd_removeitem. itemId represents the item that was removed, not being given. static bool32 TrySymbiosis(u32 battler, u32 itemId) { u32 ally = battler ^ BIT_FLANK; @@ -7046,27 +7066,9 @@ static bool32 TrySymbiosis(u32 battler, u32 itemId) && gBattleStruct->changedItems[battler] == ITEM_NONE && ItemId_GetHoldEffect(itemId) != HOLD_EFFECT_EJECT_BUTTON && ItemId_GetHoldEffect(itemId) != HOLD_EFFECT_EJECT_PACK - && GetBattlerAbility(ally) == ABILITY_SYMBIOSIS - && gBattleMons[battler].item == ITEM_NONE - && gBattleMons[ally].item != ITEM_NONE - && CanBattlerGetOrLoseItem(battler, gBattleMons[ally].item) - && CanBattlerGetOrLoseItem(ally, gBattleMons[ally].item) - && gBattleMons[battler].hp != 0 - && gBattleMons[ally].hp != 0) + && SYMBIOSIS_CHECK(battler, ally)) { - gLastUsedItem = gBattleMons[ally].item; - - gActiveBattler = ally; - gBattleMons[ally].item = ITEM_NONE; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[battler].item), &gBattleMons[battler].item); - MarkBattlerForControllerExec(ally); - - gActiveBattler = battler; - gBattleMons[battler].item = gLastUsedItem; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[battler].item), &gBattleMons[battler].item); - MarkBattlerForControllerExec(battler); - gBattleResources->flags->flags[battler] &= ~RESOURCE_FLAG_UNBURDEN; - + BestowItem(ally, battler); gLastUsedAbility = gBattleMons[ally].ability; gBattleScripting.battler = gBattlerAbility = ally; gBattlerTarget = battler; @@ -8863,22 +8865,8 @@ static void Cmd_various(void) } else { - gLastUsedItem = gBattleMons[gBattlerAttacker].item; - - gActiveBattler = gBattlerAttacker; - gBattleMons[gActiveBattler].item = ITEM_NONE; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].item), &gBattleMons[gActiveBattler].item); - MarkBattlerForControllerExec(gActiveBattler); - CheckSetUnburden(gBattlerAttacker); - - gActiveBattler = gBattlerTarget; - gBattleMons[gActiveBattler].item = gLastUsedItem; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].item), &gBattleMons[gActiveBattler].item); - MarkBattlerForControllerExec(gActiveBattler); - gBattleResources->flags->flags[gBattlerTarget] &= ~RESOURCE_FLAG_UNBURDEN; - - if (!TrySymbiosis(gBattlerAttacker, gLastUsedItem)) - gBattlescriptCurrInstr += 7; + BestowItem(gBattlerAttacker, gBattlerTarget); + gBattlescriptCurrInstr += 7; } return; case VARIOUS_ARGUMENT_TO_MOVE_EFFECT: @@ -9619,6 +9607,18 @@ static void Cmd_various(void) case VARIOUS_SWAP_SIDE_STATUSES: CourtChangeSwapSideStatuses(); break; + case VARIOUS_TRY_SYMBIOSIS: //called by Bestow and Bug Bite, which have cases that don't call Cmd_removeitem. + if (SYMBIOSIS_CHECK(gActiveBattler, gActiveBattler ^ BIT_FLANK)) + { + BestowItem(gActiveBattler ^ BIT_FLANK, gActiveBattler); + gLastUsedAbility = gBattleMons[gActiveBattler ^ BIT_FLANK].ability; + gBattleScripting.battler = gBattlerAbility = gActiveBattler ^ BIT_FLANK; + gBattlerTarget = gActiveBattler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SymbiosisActivates; + return; + } + break; } // End of switch (gBattlescriptCurrInstr[2]) gBattlescriptCurrInstr += 3; From 2ffff788b441177752195fd3f2a4f4a56c2f95dc Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Fri, 6 May 2022 22:29:40 -0700 Subject: [PATCH 037/155] fixed Fling --- data/battle_scripts_1.s | 1 + src/battle_script_commands.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index b8345a9176..16ad64b5c5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -622,6 +622,7 @@ BattleScript_EffectFlingConsumeBerry: restorebattleritem BS_TARGET BattleScript_FlingEnd: tryfaintmon BS_TARGET + trysymbiosis goto BattleScript_MoveEnd BattleScript_FlingFlameOrb: diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1b53b0c4e7..6d1055cb0e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7066,6 +7066,7 @@ static bool32 TrySymbiosis(u32 battler, u32 itemId) && gBattleStruct->changedItems[battler] == ITEM_NONE && ItemId_GetHoldEffect(itemId) != HOLD_EFFECT_EJECT_BUTTON && ItemId_GetHoldEffect(itemId) != HOLD_EFFECT_EJECT_PACK + && gCurrentMove != MOVE_FLING && SYMBIOSIS_CHECK(battler, ally)) { BestowItem(ally, battler); @@ -9607,7 +9608,7 @@ static void Cmd_various(void) case VARIOUS_SWAP_SIDE_STATUSES: CourtChangeSwapSideStatuses(); break; - case VARIOUS_TRY_SYMBIOSIS: //called by Bestow and Bug Bite, which have cases that don't call Cmd_removeitem. + case VARIOUS_TRY_SYMBIOSIS: //called by Bestow, Fling, and Bug Bite, which don't work with Cmd_removeitem. if (SYMBIOSIS_CHECK(gActiveBattler, gActiveBattler ^ BIT_FLANK)) { BestowItem(gActiveBattler ^ BIT_FLANK, gActiveBattler); From 9d222d3ab42a22ba2433481613933a3053716443 Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Sat, 7 May 2022 13:12:21 -0700 Subject: [PATCH 038/155] fixed gems and damage-reducing berries --- include/constants/battle_config.h | 1 + include/constants/battle_script_commands.h | 5 +-- src/battle_script_commands.c | 42 ++++++++++++++++------ 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index a3ef7cc94b..5f3cf512e0 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -182,6 +182,7 @@ #define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously. #define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. #define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. +#define B_SYMBIOSIS_GEMS GEN_7 // In Gen 6, Symbiosis passes an item before the gem-boosted attack hits and the item effect applies. In Gen 7+, items are passed after a gem-boosted attack. // Item settings #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index e89875f66c..eab06a4a01 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -311,8 +311,9 @@ #define MOVEEND_PICKPOCKET 27 #define MOVEEND_DANCER 28 #define MOVEEND_EMERGENCY_EXIT 29 -#define MOVEEND_CLEAR_BITS 30 -#define MOVEEND_COUNT 31 +#define MOVEEND_SYMBIOSIS 30 +#define MOVEEND_CLEAR_BITS 31 +#define MOVEEND_COUNT 32 // switch cases #define B_SWITCH_NORMAL 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6d1055cb0e..a6420bbc76 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -306,6 +306,7 @@ static void PutMonIconOnLvlUpBanner(void); static void DrawLevelUpBannerText(void); static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite* sprite); static bool32 CriticalCapture(u32 odds); +static void BestowItem(u32 battlerAtk, u32 battlerDef); static void Cmd_attackcanceler(void); static void Cmd_accuracycheck(void); @@ -4967,6 +4968,15 @@ static bool32 TryKnockOffBattleScript(u32 battlerDef) return FALSE; } +#define SYMBIOSIS_CHECK(battler, ally) \ + GetBattlerAbility(ally) == ABILITY_SYMBIOSIS \ + && gBattleMons[battler].item == ITEM_NONE \ + && gBattleMons[ally].item != ITEM_NONE \ + && CanBattlerGetOrLoseItem(battler, gBattleMons[ally].item) \ + && CanBattlerGetOrLoseItem(ally, gBattleMons[ally].item) \ + && gBattleMons[battler].hp != 0 \ + && gBattleMons[ally].hp != 0 + static void Cmd_moveend(void) { s32 i; @@ -5592,6 +5602,23 @@ static void Cmd_moveend(void) } gBattleScripting.moveendState++; break; + case MOVEEND_SYMBIOSIS: + for (i = 0; i < gBattlersCount; i++) + { + if (((B_SYMBIOSIS_GEMS >= GEN_7 && gSpecialStatuses[i].gemBoost) || gSpecialStatuses[i].berryReduced) + && SYMBIOSIS_CHECK(i, i ^ BIT_FLANK)) + { + BestowItem(i ^ BIT_FLANK, i); + gLastUsedAbility = gBattleMons[i ^ BIT_FLANK].ability; + gBattleScripting.battler = gBattlerAbility = i ^ BIT_FLANK; + gBattlerAttacker = i; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SymbiosisActivates; + effect = TRUE; + } + } + gBattleScripting.moveendState++; + break; case MOVEEND_CLEAR_BITS: // Clear/Set bits for things like using a move for all targets and all hits. if (gSpecialStatuses[gBattlerAttacker].instructedChosenTarget) *(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].instructedChosenTarget & 0x3; @@ -7030,15 +7057,6 @@ static bool32 TryCheekPouch(u32 battlerId, u32 itemId) return FALSE; } -#define SYMBIOSIS_CHECK(battler, ally) \ - GetBattlerAbility(ally) == ABILITY_SYMBIOSIS \ - && gBattleMons[battler].item == ITEM_NONE \ - && gBattleMons[ally].item != ITEM_NONE \ - && CanBattlerGetOrLoseItem(battler, gBattleMons[ally].item) \ - && CanBattlerGetOrLoseItem(ally, gBattleMons[ally].item) \ - && gBattleMons[battler].hp != 0 \ - && gBattleMons[ally].hp != 0 - // Used by Bestow and Symbiosis to take an item from one battler and give to another. static void BestowItem(u32 battlerAtk, u32 battlerDef) { @@ -7066,7 +7084,11 @@ static bool32 TrySymbiosis(u32 battler, u32 itemId) && gBattleStruct->changedItems[battler] == ITEM_NONE && ItemId_GetHoldEffect(itemId) != HOLD_EFFECT_EJECT_BUTTON && ItemId_GetHoldEffect(itemId) != HOLD_EFFECT_EJECT_PACK - && gCurrentMove != MOVE_FLING + && gBattleStruct->debugHoldEffects[battler] != HOLD_EFFECT_EJECT_BUTTON + && gBattleStruct->debugHoldEffects[battler] != HOLD_EFFECT_EJECT_BUTTON + && !(B_SYMBIOSIS_GEMS >= GEN_7 && gSpecialStatuses[battler].gemBoost) + && gCurrentMove != MOVE_FLING //Fling and damage-reducing berries are handled separately. + && !gSpecialStatuses[battler].berryReduced && SYMBIOSIS_CHECK(battler, ally)) { BestowItem(ally, battler); From fa334b21f7772f32ab5e012bc0e491b764ba05ab Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Sat, 7 May 2022 13:18:25 -0700 Subject: [PATCH 039/155] minor tweaks --- src/battle_message.c | 2 +- src/battle_script_commands.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/battle_message.c b/src/battle_message.c index d2b02e341f..d5c6844bc7 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -601,7 +601,7 @@ static const u8 sText_HarvestBerry[] = _("{B_ATK_NAME_WITH_PREFIX} harvested\nit static const u8 sText_LastAbilityRaisedBuff1[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}\nraised its {B_BUFF1}!"); static const u8 sText_MagicBounceActivates[] = _("The {B_DEF_NAME_WITH_PREFIX} bounced the\n{B_ATK_NAME_WITH_PREFIX} back!"); static const u8 sText_ProteanTypeChange[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY} transformed\nit into the {B_BUFF1} type!"); -static const u8 sText_SymbiosisItemPass[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} passed its {B_LAST_ITEM}\nto {B_DEF_NAME_WITH_PREFIX} through {B_LAST_ABILITY}!"); +static const u8 sText_SymbiosisItemPass[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} passed its {B_LAST_ITEM}\nto {B_ATK_NAME_WITH_PREFIX} through {B_LAST_ABILITY}!"); static const u8 sText_StealthRockDmg[] = _("Pointed stones dug into\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}!"); static const u8 sText_ToxicSpikesAbsorbed[] = _("The poison spikes disappeared\nfrom around the opposing team's feet!"); static const u8 sText_ToxicSpikesPoisoned[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} was poisoned!"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a6420bbc76..aa8b668798 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7094,7 +7094,7 @@ static bool32 TrySymbiosis(u32 battler, u32 itemId) BestowItem(ally, battler); gLastUsedAbility = gBattleMons[ally].ability; gBattleScripting.battler = gBattlerAbility = ally; - gBattlerTarget = battler; + gBattlerAttacker = battler; BattleScriptPush(gBattlescriptCurrInstr + 2); gBattlescriptCurrInstr = BattleScript_SymbiosisActivates; return TRUE; @@ -9636,7 +9636,7 @@ static void Cmd_various(void) BestowItem(gActiveBattler ^ BIT_FLANK, gActiveBattler); gLastUsedAbility = gBattleMons[gActiveBattler ^ BIT_FLANK].ability; gBattleScripting.battler = gBattlerAbility = gActiveBattler ^ BIT_FLANK; - gBattlerTarget = gActiveBattler; + gBattlerAttacker = gActiveBattler; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SymbiosisActivates; return; @@ -12694,7 +12694,6 @@ static void Cmd_tryswapitems(void) // trick else { CheckSetUnburden(gBattlerAttacker); - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_GIVEN; // attacker's item -> <- nothing } } From c7bee35161af457cd9391b50c59db2878f09f28e Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Sat, 7 May 2022 13:23:41 -0700 Subject: [PATCH 040/155] fixed conflict with new PR --- include/constants/battle_config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 5f3cf512e0..8942a45d6a 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -182,6 +182,7 @@ #define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously. #define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. #define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. +#define B_OBLIVIOUS_TAUNT GEN_7 // In Gen6+, Pokémon with Oblivious can't be taunted. #define B_SYMBIOSIS_GEMS GEN_7 // In Gen 6, Symbiosis passes an item before the gem-boosted attack hits and the item effect applies. In Gen 7+, items are passed after a gem-boosted attack. // Item settings From 7cc284cf0b71e7e60d8ef6922475ce5b0f942238 Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Sun, 15 May 2022 09:50:12 -0700 Subject: [PATCH 041/155] learning GetBattlerHoldEffect is a thing --- src/battle_script_commands.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index aa8b668798..f145025ce5 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7082,10 +7082,8 @@ static bool32 TrySymbiosis(u32 battler, u32 itemId) if (!gBattleStruct->itemStolen[gBattlerPartyIndexes[battler]].stolen && gBattleStruct->changedItems[battler] == ITEM_NONE - && ItemId_GetHoldEffect(itemId) != HOLD_EFFECT_EJECT_BUTTON - && ItemId_GetHoldEffect(itemId) != HOLD_EFFECT_EJECT_PACK - && gBattleStruct->debugHoldEffects[battler] != HOLD_EFFECT_EJECT_BUTTON - && gBattleStruct->debugHoldEffects[battler] != HOLD_EFFECT_EJECT_BUTTON + && GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_EJECT_BUTTON + && GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_EJECT_PACK && !(B_SYMBIOSIS_GEMS >= GEN_7 && gSpecialStatuses[battler].gemBoost) && gCurrentMove != MOVE_FLING //Fling and damage-reducing berries are handled separately. && !gSpecialStatuses[battler].berryReduced From cbe8f3000104a841132dbb61f7109ea6bd9d76b2 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Sat, 21 May 2022 12:54:02 +0200 Subject: [PATCH 042/155] added FLAG_ADVENTURE_STARTED to cheat start --- data/scripts/debug.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index 70401564e9..4ced7d9716 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -15,6 +15,7 @@ Debug_CheatStart:: setflag FLAG_SYS_POKEMON_GET setflag FLAG_RESCUED_BIRCH setflag FLAG_HIDE_ROUTE_101_BIRCH_ZIGZAGOON_BATTLE + setflag FLAG_ADVENTURE_STARTED clearflag FLAG_HIDE_LITTLEROOT_TOWN_BIRCHS_LAB_BIRCH setflag FLAG_HIDE_ROUTE_101_BIRCH_STARTERS_BAG setvar VAR_BIRCH_LAB_STATE, 2 From d0a2be963068072fbdd59f5608cb39dbb0f32c42 Mon Sep 17 00:00:00 2001 From: Sneed69 Date: Sun, 22 May 2022 01:44:51 +0300 Subject: [PATCH 043/155] weather forms fixes and config --- asm/macros/battle_script.inc | 4 +- data/battle_anim_scripts.s | 12 +-- data/battle_scripts_1.s | 27 ++++--- include/battle_scripts.h | 2 +- include/battle_util.h | 2 +- include/constants/battle_config.h | 1 + include/constants/battle_script_commands.h | 5 +- src/battle_script_commands.c | 40 ++++++++-- src/battle_util.c | 93 ++++++++++++++++++---- 9 files changed, 139 insertions(+), 47 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index b434332054..dc258e9aae 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1186,11 +1186,11 @@ .byte 0xe5 .endm - .macro docastformchangeanimation + .macro doweatherformchangeanimation .byte 0xe6 .endm - .macro trycastformdatachange + .macro tryweatherformdatachange .byte 0xe7 .endm diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index d76aff05a6..098419c008 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -796,7 +796,7 @@ gBattleAnims_StatusConditions:: .align 2 gBattleAnims_General:: - .4byte General_CastformChange @ B_ANIM_CASTFORM_CHANGE + .4byte General_WeatherFormChange @ B_ANIM_CASTFORM_CHANGE .4byte General_StatsChange @ B_ANIM_STATS_CHANGE .4byte General_SubstituteFade @ B_ANIM_SUBSTITUTE_FADE .4byte General_SubstituteAppear @ B_ANIM_SUBSTITUTE_APPEAR @@ -24152,11 +24152,11 @@ Status_Nightmare: Status_Powder: end -General_CastformChange: +General_WeatherFormChange: createvisualtask AnimTask_IsMonInvisible, 2 - jumpreteq TRUE, CastformChangeSkipAnim - goto CastformChangeContinue -CastformChangeContinue: + jumpreteq TRUE, WeatherFormChangeSkipAnim + goto WeatherFormChangeContinue +WeatherFormChangeContinue: monbg ANIM_ATTACKER playsewithpan SE_M_TELEPORT, SOUND_PAN_ATTACKER waitplaysewithpan SE_M_MINIMIZE, SOUND_PAN_ATTACKER, 48 @@ -24164,7 +24164,7 @@ CastformChangeContinue: waitforvisualfinish clearmonbg ANIM_ATTACKER end -CastformChangeSkipAnim: +WeatherFormChangeSkipAnim: createvisualtask AnimTask_CastformGfxDataChange, 2, 1 end diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a9c15040d3..c79ba5e9c2 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6511,11 +6511,9 @@ BattleScript_LearnMoveReturn:: BattleScript_RainContinuesOrEnds:: printfromtable gRainContinuesStringIds waitmessage B_WAIT_TIME_LONG - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainEnds + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainContinuesOrEndsEnd playanimation BS_ATTACKER, B_ANIM_RAIN_CONTINUES - end2 -BattleScript_RainEnds:: - call BattleScript_WeatherFormChanges +BattleScript_RainContinuesOrEndsEnd:: end2 BattleScript_DamagingWeatherContinues:: @@ -6554,7 +6552,6 @@ BattleScript_DamagingWeatherContinuesEnd:: BattleScript_SandStormHailEnds:: printfromtable gSandStormHailEndStringIds waitmessage B_WAIT_TIME_LONG - call BattleScript_WeatherFormChanges end2 BattleScript_SunlightContinues:: @@ -6566,7 +6563,6 @@ BattleScript_SunlightContinues:: BattleScript_SunlightFaded:: printstring STRINGID_SUNLIGHTFADED waitmessage B_WAIT_TIME_LONG - call BattleScript_WeatherFormChanges end2 BattleScript_OverworldWeatherStarts:: @@ -8167,19 +8163,28 @@ BattleScript_ShedSkinActivates:: BattleScript_WeatherFormChanges:: setbyte sBATTLER, 0 BattleScript_WeatherFormChangesLoop:: - trycastformdatachange + tryweatherformdatachange addbyte sBATTLER, 1 jumpifbytenotequal sBATTLER, gBattlersCount, BattleScript_WeatherFormChangesLoop return -BattleScript_CastformChange:: - call BattleScript_DoCastformChange +BattleScript_WeatherFormChange:: + call BattleScript_DoWeatherFormChange end3 -BattleScript_DoCastformChange:: +BattleScript_DoWeatherFormChange:: copybyte gBattlerAbility, sBATTLER + jumpifspecies BS_SCRIPTING, SPECIES_CASTFORM, BattleScript_DoWeatherFormChange_ForecastCheck +BattleScript_DoWeatherFormChange_FlowerGiftCheck: + jumpifability BS_SCRIPTING, ABILITY_FLOWER_GIFT, BattleScript_DoWeatherFormChange_PopUp + goto BattleScript_DoWeatherFormChange_AfterPopUp +BattleScript_DoWeatherFormChange_ForecastCheck: + jumpifability BS_SCRIPTING, ABILITY_FORECAST, BattleScript_DoWeatherFormChange_PopUp + goto BattleScript_DoWeatherFormChange_AfterPopUp +BattleScript_DoWeatherFormChange_PopUp: call BattleScript_AbilityPopUp - docastformchangeanimation +BattleScript_DoWeatherFormChange_AfterPopUp: + doweatherformchangeanimation waitstate printstring STRINGID_PKMNTRANSFORMED waitmessage B_WAIT_TIME_LONG diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 4134a87dcf..d44598789f 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -151,7 +151,7 @@ extern const u8 BattleScript_SandstreamActivates[]; extern const u8 BattleScript_ShedSkinActivates[]; extern const u8 BattleScript_WeatherFormChanges[]; extern const u8 BattleScript_WeatherFormChangesLoop[]; -extern const u8 BattleScript_CastformChange[]; +extern const u8 BattleScript_WeatherFormChange[]; extern const u8 BattleScript_IntimidateActivatesEnd3[]; extern const u8 BattleScript_IntimidateActivates[]; extern const u8 BattleScript_DroughtActivates[]; diff --git a/include/battle_util.h b/include/battle_util.h index f1864f0967..4ebe3c8d4e 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -16,7 +16,7 @@ #define ABILITYEFFECT_MOVE_END_ATTACKER 4 #define ABILITYEFFECT_MOVE_END 5 #define ABILITYEFFECT_IMMUNITY 6 -#define ABILITYEFFECT_FORECAST 7 +#define ABILITYEFFECT_WEATHER_FORM 7 #define ABILITYEFFECT_SYNCHRONIZE 8 #define ABILITYEFFECT_ATK_SYNCHRONIZE 9 #define ABILITYEFFECT_INTIMIDATE1 10 diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 74ac9e1299..e68f40fc54 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -190,6 +190,7 @@ #define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. #define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. It also activates Rattled. #define B_OBLIVIOUS_TAUNT GEN_7 // In Gen6+, Pokémon with Oblivious can't be taunted. +#define B_WEATHER_FORMS GEN_5 // In Gen5+, Castform and Cherrim revert to their base form upon losing their respective ability. Cherrim needs Flower Gift to swap forms. // Item settings #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index da44714e21..16d911e6fa 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -310,8 +310,9 @@ #define MOVEEND_PICKPOCKET 27 #define MOVEEND_DANCER 28 #define MOVEEND_EMERGENCY_EXIT 29 -#define MOVEEND_CLEAR_BITS 30 -#define MOVEEND_COUNT 31 +#define MOVEEND_WEATHER_FORM 30 +#define MOVEEND_CLEAR_BITS 31 +#define MOVEEND_COUNT 32 // switch cases #define B_SWITCH_NORMAL 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 15915c71a6..7ba9ad1766 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -537,8 +537,8 @@ static void Cmd_switchoutabilities(void); static void Cmd_jumpifhasnohp(void); static void Cmd_getsecretpowereffect(void); static void Cmd_pickup(void); -static void Cmd_docastformchangeanimation(void); -static void Cmd_trycastformdatachange(void); +static void Cmd_doweatherformchangeanimation(void); +static void Cmd_tryweatherformdatachange(void); static void Cmd_settypebasedhalvers(void); static void Cmd_jumpifsubstituteblocks(void); static void Cmd_tryrecycleitem(void); @@ -796,8 +796,8 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_jumpifhasnohp, //0xE3 Cmd_getsecretpowereffect, //0xE4 Cmd_pickup, //0xE5 - Cmd_docastformchangeanimation, //0xE6 - Cmd_trycastformdatachange, //0xE7 + Cmd_doweatherformchangeanimation, //0xE6 + Cmd_tryweatherformdatachange, //0xE7 Cmd_settypebasedhalvers, //0xE8 Cmd_jumpifsubstituteblocks, //0xE9 Cmd_tryrecycleitem, //0xEA @@ -5601,6 +5601,30 @@ static void Cmd_moveend(void) } gBattleScripting.moveendState++; break; + case MOVEEND_WEATHER_FORM: + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + switch (gBattleMons[i].species) + { + case SPECIES_CASTFORM: + case SPECIES_CHERRIM: +#ifdef POKEMON_EXPANSION + case SPECIES_CASTFORM_RAINY: + case SPECIES_CASTFORM_SNOWY: + case SPECIES_CASTFORM_SUNNY: + case SPECIES_CHERRIM_SUNSHINE: +#endif + effect = TryWeatherFormChange(i); + if (effect) + { + BattleScriptPushCursorAndCallback(BattleScript_WeatherFormChange); + gBattleScripting.battler = i; + gBattleStruct->formToChangeInto = effect - 1; + } + } + } + gBattleScripting.moveendState++; + break; case MOVEEND_CLEAR_BITS: // Clear/Set bits for things like using a move for all targets and all hits. if (gSpecialStatuses[gBattlerAttacker].instructedChosenTarget) *(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].instructedChosenTarget & 0x3; @@ -6415,7 +6439,7 @@ static void Cmd_switchineffects(void) || ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE) || AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE2, 0, 0, 0, 0) || AbilityBattleEffects(ABILITYEFFECT_TRACE2, 0, 0, 0, 0) - || AbilityBattleEffects(ABILITYEFFECT_FORECAST, 0, 0, 0, 0)) + || AbilityBattleEffects(ABILITYEFFECT_WEATHER_FORM, 0, 0, 0, 0)) return; gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED | SIDE_STATUS_TOXIC_SPIKES_DAMAGED | SIDE_STATUS_STEALTH_ROCK_DAMAGED | SIDE_STATUS_STICKY_WEB_DAMAGED); @@ -13267,7 +13291,7 @@ static void Cmd_pickup(void) gBattlescriptCurrInstr++; } -static void Cmd_docastformchangeanimation(void) +static void Cmd_doweatherformchangeanimation(void) { gActiveBattler = gBattleScripting.battler; @@ -13280,7 +13304,7 @@ static void Cmd_docastformchangeanimation(void) gBattlescriptCurrInstr++; } -static void Cmd_trycastformdatachange(void) +static void Cmd_tryweatherformdatachange(void) { u8 form; @@ -13288,7 +13312,7 @@ static void Cmd_trycastformdatachange(void) form = TryWeatherFormChange(gBattleScripting.battler); if (form) { - BattleScriptPushCursorAndCallback(BattleScript_CastformChange); + BattleScriptPushCursorAndCallback(BattleScript_WeatherFormChange); *(&gBattleStruct->formToChangeInto) = form - 1; } } diff --git a/src/battle_util.c b/src/battle_util.c index d0ff7c5beb..03e6bc2405 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2104,6 +2104,7 @@ enum ENDTURN_ION_DELUGE, ENDTURN_FAIRY_LOCK, ENDTURN_RETALIATE, + ENDTURN_WEATHER_FORM, ENDTURN_FIELD_COUNT, }; @@ -2551,6 +2552,10 @@ u8 DoFieldEndTurnEffects(void) gSideTimers[B_SIDE_OPPONENT].retaliateTimer--; gBattleStruct->turnCountersTracker++; break; + case ENDTURN_WEATHER_FORM: + AbilityBattleEffects(ABILITYEFFECT_WEATHER_FORM, 0, 0, 0, 0); + gBattleStruct->turnCountersTracker++; + break; case ENDTURN_FIELD_COUNT: effect++; break; @@ -3902,21 +3907,49 @@ u8 TryWeatherFormChange(u8 battler) bool32 weatherEffect = WEATHER_HAS_EFFECT; u16 holdEffect = GetBattlerHoldEffect(battler, TRUE); - if (gBattleMons[battler].species == SPECIES_CASTFORM) + switch (gBattleMons[battler].species) { + case SPECIES_CASTFORM: +#ifdef POKEMON_EXPANSION + case SPECIES_CASTFORM_RAINY: + case SPECIES_CASTFORM_SNOWY: + case SPECIES_CASTFORM_SUNNY: +#endif +#if B_WEATHER_FORMS >= GEN_5 + if (gBattleMons[battler].hp == 0) + { + ret = 0; // No change + } + else if (GetBattlerAbility(battler) != ABILITY_FORECAST || !weatherEffect) + { + if (!IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL)) + { + SET_BATTLER_TYPE(battler, TYPE_NORMAL); + ret = CASTFORM_NORMAL + 1; + } + else + { + ret = 0; // No change + } + } +#else if (GetBattlerAbility(battler) != ABILITY_FORECAST || gBattleMons[battler].hp == 0) { ret = 0; // No change } - else if (!weatherEffect && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL)) - { - SET_BATTLER_TYPE(battler, TYPE_NORMAL); - ret = CASTFORM_NORMAL + 1; - } else if (!weatherEffect) { - ret = 0; // No change + if (!IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL)) + { + SET_BATTLER_TYPE(battler, TYPE_NORMAL); + ret = CASTFORM_NORMAL + 1; + } + else + { + ret = 0; // No change + } } +#endif else if (holdEffect == HOLD_EFFECT_UTILITY_UMBRELLA || (!(gBattleWeather & (B_WEATHER_RAIN | B_WEATHER_SUN | B_WEATHER_HAIL)) && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL))) { SET_BATTLER_TYPE(battler, TYPE_NORMAL); @@ -3937,15 +3970,25 @@ u8 TryWeatherFormChange(u8 battler) SET_BATTLER_TYPE(battler, TYPE_ICE); ret = CASTFORM_ICE + 1; } - } - else if (gBattleMons[battler].species == SPECIES_CHERRIM) - { - if (GetBattlerAbility(battler) != ABILITY_FLOWER_GIFT || gBattleMons[battler].hp == 0) + break; + case SPECIES_CHERRIM: +#ifdef POKEMON_EXPANSION + case SPECIES_CHERRIM_SUNSHINE: +#endif + if (gBattleMons[battler].hp == 0) ret = 0; // No change +#if B_WEATHER_FORMS >= GEN_5 + if (GetBattlerAbility(battler) != ABILITY_FLOWER_GIFT) + if (gBattleMonForms[battler] != 0) + ret = CHERRIM_OVERCAST + 1; + else + ret = 0; // No change +#endif else if (gBattleMonForms[battler] == 0 && weatherEffect && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & B_WEATHER_SUN) ret = CHERRIM_SUNSHINE + 1; else if (gBattleMonForms[battler] != 0 && (!weatherEffect || holdEffect == HOLD_EFFECT_UTILITY_UMBRELLA || !(gBattleWeather & B_WEATHER_SUN))) ret = CHERRIM_OVERCAST + 1; + break; } return ret; @@ -4543,11 +4586,15 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_FORECAST: +#if B_WEATHER_FORMS >= GEN_5 case ABILITY_FLOWER_GIFT: +#else + TRY_WEATHER_FORM: +#endif effect = TryWeatherFormChange(battler); if (effect) { - BattleScriptPushCursorAndCallback(BattleScript_CastformChange); + BattleScriptPushCursorAndCallback(BattleScript_WeatherFormChange); *(&gBattleStruct->formToChangeInto) = effect - 1; } break; @@ -4623,6 +4670,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move effect++; } break; +#if B_WEATHER_FORMS < GEN_5 + default: + if (gBattleMons[battler].species == SPECIES_CHERRIM) + goto TRY_WEATHER_FORM; + break; +#endif } break; case ABILITYEFFECT_ENDTURN: // 1 @@ -5627,20 +5680,28 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } } break; - case ABILITYEFFECT_FORECAST: // 6 + case ABILITYEFFECT_WEATHER_FORM: // 6 for (battler = 0; battler < gBattlersCount; battler++) { - u16 battlerAbility = GetBattlerAbility(battler); - if (battlerAbility == ABILITY_FORECAST || battlerAbility == ABILITY_FLOWER_GIFT) + switch (gBattleMons[battler].species) { + case SPECIES_CASTFORM: + case SPECIES_CHERRIM: +#ifdef POKEMON_EXPANSION + case SPECIES_CASTFORM_RAINY: + case SPECIES_CASTFORM_SNOWY: + case SPECIES_CASTFORM_SUNNY: + case SPECIES_CHERRIM_SUNSHINE: +#endif effect = TryWeatherFormChange(battler); if (effect) { - BattleScriptPushCursorAndCallback(BattleScript_CastformChange); + BattleScriptPushCursorAndCallback(BattleScript_WeatherFormChange); gBattleScripting.battler = battler; gBattleStruct->formToChangeInto = effect - 1; return effect; } + break; } } break; From cb1c6ffbd20aac331fba8eb27da6937d001a9885 Mon Sep 17 00:00:00 2001 From: sneed Date: Sun, 22 May 2022 03:46:39 +0300 Subject: [PATCH 044/155] comment out placeholders --- src/battle_util.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 03e6bc2405..4db8792364 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3910,11 +3910,10 @@ u8 TryWeatherFormChange(u8 battler) switch (gBattleMons[battler].species) { case SPECIES_CASTFORM: -#ifdef POKEMON_EXPANSION +/* Placeholder case SPECIES_CASTFORM_RAINY: case SPECIES_CASTFORM_SNOWY: - case SPECIES_CASTFORM_SUNNY: -#endif + case SPECIES_CASTFORM_SUNNY:*/ #if B_WEATHER_FORMS >= GEN_5 if (gBattleMons[battler].hp == 0) { @@ -3972,9 +3971,7 @@ u8 TryWeatherFormChange(u8 battler) } break; case SPECIES_CHERRIM: -#ifdef POKEMON_EXPANSION - case SPECIES_CHERRIM_SUNSHINE: -#endif +// case SPECIES_CHERRIM_SUNSHINE: if (gBattleMons[battler].hp == 0) ret = 0; // No change #if B_WEATHER_FORMS >= GEN_5 From fe42eacdf0494637112356294f9af70ba5d8da02 Mon Sep 17 00:00:00 2001 From: sneed Date: Sun, 22 May 2022 05:23:06 +0300 Subject: [PATCH 045/155] tabs over spaces --- data/battle_scripts_1.s | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index c79ba5e9c2..0afe8837a4 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8176,11 +8176,11 @@ BattleScript_DoWeatherFormChange:: copybyte gBattlerAbility, sBATTLER jumpifspecies BS_SCRIPTING, SPECIES_CASTFORM, BattleScript_DoWeatherFormChange_ForecastCheck BattleScript_DoWeatherFormChange_FlowerGiftCheck: - jumpifability BS_SCRIPTING, ABILITY_FLOWER_GIFT, BattleScript_DoWeatherFormChange_PopUp - goto BattleScript_DoWeatherFormChange_AfterPopUp + jumpifability BS_SCRIPTING, ABILITY_FLOWER_GIFT, BattleScript_DoWeatherFormChange_PopUp + goto BattleScript_DoWeatherFormChange_AfterPopUp BattleScript_DoWeatherFormChange_ForecastCheck: - jumpifability BS_SCRIPTING, ABILITY_FORECAST, BattleScript_DoWeatherFormChange_PopUp - goto BattleScript_DoWeatherFormChange_AfterPopUp + jumpifability BS_SCRIPTING, ABILITY_FORECAST, BattleScript_DoWeatherFormChange_PopUp + goto BattleScript_DoWeatherFormChange_AfterPopUp BattleScript_DoWeatherFormChange_PopUp: call BattleScript_AbilityPopUp BattleScript_DoWeatherFormChange_AfterPopUp: From 5b0afffd91cfbb1145163e33ffe729d8a200ad71 Mon Sep 17 00:00:00 2001 From: sneed Date: Sun, 22 May 2022 13:10:51 +0300 Subject: [PATCH 046/155] popup and flower gift description fixes --- data/battle_scripts_1.s | 2 ++ src/data/text/abilities.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0afe8837a4..ba748258b0 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8174,10 +8174,12 @@ BattleScript_WeatherFormChange:: BattleScript_DoWeatherFormChange:: copybyte gBattlerAbility, sBATTLER +.if B_WEATHER_FORMS >= GEN_5 jumpifspecies BS_SCRIPTING, SPECIES_CASTFORM, BattleScript_DoWeatherFormChange_ForecastCheck BattleScript_DoWeatherFormChange_FlowerGiftCheck: jumpifability BS_SCRIPTING, ABILITY_FLOWER_GIFT, BattleScript_DoWeatherFormChange_PopUp goto BattleScript_DoWeatherFormChange_AfterPopUp +.endif BattleScript_DoWeatherFormChange_ForecastCheck: jumpifability BS_SCRIPTING, ABILITY_FORECAST, BattleScript_DoWeatherFormChange_PopUp goto BattleScript_DoWeatherFormChange_AfterPopUp diff --git a/src/data/text/abilities.h b/src/data/text/abilities.h index cdc3276082..ac11b9de8b 100644 --- a/src/data/text/abilities.h +++ b/src/data/text/abilities.h @@ -119,7 +119,7 @@ static const u8 sHoneyGatherDescription[] = _("May gather Honey."); static const u8 sFriskDescription[] = _("Checks a foe's item."); static const u8 sRecklessDescription[] = _("Boosts moves with recoil."); static const u8 sMultitypeDescription[] = _("Changes type to its Plate."); -static const u8 sFlowerGiftDescription[] = _("Transforms in sunshine."); +static const u8 sFlowerGiftDescription[] = _("Allies power up in sunshine."); static const u8 sBadDreamsDescription[] = _("Damages sleeping Pokémon."); static const u8 sPickpocketDescription[] = _("Steals the foe's held item."); static const u8 sSheerForceDescription[] = _("Trades effects for power."); From b95e450cb6208132596be8e721c4b73a751456d4 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Thu, 11 Aug 2022 22:48:36 -0600 Subject: [PATCH 047/155] Added corner case logic for AI Switching. 1. Refactor Perish Song 2. Yawn 3. Secondary Damage (Leech Seed, Cursed etc). 4. Added Preliminary logic to help AI be smarter against semi-invulnerable Added AI logic regarding abilities that benefit from switching 1. Natural Cure 2. Regenerator --- include/battle_util.h | 1 + src/battle_ai_switch_items.c | 212 +++++++++++++++++++++++++++-------- 2 files changed, 168 insertions(+), 45 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index e45acdb893..25226c9976 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -105,6 +105,7 @@ bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2); u8 TryWeatherFormChange(u8 battlerId); bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility); u8 AbilityBattleEffects(u8 caseID, u8 battlerId, u16 ability, u8 special, u16 moveArg); +bool32 IsNeutralizingGasOnField(void); u32 GetBattlerAbility(u8 battlerId); u32 IsAbilityOnSide(u32 battlerId, u32 ability); u32 IsAbilityOnOpposingSide(u32 battlerId, u32 ability); diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 034bb59e84..bc26f78cf9 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -1,10 +1,13 @@ #include "global.h" #include "battle.h" +#include "constants/battle_ai.h" #include "battle_ai_main.h" #include "battle_ai_util.h" +#include "battle_util.h" #include "battle_anim.h" #include "battle_controllers.h" #include "battle_main.h" +#include "constants/hold_effects.h" #include "battle_setup.h" #include "data.h" #include "pokemon.h" @@ -19,6 +22,7 @@ static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng); static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent); static bool8 ShouldUseItem(void); +static bool32 AiExpectsToFaintPlayer(void); static bool32 AI_ShouldHeal(u32 healAmount); static bool32 AI_OpponentCanFaintAiWithMod(u32 healAmount); @@ -56,21 +60,6 @@ static bool8 ShouldSwitchIfAllBadMoves(void) } } -static bool8 ShouldSwitchIfPerishSong(void) -{ - if (gStatuses3[gActiveBattler] & STATUS3_PERISH_SONG - && gDisableStructs[gActiveBattler].perishSongTimer == 0) - { - *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; - BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); - return TRUE; - } - else - { - return FALSE; - } -} - static bool8 ShouldSwitchIfWonderGuard(void) { u8 opposingPosition; @@ -228,44 +217,177 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) return FALSE; } -static bool8 ShouldSwitchIfNaturalCure(void) +static bool8 ShouldSwitchIfGameStatePrompt(void) { - if (!(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)) - return FALSE; - if (AI_GetAbility(gActiveBattler) != ABILITY_NATURAL_CURE) - return FALSE; - if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 2) - return FALSE; + bool8 switchMon = FALSE; + u16 monAbility = AI_GetAbility(gActiveBattler); + u16 holdEffect = AI_GetHoldEffect(gActiveBattler); + u8 opposingPosition = BATTLE_OPPOSITE(GetBattlerPosition(gActiveBattler)); + u8 opposingBattler = GetBattlerAtPosition(opposingPosition); + s32 moduloChance = 4; //25% Chance Default + s32 chanceReducer = 1; //No Reduce default. Increase to reduce - if ((gLastLandedMoves[gActiveBattler] == MOVE_NONE - || gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE) - && Random() & 1) + + if (AnyStatIsRaised(gActiveBattler)) + chanceReducer = 5; // Reduce switchout probability by factor of 5 if setup + + //Perish Song + if (gStatuses3[gActiveBattler] & STATUS3_PERISH_SONG + && gDisableStructs[gActiveBattler].perishSongTimer == 0 + && monAbility != ABILITY_SOUNDPROOF) + switchMon = TRUE; + + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_SMART_SWITCHING) + { + //Yawn + if (gStatuses3[gActiveBattler] & STATUS3_YAWN + && AI_CanSleep(gActiveBattler, monAbility) + && gBattleMons[gActiveBattler].hp > gBattleMons[gActiveBattler].maxHP / 3) + { + switchMon = TRUE; + + //ToDo: + //Double Battles + //Add logic checking to see if effected by yawn & ally wants to switch out to a pokemon that will set Misty or Electric Terrain + + //Check if Active Pokemon can KO opponent instead of switching + //Will still fall asleep, but take out opposing Pokemon first + if (AiExpectsToFaintPlayer()) + switchMon = FALSE; + + //Checks to see if active Pokemon can do something against sleep + if (monAbility == (ABILITY_NATURAL_CURE | ABILITY_SHED_SKIN | ABILITY_EARLY_BIRD) + || holdEffect == (HOLD_EFFECT_CURE_SLP | HOLD_EFFECT_CURE_STATUS) + || HasMove(gActiveBattler, MOVE_SLEEP_TALK) + || (HasMoveEffect(gActiveBattler, MOVE_SNORE) && AI_GetTypeEffectiveness(MOVE_SNORE, gActiveBattler, opposingBattler) >= UQ_4_12(1.0)) + || (IsBattlerGrounded(gActiveBattler) + && (HasMove(gActiveBattler, MOVE_MISTY_TERRAIN) || HasMove(gActiveBattler, MOVE_ELECTRIC_TERRAIN))) + ) + switchMon = FALSE; + + //Check if Active Pokemon evasion boosted and might be able to dodge until awake + if (gBattleMons[gActiveBattler].statStages[STAT_EVASION] > (DEFAULT_STAT_STAGE + 3) + && AI_GetAbility(opposingBattler) != ABILITY_UNAWARE + && AI_GetAbility(opposingBattler) != ABILITY_KEEN_EYE + && !(gBattleMons[gActiveBattler].status2 & STATUS2_FORESIGHT) + && !(gStatuses3[gActiveBattler] & STATUS3_MIRACLE_EYED)) + switchMon = FALSE; + + } + + //Secondary Damage + if (monAbility != ABILITY_MAGIC_GUARD + && !AiExpectsToFaintPlayer()) + { + //Toxic + moduloChance = 2; //50% + if (gBattleMons[gActiveBattler].status1 & (STATUS1_TOXIC_COUNTER > 2) + && gBattleMons[gActiveBattler].hp >= (gBattleMons[gActiveBattler].maxHP / 3) + && (Random() % (moduloChance*chanceReducer)) == 0) + switchMon = TRUE; + + //Cursed + moduloChance = 2; //50% + if (gBattleMons[gActiveBattler].status2 & STATUS2_CURSED + && (Random() % (moduloChance*chanceReducer)) == 0) + switchMon = TRUE; + + //Nightmare + moduloChance = 3; //33.3% + if (gBattleMons[gActiveBattler].status1 & (STATUS1_SLEEP > 1) && gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE + && (Random() % (moduloChance*chanceReducer)) == 0) + switchMon = TRUE; + + //Leech Seed + moduloChance = 4; //25% + if (gStatuses3[gActiveBattler] & STATUS3_LEECHSEED + && (Random() % (moduloChance*chanceReducer)) == 0) + switchMon = TRUE; + } + + //Infatuation + if (gBattleMons[gActiveBattler].status2 & STATUS2_INFATUATION + && !AiExpectsToFaintPlayer()) + switchMon = TRUE; + + //Todo + //Pass Wish Heal + + //Semi-Invulnerable + if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) + if (FindMonThatAbsorbsOpponentsMove()) //If find absorber default to switch + switchMon = TRUE; + if (!AI_OpponentCanFaintAiWithMod(0) + && AnyStatIsRaised(gActiveBattler)) + switchMon = FALSE; + if (AiExpectsToFaintPlayer() + && GetAIChosenMove(gActiveBattler) == AI_IS_SLOWER + && !AI_OpponentCanFaintAiWithMod(0)) + switchMon = FALSE; + } + + + if (switchMon) { *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); return TRUE; } - else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0 - && Random() & 1) - { - *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; - BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); - return TRUE; + else + return FALSE; +} + +static bool8 ShouldSwitchIfAbilityBenefit(void) +{ + s32 monToSwitchId; + s32 moduloChance = 4; //25% Chance Default + s32 chanceReducer = 1; //No Reduce default. Increase to reduce + u8 battlerId = GetBattlerPosition(gActiveBattler); + + if (AnyStatIsRaised(battlerId)) + chanceReducer = 5; // Reduce switchout probability by factor of 5 if setup + + //Check if ability is blocked + if (gStatuses3[gActiveBattler] & STATUS3_GASTRO_ACID + ||IsNeutralizingGasOnField()) + return FALSE; + + switch(AI_GetAbility(gActiveBattler)) { + case ABILITY_NATURAL_CURE: + moduloChance = 4; //25% + //Attempt to cure bad ailment + if (gBattleMons[gActiveBattler].status1 & (STATUS1_SLEEP | STATUS1_FREEZE | STATUS1_TOXIC_POISON) + && GetMostSuitableMonToSwitchInto() != PARTY_SIZE) + break; + //Attempt to cure lesser ailment + if ((gBattleMons[gActiveBattler].status1 & STATUS1_ANY) + && (gBattleMons[gActiveBattler].hp >= gBattleMons[gActiveBattler].maxHP / 2) + && GetMostSuitableMonToSwitchInto() != PARTY_SIZE + && Random() % (moduloChance*chanceReducer) == 0) + break; + + return FALSE; + + case ABILITY_REGENERATOR: + moduloChance = 2; //50% + //Don't switch if ailment + if (gBattleMons[gActiveBattler].status1 & STATUS1_ANY) + return FALSE; + if ((gBattleMons[gActiveBattler].hp <= ((gBattleMons[gActiveBattler].maxHP * 2) / 3)) + && GetMostSuitableMonToSwitchInto() != PARTY_SIZE + && Random() % (moduloChance*chanceReducer) == 0) + break; + + return FALSE; + + default: + return FALSE; } - if (FindMonWithFlagsAndSuperEffective(MOVE_RESULT_DOESNT_AFFECT_FOE, 1)) - return TRUE; - if (FindMonWithFlagsAndSuperEffective(MOVE_RESULT_NOT_VERY_EFFECTIVE, 1)) - return TRUE; + *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; + BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); - if (Random() & 1) - { - *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; - BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); - return TRUE; - } - - return FALSE; + return TRUE; } static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng) @@ -489,13 +611,13 @@ bool32 ShouldSwitch(void) return FALSE; if (ShouldSwitchIfAllBadMoves()) return TRUE; - if (ShouldSwitchIfPerishSong()) + if (ShouldSwitchIfGameStatePrompt()) return TRUE; if (ShouldSwitchIfWonderGuard()) return TRUE; if (FindMonThatAbsorbsOpponentsMove()) return TRUE; - if (ShouldSwitchIfNaturalCure()) + if (ShouldSwitchIfAbilityBenefit()) return TRUE; if (HasSuperEffectiveMoveAgainstOpponents(FALSE)) return FALSE; From 7378d1099b3df6e39b25c819197f53f5c4e8fd55 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Fri, 12 Aug 2022 15:21:25 -0600 Subject: [PATCH 048/155] Removed AI_GetAbility Misc cleanup --- src/battle_ai_switch_items.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index bc26f78cf9..5b4b1a30b4 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -1,6 +1,5 @@ #include "global.h" #include "battle.h" -#include "constants/battle_ai.h" #include "battle_ai_main.h" #include "battle_ai_util.h" #include "battle_util.h" @@ -169,7 +168,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) else return FALSE; - if (AI_GetAbility(gActiveBattler) == absorbingTypeAbility) + if (AI_DATA->abilities[gActiveBattler]) == absorbingTypeAbility) return FALSE; GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); @@ -220,8 +219,8 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) static bool8 ShouldSwitchIfGameStatePrompt(void) { bool8 switchMon = FALSE; - u16 monAbility = AI_GetAbility(gActiveBattler); - u16 holdEffect = AI_GetHoldEffect(gActiveBattler); + u16 monAbility = AI_DATA->abilities[gActiveBattler]; + u16 holdEffect = AI_DATA->holdEffects[gActiveBattler]; u8 opposingPosition = BATTLE_OPPOSITE(GetBattlerPosition(gActiveBattler)); u8 opposingBattler = GetBattlerAtPosition(opposingPosition); s32 moduloChance = 4; //25% Chance Default @@ -267,8 +266,8 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) //Check if Active Pokemon evasion boosted and might be able to dodge until awake if (gBattleMons[gActiveBattler].statStages[STAT_EVASION] > (DEFAULT_STAT_STAGE + 3) - && AI_GetAbility(opposingBattler) != ABILITY_UNAWARE - && AI_GetAbility(opposingBattler) != ABILITY_KEEN_EYE + && AI_DATA->abilities[opposingBattler] != ABILITY_UNAWARE + && AI_DATA->abilities[opposingBattler] != ABILITY_KEEN_EYE && !(gBattleMons[gActiveBattler].status2 & STATUS2_FORESIGHT) && !(gStatuses3[gActiveBattler] & STATUS3_MIRACLE_EYED)) switchMon = FALSE; @@ -334,7 +333,9 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) return TRUE; } else + { return FALSE; + } } static bool8 ShouldSwitchIfAbilityBenefit(void) @@ -352,7 +353,7 @@ static bool8 ShouldSwitchIfAbilityBenefit(void) ||IsNeutralizingGasOnField()) return FALSE; - switch(AI_GetAbility(gActiveBattler)) { + switch(AI_DATA->abilities[gActiveBattler]) { case ABILITY_NATURAL_CURE: moduloChance = 4; //25% //Attempt to cure bad ailment From bb978764f373bc90c7bbf3d9155393e98cfcf191 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Sat, 13 Aug 2022 00:39:44 -0600 Subject: [PATCH 049/155] Fixed recommended changes Added additional double battle logic for yawn --- src/battle_ai_switch_items.c | 54 +++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 5b4b1a30b4..3b00340d27 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -1,5 +1,6 @@ #include "global.h" #include "battle.h" +#include "constants/battle_ai.h" #include "battle_ai_main.h" #include "battle_ai_util.h" #include "battle_util.h" @@ -14,6 +15,7 @@ #include "util.h" #include "constants/abilities.h" #include "constants/item_effects.h" +#include "constants/battle_move_effects.h" #include "constants/items.h" #include "constants/moves.h" @@ -168,7 +170,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) else return FALSE; - if (AI_DATA->abilities[gActiveBattler]) == absorbingTypeAbility) + if (AI_DATA->abilities[gActiveBattler] == absorbingTypeAbility) return FALSE; GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); @@ -225,6 +227,10 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) u8 opposingBattler = GetBattlerAtPosition(opposingPosition); s32 moduloChance = 4; //25% Chance Default s32 chanceReducer = 1; //No Reduce default. Increase to reduce + s32 firstId; + s32 lastId; + s32 i; + struct Pokemon *party; if (AnyStatIsRaised(gActiveBattler)) @@ -245,10 +251,50 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) { switchMon = TRUE; - //ToDo: - //Double Battles - //Add logic checking to see if effected by yawn & ally wants to switch out to a pokemon that will set Misty or Electric Terrain + //Double Battles + //Check if partner can prevent sleep + if (IsDoubleBattle()) + { + if (IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)) + && (GetAIChosenMove(BATTLE_PARTNER(gActiveBattler)) & MOVE_UPROAR) + ) + switchMon = FALSE; + if (IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)) + && (gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_MISTY_TERRAIN + || gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_ELECTRIC_TERRAIN) + && IsBattlerGrounded(gActiveBattler) + ) + switchMon = FALSE; + + if (*(gBattleStruct->AI_monToSwitchIntoId + BATTLE_PARTNER(gActiveBattler)) != PARTY_SIZE) //Partner is switching + { + GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); + + if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) + party = gPlayerParty; + + for (i = firstId; i < lastId; i++) + { + //Look for mon in party that is able to be switched into and has ability that sets terrain + if (GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG + && i != gBattlerPartyIndexes[gActiveBattler] + && i != gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)] + && IsBattlerGrounded(gActiveBattler) + && (GetMonData(&party[i], MON_DATA_ABILITY_NUM) == 226 + || GetMonData(&party[i], MON_DATA_ABILITY_NUM) == 228)) //Ally has Misty or Electric Surge + { + *(gBattleStruct->AI_monToSwitchIntoId + BATTLE_PARTNER(gActiveBattler)) = i; + BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); + switchMon = FALSE; + break; + } + } + } + } + //Check if Active Pokemon can KO opponent instead of switching //Will still fall asleep, but take out opposing Pokemon first if (AiExpectsToFaintPlayer()) From a4b53126f639439a0901d94fbdedd8c4a9dfd5cd Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Wed, 17 Aug 2022 18:23:12 -0600 Subject: [PATCH 050/155] Added AI_FLAG_ACE_POKEMON When this flag is set, the trainer will have an "Ace" pokemon that will always be sent out last. If this flag is set, the last Pokemon in the party will be considered the "Ace" Pokemon. This is similar to the gym leader functionality found in Sword & Shield. --- include/constants/battle_ai.h | 1 + src/battle_ai_switch_items.c | 24 ++++++++++++++++++++++-- src/battle_controller_opponent.c | 30 ++++++++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index d48827683a..a7a3e54183 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -56,6 +56,7 @@ #define AI_FLAG_STALL (1 << 13) // AI stalls battle and prefers secondary damage/trapping/etc. TODO not finished #define AI_FLAG_SCREENER (1 << 14) // AI prefers screening effects like reflect, mist, etc. TODO unfinished #define AI_FLAG_SMART_SWITCHING (1 << 15) // AI includes a lot more switching checks +#define AI_FLAG_ACE_POKEMON (1 << 16) // AI has Ace Pokemon -- Saves until last // 'other' ai logic flags #define AI_FLAG_ROAMING (1 << 29) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 3b00340d27..329d3ebf35 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -199,6 +199,10 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1)) + continue; + species = GetMonData(&party[i], MON_DATA_SPECIES); if (GetMonData(&party[i], MON_DATA_ABILITY_NUM) != 0) @@ -276,6 +280,10 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) for (i = firstId; i < lastId; i++) { + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1)) + break; + //Look for mon in party that is able to be switched into and has ability that sets terrain if (GetMonData(&party[i], MON_DATA_HP) != 0 && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE @@ -562,6 +570,10 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1)) + continue; + species = GetMonData(&party[i], MON_DATA_SPECIES); if (GetMonData(&party[i], MON_DATA_ABILITY_NUM) != 0) @@ -650,6 +662,9 @@ bool32 ShouldSwitch(void) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1)) + continue; availableToSwitch++; } @@ -712,7 +727,7 @@ void AI_TrySwitchOrUseItem(void) GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); - for (monToSwitchId = firstId; monToSwitchId < lastId; monToSwitchId++) + for (monToSwitchId = (lastId-1); monToSwitchId >= firstId; monToSwitchId--) { if (GetMonData(&party[monToSwitchId], MON_DATA_HP) == 0) continue; @@ -724,6 +739,9 @@ void AI_TrySwitchOrUseItem(void) continue; if (monToSwitchId == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && monToSwitchId == (CalculateEnemyPartyCount()-1)) + continue; break; } @@ -921,7 +939,9 @@ u8 GetMostSuitableMonToSwitchInto(void) || gBattlerPartyIndexes[battlerIn2] == i || i == *(gBattleStruct->monToSwitchIntoId + battlerIn1) || i == *(gBattleStruct->monToSwitchIntoId + battlerIn2) - || (GetMonAbility(&party[i]) == ABILITY_TRUANT && IsTruantMonVulnerable(gActiveBattler, opposingBattler))) // While not really invalid per say, not really wise to switch into this mon. + || (GetMonAbility(&party[i]) == ABILITY_TRUANT && IsTruantMonVulnerable(gActiveBattler, opposingBattler)) // While not really invalid per say, not really wise to switch into this mon. + || (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1))) //Save Ace Pokemon for last invalidMons |= gBitTable[i]; else aliveCount++; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 501e31704c..ddc4c44052 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -2,6 +2,7 @@ #include "battle.h" #include "battle_ai_main.h" #include "battle_ai_util.h" +#include "constants/battle_ai.h" #include "battle_anim.h" #include "battle_arena.h" #include "battle_controllers.h" @@ -94,6 +95,7 @@ static void OpponentHandleResetActionMoveSelection(void); static void OpponentHandleEndLinkBattle(void); static void OpponentHandleDebugMenu(void); static void OpponentCmdEnd(void); +static u8 CountAIAliveNonEggMonsExcept(u8 slotToIgnore); static void OpponentBufferRunCommand(void); static void OpponentBufferExecCompleted(void); @@ -1670,6 +1672,7 @@ static void OpponentHandleChooseItem(void) static void OpponentHandleChoosePokemon(void) { s32 chosenMonId; + s32 pokemonInBattle = 1; if (*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) == PARTY_SIZE) { @@ -1687,15 +1690,20 @@ static void OpponentHandleChoosePokemon(void) { battler1 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); battler2 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); + pokemonInBattle = 2; + } GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); - for (chosenMonId = firstId; chosenMonId < lastId; chosenMonId++) + for (chosenMonId = (lastId-1); chosenMonId >= firstId; chosenMonId--) { if (GetMonData(&gEnemyParty[chosenMonId], MON_DATA_HP) != 0 && chosenMonId != gBattlerPartyIndexes[battler1] - && chosenMonId != gBattlerPartyIndexes[battler2]) + && chosenMonId != gBattlerPartyIndexes[battler2] + && (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && (!(chosenMonId == (CalculateEnemyPartyCount()-1)) + || CountAIAliveNonEggMonsExcept(PARTY_SIZE) == pokemonInBattle))) { break; } @@ -1714,6 +1722,24 @@ static void OpponentHandleChoosePokemon(void) OpponentBufferExecCompleted(); } +static u8 CountAIAliveNonEggMonsExcept(u8 slotToIgnore) +{ + u16 i, count; + + for (i = 0, count = 0; i < PARTY_SIZE; i++) + { + if (i != slotToIgnore + && GetMonData(&gEnemyParty[i], MON_DATA_SPECIES) != SPECIES_NONE + && !GetMonData(&gEnemyParty[i], MON_DATA_IS_EGG) + && GetMonData(&gEnemyParty[i], MON_DATA_HP) != 0) + { + count++; + } + } + + return count; +} + static void OpponentHandleCmd23(void) { OpponentBufferExecCompleted(); From 327782646b7de17a94b39741a55ba467d6d934df Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 23 Aug 2022 01:07:25 +0200 Subject: [PATCH 051/155] Save party mons ai --- Makefile | 2 +- NO$GBA.EXE - Shortcut.lnk | Bin 0 -> 1536 bytes include/battle.h | 24 ++- include/battle_ai_main.h | 2 + src/battle_ai_main.c | 306 +++++++++++++++++++++++--------------- src/battle_ai_util.c | 39 ++--- src/battle_debug.c | 154 ++++++++++++++++--- src/battle_main.c | 27 ++-- src/battle_util2.c | 2 + vbalink.ini | Bin 0 -> 1 bytes 10 files changed, 377 insertions(+), 179 deletions(-) create mode 100644 NO$GBA.EXE - Shortcut.lnk create mode 100644 vbalink.ini diff --git a/Makefile b/Makefile index c36cc8e936..ec3b5c4c6a 100644 --- a/Makefile +++ b/Makefile @@ -107,7 +107,7 @@ LIBPATH := -L ../../tools/agbcc/lib LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall else CC1 = $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet -override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast +override CFLAGS += -mthumb -mthumb-interwork -O0 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast ROM := $(MODERN_ROM_NAME) OBJ_DIR := $(MODERN_OBJ_DIR_NAME) LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" diff --git a/NO$GBA.EXE - Shortcut.lnk b/NO$GBA.EXE - Shortcut.lnk new file mode 100644 index 0000000000000000000000000000000000000000..32af57cf5c29d844b1fcfe676c636e29595572a5 GIT binary patch literal 1536 zcmd5+ZAep57=Gp~v?M2*4DsWVCidZ&W{QgFbh>HgB%2yda=PUQbF*D_K@pM=7%B-x zi5SBy2@;g7ep&XTpdb)`g!)T@APN)dhXxV7@4Zu}1o|iFT%Pxwd*1h)=e!^1lmbvh z1ds%#C5fUz1VNzjN=M^DR$$T^LxebpTUx)Lbl(KHxv#k(RQq zNu{`LRr@ruM&;V&+zzcV8~L~?NuzA zTB34y(%+(MMmNX%hW1XWD6d%3PAwFm+c3H|6FwqdJoK36ZA=_TC?)u(cy}%cNczWt zJ;Dd1Hb!74v@3^SEE}R!4_5+ed+vXG!uow|z)tYZ@podgPJx4@3nd_r#nV;kso}{G z{^!B^JHuN_*Ppj!tq!g9Ip})VQ;D?suDQJE0O{o|eXkY&&lC8tkDBX~a_-EAJ^P4h z)4Y0Sisob4fOj?%{=cH!TFCwZF;~F%r@E|(jzWM literal 0 HcmV?d00001 diff --git a/include/battle.h b/include/battle.h index b56b381e74..a8064e98aa 100644 --- a/include/battle.h +++ b/include/battle.h @@ -245,6 +245,26 @@ struct AI_SavedBattleMon u16 species; }; +struct AiPartyMon +{ + u16 species; + u16 item; + u16 heldEffect; + u16 ability; + u16 gender; + u16 level; + u16 moves[MAX_MON_MOVES]; + bool8 isFainted; + u8 switchInCount; // Counts how many times this Pokemon has been sent out or switched into in a battle. + bool8 wasSentInBattle; +}; + +struct AIPartyData // Opposing battlers - party mons. +{ + struct AiPartyMon mons[2][PARTY_SIZE]; // 2 parties(player, opponent). Used to save information on opposing party. + u8 count[2]; +}; + struct AiLogicData { u16 abilities[MAX_BATTLERS_COUNT]; @@ -313,6 +333,7 @@ struct BattleResources struct StatsArray* beforeLvlUp; struct AI_ThinkingStruct *ai; struct AiLogicData *aiData; + struct AIPartyData *aiParty; struct BattleHistory *battleHistory; u8 bufferA[MAX_BATTLERS_COUNT][0x200]; u8 bufferB[MAX_BATTLERS_COUNT][0x200]; @@ -320,6 +341,7 @@ struct BattleResources #define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(gBattleResources->ai)) #define AI_DATA ((struct AiLogicData *)(gBattleResources->aiData)) +#define AI_PARTY ((struct AIPartyData *)(gBattleResources->aiParty)) #define BATTLE_HISTORY ((struct BattleHistory *)(gBattleResources->battleHistory)) struct BattleResults @@ -670,7 +692,7 @@ struct BattleStruct #define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + ((stage) << 3) + (goesDown << 7)) #define SET_STATCHANGER2(dst, statId, stage, goesDown)(dst = (statId) + ((stage) << 3) + (goesDown << 7)) -// NOTE: The members of this struct have hard-coded offsets +// NOTE: The members of this struct have hard-coded offsets // in include/constants/battle_script_commands.h struct BattleScripting { diff --git a/include/battle_ai_main.h b/include/battle_ai_main.h index fcb31a9b2b..2756c7f6ce 100644 --- a/include/battle_ai_main.h +++ b/include/battle_ai_main.h @@ -24,6 +24,8 @@ void BattleAI_SetupItems(void); void BattleAI_SetupFlags(void); void BattleAI_SetupAIData(u8 defaultScoreMoves); u8 BattleAI_ChooseMoveOrAction(void); +void Ai_InitPartyStruct(void); +void Ai_UpdateSwitchInData(u32 battler); void GetAiLogicData(void); extern u8 sBattler_AI; diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 732dea7807..eb8d45abb3 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -130,10 +130,10 @@ static u32 GetWildAiFlags(void) { u8 avgLevel = GetMonData(&gEnemyParty[0], MON_DATA_LEVEL); u32 flags; - + if (IsDoubleBattle()) avgLevel = (GetMonData(&gEnemyParty[0], MON_DATA_LEVEL) + GetMonData(&gEnemyParty[1], MON_DATA_LEVEL)) / 2; - + flags |= AI_FLAG_CHECK_BAD_MOVE; if (avgLevel >= 20) flags |= AI_FLAG_CHECK_VIABILITY; @@ -141,10 +141,10 @@ static u32 GetWildAiFlags(void) flags |= AI_FLAG_PREFER_STRONGEST_MOVE; if (avgLevel >= 80) flags |= AI_FLAG_HP_AWARE; - + if (B_VAR_WILD_AI_FLAGS != 0 && VarGet(B_VAR_WILD_AI_FLAGS) != 0) flags |= VarGet(B_VAR_WILD_AI_FLAGS); - + return flags; } @@ -166,7 +166,7 @@ void BattleAI_SetupFlags(void) AI_THINKING_STRUCT->aiFlags = gTrainers[gTrainerBattleOpponent_A].aiFlags | gTrainers[gTrainerBattleOpponent_B].aiFlags; else AI_THINKING_STRUCT->aiFlags = gTrainers[gTrainerBattleOpponent_A].aiFlags; - + // check smart wild AI if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER)) && IsWildMonSmart()) AI_THINKING_STRUCT->aiFlags |= GetWildAiFlags(); @@ -220,11 +220,11 @@ u8 BattleAI_ChooseMoveOrAction(void) ret = ChooseMoveOrAction_Singles(); else ret = ChooseMoveOrAction_Doubles(); - + // Clear protect structures, some flags may be set during AI calcs // e.g. pranksterElevated from GetMovePriority memset(&gProtectStructs, 0, MAX_BATTLERS_COUNT * sizeof(struct ProtectStruct)); - + gCurrentMove = savedCurrentMove; return ret; } @@ -237,6 +237,66 @@ u8 ComputeBattleAiScores(u8 battler) return BattleAI_ChooseMoveOrAction(); } +static void CopyBattlerDataToAIParty(u32 bPosition, u32 side) +{ + u32 battler = GetBattlerAtPosition(bPosition); + struct AiPartyMon *aiMon = &AI_PARTY->mons[side][gBattlerPartyIndexes[battler]]; + struct BattlePokemon *bMon = &gBattleMons[battler]; + + aiMon->species = bMon->species; + aiMon->level = bMon->level; + aiMon->gender = GetGenderFromSpeciesAndPersonality(bMon->species, bMon->personality); + aiMon->isFainted = FALSE; + aiMon->wasSentInBattle = TRUE; + aiMon->switchInCount++; +} + +void Ai_InitPartyStruct(void) +{ + AI_PARTY->count[B_SIDE_PLAYER] = gPlayerPartyCount; + AI_PARTY->count[B_SIDE_OPPONENT] = gEnemyPartyCount; + + // Save first 2 or 4(in doubles) mons + CopyBattlerDataToAIParty(B_POSITION_PLAYER_LEFT, B_SIDE_PLAYER); + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + CopyBattlerDataToAIParty(B_POSITION_PLAYER_RIGHT, B_SIDE_PLAYER); + + // If player's partner is AI, save opponent mons + if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) + { + CopyBattlerDataToAIParty(B_POSITION_OPPONENT_LEFT, B_SIDE_OPPONENT); + CopyBattlerDataToAIParty(B_POSITION_OPPONENT_RIGHT, B_SIDE_OPPONENT); + } +} + +void Ai_UpdateSwitchInData(u32 battler) +{ + u32 i; + u32 side = GetBattlerSide(battler); + struct AiPartyMon *aiMon = &AI_PARTY->mons[side][gBattlerPartyIndexes[battler]]; + + // See if the switched-in mon has been already in battle + if (aiMon->wasSentInBattle) + { + if (aiMon->ability) + BATTLE_HISTORY->abilities[battler] = aiMon->ability; + if (aiMon->heldEffect) + BATTLE_HISTORY->itemEffects[battler] = aiMon->heldEffect; + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (aiMon->moves[i]) + BATTLE_HISTORY->usedMoves[battler][i] = aiMon->moves[i]; + } + } + else // If not, copy the newly switched-in mon in battle and clear battle history. + { + ClearBattlerMoveHistory(battler); + ClearBattlerAbilityHistory(battler); + ClearBattlerItemEffectHistory(battler); + CopyBattlerDataToAIParty(GetBattlerPosition(battler), side); + } +} + static void SetBattlerAiData(u8 battlerId) { AI_DATA->abilities[battlerId] = AI_GetAbility(battlerId); @@ -253,13 +313,13 @@ void GetAiLogicData(void) u32 battlerAtk, battlerDef, i, move; u8 effectiveness; s32 dmg; - + memset(AI_DATA, 0, sizeof(struct AiLogicData)); - + if (!(gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER)) && !IsWildMonSmart()) return; - + // get/assume all battler data for (i = 0; i < gBattlersCount; i++) { @@ -267,7 +327,7 @@ void GetAiLogicData(void) SetBattlerAiData(i); } } - + // simulate AI damage for (battlerAtk = 0; battlerAtk < gBattlersCount; battlerAtk++) { @@ -275,26 +335,26 @@ void GetAiLogicData(void) || !IsBattlerAIControlled(battlerAtk)) { continue; } - + for (battlerDef = 0; battlerDef < gBattlersCount; battlerDef++) { if (battlerAtk == battlerDef) continue; - + RecordKnownMove(battlerDef, gLastMoves[battlerDef]); for (i = 0; i < MAX_MON_MOVES; i++) { dmg = 0; effectiveness = AI_EFFECTIVENESS_x0; move = gBattleMons[battlerAtk].moves[i]; - + if (move != 0 && move != 0xFFFF //&& gBattleMoves[move].power != 0 /* we want to get effectiveness of status moves */ && !(AI_DATA->moveLimitations[battlerAtk] & gBitTable[i])) { dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness, TRUE); } - + AI_DATA->simulatedDmg[battlerAtk][battlerDef][i] = dmg; AI_DATA->effectiveness[battlerAtk][battlerDef][i] = effectiveness; } @@ -334,7 +394,7 @@ static u8 ChooseMoveOrAction_Singles(void) return AI_CHOICE_WATCH; gActiveBattler = sBattler_AI; - + // If can switch. if (CountUsablePartyMons(sBattler_AI) > 0 && !IsAbilityPreventingEscape(sBattler_AI) @@ -375,7 +435,7 @@ static u8 ChooseMoveOrAction_Singles(void) } } } - + numOfBestMoves = 1; currentMoveArray[0] = AI_THINKING_STRUCT->score[0]; consideredMoveArray[0] = 0; @@ -427,7 +487,7 @@ static u8 ChooseMoveOrAction_Doubles(void) BattleAI_SetupAIData(gBattleStruct->palaceFlags >> 4); else BattleAI_SetupAIData(0xF); - + gBattlerTarget = i; if ((i & BIT_SIDE) != (sBattler_AI & BIT_SIDE)) RecordLastUsedMoveByTarget(); @@ -467,7 +527,7 @@ static u8 ChooseMoveOrAction_Doubles(void) { if (!CanTargetBattler(sBattler_AI, i, gBattleMons[sBattler_AI].moves[j])) continue; - + if (mostViableMovesScores[0] == AI_THINKING_STRUCT->score[j]) { mostViableMovesScores[mostViableMovesNo] = AI_THINKING_STRUCT->score[j]; @@ -586,7 +646,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); u32 i; u16 predictedMove = AI_DATA->predictedMoves[battlerDef]; - + SetTypeBeforeUsingMove(move, battlerAtk); GET_MOVE_TYPE(move, moveType); @@ -594,7 +654,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) return score; GET_MOVE_TYPE(move, moveType); - + // check non-user target if (!(moveTarget & MOVE_TARGET_USER)) { @@ -604,7 +664,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { RETURN_SCORE_MINUS(20); } - + // check ground immunities if (moveType == TYPE_GROUND && !IsBattlerGrounded(battlerDef) @@ -616,11 +676,11 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { RETURN_SCORE_MINUS(20); } - + // check off screen if (IsSemiInvulnerable(battlerDef, move) && moveEffect != EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) RETURN_SCORE_MINUS(20); // if target off screen and we go first, don't use move - + // check if negates type switch (effectiveness) { @@ -632,7 +692,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) RETURN_SCORE_MINUS(10); break; } - + // target ability checks if (!DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) { @@ -758,7 +818,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) RETURN_SCORE_MINUS(10); break; } // def ability checks - + // target partner ability checks & not attacking partner if (isDoubleBattle) { @@ -796,35 +856,35 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } } // def partner ability checks } // ignore def ability check - + // gen7+ dark type mons immune to priority->elevated moves from prankster #if B_PRANKSTER_DARK_TYPES >= GEN_7 if (AI_DATA->abilities[battlerAtk] == ABILITY_PRANKSTER && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK) && IS_MOVE_STATUS(move) && !(moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_USER))) RETURN_SCORE_MINUS(10); #endif - + // terrain & effect checks if (AI_IsTerrainAffected(battlerDef, STATUS_FIELD_ELECTRIC_TERRAIN)) { if (moveEffect == EFFECT_SLEEP || moveEffect == EFFECT_YAWN) RETURN_SCORE_MINUS(20); } - + if (AI_IsTerrainAffected(battlerDef, STATUS_FIELD_MISTY_TERRAIN)) { if (IsNonVolatileStatusMoveEffect(moveEffect) || IsConfusionMoveEffect(moveEffect)) RETURN_SCORE_MINUS(20); } - + if (AI_IsTerrainAffected(battlerAtk, STATUS_FIELD_PSYCHIC_TERRAIN) && atkPriority > 0) { RETURN_SCORE_MINUS(20); } } // end check MOVE_TARGET_USER - + // the following checks apply to any target (including user) - + // throat chop check if (gDisableStructs[battlerAtk].throatChopTimer && TestMoveFlags(move, FLAG_SOUND)) return 0; // Can't even select move at all @@ -860,7 +920,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } } } - + // check move effects switch (moveEffect) { @@ -874,7 +934,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_EXPLOSION: if (!(AI_THINKING_STRUCT->aiFlags & AI_FLAG_WILL_SUICIDE)) score -= 2; - + if (effectiveness == AI_EFFECTIVENESS_x0) { score -= 10; @@ -920,7 +980,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 10; break; - case EFFECT_SPECIAL_DEFENSE_UP: + case EFFECT_SPECIAL_DEFENSE_UP: case EFFECT_SPECIAL_DEFENSE_UP_2: if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 10; @@ -1230,7 +1290,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_LOW_KICK: // AI_CBM_HighRiskForDamage if (AI_DATA->abilities[battlerDef] == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2) - score -= 10; + score -= 10; break; case EFFECT_COUNTER: case EFFECT_MIRROR_COAT: @@ -1240,7 +1300,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || DoesSubstituteBlockMove(battlerAtk, BATTLE_PARTNER(battlerDef), predictedMove)) score -= 10; break; - + case EFFECT_ROAR: if (CountUsablePartyMons(battlerDef) == 0) score -= 10; @@ -1392,7 +1452,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_SPIKES: if (gSideTimers[GetBattlerSide(battlerDef)].spikesAmount >= 3) score -= 10; - else if (PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) + else if (PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].spikesAmount == 2) score -= 10; // only one mon needs to set up the last layer of Spikes break; @@ -1570,7 +1630,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; } - + if (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_MENTAL_HERB) score -= 6; break; @@ -1802,7 +1862,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (gBattleMons[battlerAtk].hp > (gBattleMons[battlerAtk].hp + gBattleMons[battlerDef].hp) / 2) score -= 10; break; - + case EFFECT_CONVERSION_2: //TODO break; @@ -1862,7 +1922,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; } // move check - + if (decreased) break; if (IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef])) @@ -1904,7 +1964,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) IncreaseAllyProtectionViability(&viability, 0xFF); }*/ } - break; + break; case EFFECT_MIRACLE_EYE: if (gStatuses3[battlerDef] & STATUS3_MIRACLE_EYED) score -= 10; @@ -1952,7 +2012,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || ((AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) && !IsTargetingPartner(battlerAtk, battlerDef))) // don't want to raise target stats unless its your partner score -= 10; break; - + case EFFECT_PSYCH_UP: // haze stats check { for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) @@ -2116,7 +2176,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u32 atkNegativeStages = CountNegativeStatStages(battlerAtk); u32 defPositiveStages = CountPositiveStatStages(battlerDef); u32 defNegativeStages = CountNegativeStatStages(battlerDef); - + if (atkPositiveStages >= defPositiveStages && atkNegativeStages <= defNegativeStages) score -= 10; break; @@ -2513,21 +2573,21 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break;*/ } // move effect checks - + if (score < 0) score = 0; - + return score; } static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) -{ +{ if (IsTargetingPartner(battlerAtk, battlerDef)) return score; - + if (gBattleMoves[move].power == 0) return score; // can't make anything faint with no power - + if (CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0) && gBattleMoves[move].effect != EFFECT_EXPLOSION) { // this move can faint the target @@ -2541,10 +2601,10 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // this move isn't expected to faint the target if (TestMoveFlags(move, FLAG_HIGH_CRIT)) score += 2; // crit makes it more likely to make them faint - + if (GetMoveDamageResult(move) == MOVE_POWER_OTHER) score--; - + switch (AI_DATA->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]) { case AI_EFFECTIVENESS_x8: @@ -2561,7 +2621,7 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; } } - + //AI_TryToFaint_CheckIfDanger if (!WillAIStrikeFirst() && CanTargetFaintAi(battlerDef, battlerAtk)) { // AI_TryToFaint_Danger @@ -2570,7 +2630,7 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) else score++; } - + return score; } @@ -2626,8 +2686,8 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; } } // check partner move effect - - + + // consider our move effect relative to partner state switch (effect) { @@ -2648,8 +2708,8 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; } // our effect relative to partner - - + + // consider global move effects switch (effect) { @@ -2679,8 +2739,8 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; } // global move effect check - - + + // check specific target if (IsTargetingPartner(battlerAtk, battlerDef)) { @@ -2787,11 +2847,11 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { RETURN_SCORE_PLUS(1); } - break; + break; } } // ability checks } // move power check - + // attacker move effects specifically targeting partner if (!partnerProtecting) { @@ -2904,12 +2964,12 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; } // attacker move effects } // check partner protecting - + score -= 30; // otherwise, don't target partner } else // checking opponent { - // these checks mostly handled in AI_CheckBadMove and AI_CheckViability + // these checks mostly handled in AI_CheckBadMove and AI_CheckViability switch (effect) { case EFFECT_SKILL_SWAP: @@ -2934,10 +2994,10 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 3; break; } - + // lightning rod, flash fire against enemy handled in AI_CheckBadMove } - + return score; } @@ -2974,11 +3034,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u16 predictedMove = AI_DATA->predictedMoves[battlerDef]; bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); u32 i; - + // Targeting partner, check benefits of doing that instead if (IsTargetingPartner(battlerAtk, battlerDef)) return score; - + // check always hits if (!IS_MOVE_STATUS(move) && gBattleMoves[move].accuracy == 0) { @@ -2987,11 +3047,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (AI_RandLessThan(100) && (gBattleMons[battlerDef].statStages[STAT_EVASION] >= 8 || gBattleMons[battlerAtk].statStages[STAT_ACC] <= 4)) score++; } - + // check high crit if (TestMoveFlags(move, FLAG_HIGH_CRIT) && effectiveness >= AI_EFFECTIVENESS_x2 && AI_RandLessThan(128)) score++; - + // check already dead if (!IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) && CanTargetFaintAi(battlerAtk, battlerDef) @@ -3002,7 +3062,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) else score--; } - + // check damage if (gBattleMoves[move].power != 0 && GetMoveDamageResult(move) == MOVE_POWER_WEAK) score--; @@ -3010,11 +3070,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // check status move preference if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_PREFER_STATUS_MOVES && IS_MOVE_STATUS(move) && effectiveness != AI_EFFECTIVENESS_x0) score++; - + // check thawing moves if ((gBattleMons[battlerAtk].status1 & STATUS1_FREEZE) && TestMoveFlags(move, FLAG_THAW_USER)) score += (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) ? 20 : 10; - + // check burn if (gBattleMons[battlerAtk].status1 & STATUS1_BURN) { @@ -3033,7 +3093,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; } } - + // attacker ability checks switch (AI_DATA->abilities[battlerAtk]) { @@ -3049,8 +3109,8 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 8; // prioritize killing target for stat boost } break; - } // ability checks - + } // ability checks + // move effect checks switch (moveEffect) { @@ -3095,7 +3155,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; } } - + if (!AI_RandLessThan(100)) { score--; @@ -3141,7 +3201,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; } } - + if (!AI_RandLessThan(100)) { score--; @@ -3164,7 +3224,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 2; else if (AI_DATA->hpPercents[battlerAtk] <= 70) score -= 2; - else + else score++; break; case EFFECT_EVASION_UP: @@ -3294,7 +3354,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_ATTACK_SPATK_UP: // work up if (AI_DATA->hpPercents[battlerAtk] <= 40 || AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) break; - + if (HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_ATK, &score); else if (HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) @@ -3350,7 +3410,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) default: break; } - + if (ShouldRecover(battlerAtk, battlerDef, move, healPercent)) score += 2; } @@ -3578,7 +3638,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (newHp > healthBenchmark && ShouldAbsorb(battlerAtk, battlerDef, move, AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex])) score += 2; } - break; + break; case EFFECT_SLEEP_TALK: case EFFECT_SNORE: if (!IsWakeupTurn(battlerAtk) && gBattleMons[battlerAtk].status1 & STATUS1_SLEEP) @@ -3613,13 +3673,13 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_THIEF: { bool32 canSteal = FALSE; - + #if defined B_TRAINERS_KNOCK_OFF_ITEMS && B_TRAINERS_KNOCK_OFF_ITEMS == TRUE canSteal = TRUE; #endif if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER || GetBattlerSide(battlerAtk) == B_SIDE_PLAYER) canSteal = TRUE; - + if (canSteal && AI_DATA->items[battlerAtk] == ITEM_NONE && AI_DATA->items[battlerDef] != ITEM_NONE && CanBattlerGetOrLoseItem(battlerDef, AI_DATA->items[battlerDef]) @@ -3763,8 +3823,8 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (AI_DATA->abilities[battlerDef] == ABILITY_MAGIC_BOUNCE || CountUsablePartyMons(battlerDef) == 0) break; if (gDisableStructs[battlerAtk].isFirstTurn) - score += 2; - //TODO - track entire opponent party data to determine hazard effectiveness + score += 2; + //TODO - track entire opponent party data to determine hazard effectiveness break; case EFFECT_FORESIGHT: if (AI_DATA->abilities[battlerAtk] == ABILITY_SCRAPPY) @@ -3793,7 +3853,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (HasMoveEffect(battlerDef, EFFECT_MORNING_SUN) || HasMoveEffect(battlerDef, EFFECT_SYNTHESIS) || HasMoveEffect(battlerDef, EFFECT_MOONLIGHT)) - score += 2; + score += 2; } break; case EFFECT_HAIL: @@ -3802,7 +3862,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if ((HasMoveEffect(battlerAtk, EFFECT_AURORA_VEIL) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_AURORA_VEIL)) && ShouldSetScreen(battlerAtk, battlerDef, EFFECT_AURORA_VEIL)) score += 3; - + score++; if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_ICY_ROCK) score++; @@ -3861,7 +3921,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_SPECTRAL_THIEF: // Want to copy positive stat changes for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) - { + { if (gBattleMons[battlerDef].statStages[i] > gBattleMons[battlerAtk].statStages[i]) { switch (i) @@ -3920,7 +3980,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (HasMoveEffect(battlerAtk, EFFECT_SWALLOW) || HasMoveEffect(battlerAtk, EFFECT_SPIT_UP)) score += 2; - + IncreaseStatUpScore(battlerAtk, battlerDef, STAT_DEF, &score); IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPDEF, &score); break; @@ -3937,20 +3997,20 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || HasMoveEffect(battlerAtk, EFFECT_PSYCH_UP) || HasMoveEffect(battlerAtk, EFFECT_SPECTRAL_THIEF)) score++; - + if (AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) score += 2; - + IncreaseConfusionScore(battlerAtk, battlerDef, move, &score); break; case EFFECT_FLATTER: if (HasMoveEffect(battlerAtk, EFFECT_PSYCH_UP) || HasMoveEffect(battlerAtk, EFFECT_SPECTRAL_THIEF)) score += 2; - + if (AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) score += 2; - + IncreaseConfusionScore(battlerAtk, battlerDef, move, &score); break; case EFFECT_FURY_CUTTER: @@ -3991,7 +4051,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; } - + switch (move) { case MOVE_DEFOG: @@ -4007,7 +4067,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) && AI_WhoStrikesFirst(battlerAtk, BATTLE_PARTNER(battlerAtk), move) == AI_IS_SLOWER) // Partner going first break; // Don't use Defog if partner is going to set up hazards } - + // check defog lowering evasion if (ShouldLowerEvasion(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) { @@ -4179,10 +4239,10 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { u16 item = GetUsedHeldItem(battlerAtk); u16 toHeal = (ItemId_GetHoldEffectParam(item) == 10) ? 10 : gBattleMons[battlerAtk].maxHP / ItemId_GetHoldEffectParam(item); - + if (IsStatBoostingBerry(item) && AI_DATA->hpPercents[battlerAtk] > 60) score++; - else if (ShouldRestoreHpBerry(battlerAtk, item) && !CanAIFaintTarget(battlerAtk, battlerDef, 0) + else if (ShouldRestoreHpBerry(battlerAtk, item) && !CanAIFaintTarget(battlerAtk, battlerDef, 0) && ((GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 0 && CanTargetFaintAiWithMod(battlerDef, battlerAtk, 0, 0)) || !CanTargetFaintAiWithMod(battlerDef, battlerAtk, toHeal, 0))) score++; // Recycle healing berry if we can't otherwise faint the target and the target wont kill us after we activate the berry @@ -4229,7 +4289,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (AI_DATA->abilities[battlerDef] != AI_DATA->abilities[battlerAtk] && !(gStatuses3[battlerDef] & STATUS3_GASTRO_ACID)) score += 2; - } + } break; case EFFECT_IMPRISON: if (predictedMove != MOVE_NONE && HasMove(battlerAtk, predictedMove)) @@ -4300,7 +4360,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_SHELL_SMASH: if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_RESTORE_STATS) score += 1; - + IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPEED, &score); IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPATK, &score); IncreaseStatUpScore(battlerAtk, battlerDef, STAT_ATK, &score); @@ -4407,7 +4467,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (gStatuses3[battlerAtk] & STATUS3_YAWN && IsBattlerGrounded(battlerAtk)) score += 10; //fallthrough - case EFFECT_GRASSY_TERRAIN: + case EFFECT_GRASSY_TERRAIN: case EFFECT_PSYCHIC_TERRAIN: score += 2; if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_TERRAIN_EXTENDER) @@ -4680,7 +4740,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) //case EFFECT_SKY_DROP //break; } // move effect checks - + return score; } @@ -4690,15 +4750,15 @@ static s16 AI_SetupFirstTurn(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IsTargetingPartner(battlerAtk, battlerDef) || gBattleResults.battleTurnCounter != 0) return score; - - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_SMART_SWITCHING + + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_SMART_SWITCHING && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER && CanTargetFaintAi(battlerDef, battlerAtk) && GetMovePriority(battlerAtk, move) == 0) { RETURN_SCORE_MINUS(20); // No point in setting up if you will faint. Should just switch if possible.. } - + // check effects to prioritize first turn switch (gBattleMoves[move].effect) { @@ -4787,7 +4847,7 @@ static s16 AI_SetupFirstTurn(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) default: break; } - + return score; } @@ -4796,10 +4856,10 @@ static s16 AI_Risky(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (IsTargetingPartner(battlerAtk, battlerDef)) return score; - + if (TestMoveFlags(move, FLAG_HIGH_CRIT)) score += 2; - + switch (gBattleMoves[move].effect) { case EFFECT_SLEEP: @@ -4826,7 +4886,7 @@ static s16 AI_Risky(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) default: break; } - + return score; } @@ -4835,10 +4895,10 @@ static s16 AI_PreferStrongestMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 sc { if (IsTargetingPartner(battlerAtk, battlerDef)) return score; - + if (GetMoveDamageResult(move) == MOVE_POWER_BEST) score += 2; - + return score; } @@ -4846,14 +4906,14 @@ static s16 AI_PreferStrongestMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 sc static s16 AI_PreferBatonPass(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { u32 i; - + if (IsTargetingPartner(battlerAtk, battlerDef) || CountUsablePartyMons(battlerAtk) == 0 || GetMoveDamageResult(move) != MOVE_POWER_OTHER || !HasMoveEffect(battlerAtk, EFFECT_BATON_PASS) || IsBattlerTrapped(battlerAtk, TRUE)) return score; - + if (IsStatRaisingEffect(gBattleMoves[move].effect)) { if (gBattleResults.battleTurnCounter == 0) @@ -4861,9 +4921,9 @@ static s16 AI_PreferBatonPass(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) else if (AI_DATA->hpPercents[battlerAtk] < 60) score -= 10; else - score++; + score++; } - + // other specific checks switch (gBattleMoves[move].effect) { @@ -4889,12 +4949,12 @@ static s16 AI_PreferBatonPass(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (gStatuses3[battlerAtk] & (STATUS3_ROOTED | STATUS3_AQUA_RING)) score += 2; if (gStatuses3[battlerAtk] & STATUS3_LEECHSEED) - score -= 3; + score -= 3; break; default: break; } - + return score; } @@ -4914,11 +4974,11 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (gStatuses3[battlerDef] & STATUS3_HEAL_BLOCK) return 0; - + if (CanTargetFaintAi(FOE(battlerAtk), BATTLE_PARTNER(battlerAtk)) || (CanTargetFaintAi(BATTLE_PARTNER(FOE(battlerAtk)), BATTLE_PARTNER(battlerAtk)))) score--; - + if (AI_DATA->hpPercents[battlerDef] <= 50) score++; } @@ -4957,7 +5017,7 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // med hp if (IsStatRaisingEffect(effect) || IsStatLoweringEffect(effect)) score -= 2; - + switch (effect) { case EFFECT_EXPLOSION: @@ -4980,7 +5040,7 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // low hp if (IsStatRaisingEffect(effect) || IsStatLoweringEffect(effect)) score -= 2; - + // check other discouraged low hp effects switch (effect) { @@ -5013,7 +5073,7 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } } } - + // consider target HP if (CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0)) { @@ -5085,7 +5145,7 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 2; // don't use status moves if target is at low health } } - + return score; } @@ -5104,7 +5164,7 @@ static s16 AI_Roaming(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (IsBattlerTrapped(battlerAtk, FALSE)) return score; - + AI_Flee(); return score; } diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index fe715eec6e..a34dccdadb 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -499,6 +499,7 @@ void RecordKnownMove(u8 battlerId, u32 move) if (BATTLE_HISTORY->usedMoves[battlerId][i] == MOVE_NONE) { BATTLE_HISTORY->usedMoves[battlerId][i] = move; + AI_PARTY->mons[GetBattlerSide(battlerId)][gBattlerPartyIndexes[battlerId]].moves[i] = move; break; } } @@ -507,6 +508,7 @@ void RecordKnownMove(u8 battlerId, u32 move) void RecordAbilityBattle(u8 battlerId, u16 abilityId) { BATTLE_HISTORY->abilities[battlerId] = abilityId; + AI_PARTY->mons[GetBattlerSide(battlerId)][gBattlerPartyIndexes[battlerId]].ability = abilityId; } void ClearBattlerAbilityHistory(u8 battlerId) @@ -517,6 +519,7 @@ void ClearBattlerAbilityHistory(u8 battlerId) void RecordItemEffectBattle(u8 battlerId, u8 itemEffect) { BATTLE_HISTORY->itemEffects[battlerId] = itemEffect; + AI_PARTY->mons[GetBattlerSide(battlerId)][gBattlerPartyIndexes[battlerId]].heldEffect = itemEffect; } void ClearBattlerItemEffectHistory(u8 battlerId) @@ -787,7 +790,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, dmg *= 2; else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) dmg *= 3; - + if (dmg == 0) dmg = 1; } @@ -798,7 +801,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, RestoreBattlerData(battlerAtk); RestoreBattlerData(battlerDef); - + // convert multiper to AI_EFFECTIVENESS_xX *typeEffectiveness = AI_GetEffectiveness(effectivenessMultiplier); @@ -1153,11 +1156,11 @@ bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability) s32 AI_GetAbility(u32 battlerId) { u32 knownAbility = GetBattlerAbility(battlerId); - + // The AI knows its own ability. if (IsBattlerAIControlled(battlerId)) return knownAbility; - + // Check neutralizing gas, gastro acid if (knownAbility == ABILITY_NONE) return knownAbility; @@ -1177,10 +1180,10 @@ s32 AI_GetAbility(u32 battlerId) { abilityGuess = gBaseStats[gBattleMons[battlerId].species].abilities[Random() % NUM_ABILITY_SLOTS]; } - + return abilityGuess; } - + return ABILITY_NONE; // Unknown. } @@ -2668,7 +2671,7 @@ static bool32 AI_CanPoisonType(u8 battlerAttacker, u8 battlerTarget) static bool32 AI_CanBePoisoned(u8 battlerAtk, u8 battlerDef) { u16 ability = AI_DATA->abilities[battlerDef]; - + if (!(AI_CanPoisonType(battlerAtk, battlerDef)) || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD || gBattleMons[battlerDef].status1 & STATUS1_ANY @@ -3019,7 +3022,7 @@ bool32 IsValidDoubleBattle(u8 battlerAtk) u16 GetAllyChosenMove(u8 battlerId) { u8 partnerBattler = BATTLE_PARTNER(battlerId); - + if (!IsBattlerAlive(partnerBattler) || !IsBattlerAIControlled(partnerBattler)) return MOVE_NONE; else if (partnerBattler > battlerId) // Battler with the lower id chooses the move first. @@ -3425,7 +3428,7 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) if (AI_DATA->hpPercents[battlerAtk] < 80 && AI_RandLessThan(128)) return; - + if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; // Damaging moves would get a score boost from AI_TryToFaint or PreferStrongestMove so we don't consider them here @@ -3544,7 +3547,7 @@ void IncreaseParalyzeScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) { if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - + if (AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) { u8 atkSpeed = GetBattlerTotalSpeedStat(battlerAtk); @@ -3565,7 +3568,7 @@ void IncreaseSleepScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) { if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - + if (AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) *score += 2; else @@ -3583,7 +3586,7 @@ void IncreaseConfusionScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) { if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - + if (AI_CanConfuse(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_CURE_CONFUSION && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_CURE_STATUS) @@ -3614,28 +3617,28 @@ bool32 ShouldUseZMove(u8 battlerAtk, u8 battlerDef, u16 chosenMove) return FALSE; //don't use z move on partner if (gBattleStruct->zmove.used[battlerAtk]) return FALSE; //cant use z move twice - + if (IsViableZMove(battlerAtk, chosenMove)) { u8 effectiveness; - + #ifdef POKEMON_EXPANSION if (gBattleMons[battlerDef].ability == ABILITY_DISGUISE && gBattleMons[battlerDef].species == SPECIES_MIMIKYU) return FALSE; // Don't waste a Z-Move busting disguise if (gBattleMons[battlerDef].ability == ABILITY_ICE_FACE && gBattleMons[battlerDef].species == SPECIES_EISCUE && IS_MOVE_PHYSICAL(chosenMove)) return FALSE; // Don't waste a Z-Move busting Ice Face #endif - + if (IS_MOVE_STATUS(chosenMove) && !IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) return FALSE; else if (!IS_MOVE_STATUS(chosenMove) && IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) return FALSE; - + if (!IS_MOVE_STATUS(chosenMove) && AI_CalcDamage(chosenMove, battlerAtk, battlerDef, &effectiveness, FALSE) >= gBattleMons[battlerDef].hp) return FALSE; // don't waste damaging z move if can otherwise faint target - + return TRUE; } - + return FALSE; } diff --git a/src/battle_debug.c b/src/battle_debug.c index 0657ed2ac4..256647ddf6 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -43,8 +43,8 @@ struct BattleDebugModifyArrows u16 minValue; u16 maxValue; int currValue; - u8 currentDigit; - u8 maxDigits; + u8 currentDigit:4; + u8 maxDigits:4; u8 charDigits[MAX_MODIFY_DIGITS]; void *modifiedValPtr; u8 typeOfVal; @@ -52,7 +52,9 @@ struct BattleDebugModifyArrows struct BattleDebugMenu { - u8 battlerId; + u8 battlerId:2; + u8 aiBattlerId:2; + u8 battlerWindowId; u8 mainListWindowId; @@ -72,11 +74,16 @@ struct BattleDebugMenu const struct BitfieldInfo *bitfield; bool8 battlerWasChanged[MAX_BATTLERS_COUNT]; - u8 aiBattlerId; u8 aiViewState; - u8 aiIconSpriteIds[MAX_BATTLERS_COUNT]; + u8 aiMonSpriteId; u8 aiMovesWindowId; + + union + { + u8 aiIconSpriteIds[MAX_BATTLERS_COUNT]; + u8 aiPartyIcons[PARTY_SIZE]; + } spriteIds; }; struct __attribute__((__packed__)) BitfieldInfo @@ -102,6 +109,7 @@ enum LIST_ITEM_AI, LIST_ITEM_AI_MOVES_PTS, LIST_ITEM_AI_INFO, + LIST_ITEM_AI_PARTY, LIST_ITEM_VARIOUS, LIST_ITEM_COUNT }; @@ -234,6 +242,7 @@ static const u8 sText_Unknown[] = _("Unknown"); static const u8 sText_InLove[] = _("In Love"); static const u8 sText_AIMovePts[] = _("AI Pts/Dmg"); static const u8 sText_AiKnowledge[] = _("AI Info"); +static const u8 sText_AiParty[] = _("AI Party"); static const u8 sText_EffectOverride[] = _("Effect Override"); static const u8 sText_EmptyString[] = _(""); @@ -340,6 +349,7 @@ static const struct ListMenuItem sMainListItems[] = {sText_AI, LIST_ITEM_AI}, {sText_AIMovePts, LIST_ITEM_AI_MOVES_PTS}, {sText_AiKnowledge, LIST_ITEM_AI_INFO}, + {sText_AiParty, LIST_ITEM_AI_PARTY}, {sText_Various, LIST_ITEM_VARIOUS}, }; @@ -610,6 +620,7 @@ static void UpdateMonData(struct BattleDebugMenu *data); static u8 *GetSideStatusValue(struct BattleDebugMenu *data, bool32 changeStatus, bool32 statusTrue); static bool32 TryMoveDigit(struct BattleDebugModifyArrows *modArrows, bool32 moveUp); static void SwitchToDebugView(u8 taskId); +static void SwitchToDebugViewFromAiParty(u8 taskId); // code static struct BattleDebugMenu *GetStructPtr(u8 taskId) @@ -725,9 +736,9 @@ static void PutMovesPointsText(struct BattleDebugMenu *data) AddTextPrinterParameterized(data->aiMovesWindowId, 1, text, 0, i * 15, 0, NULL); for (count = 0, j = 0; j < MAX_BATTLERS_COUNT; j++) { - if (data->aiIconSpriteIds[j] == 0xFF) + if (data->spriteIds.aiIconSpriteIds[j] == 0xFF) continue; - battlerDef = gSprites[data->aiIconSpriteIds[j]].data[0]; + battlerDef = gSprites[data->spriteIds.aiIconSpriteIds[j]].data[0]; ConvertIntToDecimalStringN(text, gBattleStruct->aiFinalScore[data->aiBattlerId][battlerDef][i], STR_CONV_MODE_RIGHT_ALIGN, 3); @@ -772,20 +783,20 @@ static void Task_ShowAiPoints(u8 taskId) if (i != data->aiBattlerId && IsBattlerAlive(i)) { #ifndef POKEMON_EXPANSION - data->aiIconSpriteIds[i] = CreateMonIcon(gBattleMons[i].species, + data->spriteIds.aiIconSpriteIds[i] = CreateMonIcon(gBattleMons[i].species, SpriteCallbackDummy, 95 + (count * 60), 17, 0, 0, FALSE); #else - data->aiIconSpriteIds[i] = CreateMonIcon(gBattleMons[i].species, + data->spriteIds.aiIconSpriteIds[i] = CreateMonIcon(gBattleMons[i].species, SpriteCallbackDummy, 95 + (count * 60), 17, 0, 0); #endif - gSprites[data->aiIconSpriteIds[i]].data[0] = i; // battler id + gSprites[data->spriteIds.aiIconSpriteIds[i]].data[0] = i; // battler id count++; } else { - data->aiIconSpriteIds[i] = 0xFF; + data->spriteIds.aiIconSpriteIds[i] = 0xFF; } } #ifndef POKEMON_EXPANSION @@ -831,25 +842,26 @@ static void SwitchToAiPointsView(u8 taskId) GetStructPtr(taskId)->aiViewState = 0; } -static const u8 *const sAiInfoItemNames[] = +static const u8 *const sAiInfoItemNames[] = { sText_Ability, sText_HeldItem, sText_HoldEffect, }; + static void PutAiInfoText(struct BattleDebugMenu *data) { u32 i, j, count; u8 *text = malloc(0x50); FillWindowPixelBuffer(data->aiMovesWindowId, 0x11); - + // item names for (i = 0; i < ARRAY_COUNT(sAiInfoItemNames); i++) { AddTextPrinterParameterized(data->aiMovesWindowId, 1, sAiInfoItemNames[i], 3, i * 15, 0, NULL); } - + // items info for (i = 0; i < gBattlersCount; i++) { @@ -869,6 +881,31 @@ static void PutAiInfoText(struct BattleDebugMenu *data) free(text); } +static void PutAiPartyText(struct BattleDebugMenu *data) +{ + u32 i, j, count, maxWidth; + u8 *text = malloc(0x50), *txtPtr; + struct AiPartyMon *aiMons = AI_PARTY->mons[GET_BATTLER_SIDE(data->aiBattlerId)]; + + FillWindowPixelBuffer(data->aiMovesWindowId, 0x11); + count = AI_PARTY->count[GET_BATTLER_SIDE(data->aiBattlerId)]; + for (i = 0; i < count; i++) + { + txtPtr = StringCopyN(text, gAbilityNames[aiMons[i].ability], 7); // The screen is too small to fit the whole string, so we need to drop the last letters. + *txtPtr = EOS; + AddTextPrinterParameterized5(data->aiMovesWindowId, FONT_SMALL_NARROW, text, i * 41, 0, 0, NULL, 0, 0); + for (j = 0; j < MAX_MON_MOVES; j++) + { + txtPtr = StringCopyN(text, gMoveNames[aiMons[i].moves[j]], 8); + *txtPtr = EOS; + AddTextPrinterParameterized5(data->aiMovesWindowId, FONT_SMALL_NARROW, text, i * 41, 20 + j * 15, 0, NULL, 0, 0); + } + } + + CopyWindowToVram(data->aiMovesWindowId, 3); + free(text); +} + static void Task_ShowAiKnowledge(u8 taskId) { u32 i, count; @@ -895,20 +932,20 @@ static void Task_ShowAiKnowledge(u8 taskId) if (GET_BATTLER_SIDE(i) == B_SIDE_PLAYER && IsBattlerAlive(i)) { #ifndef POKEMON_EXPANSION - data->aiIconSpriteIds[i] = CreateMonIcon(gBattleMons[i].species, + data->spriteIds.aiIconSpriteIds[i] = CreateMonIcon(gBattleMons[i].species, SpriteCallbackDummy, 95 + (count * 80), 17, 0, 0, FALSE); #else - data->aiIconSpriteIds[i] = CreateMonIcon(gBattleMons[i].species, + data->spriteIds.aiIconSpriteIds[i] = CreateMonIcon(gBattleMons[i].species, SpriteCallbackDummy, 95 + (count * 80), 17, 0, 0); #endif - gSprites[data->aiIconSpriteIds[i]].data[0] = i; // battler id + gSprites[data->spriteIds.aiIconSpriteIds[i]].data[0] = i; // battler id count++; } else { - data->aiIconSpriteIds[i] = 0xFF; + data->spriteIds.aiIconSpriteIds[i] = 0xFF; } } #ifndef POKEMON_EXPANSION @@ -947,12 +984,82 @@ static void Task_ShowAiKnowledge(u8 taskId) } } +static void Task_ShowAiParty(u8 taskId) +{ + u32 i; + struct WindowTemplate winTemplate; + struct AiPartyMon *aiMons; + struct BattleDebugMenu *data = GetStructPtr(taskId); + + switch (data->aiViewState) + { + case 0: + HideBg(0); + ShowBg(1); + + LoadMonIconPalettes(); + data->aiBattlerId = data->battlerId; + aiMons = AI_PARTY->mons[GET_BATTLER_SIDE(data->aiBattlerId)]; + for (i = 0; i < AI_PARTY->count[GET_BATTLER_SIDE(data->aiBattlerId)]; i++) + { + u16 species = SPECIES_OLD_UNOWN_B; // Question mark + if (aiMons[i].wasSentInBattle && aiMons[i].species) + species = aiMons[i].species; + data->spriteIds.aiPartyIcons[i] = CreateMonIcon(species, SpriteCallbackDummy, (i * 41) - 5 + 20, 7, 0, 0, FALSE); + } + for (; i < PARTY_SIZE; i++) + data->spriteIds.aiPartyIcons[i] = 0xFF; + data->aiViewState++; + break; + // Put text + case 1: + winTemplate = CreateWindowTemplate(1, 0, 4, 30, 14, 15, 0x200); + data->aiMovesWindowId = AddWindow(&winTemplate); + PutWindowTilemap(data->aiMovesWindowId); + PutAiPartyText(data); + data->aiViewState++; + break; + // Input + case 2: + if (gMain.newKeys & (SELECT_BUTTON | B_BUTTON)) + { + SwitchToDebugViewFromAiParty(taskId); + HideBg(1); + ShowBg(0); + return; + } + break; + } +} + static void SwitchToAiInfoView(u8 taskId) { gTasks[taskId].func = Task_ShowAiKnowledge; GetStructPtr(taskId)->aiViewState = 0; } +static void SwitchToAiPartyView(u8 taskId) +{ + gTasks[taskId].func = Task_ShowAiParty; + GetStructPtr(taskId)->aiViewState = 0; +} + +static void SwitchToDebugViewFromAiParty(u8 taskId) +{ + u32 i; + struct BattleDebugMenu *data = GetStructPtr(taskId); + + FreeMonIconPalettes(); + for (i = 0; i < PARTY_SIZE; i++) + { + if (data->spriteIds.aiPartyIcons[i] != 0xFF) + FreeAndDestroyMonIconSprite(&gSprites[data->spriteIds.aiPartyIcons[i]]); + } + RemoveWindow(data->aiMovesWindowId); + + gTasks[taskId].func = Task_DebugMenuProcessInput; +} + static void SwitchToDebugView(u8 taskId) { u32 i; @@ -961,8 +1068,8 @@ static void SwitchToDebugView(u8 taskId) FreeMonIconPalettes(); for (i = 0; i < MAX_BATTLERS_COUNT; i++) { - if (data->aiIconSpriteIds[i] != 0xFF) - FreeAndDestroyMonIconSprite(&gSprites[data->aiIconSpriteIds[i]]); + if (data->spriteIds.aiIconSpriteIds[i] != 0xFF) + FreeAndDestroyMonIconSprite(&gSprites[data->spriteIds.aiIconSpriteIds[i]]); } FreeAndDestroyMonPicSprite(data->aiMonSpriteId); RemoveWindow(data->aiMovesWindowId); @@ -1019,6 +1126,11 @@ static void Task_DebugMenuProcessInput(u8 taskId) SwitchToAiInfoView(taskId); return; } + else if (listItemId == LIST_ITEM_AI_PARTY && gMain.newKeys & A_BUTTON) + { + SwitchToAiPartyView(taskId); + return; + } data->currentMainListItemId = listItemId; // Create the secondary menu list. @@ -2040,7 +2152,7 @@ static const u8 sText_HoldEffectRoomService[] = _("Room Service"); static const u8 sText_HoldEffectBlunderPolicy[] = _("Blunder Policy"); static const u8 sText_HoldEffectHeavyDutyBoots[] = _("Heavy Duty Boots"); static const u8 sText_HoldEffectThroatSpray[] = _("Throat Spray"); -static const u8 *const sHoldEffectNames[] = +static const u8 *const sHoldEffectNames[] = { [HOLD_EFFECT_NONE] = sText_HoldEffectNone, [HOLD_EFFECT_RESTORE_HP] = sText_HoldEffectRestoreHp, diff --git a/src/battle_main.c b/src/battle_main.c index 147c6ec415..5b58f08939 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -947,7 +947,7 @@ static void CB2_HandleStartBattle(void) // Recv Pokémon 5-6 ResetBlockReceivedFlags(); memcpy(&gEnemyParty[4], gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2); - + TryCorrectShedinjaLanguage(&gEnemyParty[0]); TryCorrectShedinjaLanguage(&gEnemyParty[1]); TryCorrectShedinjaLanguage(&gEnemyParty[2]); @@ -2856,7 +2856,7 @@ static void SpriteCB_TrainerThrowObject_Main(struct Sprite *sprite) sprite->callback = SpriteCB_Idle; } -// Sprite callback for a trainer back pic to throw an object +// Sprite callback for a trainer back pic to throw an object // (Wally throwing a ball, throwing Pokéblocks/balls in the Safari Zone) void SpriteCB_TrainerThrowObject(struct Sprite *sprite) { @@ -2991,10 +2991,10 @@ static void BattleStartClearSetData(void) gBattleStruct->arenaLostOpponentMons = 0; gBattleStruct->mega.triggerSpriteId = 0xFF; - + gBattleStruct->stickyWebUser = 0xFF; gBattleStruct->appearedInBattle = 0; - + for (i = 0; i < PARTY_SIZE; i++) { gBattleStruct->usedHeldItems[i][0] = 0; @@ -3094,7 +3094,7 @@ void SwitchInClearSetData(void) gBattleStruct->lastTakenMoveFrom[gActiveBattler][3] = 0; gBattleStruct->lastMoveFailed &= ~(gBitTable[gActiveBattler]); gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); - + if (gActiveBattler == gBattleStruct->stickyWebUser) gBattleStruct->stickyWebUser = 0xFF; // Switched into sticky web user slot so reset it @@ -3110,14 +3110,12 @@ void SwitchInClearSetData(void) gBattleResources->flags->flags[gActiveBattler] = 0; gCurrentMove = 0; gBattleStruct->arenaTurnCounter = 0xFF; - + // Reset damage to prevent things like red card activating if the switched-in mon is holding it gSpecialStatuses[gActiveBattler].physicalDmg = 0; gSpecialStatuses[gActiveBattler].specialDmg = 0; - ClearBattlerMoveHistory(gActiveBattler); - ClearBattlerAbilityHistory(gActiveBattler); - ClearBattlerItemEffectHistory(gActiveBattler); + Ai_UpdateSwitchInData(gActiveBattler); } void FaintClearSetData(void) @@ -3194,7 +3192,7 @@ void FaintClearSetData(void) gBattleStruct->lastTakenMoveFrom[gActiveBattler][3] = 0; gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); - + if (gActiveBattler == gBattleStruct->stickyWebUser) gBattleStruct->stickyWebUser = 0xFF; // User of sticky web fainted, so reset the stored battler ID @@ -3572,7 +3570,8 @@ static void DoBattleIntro(void) gBattleStruct->switchInAbilitiesCounter = 0; gBattleStruct->switchInItemsCounter = 0; gBattleStruct->overworldWeatherDone = FALSE; - + GetAiLogicData(); // get assumed abilities, hold effects, etc of all battlers + Ai_InitPartyStruct(); // Save mons party counts, and first 2/4 mons on the battlefield. gBattleMainFunc = TryDoEventsBeforeFirstTurn; } break; @@ -3706,8 +3705,6 @@ static void TryDoEventsBeforeFirstTurn(void) gMoveResultFlags = 0; gRandomTurnNumber = Random(); - - GetAiLogicData(); // get assumed abilities, hold effects, etc of all battlers if (gBattleTypeFlags & BATTLE_TYPE_ARENA) { @@ -3914,7 +3911,7 @@ static void HandleTurnActionSelectionState(void) case STATE_TURN_START_RECORD: // Recorded battle related action on start of every turn. RecordedBattle_CopyBattlerMoves(); gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN; - + // Do AI score computations here so we can use them in AI_TrySwitchOrUseItem if ((gBattleTypeFlags & BATTLE_TYPE_HAS_AI || IsWildMonSmart()) && IsBattlerAIControlled(gActiveBattler)) { gBattleStruct->aiMoveOrAction[gActiveBattler] = ComputeBattleAiScores(gActiveBattler); @@ -4574,7 +4571,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) // QUICK CLAW / CUSTAP - always first // LAGGING TAIL - always last // STALL - always last - + if (gProtectStructs[battler1].quickDraw && !gProtectStructs[battler2].quickDraw) strikesFirst = 0; else if (!gProtectStructs[battler1].quickDraw && gProtectStructs[battler2].quickDraw) diff --git a/src/battle_util2.c b/src/battle_util2.c index 2ccc38a8a7..219db07866 100644 --- a/src/battle_util2.c +++ b/src/battle_util2.c @@ -27,6 +27,7 @@ void AllocateBattleResources(void) gBattleResources->beforeLvlUp = AllocZeroed(sizeof(*gBattleResources->beforeLvlUp)); gBattleResources->ai = AllocZeroed(sizeof(*gBattleResources->ai)); gBattleResources->aiData = AllocZeroed(sizeof(*gBattleResources->aiData)); + gBattleResources->aiParty = AllocZeroed(sizeof(*gBattleResources->aiParty)); gBattleResources->battleHistory = AllocZeroed(sizeof(*gBattleResources->battleHistory)); gLinkBattleSendBuffer = AllocZeroed(BATTLE_BUFFER_LINK_SIZE); @@ -59,6 +60,7 @@ void FreeBattleResources(void) FREE_AND_SET_NULL(gBattleResources->beforeLvlUp); FREE_AND_SET_NULL(gBattleResources->ai); FREE_AND_SET_NULL(gBattleResources->aiData); + FREE_AND_SET_NULL(gBattleResources->aiParty); FREE_AND_SET_NULL(gBattleResources->battleHistory); FREE_AND_SET_NULL(gBattleResources); diff --git a/vbalink.ini b/vbalink.ini new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 From 05ec8fb182f7014290ab60b55acb4206e94be5b5 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 23 Aug 2022 11:58:17 +0200 Subject: [PATCH 052/155] AI knows Party mons --- NO$GBA.EXE - Shortcut.lnk | Bin 1536 -> 0 bytes include/battle.h | 3 +- include/battle_ai_main.h | 1 + include/party_menu.h | 2 ++ src/battle_ai_main.c | 21 ++++++++++++++ src/battle_debug.c | 57 ++++++++++++++++++++++++++++++++++---- src/battle_main.c | 4 +-- src/data/party_menu.h | 2 +- src/party_menu.c | 7 ++--- vbalink.ini | Bin 1 -> 0 bytes 10 files changed, 82 insertions(+), 15 deletions(-) delete mode 100644 NO$GBA.EXE - Shortcut.lnk delete mode 100644 vbalink.ini diff --git a/NO$GBA.EXE - Shortcut.lnk b/NO$GBA.EXE - Shortcut.lnk deleted file mode 100644 index 32af57cf5c29d844b1fcfe676c636e29595572a5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1536 zcmd5+ZAep57=Gp~v?M2*4DsWVCidZ&W{QgFbh>HgB%2yda=PUQbF*D_K@pM=7%B-x zi5SBy2@;g7ep&XTpdb)`g!)T@APN)dhXxV7@4Zu}1o|iFT%Pxwd*1h)=e!^1lmbvh z1ds%#C5fUz1VNzjN=M^DR$$T^LxebpTUx)Lbl(KHxv#k(RQq zNu{`LRr@ruM&;V&+zzcV8~L~?NuzA zTB34y(%+(MMmNX%hW1XWD6d%3PAwFm+c3H|6FwqdJoK36ZA=_TC?)u(cy}%cNczWt zJ;Dd1Hb!74v@3^SEE}R!4_5+ed+vXG!uow|z)tYZ@podgPJx4@3nd_r#nV;kso}{G z{^!B^JHuN_*Ppj!tq!g9Ip})VQ;D?suDQJE0O{o|eXkY&&lC8tkDBX~a_-EAJ^P4h z)4Y0Sisob4fOj?%{=cH!TFCwZF;~F%r@E|(jzWM diff --git a/include/battle.h b/include/battle.h index a8064e98aa..e4d280ae92 100644 --- a/include/battle.h +++ b/include/battle.h @@ -254,9 +254,10 @@ struct AiPartyMon u16 gender; u16 level; u16 moves[MAX_MON_MOVES]; + u32 status; bool8 isFainted; - u8 switchInCount; // Counts how many times this Pokemon has been sent out or switched into in a battle. bool8 wasSentInBattle; + u8 switchInCount; // Counts how many times this Pokemon has been sent out or switched into in a battle. }; struct AIPartyData // Opposing battlers - party mons. diff --git a/include/battle_ai_main.h b/include/battle_ai_main.h index 2756c7f6ce..1d53a3f398 100644 --- a/include/battle_ai_main.h +++ b/include/battle_ai_main.h @@ -26,6 +26,7 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves); u8 BattleAI_ChooseMoveOrAction(void); void Ai_InitPartyStruct(void); void Ai_UpdateSwitchInData(u32 battler); +void Ai_UpdateFaintData(u32 battler); void GetAiLogicData(void); extern u8 sBattler_AI; diff --git a/include/party_menu.h b/include/party_menu.h index 7f51d08c9f..1186f5c765 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -30,6 +30,7 @@ extern u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2]; extern void (*gItemUseCB)(u8, TaskFunc); extern const u16 gTutorMoves[]; +extern const struct SpriteTemplate gSpriteTemplate_StatusIcons; void AnimatePartySlot(u8 slot, u8 animNum); bool8 IsMultiBattle(void); @@ -47,6 +48,7 @@ bool8 FieldCallback_PrepareFadeInFromMenu(void); void CB2_ReturnToPartyMenuFromFlyMap(void); void LoadHeldItemIcons(void); void DrawHeldItemIconsForTrade(u8 *partyCounts, u8 *partySpriteIds, u8 whichParty); +void LoadPartyMenuAilmentGfx(void); void CB2_ShowPartyMenuForItemUse(void); void ItemUseCB_Medicine(u8 taskId, TaskFunc task); void ItemUseCB_ReduceEV(u8 taskId, TaskFunc task); diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index eb8d45abb3..cc6c222fb4 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -245,6 +245,7 @@ static void CopyBattlerDataToAIParty(u32 bPosition, u32 side) aiMon->species = bMon->species; aiMon->level = bMon->level; + aiMon->status = bMon->status1; aiMon->gender = GetGenderFromSpeciesAndPersonality(bMon->species, bMon->personality); aiMon->isFainted = FALSE; aiMon->wasSentInBattle = TRUE; @@ -253,6 +254,8 @@ static void CopyBattlerDataToAIParty(u32 bPosition, u32 side) void Ai_InitPartyStruct(void) { + u32 i; + AI_PARTY->count[B_SIDE_PLAYER] = gPlayerPartyCount; AI_PARTY->count[B_SIDE_OPPONENT] = gEnemyPartyCount; @@ -267,6 +270,13 @@ void Ai_InitPartyStruct(void) CopyBattlerDataToAIParty(B_POSITION_OPPONENT_LEFT, B_SIDE_OPPONENT); CopyBattlerDataToAIParty(B_POSITION_OPPONENT_RIGHT, B_SIDE_OPPONENT); } + + // Find fainted mons + for (i = 0; i < AI_PARTY->count[B_SIDE_PLAYER]; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0) + AI_PARTY->mons[B_SIDE_PLAYER][i].isFainted = TRUE; + } } void Ai_UpdateSwitchInData(u32 battler) @@ -287,6 +297,8 @@ void Ai_UpdateSwitchInData(u32 battler) if (aiMon->moves[i]) BATTLE_HISTORY->usedMoves[battler][i] = aiMon->moves[i]; } + aiMon->switchInCount++; + aiMon->status = gBattleMons[battler].status1; // Copy status, because it could've been changed in battle. } else // If not, copy the newly switched-in mon in battle and clear battle history. { @@ -297,6 +309,15 @@ void Ai_UpdateSwitchInData(u32 battler) } } +void Ai_UpdateFaintData(u32 battler) +{ + struct AiPartyMon *aiMon = &AI_PARTY->mons[GET_BATTLER_SIDE(battler)][gBattlerPartyIndexes[battler]]; + ClearBattlerMoveHistory(battler); + ClearBattlerAbilityHistory(battler); + ClearBattlerItemEffectHistory(battler); + aiMon->isFainted = TRUE; +} + static void SetBattlerAiData(u8 battlerId) { AI_DATA->abilities[battlerId] = AI_GetAbility(battlerId); diff --git a/src/battle_debug.c b/src/battle_debug.c index 256647ddf6..d9becdbabf 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -7,6 +7,7 @@ #include "menu_helpers.h" #include "scanline_effect.h" #include "palette.h" +#include "party_menu.h" #include "pokemon_icon.h" #include "sprite.h" #include "item.h" @@ -30,6 +31,7 @@ #include "reset_rtc_screen.h" #include "reshow_battle_screen.h" #include "constants/abilities.h" +#include "constants/party_menu.h" #include "constants/moves.h" #include "constants/items.h" #include "constants/rgb.h" @@ -883,7 +885,7 @@ static void PutAiInfoText(struct BattleDebugMenu *data) static void PutAiPartyText(struct BattleDebugMenu *data) { - u32 i, j, count, maxWidth; + u32 i, j, count; u8 *text = malloc(0x50), *txtPtr; struct AiPartyMon *aiMons = AI_PARTY->mons[GET_BATTLER_SIDE(data->aiBattlerId)]; @@ -891,15 +893,37 @@ static void PutAiPartyText(struct BattleDebugMenu *data) count = AI_PARTY->count[GET_BATTLER_SIDE(data->aiBattlerId)]; for (i = 0; i < count; i++) { + if (aiMons[i].wasSentInBattle) + { + text[0] = CHAR_LV; + txtPtr = ConvertIntToDecimalStringN(text + 1, aiMons[i].level, STR_CONV_MODE_LEFT_ALIGN, 3); + *txtPtr++ = CHAR_SPACE; + if (aiMons[i].gender == MON_MALE) + *txtPtr++ = CHAR_MALE; + else if (aiMons[i].gender == MON_FEMALE) + *txtPtr++ = CHAR_FEMALE; + *txtPtr = EOS; + AddTextPrinterParameterized5(data->aiMovesWindowId, FONT_SMALL_NARROW, text, i * 41, 0, 0, NULL, 0, 0); + } + txtPtr = StringCopyN(text, gAbilityNames[aiMons[i].ability], 7); // The screen is too small to fit the whole string, so we need to drop the last letters. *txtPtr = EOS; - AddTextPrinterParameterized5(data->aiMovesWindowId, FONT_SMALL_NARROW, text, i * 41, 0, 0, NULL, 0, 0); + AddTextPrinterParameterized5(data->aiMovesWindowId, FONT_SMALL_NARROW, text, i * 41, 15, 0, NULL, 0, 0); + for (j = 0; j < MAX_MON_MOVES; j++) { txtPtr = StringCopyN(text, gMoveNames[aiMons[i].moves[j]], 8); *txtPtr = EOS; - AddTextPrinterParameterized5(data->aiMovesWindowId, FONT_SMALL_NARROW, text, i * 41, 20 + j * 15, 0, NULL, 0, 0); + AddTextPrinterParameterized5(data->aiMovesWindowId, FONT_SMALL_NARROW, text, i * 41, 35 + j * 15, 0, NULL, 0, 0); } + + txtPtr = StringCopyN(text, GetHoldEffectName(aiMons[i].heldEffect), 7); + *txtPtr = EOS; + AddTextPrinterParameterized5(data->aiMovesWindowId, FONT_SMALL_NARROW, text, i * 41, 35 + j * 15, 0, NULL, 0, 0); + + txtPtr = ConvertIntToDecimalStringN(text, aiMons[i].switchInCount, STR_CONV_MODE_LEFT_ALIGN, 2); + *txtPtr = EOS; + AddTextPrinterParameterized5(data->aiMovesWindowId, FONT_SMALL_NARROW, text, i * 41, 35 + (j + 1) * 15, 0, NULL, 0, 0); } CopyWindowToVram(data->aiMovesWindowId, 3); @@ -984,9 +1008,11 @@ static void Task_ShowAiKnowledge(u8 taskId) } } +#define sConditionSpriteId data[1] + static void Task_ShowAiParty(u8 taskId) { - u32 i; + u32 i, ailment; struct WindowTemplate winTemplate; struct AiPartyMon *aiMons; struct BattleDebugMenu *data = GetStructPtr(taskId); @@ -998,6 +1024,7 @@ static void Task_ShowAiParty(u8 taskId) ShowBg(1); LoadMonIconPalettes(); + LoadPartyMenuAilmentGfx(); data->aiBattlerId = data->battlerId; aiMons = AI_PARTY->mons[GET_BATTLER_SIDE(data->aiBattlerId)]; for (i = 0; i < AI_PARTY->count[GET_BATTLER_SIDE(data->aiBattlerId)]; i++) @@ -1005,7 +1032,18 @@ static void Task_ShowAiParty(u8 taskId) u16 species = SPECIES_OLD_UNOWN_B; // Question mark if (aiMons[i].wasSentInBattle && aiMons[i].species) species = aiMons[i].species; - data->spriteIds.aiPartyIcons[i] = CreateMonIcon(species, SpriteCallbackDummy, (i * 41) - 5 + 20, 7, 0, 0, FALSE); + data->spriteIds.aiPartyIcons[i] = CreateMonIcon(species, SpriteCallbackDummy, (i * 41) + 15, 7, 1, 0, FALSE); + gSprites[data->spriteIds.aiPartyIcons[i]].oam.priority = 0; + + gSprites[data->spriteIds.aiPartyIcons[i]].sConditionSpriteId = CreateSprite(&gSpriteTemplate_StatusIcons, (i * 41) + 15, 7, 0); + gSprites[gSprites[data->spriteIds.aiPartyIcons[i]].sConditionSpriteId].oam.priority = 0; + if (aiMons[i].isFainted) + ailment = AILMENT_FNT; + else if (aiMons[i].status) + ailment = GetAilmentFromStatus(aiMons[i].status); + else + ailment = AILMENT_FNT + 1; // blank + StartSpriteAnim(&gSprites[gSprites[data->spriteIds.aiPartyIcons[i]].sConditionSpriteId], ailment - 1); } for (; i < PARTY_SIZE; i++) data->spriteIds.aiPartyIcons[i] = 0xFF; @@ -1013,7 +1051,7 @@ static void Task_ShowAiParty(u8 taskId) break; // Put text case 1: - winTemplate = CreateWindowTemplate(1, 0, 4, 30, 14, 15, 0x200); + winTemplate = CreateWindowTemplate(1, 0, 3, 29, 16, 15, 0x150); data->aiMovesWindowId = AddWindow(&winTemplate); PutWindowTilemap(data->aiMovesWindowId); PutAiPartyText(data); @@ -1053,13 +1091,19 @@ static void SwitchToDebugViewFromAiParty(u8 taskId) for (i = 0; i < PARTY_SIZE; i++) { if (data->spriteIds.aiPartyIcons[i] != 0xFF) + { + DestroySpriteAndFreeResources(&gSprites[gSprites[data->spriteIds.aiPartyIcons[i]].sConditionSpriteId]); FreeAndDestroyMonIconSprite(&gSprites[data->spriteIds.aiPartyIcons[i]]); + } } + ClearWindowTilemap(data->aiMovesWindowId); RemoveWindow(data->aiMovesWindowId); gTasks[taskId].func = Task_DebugMenuProcessInput; } +#undef sConditionSpriteId + static void SwitchToDebugView(u8 taskId) { u32 i; @@ -1072,6 +1116,7 @@ static void SwitchToDebugView(u8 taskId) FreeAndDestroyMonIconSprite(&gSprites[data->spriteIds.aiIconSpriteIds[i]]); } FreeAndDestroyMonPicSprite(data->aiMonSpriteId); + ClearWindowTilemap(data->aiMovesWindowId); RemoveWindow(data->aiMovesWindowId); gTasks[taskId].func = Task_DebugMenuProcessInput; diff --git a/src/battle_main.c b/src/battle_main.c index 5b58f08939..afa1f52882 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3210,9 +3210,7 @@ void FaintClearSetData(void) gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2; gBattleMons[gActiveBattler].type3 = TYPE_MYSTERY; - ClearBattlerMoveHistory(gActiveBattler); - ClearBattlerAbilityHistory(gActiveBattler); - ClearBattlerItemEffectHistory(gActiveBattler); + Ai_UpdateFaintData(gActiveBattler); UndoFormChange(gBattlerPartyIndexes[gActiveBattler], GET_BATTLER_SIDE(gActiveBattler), FALSE); if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) UndoMegaEvolution(gBattlerPartyIndexes[gActiveBattler]); diff --git a/src/data/party_menu.h b/src/data/party_menu.h index 7735dae58d..cc490baeb6 100644 --- a/src/data/party_menu.h +++ b/src/data/party_menu.h @@ -1143,7 +1143,7 @@ static const struct CompressedSpritePalette sSpritePalette_StatusIcons = gStatusPal_Icons, TAG_STATUS_ICONS }; -static const struct SpriteTemplate sSpriteTemplate_StatusIcons = +const struct SpriteTemplate gSpriteTemplate_StatusIcons = { .tileTag = TAG_STATUS_ICONS, .paletteTag = TAG_STATUS_ICONS, diff --git a/src/party_menu.c b/src/party_menu.c index 4323b4656b..1754ef100c 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -165,7 +165,6 @@ static bool8 AllocPartyMenuBgGfx(void); static void InitPartyMenuWindows(u8); static void InitPartyMenuBoxes(u8); static void LoadPartyMenuPokeballGfx(void); -static void LoadPartyMenuAilmentGfx(void); static bool8 CreatePartyMonSpritesLoop(void); static bool8 RenderPartyMenuBoxes(void); static void CreateCancelConfirmPokeballSprites(void); @@ -4107,7 +4106,7 @@ static void CreatePartyMonStatusSprite(struct Pokemon *mon, struct PartyMenuBox { if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE) { - menuBox->statusSpriteId = CreateSprite(&sSpriteTemplate_StatusIcons, menuBox->spriteCoords[4], menuBox->spriteCoords[5], 0); + menuBox->statusSpriteId = CreateSprite(&gSpriteTemplate_StatusIcons, menuBox->spriteCoords[4], menuBox->spriteCoords[5], 0); SetPartyMonAilmentGfx(mon, menuBox); } } @@ -4116,7 +4115,7 @@ static void CreatePartyMonStatusSpriteParameterized(u16 species, u8 status, stru { if (species != SPECIES_NONE) { - menuBox->statusSpriteId = CreateSprite(&sSpriteTemplate_StatusIcons, menuBox->spriteCoords[4], menuBox->spriteCoords[5], 0); + menuBox->statusSpriteId = CreateSprite(&gSpriteTemplate_StatusIcons, menuBox->spriteCoords[4], menuBox->spriteCoords[5], 0); UpdatePartyMonAilmentGfx(status, menuBox); gSprites[menuBox->statusSpriteId].oam.priority = 0; } @@ -4142,7 +4141,7 @@ static void UpdatePartyMonAilmentGfx(u8 status, struct PartyMenuBox *menuBox) } } -static void LoadPartyMenuAilmentGfx(void) +void LoadPartyMenuAilmentGfx(void) { LoadCompressedSpriteSheet(&sSpriteSheet_StatusIcons); LoadCompressedSpritePalette(&sSpritePalette_StatusIcons); diff --git a/vbalink.ini b/vbalink.ini deleted file mode 100644 index f76dd238ade08917e6712764a16a22005a50573d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1 IcmZPo000310RR91 From 18203a0402e9e6f8a9af4f84c3a5f1a2554a2381 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 23 Aug 2022 14:50:16 +0200 Subject: [PATCH 053/155] Fix makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ec3b5c4c6a..c36cc8e936 100644 --- a/Makefile +++ b/Makefile @@ -107,7 +107,7 @@ LIBPATH := -L ../../tools/agbcc/lib LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall else CC1 = $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet -override CFLAGS += -mthumb -mthumb-interwork -O0 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast +override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast ROM := $(MODERN_ROM_NAME) OBJ_DIR := $(MODERN_OBJ_DIR_NAME) LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" From 3771abbe087df2a18963fd4a4e0f8a117c1b059a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 23 Aug 2022 12:39:24 -0400 Subject: [PATCH 054/155] Fix names and constant usage for union room classes --- include/constants/pokemon.h | 3 --- include/constants/union_room.h | 4 ++++ include/pokemon.h | 2 +- include/trainer_card.h | 2 +- src/pokemon.c | 19 +++++++++++-------- src/trainer_card.c | 11 ++++++----- src/union_room_player_avatar.c | 5 +++-- 7 files changed, 26 insertions(+), 20 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 40af999fde..f93df1fca9 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -247,9 +247,6 @@ #define EVO_MODE_ITEM_USE 2 #define EVO_MODE_ITEM_CHECK 3 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve -#define NUM_MALE_LINK_FACILITY_CLASSES 8 -#define NUM_FEMALE_LINK_FACILITY_CLASSES 8 - #define MON_PIC_WIDTH 64 #define MON_PIC_HEIGHT 64 #define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2) diff --git a/include/constants/union_room.h b/include/constants/union_room.h index f47a8723ff..5c0c57a606 100644 --- a/include/constants/union_room.h +++ b/include/constants/union_room.h @@ -13,6 +13,10 @@ #define UNION_ROOM_MAX_LEVEL 30 +// The number of possible trainer classes for a trainer of a given gender in the Union Room. +// This value is necessarily a power of 2 because of the way it's treated in GetUnionRoomTrainerPic / GetUnionRoomTrainerClass +#define NUM_UNION_ROOM_CLASSES (1 << 3) // 8 + #define ACTIVITY_NONE 0 #define ACTIVITY_BATTLE_SINGLE 1 #define ACTIVITY_BATTLE_DOUBLE 2 diff --git a/include/pokemon.h b/include/pokemon.h index 79b662bf1d..63c5c74eb7 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -382,7 +382,7 @@ extern const u8 gPPUpGetMask[]; extern const u8 gPPUpClearMask[]; extern const u8 gPPUpAddValues[]; extern const u8 gStatStageRatios[MAX_STAT_STAGE + 1][2]; -extern const u16 gLinkPlayerFacilityClasses[]; +extern const u16 gUnionRoomFacilityClasses[]; extern const struct SpriteTemplate gBattlerSpriteTemplates[]; extern const s8 gNatureStatTable[][5]; diff --git a/include/trainer_card.h b/include/trainer_card.h index f14335ae89..7c37a84a6c 100644 --- a/include/trainer_card.h +++ b/include/trainer_card.h @@ -54,7 +54,7 @@ struct TrainerCard /*0x4C*/ bool8 shouldDrawStickers; // FRLG only /*0x4D*/ u8 unused; /*0x4E*/ u8 monIconTint; // FRLG only - /*0x4F*/ u8 facilityClass; + /*0x4F*/ u8 unionRoomClass; /*0x50*/ u8 stickers[TRAINER_CARD_STICKER_TYPES]; // FRLG only /*0x54*/ u16 monSpecies[PARTY_SIZE]; // FRLG only // Note: Link players use linkHasAllFrontierSymbols, not the field below, diff --git a/src/pokemon.c b/src/pokemon.c index 8786405c8b..244717c79a 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -46,6 +46,7 @@ #include "constants/moves.h" #include "constants/songs.h" #include "constants/trainers.h" +#include "constants/union_room.h" struct SpeciesItem { @@ -1884,7 +1885,9 @@ static const u16 sDeoxysBaseStats[] = [STAT_SPDEF] = 90, }; -const u16 gLinkPlayerFacilityClasses[NUM_MALE_LINK_FACILITY_CLASSES + NUM_FEMALE_LINK_FACILITY_CLASSES] = +// The classes used by other players in the Union Room. +// These should correspond with the overworld graphics in sUnionRoomObjGfxIds +const u16 gUnionRoomFacilityClasses[NUM_UNION_ROOM_CLASSES * GENDER_COUNT] = { // Male classes FACILITY_CLASS_COOLTRAINER_M, @@ -1895,7 +1898,7 @@ const u16 gLinkPlayerFacilityClasses[NUM_MALE_LINK_FACILITY_CLASSES + NUM_FEMALE FACILITY_CLASS_BUG_CATCHER, FACILITY_CLASS_PKMN_BREEDER_M, FACILITY_CLASS_GUITARIST, - // Female Classes + // Female classes FACILITY_CLASS_COOLTRAINER_F, FACILITY_CLASS_HEX_MANIAC, FACILITY_CLASS_PICNICKER, @@ -2740,9 +2743,9 @@ u16 GetUnionRoomTrainerPic(void) else linkId = GetMultiplayerId() ^ 1; - arrId = gLinkPlayers[linkId].trainerId & 7; - arrId |= gLinkPlayers[linkId].gender << 3; - return FacilityClassToPicIndex(gLinkPlayerFacilityClasses[arrId]); + arrId = gLinkPlayers[linkId].trainerId % NUM_UNION_ROOM_CLASSES; + arrId |= gLinkPlayers[linkId].gender * NUM_UNION_ROOM_CLASSES; + return FacilityClassToPicIndex(gUnionRoomFacilityClasses[arrId]); } u16 GetUnionRoomTrainerClass(void) @@ -2755,9 +2758,9 @@ u16 GetUnionRoomTrainerClass(void) else linkId = GetMultiplayerId() ^ 1; - arrId = gLinkPlayers[linkId].trainerId & 7; - arrId |= gLinkPlayers[linkId].gender << 3; - return gFacilityClassToTrainerClass[gLinkPlayerFacilityClasses[arrId]]; + arrId = gLinkPlayers[linkId].trainerId % NUM_UNION_ROOM_CLASSES; + arrId |= gLinkPlayers[linkId].gender * NUM_UNION_ROOM_CLASSES; + return gFacilityClassToTrainerClass[gUnionRoomFacilityClasses[arrId]]; } void CreateEventLegalEnemyMon(void) diff --git a/src/trainer_card.c b/src/trainer_card.c index ab7b3c9131..04b8f686ab 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -31,6 +31,7 @@ #include "constants/battle_frontier.h" #include "constants/rgb.h" #include "constants/trainers.h" +#include "constants/union_room.h" struct TrainerCardData { @@ -761,9 +762,9 @@ static void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard) trainerCard->stars++; if (trainerCard->gender == FEMALE) - trainerCard->facilityClass = gLinkPlayerFacilityClasses[(trainerCard->trainerId % NUM_FEMALE_LINK_FACILITY_CLASSES) + NUM_MALE_LINK_FACILITY_CLASSES]; + trainerCard->unionRoomClass = gUnionRoomFacilityClasses[(trainerCard->trainerId % NUM_UNION_ROOM_CLASSES) + NUM_UNION_ROOM_CLASSES]; else - trainerCard->facilityClass = gLinkPlayerFacilityClasses[trainerCard->trainerId % NUM_MALE_LINK_FACILITY_CLASSES]; + trainerCard->unionRoomClass = gUnionRoomFacilityClasses[trainerCard->trainerId % NUM_UNION_ROOM_CLASSES]; } void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard *trainerCard) @@ -777,9 +778,9 @@ void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard *trainerCard) trainerCard->stars++; if (trainerCard->gender == FEMALE) - trainerCard->facilityClass = gLinkPlayerFacilityClasses[(trainerCard->trainerId % NUM_FEMALE_LINK_FACILITY_CLASSES) + NUM_MALE_LINK_FACILITY_CLASSES]; + trainerCard->unionRoomClass = gUnionRoomFacilityClasses[(trainerCard->trainerId % NUM_UNION_ROOM_CLASSES) + NUM_UNION_ROOM_CLASSES]; else - trainerCard->facilityClass = gLinkPlayerFacilityClasses[trainerCard->trainerId % NUM_MALE_LINK_FACILITY_CLASSES]; + trainerCard->unionRoomClass = gUnionRoomFacilityClasses[trainerCard->trainerId % NUM_UNION_ROOM_CLASSES]; } void CopyTrainerCardData(struct TrainerCard *dst, struct TrainerCard *src, u8 gameVersion) @@ -1876,7 +1877,7 @@ static void CreateTrainerCardTrainerPic(void) { if (InUnionRoom() == TRUE && gReceivedRemoteLinkPlayers == 1) { - CreateTrainerCardTrainerPicSprite(FacilityClassToPicIndex(sData->trainerCard.facilityClass), + CreateTrainerCardTrainerPicSprite(FacilityClassToPicIndex(sData->trainerCard.unionRoomClass), TRUE, sTrainerPicOffset[sData->isHoenn][sData->trainerCard.gender][0], sTrainerPicOffset[sData->isHoenn][sData->trainerCard.gender][1], diff --git a/src/union_room_player_avatar.c b/src/union_room_player_avatar.c index b60c263ae3..beff4440d0 100644 --- a/src/union_room_player_avatar.c +++ b/src/union_room_player_avatar.c @@ -24,7 +24,8 @@ static u32 IsUnionRoomPlayerInvisible(u32, u32); static void SetUnionRoomObjectFacingDirection(s32, s32, u8); // + 2 is just to match, those elements are empty and never read -static const u8 sUnionRoomObjGfxIds[GENDER_COUNT][MAX_UNION_ROOM_LEADERS + 2] = { +// Graphics ids should correspond with the classes in gUnionRoomFacilityClasses +static const u8 sUnionRoomObjGfxIds[GENDER_COUNT][NUM_UNION_ROOM_CLASSES + 2] = { [MALE] = { OBJ_EVENT_GFX_MAN_3, OBJ_EVENT_GFX_BLACK_BELT, @@ -132,7 +133,7 @@ static bool32 IsPlayerStandingStill(void) // Gender and trainer id are used to determine which sprite a player appears as static u8 GetUnionRoomPlayerGraphicsId(u32 gender, u32 id) { - return sUnionRoomObjGfxIds[gender][id % MAX_UNION_ROOM_LEADERS]; + return sUnionRoomObjGfxIds[gender][id % NUM_UNION_ROOM_CLASSES]; } static void GetUnionRoomPlayerCoords(u32 leaderId, u32 memberId, s32 * x, s32 * y) From 67f473f38b4af0148273d601c9c6b9d16143e2a7 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Tue, 23 Aug 2022 19:49:54 -0600 Subject: [PATCH 055/155] Fixed recommended issues. Added additional comments. Reordered switching ladder in ShouldSwitch() function. Functions that can specify a specific party mon to switch into need to come first. --- include/constants/battle_ai.h | 2 +- src/battle_ai_switch_items.c | 32 ++++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index a7a3e54183..5dbbccf489 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -56,7 +56,7 @@ #define AI_FLAG_STALL (1 << 13) // AI stalls battle and prefers secondary damage/trapping/etc. TODO not finished #define AI_FLAG_SCREENER (1 << 14) // AI prefers screening effects like reflect, mist, etc. TODO unfinished #define AI_FLAG_SMART_SWITCHING (1 << 15) // AI includes a lot more switching checks -#define AI_FLAG_ACE_POKEMON (1 << 16) // AI has Ace Pokemon -- Saves until last +#define AI_FLAG_ACE_POKEMON (1 << 16) // AI has Ace Pokemon. The last Pokemon in the party will not used until last remaining. // 'other' ai logic flags #define AI_FLAG_ROAMING (1 << 29) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 329d3ebf35..04aa8d23bd 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -109,6 +109,9 @@ static bool8 ShouldSwitchIfWonderGuard(void) continue; if (i == gBattlerPartyIndexes[gActiveBattler]) continue; + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1)) + continue; for (opposingBattler = GetBattlerAtPosition(opposingPosition), j = 0; j < MAX_MON_MOVES; j++) { @@ -260,7 +263,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) if (IsDoubleBattle()) { if (IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)) - && (GetAIChosenMove(BATTLE_PARTNER(gActiveBattler)) & MOVE_UPROAR) + && (GetAIChosenMove(BATTLE_PARTNER(gActiveBattler)) == MOVE_UPROAR) ) switchMon = FALSE; @@ -291,8 +294,8 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) && i != gBattlerPartyIndexes[gActiveBattler] && i != gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)] && IsBattlerGrounded(gActiveBattler) - && (GetMonData(&party[i], MON_DATA_ABILITY_NUM) == 226 - || GetMonData(&party[i], MON_DATA_ABILITY_NUM) == 228)) //Ally has Misty or Electric Surge + && (GetMonAbility(&party[i]) == ABILITY_MISTY_SURGE + || GetMonAbility(&party[i]) == ABILITY_ELECTRIC_SURGE)) //Ally has Misty or Electric Surge { *(gBattleStruct->AI_monToSwitchIntoId + BATTLE_PARTNER(gActiveBattler)) = i; BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); @@ -347,7 +350,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) //Nightmare moduloChance = 3; //33.3% - if (gBattleMons[gActiveBattler].status1 & (STATUS1_SLEEP > 1) && gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE + if (gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE && (Random() % (moduloChance*chanceReducer)) == 0) switchMon = TRUE; @@ -374,7 +377,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) && AnyStatIsRaised(gActiveBattler)) switchMon = FALSE; if (AiExpectsToFaintPlayer() - && GetAIChosenMove(gActiveBattler) == AI_IS_SLOWER + && !WillAIStrikeFirst() && !AI_OpponentCanFaintAiWithMod(0)) switchMon = FALSE; } @@ -671,20 +674,33 @@ bool32 ShouldSwitch(void) if (availableToSwitch == 0) return FALSE; - if (ShouldSwitchIfAllBadMoves()) + + //NOTE: The sequence of the below functions matter! Do not change unless you have carefully considered the outcome. + //Since the order is sequencial, and some of these functions prompt switch to specific party members. + + //These Functions can prompt switch to specific party members + if (ShouldSwitchIfWonderGuard()) return TRUE; if (ShouldSwitchIfGameStatePrompt()) return TRUE; - if (ShouldSwitchIfWonderGuard()) - return TRUE; if (FindMonThatAbsorbsOpponentsMove()) return TRUE; + + //These Functions can prompt switch to generic pary members + if (ShouldSwitchIfAllBadMoves()) + return TRUE; if (ShouldSwitchIfAbilityBenefit()) return TRUE; + + //Removing switch capabilites under specific conditions + //These Functions prevent the "FindMonWithFlagsAndSuperEffective" from getting out of hand. if (HasSuperEffectiveMoveAgainstOpponents(FALSE)) return FALSE; if (AreStatsRaised()) return FALSE; + + //Default Function + //Can prompt switch if AI has a pokemon in party that resists current opponent & has super effective move if (FindMonWithFlagsAndSuperEffective(MOVE_RESULT_DOESNT_AFFECT_FOE, 2) || FindMonWithFlagsAndSuperEffective(MOVE_RESULT_NOT_VERY_EFFECTIVE, 3)) return TRUE; From 2bd06dee1dc4dca78b4f8b3b28405dc91390ca1b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 24 Aug 2022 01:21:06 -0400 Subject: [PATCH 056/155] Update battle_debug.c --- src/battle_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_debug.c b/src/battle_debug.c index bc6c47d2c4..50f7aa4296 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -1001,7 +1001,7 @@ static void Task_ShowAiParty(u8 taskId) aiMons = AI_PARTY->mons[GET_BATTLER_SIDE(data->aiBattlerId)]; for (i = 0; i < AI_PARTY->count[GET_BATTLER_SIDE(data->aiBattlerId)]; i++) { - u16 species = SPECIES_OLD_UNOWN_B; // Question mark + u16 species = SPECIES_NONE; // Question mark if (aiMons[i].wasSentInBattle && aiMons[i].species) species = aiMons[i].species; data->spriteIds.aiPartyIcons[i] = CreateMonIcon(species, SpriteCallbackDummy, (i * 41) + 15, 7, 1, 0, FALSE); From ec4ff0acb7378908232ffea7534749bc726e90e2 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 24 Aug 2022 01:33:00 -0400 Subject: [PATCH 057/155] Update battle_debug.c --- src/battle_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_debug.c b/src/battle_debug.c index 50f7aa4296..59d00f097d 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -1004,7 +1004,7 @@ static void Task_ShowAiParty(u8 taskId) u16 species = SPECIES_NONE; // Question mark if (aiMons[i].wasSentInBattle && aiMons[i].species) species = aiMons[i].species; - data->spriteIds.aiPartyIcons[i] = CreateMonIcon(species, SpriteCallbackDummy, (i * 41) + 15, 7, 1, 0, FALSE); + data->spriteIds.aiPartyIcons[i] = CreateMonIcon(species, SpriteCallbackDummy, (i * 41) + 15, 7, 1, 0); gSprites[data->spriteIds.aiPartyIcons[i]].oam.priority = 0; gSprites[data->spriteIds.aiPartyIcons[i]].sConditionSpriteId = CreateSprite(&gSpriteTemplate_StatusIcons, (i * 41) + 15, 7, 0); From 94183b45c7c0acdf61233c284de5a143f30533ae Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:48:40 +0200 Subject: [PATCH 058/155] Added options for ttoggling battle frontier pass and giving max BPs --- src/debug.c | 51 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/src/debug.c b/src/debug.c index 0e464fa8b9..69b346fb86 100644 --- a/src/debug.c +++ b/src/debug.c @@ -46,6 +46,7 @@ #include "task.h" #include "pokemon_summary_screen.h" #include "constants/abilities.h" +#include "constants/battle_frontier.h" #include "constants/flags.h" #include "constants/items.h" #include "constants/map_groups.h" @@ -99,6 +100,7 @@ enum { // Flags DEBUG_FLAG_MENU_ITEM_POKENAVONOFF, DEBUG_FLAG_MENU_ITEM_FLYANYWHERE, DEBUG_FLAG_MENU_ITEM_GETALLBADGES, + DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS, DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF, DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF, DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF, @@ -115,6 +117,7 @@ enum { // Give DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX, DEBUG_GIVE_MENU_ITEM_MAX_MONEY, DEBUG_GIVE_MENU_ITEM_MAX_COINS, + DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG, DEBUG_GIVE_MENU_ITEM_FILL_PC, DEBUG_GIVE_MENU_ITEM_CHEAT, @@ -127,7 +130,7 @@ enum { //Sound // ******************************* // Constants -#define DEBUG_MAIN_MENU_WIDTH 13 +#define DEBUG_MAIN_MENU_WIDTH 15 #define DEBUG_MAIN_MENU_HEIGHT 8 #define DEBUG_NUMBER_DISPLAY_WIDTH 10 @@ -220,17 +223,18 @@ static void DebugAction_Util_Trainer_Id(u8); static void DebugAction_Flags_Flags(u8 taskId); static void DebugAction_Flags_FlagsSelect(u8 taskId); -static void DebugAction_Flags_SetPokedexFlags(u8); -static void DebugAction_Flags_SwitchDex(u8); -static void DebugAction_Flags_SwitchNatDex(u8); -static void DebugAction_Flags_SwitchPokeNav(u8); -static void DebugAction_Flags_ToggleFlyFlags(u8); -static void DebugAction_Flags_ToggleBadgeFlags(u8); -static void DebugAction_Flags_CollisionOnOff(u8); -static void DebugAction_Flags_EncounterOnOff(u8); -static void DebugAction_Flags_TrainerSeeOnOff(u8); -static void DebugAction_Flags_BagUseOnOff(u8); -static void DebugAction_Flags_CatchingOnOff(u8); +static void DebugAction_Flags_SetPokedexFlags(u8 taskId); +static void DebugAction_Flags_SwitchDex(u8 taskId); +static void DebugAction_Flags_SwitchNatDex(u8 taskId); +static void DebugAction_Flags_SwitchPokeNav(u8 taskId); +static void DebugAction_Flags_ToggleFlyFlags(u8 taskId); +static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId); +static void DebugAction_Flags_ToggleFrontierPass(u8 taskId); +static void DebugAction_Flags_CollisionOnOff(u8 taskId); +static void DebugAction_Flags_EncounterOnOff(u8 taskId); +static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId); +static void DebugAction_Flags_BagUseOnOff(u8 taskId); +static void DebugAction_Flags_CatchingOnOff(u8 taskId); static void DebugAction_Vars_Vars(u8 taskId); static void DebugAction_Vars_Select(u8 taskId); @@ -252,6 +256,7 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId); static void DebugAction_Give_Pokemon_Move(u8 taskId); static void DebugAction_Give_MaxMoney(u8 taskId); static void DebugAction_Give_MaxCoins(u8 taskId); +static void DebugAction_Give_MaxBattlePoints(u8 taskId); static void DebugAction_Give_DayCareEgg(u8 taskId); static void DebugAction_Give_FillPC(u8 taskId); static void DebugAction_Give_CHEAT(u8 taskId); @@ -288,7 +293,7 @@ extern const u8 gAbilityNames[][ABILITY_NAME_LENGTH + 1]; // ******************************* //Maps per map group COPY FROM /include/constants/map_groups.h - static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; +static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; // Text // Main Menu @@ -334,6 +339,7 @@ static const u8 gDebugText_Flags_SwitchNationalDex[] = _("NatDex ON/OFF"); static const u8 gDebugText_Flags_SwitchPokeNav[] = _("PokéNav ON/OFF"); static const u8 gDebugText_Flags_ToggleFlyFlags[] = _("Fly Flags ON/OFF"); static const u8 gDebugText_Flags_ToggleAllBadges[] = _("All badges ON/OFF"); +static const u8 gDebugText_Flags_ToggleFrontierPass[] = _("Frontier Pass ON/OFF"); static const u8 gDebugText_Flags_SwitchCollision[] = _("Collision ON/OFF"); static const u8 gDebugText_Flags_SwitchEncounter[] = _("Encounter ON/OFF"); static const u8 gDebugText_Flags_SwitchTrainerSee[] = _("TrainerSee ON/OFF"); @@ -373,6 +379,7 @@ static const u8 gDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3} static const u8 gDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); static const u8 gDebugText_Give_MaxMoney[] = _("Max Money"); static const u8 gDebugText_Give_MaxCoins[] = _("Max Coins"); +static const u8 gDebugText_Give_BattlePoints[] = _("Max Battle Points"); static const u8 gDebugText_Give_DaycareEgg[] = _("Daycare Egg"); static const u8 gDebugText_Give_FillPc[] = _("Fill Pc"); static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); @@ -466,6 +473,7 @@ static const struct ListMenuItem sDebugMenu_Items_Flags[] = [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = {gDebugText_Flags_SwitchPokeNav, DEBUG_FLAG_MENU_ITEM_POKENAVONOFF}, [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = {gDebugText_Flags_ToggleFlyFlags, DEBUG_FLAG_MENU_ITEM_FLYANYWHERE}, [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = {gDebugText_Flags_ToggleAllBadges, DEBUG_FLAG_MENU_ITEM_GETALLBADGES}, + [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = {gDebugText_Flags_ToggleFrontierPass, DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS}, [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = {gDebugText_Flags_SwitchCollision, DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF}, [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = {gDebugText_Flags_SwitchEncounter, DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF}, [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF]= {gDebugText_Flags_SwitchTrainerSee, DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF}, @@ -484,6 +492,7 @@ static const struct ListMenuItem sDebugMenu_Items_Give[] = [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {gDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = {gDebugText_Give_MaxMoney, DEBUG_GIVE_MENU_ITEM_MAX_MONEY}, [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = {gDebugText_Give_MaxCoins, DEBUG_GIVE_MENU_ITEM_MAX_COINS}, + [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS]= {gDebugText_Give_BattlePoints, DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS}, [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {gDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, [DEBUG_GIVE_MENU_ITEM_FILL_PC] = {gDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC}, [DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, @@ -543,6 +552,7 @@ static void (*const sDebugMenu_Actions_Flags[])(u8) = [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = DebugAction_Flags_SwitchPokeNav, [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = DebugAction_Flags_ToggleFlyFlags, [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = DebugAction_Flags_ToggleBadgeFlags, + [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = DebugAction_Flags_ToggleFrontierPass, [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = DebugAction_Flags_CollisionOnOff, [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = DebugAction_Flags_EncounterOnOff, [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF]= DebugAction_Flags_TrainerSeeOnOff, @@ -561,6 +571,7 @@ static void (*const sDebugMenu_Actions_Give[])(u8) = [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = DebugAction_Give_PokemonComplex, [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = DebugAction_Give_MaxMoney, [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = DebugAction_Give_MaxCoins, + [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS]= DebugAction_Give_MaxBattlePoints, [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg, [DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC, [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, @@ -1424,6 +1435,15 @@ static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId) FlagToggle(FLAG_BADGE07_GET); FlagToggle(FLAG_BADGE08_GET); } +static void DebugAction_Flags_ToggleFrontierPass(u8 taskId) +{ + // Sound effect + if(FlagGet(FLAG_SYS_FRONTIER_PASS)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_SYS_FRONTIER_PASS); +} static void DebugAction_Flags_CollisionOnOff(u8 taskId) { if(FlagGet(FLAG_SYS_NO_COLLISION)) @@ -2651,6 +2671,11 @@ static void DebugAction_Give_MaxCoins(u8 taskId) SetCoins(9999); } +static void DebugAction_Give_MaxBattlePoints(u8 taskId) +{ + gSaveBlock2Ptr->frontier.battlePoints = MAX_BATTLE_FRONTIER_POINTS; +} + static void DebugAction_Give_DayCareEgg(u8 taskId) { TriggerPendingDaycareEgg(); From 006d28fd699dd0acc9f6b0c5263aad754a3cc890 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:51:40 +0200 Subject: [PATCH 059/155] tiny fix for wrong "give pokemon" window --- src/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index 69b346fb86..53f86bb7b1 100644 --- a/src/debug.c +++ b/src/debug.c @@ -598,7 +598,7 @@ static const struct WindowTemplate sDebugMenuWindowTemplate = static const struct WindowTemplate sDebugNumberDisplayWindowTemplate = { .bg = 0, - .tilemapLeft = 6 + DEBUG_MAIN_MENU_WIDTH, + .tilemapLeft = 4 + DEBUG_MAIN_MENU_WIDTH, .tilemapTop = 1, .width = DEBUG_NUMBER_DISPLAY_WIDTH, .height = 2 * DEBUG_NUMBER_DISPLAY_HEIGHT, From bed56390746252537e6cd95cf090ccf2b444bd41 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 29 Aug 2022 19:36:44 +0200 Subject: [PATCH 060/155] Changed preproc defines to TRUE/FALSE, small cleanup --- include/debug.h | 4 +- src/battle_main.c | 22 ++++++----- src/event_object_movement.c | 6 +-- src/field_control_avatar.c | 73 +++++++++++++++++-------------------- src/item_use.c | 4 +- src/start_menu.c | 10 ++--- src/trainer_see.c | 8 ++-- 7 files changed, 62 insertions(+), 65 deletions(-) diff --git a/include/debug.h b/include/debug.h index 1014690a5a..9aec5c2629 100644 --- a/include/debug.h +++ b/include/debug.h @@ -1,8 +1,8 @@ #ifndef GUARD_DEBUG_H #define GUARD_DEBUG_H -#define TX_DEBUGGING -#define TX_DEBUG_MENU_OPTION FALSE +#define TX_DEBUG_SYSTEM TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by pressing R plus START. +#define TX_DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (replaces the exit entry). void Debug_ShowMainMenu(void); diff --git a/src/battle_main.c b/src/battle_main.c index e8688b067a..029578ceb7 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4001,21 +4001,25 @@ static void HandleTurnActionSelectionState(void) } break; case B_ACTION_USE_ITEM: - #ifdef TX_DEBUGGING - if (FlagGet(FLAG_SYS_NO_BAG_USE) || (gBattleTypeFlags & (BATTLE_TYPE_LINK //DEBUG + #if TX_DEBUG_SYSTEM == TRUE + if (FlagGet(FLAG_SYS_NO_BAG_USE)) + { + RecordedBattle_ClearBattlerAction(gActiveBattler, 1); + gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed; + gBattleCommunication[gActiveBattler] = STATE_SELECTION_SCRIPT; + *(gBattleStruct->selectionScriptFinished + gActiveBattler) = FALSE; + *(gBattleStruct->stateIdAfterSelScript + gActiveBattler) = STATE_BEFORE_ACTION_CHOSEN; + return; + } + #endif + + if ((gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER_NO_PYRAMID | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_RECORDED_LINK)) // Or if currently held by Sky Drop || gStatuses3[gActiveBattler] & STATUS3_SKY_DROPPED) { - #else //DEBUG - if (gBattleTypeFlags & (BATTLE_TYPE_LINK - | BATTLE_TYPE_FRONTIER_NO_PYRAMID - | BATTLE_TYPE_EREADER_TRAINER - | BATTLE_TYPE_RECORDED_LINK)) - { - #endif RecordedBattle_ClearBattlerAction(gActiveBattler, 1); gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed; gBattleCommunication[gActiveBattler] = STATE_SELECTION_SCRIPT; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 49bfce3c2f..c5663461ac 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4630,9 +4630,9 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) { u8 direction = dir; - #ifdef TX_DEBUGGING //DEBUG - if (FlagGet(FLAG_SYS_NO_COLLISION)) - return COLLISION_NONE; + #if TX_DEBUG_SYSTEM == TRUE + if (FlagGet(FLAG_SYS_NO_COLLISION)) + return COLLISION_NONE; #endif // if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y)) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 3edfe2f169..121a10670b 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -131,34 +131,30 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) else if (heldKeys & DPAD_RIGHT) input->dpadDirection = DIR_EAST; - //DEBUG - #ifdef TX_DEBUGGING - if (!TX_DEBUG_MENU_OPTION) + #if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE + if (heldKeys & R_BUTTON) + { + if(input->pressedSelectButton) { - if (heldKeys & R_BUTTON) - { - if(input->pressedSelectButton) - { - input->input_field_1_0 = TRUE; - input->pressedSelectButton = FALSE; - }else if(input->pressedStartButton) - { - input->input_field_1_2 = TRUE; - input->pressedStartButton = FALSE; - } - } - if (heldKeys & L_BUTTON) - { - if(input->pressedSelectButton) - { - input->input_field_1_1 = TRUE; - input->pressedSelectButton = FALSE; - }else if(input->pressedStartButton) - { - input->input_field_1_3 = TRUE; - input->pressedStartButton = FALSE; - } - } + input->input_field_1_0 = TRUE; + input->pressedSelectButton = FALSE; + }else if(input->pressedStartButton) + { + input->input_field_1_2 = TRUE; + input->pressedStartButton = FALSE; + } + } + if (heldKeys & L_BUTTON) + { + if(input->pressedSelectButton) + { + input->input_field_1_1 = TRUE; + input->pressedSelectButton = FALSE; + }else if(input->pressedStartButton) + { + input->input_field_1_3 = TRUE; + input->pressedStartButton = FALSE; + } } #endif } @@ -220,16 +216,13 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE) return TRUE; - #ifdef TX_DEBUGGING - if (!TX_DEBUG_MENU_OPTION) - { - if (input->input_field_1_2) - { - PlaySE(SE_WIN_OPEN); - Debug_ShowMainMenu(); - return TRUE; - } - } + #if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE + if (input->input_field_1_2) + { + PlaySE(SE_WIN_OPEN); + Debug_ShowMainMenu(); + return TRUE; + } #endif return FALSE; @@ -712,9 +705,9 @@ void RestartWildEncounterImmunitySteps(void) static bool8 CheckStandardWildEncounter(u16 metatileBehavior) { - #ifdef TX_DEBUGGING - if (FlagGet(FLAG_SYS_NO_ENCOUNTER)) //DEBUG - return FALSE;// + #if TX_DEBUG_SYSTEM == TRUE + if (FlagGet(FLAG_SYS_NO_ENCOUNTER)) + return FALSE; #endif if (sWildEncounterImmunitySteps < 4) diff --git a/src/item_use.c b/src/item_use.c index e9d03cabf5..537e787893 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -982,8 +982,8 @@ static const u8 sText_CantThrowPokeBall_TwoMons[] = _("Cannot throw a ball!\nThe static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a ball!\nThere's no Pokémon in sight!\p"); void ItemUseInBattle_PokeBall(u8 taskId) { - #ifdef TX_DEBUGGING - if (FlagGet(FLAG_SYS_NO_CATCHING)){ //DEBUG + #if TX_DEBUG_SYSTEM == TRUE + if (FlagGet(FLAG_SYS_NO_CATCHING)){ static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p"); DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage); return; diff --git a/src/start_menu.c b/src/start_menu.c index ccaff2e3a9..f4c0112b27 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -284,17 +284,17 @@ static void BuildStartMenuActions(void) { BuildMultiPartnerRoomStartMenu(); } -#if defined(TX_DEBUGGING) && TX_DEBUG_MENU_OPTION + #if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == TRUE else { BuildDebugStartMenu(); } -#else + #else else { BuildNormalStartMenu(); } -#endif + #endif } static void AddStartMenuAction(u8 action) @@ -772,8 +772,8 @@ static bool8 StartMenuDebugCallback(void) RemoveExtraStartMenuWindows(); HideStartMenuDebug(); // Hide start menu without enabling movement - #ifdef TX_DEBUGGING - Debug_ShowMainMenu(); + #if TX_DEBUG_SYSTEM == TRUE + Debug_ShowMainMenu(); #endif return TRUE; diff --git a/src/trainer_see.c b/src/trainer_see.c index bb2c411612..81b040a3b6 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -193,10 +193,10 @@ bool8 CheckForTrainersWantingBattle(void) { u8 i; - #ifdef TX_DEBUGGING //DEBUG - if (FlagGet(FLAG_SYS_NO_TRAINER_SEE)) - return FALSE; - #endif // + #if TX_DEBUG_SYSTEM == TRUE + if (FlagGet(FLAG_SYS_NO_TRAINER_SEE)) + return FALSE; + #endif gNoOfApproachingTrainers = 0; gApproachingTrainerId = 0; From 8cf29336585107a24dcbebbd261e99311ae9c9d9 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 29 Aug 2022 19:46:03 +0200 Subject: [PATCH 061/155] added preproc directive to main debug.c code --- src/debug.c | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/src/debug.c b/src/debug.c index 55604fc753..b27142abea 100644 --- a/src/debug.c +++ b/src/debug.c @@ -12,6 +12,7 @@ #include "credits.h" #include "data.h" #include "daycare.h" +#include "debug.h" #include "event_data.h" #include "event_object_movement.h" #include "event_scripts.h" @@ -54,7 +55,7 @@ #include "constants/songs.h" #include "constants/species.h" - +#if TX_DEBUG_SYSTEM == TRUE // ******************************* // Enums enum { // Main @@ -3639,31 +3640,4 @@ SOUND_LIST_SE }; #undef X - -// Additional functions -/* -static void DebugAction_OpenSubMenu(u8 taskId, struct ListMenuTemplate LMtemplate) -{ - Debug_DestroyMenu(taskId); - Debug_ShowMenu(DebugTask_HandleMenuInput, LMtemplate); -} -static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)) -{ - void (*func)(u8); - u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); - - if (gMain.newKeys & A_BUTTON) - { - PlaySE(SE_SELECT); - if ((func = HandleInput[input]) != NULL) - func(taskId); - } - else if (gMain.newKeys & B_BUTTON) - { - PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); - ScriptContext_Enable(); - } -} -*/ - +#endif \ No newline at end of file From df88317a9890a23521e09632d1fc345b720210d6 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 28 Aug 2022 11:48:39 -0300 Subject: [PATCH 062/155] Introduced FORM_BATTLE form changes For species such as Xerneas and Zacian. --- include/constants/pokemon.h | 2 ++ src/battle_main.c | 14 ++++++++++ src/battle_util.c | 17 +++++++++++- src/data/pokemon/form_change_table_pointers.h | 8 +++++- src/data/pokemon/form_change_tables.h | 26 +++++++++++++++++++ src/pokemon.c | 6 +++-- 6 files changed, 69 insertions(+), 4 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 98075a9425..8e8b31543d 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -324,6 +324,8 @@ #define FORM_WITHDRAW 4 #define FORM_ITEM_HOLD_ABILITY 5 #define FORM_ITEM_USE_TIME 6 +#define FORM_BATTLE_BEGIN 7 +#define FORM_BATTLE_END 8 #define NUM_MALE_LINK_FACILITY_CLASSES 8 #define NUM_FEMALE_LINK_FACILITY_CLASSES 8 diff --git a/src/battle_main.c b/src/battle_main.c index 25a0b06135..f75a7ae80b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -481,6 +481,7 @@ void CB2_InitBattle(void) static void CB2_InitBattleInternal(void) { s32 i; + u16 targetSpecies; SetHBlankCallback(NULL); SetVBlankCallback(NULL); @@ -571,6 +572,19 @@ static void CB2_InitBattleInternal(void) for (i = 0; i < PARTY_SIZE; i++) AdjustFriendship(&gPlayerParty[i], FRIENDSHIP_EVENT_LEAGUE_BATTLE); + // Apply party-wide start-of-battle form changes + for (i = 0; i < PARTY_SIZE; i++) + { + // Player's side + targetSpecies = GetFormChangeTargetSpecies(&gPlayerParty[i], FORM_BATTLE_BEGIN, 0); + if (targetSpecies != SPECIES_NONE) + SetMonData(&gPlayerParty[i], MON_DATA_SPECIES, &targetSpecies); + // Opponent's side + targetSpecies = GetFormChangeTargetSpecies(&gEnemyParty[i], FORM_BATTLE_BEGIN, 0); + if (targetSpecies != SPECIES_NONE) + SetMonData(&gEnemyParty[i], MON_DATA_SPECIES, &targetSpecies); + } + gBattleCommunication[MULTIUSE_STATE] = 0; } diff --git a/src/battle_util.c b/src/battle_util.c index f38d80a69c..dff9d71da5 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -9588,7 +9588,7 @@ void UndoMegaEvolution(u32 monId) void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut) { - u32 i, currSpecies; + u32 i, currSpecies, targetSpecies; struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; static const u16 species[][3] = { @@ -9622,6 +9622,21 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut) break; } } + if (!isSwitchingOut) + { + // Apply party-wide end-of-battle form changes + for (i = 0; i < PARTY_SIZE; i++) + { + // Player's side + targetSpecies = GetFormChangeTargetSpecies(&gPlayerParty[i], FORM_BATTLE_END, 0); + if (targetSpecies != SPECIES_NONE) + SetMonData(&gPlayerParty[i], MON_DATA_SPECIES, &targetSpecies); + // Opponent's side + targetSpecies = GetFormChangeTargetSpecies(&gEnemyParty[i], FORM_BATTLE_END, 0); + if (targetSpecies != SPECIES_NONE) + SetMonData(&gEnemyParty[i], MON_DATA_SPECIES, &targetSpecies); + } + } } bool32 DoBattlersShareType(u32 battler1, u32 battler2) diff --git a/src/data/pokemon/form_change_table_pointers.h b/src/data/pokemon/form_change_table_pointers.h index 3fdbff7a6e..58a6c899fc 100644 --- a/src/data/pokemon/form_change_table_pointers.h +++ b/src/data/pokemon/form_change_table_pointers.h @@ -31,11 +31,13 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] = [SPECIES_LANDORUS_THERIAN] = sLandorusTherianFormChangeTable, [SPECIES_KELDEO] = sKeldeoFormChangeTable, [SPECIES_KELDEO_RESOLUTE] = sKeldeoResoluteFormChangeTable, - [SPECIES_GENESECT] = sGenesectFormChangeTable, + [SPECIES_GENESECT] = sGenesectFormChangeTable, [SPECIES_GENESECT_DOUSE_DRIVE] = sGenesectFormChangeTable, [SPECIES_GENESECT_SHOCK_DRIVE] = sGenesectFormChangeTable, [SPECIES_GENESECT_BURN_DRIVE] = sGenesectFormChangeTable, [SPECIES_GENESECT_CHILL_DRIVE] = sGenesectFormChangeTable, + [SPECIES_XERNEAS] = sXerneasFormChangeTable, + [SPECIES_XERNEAS_ACTIVE] = sXerneasFormChangeTable, [SPECIES_HOOPA] = sHoopaFormChangeTable, [SPECIES_HOOPA_UNBOUND] = sHoopaUnboundFormChangeTable, [SPECIES_ORICORIO] = sOricorioFormChangeTable, @@ -60,5 +62,9 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] = [SPECIES_SILVALLY_ROCK] = sSilvallyFormChangeTable, [SPECIES_SILVALLY_STEEL] = sSilvallyFormChangeTable, [SPECIES_SILVALLY_WATER] = sSilvallyFormChangeTable, + [SPECIES_ZACIAN] = sZacianFormChangeTable, + [SPECIES_ZACIAN_CROWNED_SWORD] = sZacianFormChangeTable, + [SPECIES_ZAMAZENTA] = sZamazentaFormChangeTable, + [SPECIES_ZAMAZENTA_CROWNED_SHIELD] = sZamazentaFormChangeTable, #endif }; diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index 15cb8cdecd..be76cc9956 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -33,6 +33,14 @@ FORM_ITEM_USE_TIME: param1 = item to use param2 = DAY if form change activates in the daytime NIGHT if form change activates at nighttime + +FORM_BATTLE_BEGIN: + Form change activates when the Pokémon is sent out at the beginning of a battle + param1 = item to hold, optional + +FORM_BATTLE_END: + Form change activates at the end of a battle + param1 = item to hold, optional */ // FORM_MOVE param2 Arguments @@ -185,5 +193,23 @@ static const struct FormChange sSilvallyFormChangeTable[] = { }; #endif +static const struct FormChange sXerneasFormChangeTable[] = { + {FORM_BATTLE_BEGIN, SPECIES_XERNEAS_ACTIVE, ITEM_NONE}, + {FORM_BATTLE_END, SPECIES_XERNEAS, ITEM_NONE}, + {FORM_CHANGE_END}, +}; + +static const struct FormChange sZacianFormChangeTable[] = { + {FORM_BATTLE_BEGIN, SPECIES_ZACIAN_CROWNED_SWORD, ITEM_RUSTED_SWORD}, + {FORM_BATTLE_END, SPECIES_ZACIAN, ITEM_RUSTED_SWORD}, + {FORM_CHANGE_END}, +}; + +static const struct FormChange sZamazentaFormChangeTable[] = { + {FORM_BATTLE_BEGIN, SPECIES_ZAMAZENTA_CROWNED_SHIELD, ITEM_RUSTED_SHIELD}, + {FORM_BATTLE_END, SPECIES_ZAMAZENTA, ITEM_RUSTED_SHIELD}, + {FORM_CHANGE_END}, +}; + #undef WHEN_LEARNED #undef WHEN_FORGOTTEN diff --git a/src/pokemon.c b/src/pokemon.c index 92bd923f08..06e75dbc3b 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8237,13 +8237,13 @@ u8 GetFormIdFromFormSpeciesId(u16 formSpeciesId) return targetFormId; } -u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg) +u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg) { return GetFormChangeTargetSpeciesBoxMon(&mon->box, method, arg); } // Returns SPECIES_NONE if no form change is possible -u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg) +u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg) { u32 i; u16 targetSpecies = SPECIES_NONE; @@ -8264,6 +8264,8 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg switch (method) { case FORM_ITEM_HOLD: + case FORM_BATTLE_BEGIN: + case FORM_BATTLE_END: if (heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) targetSpecies = formChanges[i].targetSpecies; break; From 61c95421eb75a391dfde3e0f6d408e6737ad9b8d Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:01:46 +0200 Subject: [PATCH 063/155] Update src/event_object_movement.c Co-authored-by: LOuroboros --- src/event_object_movement.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index c5663461ac..2c80e79489 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4633,7 +4633,7 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) #if TX_DEBUG_SYSTEM == TRUE if (FlagGet(FLAG_SYS_NO_COLLISION)) return COLLISION_NONE; - #endif // + #endif if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y)) return COLLISION_OUTSIDE_RANGE; From cc921c62d77182c78ca2117598a7ddb52288f0b7 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:01:59 +0200 Subject: [PATCH 064/155] Update src/field_control_avatar.c Co-authored-by: LOuroboros --- src/field_control_avatar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 121a10670b..9dda48d668 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -134,7 +134,7 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) #if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE if (heldKeys & R_BUTTON) { - if(input->pressedSelectButton) + if (input->pressedSelectButton) { input->input_field_1_0 = TRUE; input->pressedSelectButton = FALSE; From 79c4fa560fb3d7ab59060f9bec638bc9238a5ad9 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:03:07 +0200 Subject: [PATCH 065/155] Update src/start_menu.c Co-authored-by: LOuroboros --- src/start_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/start_menu.c b/src/start_menu.c index f4c0112b27..ce9b726a3e 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -174,7 +174,7 @@ static const struct MenuAction sStartMenuItems[] = [MENU_ACTION_REST_FRONTIER] = {gText_MenuRest, {.u8_void = StartMenuSaveCallback}}, [MENU_ACTION_RETIRE_FRONTIER] = {gText_MenuRetire, {.u8_void = StartMenuBattlePyramidRetireCallback}}, [MENU_ACTION_PYRAMID_BAG] = {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}}, - [MENU_ACTION_DEBUG] = {gText_MenuDebug, {.u8_void = StartMenuDebugCallback}}, + [MENU_ACTION_DEBUG] = {gText_MenuDebug, {.u8_void = StartMenuDebugCallback}}, }; static const struct BgTemplate sBgTemplates_LinkBattleSave[] = From 155465a919b644105db742503eb491ae12ea666a Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:03:28 +0200 Subject: [PATCH 066/155] Update src/pokemon_storage_system.c Co-authored-by: LOuroboros --- src/pokemon_storage_system.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index e064be64d3..df822f2458 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1669,12 +1669,15 @@ static void FieldTask_ReturnToPcMenu(void) MainCallback vblankCb = gMain.vblankCallback; SetVBlankCallback(NULL); - if (!FlagGet(FLAG_SYS_PC_FROM_DEBUG_MENU)) { + if (!FlagGet(FLAG_SYS_PC_FROM_DEBUG_MENU)) + { taskId = CreateTask(Task_PCMainMenu, 80); gTasks[taskId].tState = 0; gTasks[taskId].tSelectedOption = sPreviousBoxOption; Task_PCMainMenu(taskId); - } else { + } + else + { FlagClear(FLAG_SYS_PC_FROM_DEBUG_MENU); ScriptContext_Enable(); } From 725a9102ee257700510c756011fdbf38e8c56a4e Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:03:44 +0200 Subject: [PATCH 067/155] Update src/new_game.c Co-authored-by: LOuroboros --- src/new_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/new_game.c b/src/new_game.c index 0280e4c93d..8f8aa9b82b 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -90,7 +90,7 @@ static void InitPlayerTrainerId(void) // L=A isnt set here for some reason. static void SetDefaultOptions(void) { - gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_FAST; + gSaveBlock2Ptr->optionsTextSpeed = OPTIONS_TEXT_SPEED_MID; gSaveBlock2Ptr->optionsWindowFrameType = 0; gSaveBlock2Ptr->optionsSound = OPTIONS_SOUND_MONO; gSaveBlock2Ptr->optionsBattleStyle = OPTIONS_BATTLE_STYLE_SHIFT; From 2f61407c7886fbdb0893335100e0df857e718531 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:04:02 +0200 Subject: [PATCH 068/155] Update src/field_control_avatar.c Co-authored-by: LOuroboros --- src/field_control_avatar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 9dda48d668..137fe8980d 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -725,7 +725,7 @@ static bool8 CheckStandardWildEncounter(u16 metatileBehavior) } sPreviousPlayerMetatileBehavior = metatileBehavior; - return FALSE; + return FALSE; } static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8 direction) From 5fed45e40b3646da5b066d4e2bba07254d3e5d6f Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:04:14 +0200 Subject: [PATCH 069/155] Update src/item_use.c Co-authored-by: LOuroboros --- src/item_use.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/item_use.c b/src/item_use.c index 537e787893..63599d1e21 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -983,7 +983,8 @@ static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a b void ItemUseInBattle_PokeBall(u8 taskId) { #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_CATCHING)){ + if (FlagGet(FLAG_SYS_NO_CATCHING)) + { static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p"); DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage); return; From d9bd2724525bb2deabd4d7750017a73a6f50e03e Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:08:35 +0200 Subject: [PATCH 070/155] removed the entries ld_script as per pret#1738, added newline to debug.h --- include/debug.h | 2 +- ld_script.txt | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/debug.h b/include/debug.h index 9aec5c2629..bfc072ee3b 100644 --- a/include/debug.h +++ b/include/debug.h @@ -8,4 +8,4 @@ void Debug_ShowMainMenu(void); -#endif // GUARD_DEBUG_H \ No newline at end of file +#endif // GUARD_DEBUG_H diff --git a/ld_script.txt b/ld_script.txt index 10de31a99d..da0eb682d3 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -105,7 +105,6 @@ SECTIONS { src/random.o(.text); src/util.o(.text); src/daycare.o(.text); - src/debug.o(.text); src/egg_hatch.o(.text); src/battle_interface.o(.text); src/battle_anim_smokescreen.o(.text); @@ -496,7 +495,6 @@ SECTIONS { src/trig.o(.rodata); src/util.o(.rodata); src/daycare.o(.rodata); - src/debug.o(.rodata); src/egg_hatch.o(.rodata); src/battle_gfx_sfx_util.o(.rodata); src/battle_interface.o(.rodata); From e09ba650f375b69d28b971b145d81cdb9721e62e Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:12:23 +0200 Subject: [PATCH 071/155] imrpoved code formatting in field_control_avatar as per suggestion --- src/field_control_avatar.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 137fe8980d..6f5460f589 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -138,7 +138,8 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) { input->input_field_1_0 = TRUE; input->pressedSelectButton = FALSE; - }else if(input->pressedStartButton) + } + else if (input->pressedStartButton) { input->input_field_1_2 = TRUE; input->pressedStartButton = FALSE; @@ -146,16 +147,17 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) } if (heldKeys & L_BUTTON) { - if(input->pressedSelectButton) + if (input->pressedSelectButton) { input->input_field_1_1 = TRUE; input->pressedSelectButton = FALSE; - }else if(input->pressedStartButton) + } + else if (input->pressedStartButton) { input->input_field_1_3 = TRUE; input->pressedStartButton = FALSE; } - } + } #endif } From 04c40677bd54f2fd2421401f1684c51ebabb9cad Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 17:41:35 +0200 Subject: [PATCH 072/155] Changed the way debug flags are handled, now in constants/battle_config.h --- include/constants/battle_config.h | 8 ++++++++ include/constants/flags.h | 14 +++++++------- src/battle_main.c | 2 +- src/debug.c | 32 +++++++++++++++---------------- src/event_object_movement.c | 2 +- src/field_control_avatar.c | 2 +- src/item_use.c | 2 +- src/pokemon_storage_system.c | 4 ++-- src/trainer_see.c | 2 +- 9 files changed, 38 insertions(+), 30 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 89134daf91..0b610211c5 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -194,6 +194,14 @@ #define B_NEW_IMPACT_PALETTE FALSE // If set to TRUE, it updates the basic 'hit' palette. #define B_NEW_SURF_PARTICLE_PALETTE FALSE // If set to TRUE, it updates Surf's wave palette. +// Debugging, Replace the used flags with others or disable with a 0 #define B_ENABLE_DEBUG TRUE // If set to TRUE, enables a debug menu to use in battles by pressing the Select button. +#define TX_DEBUG_FLAG_NO_COLLISION FLAG_UNUSED_0x020 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used. +#define TX_DEBUG_FLAG_NO_ENCOUNTER FLAG_UNUSED_0x021 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used. +#define TX_DEBUG_FLAG_NO_TRAINER_SEE FLAG_UNUSED_0x022 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used. +#define TX_DEBUG_FLAG_NO_BAG_USE FLAG_UNUSED_0x023 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used. +#define TX_DEBUG_FLAG_NO_CATCHING FLAG_UNUSED_0x024 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used. +#define TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU FLAG_UNUSED_0x025 // If this flag is set, the debug function in debug menu to access the player PC works. + #endif // GUARD_CONSTANTS_BATTLE_CONFIG_H diff --git a/include/constants/flags.h b/include/constants/flags.h index 9b101c77e4..ac8de43dc4 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -40,13 +40,13 @@ #define FLAG_TEMP_1E (TEMP_FLAGS_START + 0x1E) #define FLAG_TEMP_1F (TEMP_FLAGS_START + 0x1F) #define TEMP_FLAGS_END FLAG_TEMP_1F - -#define FLAG_SYS_NO_COLLISION 0x20 // Unused Flag //DEBUG -#define FLAG_SYS_NO_ENCOUNTER 0x21 // Unused Flag //DEBUG -#define FLAG_SYS_NO_TRAINER_SEE 0x22 // Unused Flag //DEBUG -#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_UNUSED_0x020 0x20 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x021 0x21 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x022 0x22 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x023 0x23 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x024 0x24 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x025 0x25 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" #define FLAG_UNUSED_0x026 0x26 // Unused Flag #define FLAG_UNUSED_0x027 0x27 // Unused Flag #define FLAG_UNUSED_0x028 0x28 // Unused Flag diff --git a/src/battle_main.c b/src/battle_main.c index 029578ceb7..20ebc05c61 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4002,7 +4002,7 @@ static void HandleTurnActionSelectionState(void) break; case B_ACTION_USE_ITEM: #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_BAG_USE)) + if (FlagGet(TX_DEBUG_FLAG_NO_BAG_USE)) { RecordedBattle_ClearBattlerAction(gActiveBattler, 1); gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed; diff --git a/src/debug.c b/src/debug.c index b27142abea..283361b389 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1447,56 +1447,56 @@ static void DebugAction_Flags_ToggleFrontierPass(u8 taskId) } static void DebugAction_Flags_CollisionOnOff(u8 taskId) { - if(FlagGet(FLAG_SYS_NO_COLLISION)) + if(FlagGet(TX_DEBUG_FLAG_NO_COLLISION)) { - FlagClear(FLAG_SYS_NO_COLLISION); + FlagClear(TX_DEBUG_FLAG_NO_COLLISION); PlaySE(SE_PC_OFF); }else{ - FlagSet(FLAG_SYS_NO_COLLISION); + FlagSet(TX_DEBUG_FLAG_NO_COLLISION); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_EncounterOnOff(u8 taskId) { - if(FlagGet(FLAG_SYS_NO_ENCOUNTER)) + if(FlagGet(TX_DEBUG_FLAG_NO_ENCOUNTER)) { - FlagClear(FLAG_SYS_NO_ENCOUNTER); + FlagClear(TX_DEBUG_FLAG_NO_ENCOUNTER); PlaySE(SE_PC_OFF); }else{ - FlagSet(FLAG_SYS_NO_ENCOUNTER); + FlagSet(TX_DEBUG_FLAG_NO_ENCOUNTER); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) { - if(FlagGet(FLAG_SYS_NO_TRAINER_SEE)) + if(FlagGet(TX_DEBUG_FLAG_NO_TRAINER_SEE)) { - FlagClear(FLAG_SYS_NO_TRAINER_SEE); + FlagClear(TX_DEBUG_FLAG_NO_TRAINER_SEE); PlaySE(SE_PC_OFF); }else{ - FlagSet(FLAG_SYS_NO_TRAINER_SEE); + FlagSet(TX_DEBUG_FLAG_NO_TRAINER_SEE); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_BagUseOnOff(u8 taskId) { - if(FlagGet(FLAG_SYS_NO_BAG_USE)) + if(FlagGet(TX_DEBUG_FLAG_NO_BAG_USE)) { - FlagClear(FLAG_SYS_NO_BAG_USE); + FlagClear(TX_DEBUG_FLAG_NO_BAG_USE); PlaySE(SE_PC_OFF); }else{ - FlagSet(FLAG_SYS_NO_BAG_USE); + FlagSet(TX_DEBUG_FLAG_NO_BAG_USE); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_CatchingOnOff(u8 taskId) { - if(FlagGet(FLAG_SYS_NO_CATCHING)) + if(FlagGet(TX_DEBUG_FLAG_NO_CATCHING)) { - FlagClear(FLAG_SYS_NO_CATCHING); + FlagClear(TX_DEBUG_FLAG_NO_CATCHING); PlaySE(SE_PC_OFF); }else{ - FlagSet(FLAG_SYS_NO_CATCHING); + FlagSet(TX_DEBUG_FLAG_NO_CATCHING); PlaySE(SE_PC_LOGIN); } } @@ -2723,7 +2723,7 @@ static void Task_WaitFadeAccessPC(u8 taskId) if (!gPaletteFade.active) { DestroyTask(taskId); - FlagSet(FLAG_SYS_PC_FROM_DEBUG_MENU); + FlagSet(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU); EnterPokeStorage(2); } } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 2c80e79489..fbcb6ed795 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4631,7 +4631,7 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) u8 direction = dir; #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_COLLISION)) + if (FlagGet(TX_DEBUG_FLAG_NO_COLLISION)) return COLLISION_NONE; #endif diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 6f5460f589..5f8712980f 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -708,7 +708,7 @@ void RestartWildEncounterImmunitySteps(void) static bool8 CheckStandardWildEncounter(u16 metatileBehavior) { #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_ENCOUNTER)) + if (FlagGet(TX_DEBUG_FLAG_NO_ENCOUNTER)) return FALSE; #endif diff --git a/src/item_use.c b/src/item_use.c index 63599d1e21..5cca3aee3f 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -983,7 +983,7 @@ static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a b void ItemUseInBattle_PokeBall(u8 taskId) { #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_CATCHING)) + if (FlagGet(TX_DEBUG_FLAG_NO_CATCHING)) { static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p"); DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage); diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index df822f2458..437458d75b 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1669,7 +1669,7 @@ static void FieldTask_ReturnToPcMenu(void) MainCallback vblankCb = gMain.vblankCallback; SetVBlankCallback(NULL); - if (!FlagGet(FLAG_SYS_PC_FROM_DEBUG_MENU)) + if (!FlagGet(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU)) { taskId = CreateTask(Task_PCMainMenu, 80); gTasks[taskId].tState = 0; @@ -1678,7 +1678,7 @@ static void FieldTask_ReturnToPcMenu(void) } else { - FlagClear(FLAG_SYS_PC_FROM_DEBUG_MENU); + FlagClear(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU); ScriptContext_Enable(); } SetVBlankCallback(vblankCb); diff --git a/src/trainer_see.c b/src/trainer_see.c index 81b040a3b6..596b7456d8 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -194,7 +194,7 @@ bool8 CheckForTrainersWantingBattle(void) u8 i; #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(FLAG_SYS_NO_TRAINER_SEE)) + if (FlagGet(TX_DEBUG_FLAG_NO_TRAINER_SEE)) return FALSE; #endif From 3debf0442dc88b948899c73a3b98a0d76b1f45f7 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 18:02:23 +0200 Subject: [PATCH 073/155] changed the locations of tx_debug_system related #defines to its own file 'constants/debug_config.h' --- include/constants/battle_config.h | 8 -------- include/constants/debug_config.h | 15 +++++++++++++++ include/constants/global.h | 1 + include/debug.h | 5 +---- 4 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 include/constants/debug_config.h diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 0b610211c5..89134daf91 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -194,14 +194,6 @@ #define B_NEW_IMPACT_PALETTE FALSE // If set to TRUE, it updates the basic 'hit' palette. #define B_NEW_SURF_PARTICLE_PALETTE FALSE // If set to TRUE, it updates Surf's wave palette. -// Debugging, Replace the used flags with others or disable with a 0 #define B_ENABLE_DEBUG TRUE // If set to TRUE, enables a debug menu to use in battles by pressing the Select button. -#define TX_DEBUG_FLAG_NO_COLLISION FLAG_UNUSED_0x020 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used. -#define TX_DEBUG_FLAG_NO_ENCOUNTER FLAG_UNUSED_0x021 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used. -#define TX_DEBUG_FLAG_NO_TRAINER_SEE FLAG_UNUSED_0x022 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used. -#define TX_DEBUG_FLAG_NO_BAG_USE FLAG_UNUSED_0x023 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used. -#define TX_DEBUG_FLAG_NO_CATCHING FLAG_UNUSED_0x024 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used. -#define TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU FLAG_UNUSED_0x025 // If this flag is set, the debug function in debug menu to access the player PC works. - #endif // GUARD_CONSTANTS_BATTLE_CONFIG_H diff --git a/include/constants/debug_config.h b/include/constants/debug_config.h new file mode 100644 index 0000000000..847288d64e --- /dev/null +++ b/include/constants/debug_config.h @@ -0,0 +1,15 @@ +#ifndef GUARD_CONSTANTS_DEBUG_CONFIG_H +#define GUARD_CONSTANTS_DEBUG_CONFIG_H + +#define TX_DEBUG_SYSTEM TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by pressing R plus START. +#define TX_DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (replaces the exit entry). + +// Replace the used flags with others or disable with a 0 +#define TX_DEBUG_FLAG_NO_COLLISION FLAG_UNUSED_0x020 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used. +#define TX_DEBUG_FLAG_NO_ENCOUNTER FLAG_UNUSED_0x021 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used. +#define TX_DEBUG_FLAG_NO_TRAINER_SEE FLAG_UNUSED_0x022 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used. +#define TX_DEBUG_FLAG_NO_BAG_USE FLAG_UNUSED_0x023 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used. +#define TX_DEBUG_FLAG_NO_CATCHING FLAG_UNUSED_0x024 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used. +#define TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU FLAG_UNUSED_0x025 // If this flag is set, the debug function in debug menu to access the player PC works. + +#endif // GUARD_CONSTANTS_DEBUG_CONFIG_H diff --git a/include/constants/global.h b/include/constants/global.h index 2a773dbb95..b80bcd402a 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -2,6 +2,7 @@ #define GUARD_CONSTANTS_GLOBAL_H #include "constants/battle_config.h" +#include "constants/debug_config.h" // Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. // In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen. diff --git a/include/debug.h b/include/debug.h index bfc072ee3b..c5bdc224cc 100644 --- a/include/debug.h +++ b/include/debug.h @@ -1,11 +1,8 @@ #ifndef GUARD_DEBUG_H #define GUARD_DEBUG_H -#define TX_DEBUG_SYSTEM TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by pressing R plus START. -#define TX_DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (replaces the exit entry). - +#include "constants/debug_config.h" void Debug_ShowMainMenu(void); - #endif // GUARD_DEBUG_H From c13561e5ba4db120578cce0e726b7605f8f3f505 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 30 Aug 2022 18:15:06 +0200 Subject: [PATCH 074/155] simplified filed controls code for debug menu --- src/field_control_avatar.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 5f8712980f..e2bc06e98a 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -132,31 +132,10 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) input->dpadDirection = DIR_EAST; #if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE - if (heldKeys & R_BUTTON) + if ((heldKeys & R_BUTTON) && input->pressedStartButton) { - if (input->pressedSelectButton) - { - input->input_field_1_0 = TRUE; - input->pressedSelectButton = FALSE; - } - else if (input->pressedStartButton) - { - input->input_field_1_2 = TRUE; - input->pressedStartButton = FALSE; - } - } - if (heldKeys & L_BUTTON) - { - if (input->pressedSelectButton) - { - input->input_field_1_1 = TRUE; - input->pressedSelectButton = FALSE; - } - else if (input->pressedStartButton) - { - input->input_field_1_3 = TRUE; - input->pressedStartButton = FALSE; - } + input->input_field_1_2 = TRUE; + input->pressedStartButton = FALSE; } #endif } From 494e8791d742f72273f65bf7edef9b240f05d38e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 30 Aug 2022 21:18:54 -0400 Subject: [PATCH 075/155] Fixed tutors changing levels --- src/party_menu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/party_menu.c b/src/party_menu.c index 00224f6bd6..4d7f24883a 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5040,7 +5040,8 @@ static void CB2_ShowSummaryScreenToForgetMove(void) static void CB2_ReturnToPartyMenuWhileLearningMove(void) { - SetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_LEVEL, &sFinalLevel); // to avoid displaying incorrect level + if (sFinalLevel != 0) + SetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_LEVEL, &sFinalLevel); // to avoid displaying incorrect level InitPartyMenu(PARTY_MENU_TYPE_FIELD, PARTY_LAYOUT_SINGLE, PARTY_ACTION_CHOOSE_MON, TRUE, PARTY_MSG_NONE, Task_ReturnToPartyMenuWhileLearningMove, gPartyMenu.exitCallback); } @@ -5313,6 +5314,10 @@ static void PartyMenuTryEvolution(u8 taskId) struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId]; u16 targetSpecies = GetEvolutionTargetSpecies(mon, EVO_MODE_NORMAL, ITEM_NONE, NULL); + // Resets values to 0 so other means of teaching moves doesn't overwrite levels + sInitialLevel = 0; + sFinalLevel = 0; + if (targetSpecies != SPECIES_NONE) { FreePartyPointers(); From 29448b6acca364feb4476e9d72270bb6bf98ffbe Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 30 Aug 2022 22:05:47 -0400 Subject: [PATCH 076/155] Fixed XL Candy going out of bounds. Also added failsafe in case an invalid param is used. --- src/pokemon.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 350aebf0b8..8b3938aa51 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5714,20 +5714,26 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov && GetMonData(mon, MON_DATA_LEVEL, NULL) != MAX_LEVEL) { u8 param = ItemId_GetHoldEffectParam(item); + dataUnsigned = 0; + if (param == 0) // Rare Candy { dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1]; } - else if (param < ARRAY_COUNT(sExpCandyExperienceTable)) // EXP Candies + else if (param - 1 < ARRAY_COUNT(sExpCandyExperienceTable)) // EXP Candies { u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); dataUnsigned = sExpCandyExperienceTable[param - 1] + GetMonData(mon, MON_DATA_EXP, NULL); if (dataUnsigned > gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]) dataUnsigned = gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]; } - SetMonData(mon, MON_DATA_EXP, &dataUnsigned); - CalculateMonStats(mon); - retVal = FALSE; + + if (dataUnsigned != 0) // Failsafe + { + SetMonData(mon, MON_DATA_EXP, &dataUnsigned); + CalculateMonStats(mon); + retVal = FALSE; + } } // Cure status From fe5f30c2005bd668febfd1568c511eddbf0527e8 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 30 Aug 2022 22:50:20 -0400 Subject: [PATCH 077/155] Fixed moves learned at the same level being skipped while using exp candies --- src/party_menu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/party_menu.c b/src/party_menu.c index 4d7f24883a..73937b966c 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5292,11 +5292,14 @@ static void Task_TryLearningNextMove(u8 taskId) switch (result) { case 0: // No moves to learn + if (sInitialLevel >= sFinalLevel) + PartyMenuTryEvolution(taskId); break; case MON_HAS_MAX_MOVES: DisplayMonNeedsToReplaceMove(taskId); break; case MON_ALREADY_KNOWS_MOVE: + gTasks[taskId].func = Task_TryLearningNextMove; return; default: DisplayMonLearnedMove(taskId, result); @@ -5305,8 +5308,6 @@ static void Task_TryLearningNextMove(u8 taskId) if (result) break; } - if (sInitialLevel >= sFinalLevel) - PartyMenuTryEvolution(taskId); } static void PartyMenuTryEvolution(u8 taskId) From 3264c3c87a3dc68d1aac4c549ba12b729a25303e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 31 Aug 2022 09:05:51 -0400 Subject: [PATCH 078/155] Shows amount of Exp gained. --- include/pokemon.h | 1 + src/party_menu.c | 1 + src/pokemon.c | 2 +- src/strings.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index 94fdff91d2..34065c6cc5 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -406,6 +406,7 @@ extern const u16 gLinkPlayerFacilityClasses[]; extern const struct SpriteTemplate gBattlerSpriteTemplates[]; extern const s8 gNatureStatTable[][5]; extern const u16 *const gFormSpeciesIdTables[NUM_SPECIES]; +extern const u32 sExpCandyExperienceTable[]; void ZeroBoxMonData(struct BoxPokemon *boxMon); void ZeroMonData(struct Pokemon *mon); diff --git a/src/party_menu.c b/src/party_menu.c index 73937b966c..e94bfb9284 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5187,6 +5187,7 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) { PlaySE(SE_USE_ITEM); gPartyMenuUseExitCallback = FALSE; + ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[ItemId_GetHoldEffectParam(*itemPtr)], STR_CONV_MODE_LEFT_ALIGN, 3); StringExpandPlaceholders(gStringVar4, gText_PkmnGainedExp); DisplayPartyMenuMessage(gStringVar4, FALSE); ScheduleBgCopyTilemapToVram(2); diff --git a/src/pokemon.c b/src/pokemon.c index 8b3938aa51..bca560175d 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5507,7 +5507,7 @@ bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, } // EXP candies store an index for this table in their holdEffectParam. -static const u32 sExpCandyExperienceTable[] = { +const u32 sExpCandyExperienceTable[] = { [EXP_100 - 1] = 100, [EXP_800 - 1] = 800, [EXP_3000 - 1] = 3000, diff --git a/src/strings.c b/src/strings.c index d199b92d4b..52f1b6be71 100644 --- a/src/strings.c +++ b/src/strings.c @@ -417,7 +417,7 @@ const u8 gText_PkmnRegainhedHealth[] = _("{STR_VAR_1} regained health.{PAUSE_UNT const u8 gText_PkmnBecameHealthy[] = _("{STR_VAR_1} became healthy.{PAUSE_UNTIL_PRESS}"); const u8 gText_MovesPPIncreased[] = _("{STR_VAR_1}'s PP increased.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnElevatedToLvVar2[] = _("{STR_VAR_1} was elevated to\nLv. {STR_VAR_2}."); -const u8 gText_PkmnGainedExp[] = _("{STR_VAR_1} gained Exp. Points!{PAUSE_UNTIL_PRESS}"); +const u8 gText_PkmnGainedExp[] = _("{STR_VAR_1} gained {STR_VAR_2} Exp. Points!{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnBaseVar2StatIncreased[] = _("{STR_VAR_1}'s base {STR_VAR_2}\nstat was raised.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnFriendlyBaseVar2Fell[] = _("{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnAdoresBaseVar2Fell[] = _("{STR_VAR_1} adores you!\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}"); From 8d94c58cacd46657df3163426ec5b93d1fb72b25 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 31 Aug 2022 21:54:27 -0400 Subject: [PATCH 079/155] Shows exp when leveling up with Exp Candies --- include/strings.h | 1 + src/party_menu.c | 27 ++++++++++++++++++++++++--- src/strings.c | 1 + 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/include/strings.h b/include/strings.h index 25a96eef08..f8f5da4dae 100644 --- a/include/strings.h +++ b/include/strings.h @@ -500,6 +500,7 @@ extern const u8 gText_StopLearningMove2[]; extern const u8 gText_MoveNotLearned[]; extern const u8 gText_PkmnElevatedToLvVar2[]; extern const u8 gText_PkmnGainedExp[]; +extern const u8 gText_PkmnGainedExpAndElevatedToLvVar3[]; extern const u8 gText_RemoveMailBeforeItem[]; extern const u8 gText_PkmnHoldingItemCantHoldMail[]; extern const u8 gText_MailTransferredFromMailbox[]; diff --git a/src/party_menu.c b/src/party_menu.c index e94bfb9284..1d890c5f3a 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5140,6 +5140,16 @@ static void Task_TryLearningNextMoveAfterText(u8 taskId) Task_TryLearningNextMove(taskId); } +static void DisplayExpPoints(u8 taskId, TaskFunc task, u8 holdEffectParam) +{ + PlaySE(SE_USE_ITEM); + ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[holdEffectParam], STR_CONV_MODE_LEFT_ALIGN, 3); + StringExpandPlaceholders(gStringVar4, gText_PkmnGainedExp); + DisplayPartyMenuMessage(gStringVar4, FALSE); + ScheduleBgCopyTilemapToVram(2); + gTasks[taskId].func = task; +} + void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) { struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId]; @@ -5147,6 +5157,7 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) s16 *arrayPtr = ptr->data; u16 *itemPtr = &gSpecialVar_ItemId; bool8 cannotUseEffect; + u8 holdEffectParam = ItemId_GetHoldEffectParam(*itemPtr); sInitialLevel = GetMonData(mon, MON_DATA_LEVEL); if (sInitialLevel != MAX_LEVEL) @@ -5177,8 +5188,18 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) if (sFinalLevel > sInitialLevel) { PlayFanfareByFanfareNum(FANFARE_LEVEL_UP); - ConvertIntToDecimalStringN(gStringVar2, sFinalLevel, STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar4, gText_PkmnElevatedToLvVar2); + if (holdEffectParam == 0) // Rare Candy + { + ConvertIntToDecimalStringN(gStringVar2, sFinalLevel, STR_CONV_MODE_LEFT_ALIGN, 3); + StringExpandPlaceholders(gStringVar4, gText_PkmnElevatedToLvVar2); + } + else // Exp Candies + { + ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[holdEffectParam - 1], STR_CONV_MODE_LEFT_ALIGN, 6); + ConvertIntToDecimalStringN(gStringVar3, sFinalLevel, STR_CONV_MODE_LEFT_ALIGN, 3); + StringExpandPlaceholders(gStringVar4, gText_PkmnGainedExpAndElevatedToLvVar3); + } + DisplayPartyMenuMessage(gStringVar4, TRUE); ScheduleBgCopyTilemapToVram(2); gTasks[taskId].func = Task_DisplayLevelUpStatsPg1; @@ -5187,7 +5208,7 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) { PlaySE(SE_USE_ITEM); gPartyMenuUseExitCallback = FALSE; - ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[ItemId_GetHoldEffectParam(*itemPtr)], STR_CONV_MODE_LEFT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[holdEffectParam - 1], STR_CONV_MODE_LEFT_ALIGN, 6); StringExpandPlaceholders(gStringVar4, gText_PkmnGainedExp); DisplayPartyMenuMessage(gStringVar4, FALSE); ScheduleBgCopyTilemapToVram(2); diff --git a/src/strings.c b/src/strings.c index 52f1b6be71..fce4acdde1 100644 --- a/src/strings.c +++ b/src/strings.c @@ -418,6 +418,7 @@ const u8 gText_PkmnBecameHealthy[] = _("{STR_VAR_1} became healthy.{PAUSE_UNTIL_ const u8 gText_MovesPPIncreased[] = _("{STR_VAR_1}'s PP increased.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnElevatedToLvVar2[] = _("{STR_VAR_1} was elevated to\nLv. {STR_VAR_2}."); const u8 gText_PkmnGainedExp[] = _("{STR_VAR_1} gained {STR_VAR_2} Exp. Points!{PAUSE_UNTIL_PRESS}"); +const u8 gText_PkmnGainedExpAndElevatedToLvVar3[] = _("{STR_VAR_1} gained {STR_VAR_2} Exp. Points\nand was elevated to Lv. {STR_VAR_3}!"); const u8 gText_PkmnBaseVar2StatIncreased[] = _("{STR_VAR_1}'s base {STR_VAR_2}\nstat was raised.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnFriendlyBaseVar2Fell[] = _("{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnAdoresBaseVar2Fell[] = _("{STR_VAR_1} adores you!\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}"); From ad57551db16ae81f2feda9fd96367d821e159b40 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Fri, 2 Sep 2022 12:10:11 +0200 Subject: [PATCH 080/155] removed unnecessary script, cheat start now with national dex, reverted accidental type hin removal, changed indentation --- data/scripts/debug.inc | 24 +++--------------------- include/constants/map_groups.h | 2 -- include/main_menu.h | 2 +- src/battle_main.c | 4 ++-- src/event_object_movement.c | 4 ++-- src/field_control_avatar.c | 12 ++++++------ src/item_use.c | 4 ++-- src/start_menu.c | 26 +++++++------------------- src/trainer_see.c | 4 ++-- 9 files changed, 25 insertions(+), 57 deletions(-) diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index 4ced7d9716..e174343f22 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -5,11 +5,6 @@ Debug_ShowFieldMessageStringVar4:: releaseall end -Debug_CheckWeekDay_Text: - .string "Aaaaah, yes!\l" - .string "{STR_VAR_1}s are made for dads!\l" - .string "And dad's car!$" - Debug_CheatStart:: lockall setflag FLAG_SYS_POKEMON_GET @@ -27,8 +22,8 @@ Debug_CheatStart:: special SetUnlockedPokedexFlags setflag FLAG_RECEIVED_POKEDEX_FROM_BIRCH setvar VAR_CABLE_CLUB_TUTORIAL_STATE, 1 - @ setflag FLAG_SYS_NATIONAL_DEX - @ special EnableNationalPokedex + setflag FLAG_SYS_NATIONAL_DEX + special EnableNationalPokedex setflag FLAG_RECEIVED_RUNNING_SHOES setflag FLAG_SYS_B_DASH setvar VAR_LITTLEROOT_TOWN_STATE, 4 @ 4: Received Running Shoes @@ -37,25 +32,12 @@ Debug_CheatStart:: setvar VAR_LITTLEROOT_HOUSES_STATE_MAY, 2 @ 2: Met Rival's Mom (and is corresponding gender) setvar VAR_LITTLEROOT_RIVAL_STATE, 4 @ 4: Received Pokedex setflag FLAG_RECEIVED_BIKE - giveitem ITEM_ACRO_BIKE + additem ITEM_ACRO_BIKE setvar VAR_BRINEY_HOUSE_STATE, 1 setvar VAR_ROUTE116_STATE, 2 setflag FLAG_HIDE_ROUTE_116_MR_BRINEY clearflag FLAG_HIDE_BRINEYS_HOUSE_MR_BRINEY clearflag FLAG_HIDE_BRINEYS_HOUSE_PEEKO - @ additem ITEM_MAX_REPEL, 10 - @ giveitem ITEM_EON_TICKET - @ setflag FLAG_SYS_HAS_EON_TICKET - @ setvar VAR_DISTRIBUTE_EON_TICKET, 0 - @ giveitem ITEM_MYSTIC_TICKET - @ setflag FLAG_ENABLE_SHIP_NAVEL_ROCK - @ setflag FLAG_RECEIVED_MYSTIC_TICKET - @ giveitem ITEM_AURORA_TICKET - @ setflag FLAG_ENABLE_SHIP_BIRTH_ISLAND - @ setflag FLAG_RECEIVED_AURORA_TICKET - @ setflag FLAG_BADGE06_GET @ Badge for flying filed move - @ setweather WEATHER_VOLCANIC_ASH - @ doweather closemessage release end diff --git a/include/constants/map_groups.h b/include/constants/map_groups.h index 2e6c781943..eaf40a525d 100755 --- a/include/constants/map_groups.h +++ b/include/constants/map_groups.h @@ -593,6 +593,4 @@ #define MAP_GROUPS_COUNT 34 -// static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; - #endif // GUARD_CONSTANTS_MAP_GROUPS_H diff --git a/include/main_menu.h b/include/main_menu.h index 790c9d10ec..81e2d9794b 100644 --- a/include/main_menu.h +++ b/include/main_menu.h @@ -2,7 +2,7 @@ #define GUARD_MAIN_MENU_H void CB2_InitMainMenu(void); -void CreateYesNoMenuParameterized(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f); +void CreateYesNoMenuParameterized(u8 x, u8 y, u16 baseTileNum, u16 baseBlock, u8 yesNoPalNum, u8 winPalNum); void NewGameBirchSpeech_SetDefaultPlayerName(u8); #endif // GUARD_MAIN_MENU_H diff --git a/src/battle_main.c b/src/battle_main.c index 20ebc05c61..052b61163c 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4001,7 +4001,7 @@ static void HandleTurnActionSelectionState(void) } break; case B_ACTION_USE_ITEM: - #if TX_DEBUG_SYSTEM == TRUE + #if TX_DEBUG_SYSTEM == TRUE if (FlagGet(TX_DEBUG_FLAG_NO_BAG_USE)) { RecordedBattle_ClearBattlerAction(gActiveBattler, 1); @@ -4011,7 +4011,7 @@ static void HandleTurnActionSelectionState(void) *(gBattleStruct->stateIdAfterSelScript + gActiveBattler) = STATE_BEFORE_ACTION_CHOSEN; return; } - #endif + #endif if ((gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER_NO_PYRAMID diff --git a/src/event_object_movement.c b/src/event_object_movement.c index fbcb6ed795..9765febbf4 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4630,10 +4630,10 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) { u8 direction = dir; - #if TX_DEBUG_SYSTEM == TRUE +#if TX_DEBUG_SYSTEM == TRUE if (FlagGet(TX_DEBUG_FLAG_NO_COLLISION)) return COLLISION_NONE; - #endif +#endif if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y)) return COLLISION_OUTSIDE_RANGE; diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index e2bc06e98a..2b86bf2cf7 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -131,13 +131,13 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) else if (heldKeys & DPAD_RIGHT) input->dpadDirection = DIR_EAST; - #if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE +#if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE if ((heldKeys & R_BUTTON) && input->pressedStartButton) { input->input_field_1_2 = TRUE; input->pressedStartButton = FALSE; } - #endif +#endif } int ProcessPlayerFieldInput(struct FieldInput *input) @@ -197,14 +197,14 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE) return TRUE; - #if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE +#if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE if (input->input_field_1_2) { PlaySE(SE_WIN_OPEN); Debug_ShowMainMenu(); return TRUE; } - #endif +#endif return FALSE; } @@ -686,10 +686,10 @@ void RestartWildEncounterImmunitySteps(void) static bool8 CheckStandardWildEncounter(u16 metatileBehavior) { - #if TX_DEBUG_SYSTEM == TRUE +#if TX_DEBUG_SYSTEM == TRUE if (FlagGet(TX_DEBUG_FLAG_NO_ENCOUNTER)) return FALSE; - #endif +#endif if (sWildEncounterImmunitySteps < 4) { diff --git a/src/item_use.c b/src/item_use.c index 5cca3aee3f..ea2bea0fe7 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -982,14 +982,14 @@ static const u8 sText_CantThrowPokeBall_TwoMons[] = _("Cannot throw a ball!\nThe static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a ball!\nThere's no Pokémon in sight!\p"); void ItemUseInBattle_PokeBall(u8 taskId) { - #if TX_DEBUG_SYSTEM == TRUE +#if TX_DEBUG_SYSTEM == TRUE if (FlagGet(TX_DEBUG_FLAG_NO_CATCHING)) { static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p"); DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage); return; } - #endif +#endif switch (GetBallThrowableState()) { diff --git a/src/start_menu.c b/src/start_menu.c index ce9b726a3e..9f84df16ad 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -174,7 +174,7 @@ static const struct MenuAction sStartMenuItems[] = [MENU_ACTION_REST_FRONTIER] = {gText_MenuRest, {.u8_void = StartMenuSaveCallback}}, [MENU_ACTION_RETIRE_FRONTIER] = {gText_MenuRetire, {.u8_void = StartMenuBattlePyramidRetireCallback}}, [MENU_ACTION_PYRAMID_BAG] = {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}}, - [MENU_ACTION_DEBUG] = {gText_MenuDebug, {.u8_void = StartMenuDebugCallback}}, + [MENU_ACTION_DEBUG] = {gText_MenuDebug, {.u8_void = StartMenuDebugCallback}}, }; static const struct BgTemplate sBgTemplates_LinkBattleSave[] = @@ -284,17 +284,14 @@ static void BuildStartMenuActions(void) { BuildMultiPartnerRoomStartMenu(); } + else + { #if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == TRUE - else - { BuildDebugStartMenu(); - } #else - else - { BuildNormalStartMenu(); - } #endif + } } static void AddStartMenuAction(u8 action) @@ -328,26 +325,17 @@ static void BuildNormalStartMenu(void) static void BuildDebugStartMenu(void) { + AddStartMenuAction(MENU_ACTION_DEBUG); if (FlagGet(FLAG_SYS_POKEDEX_GET) == TRUE) - { AddStartMenuAction(MENU_ACTION_POKEDEX); - } if (FlagGet(FLAG_SYS_POKEMON_GET) == TRUE) - { AddStartMenuAction(MENU_ACTION_POKEMON); - } - AddStartMenuAction(MENU_ACTION_BAG); - if (FlagGet(FLAG_SYS_POKENAV_GET) == TRUE) - { AddStartMenuAction(MENU_ACTION_POKENAV); - } - AddStartMenuAction(MENU_ACTION_PLAYER); AddStartMenuAction(MENU_ACTION_SAVE); AddStartMenuAction(MENU_ACTION_OPTION); - AddStartMenuAction(MENU_ACTION_DEBUG); } static void BuildSafariZoneStartMenu(void) @@ -772,11 +760,11 @@ static bool8 StartMenuDebugCallback(void) RemoveExtraStartMenuWindows(); HideStartMenuDebug(); // Hide start menu without enabling movement - #if TX_DEBUG_SYSTEM == TRUE +#if TX_DEBUG_SYSTEM == TRUE Debug_ShowMainMenu(); #endif - return TRUE; +return TRUE; } static bool8 StartMenuSafariZoneRetireCallback(void) diff --git a/src/trainer_see.c b/src/trainer_see.c index 596b7456d8..73b4395d40 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -193,10 +193,10 @@ bool8 CheckForTrainersWantingBattle(void) { u8 i; - #if TX_DEBUG_SYSTEM == TRUE +#if TX_DEBUG_SYSTEM == TRUE if (FlagGet(TX_DEBUG_FLAG_NO_TRAINER_SEE)) return FALSE; - #endif +#endif gNoOfApproachingTrainers = 0; gApproachingTrainerId = 0; From 367b12801e32e5a8b1dbc258030b98643e755cbf Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Fri, 2 Sep 2022 12:33:42 +0200 Subject: [PATCH 081/155] changed debug_config.h to overworld_config.h, changed no bag use and no catching flags to battle_config.h, removed TX reference (big sad) --- include/constants/battle_config.h | 2 ++ include/constants/debug_config.h | 15 ------------ include/constants/global.h | 2 +- include/constants/overworld_config.h | 14 ++++++++++++ include/debug.h | 2 +- src/battle_main.c | 4 +--- src/debug.c | 34 ++++++++++++++-------------- src/event_object_movement.c | 4 ++-- src/field_control_avatar.c | 8 +++---- src/item_use.c | 4 +--- src/pokemon_storage_system.c | 4 ++-- src/start_menu.c | 4 ++-- src/trainer_see.c | 4 ++-- 13 files changed, 49 insertions(+), 52 deletions(-) delete mode 100644 include/constants/debug_config.h create mode 100644 include/constants/overworld_config.h diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 89134daf91..a5db36e19b 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -138,6 +138,8 @@ #define B_FLAG_INVERSE_BATTLE 0 // If this flag is set, the battle's type effectiveness are inversed. For example, fire is super effective against water. #define B_FLAG_FORCE_DOUBLE_WILD 0 // If this flag is set, all land and surfing wild battles will be double battles. #define B_SMART_WILD_AI_FLAG 0 // If not 0, you can set this flag in a script to enable smart wild pokemon +#define B_FLAG_NO_BAG_USE FLAG_UNUSED_0x023 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used. +#define B_FLAG_NO_CATCHING FLAG_UNUSED_0x024 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used. // Var Settings // To use the following features in scripting, replace the 0s with the var ID you're assigning it to. diff --git a/include/constants/debug_config.h b/include/constants/debug_config.h deleted file mode 100644 index 847288d64e..0000000000 --- a/include/constants/debug_config.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef GUARD_CONSTANTS_DEBUG_CONFIG_H -#define GUARD_CONSTANTS_DEBUG_CONFIG_H - -#define TX_DEBUG_SYSTEM TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by pressing R plus START. -#define TX_DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (replaces the exit entry). - -// Replace the used flags with others or disable with a 0 -#define TX_DEBUG_FLAG_NO_COLLISION FLAG_UNUSED_0x020 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used. -#define TX_DEBUG_FLAG_NO_ENCOUNTER FLAG_UNUSED_0x021 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used. -#define TX_DEBUG_FLAG_NO_TRAINER_SEE FLAG_UNUSED_0x022 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used. -#define TX_DEBUG_FLAG_NO_BAG_USE FLAG_UNUSED_0x023 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used. -#define TX_DEBUG_FLAG_NO_CATCHING FLAG_UNUSED_0x024 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used. -#define TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU FLAG_UNUSED_0x025 // If this flag is set, the debug function in debug menu to access the player PC works. - -#endif // GUARD_CONSTANTS_DEBUG_CONFIG_H diff --git a/include/constants/global.h b/include/constants/global.h index b80bcd402a..07ed190208 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -2,7 +2,7 @@ #define GUARD_CONSTANTS_GLOBAL_H #include "constants/battle_config.h" -#include "constants/debug_config.h" +#include "constants/overworld_config.h" // Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. // In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen. diff --git a/include/constants/overworld_config.h b/include/constants/overworld_config.h new file mode 100644 index 0000000000..3e57066f5f --- /dev/null +++ b/include/constants/overworld_config.h @@ -0,0 +1,14 @@ +#ifndef GUARD_CONSTANTS_OVERWORLD_CONFIG_H +#define GUARD_CONSTANTS_OVERWORLD_CONFIG_H + +// Debug options +#define DEBUG_SYSTEM_ENABLE TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by pressing R plus START. +#define DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (replaces the exit entry). + +// Replace the used flags with others or disable with a 0 +#define DEBUG_FLAG_NO_COLLISION FLAG_UNUSED_0x020 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used. +#define DEBUG_FLAG_NO_ENCOUNTER FLAG_UNUSED_0x021 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used. +#define DEBUG_FLAG_NO_TRAINER_SEE FLAG_UNUSED_0x022 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used. +#define DEBUG_FLAG_PC_FROM_DEBUG_MENU FLAG_UNUSED_0x025 // If this flag is set, the debug function in debug menu to access the player PC works. + +#endif // GUARD_CONSTANTS_OVERWORLD_CONFIG_H diff --git a/include/debug.h b/include/debug.h index c5bdc224cc..f56efbde34 100644 --- a/include/debug.h +++ b/include/debug.h @@ -1,7 +1,7 @@ #ifndef GUARD_DEBUG_H #define GUARD_DEBUG_H -#include "constants/debug_config.h" +#include "constants/overworld_config.h" void Debug_ShowMainMenu(void); diff --git a/src/battle_main.c b/src/battle_main.c index 052b61163c..39deaca27f 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4001,8 +4001,7 @@ static void HandleTurnActionSelectionState(void) } break; case B_ACTION_USE_ITEM: - #if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(TX_DEBUG_FLAG_NO_BAG_USE)) + if (FlagGet(B_FLAG_NO_BAG_USE)) { RecordedBattle_ClearBattlerAction(gActiveBattler, 1); gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed; @@ -4011,7 +4010,6 @@ static void HandleTurnActionSelectionState(void) *(gBattleStruct->stateIdAfterSelScript + gActiveBattler) = STATE_BEFORE_ACTION_CHOSEN; return; } - #endif if ((gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER_NO_PYRAMID diff --git a/src/debug.c b/src/debug.c index 283361b389..2883beb797 100644 --- a/src/debug.c +++ b/src/debug.c @@ -55,7 +55,7 @@ #include "constants/songs.h" #include "constants/species.h" -#if TX_DEBUG_SYSTEM == TRUE +#if DEBUG_SYSTEM_ENABLE == TRUE // ******************************* // Enums enum { // Main @@ -1447,56 +1447,56 @@ static void DebugAction_Flags_ToggleFrontierPass(u8 taskId) } static void DebugAction_Flags_CollisionOnOff(u8 taskId) { - if(FlagGet(TX_DEBUG_FLAG_NO_COLLISION)) + if(FlagGet(DEBUG_FLAG_NO_COLLISION)) { - FlagClear(TX_DEBUG_FLAG_NO_COLLISION); + FlagClear(DEBUG_FLAG_NO_COLLISION); PlaySE(SE_PC_OFF); }else{ - FlagSet(TX_DEBUG_FLAG_NO_COLLISION); + FlagSet(DEBUG_FLAG_NO_COLLISION); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_EncounterOnOff(u8 taskId) { - if(FlagGet(TX_DEBUG_FLAG_NO_ENCOUNTER)) + if(FlagGet(DEBUG_FLAG_NO_ENCOUNTER)) { - FlagClear(TX_DEBUG_FLAG_NO_ENCOUNTER); + FlagClear(DEBUG_FLAG_NO_ENCOUNTER); PlaySE(SE_PC_OFF); }else{ - FlagSet(TX_DEBUG_FLAG_NO_ENCOUNTER); + FlagSet(DEBUG_FLAG_NO_ENCOUNTER); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) { - if(FlagGet(TX_DEBUG_FLAG_NO_TRAINER_SEE)) + if(FlagGet(DEBUG_FLAG_NO_TRAINER_SEE)) { - FlagClear(TX_DEBUG_FLAG_NO_TRAINER_SEE); + FlagClear(DEBUG_FLAG_NO_TRAINER_SEE); PlaySE(SE_PC_OFF); }else{ - FlagSet(TX_DEBUG_FLAG_NO_TRAINER_SEE); + FlagSet(DEBUG_FLAG_NO_TRAINER_SEE); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_BagUseOnOff(u8 taskId) { - if(FlagGet(TX_DEBUG_FLAG_NO_BAG_USE)) + if(FlagGet(B_FLAG_NO_BAG_USE)) { - FlagClear(TX_DEBUG_FLAG_NO_BAG_USE); + FlagClear(B_FLAG_NO_BAG_USE); PlaySE(SE_PC_OFF); }else{ - FlagSet(TX_DEBUG_FLAG_NO_BAG_USE); + FlagSet(B_FLAG_NO_BAG_USE); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_CatchingOnOff(u8 taskId) { - if(FlagGet(TX_DEBUG_FLAG_NO_CATCHING)) + if(FlagGet(B_FLAG_NO_CATCHING)) { - FlagClear(TX_DEBUG_FLAG_NO_CATCHING); + FlagClear(B_FLAG_NO_CATCHING); PlaySE(SE_PC_OFF); }else{ - FlagSet(TX_DEBUG_FLAG_NO_CATCHING); + FlagSet(B_FLAG_NO_CATCHING); PlaySE(SE_PC_LOGIN); } } @@ -2723,7 +2723,7 @@ static void Task_WaitFadeAccessPC(u8 taskId) if (!gPaletteFade.active) { DestroyTask(taskId); - FlagSet(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU); + FlagSet(DEBUG_FLAG_PC_FROM_DEBUG_MENU); EnterPokeStorage(2); } } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 9765febbf4..2c5418da41 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4630,8 +4630,8 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) { u8 direction = dir; -#if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(TX_DEBUG_FLAG_NO_COLLISION)) +#if DEBUG_SYSTEM_ENABLE == TRUE + if (FlagGet(DEBUG_FLAG_NO_COLLISION)) return COLLISION_NONE; #endif diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 2b86bf2cf7..76503a85a2 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -131,7 +131,7 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) else if (heldKeys & DPAD_RIGHT) input->dpadDirection = DIR_EAST; -#if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE +#if DEBUG_SYSTEM_ENABLE == TRUE && DEBUG_SYSTEM_IN_MENU == FALSE if ((heldKeys & R_BUTTON) && input->pressedStartButton) { input->input_field_1_2 = TRUE; @@ -197,7 +197,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE) return TRUE; -#if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == FALSE +#if DEBUG_SYSTEM_ENABLE == TRUE && DEBUG_SYSTEM_IN_MENU == FALSE if (input->input_field_1_2) { PlaySE(SE_WIN_OPEN); @@ -686,8 +686,8 @@ void RestartWildEncounterImmunitySteps(void) static bool8 CheckStandardWildEncounter(u16 metatileBehavior) { -#if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(TX_DEBUG_FLAG_NO_ENCOUNTER)) +#if DEBUG_SYSTEM_ENABLE == TRUE + if (FlagGet(DEBUG_FLAG_NO_ENCOUNTER)) return FALSE; #endif diff --git a/src/item_use.c b/src/item_use.c index ea2bea0fe7..a0b4233fff 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -982,14 +982,12 @@ static const u8 sText_CantThrowPokeBall_TwoMons[] = _("Cannot throw a ball!\nThe static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a ball!\nThere's no Pokémon in sight!\p"); void ItemUseInBattle_PokeBall(u8 taskId) { -#if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(TX_DEBUG_FLAG_NO_CATCHING)) + if (FlagGet(B_FLAG_NO_CATCHING)) { static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p"); DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage); return; } -#endif switch (GetBallThrowableState()) { diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 437458d75b..d3fe3caa29 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1669,7 +1669,7 @@ static void FieldTask_ReturnToPcMenu(void) MainCallback vblankCb = gMain.vblankCallback; SetVBlankCallback(NULL); - if (!FlagGet(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU)) + if (!FlagGet(DEBUG_FLAG_PC_FROM_DEBUG_MENU)) { taskId = CreateTask(Task_PCMainMenu, 80); gTasks[taskId].tState = 0; @@ -1678,7 +1678,7 @@ static void FieldTask_ReturnToPcMenu(void) } else { - FlagClear(TX_DEBUG_FLAG_PC_FROM_DEBUG_MENU); + FlagClear(DEBUG_FLAG_PC_FROM_DEBUG_MENU); ScriptContext_Enable(); } SetVBlankCallback(vblankCb); diff --git a/src/start_menu.c b/src/start_menu.c index 9f84df16ad..0f7c0cb697 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -286,7 +286,7 @@ static void BuildStartMenuActions(void) } else { - #if TX_DEBUG_SYSTEM == TRUE && TX_DEBUG_SYSTEM_IN_MENU == TRUE + #if DEBUG_SYSTEM_ENABLE == TRUE && DEBUG_SYSTEM_IN_MENU == TRUE BuildDebugStartMenu(); #else BuildNormalStartMenu(); @@ -760,7 +760,7 @@ static bool8 StartMenuDebugCallback(void) RemoveExtraStartMenuWindows(); HideStartMenuDebug(); // Hide start menu without enabling movement -#if TX_DEBUG_SYSTEM == TRUE +#if DEBUG_SYSTEM_ENABLE == TRUE Debug_ShowMainMenu(); #endif diff --git a/src/trainer_see.c b/src/trainer_see.c index 73b4395d40..d44e5e46fb 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -193,8 +193,8 @@ bool8 CheckForTrainersWantingBattle(void) { u8 i; -#if TX_DEBUG_SYSTEM == TRUE - if (FlagGet(TX_DEBUG_FLAG_NO_TRAINER_SEE)) +#if DEBUG_SYSTEM_ENABLE == TRUE + if (FlagGet(DEBUG_FLAG_NO_TRAINER_SEE)) return FALSE; #endif From b4b3e84cbdeb790a982ed97e48a2a7e5f9be4f73 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Fri, 2 Sep 2022 18:39:38 +0200 Subject: [PATCH 082/155] removed default flags and added ingame warning if a function that requires them is used --- data/scripts/debug.inc | 14 ++++++++++++- include/constants/battle_config.h | 4 ++-- include/constants/flags.h | 12 +++++------ include/constants/overworld_config.h | 8 +++---- src/debug.c | 31 ++++++++++++++++++++++++++++ 5 files changed, 56 insertions(+), 13 deletions(-) diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index e174343f22..fe86197c8c 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -38,10 +38,22 @@ Debug_CheatStart:: setflag FLAG_HIDE_ROUTE_116_MR_BRINEY clearflag FLAG_HIDE_BRINEYS_HOUSE_MR_BRINEY clearflag FLAG_HIDE_BRINEYS_HOUSE_PEEKO - closemessage release end +Debug_FlagsNotSetMessage:: + lockall + message Debug_FlagsNotSetMessage_Text + waitmessage + waitbuttonpress + releaseall + end + +Debug_FlagsNotSetMessage_Text: + .string "Feature unavailable!\n" + .string "Please define a usable flag in:\l" + .string "'include/constants/debug{UNDERSCORE}config.h'!$" + Debug_Script_1:: end diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index a5db36e19b..ad7775b673 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -138,8 +138,8 @@ #define B_FLAG_INVERSE_BATTLE 0 // If this flag is set, the battle's type effectiveness are inversed. For example, fire is super effective against water. #define B_FLAG_FORCE_DOUBLE_WILD 0 // If this flag is set, all land and surfing wild battles will be double battles. #define B_SMART_WILD_AI_FLAG 0 // If not 0, you can set this flag in a script to enable smart wild pokemon -#define B_FLAG_NO_BAG_USE FLAG_UNUSED_0x023 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used. -#define B_FLAG_NO_CATCHING FLAG_UNUSED_0x024 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used. +#define B_FLAG_NO_BAG_USE 0 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used. +#define B_FLAG_NO_CATCHING 0 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used. // Var Settings // To use the following features in scripting, replace the 0s with the var ID you're assigning it to. diff --git a/include/constants/flags.h b/include/constants/flags.h index ac8de43dc4..8fbc246300 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -41,12 +41,12 @@ #define FLAG_TEMP_1F (TEMP_FLAGS_START + 0x1F) #define TEMP_FLAGS_END FLAG_TEMP_1F -#define FLAG_UNUSED_0x020 0x20 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" -#define FLAG_UNUSED_0x021 0x21 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" -#define FLAG_UNUSED_0x022 0x22 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" -#define FLAG_UNUSED_0x023 0x23 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" -#define FLAG_UNUSED_0x024 0x24 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" -#define FLAG_UNUSED_0x025 0x25 // Unused Flag //Used for DEBUG functions, can be changed in "constants/battle_config.h" +#define FLAG_UNUSED_0x020 0x20 // Unused Flag +#define FLAG_UNUSED_0x021 0x21 // Unused Flag +#define FLAG_UNUSED_0x022 0x22 // Unused Flag +#define FLAG_UNUSED_0x023 0x23 // Unused Flag +#define FLAG_UNUSED_0x024 0x24 // Unused Flag +#define FLAG_UNUSED_0x025 0x25 // Unused Flag #define FLAG_UNUSED_0x026 0x26 // Unused Flag #define FLAG_UNUSED_0x027 0x27 // Unused Flag #define FLAG_UNUSED_0x028 0x28 // Unused Flag diff --git a/include/constants/overworld_config.h b/include/constants/overworld_config.h index 3e57066f5f..6d094d60f5 100644 --- a/include/constants/overworld_config.h +++ b/include/constants/overworld_config.h @@ -6,9 +6,9 @@ #define DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (replaces the exit entry). // Replace the used flags with others or disable with a 0 -#define DEBUG_FLAG_NO_COLLISION FLAG_UNUSED_0x020 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used. -#define DEBUG_FLAG_NO_ENCOUNTER FLAG_UNUSED_0x021 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used. -#define DEBUG_FLAG_NO_TRAINER_SEE FLAG_UNUSED_0x022 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used. -#define DEBUG_FLAG_PC_FROM_DEBUG_MENU FLAG_UNUSED_0x025 // If this flag is set, the debug function in debug menu to access the player PC works. +#define DEBUG_FLAG_NO_COLLISION 0 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used. +#define DEBUG_FLAG_NO_ENCOUNTER 0 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used. +#define DEBUG_FLAG_NO_TRAINER_SEE 0 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used. +#define DEBUG_FLAG_PC_FROM_DEBUG_MENU 0 // If this flag is set, the debug function in debug menu to access the player PC works. #endif // GUARD_CONSTANTS_OVERWORLD_CONFIG_H diff --git a/src/debug.c b/src/debug.c index 2883beb797..81e30cff01 100644 --- a/src/debug.c +++ b/src/debug.c @@ -271,6 +271,7 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId); static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)); static void DebugAction_OpenSubMenu(u8 taskId, struct ListMenuTemplate LMtemplate); +extern u8 Debug_FlagsNotSetMessage[]; extern u8 Debug_Script_1[]; extern u8 Debug_Script_2[]; extern u8 Debug_Script_3[]; @@ -1447,6 +1448,11 @@ static void DebugAction_Flags_ToggleFrontierPass(u8 taskId) } static void DebugAction_Flags_CollisionOnOff(u8 taskId) { +#if DEBUG_FLAG_NO_COLLISION == 0 + Debug_DestroyMenu(taskId); + LockPlayerFieldControls(); + ScriptContext_SetupScript(Debug_FlagsNotSetMessage); +#else if(FlagGet(DEBUG_FLAG_NO_COLLISION)) { FlagClear(DEBUG_FLAG_NO_COLLISION); @@ -1455,9 +1461,15 @@ static void DebugAction_Flags_CollisionOnOff(u8 taskId) FlagSet(DEBUG_FLAG_NO_COLLISION); PlaySE(SE_PC_LOGIN); } +#endif } static void DebugAction_Flags_EncounterOnOff(u8 taskId) { +#if DEBUG_FLAG_NO_ENCOUNTER == 0 + Debug_DestroyMenu(taskId); + LockPlayerFieldControls(); + ScriptContext_SetupScript(Debug_FlagsNotSetMessage); +#else if(FlagGet(DEBUG_FLAG_NO_ENCOUNTER)) { FlagClear(DEBUG_FLAG_NO_ENCOUNTER); @@ -1466,9 +1478,15 @@ static void DebugAction_Flags_EncounterOnOff(u8 taskId) FlagSet(DEBUG_FLAG_NO_ENCOUNTER); PlaySE(SE_PC_LOGIN); } +#endif } static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) { +#if DEBUG_FLAG_NO_TRAINER_SEE == 0 + Debug_DestroyMenu(taskId); + LockPlayerFieldControls(); + ScriptContext_SetupScript(Debug_FlagsNotSetMessage); +#else if(FlagGet(DEBUG_FLAG_NO_TRAINER_SEE)) { FlagClear(DEBUG_FLAG_NO_TRAINER_SEE); @@ -1477,9 +1495,15 @@ static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) FlagSet(DEBUG_FLAG_NO_TRAINER_SEE); PlaySE(SE_PC_LOGIN); } +#endif } static void DebugAction_Flags_BagUseOnOff(u8 taskId) { +#if B_FLAG_NO_BAG_USE == 0 + Debug_DestroyMenu(taskId); + LockPlayerFieldControls(); + ScriptContext_SetupScript(Debug_FlagsNotSetMessage); +#else if(FlagGet(B_FLAG_NO_BAG_USE)) { FlagClear(B_FLAG_NO_BAG_USE); @@ -1488,9 +1512,15 @@ static void DebugAction_Flags_BagUseOnOff(u8 taskId) FlagSet(B_FLAG_NO_BAG_USE); PlaySE(SE_PC_LOGIN); } +#endif } static void DebugAction_Flags_CatchingOnOff(u8 taskId) { +#if B_FLAG_NO_CATCHING_USE == 0 + Debug_DestroyMenu(taskId); + LockPlayerFieldControls(); + ScriptContext_SetupScript(Debug_FlagsNotSetMessage); +#else if(FlagGet(B_FLAG_NO_CATCHING)) { FlagClear(B_FLAG_NO_CATCHING); @@ -1499,6 +1529,7 @@ static void DebugAction_Flags_CatchingOnOff(u8 taskId) FlagSet(B_FLAG_NO_CATCHING); PlaySE(SE_PC_LOGIN); } +#endif } // ******************************* From 13cc640b7841fb0e71ee1225aa64db4114c4ecfd Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Fri, 2 Sep 2022 18:53:51 +0200 Subject: [PATCH 083/155] whitspace changes, removed wrong comment --- src/start_menu.c | 4 ++-- tools/mapjson/mapjson.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/start_menu.c b/src/start_menu.c index 0f7c0cb697..a0cff087cd 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -174,7 +174,7 @@ static const struct MenuAction sStartMenuItems[] = [MENU_ACTION_REST_FRONTIER] = {gText_MenuRest, {.u8_void = StartMenuSaveCallback}}, [MENU_ACTION_RETIRE_FRONTIER] = {gText_MenuRetire, {.u8_void = StartMenuBattlePyramidRetireCallback}}, [MENU_ACTION_PYRAMID_BAG] = {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}}, - [MENU_ACTION_DEBUG] = {gText_MenuDebug, {.u8_void = StartMenuDebugCallback}}, + [MENU_ACTION_DEBUG] = {gText_MenuDebug, {.u8_void = StartMenuDebugCallback}}, }; static const struct BgTemplate sBgTemplates_LinkBattleSave[] = @@ -762,7 +762,7 @@ static bool8 StartMenuDebugCallback(void) #if DEBUG_SYSTEM_ENABLE == TRUE Debug_ShowMainMenu(); - #endif +#endif return TRUE; } diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index c5f86bdf0e..8de9ff8d01 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -398,8 +398,8 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { for (auto &group : groups_data["group_order"].array_items()) { text << "// " << group.string_value() << "\n"; vector map_ids; - - size_t max_length = 0; //DEBUG + size_t max_length = 0; + int map_count = 0; //DEBUG for (auto &map_name : groups_data[group.string_value()].array_items()) { From 03a98c72bc435bf92e535de26f21ce0c06df6dd9 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Sep 2022 19:29:35 -0400 Subject: [PATCH 084/155] Sync fieldmap --- include/fieldmap.h | 2 +- include/global.fieldmap.h | 10 +++++----- src/fieldmap.c | 13 +++++++------ src/item_use.c | 2 +- src/scrcmd.c | 8 ++++---- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/include/fieldmap.h b/include/fieldmap.h index 7caadfcaaa..2f7eaba66b 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -47,7 +47,7 @@ void CopySecondaryTilesetToVramUsingHeap(struct MapLayout const *mapLayout); void CopyPrimaryTilesetToVram(const struct MapLayout *); void CopySecondaryTilesetToVram(const struct MapLayout *); struct MapHeader const *const GetMapHeaderFromConnection(struct MapConnection *connection); -struct MapConnection *GetConnectionAtCoords(s16 x, s16 y); +struct MapConnection *GetMapConnectionAtPos(s16 x, s16 y); void MapGridSetMetatileImpassabilityAt(int x, int y, bool32 impassable); // field_region_map.c diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 974fa3382b..2be44a5f3b 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -4,9 +4,9 @@ // Masks/shifts for blocks in the map grid // Map grid blocks consist of a 10 bit metatile id, a 2 bit collision value, and a 4 bit elevation value // This is the data stored in each data/layouts/*/map.bin file -#define MAPGRID_METATILE_ID_MASK 0x03FF // Bits 1-10 -#define MAPGRID_COLLISION_MASK 0x0C00 // Bits 11-12 -#define MAPGRID_ELEVATION_MASK 0xF000 // Bits 13-16 +#define MAPGRID_METATILE_ID_MASK 0x03FF // Bits 0-9 +#define MAPGRID_COLLISION_MASK 0x0C00 // Bits 10-11 +#define MAPGRID_ELEVATION_MASK 0xF000 // Bits 12-15 #define MAPGRID_COLLISION_SHIFT 10 #define MAPGRID_ELEVATION_SHIFT 12 @@ -16,8 +16,8 @@ // Masks/shifts for metatile attributes // Metatile attributes consist of an 8 bit behavior value, 4 unused bits, and a 4 bit layer type value // This is the data stored in each data/tilesets/*/*/metatile_attributes.bin file -#define METATILE_ATTR_BEHAVIOR_MASK 0x00FF // Bits 1-8 -#define METATILE_ATTR_LAYER_MASK 0xF000 // Bits 13-16 +#define METATILE_ATTR_BEHAVIOR_MASK 0x00FF // Bits 0-7 +#define METATILE_ATTR_LAYER_MASK 0xF000 // Bits 12-15 #define METATILE_ATTR_LAYER_SHIFT 12 enum { diff --git a/src/fieldmap.c b/src/fieldmap.c index 2b981dc6e5..8dfa23bf34 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -753,7 +753,7 @@ static int IsPosInConnectingMap(struct MapConnection *connection, int x, int y) return FALSE; } -struct MapConnection *GetConnectionAtCoords(s16 x, s16 y) +struct MapConnection *GetMapConnectionAtPos(s16 x, s16 y) { int count; struct MapConnection *connection; @@ -860,12 +860,13 @@ static void CopyTilesetToVramUsingHeap(struct Tileset const *tileset, u16 numTil } } -static void FieldmapPaletteDummy(u16 offset, u16 size) +// Below two are dummied functions from FRLG, used to tint the overworld palettes for the Quest Log +static void ApplyGlobalTintToPaletteEntries(u16 offset, u16 size) { } -static void FieldmapUnkDummy(void) +static void ApplyGlobalTintToPaletteSlot(void) { } @@ -880,17 +881,17 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size) { LoadPalette(&black, destOffset, 2); LoadPalette(((u16 *)tileset->palettes) + 1, destOffset + 1, size - 2); - FieldmapPaletteDummy(destOffset + 1, (size - 2) >> 1); + ApplyGlobalTintToPaletteEntries(destOffset + 1, (size - 2) >> 1); } else if (tileset->isSecondary == TRUE) { LoadPalette(((u16 *)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size); - FieldmapPaletteDummy(destOffset, size >> 1); + ApplyGlobalTintToPaletteEntries(destOffset, size >> 1); } else { LoadCompressedPalette((u32 *)tileset->palettes, destOffset, size); - FieldmapPaletteDummy(destOffset, size >> 1); + ApplyGlobalTintToPaletteEntries(destOffset, size >> 1); } } } diff --git a/src/item_use.c b/src/item_use.c index e5c78d0910..41e8884968 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -456,7 +456,7 @@ static void CheckForHiddenItemsInMapConnection(u8 taskId) || var2 > y || y >= height) { - struct MapConnection *conn = GetConnectionAtCoords(x, y); + struct MapConnection *conn = GetMapConnectionAtPos(x, y); if (conn && IsHiddenItemPresentInConnection(conn, x, y) == TRUE) SetDistanceOfClosestHiddenItem(taskId, x - playerX, y - playerY); } diff --git a/src/scrcmd.c b/src/scrcmd.c index 6ca02019d8..3d67c69e51 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -2038,15 +2038,15 @@ bool8 ScrCmd_setmetatile(struct ScriptContext *ctx) { u16 x = VarGet(ScriptReadHalfword(ctx)); u16 y = VarGet(ScriptReadHalfword(ctx)); - u16 tileId = VarGet(ScriptReadHalfword(ctx)); - u16 isImpassable = VarGet(ScriptReadHalfword(ctx)); + u16 metatileId = VarGet(ScriptReadHalfword(ctx)); + bool16 isImpassable = VarGet(ScriptReadHalfword(ctx)); x += MAP_OFFSET; y += MAP_OFFSET; if (!isImpassable) - MapGridSetMetatileIdAt(x, y, tileId); + MapGridSetMetatileIdAt(x, y, metatileId); else - MapGridSetMetatileIdAt(x, y, tileId | MAPGRID_COLLISION_MASK); + MapGridSetMetatileIdAt(x, y, metatileId | MAPGRID_COLLISION_MASK); return FALSE; } From 7f1c4720a246702c97ef04f7191648ccac587232 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Sep 2022 19:36:46 -0400 Subject: [PATCH 085/155] Update arguments for ApplyGlobalTintToPaletteSlot --- src/fieldmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fieldmap.c b/src/fieldmap.c index 8dfa23bf34..149084d35e 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -866,7 +866,7 @@ static void ApplyGlobalTintToPaletteEntries(u16 offset, u16 size) } -static void ApplyGlobalTintToPaletteSlot(void) +static void ApplyGlobalTintToPaletteSlot(u8 slot, u8 count) { } From 8b7230c3c456f23cc87b3581f641688e41e82987 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Sep 2022 19:41:28 -0400 Subject: [PATCH 086/155] CpuFastFill -> CpuFastFill16 in fieldmap --- src/fieldmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fieldmap.c b/src/fieldmap.c index 149084d35e..bcd2d1019a 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -87,13 +87,13 @@ void InitMapFromSavedGame(void) void InitBattlePyramidMap(bool8 setPlayerPosition) { - CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData)); + CpuFastFill16(MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData)); GenerateBattlePyramidFloorLayout(sBackupMapData, setPlayerPosition); } void InitTrainerHillMap(void) { - CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData)); + CpuFastFill16(MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData)); GenerateTrainerHillFloorLayout(sBackupMapData); } From 97021baec6f9f112b27ce1356b7e3ca0873327ba Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Sep 2022 21:53:44 -0400 Subject: [PATCH 087/155] Drop usage of global directive --- src/crt0.s | 6 ++---- src/rom_header.s | 21 +++++++-------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/crt0.s b/src/crt0.s index 523061f52d..5808147220 100644 --- a/src/crt0.s +++ b/src/crt0.s @@ -5,8 +5,7 @@ .arm .align 2, 0 - .global Init -Init: +Init:: mov r0, #PSR_IRQ_MODE msr cpsr_cf, r0 ldr sp, sp_irq @@ -33,8 +32,7 @@ sp_irq: .word IWRAM_END - 0x60 .arm .align 2, 0 - .global IntrMain -IntrMain: +IntrMain:: mov r3, #REG_BASE add r3, r3, #OFFSET_REG_IE ldr r2, [r3] diff --git a/src/rom_header.s b/src/rom_header.s index c5fa5ddf40..4f80d8f63f 100644 --- a/src/rom_header.s +++ b/src/rom_header.s @@ -1,19 +1,16 @@ @ Note: ROM header data is empty space here. @ It's populated by gbafix using data provided in the Makefile. - .global Start -Start: +Start:: b Init - .global RomHeaderNintendoLogo -RomHeaderNintendoLogo: +RomHeaderNintendoLogo:: .space 156 RomHeaderGameTitle: .space 12 - .global RomHeaderGameCode -RomHeaderGameCode: +RomHeaderGameCode:: .space 4 RomHeaderMakerCode: @@ -31,8 +28,7 @@ RomHeaderDeviceType: RomHeaderReserved1: .space 7 - .global RomHeaderSoftwareVersion -RomHeaderSoftwareVersion: +RomHeaderSoftwareVersion:: .byte 0 RomHeaderChecksum: @@ -43,16 +39,13 @@ RomHeaderReserved2: .word 0 - .global GPIOPortData -GPIOPortData: +GPIOPortData:: .2byte 0 - .global GPIOPortDirection -GPIOPortDirection: +GPIOPortDirection:: .2byte 0 - .global GPIOPortReadEnable -GPIOPortReadEnable: +GPIOPortReadEnable:: .2byte 0 .2byte 0 From 4017fc3e20f3c996a46eccb650f72c46c302fc0b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 3 Sep 2022 21:22:15 -0400 Subject: [PATCH 088/155] Apply style suggestions from code review --- data/scripts/debug.inc | 2 +- include/constants/battle_config.h | 4 +- src/battle_main.c | 1 - src/debug.c | 815 ++++++++++++++---------------- src/item_use.c | 1 - src/trainer_see.c | 1 - 6 files changed, 372 insertions(+), 452 deletions(-) diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index fe86197c8c..9463164ac2 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -52,7 +52,7 @@ Debug_FlagsNotSetMessage:: Debug_FlagsNotSetMessage_Text: .string "Feature unavailable!\n" .string "Please define a usable flag in:\l" - .string "'include/constants/debug{UNDERSCORE}config.h'!$" + .string "'include/constants/overworld{UNDERSCORE}config.h'!$" Debug_Script_1:: end diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index ad7775b673..461829e261 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -138,8 +138,8 @@ #define B_FLAG_INVERSE_BATTLE 0 // If this flag is set, the battle's type effectiveness are inversed. For example, fire is super effective against water. #define B_FLAG_FORCE_DOUBLE_WILD 0 // If this flag is set, all land and surfing wild battles will be double battles. #define B_SMART_WILD_AI_FLAG 0 // If not 0, you can set this flag in a script to enable smart wild pokemon -#define B_FLAG_NO_BAG_USE 0 // If this flag is set, the debug function in the Utility submenu to disable the bag in battle can be used. -#define B_FLAG_NO_CATCHING 0 // If this flag is set, the debug function in the Utility submenu to disable catching of wild Pokémon can be used. +#define B_FLAG_NO_BAG_USE 0 // If this flag is set, the ability to use the bag in battle is disabled. +#define B_FLAG_NO_CATCHING 0 // If this flag is set, the ability to catch wild Pokémon is disabled. // Var Settings // To use the following features in scripting, replace the 0s with the var ID you're assigning it to. diff --git a/src/battle_main.c b/src/battle_main.c index 39deaca27f..69335532c4 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -16,7 +16,6 @@ #include "berry.h" #include "bg.h" #include "data.h" -#include "debug.h" #include "decompress.h" #include "dma3.h" #include "event_data.h" diff --git a/src/debug.c b/src/debug.c index 81e30cff01..5d861640cd 100644 --- a/src/debug.c +++ b/src/debug.c @@ -151,7 +151,6 @@ enum { //Sound // EWRAM static EWRAM_DATA struct DebugMonData *sDebugMonData = NULL; - // ******************************* struct DebugMonData { @@ -172,7 +171,6 @@ struct DebugMonData u16 mon_move_3; }; - // ******************************* // Define functions static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate); @@ -285,12 +283,6 @@ extern u8 Debug_ShowFieldMessageStringVar4[]; extern u8 Debug_CheatStart[]; extern u8 PlayersHouse_2F_EventScript_SetWallClock[]; extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; -#ifdef BATTLE_ENGINE -#define ABILITY_NAME_LENGTH 16 -#else -#define ABILITY_NAME_LENGTH 12 -#endif -extern const u8 gAbilityNames[][ABILITY_NAME_LENGTH + 1]; // ******************************* @@ -299,108 +291,108 @@ static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, // Text // Main Menu -static const u8 gDebugText_Utilities[] = _("Utilities"); -static const u8 gDebugText_Scripts[] = _("Scripts"); -static const u8 gDebugText_Flags[] = _("Flags"); -static const u8 gDebugText_Vars[] = _("Variables"); -static const u8 gDebugText_Give[] = _("Give X"); -static const u8 gDebugText_Sound[] = _("Sound"); -static const u8 gDebugText_Cancel[] = _("Cancel"); +static const u8 gDebugText_Utilities[] = _("Utilities"); +static const u8 gDebugText_Scripts[] = _("Scripts"); +static const u8 gDebugText_Flags[] = _("Flags"); +static const u8 gDebugText_Vars[] = _("Variables"); +static const u8 gDebugText_Give[] = _("Give X"); +static const u8 gDebugText_Sound[] = _("Sound"); +static const u8 gDebugText_Cancel[] = _("Cancel"); // Script menu -static const u8 gDebugText_Util_Script_1[] = _("Script 1"); -static const u8 gDebugText_Util_Script_2[] = _("Script 2"); -static const u8 gDebugText_Util_Script_3[] = _("Script 3"); -static const u8 gDebugText_Util_Script_4[] = _("Script 4"); -static const u8 gDebugText_Util_Script_5[] = _("Script 5"); -static const u8 gDebugText_Util_Script_6[] = _("Script 6"); -static const u8 gDebugText_Util_Script_7[] = _("Script 7"); -static const u8 gDebugText_Util_Script_8[] = _("Script 8"); +static const u8 gDebugText_Util_Script_1[] = _("Script 1"); +static const u8 gDebugText_Util_Script_2[] = _("Script 2"); +static const u8 gDebugText_Util_Script_3[] = _("Script 3"); +static const u8 gDebugText_Util_Script_4[] = _("Script 4"); +static const u8 gDebugText_Util_Script_5[] = _("Script 5"); +static const u8 gDebugText_Util_Script_6[] = _("Script 6"); +static const u8 gDebugText_Util_Script_7[] = _("Script 7"); +static const u8 gDebugText_Util_Script_8[] = _("Script 8"); // Util Menu -static const u8 gDebugText_Util_HealParty[] = _("Heal Party"); -static const u8 gDebugText_Util_Fly[] = _("Fly to map"); -static const u8 gDebugText_Util_WarpToMap[] = _("Warp to map warp"); -static const u8 gDebugText_Util_WarpToMap_SelectMapGroup[] =_("Group: {STR_VAR_1} \n \n\n{STR_VAR_3} "); -static const u8 gDebugText_Util_WarpToMap_SelectMap[] = _("Map: {STR_VAR_1} \nMapSec: \n{STR_VAR_2} \n{STR_VAR_3} "); -static const u8 gDebugText_Util_WarpToMap_SelectWarp[] = _("Warp: \n{STR_VAR_1} \n \n{STR_VAR_3} "); -static const u8 gDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}"); -static const u8 gDebugText_Util_RunningShoes[] = _("Toggle Running Shoes"); -static const u8 gDebugText_Util_PoisonMons[] = _("Poison all mons"); -static const u8 gDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); -static const u8 gDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); -static const u8 gDebugText_Util_SetWallClock[] = _("Set Wall Clock"); -static const u8 gDebugText_Util_CheckWeekDay[] = _("Check Week Day"); -static const u8 gDebugText_Util_WatchCredits[] = _("Watch Credits"); -static const u8 gDebugText_Util_Trainer_Name[] = _("Trainer name"); -static const u8 gDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); -static const u8 gDebugText_Util_Trainer_Id[] = _("New Trainer Id"); +static const u8 gDebugText_Util_HealParty[] = _("Heal Party"); +static const u8 gDebugText_Util_Fly[] = _("Fly to map"); +static const u8 gDebugText_Util_WarpToMap[] = _("Warp to map warp"); +static const u8 gDebugText_Util_WarpToMap_SelectMapGroup[] = _("Group: {STR_VAR_1} \n \n\n{STR_VAR_3} "); +static const u8 gDebugText_Util_WarpToMap_SelectMap[] = _("Map: {STR_VAR_1} \nMapSec: \n{STR_VAR_2} \n{STR_VAR_3} "); +static const u8 gDebugText_Util_WarpToMap_SelectWarp[] = _("Warp: \n{STR_VAR_1} \n \n{STR_VAR_3} "); +static const u8 gDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}"); +static const u8 gDebugText_Util_RunningShoes[] = _("Toggle Running Shoes"); +static const u8 gDebugText_Util_PoisonMons[] = _("Poison all mons"); +static const u8 gDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); +static const u8 gDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); +static const u8 gDebugText_Util_SetWallClock[] = _("Set Wall Clock"); +static const u8 gDebugText_Util_CheckWeekDay[] = _("Check Week Day"); +static const u8 gDebugText_Util_WatchCredits[] = _("Watch Credits"); +static const u8 gDebugText_Util_Trainer_Name[] = _("Trainer name"); +static const u8 gDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); +static const u8 gDebugText_Util_Trainer_Id[] = _("New Trainer Id"); // Flags Menu -static const u8 gDebugText_Flags_Flags[] = _("Set Flag XXXX"); -static const u8 gDebugText_Flags_SetPokedexFlags[] = _("All Pokédex Flags"); -static const u8 gDebugText_Flags_SwitchDex[] = _("Pokédex ON/OFF"); -static const u8 gDebugText_Flags_SwitchNationalDex[] = _("NatDex ON/OFF"); -static const u8 gDebugText_Flags_SwitchPokeNav[] = _("PokéNav ON/OFF"); -static const u8 gDebugText_Flags_ToggleFlyFlags[] = _("Fly Flags ON/OFF"); -static const u8 gDebugText_Flags_ToggleAllBadges[] = _("All badges ON/OFF"); -static const u8 gDebugText_Flags_ToggleFrontierPass[] = _("Frontier Pass ON/OFF"); -static const u8 gDebugText_Flags_SwitchCollision[] = _("Collision ON/OFF"); -static const u8 gDebugText_Flags_SwitchEncounter[] = _("Encounter ON/OFF"); -static const u8 gDebugText_Flags_SwitchTrainerSee[] = _("TrainerSee ON/OFF"); -static const u8 gDebugText_Flags_SwitchBagUse[] = _("BagUse ON/OFF"); -static const u8 gDebugText_Flags_SwitchCatching[] = _("Catching ON/OFF"); -static const u8 gDebugText_Flags_Flag[] = _("Flag: {STR_VAR_1} \n{STR_VAR_2} \n{STR_VAR_3}"); -static const u8 gDebugText_Flags_FlagHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); -static const u8 gDebugText_Flags_FlagSet[] = _("TRUE"); -static const u8 gDebugText_Flags_FlagUnset[] = _("FALSE"); +static const u8 gDebugText_Flags_Flags[] = _("Set Flag XXXX"); +static const u8 gDebugText_Flags_SetPokedexFlags[] = _("All Pokédex Flags"); +static const u8 gDebugText_Flags_SwitchDex[] = _("Pokédex ON/OFF"); +static const u8 gDebugText_Flags_SwitchNationalDex[] = _("NatDex ON/OFF"); +static const u8 gDebugText_Flags_SwitchPokeNav[] = _("PokéNav ON/OFF"); +static const u8 gDebugText_Flags_ToggleFlyFlags[] = _("Fly Flags ON/OFF"); +static const u8 gDebugText_Flags_ToggleAllBadges[] = _("All badges ON/OFF"); +static const u8 gDebugText_Flags_ToggleFrontierPass[] = _("Frontier Pass ON/OFF"); +static const u8 gDebugText_Flags_SwitchCollision[] = _("Collision ON/OFF"); +static const u8 gDebugText_Flags_SwitchEncounter[] = _("Encounter ON/OFF"); +static const u8 gDebugText_Flags_SwitchTrainerSee[] = _("TrainerSee ON/OFF"); +static const u8 gDebugText_Flags_SwitchBagUse[] = _("BagUse ON/OFF"); +static const u8 gDebugText_Flags_SwitchCatching[] = _("Catching ON/OFF"); +static const u8 gDebugText_Flags_Flag[] = _("Flag: {STR_VAR_1} \n{STR_VAR_2} \n{STR_VAR_3}"); +static const u8 gDebugText_Flags_FlagHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); +static const u8 gDebugText_Flags_FlagSet[] = _("TRUE"); +static const u8 gDebugText_Flags_FlagUnset[] = _("FALSE"); // Variables Menu -static const u8 gDebugText_Vars_Vars[] = _("Set Vars XXXX"); -static const u8 gDebugText_Vars_VariableHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); -static const u8 gDebugText_Vars_Variable[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); -static const u8 gDebugText_Vars_VariableValueSet[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); +static const u8 gDebugText_Vars_Vars[] = _("Set Vars XXXX"); +static const u8 gDebugText_Vars_VariableHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); +static const u8 gDebugText_Vars_Variable[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); +static const u8 gDebugText_Vars_VariableValueSet[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); // Give Menu -static const u8 gDebugText_Give_GiveItem[] = _("Give item XXXX"); -static const u8 gDebugText_ItemQuantity[] = _("Quantity: \n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 gDebugText_ItemID[] = _("Item Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 gDebugText_Give_AllTMs[] = _("Give all TMs"); -static const u8 gDebugText_Give_GivePokemonSimple[] = _("Pkm(lvl)"); -static const u8 gDebugText_Give_GivePokemonComplex[] = _("Pkm(l,s,n,a,IV,mov)"); -static const u8 gDebugText_PokemonID[] = _("Species: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 gDebugText_PokemonLevel[] = _("Level: \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonShiny[] = _("Shiny: \n {STR_VAR_2} \n \n "); -static const u8 gDebugText_PokemonNature[] = _("NatureId: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonAbility[] = _("AbilityNum: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonIVs[] = _("All IVs: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_0[] = _("IV HP: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_1[] = _("IV Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_2[] = _("IV Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_3[] = _("IV Speed: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_4[] = _("IV Sp. Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_5[] = _("IV Sp. Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_Give_MaxMoney[] = _("Max Money"); -static const u8 gDebugText_Give_MaxCoins[] = _("Max Coins"); -static const u8 gDebugText_Give_BattlePoints[] = _("Max Battle Points"); -static const u8 gDebugText_Give_DaycareEgg[] = _("Daycare Egg"); -static const u8 gDebugText_Give_FillPc[] = _("Fill Pc"); -static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); -static const u8 gDebugText_AccessPC[] = _("Access PC"); +static const u8 gDebugText_Give_GiveItem[] = _("Give item XXXX"); +static const u8 gDebugText_ItemQuantity[] = _("Quantity: \n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_ItemID[] = _("Item Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_Give_AllTMs[] = _("Give all TMs"); +static const u8 gDebugText_Give_GivePokemonSimple[] = _("Pkm(lvl)"); +static const u8 gDebugText_Give_GivePokemonComplex[] = _("Pkm(l,s,n,a,IV,mov)"); +static const u8 gDebugText_PokemonID[] = _("Species: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 gDebugText_PokemonLevel[] = _("Level: \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonShiny[] = _("Shiny: \n {STR_VAR_2} \n \n "); +static const u8 gDebugText_PokemonNature[] = _("NatureId: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonAbility[] = _("AbilityNum: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonIVs[] = _("All IVs: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_0[] = _("IV HP: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_1[] = _("IV Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_2[] = _("IV Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_3[] = _("IV Speed: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_4[] = _("IV Sp. Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonIV_5[] = _("IV Sp. Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 gDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 gDebugText_Give_MaxMoney[] = _("Max Money"); +static const u8 gDebugText_Give_MaxCoins[] = _("Max Coins"); +static const u8 gDebugText_Give_BattlePoints[] = _("Max Battle Points"); +static const u8 gDebugText_Give_DaycareEgg[] = _("Daycare Egg"); +static const u8 gDebugText_Give_FillPc[] = _("Fill Pc"); +static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); +static const u8 gDebugText_AccessPC[] = _("Access PC"); // Sound Mneu -static const u8 gDebugText_Sound_SE[] = _("Effects"); -static const u8 gDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); -static const u8 gDebugText_Sound_MUS[] = _("Music"); -static const u8 gDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); -static const u8 gDebugText_Sound_Empty[] = _(""); +static const u8 gDebugText_Sound_SE[] = _("Effects"); +static const u8 gDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); +static const u8 gDebugText_Sound_MUS[] = _("Music"); +static const u8 gDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); +static const u8 gDebugText_Sound_Empty[] = _(""); -static const u8 digitInidicator_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); -static const u8 digitInidicator_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); -static const u8 digitInidicator_100[] = _("{LEFT_ARROW}+100{RIGHT_ARROW} "); -static const u8 digitInidicator_1000[] = _("{LEFT_ARROW}+1000{RIGHT_ARROW} "); -static const u8 digitInidicator_10000[] = _("{LEFT_ARROW}+10000{RIGHT_ARROW} "); -static const u8 digitInidicator_100000[] = _("{LEFT_ARROW}+100000{RIGHT_ARROW} "); -static const u8 digitInidicator_1000000[] = _("{LEFT_ARROW}+1000000{RIGHT_ARROW} "); -static const u8 digitInidicator_10000000[] = _("{LEFT_ARROW}+10000000{RIGHT_ARROW} "); +static const u8 digitInidicator_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); +static const u8 digitInidicator_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); +static const u8 digitInidicator_100[] = _("{LEFT_ARROW}+100{RIGHT_ARROW} "); +static const u8 digitInidicator_1000[] = _("{LEFT_ARROW}+1000{RIGHT_ARROW} "); +static const u8 digitInidicator_10000[] = _("{LEFT_ARROW}+10000{RIGHT_ARROW} "); +static const u8 digitInidicator_100000[] = _("{LEFT_ARROW}+100000{RIGHT_ARROW} "); +static const u8 digitInidicator_1000000[] = _("{LEFT_ARROW}+1000000{RIGHT_ARROW} "); +static const u8 digitInidicator_10000000[] = _("{LEFT_ARROW}+10000000{RIGHT_ARROW} "); const u8 * const gText_DigitIndicator[] = { digitInidicator_1, @@ -430,158 +422,156 @@ static const s32 sPowersOfTen[] = // List Menu Items static const struct ListMenuItem sDebugMenu_Items_Main[] = { - [DEBUG_MENU_ITEM_UTILITIES] = {gDebugText_Utilities, DEBUG_MENU_ITEM_UTILITIES}, - [DEBUG_MENU_ITEM_SCRIPTS] = {gDebugText_Scripts, DEBUG_MENU_ITEM_SCRIPTS}, - [DEBUG_MENU_ITEM_FLAGS] = {gDebugText_Flags, DEBUG_MENU_ITEM_FLAGS}, - [DEBUG_MENU_ITEM_VARS] = {gDebugText_Vars, DEBUG_MENU_ITEM_VARS}, - [DEBUG_MENU_ITEM_GIVE] = {gDebugText_Give, DEBUG_MENU_ITEM_GIVE}, - [DEBUG_MENU_ITEM_SOUND] = {gDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, - [DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, - [DEBUG_MENU_ITEM_CANCEL] = {gDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} + [DEBUG_MENU_ITEM_UTILITIES] = {gDebugText_Utilities, DEBUG_MENU_ITEM_UTILITIES}, + [DEBUG_MENU_ITEM_SCRIPTS] = {gDebugText_Scripts, DEBUG_MENU_ITEM_SCRIPTS}, + [DEBUG_MENU_ITEM_FLAGS] = {gDebugText_Flags, DEBUG_MENU_ITEM_FLAGS}, + [DEBUG_MENU_ITEM_VARS] = {gDebugText_Vars, DEBUG_MENU_ITEM_VARS}, + [DEBUG_MENU_ITEM_GIVE] = {gDebugText_Give, DEBUG_MENU_ITEM_GIVE}, + [DEBUG_MENU_ITEM_SOUND] = {gDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, + [DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, + [DEBUG_MENU_ITEM_CANCEL] = {gDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} }; static const struct ListMenuItem sDebugMenu_Items_Utilities[] = { - [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {gDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, - [DEBUG_UTIL_MENU_ITEM_FLY] = {gDebugText_Util_Fly, DEBUG_UTIL_MENU_ITEM_FLY}, - [DEBUG_UTIL_MENU_ITEM_WARP] = {gDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, - [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = {gDebugText_Util_RunningShoes, DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES}, - [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {gDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {gDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {gDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {gDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY] = {gDebugText_Util_CheckWeekDay, DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY}, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {gDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = {gDebugText_Util_Trainer_Name, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {gDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {gDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {gDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, + [DEBUG_UTIL_MENU_ITEM_FLY] = {gDebugText_Util_Fly, DEBUG_UTIL_MENU_ITEM_FLY}, + [DEBUG_UTIL_MENU_ITEM_WARP] = {gDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, + [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = {gDebugText_Util_RunningShoes, DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES}, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {gDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {gDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {gDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {gDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {gDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = {gDebugText_Util_Trainer_Name, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {gDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {gDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, }; static const struct ListMenuItem sDebugMenu_Items_Scripts[] = { - [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = {gDebugText_Util_Script_1, DEBUG_UTIL_MENU_ITEM_SCRIPT_1}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = {gDebugText_Util_Script_2, DEBUG_UTIL_MENU_ITEM_SCRIPT_2}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = {gDebugText_Util_Script_3, DEBUG_UTIL_MENU_ITEM_SCRIPT_3}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = {gDebugText_Util_Script_4, DEBUG_UTIL_MENU_ITEM_SCRIPT_4}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = {gDebugText_Util_Script_5, DEBUG_UTIL_MENU_ITEM_SCRIPT_5}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = {gDebugText_Util_Script_6, DEBUG_UTIL_MENU_ITEM_SCRIPT_6}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = {gDebugText_Util_Script_7, DEBUG_UTIL_MENU_ITEM_SCRIPT_7}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = {gDebugText_Util_Script_8, DEBUG_UTIL_MENU_ITEM_SCRIPT_8}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = {gDebugText_Util_Script_1, DEBUG_UTIL_MENU_ITEM_SCRIPT_1}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = {gDebugText_Util_Script_2, DEBUG_UTIL_MENU_ITEM_SCRIPT_2}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = {gDebugText_Util_Script_3, DEBUG_UTIL_MENU_ITEM_SCRIPT_3}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = {gDebugText_Util_Script_4, DEBUG_UTIL_MENU_ITEM_SCRIPT_4}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = {gDebugText_Util_Script_5, DEBUG_UTIL_MENU_ITEM_SCRIPT_5}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = {gDebugText_Util_Script_6, DEBUG_UTIL_MENU_ITEM_SCRIPT_6}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = {gDebugText_Util_Script_7, DEBUG_UTIL_MENU_ITEM_SCRIPT_7}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = {gDebugText_Util_Script_8, DEBUG_UTIL_MENU_ITEM_SCRIPT_8}, }; static const struct ListMenuItem sDebugMenu_Items_Flags[] = { - [DEBUG_FLAG_MENU_ITEM_FLAGS] = {gDebugText_Flags_Flags, DEBUG_FLAG_MENU_ITEM_FLAGS}, - [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = {gDebugText_Flags_SetPokedexFlags, DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS}, - [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = {gDebugText_Flags_SwitchDex, DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF}, - [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = {gDebugText_Flags_SwitchNationalDex, DEBUG_FLAG_MENU_ITEM_NATDEXONOFF}, - [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = {gDebugText_Flags_SwitchPokeNav, DEBUG_FLAG_MENU_ITEM_POKENAVONOFF}, - [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = {gDebugText_Flags_ToggleFlyFlags, DEBUG_FLAG_MENU_ITEM_FLYANYWHERE}, - [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = {gDebugText_Flags_ToggleAllBadges, DEBUG_FLAG_MENU_ITEM_GETALLBADGES}, - [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = {gDebugText_Flags_ToggleFrontierPass, DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS}, - [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = {gDebugText_Flags_SwitchCollision, DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = {gDebugText_Flags_SwitchEncounter, DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF]= {gDebugText_Flags_SwitchTrainerSee, DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = {gDebugText_Flags_SwitchBagUse, DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = {gDebugText_Flags_SwitchCatching, DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_FLAGS] = {gDebugText_Flags_Flags, DEBUG_FLAG_MENU_ITEM_FLAGS}, + [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = {gDebugText_Flags_SetPokedexFlags, DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS}, + [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = {gDebugText_Flags_SwitchDex, DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF}, + [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = {gDebugText_Flags_SwitchNationalDex, DEBUG_FLAG_MENU_ITEM_NATDEXONOFF}, + [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = {gDebugText_Flags_SwitchPokeNav, DEBUG_FLAG_MENU_ITEM_POKENAVONOFF}, + [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = {gDebugText_Flags_ToggleFlyFlags, DEBUG_FLAG_MENU_ITEM_FLYANYWHERE}, + [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = {gDebugText_Flags_ToggleAllBadges, DEBUG_FLAG_MENU_ITEM_GETALLBADGES}, + [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = {gDebugText_Flags_ToggleFrontierPass, DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS}, + [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = {gDebugText_Flags_SwitchCollision, DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = {gDebugText_Flags_SwitchEncounter, DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF] = {gDebugText_Flags_SwitchTrainerSee, DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = {gDebugText_Flags_SwitchBagUse, DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = {gDebugText_Flags_SwitchCatching, DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF}, }; static const struct ListMenuItem sDebugMenu_Items_Vars[] = { - [DEBUG_VARS_MENU_ITEM_VARS] = {gDebugText_Vars_Vars, DEBUG_FLAG_MENU_ITEM_FLAGS}, + [DEBUG_VARS_MENU_ITEM_VARS] = {gDebugText_Vars_Vars, DEBUG_FLAG_MENU_ITEM_FLAGS}, }; static const struct ListMenuItem sDebugMenu_Items_Give[] = { - [DEBUG_GIVE_MENU_ITEM_ITEM_X] = {gDebugText_Give_GiveItem, DEBUG_GIVE_MENU_ITEM_ITEM_X}, - [DEBUG_GIVE_MENU_ITEM_ALLTMS] = {gDebugText_Give_AllTMs, DEBUG_GIVE_MENU_ITEM_ALLTMS}, - [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {gDebugText_Give_GivePokemonSimple, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE}, - [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {gDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, - [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = {gDebugText_Give_MaxMoney, DEBUG_GIVE_MENU_ITEM_MAX_MONEY}, - [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = {gDebugText_Give_MaxCoins, DEBUG_GIVE_MENU_ITEM_MAX_COINS}, - [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS]= {gDebugText_Give_BattlePoints, DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS}, - [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {gDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, - [DEBUG_GIVE_MENU_ITEM_FILL_PC] = {gDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC}, - [DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, + [DEBUG_GIVE_MENU_ITEM_ITEM_X] = {gDebugText_Give_GiveItem, DEBUG_GIVE_MENU_ITEM_ITEM_X}, + [DEBUG_GIVE_MENU_ITEM_ALLTMS] = {gDebugText_Give_AllTMs, DEBUG_GIVE_MENU_ITEM_ALLTMS}, + [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {gDebugText_Give_GivePokemonSimple, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE}, + [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {gDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, + [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = {gDebugText_Give_MaxMoney, DEBUG_GIVE_MENU_ITEM_MAX_MONEY}, + [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = {gDebugText_Give_MaxCoins, DEBUG_GIVE_MENU_ITEM_MAX_COINS}, + [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = {gDebugText_Give_BattlePoints, DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS}, + [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {gDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, + [DEBUG_GIVE_MENU_ITEM_FILL_PC] = {gDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC}, + [DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, }; static const struct ListMenuItem sDebugMenu_Items_Sound[] = { - [DEBUG_SOUND_MENU_ITEM_SE] = {gDebugText_Sound_SE, DEBUG_SOUND_MENU_ITEM_SE}, - [DEBUG_SOUND_MENU_ITEM_MUS] = {gDebugText_Sound_MUS, DEBUG_SOUND_MENU_ITEM_MUS}, + [DEBUG_SOUND_MENU_ITEM_SE] = {gDebugText_Sound_SE, DEBUG_SOUND_MENU_ITEM_SE}, + [DEBUG_SOUND_MENU_ITEM_MUS] = {gDebugText_Sound_MUS, DEBUG_SOUND_MENU_ITEM_MUS}, }; // ******************************* // Menu Actions static void (*const sDebugMenu_Actions_Main[])(u8) = { - [DEBUG_MENU_ITEM_UTILITIES] = DebugAction_OpenUtilitiesMenu, - [DEBUG_MENU_ITEM_SCRIPTS] = DebugAction_OpenScriptsMenu, - [DEBUG_MENU_ITEM_FLAGS] = DebugAction_OpenFlagsMenu, - [DEBUG_MENU_ITEM_VARS] = DebugAction_OpenVariablesMenu, - [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, - [DEBUG_MENU_ITEM_SOUND] = DebugAction_OpenSoundMenu, - [DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, - [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel + [DEBUG_MENU_ITEM_UTILITIES] = DebugAction_OpenUtilitiesMenu, + [DEBUG_MENU_ITEM_SCRIPTS] = DebugAction_OpenScriptsMenu, + [DEBUG_MENU_ITEM_FLAGS] = DebugAction_OpenFlagsMenu, + [DEBUG_MENU_ITEM_VARS] = DebugAction_OpenVariablesMenu, + [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, + [DEBUG_MENU_ITEM_SOUND] = DebugAction_OpenSoundMenu, + [DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, + [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel }; static void (*const sDebugMenu_Actions_Utilities[])(u8) = { - [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = DebugAction_Util_HealParty, - [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, - [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, - [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = DebugAction_Util_RunningShoes, - [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, - [DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY] = DebugAction_Util_CheckWeekDay, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, - [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = DebugAction_Util_Trainer_Name, - [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = DebugAction_Util_Trainer_Gender, - [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id, + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = DebugAction_Util_HealParty, + [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, + [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, + [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = DebugAction_Util_RunningShoes, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, + [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = DebugAction_Util_Trainer_Name, + [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = DebugAction_Util_Trainer_Gender, + [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id, }; static void (*const sDebugMenu_Actions_Scripts[])(u8) = { - [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = DebugAction_Util_Script_1, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = DebugAction_Util_Script_2, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = DebugAction_Util_Script_3, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = DebugAction_Util_Script_4, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = DebugAction_Util_Script_5, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = DebugAction_Util_Script_6, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = DebugAction_Util_Script_7, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = DebugAction_Util_Script_8, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = DebugAction_Util_Script_1, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = DebugAction_Util_Script_2, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = DebugAction_Util_Script_3, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = DebugAction_Util_Script_4, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = DebugAction_Util_Script_5, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = DebugAction_Util_Script_6, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = DebugAction_Util_Script_7, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = DebugAction_Util_Script_8, }; static void (*const sDebugMenu_Actions_Flags[])(u8) = { - [DEBUG_FLAG_MENU_ITEM_FLAGS] = DebugAction_Flags_Flags, - [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = DebugAction_Flags_SetPokedexFlags, - [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = DebugAction_Flags_SwitchDex, - [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = DebugAction_Flags_SwitchNatDex, - [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = DebugAction_Flags_SwitchPokeNav, - [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = DebugAction_Flags_ToggleFlyFlags, - [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = DebugAction_Flags_ToggleBadgeFlags, - [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = DebugAction_Flags_ToggleFrontierPass, - [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = DebugAction_Flags_CollisionOnOff, - [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = DebugAction_Flags_EncounterOnOff, - [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF]= DebugAction_Flags_TrainerSeeOnOff, - [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = DebugAction_Flags_BagUseOnOff, - [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = DebugAction_Flags_CatchingOnOff, + [DEBUG_FLAG_MENU_ITEM_FLAGS] = DebugAction_Flags_Flags, + [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = DebugAction_Flags_SetPokedexFlags, + [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = DebugAction_Flags_SwitchDex, + [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = DebugAction_Flags_SwitchNatDex, + [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = DebugAction_Flags_SwitchPokeNav, + [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = DebugAction_Flags_ToggleFlyFlags, + [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = DebugAction_Flags_ToggleBadgeFlags, + [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = DebugAction_Flags_ToggleFrontierPass, + [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = DebugAction_Flags_CollisionOnOff, + [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = DebugAction_Flags_EncounterOnOff, + [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF] = DebugAction_Flags_TrainerSeeOnOff, + [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = DebugAction_Flags_BagUseOnOff, + [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = DebugAction_Flags_CatchingOnOff, }; static void (*const sDebugMenu_Actions_Vars[])(u8) = { - [DEBUG_VARS_MENU_ITEM_VARS] = DebugAction_Vars_Vars, + [DEBUG_VARS_MENU_ITEM_VARS] = DebugAction_Vars_Vars, }; static void (*const sDebugMenu_Actions_Give[])(u8) = { - [DEBUG_GIVE_MENU_ITEM_ITEM_X] = DebugAction_Give_Item, - [DEBUG_GIVE_MENU_ITEM_ALLTMS] = DebugAction_Give_AllTMs, - [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = DebugAction_Give_PokemonSimple, - [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = DebugAction_Give_PokemonComplex, - [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = DebugAction_Give_MaxMoney, - [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = DebugAction_Give_MaxCoins, - [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS]= DebugAction_Give_MaxBattlePoints, - [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg, - [DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC, - [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, + [DEBUG_GIVE_MENU_ITEM_ITEM_X] = DebugAction_Give_Item, + [DEBUG_GIVE_MENU_ITEM_ALLTMS] = DebugAction_Give_AllTMs, + [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = DebugAction_Give_PokemonSimple, + [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = DebugAction_Give_PokemonComplex, + [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = DebugAction_Give_MaxMoney, + [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = DebugAction_Give_MaxCoins, + [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = DebugAction_Give_MaxBattlePoints, + [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg, + [DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC, + [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, }; static void (*const sDebugMenu_Actions_Sound[])(u8) = { - [DEBUG_SOUND_MENU_ITEM_SE] = DebugAction_Sound_SE, - [DEBUG_SOUND_MENU_ITEM_MUS] = DebugAction_Sound_MUS, + [DEBUG_SOUND_MENU_ITEM_SE] = DebugAction_Sound_SE, + [DEBUG_SOUND_MENU_ITEM_MUS] = DebugAction_Sound_MUS, }; @@ -944,7 +934,6 @@ static void DebugAction_Util_Warp_Warp(u8 taskId) CopyWindowToVram(windowId, 3); - ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); ConvertIntToDecimalStringN(gStringVar2, MAP_GROUPS_COUNT-1, STR_CONV_MODE_LEADING_ZEROS, 2); StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); @@ -965,31 +954,31 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId) if (gMain.newKeys & DPAD_ANY) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > MAP_GROUPS_COUNT-1) - gTasks[taskId].data[3] = MAP_GROUPS_COUNT-1; + if (gTasks[taskId].data[3] > MAP_GROUPS_COUNT - 1) + gTasks[taskId].data[3] = MAP_GROUPS_COUNT - 1; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0) + if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < 2) + if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; } ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); - ConvertIntToDecimalStringN(gStringVar2, MAP_GROUPS_COUNT-1, STR_CONV_MODE_LEADING_ZEROS, 2); + ConvertIntToDecimalStringN(gStringVar2, MAP_GROUPS_COUNT - 1, STR_CONV_MODE_LEADING_ZEROS, 2); StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMapGroup); @@ -1003,7 +992,7 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId) gTasks[taskId].data[4] = 0; ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); - ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]]-1, STR_CONV_MODE_LEADING_ZEROS, 2); + ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1, STR_CONV_MODE_LEADING_ZEROS, 2); StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); @@ -1025,31 +1014,31 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) if (gMain.newKeys & DPAD_ANY) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > max_value-1) - gTasks[taskId].data[3] = max_value-1; + if(gTasks[taskId].data[3] > max_value - 1) + gTasks[taskId].data[3] = max_value - 1; } if(gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0) + if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } if(gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { if(gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; } ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); - ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]]-1, STR_CONV_MODE_LEADING_ZEROS, 2); + ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1, STR_CONV_MODE_LEADING_ZEROS, 2); StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); @@ -1103,7 +1092,8 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId) { gTasks[taskId].data[7] = gTasks[taskId].data[3]; //WARP - SetWarpDestinationToMapWarp(gTasks[taskId].data[5], gTasks[taskId].data[6], gTasks[taskId].data[7]); //If not warp with the number available -> center of map + //If there's no warp with the number available, warp to the center of the map. + SetWarpDestinationToMapWarp(gTasks[taskId].data[5], gTasks[taskId].data[6], gTasks[taskId].data[7]); DoWarp(); ResetInitialPlayerAvatarState(); DebugAction_DestroyExtraWindow(taskId); @@ -1277,7 +1267,7 @@ static void DebugAction_Flags_Flags(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); ConvertIntToHexStringN(gStringVar2, 0, STR_CONV_MODE_LEFT_ALIGN, 3); StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex); - if(FlagGet(0) == TRUE) + if (FlagGet(0) == TRUE) StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); else StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); @@ -1301,38 +1291,38 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) return; } - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { PlaySE(SE_SELECT); gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] >= FLAGS_COUNT){ + if (gTasks[taskId].data[3] >= FLAGS_COUNT){ gTasks[taskId].data[3] = FLAGS_COUNT - 1; } } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { PlaySE(SE_SELECT); gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0){ + if (gTasks[taskId].data[3] < 0){ gTasks[taskId].data[3] = 0; } } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { PlaySE(SE_SELECT); gTasks[taskId].data[4] -= 1; - if(gTasks[taskId].data[4] < 0) + if (gTasks[taskId].data[4] < 0) { gTasks[taskId].data[4] = 0; } } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { PlaySE(SE_SELECT); gTasks[taskId].data[4] += 1; - if(gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_FLAGS-1) + if (gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_FLAGS - 1) { - gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_FLAGS-1; + gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_FLAGS - 1; } } @@ -1341,7 +1331,7 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 3); StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex); - if(FlagGet(gTasks[taskId].data[3]) == TRUE) + if (FlagGet(gTasks[taskId].data[3]) == TRUE) StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); else StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); @@ -1364,44 +1354,41 @@ static void DebugAction_Flags_SetPokedexFlags(u8 taskId) } static void DebugAction_Flags_SwitchDex(u8 taskId) { - if(FlagGet(FLAG_SYS_POKEDEX_GET)) - { - FlagClear(FLAG_SYS_POKEDEX_GET); + if (FlagGet(FLAG_SYS_POKEDEX_GET)) PlaySE(SE_PC_OFF); - }else{ - FlagSet(FLAG_SYS_POKEDEX_GET); + else PlaySE(SE_PC_LOGIN); - } + FlagToggle(FLAG_SYS_POKEDEX_GET); } static void DebugAction_Flags_SwitchNatDex(u8 taskId) { - if(IsNationalPokedexEnabled()) + if (IsNationalPokedexEnabled()) { DisableNationalPokedex(); PlaySE(SE_PC_OFF); - }else{ + } + else + { EnableNationalPokedex(); PlaySE(SE_PC_LOGIN); } } static void DebugAction_Flags_SwitchPokeNav(u8 taskId) { - if(FlagGet(FLAG_SYS_POKENAV_GET)) - { - FlagClear(FLAG_SYS_POKENAV_GET); + if (FlagGet(FLAG_SYS_POKENAV_GET)) PlaySE(SE_PC_OFF); - }else{ - FlagSet(FLAG_SYS_POKENAV_GET); + else PlaySE(SE_PC_LOGIN); - } + FlagToggle(FLAG_SYS_POKENAV_GET); } static void DebugAction_Flags_ToggleFlyFlags(u8 taskId) { // Sound effect - if(FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER)) + if (FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER)) PlaySE(SE_PC_OFF); else PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_VISITED_LITTLEROOT_TOWN); FlagToggle(FLAG_VISITED_OLDALE_TOWN); FlagToggle(FLAG_VISITED_DEWFORD_TOWN); @@ -1424,10 +1411,11 @@ static void DebugAction_Flags_ToggleFlyFlags(u8 taskId) static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId) { // Sound effect - if(FlagGet(FLAG_BADGE08_GET)) + if (FlagGet(FLAG_BADGE08_GET)) PlaySE(SE_PC_OFF); else PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_BADGE01_GET); FlagToggle(FLAG_BADGE02_GET); FlagToggle(FLAG_BADGE03_GET); @@ -1440,7 +1428,7 @@ static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId) static void DebugAction_Flags_ToggleFrontierPass(u8 taskId) { // Sound effect - if(FlagGet(FLAG_SYS_FRONTIER_PASS)) + if (FlagGet(FLAG_SYS_FRONTIER_PASS)) PlaySE(SE_PC_OFF); else PlaySE(SE_PC_LOGIN); @@ -1453,48 +1441,39 @@ static void DebugAction_Flags_CollisionOnOff(u8 taskId) LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else - if(FlagGet(DEBUG_FLAG_NO_COLLISION)) - { - FlagClear(DEBUG_FLAG_NO_COLLISION); + if (FlagGet(DEBUG_FLAG_NO_COLLISION)) PlaySE(SE_PC_OFF); - }else{ - FlagSet(DEBUG_FLAG_NO_COLLISION); + else PlaySE(SE_PC_LOGIN); - } + FlagToggle(DEBUG_FLAG_NO_COLLISION); #endif } static void DebugAction_Flags_EncounterOnOff(u8 taskId) { -#if DEBUG_FLAG_NO_ENCOUNTER == 0 +#if OW_FLAG_NO_ENCOUNTER == 0 Debug_DestroyMenu(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else - if(FlagGet(DEBUG_FLAG_NO_ENCOUNTER)) - { - FlagClear(DEBUG_FLAG_NO_ENCOUNTER); + if (FlagGet(OW_FLAG_NO_ENCOUNTER)) PlaySE(SE_PC_OFF); - }else{ - FlagSet(DEBUG_FLAG_NO_ENCOUNTER); + else PlaySE(SE_PC_LOGIN); - } + FlagToggle(OW_FLAG_NO_ENCOUNTER); #endif } static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) { -#if DEBUG_FLAG_NO_TRAINER_SEE == 0 +#if OW_FLAG_NO_TRAINER_SEE == 0 Debug_DestroyMenu(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else - if(FlagGet(DEBUG_FLAG_NO_TRAINER_SEE)) - { - FlagClear(DEBUG_FLAG_NO_TRAINER_SEE); + if (FlagGet(OW_FLAG_NO_TRAINER_SEE)) PlaySE(SE_PC_OFF); - }else{ - FlagSet(DEBUG_FLAG_NO_TRAINER_SEE); + else PlaySE(SE_PC_LOGIN); - } + FlagToggle(OW_FLAG_NO_TRAINER_SEE); #endif } static void DebugAction_Flags_BagUseOnOff(u8 taskId) @@ -1504,14 +1483,11 @@ static void DebugAction_Flags_BagUseOnOff(u8 taskId) LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else - if(FlagGet(B_FLAG_NO_BAG_USE)) - { - FlagClear(B_FLAG_NO_BAG_USE); + if (FlagGet(B_FLAG_NO_BAG_USE)) PlaySE(SE_PC_OFF); - }else{ - FlagSet(B_FLAG_NO_BAG_USE); + else PlaySE(SE_PC_LOGIN); - } + FlagToggle(B_FLAG_NO_BAG_USE); #endif } static void DebugAction_Flags_CatchingOnOff(u8 taskId) @@ -1521,14 +1497,11 @@ static void DebugAction_Flags_CatchingOnOff(u8 taskId) LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else - if(FlagGet(B_FLAG_NO_CATCHING)) - { - FlagClear(B_FLAG_NO_CATCHING); + if (FlagGet(B_FLAG_NO_CATCHING)) PlaySE(SE_PC_OFF); - }else{ - FlagSet(B_FLAG_NO_CATCHING); + else PlaySE(SE_PC_LOGIN); - } + FlagToggle(B_FLAG_NO_CATCHING); #endif } @@ -1560,42 +1533,36 @@ static void DebugAction_Vars_Vars(u8 taskId) gTasks[taskId].func = DebugAction_Vars_Select; gTasks[taskId].data[2] = windowId; - gTasks[taskId].data[3] = VARS_START; //Current Variable - gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[3] = VARS_START; //Current Variable + gTasks[taskId].data[4] = 0; //Digit Selected gTasks[taskId].data[5] = 0; //Current Variable VALUE } static void DebugAction_Vars_Select(u8 taskId) { - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > VARS_END){ + if(gTasks[taskId].data[3] > VARS_END) gTasks[taskId].data[3] = VARS_END; - } } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < VARS_START){ + if (gTasks[taskId].data[3] < VARS_START) gTasks[taskId].data[3] = VARS_START; - } } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { gTasks[taskId].data[4] -= 1; if(gTasks[taskId].data[4] < 0) - { gTasks[taskId].data[4] = 0; - } } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { gTasks[taskId].data[4] += 1; - if(gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_VARIABLES-1) - { - gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_VARIABLES-1; - } + if (gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_VARIABLES - 1) + gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_VARIABLES - 1; } if (gMain.newKeys & DPAD_ANY) @@ -1653,30 +1620,30 @@ static void DebugAction_Vars_SetValue(u8 taskId) if (gTasks[taskId].data[6] + sPowersOfTen[gTasks[taskId].data[4]] <= 32000) gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]]; else - gTasks[taskId].data[6] = 32000-1; - if(gTasks[taskId].data[6] >= 32000){ - gTasks[taskId].data[6] = 32000-1; - } + gTasks[taskId].data[6] = 32000 - 1; + + if (gTasks[taskId].data[6] >= 32000) + gTasks[taskId].data[6] = 32000 - 1; } if(gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[6] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[6] < 0){ + if (gTasks[taskId].data[6] < 0){ gTasks[taskId].data[6] = 0; } } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { gTasks[taskId].data[4] -= 1; - if(gTasks[taskId].data[4] < 0) + if (gTasks[taskId].data[4] < 0) { gTasks[taskId].data[4] = 0; } } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { gTasks[taskId].data[4] += 1; - if(gTasks[taskId].data[4] > 4) + if (gTasks[taskId].data[4] > 4) { gTasks[taskId].data[4] = 4; } @@ -1751,26 +1718,26 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; if(gTasks[taskId].data[3] >= ITEMS_COUNT) gTasks[taskId].data[3] = ITEMS_COUNT - 1; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 1) + if (gTasks[taskId].data[3] < 1) gTasks[taskId].data[3] = 1; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { if(gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS-1) + if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1) gTasks[taskId].data[4] += 1; } @@ -1822,26 +1789,26 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] >= 100) + if (gTasks[taskId].data[3] >= 100) gTasks[taskId].data[3] = 99; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 1) + if (gTasks[taskId].data[3] < 1) gTasks[taskId].data[3] = 1; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < 2) + if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; } @@ -1880,9 +1847,11 @@ static void DebugAction_Give_AllTMs(u8 taskId) { u16 i; PlayFanfare(MUS_OBTAIN_TMHM); - for (i = ITEM_TM01; i <= ITEM_TM50; i++) - if(!CheckBagHasItem(i, 1)) + for (i = ITEM_TM01; i <= ITEM_HM08; i++) + { + if (ItemIdToBattleMoveId(i) != MOVE_NONE && !CheckBagHasItem(i, 1)) AddBagItem(i, 1); + } Debug_DestroyMenu(taskId); ScriptContext_Enable(); } @@ -1937,12 +1906,7 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) gTasks[taskId].data[5] = 0; //Complex? FreeMonIconPalettes(); //Free space for new pallete LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon - #ifndef POKEMON_EXPANSION - gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite - #endif - #ifdef POKEMON_EXPANSION - gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite - #endif + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID } static void DebugAction_Give_PokemonComplex(u8 taskId) @@ -1972,7 +1936,6 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); - gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId; gTasks[taskId].data[2] = windowId; gTasks[taskId].data[3] = 1; //Current ID @@ -1980,12 +1943,7 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) gTasks[taskId].data[5] = 1; //Complex? FreeMonIconPalettes(); //Free space for new palletes LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon - #ifndef POKEMON_EXPANSION - gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite - #endif - #ifdef POKEMON_EXPANSION - gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite - #endif + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID gTasks[taskId].data[7] = 0; //iterator } @@ -1996,30 +1954,26 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > SPECIES_CELEBI && gTasks[taskId].data[3] < SPECIES_TREECKO) - gTasks[taskId].data[3] = SPECIES_TREECKO; - if(gTasks[taskId].data[3] >= NUM_SPECIES) + if (gTasks[taskId].data[3] >= NUM_SPECIES) gTasks[taskId].data[3] = NUM_SPECIES - 1; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < SPECIES_TREECKO && gTasks[taskId].data[3] > SPECIES_CELEBI) - gTasks[taskId].data[3] = SPECIES_CELEBI; - if(gTasks[taskId].data[3] < 1) + if (gTasks[taskId].data[3] < 1) gTasks[taskId].data[3] = 1; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS-1) + if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1) gTasks[taskId].data[4] += 1; } @@ -2033,12 +1987,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); FreeMonIconPalettes(); //Free space for new pallete LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon - #ifndef POKEMON_EXPANSION - gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0, TRUE); //Create pokemon sprite - #endif - #ifdef POKEMON_EXPANSION - gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite - #endif + gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite gSprites[gTasks[taskId].data[6]].oam.priority = 0; } @@ -2071,26 +2020,26 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > 100) + if (gTasks[taskId].data[3] > 100) gTasks[taskId].data[3] = 100; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 1) + if (gTasks[taskId].data[3] < 1) gTasks[taskId].data[3] = 1; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < 2) + if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; } @@ -2143,20 +2092,20 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > 1) + if (gTasks[taskId].data[3] > 1) gTasks[taskId].data[3] = 1; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0) + if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } - if(gTasks[taskId].data[3] == 1) + if (gTasks[taskId].data[3] == 1) StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); else StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); @@ -2194,13 +2143,13 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > NUM_NATURES-1) + if (gTasks[taskId].data[3] > NUM_NATURES-1) gTasks[taskId].data[3] = NUM_NATURES-1; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if(gTasks[taskId].data[3] < 0) @@ -2242,26 +2191,23 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) { u8 abilityId; - u8 abilityCount = 2 - 1; //-1 for proper iteration + u8 abilityCount = NUM_ABILITY_SLOTS - 1; //-1 for proper iteration u8 i = 0; - #ifdef POKEMON_EXPANSION - abilityCount = NUM_ABILITY_SLOTS - 1; - #endif if (gMain.newKeys & DPAD_ANY) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > abilityCount) + if (gTasks[taskId].data[3] > abilityCount) gTasks[taskId].data[3] = abilityCount; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0) + if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } @@ -2305,26 +2251,26 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > 31) + if (gTasks[taskId].data[3] > 31) gTasks[taskId].data[3] = 31; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0) + if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < 2) + if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; } @@ -2444,26 +2390,26 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] >= MOVES_COUNT) + if (gTasks[taskId].data[3] >= MOVES_COUNT) gTasks[taskId].data[3] = MOVES_COUNT - 1; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0) + if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < 3) + if (gTasks[taskId].data[4] < 3) gTasks[taskId].data[4] += 1; } @@ -2583,12 +2529,11 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu IVs[4] = sDebugMonData->mon_iv_satk; IVs[5] = sDebugMonData->mon_iv_sdef; - //Nature if (nature == NUM_NATURES || nature == 0xFF) nature = Random() % NUM_NATURES; - //Shinyness + //Shininess if (isShiny == 1) { u32 personality; @@ -2608,21 +2553,9 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu else CreateMonWithNature(&mon, species, level, 32, nature); - //EVs/IVs + //IVs for (i = 0; i < NUM_STATS; i++) { - // ev - // if (evs[i] != 0xFF && evTotal < 510) - // { - // // only up to 510 evs - // if ((evTotal + evs[i]) > 510) - // evs[i] = (510 - evTotal); - - // evTotal += evs[i]; - // SetMonData(&mon, MON_DATA_HP_EV + i, &evs[i]); - // } - - // iv iv_val = IVs[i]; if (iv_val != 32 && iv_val != 0xFF) SetMonData(&mon, MON_DATA_HP_IV + i, &iv_val); @@ -2648,17 +2581,7 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu SetMonData(&mon, MON_DATA_ABILITY_NUM, &abilityNum); - //ball - // if (ball <= POKEBALL_COUNT) - // SetMonData(&mon, MON_DATA_POKEBALL, &ball); - - //item - // heldItem[0] = item; - // heldItem[1] = item >> 8; - // SetMonData(&mon, MON_DATA_HELD_ITEM, heldItem); - // give player the mon - //sentToPc = GiveMonToPlayer(&mon); SetMonData(&mon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName); SetMonData(&mon, MON_DATA_OT_GENDER, &gSaveBlock2Ptr->playerGender); for (i = 0; i < PARTY_SIZE; i++) @@ -2805,26 +2728,26 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId) { if (gMain.newKeys & DPAD_ANY) { - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > END_SE) + if (gTasks[taskId].data[3] > END_SE) gTasks[taskId].data[3] = END_SE; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 1) + if (gTasks[taskId].data[3] < 1) gTasks[taskId].data[3] = 1; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS-1) + if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1) gTasks[taskId].data[4] += 1; } @@ -2882,26 +2805,26 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) { if (gMain.newKeys & DPAD_ANY) { - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > END_MUS) + if (gTasks[taskId].data[3] > END_MUS) gTasks[taskId].data[3] = END_MUS; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < START_MUS) + if (gTasks[taskId].data[3] < START_MUS) gTasks[taskId].data[3] = START_MUS; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } - if(gMain.newKeys & DPAD_RIGHT) + if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS-1) + if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1) gTasks[taskId].data[4] += 1; } diff --git a/src/item_use.c b/src/item_use.c index a0b4233fff..cb85ae3e35 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -9,7 +9,6 @@ #include "bike.h" #include "coins.h" #include "data.h" -#include "debug.h" #include "event_data.h" #include "event_object_lock.h" #include "event_object_movement.h" diff --git a/src/trainer_see.c b/src/trainer_see.c index d44e5e46fb..b720a59d90 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -1,6 +1,5 @@ #include "global.h" #include "battle_setup.h" -#include "debug.h" #include "event_data.h" #include "event_object_movement.h" #include "field_effect.h" From 1287c3d2636a411a11ec96f32e7bd906c5a779aa Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 3 Sep 2022 21:27:29 -0400 Subject: [PATCH 089/155] Fixed call to ItemIdToBattleMoveId --- src/debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/debug.c b/src/debug.c index 5d861640cd..f889ed5d29 100644 --- a/src/debug.c +++ b/src/debug.c @@ -33,6 +33,7 @@ #include "new_game.h" #include "overworld.h" #include "palette.h" +#include "party_menu.h" #include "pokedex.h" #include "pokemon.h" #include "pokemon_icon.h" From 7500435a8040c1ae3b62cf47eac6e1e9a5c60fbe Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 4 Sep 2022 21:24:12 -0300 Subject: [PATCH 090/155] Implemented review changes from https://github.com/pret/pokefirered/pull/548 --- src/battle_controller_link_opponent.c | 4 ---- src/battle_controller_opponent.c | 2 -- src/battle_controller_recorded_opponent.c | 4 ---- src/battle_controllers.c | 15 ++++----------- src/battle_main.c | 10 +++++----- src/battle_tower.c | 2 +- src/berry_crush.c | 2 +- src/dodrio_berry_picking.c | 4 ++-- src/link_rfu_2.c | 2 +- src/minigame_countdown.c | 2 +- src/mystery_event_menu.c | 2 +- src/mystery_gift_menu.c | 4 ++-- src/record_mixing.c | 2 +- src/reshow_battle_screen.c | 2 +- src/trade.c | 2 +- src/union_room.c | 4 ++-- 16 files changed, 23 insertions(+), 40 deletions(-) diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index a9629f6622..0f1ce1b17f 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -386,13 +386,9 @@ static void CompleteOnHealthbarDone(void) SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); if (hpValue != -1) - { UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT); - } else - { LinkOpponentBufferExecCompleted(); - } } static void HideHealthboxAfterMonFaint(void) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 4c274f17e3..b3554dc5af 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -397,9 +397,7 @@ static void CompleteOnHealthbarDone(void) s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); if (hpValue != -1) - { UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT); - } else OpponentBufferExecCompleted(); } diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 0fb14f20d5..872a61c0e7 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -373,13 +373,9 @@ static void CompleteOnHealthbarDone(void) SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); if (hpValue != -1) - { UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT); - } else - { RecordedOpponentBufferExecCompleted(); - } } static void HideHealthboxAfterMonFaint(void) diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 20681b27ce..e5cfb3be68 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -660,18 +660,12 @@ static void PrepareBufferDataTransfer(u8 bufferId, u8 *data, u16 size) switch (bufferId) { case BUFFER_A: - for (i = 0; i < size; i++) - { + for (i = 0; i < size; data++, i++) gBattleBufferA[gActiveBattler][i] = *data; - data++; - } break; case BUFFER_B: - for (i = 0; i < size; i++) - { + for (i = 0; i < size; data++, i++) gBattleBufferB[gActiveBattler][i] = *data; - data++; - } break; } } @@ -808,8 +802,7 @@ static void Task_HandleSendLinkBuffersData(u8 taskId) } break; case 5: - gTasks[taskId].data[13]--; - if (gTasks[taskId].data[13] == 0) + if (--gTasks[taskId].data[13] == 0) { gTasks[taskId].data[13] = 1; gTasks[taskId].data[11] = 3; @@ -824,7 +817,7 @@ void TryReceiveLinkBattleData(void) s32 j; u8 *recvBuffer; - if (gReceivedRemoteLinkPlayers != 0 && (gBattleTypeFlags & BATTLE_TYPE_LINK_IN_BATTLE)) + if (gReceivedRemoteLinkPlayers && (gBattleTypeFlags & BATTLE_TYPE_LINK_IN_BATTLE)) { DestroyTask_RfuIdle(); for (i = 0; i < GetLinkPlayerCount(); i++) diff --git a/src/battle_main.c b/src/battle_main.c index ad4ea88b9e..52a1005989 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -967,7 +967,7 @@ static void CB2_HandleStartBattle(void) case 1: if (gBattleTypeFlags & BATTLE_TYPE_LINK) { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { if (IsLinkTaskFinished()) { @@ -1175,7 +1175,7 @@ static void CB2_HandleStartMultiPartnerBattle(void) case 1: if (gBattleTypeFlags & BATTLE_TYPE_LINK) { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { u8 language; @@ -1442,7 +1442,7 @@ static void CB2_PreInitMultiBattle(void) switch (gBattleCommunication[MULTIUSE_STATE]) { case 0: - if (gReceivedRemoteLinkPlayers != 0 && IsLinkTaskFinished()) + if (gReceivedRemoteLinkPlayers && IsLinkTaskFinished()) { sMultiPartnerPartyBuffer = Alloc(sizeof(gMultiPartnerParty)); SetMultiPartnerMenuParty(0); @@ -1578,7 +1578,7 @@ static void CB2_HandleStartMultiBattle(void) case 1: if (gBattleTypeFlags & BATTLE_TYPE_LINK) { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { if (IsLinkTaskFinished()) { @@ -5183,7 +5183,7 @@ static void ReturnFromBattleToOverworld(void) PartySpreadPokerus(gPlayerParty); } - if (gBattleTypeFlags & BATTLE_TYPE_LINK && gReceivedRemoteLinkPlayers != 0) + if (gBattleTypeFlags & BATTLE_TYPE_LINK && gReceivedRemoteLinkPlayers) return; gSpecialVar_Result = gBattleOutcome; diff --git a/src/battle_tower.c b/src/battle_tower.c index bebbdee7da..62feb7f838 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -2635,7 +2635,7 @@ static void LoadLinkMultiOpponentsData(void) gTrainerBattleOpponent_B = gSaveBlock2Ptr->frontier.trainerIds[battleNum * 2 + 1]; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1); - if (gReceivedRemoteLinkPlayers != 0 && gWirelessCommType == 0) + if (gReceivedRemoteLinkPlayers && gWirelessCommType == 0) gSpecialVar_Result = 4; else gSpecialVar_Result = 6; diff --git a/src/berry_crush.c b/src/berry_crush.c index 19c03391d3..d93dbe80ad 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -3428,7 +3428,7 @@ static u32 Cmd_CloseLink(struct BerryCrushGame *game, u8 *args) SetCloseLinkCallback(); break; case 2: - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) return 0; game->nextCmd = CMD_QUIT; RunOrScheduleCommand(CMD_HIDE_GAME, SCHEDULE_CMD, NULL); diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 11bf12925b..a3710e04fb 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -665,7 +665,7 @@ void StartDodrioBerryPicking(u16 partyId, void (*exitCallback)(void)) { sExitingGame = FALSE; - if (gReceivedRemoteLinkPlayers != 0 && (sGame = AllocZeroed(sizeof(*sGame)))) + if (gReceivedRemoteLinkPlayers && (sGame = AllocZeroed(sizeof(*sGame)))) { ResetTasksAndSprites(); InitDodrioGame(sGame); @@ -775,7 +775,7 @@ static void Task_StartDodrioGame(u8 taskId) case 3: if (IsLinkTaskFinished()) { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { LoadWirelessStatusIndicatorSpriteGfx(); CreateWirelessStatusIndicatorSprite(0, 0); diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c index c54d6c3d34..437cec2fdb 100644 --- a/src/link_rfu_2.c +++ b/src/link_rfu_2.c @@ -1115,7 +1115,7 @@ static void RfuHandleReceiveCommand(u8 unused) { gRfu.recvBlock[i].receiving = RECV_STATE_FINISHED; Rfu_SetBlockReceivedFlag(i); - if (GetHostRfuGameData()->activity == (ACTIVITY_CHAT | IN_UNION_ROOM) && gReceivedRemoteLinkPlayers != 0 && gRfu.parentChild == MODE_CHILD) + if (GetHostRfuGameData()->activity == (ACTIVITY_CHAT | IN_UNION_ROOM) && gReceivedRemoteLinkPlayers && gRfu.parentChild == MODE_CHILD) ValidateAndReceivePokemonSioInfo(gBlockRecvBuffer); } } diff --git a/src/minigame_countdown.c b/src/minigame_countdown.c index 5aaed0cb23..b4d3b6558b 100644 --- a/src/minigame_countdown.c +++ b/src/minigame_countdown.c @@ -315,7 +315,7 @@ static void Task_StaticCountdown_Run(u8 taskId) u16 packet[RFU_PACKET_SIZE]; s16 *data = gTasks[taskId].data; - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { // Read link timer if (gRecvCmds[0][1] == LINKCMD_COUNTDOWN) diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index c35fe8ed80..b6610a6403 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -201,7 +201,7 @@ static void CB2_MysteryEventMenu(void) case 6: if (IsLinkConnectionEstablished()) { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { if (GetLinkPlayerDataExchangeStatusTimed(2, 2) == EXCHANGE_DIFF_SELECTIONS) { diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c index b970711fd3..92e544a27b 100644 --- a/src/mystery_gift_menu.c +++ b/src/mystery_gift_menu.c @@ -1232,7 +1232,7 @@ static void Task_MysteryGift(u8 taskId) data->state = MG_STATE_CLIENT_LINK_WAIT; break; case MG_STATE_CLIENT_LINK_WAIT: - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { ClearScreenInBg0(TRUE); data->state = MG_STATE_CLIENT_COMMUNICATING; @@ -1528,7 +1528,7 @@ static void Task_MysteryGift(u8 taskId) } break; case MG_STATE_SERVER_LINK_WAIT: - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { ClearScreenInBg0(TRUE); data->state = MG_STATE_SERVER_LINK_START; diff --git a/src/record_mixing.c b/src/record_mixing.c index 3a831c8ce1..b03d7be2f3 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -444,7 +444,7 @@ static void Task_MixingRecordsRecv(u8 taskId) } break; case 1: // wait for handshake - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { ConvertIntToDecimalStringN(gStringVar1, GetMultiplayerId_(), STR_CONV_MODE_LEADING_ZEROS, 2); task->tState = 5; diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index 3a087b7d78..4217d78c73 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -149,7 +149,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void) ActionSelectionCreateCursorAt(gActionSelectionCursor[gBattlerInMenuId], 0); - if (gWirelessCommType != 0 && gReceivedRemoteLinkPlayers != 0) + if (gWirelessCommType != 0 && gReceivedRemoteLinkPlayers) { LoadWirelessStatusIndicatorSpriteGfx(); CreateWirelessStatusIndicatorSprite(0, 0); diff --git a/src/trade.c b/src/trade.c index 7c712b5803..e24051e041 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2391,7 +2391,7 @@ s32 GetGameProgressForLinkTrade(void) s32 isGameFrLg; u16 version; - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { isGameFrLg = 0; version = (gLinkPlayers[GetMultiplayerId() ^ 1].version & 0xFF); diff --git a/src/union_room.c b/src/union_room.c index 67d1059ee0..7d14176717 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -702,7 +702,7 @@ static void Task_TryBecomeLinkLeader(u8 taskId) } else { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { if (IsActivityWithVariableGroupSize(gPlayerCurrActivity)) GetOtherPlayersInfoFlags(); @@ -2047,7 +2047,7 @@ static void Task_SendMysteryGift(u8 taskId) { data->state = 13; } - else if (gReceivedRemoteLinkPlayers != 0) + else if (gReceivedRemoteLinkPlayers) { UpdateGameData_GroupLockedIn(TRUE); data->state++; From 6cab795c5c8f6e35992bee8689379461c50b8db1 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 5 Sep 2022 11:02:44 +0200 Subject: [PATCH 091/155] Update include/constants/overworld_config.h Co-authored-by: Eduardo Quezada D'Ottone --- include/constants/overworld_config.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/constants/overworld_config.h b/include/constants/overworld_config.h index 6d094d60f5..50f45933df 100644 --- a/include/constants/overworld_config.h +++ b/include/constants/overworld_config.h @@ -1,14 +1,18 @@ #ifndef GUARD_CONSTANTS_OVERWORLD_CONFIG_H #define GUARD_CONSTANTS_OVERWORLD_CONFIG_H +// Overworld flags +#define OW_FLAG_NO_ENCOUNTER 0 // If this flag is set, wild encounters will be disabled. +#define OW_FLAG_NO_TRAINER_SEE 0 // If this flag is set, trainers will not battle the player unless they're talked to. + // Debug options -#define DEBUG_SYSTEM_ENABLE TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by pressing R plus START. -#define DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (replaces the exit entry). +#define DEBUG_SYSTEM_ENABLE TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by holding R and pressing START while in the overworld by default. +#define DEBUG_SYSTEM_HELD_KEYS (R_BUTTON) // The keys required to be held to open the debug menu. +#define DEBUG_SYSTEM_TRIGGER_EVENT pressedStartButton // The event that opens the menu when holding the key(s) defined in DEBUG_SYSTEM_HELD_KEYS. +#define DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (above Pokédex). // Replace the used flags with others or disable with a 0 #define DEBUG_FLAG_NO_COLLISION 0 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used. -#define DEBUG_FLAG_NO_ENCOUNTER 0 // If this flag is set, the debug function in the Utility submenu to disable wild encounters can be used. -#define DEBUG_FLAG_NO_TRAINER_SEE 0 // If this flag is set, the debug function in the Utility submenu to disable battles with trainer can be used. #define DEBUG_FLAG_PC_FROM_DEBUG_MENU 0 // If this flag is set, the debug function in debug menu to access the player PC works. #endif // GUARD_CONSTANTS_OVERWORLD_CONFIG_H From 0b3eddc9a4529d34debd2521b8d11dcdc2a38a96 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 5 Sep 2022 11:03:01 +0200 Subject: [PATCH 092/155] Update src/field_control_avatar.c Co-authored-by: Eduardo Quezada D'Ottone --- src/field_control_avatar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 76503a85a2..0494c52d81 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -132,10 +132,10 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys) input->dpadDirection = DIR_EAST; #if DEBUG_SYSTEM_ENABLE == TRUE && DEBUG_SYSTEM_IN_MENU == FALSE - if ((heldKeys & R_BUTTON) && input->pressedStartButton) + if ((heldKeys & DEBUG_SYSTEM_HELD_KEYS) && input->DEBUG_SYSTEM_TRIGGER_EVENT) { input->input_field_1_2 = TRUE; - input->pressedStartButton = FALSE; + input->DEBUG_SYSTEM_TRIGGER_EVENT = FALSE; } #endif } From 57296dde71950e350b5354685c4c074043505cfc Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 5 Sep 2022 11:03:23 +0200 Subject: [PATCH 093/155] Update src/field_control_avatar.c Co-authored-by: Eduardo Quezada D'Ottone --- src/field_control_avatar.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 0494c52d81..d407cc0279 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -686,10 +686,8 @@ void RestartWildEncounterImmunitySteps(void) static bool8 CheckStandardWildEncounter(u16 metatileBehavior) { -#if DEBUG_SYSTEM_ENABLE == TRUE - if (FlagGet(DEBUG_FLAG_NO_ENCOUNTER)) + if (FlagGet(OW_FLAG_NO_ENCOUNTER)) return FALSE; -#endif if (sWildEncounterImmunitySteps < 4) { From 7696a78760016db2cd13a101cf5ca79576747583 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 5 Sep 2022 11:04:21 +0200 Subject: [PATCH 094/155] Update src/trainer_see.c Co-authored-by: Eduardo Quezada D'Ottone --- src/trainer_see.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/trainer_see.c b/src/trainer_see.c index b720a59d90..41534a55d8 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -192,10 +192,8 @@ bool8 CheckForTrainersWantingBattle(void) { u8 i; -#if DEBUG_SYSTEM_ENABLE == TRUE - if (FlagGet(DEBUG_FLAG_NO_TRAINER_SEE)) + if (FlagGet(OW_FLAG_NO_TRAINER_SEE)) return FALSE; -#endif gNoOfApproachingTrainers = 0; gApproachingTrainerId = 0; From 40e33799211c65e8b88fa97244733f728146e760 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 5 Sep 2022 11:15:18 +0200 Subject: [PATCH 095/155] removed music expansion songs, added newline, removed all weekday remains --- src/debug.c | 203 +--------------------------------------------------- 1 file changed, 2 insertions(+), 201 deletions(-) diff --git a/src/debug.c b/src/debug.c index f889ed5d29..9e8a9b5b89 100644 --- a/src/debug.c +++ b/src/debug.c @@ -78,7 +78,6 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_SAVEBLOCK, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK, - DEBUG_UTIL_MENU_ITEM_CHECKWEEKDAY, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER, @@ -214,7 +213,6 @@ static void DebugAction_Util_PoisonMons(u8 taskId); static void DebugAction_Util_CheckSaveBlock(u8); static void DebugAction_Util_CheckWallClock(u8); static void DebugAction_Util_SetWallClock(u8); -static void DebugAction_Util_CheckWeekDay(u8); static void DebugAction_Util_WatchCredits(u8); static void DebugAction_Util_Trainer_Name(u8); static void DebugAction_Util_Trainer_Gender(u8); @@ -321,7 +319,6 @@ static const u8 gDebugText_Util_PoisonMons[] = _("Poison all mons" static const u8 gDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); static const u8 gDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); static const u8 gDebugText_Util_SetWallClock[] = _("Set Wall Clock"); -static const u8 gDebugText_Util_CheckWeekDay[] = _("Check Week Day"); static const u8 gDebugText_Util_WatchCredits[] = _("Watch Credits"); static const u8 gDebugText_Util_Trainer_Name[] = _("Trainer name"); static const u8 gDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); @@ -1161,14 +1158,6 @@ static void DebugAction_Util_SetWallClock(u8 taskId) LockPlayerFieldControls(); ScriptContext_SetupScript(PlayersHouse_2F_EventScript_SetWallClock); } -static void DebugAction_Util_CheckWeekDay(u8 taskId) -{ - //StringCopy(gStringVar4, GetDayOfWeekString(gLocalTime.dayOfWeek)); - Debug_DestroyMenu(taskId); - //LockPlayerFieldControls(); - //ScriptContext_SetupScript(Debug_ShowFieldMessageStringVar4); - ScriptContext_Enable(); -} static void DebugAction_Util_WatchCredits(u8 taskId) { struct Task* task = &gTasks[taskId]; @@ -2212,7 +2201,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) gTasks[taskId].data[3] = 0; } - while (GetAbilityBySpecies(sDebugMonData->mon_speciesId, gTasks[taskId].data[3] - i) == ABILITY_NONE) + while (GetAbilityBySpecies(sDebugMonData->mon_speciesId, gTasks[taskId].data[3] - i) == ABILITY_NONE && gTasks[taskId].data[3] - i < NUM_ABILITY_SLOTS) { i++; } @@ -3060,194 +3049,6 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) X(MUS_RG_TRAINER_TOWER, "MUS-RG-TRAINER-TOWER") \ X(MUS_RG_SLOW_PALLET, "MUS-RG-SLOW-PALLET") \ X(MUS_RG_TEACHY_TV_MENU, "MUS-RG-TEACHY-TV-MENU") \ - X(DP_SEQ_TITLE00 , "DP-SEQ-TITLE00") \ - X(DP_SEQ_TITLE01 , "DP-SEQ-TITLE01") \ - X(DP_SEQ_OPENING , "DP-SEQ-OPENING") \ - X(DP_SEQ_TV_HOUSOU , "DP-SEQ-TV-HOUSOU") \ - X(DP_SEQ_TV_END , "DP-SEQ-TV-END") \ - X(DP_SEQ_TOWN01_D , "DP-SEQ-TOWN01-D") \ - X(DP_SEQ_TOWN01_N , "DP-SEQ-TOWN01-N") \ - X(DP_SEQ_THE_RIV , "DP-SEQ-THE-RIV") \ - X(DP_SEQ_ROAD_A_D , "DP-SEQ-ROAD-A-D") \ - X(DP_SEQ_ROAD_A_N , "DP-SEQ-ROAD-A-N") \ - X(DP_SEQ_D_LAKE , "DP-SEQ-D-LAKE") \ - X(DP_SEQ_THE_EVENT01, "DP-SEQ-THE-EVENT01") \ - X(DP_SEQ_BA_POKE , "DP-SEQ-BA-POKE") \ - X(DP_SEQ_WINPOKE , "DP-SEQ-WINPOKE") \ - X(DP_SEQ_THE_GIRL , "DP-SEQ-THE-GIRL") \ - X(DP_SEQ_THE_BOY , "DP-SEQ-THE-BOY") \ - X(DP_SEQ_FANFA4 , "DP-SEQ-FANFA4") \ - X(DP_SEQ_TOWN02_D , "DP-SEQ-TOWN02-D") \ - X(DP_SEQ_TOWN02_N , "DP-SEQ-TOWN02-N") \ - X(DP_SEQ_KENKYUJO , "DP-SEQ-KENKYUJO") \ - X(DP_SEQ_TSURETEKE , "DP-SEQ-TSURETEKE") \ - X(DP_SEQ_PC_01 , "DP-SEQ-PC-01") \ - X(DP_SEQ_PC_02 , "DP-SEQ-PC-02") \ - X(DP_SEQ_ASA , "DP-SEQ-ASA") \ - X(DP_SEQ_EYE_BOY , "DP-SEQ-EYE-BOY") \ - X(DP_SEQ_EYE_GIRL , "DP-SEQ-EYE-GIRL") \ - X(DP_SEQ_BA_TRAIN , "DP-SEQ-BA-TRAIN") \ - X(DP_SEQ_WINTRAIN , "DP-SEQ-WINTRAIN") \ - X(DP_SEQ_CITY01_D , "DP-SEQ-CITY01-D") \ - X(DP_SEQ_CITY01_N , "DP-SEQ-CITY01-N") \ - X(DP_SEQ_FANFA3 , "DP-SEQ-FANFA3") \ - X(DP_SEQ_FS , "DP-SEQ-FS") \ - X(DP_SEQ_ROAD_B_D , "DP-SEQ-ROAD-B-D") \ - X(DP_SEQ_ROAD_B_N , "DP-SEQ-ROAD-B-N") \ - X(DP_SEQ_BA_RIVAL , "DP-SEQ-BA-RIVAL") \ - X(DP_SEQ_D_05 , "DP-SEQ-D-05") \ - X(DP_SEQ_WAZA , "DP-SEQ-WAZA") \ - X(DP_SEQ_CITY03_D , "DP-SEQ-CITY03-D") \ - X(DP_SEQ_CITY03_N , "DP-SEQ-CITY03-N") \ - X(DP_SEQ_D_04 , "DP-SEQ-D-04") \ - X(DP_SEQ_GYM , "DP-SEQ-GYM") \ - X(DP_SEQ_BA_GYM , "DP-SEQ-BA-GYM") \ - X(DP_SEQ_WINTGYM , "DP-SEQ-WINTGYM") \ - X(DP_SEQ_BADGE , "DP-SEQ-BADGE") \ - X(DP_SEQ_EYE_KID , "DP-SEQ-EYE-KID") \ - X(DP_SEQ_FANFA1 , "DP-SEQ-FANFA1") \ - X(DP_SEQ_TOWN03_D , "DP-SEQ-TOWN03-D") \ - X(DP_SEQ_TOWN03_N , "DP-SEQ-TOWN03-N") \ - X(DP_SEQ_KINOMI , "DP-SEQ-KINOMI") \ - X(DP_SEQ_ROAD_C_D , "DP-SEQ-ROAD-C-D") \ - X(DP_SEQ_ROAD_C_N , "DP-SEQ-ROAD-C-N") \ - X(DP_SEQ_EYE_GINGA , "DP-SEQ-EYE-GINGA") \ - X(DP_SEQ_BA_GINGA , "DP-SEQ-BA-GINGA") \ - X(DP_SEQ_D_02 , "DP-SEQ-D-02") \ - X(DP_SEQ_GONIN , "DP-SEQ-GONIN") \ - X(DP_SEQ_CITY04_D , "DP-SEQ-CITY04-D") \ - X(DP_SEQ_CITY04_N , "DP-SEQ-CITY04-N") \ - X(DP_SEQ_D_GINLOBBY , "DP-SEQ-D-GINLOBBY") \ - X(DP_SEQ_BA_GINGA3 , "DP-SEQ-BA-GINGA3") \ - X(DP_SEQ_WINGINGA , "DP-SEQ-WINGINGA") \ - X(DP_SEQ_SHINKA , "DP-SEQ-SHINKA") \ - X(DP_SEQ_FANFA5 , "DP-SEQ-FANFA5") \ - X(DP_SEQ_BICYCLE , "DP-SEQ-BICYCLE") \ - X(DP_SEQ_EYE_SPORT , "DP-SEQ-EYE-SPORT") \ - X(DP_SEQ_ROAD_D_D , "DP-SEQ-ROAD-D-D") \ - X(DP_SEQ_ROAD_D_N , "DP-SEQ-ROAD-D-N") \ - X(DP_SEQ_CITY05_D , "DP-SEQ-CITY05-D") \ - X(DP_SEQ_CITY05_N , "DP-SEQ-CITY05-N") \ - X(DP_SEQ_ROAD_E_D , "DP-SEQ-ROAD-E-D") \ - X(DP_SEQ_ROAD_E_N , "DP-SEQ-ROAD-E-N") \ - X(DP_SEQ_EYE_MOUNT , "DP-SEQ-EYE-MOUNT") \ - X(DP_SEQ_TOWN04_D , "DP-SEQ-TOWN04-D") \ - X(DP_SEQ_TOWN04_N , "DP-SEQ-TOWN04-N") \ - X(DP_SEQ_POCKETCH , "DP-SEQ-POCKETCH") \ - X(DP_SEQ_ROAD_F_D , "DP-SEQ-ROAD-F-D") \ - X(DP_SEQ_ROAD_F_N , "DP-SEQ-ROAD-F-N") \ - X(DP_SEQ_CITY07_D , "DP-SEQ-CITY07-D") \ - X(DP_SEQ_CITY07_N , "DP-SEQ-CITY07-N") \ - X(DP_SEQ_TOWN07_D , "DP-SEQ-TOWN07-D") \ - X(DP_SEQ_TOWN07_N , "DP-SEQ-TOWN07-N") \ - X(DP_SEQ_CITY02_D , "DP-SEQ-CITY02-D") \ - X(DP_SEQ_CITY02_N , "DP-SEQ-CITY02-N") \ - X(DP_SEQ_ROAD_SNOW_D , "DP-SEQ-ROAD-SNOW-D") \ - X(DP_SEQ_ROAD_SNOW_N , "DP-SEQ-ROAD-SNOW-N") \ - X(DP_SEQ_CITY09_D , "DP-SEQ-CITY09-D") \ - X(DP_SEQ_CITY09_N , "DP-SEQ-CITY09-N") \ - X(DP_SEQ_D_AGITO , "DP-SEQ-D-AGITO") \ - X(DP_SEQ_BA_AGAKI , "DP-SEQ-BA-AGAKI") \ - X(DP_SEQ_THE_EVENT04 , "DP-SEQ-THE-EVENT04") \ - X(DP_SEQ_D_MOUNT1 , "DP-SEQ-D-MOUNT1") \ - X(DP_SEQ_D_MOUNT2 , "DP-SEQ-D-MOUNT2") \ - X(DP_SEQ_THE_EVENT02 , "DP-SEQ-THE-EVENT02") \ - X(DP_SEQ_THE_EVENT03 , "DP-SEQ-THE-EVENT03") \ - X(DP_SEQ_BA_DPOKE2 , "DP-SEQ-BA-DPOKE2") \ - X(DP_SEQ_CITY08_D , "DP-SEQ-CITY08-D") \ - X(DP_SEQ_CITY08_N , "DP-SEQ-CITY08-N") \ - X(DP_SEQ_D_01 , "DP-SEQ-D-01") \ - X(DP_SEQ_EYE_ELITE , "DP-SEQ-EYE-ELITE") \ - X(DP_SEQ_CITY10_D , "DP-SEQ-CITY10-D") \ - X(DP_SEQ_CITY10_N , "DP-SEQ-CITY10-N") \ - X(DP_SEQ_CITY11_D , "DP-SEQ-CITY11-D") \ - X(DP_SEQ_CITY11_N , "DP-SEQ-CITY11-N") \ - X(DP_SEQ_TOWN06_D , "DP-SEQ-TOWN06-D") \ - X(DP_SEQ_TOWN06_N , "DP-SEQ-TOWN06-N") \ - X(DP_SEQ_ROAD_BZA_D , "DP-SEQ-ROAD-BZA-D") \ - X(DP_SEQ_ROAD_BZA_N , "DP-SEQ-ROAD-BZA-N") \ - X(DP_SEQ_WIFILOBBY , "DP-SEQ-WIFILOBBY") \ - X(DP_SEQ_BLD_TV , "DP-SEQ-BLD-TV") \ - X(DP_SEQ_BLD_BLD_GTC , "DP-SEQ-BLD-BLD-GTC") \ - X(DP_SEQ_NAMINORI , "DP-SEQ-NAMINORI") \ - X(DP_SEQ_WASURE , "DP-SEQ-WASURE") \ - X(DP_SEQ_EYE_FIGHT , "DP-SEQ-EYE-FIGHT") \ - X(DP_SEQ_EYE_ENKA , "DP-SEQ-EYE-ENKA") \ - X(DP_SEQ_TANKOU , "DP-SEQ-TANKOU") \ - X(DP_SEQ_HATANIGE , "DP-SEQ-HATANIGE") \ - X(DP_SEQ_EYE_LADY , "DP-SEQ-EYE-LADY") \ - X(DP_SEQ_D_03 , "DP-SEQ-D-03") \ - X(DP_SEQ_D_SAFARI , "DP-SEQ-D-SAFARI") \ - X(DP_SEQ_EYE_MYS , "DP-SEQ-EYE-MYS") \ - X(DP_SEQ_BLD_GAME , "DP-SEQ-BLD-GAME") \ - X(DP_SEQ_SLOT_ATARI , "DP-SEQ-SLOT-ATARI") \ - X(DP_SEQ_SLOT_OOATARI , "DP-SEQ-SLOT-OOATARI") \ - X(DP_SEQ_EYE_RICH , "DP-SEQ-EYE-RICH") \ - X(DP_SEQ_D_RYAYHY , "DP-SEQ-D-RYAYHY") \ - X(DP_SEQ_BA_DPOKE1 , "DP-SEQ-BA-DPOKE1") \ - X(DP_SEQ_KUSAGASA , "DP-SEQ-KUSAGASA") \ - X(DP_SEQ_EYE_FUN , "DP-SEQ-EYE-FUN") \ - X(DP_SEQ_D_KOUEN , "DP-SEQ-D-KOUEN") \ - X(DP_SEQ_ACCE , "DP-SEQ-ACCE") \ - X(DP_SEQ_BLD_CON , "DP-SEQ-BLD-CON") \ - X(DP_SEQ_KINOMI1 , "DP-SEQ-KINOMI1") \ - X(DP_SEQ_CON_TEST , "DP-SEQ-CON-TEST") \ - X(DP_SEQ_CO_DRESS , "DP-SEQ-CO-DRESS") \ - X(DP_SEQ_CO_KASHI , "DP-SEQ-CO-KASHI") \ - X(DP_SEQ_CO_TAKUMA , "DP-SEQ-CO-TAKUMA") \ - X(DP_SEQ_CO_KEKKA , "DP-SEQ-CO-KEKKA") \ - X(DP_SEQ_CO_FANFA , "DP-SEQ-CO-FANFA") \ - X(DP_SEQ_BF_TOWWER , "DP-SEQ-BF-TOWWER") \ - X(DP_SEQ_D_06 , "DP-SEQ-D-06") \ - X(DP_SEQ_BA_SECRET2 , "DP-SEQ-BA-SECRET2") \ - X(DP_SEQ_PRESENT , "DP-SEQ-PRESENT") \ - X(DP_SEQ_D_LEAGUE , "DP-SEQ-D-LEAGUE") \ - X(DP_SEQ_EYE_TENNO , "DP-SEQ-EYE-TENNO") \ - X(DP_SEQ_BA_TENNO , "DP-SEQ-BA-TENNO") \ - X(DP_SEQ_WINTENNO , "DP-SEQ-WINTENNO") \ - X(DP_SEQ_EYE_CHAMP , "DP-SEQ-EYE-CHAMP") \ - X(DP_SEQ_BA_CHANP , "DP-SEQ-BA-CHANP") \ - X(DP_SEQ_WINCHAMP , "DP-SEQ-WINCHAMP") \ - X(DP_SEQ_BLD_DENDO , "DP-SEQ-BLD-DENDO") \ - X(DP_SEQ_BLD_EV_DENDO2 , "DP-SEQ-BLD-EV-DENDO2") \ - X(DP_SEQ_BLD_ENDING , "DP-SEQ-BLD-ENDING") \ - X(DP_SEQ_FUE , "DP-SEQ-FUE") \ - X(DP_SEQ_AUS , "DP-SEQ-AUS") \ - X(DP_SEQ_BA_SECRET1 , "DP-SEQ-BA-SECRET1") \ - X(PL_SEQ_TITLE00 , "PL-SEQ-TITLE00") \ - X(PL_SEQ_TITLE01 , "PL-SEQ-TITLE01") \ - X(PL_SEQ_TV_HOUSOU , "PL-SEQ-TV-HOUSOU") \ - X(PL_SEQ_TV_END , "PL-SEQ-TV-END") \ - X(PL_SEQ_PL_HANDSOME , "PL-SEQ-PL-HANDSOME") \ - X(PL_SEQ_PL_WIFITOWER , "PL-SEQ-PL-WIFITOWER") \ - X(PL_SEQ_PL_WIFIUNION , "PL-SEQ-PL-WIFIUNION") \ - X(PL_SEQ_PL_WIFIGAME , "PL-SEQ-PL-WIFIGAME") \ - X(PL_SEQ_PL_WINMINI2 , "PL-SEQ-PL-WINMINI2") \ - X(PL_SEQ_PL_WIFIPARADE , "PL-SEQ-PL-WIFIPARADE") \ - X(PL_SEQ_PL_EV_GIRA , "PL-SEQ-PL-EV-GIRA") \ - X(PL_SEQ_PL_EV_GIRA2 , "PL-SEQ-PL-EV-GIRA2") \ - X(PL_SEQ_PL_D_GIRATINA , "PL-SEQ-PL-D-GIRATINA") \ - X(PL_SEQ_PL_BA_GIRA , "PL-SEQ-PL-BA-GIRA") \ - X(PL_SEQ_PL_GURUGURU , "PL-SEQ-PL-GURUGURU") \ - X(PL_SEQ_PL_PTHAIFU , "PL-SEQ-PL-PTHAIFU") \ - X(PL_SEQ_PL_MTKAWA , "PL-SEQ-PL-MTKAWA") \ - X(PL_SEQ_PL_MTKAKKO , "PL-SEQ-PL-MTKAKKO") \ - X(PL_SEQ_PL_MTTAKMA , "PL-SEQ-PL-MTTAKMA") \ - X(PL_SEQ_PL_MTUTSUK , "PL-SEQ-PL-MTUTSUK") \ - X(PL_SEQ_PL_MTKASHI , "PL-SEQ-PL-MTKASHI") \ - X(PL_SEQ_PL_TOWN02 , "PL-SEQ-PL-TOWN02") \ - X(PL_SEQ_PL_AUDIO , "PL-SEQ-PL-AUDIO") \ - X(PL_SEQ_CITY11_D , "PL-SEQ-CITY11-D") \ - X(PL_SEQ_PL_BF_ROULETTE , "PL-SEQ-PL-BF-ROULETTE") \ - X(PL_SEQ_PL_DON2 , "PL-SEQ-PL-DON2") \ - X(PL_SEQ_PL_BF_STAGE , "PL-SEQ-PL-BF-STAGE") \ - X(PL_SEQ_PL_BF_FACTORY , "PL-SEQ-PL-BF-FACTORY") \ - X(PL_SEQ_PL_BF_CASTLE , "PL-SEQ-PL-BF-CASTLE") \ - X(PL_SEQ_PL_FRO , "PL-SEQ-PL-FRO") \ - X(PL_SEQ_PL_POINTGET3 , "PL-SEQ-PL-POINTGET3") \ - X(PL_SEQ_PL_BA_BRAIN , "PL-SEQ-PL-BA-BRAIN") \ - X(PL_SEQ_PL_WINBRAIN , "PL-SEQ-PL-WINBRAIN") \ - X(PL_SEQ_PL_BA_REGI , "PL-SEQ-PL-BA-REGI") \ X(PH_TRAP_BLEND, "PH-TRAP-BLEND") \ X(PH_TRAP_HELD, "PH-TRAP-HELD") \ X(PH_TRAP_SOLO, "PH-TRAP-SOLO") \ @@ -3595,4 +3396,4 @@ SOUND_LIST_SE }; #undef X -#endif \ No newline at end of file +#endif From f6d111d0c7f994597f3a5243f16da7d6ef3ddab7 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 5 Sep 2022 11:17:21 +0200 Subject: [PATCH 096/155] Update src/debug.c Co-authored-by: Eduardo Quezada D'Ottone --- src/debug.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index 9e8a9b5b89..4cc1ac6168 100644 --- a/src/debug.c +++ b/src/debug.c @@ -128,7 +128,6 @@ enum { //Sound DEBUG_SOUND_MENU_ITEM_MUS, }; - // ******************************* // Constants #define DEBUG_MAIN_MENU_WIDTH 15 From 33f10d2139b4e47d9f6705c8b9b30ef5533d48e0 Mon Sep 17 00:00:00 2001 From: tustin2121 Date: Mon, 5 Sep 2022 09:49:20 -0400 Subject: [PATCH 097/155] Adding missing externs If there are not externs on these forward declarations, it's entirely possible for the program to link and missing data to be assigned to someplace presumed in IWRAM or something. --- .../field_effect_object_template_pointers.h | 74 +-- .../object_event_graphics_info_pointers.h | 492 +++++++++--------- 2 files changed, 283 insertions(+), 283 deletions(-) diff --git a/src/data/field_effects/field_effect_object_template_pointers.h b/src/data/field_effects/field_effect_object_template_pointers.h index 41d6271bf2..64a3c3283b 100755 --- a/src/data/field_effects/field_effect_object_template_pointers.h +++ b/src/data/field_effects/field_effect_object_template_pointers.h @@ -1,40 +1,40 @@ -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowLarge; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowExtraLarge; -const struct SpriteTemplate gFieldEffectObjectTemplate_TallGrass; -const struct SpriteTemplate gFieldEffectObjectTemplate_Ripple; -const struct SpriteTemplate gFieldEffectObjectTemplate_Ash; -const struct SpriteTemplate gFieldEffectObjectTemplate_SurfBlob; -const struct SpriteTemplate gFieldEffectObjectTemplate_Arrow; -const struct SpriteTemplate gFieldEffectObjectTemplate_GroundImpactDust; -const struct SpriteTemplate gFieldEffectObjectTemplate_JumpTallGrass; -const struct SpriteTemplate gFieldEffectObjectTemplate_SandFootprints; -const struct SpriteTemplate gFieldEffectObjectTemplate_JumpBigSplash; -const struct SpriteTemplate gFieldEffectObjectTemplate_Splash; -const struct SpriteTemplate gFieldEffectObjectTemplate_JumpSmallSplash; -const struct SpriteTemplate gFieldEffectObjectTemplate_LongGrass; -const struct SpriteTemplate gFieldEffectObjectTemplate_JumpLongGrass; -const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass; -const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass2; -const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedSand; -const struct SpriteTemplate gFieldEffectObjectTemplate_WaterSurfacing; -const struct SpriteTemplate gFieldEffectObjectTemplate_ReflectionDistortion; -const struct SpriteTemplate gFieldEffectObjectTemplate_Sparkle; -const struct SpriteTemplate gFieldEffectObjectTemplate_DeepSandFootprints; -const struct SpriteTemplate gFieldEffectObjectTemplate_TreeDisguise; -const struct SpriteTemplate gFieldEffectObjectTemplate_MountainDisguise; -const struct SpriteTemplate gFieldEffectObjectTemplate_Bird; -const struct SpriteTemplate gFieldEffectObjectTemplate_BikeTireTracks; -const struct SpriteTemplate gFieldEffectObjectTemplate_SandDisguisePlaceholder; -const struct SpriteTemplate gFieldEffectObjectTemplate_SandPile; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShortGrass; -const struct SpriteTemplate gFieldEffectObjectTemplate_HotSpringsWater; -const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff; -const struct SpriteTemplate gFieldEffectObjectTemplate_AshLaunch; -const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles; -const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle; -const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowLarge; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowExtraLarge; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_TallGrass; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_Ripple; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_Ash; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_SurfBlob; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_Arrow; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_GroundImpactDust; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_JumpTallGrass; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_SandFootprints; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_JumpBigSplash; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_Splash; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_JumpSmallSplash; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_LongGrass; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_JumpLongGrass; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass2; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedSand; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_WaterSurfacing; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_ReflectionDistortion; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_Sparkle; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_DeepSandFootprints; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_TreeDisguise; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_MountainDisguise; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_Bird; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_BikeTireTracks; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_SandDisguisePlaceholder; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_SandPile; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShortGrass; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_HotSpringsWater; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_AshLaunch; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle; +extern const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza; const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[] = { [FLDEFFOBJ_SHADOW_S] = &gFieldEffectObjectTemplate_ShadowSmall, diff --git a/src/data/object_events/object_event_graphics_info_pointers.h b/src/data/object_events/object_event_graphics_info_pointers.h index 1c94919a75..ae1117164a 100755 --- a/src/data/object_events/object_event_graphics_info_pointers.h +++ b/src/data/object_events/object_event_graphics_info_pointers.h @@ -1,249 +1,249 @@ -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanNormal; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanMachBike; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanSurfing; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFieldMove; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_QuintyPlump; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_NinjaBoy; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Twin; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy1; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl1; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy2; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl2; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleBoy; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleGirl; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy3; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl3; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RichBoy; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman1; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FatMan; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanF; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man1; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman2; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertF; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man2; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman3; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman4; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cook; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkReceptionist; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldMan; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldWoman; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Camper; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Picnicker; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man3; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman5; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Youngster; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BugCatcher; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PsychicM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SchoolKidM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maniac; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HexManiac; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RayquazaStill; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerF; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BlackBelt; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Beauty; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist1; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lass; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Gentleman; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sailor; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fisherman; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteF; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberF; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hiker; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteF; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Nurse; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ItemBall; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTree; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeEarlyStages; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeLateStages; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanAcroBike; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ProfBirch; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man4; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man5; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterF; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Anabel; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tucker; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Greta; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Spenser; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Noland; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lucy; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedNatuDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMagnemiteDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedSquirtleDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedWooperDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPikachuDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPorygon2Doll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CuttableTree; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MartEmployee; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RooftopSaleWoman; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Teala; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BreakableRock; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PushableBoulder; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MrBrineysBoat; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayNormal; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayMachBike; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayAcroBike; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MaySurfing; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFieldMove; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Truck; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothCarryingBox; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothFacingAway; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirchsBag; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_EnemyZigzagoon; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Artist; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanNormal; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanMachBike; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanAcroBike; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanSurfing; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanFieldMove; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayNormal; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayMachBike; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayAcroBike; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMaySurfing; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayFieldMove; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cameraman; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanUnderwater; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayUnderwater; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MovingBox; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CableCar; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist2; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DevonEmployee; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberF; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberM; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberF; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sidney; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Phoebe; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Glacia; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Drake; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Roxanne; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brawly; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wattson; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Flannery; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Norman; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Winona; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Liza; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tate; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wallace; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Steven; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wally; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireLittleBoy; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFishing; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFishing; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HotSpringsOldWoman; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SSTidal; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SubmarineShadow; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PichuDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikachuDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MarillDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TogepiDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyndaquilDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ChikoritaDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TotodileDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_JigglypuffDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MeowthDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ClefairyDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DittoDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SmoochumDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TreeckoDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TorchicDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MudkipDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DuskullDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WynautDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BaltoyDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AzurillDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SkittyDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwabluDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GulpinDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LotadDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SeedotDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikaCushion; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RoundCushion; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KissCushion; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ZigzagCushion; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SpinCushion; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DiamondCushion; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BallCushion; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GrassCushion; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FireCushion; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WaterCushion; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigSnorlaxDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRhydonDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigLaprasDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigVenusaurDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigCharizardDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigBlastoiseDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigWailmerDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegirockDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegiceDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegisteelDoll; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latias; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latios; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GameboyKid; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ContestJudge; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanWatering; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayWatering; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanDecorating; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayDecorating; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Archie; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maxie; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreFront; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonFront; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fossil; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regirock; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regice; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Registeel; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Skitty; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kecleon; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreAsleep; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonAsleep; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Zigzagoon; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Pikachu; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azumarill; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wingull; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonBridgeShadow; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberMSwimming; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azurill; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mom; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkBrendan; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkMay; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Juan; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scott; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Poochyena; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreSide; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonSide; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MysteryEventDeliveryman; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Statue; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kirlia; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Dusclops; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnionRoomAttendant; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sudowoodo; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mew; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Red; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Leaf; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Deoxys; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirthIslandStone; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brandon; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireBrendan; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireMay; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hipster; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Trader; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Storyteller; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Giddy; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan1; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan2; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanNormal; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanMachBike; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanSurfing; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFieldMove; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_QuintyPlump; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_NinjaBoy; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Twin; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy1; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl1; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy2; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl2; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleBoy; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleGirl; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy3; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl3; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RichBoy; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman1; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FatMan; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanF; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man1; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman2; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertF; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man2; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman3; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman4; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cook; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkReceptionist; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldMan; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldWoman; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Camper; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Picnicker; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man3; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman5; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Youngster; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BugCatcher; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PsychicM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SchoolKidM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maniac; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HexManiac; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RayquazaStill; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerF; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BlackBelt; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Beauty; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist1; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lass; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Gentleman; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sailor; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fisherman; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteF; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberF; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hiker; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteF; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Nurse; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ItemBall; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTree; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeEarlyStages; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeLateStages; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanAcroBike; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ProfBirch; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man4; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man5; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterF; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Anabel; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tucker; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Greta; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Spenser; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Noland; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lucy; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedNatuDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMagnemiteDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedSquirtleDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedWooperDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPikachuDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPorygon2Doll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CuttableTree; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MartEmployee; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RooftopSaleWoman; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Teala; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BreakableRock; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PushableBoulder; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MrBrineysBoat; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayNormal; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayMachBike; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayAcroBike; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MaySurfing; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFieldMove; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Truck; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothCarryingBox; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothFacingAway; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirchsBag; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_EnemyZigzagoon; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Artist; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanNormal; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanMachBike; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanAcroBike; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanSurfing; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanFieldMove; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayNormal; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayMachBike; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayAcroBike; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMaySurfing; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayFieldMove; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cameraman; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanUnderwater; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayUnderwater; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MovingBox; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CableCar; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist2; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DevonEmployee; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberF; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberM; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberF; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sidney; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Phoebe; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Glacia; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Drake; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Roxanne; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brawly; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wattson; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Flannery; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Norman; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Winona; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Liza; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tate; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wallace; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Steven; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wally; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireLittleBoy; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFishing; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFishing; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HotSpringsOldWoman; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SSTidal; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SubmarineShadow; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PichuDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikachuDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MarillDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TogepiDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyndaquilDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ChikoritaDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TotodileDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_JigglypuffDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MeowthDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ClefairyDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DittoDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SmoochumDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TreeckoDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TorchicDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MudkipDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DuskullDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WynautDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BaltoyDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AzurillDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SkittyDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwabluDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GulpinDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LotadDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SeedotDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikaCushion; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RoundCushion; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KissCushion; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ZigzagCushion; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SpinCushion; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DiamondCushion; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BallCushion; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GrassCushion; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FireCushion; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WaterCushion; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigSnorlaxDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRhydonDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigLaprasDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigVenusaurDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigCharizardDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigBlastoiseDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigWailmerDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegirockDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegiceDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegisteelDoll; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latias; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latios; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GameboyKid; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ContestJudge; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanWatering; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayWatering; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanDecorating; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayDecorating; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Archie; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maxie; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreFront; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonFront; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fossil; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regirock; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regice; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Registeel; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Skitty; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kecleon; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreAsleep; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonAsleep; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Zigzagoon; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Pikachu; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azumarill; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wingull; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonBridgeShadow; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberMSwimming; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azurill; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mom; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkBrendan; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkMay; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Juan; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scott; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Poochyena; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreSide; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonSide; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MysteryEventDeliveryman; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Statue; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kirlia; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Dusclops; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnionRoomAttendant; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sudowoodo; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mew; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Red; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Leaf; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Deoxys; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirthIslandStone; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brandon; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireBrendan; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireMay; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hipster; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Trader; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Storyteller; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Giddy; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan1; +extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan2; const struct ObjectEventGraphicsInfo *const gObjectEventGraphicsInfoPointers[NUM_OBJ_EVENT_GFX] = { From bb290d5ab0f0e27466a71078a4f8b75f135863c4 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 1 Sep 2022 14:57:58 -0300 Subject: [PATCH 098/155] Updates -Removed the pointless param1 setting in sXerneasFormChangeTable -Updated the descriptions of Behemoth Blade and Behemoth Bash -Added a new parameter to the struct FormChange -Allowed FORM_BATTLE_BEGIN and FORM_BATTLE_END to replace a move through a new function called "TryToSetBattleFormChangeMoves". -Added missing calls to "CalculateMonStats". -Renamed BoxPokemon pointer in GetFormChangeTargetSpeciesBoxMon for consistency's sake -Optimized check inside UndoFormChange (even though the plan is to get rid of that func entirely.) Special thanks to Blecoutre who fixed my TryToSetBattleFormChangeMoves function. It just wasn't working correctly at all. --- include/pokemon.h | 5 ++- src/battle_main.c | 8 ++++ src/battle_util.c | 15 +++---- src/data/pokemon/form_change_tables.h | 16 ++++--- src/data/text/move_descriptions.h | 8 ++-- src/pokemon.c | 62 ++++++++++++++++++++++----- 6 files changed, 83 insertions(+), 31 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index c05628a598..9ebaa52a0d 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -366,11 +366,13 @@ struct Evolution u16 targetSpecies; }; -struct FormChange { +struct FormChange +{ u16 method; u16 targetSpecies; u16 param1; u16 param2; + u16 param3; }; #define NUM_UNOWN_FORMS 28 @@ -559,5 +561,6 @@ u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg); u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg); u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove); bool32 ShouldShowFemaleDifferences(u16 species, u32 personality); +void TryToSetBattleFormChangeMoves(struct Pokemon *mon); #endif // GUARD_POKEMON_H diff --git a/src/battle_main.c b/src/battle_main.c index f75a7ae80b..84af5ae748 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -578,11 +578,19 @@ static void CB2_InitBattleInternal(void) // Player's side targetSpecies = GetFormChangeTargetSpecies(&gPlayerParty[i], FORM_BATTLE_BEGIN, 0); if (targetSpecies != SPECIES_NONE) + { SetMonData(&gPlayerParty[i], MON_DATA_SPECIES, &targetSpecies); + CalculateMonStats(&gPlayerParty[i]); + TryToSetBattleFormChangeMoves(&gPlayerParty[i]); + } // Opponent's side targetSpecies = GetFormChangeTargetSpecies(&gEnemyParty[i], FORM_BATTLE_BEGIN, 0); if (targetSpecies != SPECIES_NONE) + { SetMonData(&gEnemyParty[i], MON_DATA_SPECIES, &targetSpecies); + CalculateMonStats(&gEnemyParty[i]); + TryToSetBattleFormChangeMoves(&gEnemyParty[i]); + } } gBattleCommunication[MULTIUSE_STATE] = 0; diff --git a/src/battle_util.c b/src/battle_util.c index dff9d71da5..c9b4435f4c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -9624,17 +9624,12 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut) } if (!isSwitchingOut) { - // Apply party-wide end-of-battle form changes - for (i = 0; i < PARTY_SIZE; i++) + targetSpecies = GetFormChangeTargetSpecies(&party[monId], FORM_BATTLE_END, 0); + if (targetSpecies != SPECIES_NONE) { - // Player's side - targetSpecies = GetFormChangeTargetSpecies(&gPlayerParty[i], FORM_BATTLE_END, 0); - if (targetSpecies != SPECIES_NONE) - SetMonData(&gPlayerParty[i], MON_DATA_SPECIES, &targetSpecies); - // Opponent's side - targetSpecies = GetFormChangeTargetSpecies(&gEnemyParty[i], FORM_BATTLE_END, 0); - if (targetSpecies != SPECIES_NONE) - SetMonData(&gEnemyParty[i], MON_DATA_SPECIES, &targetSpecies); + SetMonData(&party[monId], MON_DATA_SPECIES, &targetSpecies); + CalculateMonStats(&party[monId]); + TryToSetBattleFormChangeMoves(&party[monId]); } } } diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index be76cc9956..914ca6d994 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -37,10 +37,14 @@ FORM_ITEM_USE_TIME: FORM_BATTLE_BEGIN: Form change activates when the Pokémon is sent out at the beginning of a battle param1 = item to hold, optional + param2 = a move that will be replaced, optional + param3 = a new move to replace it with, optional FORM_BATTLE_END: Form change activates at the end of a battle param1 = item to hold, optional + param2 = a move that will be replaced, optional + param3 = a new move to replace it with, optional */ // FORM_MOVE param2 Arguments @@ -194,20 +198,20 @@ static const struct FormChange sSilvallyFormChangeTable[] = { #endif static const struct FormChange sXerneasFormChangeTable[] = { - {FORM_BATTLE_BEGIN, SPECIES_XERNEAS_ACTIVE, ITEM_NONE}, - {FORM_BATTLE_END, SPECIES_XERNEAS, ITEM_NONE}, + {FORM_BATTLE_BEGIN, SPECIES_XERNEAS_ACTIVE}, + {FORM_BATTLE_END, SPECIES_XERNEAS, }, {FORM_CHANGE_END}, }; static const struct FormChange sZacianFormChangeTable[] = { - {FORM_BATTLE_BEGIN, SPECIES_ZACIAN_CROWNED_SWORD, ITEM_RUSTED_SWORD}, - {FORM_BATTLE_END, SPECIES_ZACIAN, ITEM_RUSTED_SWORD}, + {FORM_BATTLE_BEGIN, SPECIES_ZACIAN_CROWNED_SWORD, ITEM_RUSTED_SWORD, MOVE_IRON_HEAD, MOVE_BEHEMOTH_BLADE}, + {FORM_BATTLE_END, SPECIES_ZACIAN, ITEM_RUSTED_SWORD, MOVE_BEHEMOTH_BLADE, MOVE_IRON_HEAD}, {FORM_CHANGE_END}, }; static const struct FormChange sZamazentaFormChangeTable[] = { - {FORM_BATTLE_BEGIN, SPECIES_ZAMAZENTA_CROWNED_SHIELD, ITEM_RUSTED_SHIELD}, - {FORM_BATTLE_END, SPECIES_ZAMAZENTA, ITEM_RUSTED_SHIELD}, + {FORM_BATTLE_BEGIN, SPECIES_ZAMAZENTA_CROWNED_SHIELD, ITEM_RUSTED_SHIELD, MOVE_IRON_HEAD, MOVE_BEHEMOTH_BASH}, + {FORM_BATTLE_END, SPECIES_ZAMAZENTA, ITEM_RUSTED_SHIELD, MOVE_BEHEMOTH_BASH, MOVE_IRON_HEAD}, {FORM_CHANGE_END}, }; diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h index 7d890b1d3d..0a1d385042 100644 --- a/src/data/text/move_descriptions.h +++ b/src/data/text/move_descriptions.h @@ -2791,12 +2791,12 @@ static const u8 sPyroBallDescription[] = _( "target. It may cause a burn."); static const u8 sBehemothBladeDescription[] = _( - "Strikes as a sword. It deals\n" - "2x damage to Dynamaxed foes."); + "Strikes as a sword. Deals 2x\n" + "damage to Dynamaxed foes."); static const u8 sBehemothBashDescription[] = _( - "Attacks as a shield. Deals\n" - "2x damage to Dynamaxed foes."); + "Attacks as a shield. Deals 2x\n" + "damage to Dynamaxed foes."); static const u8 sAuraWheelDescription[] = _( "Raises Speed to attack. The\n" diff --git a/src/pokemon.c b/src/pokemon.c index 06e75dbc3b..d1aa0abb07 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8243,19 +8243,19 @@ u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg) } // Returns SPECIES_NONE if no form change is possible -u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg) +u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 arg) { - u32 i; + u32 i, j; u16 targetSpecies = SPECIES_NONE; - u16 species = GetBoxMonData(mon, MON_DATA_SPECIES, NULL); + u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL); const struct FormChange *formChanges = gFormChangeTablePointers[species]; u16 heldItem; u32 ability; if (formChanges != NULL) { - heldItem = GetBoxMonData(mon, MON_DATA_HELD_ITEM, NULL); - ability = GetAbilityBySpecies(species, GetBoxMonData(mon, MON_DATA_ABILITY_NUM, NULL)); + heldItem = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM, NULL); + ability = GetAbilityBySpecies(species, GetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, NULL)); for (i = 0; formChanges[i].method != FORM_CHANGE_END; i++) { @@ -8264,8 +8264,6 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg switch (method) { case FORM_ITEM_HOLD: - case FORM_BATTLE_BEGIN: - case FORM_BATTLE_END: if (heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) targetSpecies = formChanges[i].targetSpecies; break; @@ -8274,7 +8272,7 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg targetSpecies = formChanges[i].targetSpecies; break; case FORM_MOVE: - if (BoxMonKnowsMove(mon, formChanges[i].param1) != formChanges[i].param2) + if (BoxMonKnowsMove(boxMon, formChanges[i].param1) != formChanges[i].param2) targetSpecies = formChanges[i].targetSpecies; break; case FORM_ITEM_HOLD_ABILITY: @@ -8299,6 +8297,10 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg } } break; + case FORM_BATTLE_BEGIN: + case FORM_BATTLE_END: + if (heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) + targetSpecies = formChanges[i].targetSpecies; } } } @@ -8358,7 +8360,7 @@ void TrySpecialOverworldEvo(void) u8 i; u8 evoMethod = gSpecialVar_0x8000; u16 canStopEvo = gSpecialVar_0x8001; - u16 tryMultiple = gSpecialVar_0x8002; + u16 tryMultiple = gSpecialVar_0x8002; for (i = 0; i < PARTY_SIZE; i++) { @@ -8375,7 +8377,7 @@ void TrySpecialOverworldEvo(void) else gCB2_AfterEvolution = CB2_ReturnToField; return; - } + } } sTriedEvolving = 0; @@ -8386,3 +8388,43 @@ bool32 ShouldShowFemaleDifferences(u16 species, u32 personality) { return (gBaseStats[species].flags & FLAG_GENDER_DIFFERENCE) && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE; } + +void TryToSetBattleFormChangeMoves(struct Pokemon *mon) +{ + int i, j; + u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); + const struct FormChange *formChanges = gFormChangeTablePointers[species]; + u8 ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL); + + if (formChanges == NULL) + return; + + for (i = 0; formChanges[i].method != FORM_CHANGE_END; i++) + { + if ((formChanges[i].method == FORM_BATTLE_BEGIN || formChanges[i].method == FORM_BATTLE_END) + && formChanges[i].param2 && formChanges[i].param3 && formChanges[i].targetSpecies == species) + { + u16 originalMove = formChanges[i].param2; + u16 newMove = formChanges[i].param3; + + for (j = 0; j < MAX_MON_MOVES; j++) + { + u16 currMove = GetMonData(mon, MON_DATA_MOVE1 + j, NULL); + u8 totalPp = gBattleMoves[currMove].pp; // Get current move's max PP + u8 currPp = GetMonData(mon, MON_DATA_PP1 + j, NULL); // Get current move's remaining PP + u8 diffPp = totalPp - currPp; // Current move's PP difference + u8 finalPp = gBattleMoves[newMove].pp - diffPp; // Apply the PP difference to the new move + + if (currMove == originalMove) + { + if (finalPp > gBattleMoves[newMove].pp) + finalPp = 0; + SetMonMoveSlot(mon, newMove, j); + SetMonData(mon, MON_DATA_PP1 + j, &finalPp); + } + } + SetMonData(mon, MON_DATA_PP_BONUSES, &ppBonuses); + break; + } + } +} From 7a0838a0f2c45cae4a418f9513266daa02237796 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 1 Sep 2022 14:03:37 -0400 Subject: [PATCH 099/155] Adjusted `GetFormChangeTargetSpeciesBoxMon` to allow having form changes of the same method in the same table --- src/data/pokemon/form_change_table_pointers.h | 12 ++--- src/data/pokemon/form_change_tables.h | 50 ++++--------------- src/pokemon.c | 4 +- 3 files changed, 19 insertions(+), 47 deletions(-) diff --git a/src/data/pokemon/form_change_table_pointers.h b/src/data/pokemon/form_change_table_pointers.h index 7bf249fcbe..85685e50ef 100644 --- a/src/data/pokemon/form_change_table_pointers.h +++ b/src/data/pokemon/form_change_table_pointers.h @@ -24,15 +24,15 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] = [SPECIES_ARCEUS_DARK] = sArceusFormChangeTable, [SPECIES_ARCEUS_FAIRY] = sArceusFormChangeTable, [SPECIES_TORNADUS] = sTornadusFormChangeTable, - [SPECIES_TORNADUS_THERIAN] = sTornadusTherianFormChangeTable, + [SPECIES_TORNADUS_THERIAN] = sTornadusFormChangeTable, [SPECIES_THUNDURUS] = sThundurusFormChangeTable, - [SPECIES_THUNDURUS_THERIAN] = sThundurusTherianFormChangeTable, + [SPECIES_THUNDURUS_THERIAN] = sThundurusFormChangeTable, [SPECIES_LANDORUS] = sLandorusFormChangeTable, - [SPECIES_LANDORUS_THERIAN] = sLandorusTherianFormChangeTable, + [SPECIES_LANDORUS_THERIAN] = sLandorusFormChangeTable, [SPECIES_ENAMORUS] = sEnamorusFormChangeTable, - [SPECIES_ENAMORUS_THERIAN] = sEnamorusTherianFormChangeTable, + [SPECIES_ENAMORUS_THERIAN] = sEnamorusFormChangeTable, [SPECIES_KELDEO] = sKeldeoFormChangeTable, - [SPECIES_KELDEO_RESOLUTE] = sKeldeoResoluteFormChangeTable, + [SPECIES_KELDEO_RESOLUTE] = sKeldeoFormChangeTable, [SPECIES_GENESECT] = sGenesectFormChangeTable, [SPECIES_GENESECT_DOUSE_DRIVE] = sGenesectFormChangeTable, [SPECIES_GENESECT_SHOCK_DRIVE] = sGenesectFormChangeTable, @@ -41,7 +41,7 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] = [SPECIES_XERNEAS] = sXerneasFormChangeTable, [SPECIES_XERNEAS_ACTIVE] = sXerneasFormChangeTable, [SPECIES_HOOPA] = sHoopaFormChangeTable, - [SPECIES_HOOPA_UNBOUND] = sHoopaUnboundFormChangeTable, + [SPECIES_HOOPA_UNBOUND] = sHoopaFormChangeTable, [SPECIES_ORICORIO] = sOricorioFormChangeTable, [SPECIES_ORICORIO_POM_POM] = sOricorioFormChangeTable, [SPECIES_ORICORIO_PAU] = sOricorioFormChangeTable, diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index ba24b14371..3a97f4efe6 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -1,8 +1,4 @@ /* -For cycling between forms with the same method and parameters but different target species (eg. Tornadus using the -Reveal Glass to change between its two forms), a separate form change table is required for each form. -Otherwise, only the last form change on the table will trigger. - FORM_ITEM_HOLD: Form change activates when the item is given to or taken from the selected Pokémon. param1 = item to hold @@ -64,7 +60,7 @@ static const struct FormChange sGiratinaFormChangeTable[] = { static const struct FormChange sShayminFormChangeTable[] = { {FORM_ITEM_USE_TIME, SPECIES_SHAYMIN_SKY, ITEM_GRACIDEA, DAY}, - {FORM_WITHDRAW, SPECIES_SHAYMIN}, + // {FORM_WITHDRAW, SPECIES_SHAYMIN}, {FORM_CHANGE_END}, }; @@ -109,51 +105,25 @@ static const struct FormChange sArceusFormChangeTable[] = { static const struct FormChange sTornadusFormChangeTable[] = { {FORM_ITEM_USE, SPECIES_TORNADUS_THERIAN, ITEM_REVEAL_GLASS}, - {FORM_CHANGE_END}, -}; - -static const struct FormChange sTornadusTherianFormChangeTable[] = { {FORM_ITEM_USE, SPECIES_TORNADUS, ITEM_REVEAL_GLASS}, {FORM_CHANGE_END}, }; static const struct FormChange sThundurusFormChangeTable[] = { {FORM_ITEM_USE, SPECIES_THUNDURUS_THERIAN, ITEM_REVEAL_GLASS}, - {FORM_CHANGE_END}, -}; - -static const struct FormChange sThundurusTherianFormChangeTable[] = { {FORM_ITEM_USE, SPECIES_THUNDURUS, ITEM_REVEAL_GLASS}, {FORM_CHANGE_END}, }; static const struct FormChange sLandorusFormChangeTable[] = { {FORM_ITEM_USE, SPECIES_LANDORUS_THERIAN, ITEM_REVEAL_GLASS}, - {FORM_CHANGE_END}, -}; - -static const struct FormChange sLandorusTherianFormChangeTable[] = { {FORM_ITEM_USE, SPECIES_LANDORUS, ITEM_REVEAL_GLASS}, {FORM_CHANGE_END}, }; -static const struct FormChange sEnamorusFormChangeTable[] = { - {FORM_ITEM_USE, SPECIES_ENAMORUS, ITEM_REVEAL_GLASS}, - {FORM_CHANGE_END}, -}; - -static const struct FormChange sEnamorusTherianFormChangeTable[] = { - {FORM_ITEM_USE, SPECIES_ENAMORUS_THERIAN, ITEM_REVEAL_GLASS}, - {FORM_CHANGE_END}, -}; - static const struct FormChange sKeldeoFormChangeTable[] = { - {FORM_MOVE, SPECIES_KELDEO_RESOLUTE, MOVE_SECRET_SWORD, WHEN_LEARNED}, - {FORM_CHANGE_END}, -}; - -static const struct FormChange sKeldeoResoluteFormChangeTable[] = { - {FORM_MOVE, SPECIES_KELDEO, MOVE_SECRET_SWORD, WHEN_FORGOTTEN}, + // {FORM_MOVE, SPECIES_KELDEO_RESOLUTE, MOVE_SECRET_SWORD, WHEN_LEARNED}, + // {FORM_MOVE, SPECIES_KELDEO, MOVE_SECRET_SWORD, WHEN_FORGOTTEN}, {FORM_CHANGE_END}, }; @@ -167,12 +137,8 @@ static const struct FormChange sGenesectFormChangeTable[] = { }; static const struct FormChange sHoopaFormChangeTable[] = { - // {FORM_ITEM_USE, SPECIES_HOOPA_UNBOUND, ITEM_PRISON_BOTTLE, SPECIES_HOOPA}, - {FORM_CHANGE_END}, -}; - -static const struct FormChange sHoopaUnboundFormChangeTable[] = { - {FORM_WITHDRAW, SPECIES_HOOPA}, + {FORM_ITEM_USE, SPECIES_HOOPA_UNBOUND, ITEM_PRISON_BOTTLE, SPECIES_HOOPA}, + // {FORM_WITHDRAW, SPECIES_HOOPA}, {FORM_CHANGE_END}, }; @@ -225,5 +191,11 @@ static const struct FormChange sZamazentaFormChangeTable[] = { {FORM_CHANGE_END}, }; +static const struct FormChange sEnamorusFormChangeTable[] = { + {FORM_ITEM_USE, SPECIES_ENAMORUS, ITEM_REVEAL_GLASS}, + {FORM_ITEM_USE, SPECIES_ENAMORUS_THERIAN, ITEM_REVEAL_GLASS}, + {FORM_CHANGE_END}, +}; + #undef WHEN_LEARNED #undef WHEN_FORGOTTEN diff --git a/src/pokemon.c b/src/pokemon.c index f88f7dab2d..99a82ec130 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8277,7 +8277,7 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 for (i = 0; formChanges[i].method != FORM_CHANGE_END; i++) { - if (method == formChanges[i].method) + if (method == formChanges[i].method && species != formChanges[i].targetSpecies) { switch (method) { @@ -8324,7 +8324,7 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 } } - return species != targetSpecies ? targetSpecies : SPECIES_NONE; + return targetSpecies; } u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove) From b249399a530727dec08911cc769c86c844a25e37 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 6 Sep 2022 23:00:26 +0200 Subject: [PATCH 100/155] changed 'B_FLAG_NO_CATCHING' to be evaluated by 'GetBallThrowableState()' --- include/item_use.h | 1 + src/item_use.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/item_use.h b/include/item_use.h index 036a541012..d55f7cf0d7 100644 --- a/include/item_use.h +++ b/include/item_use.h @@ -43,6 +43,7 @@ enum { BALL_THROW_UNABLE_NO_ROOM, BALL_THROW_UNABLE_SEMI_INVULNERABLE, BALL_THROW_ABLE, + BALL_THROW_UNABLE_DISABLED_FLAG, }; bool32 CanThrowBall(void); diff --git a/src/item_use.c b/src/item_use.c index cb85ae3e35..645a5d1647 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -968,6 +968,8 @@ static u32 GetBallThrowableState(void) else if (gStatuses3[GetCatchingBattler()] & STATUS3_SEMI_INVULNERABLE) return BALL_THROW_UNABLE_SEMI_INVULNERABLE; #endif + else if (FlagGet(B_FLAG_NO_CATCHING)) + return BALL_THROW_UNABLE_DISABLED_FLAG; return BALL_THROW_ABLE; } @@ -979,15 +981,9 @@ bool32 CanThrowBall(void) static const u8 sText_CantThrowPokeBall_TwoMons[] = _("Cannot throw a ball!\nThere are two Pokémon out there!\p"); static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a ball!\nThere's no Pokémon in sight!\p"); +static const u8 sText_CantThrowPokeBall_Disabled[] = _("POKé BALLS cannot be used\nright now!\p"); void ItemUseInBattle_PokeBall(u8 taskId) -{ - if (FlagGet(B_FLAG_NO_CATCHING)) - { - static const u8 sText_BallsCannotBeUsed[] = _("Poké Balls cannot be used\nright now!\p"); - DisplayItemMessage(taskId, 1, sText_BallsCannotBeUsed, CloseItemMessage); - return; - } - +{ switch (GetBallThrowableState()) { case BALL_THROW_ABLE: @@ -1018,6 +1014,12 @@ void ItemUseInBattle_PokeBall(u8 taskId) DisplayItemMessageInBattlePyramid(taskId, sText_CantThrowPokeBall_SemiInvulnerable, Task_CloseBattlePyramidBagMessage); break; #endif + case BALL_THROW_UNABLE_DISABLED_FLAG: + if (!InBattlePyramid()) + DisplayItemMessage(taskId, FONT_NORMAL, sText_CantThrowPokeBall_Disabled, CloseItemMessage); + else + DisplayItemMessageInBattlePyramid(taskId, sText_CantThrowPokeBall_Disabled, Task_CloseBattlePyramidBagMessage); + break; } } From 12bb32666b558c3b5b68c7652f03d87483d272a6 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 6 Sep 2022 17:05:56 -0400 Subject: [PATCH 101/155] Aligned FRONTIER_MONS trainer macros with the rest for consistency --- .../battle_frontier_trainer_mons.h | 198 +++++++++--------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/src/data/battle_frontier/battle_frontier_trainer_mons.h b/src/data/battle_frontier/battle_frontier_trainer_mons.h index efd9ef84dd..625a602658 100644 --- a/src/data/battle_frontier/battle_frontier_trainer_mons.h +++ b/src/data/battle_frontier/battle_frontier_trainer_mons.h @@ -1,67 +1,67 @@ // Also used by early Pkmn Breeder, Collector, and Beauty trainers #define FRONTIER_MONS_YOUNGSTER_LASS_1 \ - FRONTIER_MON_SUNKERN, \ - FRONTIER_MON_AZURILL, \ - FRONTIER_MON_CATERPIE, \ - FRONTIER_MON_WEEDLE, \ - FRONTIER_MON_WURMPLE, \ - FRONTIER_MON_RALTS, \ - FRONTIER_MON_MAGIKARP, \ - FRONTIER_MON_FEEBAS, \ - FRONTIER_MON_PICHU, \ - FRONTIER_MON_IGGLYBUFF, \ - FRONTIER_MON_WOOPER, \ - FRONTIER_MON_TYROGUE, \ - FRONTIER_MON_SENTRET, \ - FRONTIER_MON_CLEFFA, \ - FRONTIER_MON_SEEDOT, \ - FRONTIER_MON_LOTAD, \ - FRONTIER_MON_POOCHYENA, \ - FRONTIER_MON_SHEDINJA, \ - FRONTIER_MON_MAKUHITA, \ - FRONTIER_MON_WHISMUR, \ - FRONTIER_MON_ZIGZAGOON, \ - FRONTIER_MON_ZUBAT, \ - FRONTIER_MON_TOGEPI, \ - FRONTIER_MON_SPINARAK, \ - FRONTIER_MON_MARILL, \ - FRONTIER_MON_HOPPIP, \ - FRONTIER_MON_SLUGMA, \ - FRONTIER_MON_SWINUB, \ - FRONTIER_MON_SMEARGLE, \ - FRONTIER_MON_PIDGEY, \ - FRONTIER_MON_RATTATA, \ - FRONTIER_MON_WYNAUT, \ - FRONTIER_MON_SKITTY, \ - FRONTIER_MON_SPEAROW, \ - FRONTIER_MON_HOOTHOOT, \ - FRONTIER_MON_DIGLETT, \ - FRONTIER_MON_LEDYBA, \ - FRONTIER_MON_NINCADA, \ - FRONTIER_MON_SURSKIT, \ - FRONTIER_MON_JIGGLYPUFF, \ - FRONTIER_MON_TAILLOW, \ - FRONTIER_MON_WINGULL, \ - FRONTIER_MON_NIDORAN_M, \ - FRONTIER_MON_NIDORAN_F, \ - FRONTIER_MON_KIRLIA, \ - FRONTIER_MON_MAREEP, \ - FRONTIER_MON_MEDITITE, \ - FRONTIER_MON_SLAKOTH, \ - FRONTIER_MON_PARAS, \ - FRONTIER_MON_EKANS, \ - FRONTIER_MON_DITTO, \ - FRONTIER_MON_BARBOACH, \ - FRONTIER_MON_MEOWTH, \ - FRONTIER_MON_PINECO, \ - FRONTIER_MON_TRAPINCH, \ - FRONTIER_MON_SPHEAL, \ - FRONTIER_MON_HORSEA, \ - FRONTIER_MON_SHROOMISH, \ - FRONTIER_MON_SHUPPET, \ - FRONTIER_MON_DUSKULL, \ - FRONTIER_MON_ELECTRIKE, \ - FRONTIER_MON_VULPIX, \ + FRONTIER_MON_SUNKERN, \ + FRONTIER_MON_AZURILL, \ + FRONTIER_MON_CATERPIE, \ + FRONTIER_MON_WEEDLE, \ + FRONTIER_MON_WURMPLE, \ + FRONTIER_MON_RALTS, \ + FRONTIER_MON_MAGIKARP, \ + FRONTIER_MON_FEEBAS, \ + FRONTIER_MON_PICHU, \ + FRONTIER_MON_IGGLYBUFF, \ + FRONTIER_MON_WOOPER, \ + FRONTIER_MON_TYROGUE, \ + FRONTIER_MON_SENTRET, \ + FRONTIER_MON_CLEFFA, \ + FRONTIER_MON_SEEDOT, \ + FRONTIER_MON_LOTAD, \ + FRONTIER_MON_POOCHYENA, \ + FRONTIER_MON_SHEDINJA, \ + FRONTIER_MON_MAKUHITA, \ + FRONTIER_MON_WHISMUR, \ + FRONTIER_MON_ZIGZAGOON, \ + FRONTIER_MON_ZUBAT, \ + FRONTIER_MON_TOGEPI, \ + FRONTIER_MON_SPINARAK, \ + FRONTIER_MON_MARILL, \ + FRONTIER_MON_HOPPIP, \ + FRONTIER_MON_SLUGMA, \ + FRONTIER_MON_SWINUB, \ + FRONTIER_MON_SMEARGLE, \ + FRONTIER_MON_PIDGEY, \ + FRONTIER_MON_RATTATA, \ + FRONTIER_MON_WYNAUT, \ + FRONTIER_MON_SKITTY, \ + FRONTIER_MON_SPEAROW, \ + FRONTIER_MON_HOOTHOOT, \ + FRONTIER_MON_DIGLETT, \ + FRONTIER_MON_LEDYBA, \ + FRONTIER_MON_NINCADA, \ + FRONTIER_MON_SURSKIT, \ + FRONTIER_MON_JIGGLYPUFF, \ + FRONTIER_MON_TAILLOW, \ + FRONTIER_MON_WINGULL, \ + FRONTIER_MON_NIDORAN_M, \ + FRONTIER_MON_NIDORAN_F, \ + FRONTIER_MON_KIRLIA, \ + FRONTIER_MON_MAREEP, \ + FRONTIER_MON_MEDITITE, \ + FRONTIER_MON_SLAKOTH, \ + FRONTIER_MON_PARAS, \ + FRONTIER_MON_EKANS, \ + FRONTIER_MON_DITTO, \ + FRONTIER_MON_BARBOACH, \ + FRONTIER_MON_MEOWTH, \ + FRONTIER_MON_PINECO, \ + FRONTIER_MON_TRAPINCH, \ + FRONTIER_MON_SPHEAL, \ + FRONTIER_MON_HORSEA, \ + FRONTIER_MON_SHROOMISH, \ + FRONTIER_MON_SHUPPET, \ + FRONTIER_MON_DUSKULL, \ + FRONTIER_MON_ELECTRIKE, \ + FRONTIER_MON_VULPIX, \ -1 // Also used by early Pkmn Breeder, Collector, and Beauty trainers @@ -113,43 +113,43 @@ -1 #define FRONTIER_MONS_RICH_BOY_LADY_1 \ - FRONTIER_MON_RALTS, \ - FRONTIER_MON_POOCHYENA, \ - FRONTIER_MON_SHEDINJA, \ - FRONTIER_MON_ZUBAT, \ - FRONTIER_MON_SPINARAK, \ - FRONTIER_MON_WYNAUT, \ - FRONTIER_MON_NIDORAN_M, \ - FRONTIER_MON_NIDORAN_F, \ - FRONTIER_MON_KIRLIA, \ - FRONTIER_MON_MEDITITE, \ - FRONTIER_MON_EKANS, \ - FRONTIER_MON_SHUPPET, \ - FRONTIER_MON_DUSKULL, \ - FRONTIER_MON_BELLSPROUT, \ - FRONTIER_MON_BALTOY, \ - FRONTIER_MON_BELDUM, \ - FRONTIER_MON_GULPIN, \ - FRONTIER_MON_VENONAT, \ - FRONTIER_MON_SMOOCHUM, \ - FRONTIER_MON_ABRA, \ - FRONTIER_MON_GASTLY, \ - FRONTIER_MON_SLOWPOKE, \ - FRONTIER_MON_BULBASAUR, \ - FRONTIER_MON_ODDISH, \ - FRONTIER_MON_NATU, \ - FRONTIER_MON_GRIMER, \ - FRONTIER_MON_EXEGGCUTE, \ - FRONTIER_MON_DROWZEE, \ - FRONTIER_MON_HOUNDOUR, \ - FRONTIER_MON_SPOINK, \ - FRONTIER_MON_TENTACOOL, \ - FRONTIER_MON_KOFFING, \ - FRONTIER_MON_NIDORINA, \ - FRONTIER_MON_NIDORINO, \ - FRONTIER_MON_BEEDRILL, \ - FRONTIER_MON_DUSTOX, \ - FRONTIER_MON_ARIADOS, \ + FRONTIER_MON_RALTS, \ + FRONTIER_MON_POOCHYENA, \ + FRONTIER_MON_SHEDINJA, \ + FRONTIER_MON_ZUBAT, \ + FRONTIER_MON_SPINARAK, \ + FRONTIER_MON_WYNAUT, \ + FRONTIER_MON_NIDORAN_M, \ + FRONTIER_MON_NIDORAN_F, \ + FRONTIER_MON_KIRLIA, \ + FRONTIER_MON_MEDITITE, \ + FRONTIER_MON_EKANS, \ + FRONTIER_MON_SHUPPET, \ + FRONTIER_MON_DUSKULL, \ + FRONTIER_MON_BELLSPROUT, \ + FRONTIER_MON_BALTOY, \ + FRONTIER_MON_BELDUM, \ + FRONTIER_MON_GULPIN, \ + FRONTIER_MON_VENONAT, \ + FRONTIER_MON_SMOOCHUM, \ + FRONTIER_MON_ABRA, \ + FRONTIER_MON_GASTLY, \ + FRONTIER_MON_SLOWPOKE, \ + FRONTIER_MON_BULBASAUR, \ + FRONTIER_MON_ODDISH, \ + FRONTIER_MON_NATU, \ + FRONTIER_MON_GRIMER, \ + FRONTIER_MON_EXEGGCUTE, \ + FRONTIER_MON_DROWZEE, \ + FRONTIER_MON_HOUNDOUR, \ + FRONTIER_MON_SPOINK, \ + FRONTIER_MON_TENTACOOL, \ + FRONTIER_MON_KOFFING, \ + FRONTIER_MON_NIDORINA, \ + FRONTIER_MON_NIDORINO, \ + FRONTIER_MON_BEEDRILL, \ + FRONTIER_MON_DUSTOX, \ + FRONTIER_MON_ARIADOS, \ -1 // Also used by early Pkmn Breeder, Collector, and Beauty trainers From 94995c54fb98a5891bffb5612ada93de7a46dfdc Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Tue, 6 Sep 2022 23:35:05 +0200 Subject: [PATCH 102/155] fix? --- src/item_use.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/item_use.c b/src/item_use.c index 645a5d1647..0bab2fe376 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -1006,14 +1006,14 @@ void ItemUseInBattle_PokeBall(u8 taskId) else DisplayItemMessageInBattlePyramid(taskId, gText_BoxFull, Task_CloseBattlePyramidBagMessage); break; - #if B_SEMI_INVULNERABLE_CATCH >= GEN_4 +#if B_SEMI_INVULNERABLE_CATCH >= GEN_4 case BALL_THROW_UNABLE_SEMI_INVULNERABLE: if (!InBattlePyramid()) DisplayItemMessage(taskId, FONT_NORMAL, sText_CantThrowPokeBall_SemiInvulnerable, CloseItemMessage); else DisplayItemMessageInBattlePyramid(taskId, sText_CantThrowPokeBall_SemiInvulnerable, Task_CloseBattlePyramidBagMessage); break; - #endif +#endif case BALL_THROW_UNABLE_DISABLED_FLAG: if (!InBattlePyramid()) DisplayItemMessage(taskId, FONT_NORMAL, sText_CantThrowPokeBall_Disabled, CloseItemMessage); From f1c153e469be4040eb4fb7882c5893f571713fe2 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Tue, 6 Sep 2022 18:37:16 -0300 Subject: [PATCH 103/155] Merged FORM_ITEM_HOLD_ABILITY into FORM_ITEM_HOLD There was never a reason not to. --- include/constants/pokemon.h | 7 +- src/data/pokemon/form_change_tables.h | 115 +++++++++++++------------- src/party_menu.c | 5 +- src/pokemon.c | 8 +- src/pokemon_storage_system.c | 4 +- src/script_pokemon_util.c | 4 +- 6 files changed, 64 insertions(+), 79 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index c7101cfaca..6912cfe6bb 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -322,10 +322,9 @@ #define FORM_ITEM_USE 2 #define FORM_MOVE 3 #define FORM_WITHDRAW 4 -#define FORM_ITEM_HOLD_ABILITY 5 -#define FORM_ITEM_USE_TIME 6 -#define FORM_BATTLE_BEGIN 7 -#define FORM_BATTLE_END 8 +#define FORM_ITEM_USE_TIME 5 +#define FORM_BATTLE_BEGIN 6 +#define FORM_BATTLE_END 7 #define NUM_MALE_LINK_FACILITY_CLASSES 8 #define NUM_FEMALE_LINK_FACILITY_CLASSES 8 diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index 3a97f4efe6..f24fe4d850 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -1,7 +1,10 @@ /* FORM_ITEM_HOLD: Form change activates when the item is given to or taken from the selected Pokémon. + Alternatively, form change activates when the item is used on the selected Pokémon + that has a particular ability. param1 = item to hold + param2 = ability to check for, optional FORM_ITEM_USE: Form change activates when the item is used on the selected Pokémon. @@ -17,12 +20,6 @@ FORM_WITHDRAW: Form change activates when the Pokémon is withdrawn from the PC or Daycare. no parameters -FORM_ITEM_HOLD_ABILITY: - Form change activates when the item is used on the selected Pokémon that has - a particular ability. - param1 = item to use - param2 = ability to check for - FORM_ITEM_USE_TIME: Form change activates when the item is used on the selected Pokémon at the appropriate time of day. @@ -65,41 +62,41 @@ static const struct FormChange sShayminFormChangeTable[] = { }; static const struct FormChange sArceusFormChangeTable[] = { - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS, ITEM_NONE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_FIGHTING, ITEM_FIST_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_FIGHTING, ITEM_FIGHTINIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_FLYING, ITEM_SKY_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_FLYING, ITEM_FLYINIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_POISON, ITEM_TOXIC_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_POISON, ITEM_POISONIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_ROCK, ITEM_STONE_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_ROCK, ITEM_ROCKIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_GROUND, ITEM_EARTH_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_GROUND, ITEM_GROUNDIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_BUG, ITEM_INSECT_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_BUG, ITEM_BUGINIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_GHOST, ITEM_SPOOKY_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_GHOST, ITEM_GHOSTIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_STEEL, ITEM_IRON_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_STEEL, ITEM_STEELIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_FIRE, ITEM_FLAME_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_FIRE, ITEM_FIRIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_WATER, ITEM_SPLASH_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_WATER, ITEM_WATERIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_GRASS, ITEM_MEADOW_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_GRASS, ITEM_GRASSIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_ELECTRIC, ITEM_ZAP_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_ELECTRIC, ITEM_ELECTRIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_PSYCHIC, ITEM_MIND_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_PSYCHIC, ITEM_PSYCHIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_ICE, ITEM_ICICLE_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_ICE, ITEM_ICIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_DRAGON, ITEM_DRACO_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_DRAGON, ITEM_DRAGONIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_DARK, ITEM_DREAD_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_DARK, ITEM_DARKINIUM_Z, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_FAIRY, ITEM_PIXIE_PLATE, ABILITY_MULTITYPE}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_ARCEUS_FAIRY, ITEM_FAIRIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS, ITEM_NONE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_FIGHTING, ITEM_FIST_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_FIGHTING, ITEM_FIGHTINIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_FLYING, ITEM_SKY_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_FLYING, ITEM_FLYINIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_POISON, ITEM_TOXIC_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_POISON, ITEM_POISONIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_ROCK, ITEM_STONE_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_ROCK, ITEM_ROCKIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_GROUND, ITEM_EARTH_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_GROUND, ITEM_GROUNDIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_BUG, ITEM_INSECT_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_BUG, ITEM_BUGINIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_GHOST, ITEM_SPOOKY_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_GHOST, ITEM_GHOSTIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_STEEL, ITEM_IRON_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_STEEL, ITEM_STEELIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_FIRE, ITEM_FLAME_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_FIRE, ITEM_FIRIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_WATER, ITEM_SPLASH_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_WATER, ITEM_WATERIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_GRASS, ITEM_MEADOW_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_GRASS, ITEM_GRASSIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_ELECTRIC, ITEM_ZAP_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_ELECTRIC, ITEM_ELECTRIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_PSYCHIC, ITEM_MIND_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_PSYCHIC, ITEM_PSYCHIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_ICE, ITEM_ICICLE_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_ICE, ITEM_ICIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_DRAGON, ITEM_DRACO_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_DRAGON, ITEM_DRAGONIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_DARK, ITEM_DREAD_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_DARK, ITEM_DARKINIUM_Z, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_FAIRY, ITEM_PIXIE_PLATE, ABILITY_MULTITYPE}, + {FORM_ITEM_HOLD, SPECIES_ARCEUS_FAIRY, ITEM_FAIRIUM_Z, ABILITY_MULTITYPE}, {FORM_CHANGE_END}, }; @@ -151,24 +148,24 @@ static const struct FormChange sOricorioFormChangeTable[] = { }; static const struct FormChange sSilvallyFormChangeTable[] = { - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY, ITEM_NONE, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_FIGHTING, ITEM_FIGHTING_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_FLYING, ITEM_FLYING_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_POISON, ITEM_POISON_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_GROUND, ITEM_GROUND_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_ROCK, ITEM_ROCK_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_BUG, ITEM_BUG_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_GHOST, ITEM_GHOST_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_STEEL, ITEM_STEEL_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_FIRE, ITEM_FIRE_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_WATER, ITEM_WATER_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_GRASS, ITEM_GRASS_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_ELECTRIC, ITEM_ELECTRIC_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_PSYCHIC, ITEM_PSYCHIC_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_ICE, ITEM_ICE_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_DRAGON, ITEM_DRAGON_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_DARK, ITEM_DARK_MEMORY, ABILITY_RKS_SYSTEM}, - {FORM_ITEM_HOLD_ABILITY, SPECIES_SILVALLY_FAIRY, ITEM_FAIRY_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY, ITEM_NONE, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_FIGHTING, ITEM_FIGHTING_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_FLYING, ITEM_FLYING_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_POISON, ITEM_POISON_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_GROUND, ITEM_GROUND_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_ROCK, ITEM_ROCK_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_BUG, ITEM_BUG_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_GHOST, ITEM_GHOST_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_STEEL, ITEM_STEEL_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_FIRE, ITEM_FIRE_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_WATER, ITEM_WATER_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_GRASS, ITEM_GRASS_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_ELECTRIC, ITEM_ELECTRIC_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_PSYCHIC, ITEM_PSYCHIC_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_ICE, ITEM_ICE_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_DRAGON, ITEM_DRAGON_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_DARK, ITEM_DARK_MEMORY, ABILITY_RKS_SYSTEM}, + {FORM_ITEM_HOLD, SPECIES_SILVALLY_FAIRY, ITEM_FAIRY_MEMORY, ABILITY_RKS_SYSTEM}, {FORM_CHANGE_END}, }; #endif diff --git a/src/party_menu.c b/src/party_menu.c index 00224f6bd6..03e4a5826d 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5596,10 +5596,7 @@ void ItemUseCB_FormChange_ConsumedOnUse(u8 taskId, TaskFunc task) } void TryItemHoldFormChange(struct Pokemon *mon) { - u16 species = GetMonData(mon, MON_DATA_SPECIES); - u16 targetSpecies = GetFormChangeTargetSpecies(mon, FORM_ITEM_HOLD_ABILITY, 0); - if (targetSpecies == SPECIES_NONE) - targetSpecies = GetFormChangeTargetSpecies(mon, FORM_ITEM_HOLD, 0); + u16 targetSpecies = GetFormChangeTargetSpecies(mon, FORM_ITEM_HOLD, 0); if (targetSpecies != SPECIES_NONE) { PlayCry_NormalNoDucking(targetSpecies, 0, CRY_VOLUME_RS, CRY_VOLUME_RS); diff --git a/src/pokemon.c b/src/pokemon.c index 99a82ec130..4fbce67d1e 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8282,7 +8282,8 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 switch (method) { case FORM_ITEM_HOLD: - if (heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) + if ((heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) + || ability == formChanges[i].param2) targetSpecies = formChanges[i].targetSpecies; break; case FORM_ITEM_USE: @@ -8293,11 +8294,6 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 if (BoxMonKnowsMove(boxMon, formChanges[i].param1) != formChanges[i].param2) targetSpecies = formChanges[i].targetSpecies; break; - case FORM_ITEM_HOLD_ABILITY: - if ((heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) - && ability == formChanges[i].param2) - targetSpecies = formChanges[i].targetSpecies; - break; case FORM_ITEM_USE_TIME: RtcCalcLocalTime(); if (arg == formChanges[i].param1) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index d3f5d433f4..fba5bbcda9 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -6893,9 +6893,7 @@ static void ReshowDisplayMon(void) void SetMonFormPSS(struct BoxPokemon *boxMon) { - u16 targetSpecies = GetFormChangeTargetSpeciesBoxMon(boxMon, FORM_ITEM_HOLD_ABILITY, 0); - if (targetSpecies == SPECIES_NONE) - targetSpecies = GetFormChangeTargetSpeciesBoxMon(boxMon, FORM_ITEM_HOLD, 0); + u16 targetSpecies = GetFormChangeTargetSpeciesBoxMon(boxMon, FORM_ITEM_HOLD, 0); if (targetSpecies != SPECIES_NONE) { SetBoxMonData(boxMon, MON_DATA_SPECIES, &targetSpecies); diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c index 8a9e65ff8f..e33c8ffcad 100755 --- a/src/script_pokemon_util.c +++ b/src/script_pokemon_util.c @@ -72,9 +72,7 @@ u8 ScriptGiveMon(u16 species, u8 level, u16 item, u32 unused1, u32 unused2, u8 u SetMonData(&mon, MON_DATA_HELD_ITEM, heldItem); // In case a mon with a form changing item is given. Eg: SPECIES_ARCEUS with ITEM_SPLASH_PLATE will transform into SPECIES_ARCEUS_WATER upon gifted. - targetSpecies = GetFormChangeTargetSpecies(&mon, FORM_ITEM_HOLD_ABILITY, 0); - if (targetSpecies == SPECIES_NONE) - targetSpecies = GetFormChangeTargetSpecies(&mon, FORM_ITEM_HOLD, 0); + targetSpecies = GetFormChangeTargetSpecies(&mon, FORM_ITEM_HOLD, 0); if (targetSpecies != SPECIES_NONE) { SetMonData(&mon, MON_DATA_SPECIES, &targetSpecies); From a7a1ab9aeb5b965c31046601a874a2e3cebab286 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Tue, 6 Sep 2022 18:37:16 -0300 Subject: [PATCH 104/155] Merged FORM_ITEM_HOLD_ABILITY into FORM_ITEM_HOLD There was never a reason not to. --- src/data/pokemon/form_change_tables.h | 6 +++--- src/pokemon.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index f24fe4d850..ddcb4d9cbd 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -1,8 +1,8 @@ /* FORM_ITEM_HOLD: - Form change activates when the item is given to or taken from the selected Pokémon. - Alternatively, form change activates when the item is used on the selected Pokémon - that has a particular ability. + Form change activates when the specified item is given to or taken from the selected Pokémon. + Alternatively, form change activates when the specified item is is given to or taken from + the selected Pokémon that has a particular ability. param1 = item to hold param2 = ability to check for, optional diff --git a/src/pokemon.c b/src/pokemon.c index 4fbce67d1e..63b3dae9dc 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8285,6 +8285,8 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 if ((heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) || ability == formChanges[i].param2) targetSpecies = formChanges[i].targetSpecies; + if ((heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) && ability == formChanges[i].param2) + targetSpecies = formChanges[i].targetSpecies; break; case FORM_ITEM_USE: if (arg == formChanges[i].param1) From 3a0759d458a711196739a7397248cdf1d34069e9 Mon Sep 17 00:00:00 2001 From: sbird Date: Wed, 7 Sep 2022 14:37:03 +0200 Subject: [PATCH 105/155] [doc] fix misnamed dma <--> aslr --- include/load_save.h | 18 +++++++++--------- src/load_save.c | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/load_save.h b/include/load_save.h index 309e62e2b4..389bd5a2b9 100644 --- a/include/load_save.h +++ b/include/load_save.h @@ -10,24 +10,24 @@ * toolchains. If this is not done, the ClearSav functions will end up erasing * the wrong memory leading to various glitches. */ -struct SaveBlock2DMA { +struct SaveBlock2ASLR { struct SaveBlock2 block; - u8 dma[SAVEBLOCK_MOVE_RANGE]; + u8 aslr[SAVEBLOCK_MOVE_RANGE]; }; -struct SaveBlock1DMA { +struct SaveBlock1ASLR { struct SaveBlock1 block; - u8 dma[SAVEBLOCK_MOVE_RANGE]; + u8 aslr[SAVEBLOCK_MOVE_RANGE]; }; -struct PokemonStorageDMA { +struct PokemonStorageASLR { struct PokemonStorage block; - u8 dma[SAVEBLOCK_MOVE_RANGE]; + u8 aslr[SAVEBLOCK_MOVE_RANGE]; }; -extern struct SaveBlock1DMA gSaveblock1; -extern struct SaveBlock2DMA gSaveblock2; -extern struct PokemonStorageDMA gPokemonStorage; +extern struct SaveBlock1ASLR gSaveblock1; +extern struct SaveBlock2ASLR gSaveblock2; +extern struct PokemonStorageASLR gPokemonStorage; extern bool32 gFlashMemoryPresent; extern struct SaveBlock1 *gSaveBlock1Ptr; diff --git a/src/load_save.c b/src/load_save.c index 494a61bcf2..44e08b5e9c 100644 --- a/src/load_save.c +++ b/src/load_save.c @@ -29,9 +29,9 @@ struct LoadedSaveData }; // EWRAM DATA -EWRAM_DATA struct SaveBlock2DMA gSaveblock2 = {0}; -EWRAM_DATA struct SaveBlock1DMA gSaveblock1 = {0}; -EWRAM_DATA struct PokemonStorageDMA gPokemonStorage = {0}; +EWRAM_DATA struct SaveBlock2ASLR gSaveblock2 = {0}; +EWRAM_DATA struct SaveBlock1ASLR gSaveblock1 = {0}; +EWRAM_DATA struct PokemonStorageASLR gPokemonStorage = {0}; EWRAM_DATA struct LoadedSaveData gLoadedSaveData = {0}; EWRAM_DATA u32 gLastEncryptionKey = 0; @@ -58,12 +58,12 @@ void CheckForFlashMemory(void) void ClearSav2(void) { - CpuFill16(0, &gSaveblock2, sizeof(struct SaveBlock2DMA)); + CpuFill16(0, &gSaveblock2, sizeof(struct SaveBlock2ASLR)); } void ClearSav1(void) { - CpuFill16(0, &gSaveblock1, sizeof(struct SaveBlock1DMA)); + CpuFill16(0, &gSaveblock1, sizeof(struct SaveBlock1ASLR)); } // Offset is the sum of the trainer id bytes From 05c13614c64ecc79b4aabf455e0c073a9f9424ae Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 7 Sep 2022 13:41:48 -0300 Subject: [PATCH 106/155] Undefined temporary preproc macro HIBYTE --- src/pokeball.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pokeball.c b/src/pokeball.c index b9f63e5806..2633fd5740 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -977,6 +977,8 @@ static void SpriteCB_PlayerMonSendOut_2(struct Sprite *sprite) } } +#undef HIBYTE + static void SpriteCB_ReleaseMon2FromBall(struct Sprite *sprite) { if (sprite->data[0]++ > 24) From 4a6d3d1debab52c5e9fd5284062d924d583295b4 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Thu, 8 Sep 2022 00:19:13 -0400 Subject: [PATCH 107/155] Whitespace --- src/item_use.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item_use.c b/src/item_use.c index 0bab2fe376..5cd162519f 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -983,7 +983,7 @@ static const u8 sText_CantThrowPokeBall_TwoMons[] = _("Cannot throw a ball!\nThe static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a ball!\nThere's no Pokémon in sight!\p"); static const u8 sText_CantThrowPokeBall_Disabled[] = _("POKé BALLS cannot be used\nright now!\p"); void ItemUseInBattle_PokeBall(u8 taskId) -{ +{ switch (GetBallThrowableState()) { case BALL_THROW_ABLE: From d58af1ba9217963706cefbae06a0eb0999ccd441 Mon Sep 17 00:00:00 2001 From: Jaizu Date: Thu, 8 Sep 2022 10:38:52 +0200 Subject: [PATCH 108/155] Fix 'y' actually being 'x' in CreatePCMultichoice --- src/script_menu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/script_menu.c b/src/script_menu.c index d25f28cb29..6633332f3f 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -328,7 +328,7 @@ bool16 ScriptMenu_CreatePCMultichoice(void) static void CreatePCMultichoice(void) { - u8 y = 8; + u8 x = 8; u32 pixelWidth = 0; u8 width; u8 numChoices; @@ -353,25 +353,25 @@ static void CreatePCMultichoice(void) numChoices = 4; windowId = CreateWindowFromRect(0, 0, width, 8); SetStandardWindowBorderStyle(windowId, FALSE); - AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_HallOfFame, y, 33, TEXT_SKIP_DRAW, NULL); - AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LogOff, y, 49, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_HallOfFame, x, 33, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LogOff, x, 49, TEXT_SKIP_DRAW, NULL); } else { numChoices = 3; windowId = CreateWindowFromRect(0, 0, width, 6); SetStandardWindowBorderStyle(windowId, FALSE); - AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LogOff, y, 33, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LogOff, x, 33, TEXT_SKIP_DRAW, NULL); } // Change PC name if player has met Lanette if (FlagGet(FLAG_SYS_PC_LANETTE)) - AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LanettesPC, y, 1, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_LanettesPC, x, 1, TEXT_SKIP_DRAW, NULL); else - AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_SomeonesPC, y, 1, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_SomeonesPC, x, 1, TEXT_SKIP_DRAW, NULL); StringExpandPlaceholders(gStringVar4, gText_PlayersPC); - PrintPlayerNameOnWindow(windowId, gStringVar4, y, 17); + PrintPlayerNameOnWindow(windowId, gStringVar4, x, 17); InitMenuInUpperLeftCornerNormal(windowId, numChoices, 0); CopyWindowToVram(windowId, COPYWIN_FULL); InitMultichoiceCheckWrap(FALSE, numChoices, windowId, MULTI_PC); From 3acb32acb826ddb693c346da517a9a1b203b3582 Mon Sep 17 00:00:00 2001 From: Blackforest92 Date: Fri, 9 Sep 2022 00:25:43 +0700 Subject: [PATCH 109/155] Tyding graphics - Acupressure --- data/battle_anim_scripts.s | 6 +- .../battle_anims/sprites/accupressure.png | Bin 358 -> 0 bytes graphics/battle_anims/sprites/acupressure.png | Bin 0 -> 310 bytes .../sprites/acupressure_finger.png | Bin 298 -> 0 bytes include/constants/battle_anim.h | 125 +++++++++--------- include/constants/map_groups.h | 2 + include/graphics.h | 6 +- src/battle_anim_effects_1.c | 6 +- src/battle_anim_rock.c | 2 +- src/data/battle_anim.h | 6 +- src/graphics.c | 7 +- 11 files changed, 77 insertions(+), 83 deletions(-) delete mode 100644 graphics/battle_anims/sprites/accupressure.png create mode 100644 graphics/battle_anims/sprites/acupressure.png delete mode 100644 graphics/battle_anims/sprites/acupressure_finger.png diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 6a46a2d55e..f83d437a5d 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -1185,9 +1185,9 @@ Move_TAILWIND: end Move_ACUPRESSURE: - loadspritegfx ANIM_TAG_ACCUPRESSURE + loadspritegfx ANIM_TAG_ACUPRESSURE loadspritegfx ANIM_TAG_SPARK_2 - createsprite gAccupressureSpriteTemplate, ANIM_ATTACKER, 40, 0, -40, 40 + createsprite gAcupressureSpriteTemplate, ANIM_ATTACKER, 40, 0, -40, 40 waitforvisualfinish call ElectricityEffect end @@ -4337,7 +4337,7 @@ Move_LUNAR_DANCE: Move_CRUSH_GRIP: loadspritegfx ANIM_TAG_EXPLOSION - loadspritegfx ANIM_TAG_ACCUPRESSURE + loadspritegfx ANIM_TAG_ACUPRESSURE loadspritegfx ANIM_TAG_PURPLE_HAND_OUTLINE setalpha 15, 0 createsprite gCrushGripHandTemplate, ANIM_TARGET, 2, 16, 0, 0, 0, 25, 0x101 diff --git a/graphics/battle_anims/sprites/accupressure.png b/graphics/battle_anims/sprites/accupressure.png deleted file mode 100644 index 0da836ff3fec4d52d5a2d30f4ae9cffb83aac295..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 358 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvxd5LKS0D`p5gri<0SP-+95}Gy z#Elydz~IG)4t8*0pd71sZz_izopr07S5TX#fBK diff --git a/graphics/battle_anims/sprites/acupressure.png b/graphics/battle_anims/sprites/acupressure.png new file mode 100644 index 0000000000000000000000000000000000000000..5d8ae62bc9ca1592ea13573666e6b9eccd5b3efc GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvg8-ip*NOux1Ox;kJR%YT5_YUO zaA3oU8#f++!HW+cJ^)prf!W#bgn>c_JzX3_G$yuA^cHF|5ODDOE pQ2T!%k^7adzzVa5`kV{9p7WJ!31o~*OvfAw|crbhE&X%I>DRoumX?E&7Ulm&io7=%mzW%0=sv( z**os5D^%$84F8%p@7Uplj!6HeWJXI%Shm$RvT(O3n*>^DZq)>O8t(PQvA^ z)N1Fn?E%-@TXWg}#ujaySe<9h+Ho=btuwPc!_}1BE!GdNIxmtmZz(q%Q~loCIEZJaCiU! diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 28bcb283d4..db2efd8d05 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -308,7 +308,7 @@ #define ANIM_TAG_MEGA_PARTICLES (ANIM_SPRITES_START + 297) #define ANIM_TAG_TRUMP_CARD (ANIM_SPRITES_START + 298) #define ANIM_TAG_TRUMP_CARD_PARTICLES (ANIM_SPRITES_START + 299) -#define ANIM_TAG_ACCUPRESSURE (ANIM_SPRITES_START + 300) +#define ANIM_TAG_ACUPRESSURE (ANIM_SPRITES_START + 300) #define ANIM_TAG_WRING_OUT (ANIM_SPRITES_START + 301) #define ANIM_TAG_COLORED_ORBS (ANIM_SPRITES_START + 302) #define ANIM_TAG_WORRY_SEED (ANIM_SPRITES_START + 303) @@ -334,68 +334,67 @@ #define ANIM_TAG_BRINE (ANIM_SPRITES_START + 322) #define ANIM_TAG_GEAR (ANIM_SPRITES_START + 323) #define ANIM_TAG_ASSURANCE_HAND (ANIM_SPRITES_START + 324) -#define ANIM_TAG_ACUPRESSURE_FINGER (ANIM_SPRITES_START + 325) -#define ANIM_TAG_WISHIWASHI_FISH (ANIM_SPRITES_START + 326) -#define ANIM_TAG_ZYGARDE_HEXES (ANIM_SPRITES_START + 327) -#define ANIM_TAG_AURA_SPHERE (ANIM_SPRITES_START + 328) -#define ANIM_TAG_OMEGA_STONE (ANIM_SPRITES_START + 329) -#define ANIM_TAG_ALPHA_STONE (ANIM_SPRITES_START + 330) -#define ANIM_TAG_BERRY_NORMAL (ANIM_SPRITES_START + 331) -#define ANIM_TAG_BERRY_EATEN (ANIM_SPRITES_START + 332) -#define ANIM_TAG_DRAGON_ASCENT (ANIM_SPRITES_START + 333) -#define ANIM_TAG_PINK_DIAMOND (ANIM_SPRITES_START + 334) -#define ANIM_TAG_STEAM_ERUPTION (ANIM_SPRITES_START + 335) -#define ANIM_TAG_CONFIDE (ANIM_SPRITES_START + 336) -#define ANIM_TAG_VERTICAL_HEX (ANIM_SPRITES_START + 337) -#define ANIM_TAG_UNAVAILABLE_1 (ANIM_SPRITES_START + 338) //0x2862.. supposedly used elsewhere? -#define ANIM_TAG_UNAVAILABLE_2 (ANIM_SPRITES_START + 339) -#define ANIM_TAG_POWER_TRICK (ANIM_SPRITES_START + 340) -#define ANIM_TAG_CHAIN_LINK (ANIM_SPRITES_START + 341) -#define ANIM_TAG_ANCHOR (ANIM_SPRITES_START + 342) -#define ANIM_TAG_HORSESHOE_SIDE_FIST (ANIM_SPRITES_START + 343) -#define ANIM_TAG_DRAGON_ASCENT_FOE (ANIM_SPRITES_START + 344) -#define ANIM_TAG_CRAFTY_SHIELD (ANIM_SPRITES_START + 345) -#define ANIM_TAG_BLACEPHALON_HEAD (ANIM_SPRITES_START + 346) -#define ANIM_TAG_FAIRY_LOCK_CHAINS (ANIM_SPRITES_START + 347) -#define ANIM_TAG_IONS (ANIM_SPRITES_START + 348) -#define ANIM_TAG_CHOP (ANIM_SPRITES_START + 349) -#define ANIM_TAG_HEART_STAMP (ANIM_SPRITES_START + 350) -#define ANIM_TAG_HORN_LEECH (ANIM_SPRITES_START + 351) -#define ANIM_TAG_STEAMROLLER (ANIM_SPRITES_START + 352) -#define ANIM_TAG_HOOPA_HAND (ANIM_SPRITES_START + 353) -#define ANIM_TAG_HOOPA_RING (ANIM_SPRITES_START + 354) -#define ANIM_TAG_METAL_BITS (ANIM_SPRITES_START + 355) -#define ANIM_TAG_SMALL_ROCK (ANIM_SPRITES_START + 356) -#define ANIM_TAG_SPIRIT_ARROW (ANIM_SPRITES_START + 357) -#define ANIM_TAG_ULTRA_BURST_SYMBOL (ANIM_SPRITES_START + 358) -#define ANIM_TAG_Z_MOVE_SYMBOL (ANIM_SPRITES_START + 359) -#define ANIM_TAG_REALLY_BIG_ROCK (ANIM_SPRITES_START + 360) -#define ANIM_TAG_COCOON (ANIM_SPRITES_START + 361) -#define ANIM_TAG_CORKSCREW (ANIM_SPRITES_START + 362) -#define ANIM_TAG_HAVOC_SPEAR (ANIM_SPRITES_START + 363) -#define ANIM_TAG_PURPLE_DRAKE (ANIM_SPRITES_START + 364) -#define ANIM_TAG_MUD_BOMB (ANIM_SPRITES_START + 365) -#define ANIM_TAG_BRANCH (ANIM_SPRITES_START + 366) -#define ANIM_TAG_APPLE (ANIM_SPRITES_START + 367) -#define ANIM_TAG_OBSTRUCT_CROSS (ANIM_SPRITES_START + 368) -#define ANIM_TAG_POISON_COLUMN (ANIM_SPRITES_START + 369) -#define ANIM_TAG_GARBAGE_COLUMN (ANIM_SPRITES_START + 370) -#define ANIM_TAG_LARGE_SPIKE (ANIM_SPRITES_START + 371) -#define ANIM_TAG_DRAGON_PULSE_RING (ANIM_SPRITES_START + 372) -#define ANIM_TAG_STONE_PILLAR (ANIM_SPRITES_START + 373) -#define ANIM_TAG_MUSHROOM (ANIM_SPRITES_START + 374) -#define ANIM_TAG_GOLDEN_APPLE (ANIM_SPRITES_START + 375) -#define ANIM_TAG_ICE_ROCK (ANIM_SPRITES_START + 376) -#define ANIM_TAG_TORNADO (ANIM_SPRITES_START + 377) -#define ANIM_TAG_STRAIGHT_BEAM (ANIM_SPRITES_START + 378) -#define ANIM_TAG_DREEPY (ANIM_SPRITES_START + 379) -#define ANIM_TAG_ICE_ROCK_SINGLE (ANIM_SPRITES_START + 380) -#define ANIM_TAG_STONE_PILLAR_MULTI (ANIM_SPRITES_START + 381) -#define ANIM_TAG_ALPHA_SYMBOL (ANIM_SPRITES_START + 382) -#define ANIM_TAG_OMEGA_SYMBOL (ANIM_SPRITES_START + 383) -#define ANIM_TAG_PRIMAL_PARTICLES (ANIM_SPRITES_START + 384) -#define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 385) -#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 386) +#define ANIM_TAG_WISHIWASHI_FISH (ANIM_SPRITES_START + 325) +#define ANIM_TAG_ZYGARDE_HEXES (ANIM_SPRITES_START + 326) +#define ANIM_TAG_AURA_SPHERE (ANIM_SPRITES_START + 327) +#define ANIM_TAG_OMEGA_STONE (ANIM_SPRITES_START + 328) +#define ANIM_TAG_ALPHA_STONE (ANIM_SPRITES_START + 329) +#define ANIM_TAG_BERRY_NORMAL (ANIM_SPRITES_START + 330) +#define ANIM_TAG_BERRY_EATEN (ANIM_SPRITES_START + 331) +#define ANIM_TAG_DRAGON_ASCENT (ANIM_SPRITES_START + 332) +#define ANIM_TAG_PINK_DIAMOND (ANIM_SPRITES_START + 333) +#define ANIM_TAG_STEAM_ERUPTION (ANIM_SPRITES_START + 334) +#define ANIM_TAG_CONFIDE (ANIM_SPRITES_START + 335) +#define ANIM_TAG_VERTICAL_HEX (ANIM_SPRITES_START + 336) +#define ANIM_TAG_UNAVAILABLE_1 (ANIM_SPRITES_START + 337) //0x2862.. supposedly used elsewhere? +#define ANIM_TAG_UNAVAILABLE_2 (ANIM_SPRITES_START + 338) +#define ANIM_TAG_POWER_TRICK (ANIM_SPRITES_START + 339) +#define ANIM_TAG_CHAIN_LINK (ANIM_SPRITES_START + 340) +#define ANIM_TAG_ANCHOR (ANIM_SPRITES_START + 341) +#define ANIM_TAG_HORSESHOE_SIDE_FIST (ANIM_SPRITES_START + 342) +#define ANIM_TAG_DRAGON_ASCENT_FOE (ANIM_SPRITES_START + 343) +#define ANIM_TAG_CRAFTY_SHIELD (ANIM_SPRITES_START + 344) +#define ANIM_TAG_BLACEPHALON_HEAD (ANIM_SPRITES_START + 345) +#define ANIM_TAG_FAIRY_LOCK_CHAINS (ANIM_SPRITES_START + 346) +#define ANIM_TAG_IONS (ANIM_SPRITES_START + 347) +#define ANIM_TAG_CHOP (ANIM_SPRITES_START + 348) +#define ANIM_TAG_HEART_STAMP (ANIM_SPRITES_START + 349) +#define ANIM_TAG_HORN_LEECH (ANIM_SPRITES_START + 350) +#define ANIM_TAG_STEAMROLLER (ANIM_SPRITES_START + 351) +#define ANIM_TAG_HOOPA_HAND (ANIM_SPRITES_START + 352) +#define ANIM_TAG_HOOPA_RING (ANIM_SPRITES_START + 353) +#define ANIM_TAG_METAL_BITS (ANIM_SPRITES_START + 354) +#define ANIM_TAG_SMALL_ROCK (ANIM_SPRITES_START + 355) +#define ANIM_TAG_SPIRIT_ARROW (ANIM_SPRITES_START + 356) +#define ANIM_TAG_ULTRA_BURST_SYMBOL (ANIM_SPRITES_START + 357) +#define ANIM_TAG_Z_MOVE_SYMBOL (ANIM_SPRITES_START + 358) +#define ANIM_TAG_REALLY_BIG_ROCK (ANIM_SPRITES_START + 359) +#define ANIM_TAG_COCOON (ANIM_SPRITES_START + 360) +#define ANIM_TAG_CORKSCREW (ANIM_SPRITES_START + 361) +#define ANIM_TAG_HAVOC_SPEAR (ANIM_SPRITES_START + 362) +#define ANIM_TAG_PURPLE_DRAKE (ANIM_SPRITES_START + 363) +#define ANIM_TAG_MUD_BOMB (ANIM_SPRITES_START + 364) +#define ANIM_TAG_BRANCH (ANIM_SPRITES_START + 365) +#define ANIM_TAG_APPLE (ANIM_SPRITES_START + 366) +#define ANIM_TAG_OBSTRUCT_CROSS (ANIM_SPRITES_START + 367) +#define ANIM_TAG_POISON_COLUMN (ANIM_SPRITES_START + 368) +#define ANIM_TAG_GARBAGE_COLUMN (ANIM_SPRITES_START + 369) +#define ANIM_TAG_LARGE_SPIKE (ANIM_SPRITES_START + 370) +#define ANIM_TAG_DRAGON_PULSE_RING (ANIM_SPRITES_START + 371) +#define ANIM_TAG_STONE_PILLAR (ANIM_SPRITES_START + 372) +#define ANIM_TAG_MUSHROOM (ANIM_SPRITES_START + 373) +#define ANIM_TAG_GOLDEN_APPLE (ANIM_SPRITES_START + 374) +#define ANIM_TAG_ICE_ROCK (ANIM_SPRITES_START + 375) +#define ANIM_TAG_TORNADO (ANIM_SPRITES_START + 376) +#define ANIM_TAG_STRAIGHT_BEAM (ANIM_SPRITES_START + 377) +#define ANIM_TAG_DREEPY (ANIM_SPRITES_START + 378) +#define ANIM_TAG_ICE_ROCK_SINGLE (ANIM_SPRITES_START + 379) +#define ANIM_TAG_STONE_PILLAR_MULTI (ANIM_SPRITES_START + 380) +#define ANIM_TAG_ALPHA_SYMBOL (ANIM_SPRITES_START + 381) +#define ANIM_TAG_OMEGA_SYMBOL (ANIM_SPRITES_START + 382) +#define ANIM_TAG_PRIMAL_PARTICLES (ANIM_SPRITES_START + 383) +#define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 384) +#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 385) // battlers #define ANIM_ATTACKER 0 diff --git a/include/constants/map_groups.h b/include/constants/map_groups.h index eaf40a525d..2e6c781943 100755 --- a/include/constants/map_groups.h +++ b/include/constants/map_groups.h @@ -593,4 +593,6 @@ #define MAP_GROUPS_COUNT 34 +// static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; + #endif // GUARD_CONSTANTS_MAP_GROUPS_H diff --git a/include/graphics.h b/include/graphics.h index 80532ad933..197cb4bb41 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -9304,7 +9304,7 @@ extern const u32 gBattleAnimSpriteGfx_Bird[]; extern const u32 gBattleAnimSpriteGfx_CrossImpact[]; extern const u32 gBattleAnimSpriteGfx_TrumpCard[]; extern const u32 gBattleAnimSpriteGfx_TrumpCardParticles[]; -extern const u32 gBattleAnimSpriteGfx_Accupressure[]; +extern const u32 gBattleAnimSpriteGfx_Acupressure[]; extern const u32 gBattleAnimSpriteGfx_WringOut[]; extern const u32 gBattleAnimSpriteGfx_ColoredOrbs[]; extern const u32 gBattleAnimSpriteGfx_WorrySeed[]; @@ -9606,7 +9606,7 @@ extern const u32 gBattleAnimSpritePal_WhipHit[]; extern const u32 gBattleAnimSpritePal_BlueRing2[]; extern const u32 gBattleAnimSpritePal_TrumpCard[]; extern const u32 gBattleAnimSpritePal_TrumpCardParticles[]; -extern const u32 gBattleAnimSpritePal_Accupressure[]; +extern const u32 gBattleAnimSpritePal_Acupressure[]; extern const u32 gBattleAnimSpritePal_WringOut[]; extern const u32 gBattleAnimSpritePal_ColoredOrbs[]; extern const u32 gBattleAnimSpritePal_WorrySeed[]; @@ -9645,8 +9645,6 @@ extern const u32 gBattleAnimSpriteGfx_QuickGuard[]; extern const u32 gBattleAnimSpritePal_QuickGuard[]; // New Battle Anim Particles -extern const u32 gBattleAnimSpriteGfx_AcupressureFinger[]; -extern const u32 gBattleAnimSpritePal_AcupressureFinger[]; extern const u32 gBattleAnimSpriteGfx_AlphaStone[]; extern const u32 gBattleAnimSpritePal_AlphaStone[]; extern const u32 gBattleAnimSpriteGfx_AlphaSymbol[]; diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index ff9495d0e0..048b37c660 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -354,10 +354,10 @@ const struct SpriteTemplate gSmallCloudTemplate = .callback = AnimMoveSmallCloud }; -const struct SpriteTemplate gAccupressureSpriteTemplate = +const struct SpriteTemplate gAcupressureSpriteTemplate = { - .tileTag = ANIM_TAG_ACCUPRESSURE, - .paletteTag = ANIM_TAG_ACCUPRESSURE, + .tileTag = ANIM_TAG_ACUPRESSURE, + .paletteTag = ANIM_TAG_ACUPRESSURE, .oam = &gOamData_AffineDouble_ObjNormal_32x32, .anims = gDummySpriteAnimTable, .images = NULL, diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c index e1a90b1948..b1ccc9a582 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -331,7 +331,7 @@ static const union AffineAnimCmd* const sSpriteAffineAnimTable_CrushGripHand[] = const struct SpriteTemplate gCrushGripHandTemplate = { .tileTag = ANIM_TAG_PURPLE_HAND_OUTLINE, - .paletteTag = ANIM_TAG_ACCUPRESSURE, + .paletteTag = ANIM_TAG_ACUPRESSURE, .oam = &gOamData_AffineNormal_ObjNormal_32x32, .anims = sAnims_BasicRock, .images = NULL, diff --git a/src/data/battle_anim.h b/src/data/battle_anim.h index b8fb8c0378..6a67e0cd60 100644 --- a/src/data/battle_anim.h +++ b/src/data/battle_anim.h @@ -1365,7 +1365,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_MegaParticles, 0x0180, ANIM_TAG_MEGA_PARTICLES}, {gBattleAnimSpriteGfx_TrumpCard, 0x0180, ANIM_TAG_TRUMP_CARD}, {gBattleAnimSpriteGfx_TrumpCardParticles, 0x0060, ANIM_TAG_TRUMP_CARD_PARTICLES}, - {gBattleAnimSpriteGfx_Accupressure, 0x0200, ANIM_TAG_ACCUPRESSURE}, + {gBattleAnimSpriteGfx_Acupressure, 0x0200, ANIM_TAG_ACUPRESSURE}, {gBattleAnimSpriteGfx_WringOut, 0x0200, ANIM_TAG_WRING_OUT}, {gBattleAnimSpriteGfx_ColoredOrbs, 0x0300, ANIM_TAG_COLORED_ORBS}, {gBattleAnimSpriteGfx_WorrySeed, 0x0080, ANIM_TAG_WORRY_SEED}, @@ -1390,7 +1390,6 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_Brine, 0xc00, ANIM_TAG_BRINE}, {gBattleAnimSpriteGfx_Gear, 0x200, ANIM_TAG_GEAR}, {gBattleAnimSpriteGfx_AssuranceHand, 0x200, ANIM_TAG_ASSURANCE_HAND}, - {gBattleAnimSpriteGfx_AcupressureFinger, 0x200, ANIM_TAG_ACUPRESSURE_FINGER}, {gBattleAnimSpriteGfx_Fishies, 0x480, ANIM_TAG_WISHIWASHI_FISH}, {gBattleAnimSpriteGfx_ZygardeHexes, 0x480, ANIM_TAG_ZYGARDE_HEXES}, {gBattleAnimSpriteGfx_AuraSphere, 0x200, ANIM_TAG_AURA_SPHERE}, @@ -1817,7 +1816,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_MegaParticles, ANIM_TAG_MEGA_PARTICLES}, {gBattleAnimSpritePal_TrumpCard, ANIM_TAG_TRUMP_CARD}, {gBattleAnimSpritePal_TrumpCardParticles, ANIM_TAG_TRUMP_CARD_PARTICLES}, - {gBattleAnimSpritePal_Accupressure, ANIM_TAG_ACCUPRESSURE}, + {gBattleAnimSpritePal_Acupressure, ANIM_TAG_ACUPRESSURE}, {gBattleAnimSpritePal_WringOut, ANIM_TAG_WRING_OUT}, {gBattleAnimSpritePal_ColoredOrbs, ANIM_TAG_COLORED_ORBS}, {gBattleAnimSpritePal_WorrySeed, ANIM_TAG_WORRY_SEED}, @@ -1842,7 +1841,6 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_Brine, ANIM_TAG_BRINE}, {gBattleAnimSpritePal_Gear, ANIM_TAG_GEAR}, {gBattleAnimSpritePal_AssuranceHand, ANIM_TAG_ASSURANCE_HAND}, - {gBattleAnimSpritePal_AcupressureFinger, ANIM_TAG_ACUPRESSURE_FINGER}, {gBattleAnimSpritePal_Fishies, ANIM_TAG_WISHIWASHI_FISH}, {gBattleAnimSpritePal_ZygardeHexes, ANIM_TAG_ZYGARDE_HEXES}, {gBattleAnimSpritePal_AuraSphere, ANIM_TAG_AURA_SPHERE}, diff --git a/src/graphics.c b/src/graphics.c index a59d919527..6a12dda1cc 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -57,9 +57,6 @@ const u32 gBattleAnimSpritePal_Punishment[] = INCBIN_U32("graphics/battle_anims/ const u32 gBattleAnimSpriteGfx_QuickGuard[] = INCBIN_U32("graphics/battle_anims/sprites/quick_guard.4bpp.lz"); const u32 gBattleAnimSpritePal_QuickGuard[] = INCBIN_U32("graphics/battle_anims/sprites/quick_guard.gbapal.lz"); -const u32 gBattleAnimSpritePal_AcupressureFinger[] = INCBIN_U32("graphics/battle_anims/sprites/acupressure_finger.gbapal.lz"); -const u32 gBattleAnimSpriteGfx_AcupressureFinger[] = INCBIN_U32("graphics/battle_anims/sprites/acupressure_finger.4bpp.lz"); - const u32 gBattleAnimSpriteGfx_AlphaStone[] = INCBIN_U32("graphics/battle_anims/sprites/alpha_stone.4bpp.lz"); const u32 gBattleAnimSpritePal_AlphaStone[] = INCBIN_U32("graphics/battle_anims/sprites/alpha_stone.gbapal.lz"); @@ -375,8 +372,8 @@ const u32 gBattleAnimSpritePal_TrumpCard[] = INCBIN_U32("graphics/battle_anims/s const u32 gBattleAnimSpriteGfx_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump_card_particles.4bpp.lz"); const u32 gBattleAnimSpritePal_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump_card_particles.gbapal.lz"); -const u32 gBattleAnimSpriteGfx_Accupressure[] = INCBIN_U32("graphics/battle_anims/sprites/accupressure.4bpp.lz"); -const u32 gBattleAnimSpritePal_Accupressure[] = INCBIN_U32("graphics/battle_anims/sprites/accupressure.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_Acupressure[] = INCBIN_U32("graphics/battle_anims/sprites/acupressure.4bpp.lz"); +const u32 gBattleAnimSpritePal_Acupressure[] = INCBIN_U32("graphics/battle_anims/sprites/acupressure.gbapal.lz"); const u32 gBattleAnimSpriteGfx_WringOut[] = INCBIN_U32("graphics/battle_anims/sprites/wring_out.4bpp.lz"); const u32 gBattleAnimSpritePal_WringOut[] = INCBIN_U32("graphics/battle_anims/sprites/wring_out.gbapal.lz"); From caf323a653907cfa4158cc86ef9be124afce48a5 Mon Sep 17 00:00:00 2001 From: Blackforest92 Date: Fri, 9 Sep 2022 00:40:30 +0700 Subject: [PATCH 110/155] Erase ghost data in include/constants/map_groups.h --- include/constants/map_groups.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/constants/map_groups.h b/include/constants/map_groups.h index 2e6c781943..eaf40a525d 100755 --- a/include/constants/map_groups.h +++ b/include/constants/map_groups.h @@ -593,6 +593,4 @@ #define MAP_GROUPS_COUNT 34 -// static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; - #endif // GUARD_CONSTANTS_MAP_GROUPS_H From db6d285f00ad5ce09b06ef282d29727d34bd6d07 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 8 Sep 2022 17:53:15 -0300 Subject: [PATCH 111/155] Small syntax fix for CanLearnTeachableMove --- src/pokemon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index d3b401e8c3..fc80330306 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -7297,9 +7297,8 @@ u8 CanLearnTeachableMove(u16 species, u16 move) u8 i; for (i = 0; gTeachableLearnsets[species][i] != MOVE_UNAVAILABLE; i++) { - if (gTeachableLearnsets[species][i] == move) { + if (gTeachableLearnsets[species][i] == move) return TRUE; - } } return FALSE; } From 1fa9bc1b5c5a2eed1f88462757968c3f8d1cb26b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 8 Sep 2022 18:32:01 -0400 Subject: [PATCH 112/155] Adjusted style of coords tables --- .../pokemon_graphics/back_pic_coordinates.h | 2640 +++-------------- .../pokemon_graphics/front_pic_coordinates.h | 2640 +++-------------- 2 files changed, 880 insertions(+), 4400 deletions(-) diff --git a/src/data/pokemon_graphics/back_pic_coordinates.h b/src/data/pokemon_graphics/back_pic_coordinates.h index addb482851..43986dd9b0 100644 --- a/src/data/pokemon_graphics/back_pic_coordinates.h +++ b/src/data/pokemon_graphics/back_pic_coordinates.h @@ -4,2205 +4,445 @@ // .y_offset is the number of pixels between the drawn pixel area and the bottom edge. const struct MonCoords gMonBackPicCoords[] = { - [SPECIES_NONE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_BULBASAUR] = - { - .size = MON_COORDS_SIZE(48, 32), - .y_offset = 16, - }, - [SPECIES_IVYSAUR] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_VENUSAUR] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_CHARMANDER] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 14, - }, - [SPECIES_CHARMELEON] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_CHARIZARD] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_SQUIRTLE] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 14, - }, - [SPECIES_WARTORTLE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_BLASTOISE] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_CATERPIE] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 15, - }, - [SPECIES_METAPOD] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_BUTTERFREE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_WEEDLE] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 11, - }, - [SPECIES_KAKUNA] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 10, - }, - [SPECIES_BEEDRILL] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 9, - }, - [SPECIES_PIDGEY] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_PIDGEOTTO] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 12, - }, - [SPECIES_PIDGEOT] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 2, - }, - [SPECIES_RATTATA] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_RATICATE] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 13, - }, - [SPECIES_SPEAROW] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_FEAROW] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_EKANS] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_ARBOK] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_PIKACHU] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_RAICHU] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_SANDSHREW] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_SANDSLASH] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 9, - }, - [SPECIES_NIDORAN_F] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 12, - }, - [SPECIES_NIDORINA] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_NIDOQUEEN] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_NIDORAN_M] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 8, - }, - [SPECIES_NIDORINO] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 9, - }, - [SPECIES_NIDOKING] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_CLEFAIRY] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_CLEFABLE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_VULPIX] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_NINETALES] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_JIGGLYPUFF] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_WIGGLYTUFF] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_ZUBAT] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_GOLBAT] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_ODDISH] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 11, - }, - [SPECIES_GLOOM] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_VILEPLUME] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_PARAS] = - { - .size = MON_COORDS_SIZE(48, 24), - .y_offset = 20, - }, - [SPECIES_PARASECT] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_VENONAT] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_VENOMOTH] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_DIGLETT] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 16, - }, - [SPECIES_DUGTRIO] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_MEOWTH] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_PERSIAN] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_PSYDUCK] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 7, - }, - [SPECIES_GOLDUCK] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_MANKEY] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_PRIMEAPE] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_GROWLITHE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_ARCANINE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_POLIWAG] = - { - .size = MON_COORDS_SIZE(56, 32), - .y_offset = 16, - }, - [SPECIES_POLIWHIRL] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_POLIWRATH] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 11, - }, - [SPECIES_ABRA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_KADABRA] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_ALAKAZAM] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 5, - }, - [SPECIES_MACHOP] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_MACHOKE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_MACHAMP] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 4, - }, - [SPECIES_BELLSPROUT] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_WEEPINBELL] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_VICTREEBEL] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_TENTACOOL] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 10, - }, - [SPECIES_TENTACRUEL] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 11, - }, - [SPECIES_GEODUDE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_GRAVELER] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 12, - }, - [SPECIES_GOLEM] = - { - .size = MON_COORDS_SIZE(64, 32), - .y_offset = 16, - }, - [SPECIES_PONYTA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_RAPIDASH] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_SLOWPOKE] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 14, - }, - [SPECIES_SLOWBRO] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_MAGNEMITE] = - { - .size = MON_COORDS_SIZE(32, 24), - .y_offset = 20, - }, - [SPECIES_MAGNETON] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_FARFETCHD] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_DODUO] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_DODRIO] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_SEEL] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_DEWGONG] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_GRIMER] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 12, - }, - [SPECIES_MUK] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_SHELLDER] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_CLOYSTER] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_GASTLY] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 14, - }, - [SPECIES_HAUNTER] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_GENGAR] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_ONIX] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 0, - }, - [SPECIES_DROWZEE] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_HYPNO] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_KRABBY] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_KINGLER] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_VOLTORB] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 14, - }, - [SPECIES_ELECTRODE] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_EXEGGCUTE] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_EXEGGUTOR] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_CUBONE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_MAROWAK] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_HITMONLEE] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_HITMONCHAN] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_LICKITUNG] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 14, - }, - [SPECIES_KOFFING] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_WEEZING] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_RHYHORN] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 12, - }, - [SPECIES_RHYDON] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_CHANSEY] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 11, - }, - [SPECIES_TANGELA] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 14, - }, - [SPECIES_KANGASKHAN] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_HORSEA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_SEADRA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_GOLDEEN] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_SEAKING] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_STARYU] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_STARMIE] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 14, - }, - [SPECIES_MR_MIME] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 13, - }, - [SPECIES_SCYTHER] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_JYNX] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_ELECTABUZZ] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_MAGMAR] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_PINSIR] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_TAUROS] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 13, - }, - [SPECIES_MAGIKARP] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_GYARADOS] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 0, - }, - [SPECIES_LAPRAS] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_DITTO] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 17, - }, - [SPECIES_EEVEE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_VAPOREON] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_JOLTEON] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_FLAREON] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 5, - }, - [SPECIES_PORYGON] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_OMANYTE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_OMASTAR] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_KABUTO] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_KABUTOPS] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_AERODACTYL] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_SNORLAX] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 11, - }, - [SPECIES_ARTICUNO] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_ZAPDOS] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_MOLTRES] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_DRATINI] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_DRAGONAIR] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 0, - }, - [SPECIES_DRAGONITE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_MEWTWO] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 1, - }, - [SPECIES_MEW] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_CHIKORITA] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 10, - }, - [SPECIES_BAYLEEF] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_MEGANIUM] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 0, - }, - [SPECIES_CYNDAQUIL] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_QUILAVA] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_TYPHLOSION] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_TOTODILE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_CROCONAW] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 7, - }, - [SPECIES_FERALIGATR] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_SENTRET] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 5, - }, - [SPECIES_FURRET] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_HOOTHOOT] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_NOCTOWL] = - { - .size = MON_COORDS_SIZE(48, 64), - .y_offset = 3, - }, - [SPECIES_LEDYBA] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_LEDIAN] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_SPINARAK] = - { - .size = MON_COORDS_SIZE(56, 24), - .y_offset = 21, - }, - [SPECIES_ARIADOS] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 11, - }, - [SPECIES_CROBAT] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_CHINCHOU] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_LANTURN] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_PICHU] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_CLEFFA] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 15, - }, - [SPECIES_IGGLYBUFF] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_TOGEPI] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 16, - }, - [SPECIES_TOGETIC] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_NATU] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 17, - }, - [SPECIES_XATU] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_MAREEP] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_FLAAFFY] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_AMPHAROS] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_BELLOSSOM] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_MARILL] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 12, - }, - [SPECIES_AZUMARILL] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_SUDOWOODO] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_POLITOED] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_HOPPIP] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_SKIPLOOM] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_JUMPLUFF] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_AIPOM] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_SUNKERN] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 10, - }, - [SPECIES_SUNFLORA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_YANMA] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_WOOPER] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 15, - }, - [SPECIES_QUAGSIRE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_ESPEON] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_UMBREON] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_MURKROW] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_SLOWKING] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_MISDREAVUS] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_UNOWN] = - { - .size = MON_COORDS_SIZE(24, 48), - .y_offset = 8, - }, - [SPECIES_WOBBUFFET] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 12, - }, - [SPECIES_GIRAFARIG] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_PINECO] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 15, - }, - [SPECIES_FORRETRESS] = - { - .size = MON_COORDS_SIZE(64, 32), - .y_offset = 16, - }, - [SPECIES_DUNSPARCE] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 15, - }, - [SPECIES_GLIGAR] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_STEELIX] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_SNUBBULL] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_GRANBULL] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_QWILFISH] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_SCIZOR] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_SHUCKLE] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 11, - }, - [SPECIES_HERACROSS] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_SNEASEL] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_TEDDIURSA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_URSARING] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_SLUGMA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_MAGCARGO] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_SWINUB] = - { - .size = MON_COORDS_SIZE(48, 24), - .y_offset = 21, - }, - [SPECIES_PILOSWINE] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 13, - }, - [SPECIES_CORSOLA] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_REMORAID] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 13, - }, - [SPECIES_OCTILLERY] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_DELIBIRD] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_MANTINE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_SKARMORY] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_HOUNDOUR] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 12, - }, - [SPECIES_HOUNDOOM] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_KINGDRA] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_PHANPY] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 14, - }, - [SPECIES_DONPHAN] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 13, - }, - [SPECIES_PORYGON2] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_STANTLER] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 3, - }, - [SPECIES_SMEARGLE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_TYROGUE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_HITMONTOP] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_SMOOCHUM] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 9, - }, - [SPECIES_ELEKID] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_MAGBY] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_MILTANK] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_BLISSEY] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 13, - }, - [SPECIES_RAIKOU] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_ENTEI] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_SUICUNE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_LARVITAR] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_PUPITAR] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 5, - }, - [SPECIES_TYRANITAR] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_LUGIA] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_HO_OH] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_CELEBI] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_OLD_UNOWN_B] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_C] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_D] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_E] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_F] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_G] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_H] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_I] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_J] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_K] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_L] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_M] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_N] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_O] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_P] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_Q] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_R] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_S] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_T] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_U] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_V] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_W] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_X] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_Y] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_OLD_UNOWN_Z] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_TREECKO] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_GROVYLE] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_SCEPTILE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_TORCHIC] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 5, - }, - [SPECIES_COMBUSKEN] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_BLAZIKEN] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_MUDKIP] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_MARSHTOMP] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_SWAMPERT] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_POOCHYENA] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_MIGHTYENA] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_ZIGZAGOON] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_LINOONE] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 15, - }, - [SPECIES_WURMPLE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_SILCOON] = - { - .size = MON_COORDS_SIZE(64, 24), - .y_offset = 21, - }, - [SPECIES_BEAUTIFLY] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_CASCOON] = - { - .size = MON_COORDS_SIZE(56, 24), - .y_offset = 20, - }, - [SPECIES_DUSTOX] = - { - .size = MON_COORDS_SIZE(64, 24), - .y_offset = 20, - }, - [SPECIES_LOTAD] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 15, - }, - [SPECIES_LOMBRE] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_LUDICOLO] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_SEEDOT] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 9, - }, - [SPECIES_NUZLEAF] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_SHIFTRY] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_NINCADA] = - { - .size = MON_COORDS_SIZE(64, 24), - .y_offset = 20, - }, - [SPECIES_NINJASK] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_SHEDINJA] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_TAILLOW] = - { - .size = MON_COORDS_SIZE(48, 32), - .y_offset = 17, - }, - [SPECIES_SWELLOW] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_SHROOMISH] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 13, - }, - [SPECIES_BRELOOM] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_SPINDA] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_WINGULL] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 14, - }, - [SPECIES_PELIPPER] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_SURSKIT] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 11, - }, - [SPECIES_MASQUERAIN] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_WAILMER] = - { - .size = MON_COORDS_SIZE(64, 24), - .y_offset = 21, - }, - [SPECIES_WAILORD] = - { - .size = MON_COORDS_SIZE(64, 24), - .y_offset = 22, - }, - [SPECIES_SKITTY] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_DELCATTY] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_KECLEON] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_BALTOY] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_CLAYDOL] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_NOSEPASS] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 12, - }, - [SPECIES_TORKOAL] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_SABLEYE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_BARBOACH] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_WHISCASH] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_LUVDISC] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 10, - }, - [SPECIES_CORPHISH] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_CRAWDAUNT] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_FEEBAS] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 7, - }, - [SPECIES_MILOTIC] = - { - .size = MON_COORDS_SIZE(48, 64), - .y_offset = 2, - }, - [SPECIES_CARVANHA] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_SHARPEDO] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_TRAPINCH] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 14, - }, - [SPECIES_VIBRAVA] = - { - .size = MON_COORDS_SIZE(56, 32), - .y_offset = 17, - }, - [SPECIES_FLYGON] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_MAKUHITA] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_HARIYAMA] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_ELECTRIKE] = - { - .size = MON_COORDS_SIZE(64, 32), - .y_offset = 16, - }, - [SPECIES_MANECTRIC] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_NUMEL] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 11, - }, - [SPECIES_CAMERUPT] = - { - .size = MON_COORDS_SIZE(64, 32), - .y_offset = 19, - }, - [SPECIES_SPHEAL] = - { - .size = MON_COORDS_SIZE(48, 32), - .y_offset = 18, - }, - [SPECIES_SEALEO] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_WALREIN] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_CACNEA] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 15, - }, - [SPECIES_CACTURNE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_SNORUNT] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_GLALIE] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 12, - }, - [SPECIES_LUNATONE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_SOLROCK] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_AZURILL] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_SPOINK] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 11, - }, - [SPECIES_GRUMPIG] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_PLUSLE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_MINUN] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_MAWILE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_MEDITITE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_MEDICHAM] = - { - .size = MON_COORDS_SIZE(48, 64), - .y_offset = 3, - }, - [SPECIES_SWABLU] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 9, - }, - [SPECIES_ALTARIA] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_WYNAUT] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_DUSKULL] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_DUSCLOPS] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_ROSELIA] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_SLAKOTH] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 15, - }, - [SPECIES_VIGOROTH] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_SLAKING] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_GULPIN] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_SWALOT] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_TROPIUS] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_WHISMUR] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 13, - }, - [SPECIES_LOUDRED] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 9, - }, - [SPECIES_EXPLOUD] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_CLAMPERL] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 13, - }, - [SPECIES_HUNTAIL] = - { - .size = MON_COORDS_SIZE(48, 64), - .y_offset = 2, - }, - [SPECIES_GOREBYSS] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_ABSOL] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 3, - }, - [SPECIES_SHUPPET] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_BANETTE] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_SEVIPER] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_ZANGOOSE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_RELICANTH] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_ARON] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 17, - }, - [SPECIES_LAIRON] = - { - .size = MON_COORDS_SIZE(64, 32), - .y_offset = 17, - }, - [SPECIES_AGGRON] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_CASTFORM] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 13, - }, - [SPECIES_VOLBEAT] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_ILLUMISE] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_LILEEP] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 9, - }, - [SPECIES_CRADILY] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_ANORITH] = - { - .size = MON_COORDS_SIZE(64, 24), - .y_offset = 23, - }, - [SPECIES_ARMALDO] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_RALTS] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 13, - }, - [SPECIES_KIRLIA] = - { - .size = MON_COORDS_SIZE(40, 56), - .y_offset = 6, - }, - [SPECIES_GARDEVOIR] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_BAGON] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_SHELGON] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 13, - }, - [SPECIES_SALAMENCE] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_BELDUM] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_METANG] = - { - .size = MON_COORDS_SIZE(64, 32), - .y_offset = 16, - }, - [SPECIES_METAGROSS] = - { - .size = MON_COORDS_SIZE(64, 24), - .y_offset = 20, - }, - [SPECIES_REGIROCK] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_REGICE] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 14, - }, - [SPECIES_REGISTEEL] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 14, - }, - [SPECIES_KYOGRE] = - { - .size = MON_COORDS_SIZE(64, 32), - .y_offset = 19, - }, - [SPECIES_GROUDON] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_RAYQUAZA] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 0, - }, - [SPECIES_LATIAS] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_LATIOS] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_JIRACHI] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_DEOXYS] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 9, - }, - [SPECIES_CHIMECHO] = - { - .size = MON_COORDS_SIZE(32, 56), - .y_offset = 7, - }, - [SPECIES_EGG] = - { - .size = MON_COORDS_SIZE(24, 48), - .y_offset = 10, - }, - [SPECIES_UNOWN_B] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 9, - }, - [SPECIES_UNOWN_C] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_UNOWN_D] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 8, - }, - [SPECIES_UNOWN_E] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 10, - }, - [SPECIES_UNOWN_F] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_UNOWN_G] = - { - .size = MON_COORDS_SIZE(40, 56), - .y_offset = 5, - }, - [SPECIES_UNOWN_H] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_UNOWN_I] = - { - .size = MON_COORDS_SIZE(24, 56), - .y_offset = 7, - }, - [SPECIES_UNOWN_J] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 9, - }, - [SPECIES_UNOWN_K] = - { - .size = MON_COORDS_SIZE(40, 56), - .y_offset = 7, - }, - [SPECIES_UNOWN_L] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 10, - }, - [SPECIES_UNOWN_M] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_UNOWN_N] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_UNOWN_O] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_UNOWN_P] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 10, - }, - [SPECIES_UNOWN_Q] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 15, - }, - [SPECIES_UNOWN_R] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 12, - }, - [SPECIES_UNOWN_S] = - { - .size = MON_COORDS_SIZE(40, 56), - .y_offset = 4, - }, - [SPECIES_UNOWN_T] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 13, - }, - [SPECIES_UNOWN_U] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_UNOWN_V] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 11, - }, - [SPECIES_UNOWN_W] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 13, - }, - [SPECIES_UNOWN_X] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 15, - }, - [SPECIES_UNOWN_Y] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 10, - }, - [SPECIES_UNOWN_Z] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 10, - }, - [SPECIES_UNOWN_EMARK] = - { - .size = MON_COORDS_SIZE(24, 56), - .y_offset = 6, - }, - [SPECIES_UNOWN_QMARK] = - { - .size = MON_COORDS_SIZE(32, 56), - .y_offset = 6, - }, + [SPECIES_NONE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_BULBASAUR] = { .size = MON_COORDS_SIZE(48, 32), .y_offset = 16 }, + [SPECIES_IVYSAUR] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_VENUSAUR] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_CHARMANDER] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, + [SPECIES_CHARMELEON] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_CHARIZARD] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_SQUIRTLE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, + [SPECIES_WARTORTLE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_BLASTOISE] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_CATERPIE] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, + [SPECIES_METAPOD] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_BUTTERFREE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_WEEDLE] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, + [SPECIES_KAKUNA] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 10 }, + [SPECIES_BEEDRILL] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 9 }, + [SPECIES_PIDGEY] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_PIDGEOTTO] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 12 }, + [SPECIES_PIDGEOT] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, + [SPECIES_RATTATA] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_RATICATE] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 13 }, + [SPECIES_SPEAROW] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_FEAROW] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_EKANS] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_ARBOK] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_PIKACHU] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_RAICHU] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_SANDSHREW] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_SANDSLASH] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 9 }, + [SPECIES_NIDORAN_F] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, + [SPECIES_NIDORINA] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_NIDOQUEEN] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_NIDORAN_M] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 8 }, + [SPECIES_NIDORINO] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 9 }, + [SPECIES_NIDOKING] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_CLEFAIRY] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_CLEFABLE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_VULPIX] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_NINETALES] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_JIGGLYPUFF] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_WIGGLYTUFF] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_ZUBAT] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_GOLBAT] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_ODDISH] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, + [SPECIES_GLOOM] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_VILEPLUME] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_PARAS] = { .size = MON_COORDS_SIZE(48, 24), .y_offset = 20 }, + [SPECIES_PARASECT] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_VENONAT] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_VENOMOTH] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_DIGLETT] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 16 }, + [SPECIES_DUGTRIO] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_MEOWTH] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_PERSIAN] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_PSYDUCK] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 7 }, + [SPECIES_GOLDUCK] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_MANKEY] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_PRIMEAPE] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_GROWLITHE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_ARCANINE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_POLIWAG] = { .size = MON_COORDS_SIZE(56, 32), .y_offset = 16 }, + [SPECIES_POLIWHIRL] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_POLIWRATH] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 11 }, + [SPECIES_ABRA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_KADABRA] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_ALAKAZAM] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 5 }, + [SPECIES_MACHOP] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_MACHOKE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_MACHAMP] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 4 }, + [SPECIES_BELLSPROUT] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_WEEPINBELL] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_VICTREEBEL] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_TENTACOOL] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 10 }, + [SPECIES_TENTACRUEL] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 11 }, + [SPECIES_GEODUDE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_GRAVELER] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 12 }, + [SPECIES_GOLEM] = { .size = MON_COORDS_SIZE(64, 32), .y_offset = 16 }, + [SPECIES_PONYTA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_RAPIDASH] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_SLOWPOKE] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 14 }, + [SPECIES_SLOWBRO] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_MAGNEMITE] = { .size = MON_COORDS_SIZE(32, 24), .y_offset = 20 }, + [SPECIES_MAGNETON] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_FARFETCHD] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_DODUO] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_DODRIO] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_SEEL] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_DEWGONG] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_GRIMER] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 12 }, + [SPECIES_MUK] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_SHELLDER] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_CLOYSTER] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_GASTLY] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 14 }, + [SPECIES_HAUNTER] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_GENGAR] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_ONIX] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, + [SPECIES_DROWZEE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_HYPNO] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_KRABBY] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_KINGLER] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_VOLTORB] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 14 }, + [SPECIES_ELECTRODE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_EXEGGCUTE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_EXEGGUTOR] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_CUBONE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_MAROWAK] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_HITMONLEE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_HITMONCHAN] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_LICKITUNG] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, + [SPECIES_KOFFING] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_WEEZING] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_RHYHORN] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 12 }, + [SPECIES_RHYDON] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_CHANSEY] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 11 }, + [SPECIES_TANGELA] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 14 }, + [SPECIES_KANGASKHAN] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_HORSEA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_SEADRA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_GOLDEEN] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_SEAKING] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_STARYU] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_STARMIE] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 14 }, + [SPECIES_MR_MIME] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 13 }, + [SPECIES_SCYTHER] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_JYNX] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_ELECTABUZZ] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_MAGMAR] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_PINSIR] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_TAUROS] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 13 }, + [SPECIES_MAGIKARP] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_GYARADOS] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, + [SPECIES_LAPRAS] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_DITTO] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 17 }, + [SPECIES_EEVEE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_VAPOREON] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_JOLTEON] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_FLAREON] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 5 }, + [SPECIES_PORYGON] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_OMANYTE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_OMASTAR] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_KABUTO] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_KABUTOPS] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_AERODACTYL] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_SNORLAX] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 11 }, + [SPECIES_ARTICUNO] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_ZAPDOS] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_MOLTRES] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_DRATINI] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_DRAGONAIR] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, + [SPECIES_DRAGONITE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_MEWTWO] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 1 }, + [SPECIES_MEW] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_CHIKORITA] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 10 }, + [SPECIES_BAYLEEF] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_MEGANIUM] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, + [SPECIES_CYNDAQUIL] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_QUILAVA] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_TYPHLOSION] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_TOTODILE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_CROCONAW] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 7 }, + [SPECIES_FERALIGATR] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_SENTRET] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 5 }, + [SPECIES_FURRET] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_HOOTHOOT] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_NOCTOWL] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 3 }, + [SPECIES_LEDYBA] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_LEDIAN] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_SPINARAK] = { .size = MON_COORDS_SIZE(56, 24), .y_offset = 21 }, + [SPECIES_ARIADOS] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 11 }, + [SPECIES_CROBAT] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_CHINCHOU] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_LANTURN] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_PICHU] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_CLEFFA] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 15 }, + [SPECIES_IGGLYBUFF] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_TOGEPI] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 16 }, + [SPECIES_TOGETIC] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_NATU] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 17 }, + [SPECIES_XATU] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_MAREEP] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_FLAAFFY] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_AMPHAROS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_BELLOSSOM] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_MARILL] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 12 }, + [SPECIES_AZUMARILL] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_SUDOWOODO] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_POLITOED] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_HOPPIP] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_SKIPLOOM] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_JUMPLUFF] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_AIPOM] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_SUNKERN] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 10 }, + [SPECIES_SUNFLORA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_YANMA] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_WOOPER] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 15 }, + [SPECIES_QUAGSIRE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_ESPEON] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_UMBREON] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_MURKROW] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_SLOWKING] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_MISDREAVUS] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_UNOWN] = { .size = MON_COORDS_SIZE(24, 48), .y_offset = 8 }, + [SPECIES_WOBBUFFET] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 12 }, + [SPECIES_GIRAFARIG] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_PINECO] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 15 }, + [SPECIES_FORRETRESS] = { .size = MON_COORDS_SIZE(64, 32), .y_offset = 16 }, + [SPECIES_DUNSPARCE] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 15 }, + [SPECIES_GLIGAR] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_STEELIX] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_SNUBBULL] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_GRANBULL] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_QWILFISH] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_SCIZOR] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_SHUCKLE] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, + [SPECIES_HERACROSS] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_SNEASEL] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_TEDDIURSA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_URSARING] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_SLUGMA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_MAGCARGO] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_SWINUB] = { .size = MON_COORDS_SIZE(48, 24), .y_offset = 21 }, + [SPECIES_PILOSWINE] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 13 }, + [SPECIES_CORSOLA] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_REMORAID] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 13 }, + [SPECIES_OCTILLERY] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_DELIBIRD] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_MANTINE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_SKARMORY] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_HOUNDOUR] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, + [SPECIES_HOUNDOOM] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_KINGDRA] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_PHANPY] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, + [SPECIES_DONPHAN] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 13 }, + [SPECIES_PORYGON2] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_STANTLER] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 3 }, + [SPECIES_SMEARGLE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_TYROGUE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_HITMONTOP] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_SMOOCHUM] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 9 }, + [SPECIES_ELEKID] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_MAGBY] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_MILTANK] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_BLISSEY] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 13 }, + [SPECIES_RAIKOU] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_ENTEI] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_SUICUNE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_LARVITAR] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_PUPITAR] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 5 }, + [SPECIES_TYRANITAR] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_LUGIA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_HO_OH] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_CELEBI] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_OLD_UNOWN_B] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_C] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_D] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_E] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_F] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_G] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_H] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_I] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_J] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_K] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_L] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_M] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_N] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_O] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_P] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_Q] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_R] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_S] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_T] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_U] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_V] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_W] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_X] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_Y] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_OLD_UNOWN_Z] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_TREECKO] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_GROVYLE] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_SCEPTILE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_TORCHIC] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 5 }, + [SPECIES_COMBUSKEN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_BLAZIKEN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_MUDKIP] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_MARSHTOMP] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_SWAMPERT] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_POOCHYENA] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_MIGHTYENA] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_ZIGZAGOON] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_LINOONE] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 15 }, + [SPECIES_WURMPLE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_SILCOON] = { .size = MON_COORDS_SIZE(64, 24), .y_offset = 21 }, + [SPECIES_BEAUTIFLY] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_CASCOON] = { .size = MON_COORDS_SIZE(56, 24), .y_offset = 20 }, + [SPECIES_DUSTOX] = { .size = MON_COORDS_SIZE(64, 24), .y_offset = 20 }, + [SPECIES_LOTAD] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 15 }, + [SPECIES_LOMBRE] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_LUDICOLO] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_SEEDOT] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 9 }, + [SPECIES_NUZLEAF] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_SHIFTRY] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_NINCADA] = { .size = MON_COORDS_SIZE(64, 24), .y_offset = 20 }, + [SPECIES_NINJASK] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_SHEDINJA] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_TAILLOW] = { .size = MON_COORDS_SIZE(48, 32), .y_offset = 17 }, + [SPECIES_SWELLOW] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_SHROOMISH] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 13 }, + [SPECIES_BRELOOM] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_SPINDA] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_WINGULL] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 14 }, + [SPECIES_PELIPPER] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_SURSKIT] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 11 }, + [SPECIES_MASQUERAIN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_WAILMER] = { .size = MON_COORDS_SIZE(64, 24), .y_offset = 21 }, + [SPECIES_WAILORD] = { .size = MON_COORDS_SIZE(64, 24), .y_offset = 22 }, + [SPECIES_SKITTY] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_DELCATTY] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_KECLEON] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_BALTOY] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_CLAYDOL] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_NOSEPASS] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 12 }, + [SPECIES_TORKOAL] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_SABLEYE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_BARBOACH] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_WHISCASH] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_LUVDISC] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 10 }, + [SPECIES_CORPHISH] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_CRAWDAUNT] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_FEEBAS] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 7 }, + [SPECIES_MILOTIC] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 2 }, + [SPECIES_CARVANHA] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_SHARPEDO] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_TRAPINCH] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 14 }, + [SPECIES_VIBRAVA] = { .size = MON_COORDS_SIZE(56, 32), .y_offset = 17 }, + [SPECIES_FLYGON] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_MAKUHITA] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_HARIYAMA] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_ELECTRIKE] = { .size = MON_COORDS_SIZE(64, 32), .y_offset = 16 }, + [SPECIES_MANECTRIC] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_NUMEL] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 11 }, + [SPECIES_CAMERUPT] = { .size = MON_COORDS_SIZE(64, 32), .y_offset = 19 }, + [SPECIES_SPHEAL] = { .size = MON_COORDS_SIZE(48, 32), .y_offset = 18 }, + [SPECIES_SEALEO] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_WALREIN] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_CACNEA] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 15 }, + [SPECIES_CACTURNE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_SNORUNT] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_GLALIE] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 12 }, + [SPECIES_LUNATONE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_SOLROCK] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_AZURILL] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_SPOINK] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, + [SPECIES_GRUMPIG] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_PLUSLE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_MINUN] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_MAWILE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_MEDITITE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_MEDICHAM] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 3 }, + [SPECIES_SWABLU] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 9 }, + [SPECIES_ALTARIA] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_WYNAUT] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_DUSKULL] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_DUSCLOPS] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_ROSELIA] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_SLAKOTH] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 15 }, + [SPECIES_VIGOROTH] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_SLAKING] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_GULPIN] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_SWALOT] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_TROPIUS] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_WHISMUR] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 13 }, + [SPECIES_LOUDRED] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 9 }, + [SPECIES_EXPLOUD] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_CLAMPERL] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 13 }, + [SPECIES_HUNTAIL] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 2 }, + [SPECIES_GOREBYSS] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_ABSOL] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 3 }, + [SPECIES_SHUPPET] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_BANETTE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_SEVIPER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_ZANGOOSE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_RELICANTH] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_ARON] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 17 }, + [SPECIES_LAIRON] = { .size = MON_COORDS_SIZE(64, 32), .y_offset = 17 }, + [SPECIES_AGGRON] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_CASTFORM] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 13 }, + [SPECIES_VOLBEAT] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_ILLUMISE] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_LILEEP] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 9 }, + [SPECIES_CRADILY] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_ANORITH] = { .size = MON_COORDS_SIZE(64, 24), .y_offset = 23 }, + [SPECIES_ARMALDO] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_RALTS] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 13 }, + [SPECIES_KIRLIA] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 6 }, + [SPECIES_GARDEVOIR] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_BAGON] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_SHELGON] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 13 }, + [SPECIES_SALAMENCE] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_BELDUM] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_METANG] = { .size = MON_COORDS_SIZE(64, 32), .y_offset = 16 }, + [SPECIES_METAGROSS] = { .size = MON_COORDS_SIZE(64, 24), .y_offset = 20 }, + [SPECIES_REGIROCK] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_REGICE] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 14 }, + [SPECIES_REGISTEEL] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 14 }, + [SPECIES_KYOGRE] = { .size = MON_COORDS_SIZE(64, 32), .y_offset = 19 }, + [SPECIES_GROUDON] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_RAYQUAZA] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, + [SPECIES_LATIAS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_LATIOS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_JIRACHI] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_DEOXYS] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 9 }, + [SPECIES_CHIMECHO] = { .size = MON_COORDS_SIZE(32, 56), .y_offset = 7 }, + [SPECIES_EGG] = { .size = MON_COORDS_SIZE(24, 48), .y_offset = 10 }, + [SPECIES_UNOWN_B] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 9 }, + [SPECIES_UNOWN_C] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_UNOWN_D] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 8 }, + [SPECIES_UNOWN_E] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 10 }, + [SPECIES_UNOWN_F] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_UNOWN_G] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 5 }, + [SPECIES_UNOWN_H] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_UNOWN_I] = { .size = MON_COORDS_SIZE(24, 56), .y_offset = 7 }, + [SPECIES_UNOWN_J] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 9 }, + [SPECIES_UNOWN_K] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 7 }, + [SPECIES_UNOWN_L] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 10 }, + [SPECIES_UNOWN_M] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_UNOWN_N] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_UNOWN_O] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_UNOWN_P] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 10 }, + [SPECIES_UNOWN_Q] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, + [SPECIES_UNOWN_R] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 12 }, + [SPECIES_UNOWN_S] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 4 }, + [SPECIES_UNOWN_T] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 13 }, + [SPECIES_UNOWN_U] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_UNOWN_V] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, + [SPECIES_UNOWN_W] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 13 }, + [SPECIES_UNOWN_X] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, + [SPECIES_UNOWN_Y] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 10 }, + [SPECIES_UNOWN_Z] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 10 }, + [SPECIES_UNOWN_EMARK] = { .size = MON_COORDS_SIZE(24, 56), .y_offset = 6 }, + [SPECIES_UNOWN_QMARK] = { .size = MON_COORDS_SIZE(32, 56), .y_offset = 6 }, }; diff --git a/src/data/pokemon_graphics/front_pic_coordinates.h b/src/data/pokemon_graphics/front_pic_coordinates.h index 6022f9cc18..34d5c67442 100644 --- a/src/data/pokemon_graphics/front_pic_coordinates.h +++ b/src/data/pokemon_graphics/front_pic_coordinates.h @@ -4,2204 +4,444 @@ // .y_offset is the number of pixels between the drawn pixel area and the bottom edge. const struct MonCoords gMonFrontPicCoords[] = { - [SPECIES_NONE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_BULBASAUR] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 14, - }, - [SPECIES_IVYSAUR] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 10, - }, - [SPECIES_VENUSAUR] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_CHARMANDER] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 12, - }, - [SPECIES_CHARMELEON] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_CHARIZARD] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_SQUIRTLE] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_WARTORTLE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_BLASTOISE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_CATERPIE] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 16, - }, - [SPECIES_METAPOD] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 20, - }, - [SPECIES_BUTTERFREE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_WEEDLE] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 18, - }, - [SPECIES_KAKUNA] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 14, - }, - [SPECIES_BEEDRILL] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 9, - }, - [SPECIES_PIDGEY] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_PIDGEOTTO] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 11, - }, - [SPECIES_PIDGEOT] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_RATTATA] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 16, - }, - [SPECIES_RATICATE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_SPEAROW] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 15, - }, - [SPECIES_FEAROW] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 0, - }, - [SPECIES_EKANS] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_ARBOK] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_PIKACHU] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 9, - }, - [SPECIES_RAICHU] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 4, - }, - [SPECIES_SANDSHREW] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 14, - }, - [SPECIES_SANDSLASH] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_NIDORAN_F] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 15, - }, - [SPECIES_NIDORINA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_NIDOQUEEN] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 3, - }, - [SPECIES_NIDORAN_M] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 12, - }, - [SPECIES_NIDORINO] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_NIDOKING] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 2, - }, - [SPECIES_CLEFAIRY] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 16, - }, - [SPECIES_CLEFABLE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_VULPIX] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_NINETALES] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_JIGGLYPUFF] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 16, - }, - [SPECIES_WIGGLYTUFF] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 8, - }, - [SPECIES_ZUBAT] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_GOLBAT] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_ODDISH] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 15, - }, - [SPECIES_GLOOM] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_VILEPLUME] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_PARAS] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 15, - }, - [SPECIES_PARASECT] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_VENONAT] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_VENOMOTH] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_DIGLETT] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 18, - }, - [SPECIES_DUGTRIO] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 13, - }, - [SPECIES_MEOWTH] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 12, - }, - [SPECIES_PERSIAN] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_PSYDUCK] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 9, - }, - [SPECIES_GOLDUCK] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 2, - }, - [SPECIES_MANKEY] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 14, - }, - [SPECIES_PRIMEAPE] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_GROWLITHE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_ARCANINE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_POLIWAG] = - { - .size = MON_COORDS_SIZE(56, 32), - .y_offset = 19, - }, - [SPECIES_POLIWHIRL] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_POLIWRATH] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_ABRA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_KADABRA] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_ALAKAZAM] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_MACHOP] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 11, - }, - [SPECIES_MACHOKE] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_MACHAMP] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_BELLSPROUT] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 15, - }, - [SPECIES_WEEPINBELL] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_VICTREEBEL] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_TENTACOOL] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 9, - }, - [SPECIES_TENTACRUEL] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_GEODUDE] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 18, - }, - [SPECIES_GRAVELER] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_GOLEM] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_PONYTA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_RAPIDASH] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_SLOWPOKE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_SLOWBRO] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_MAGNEMITE] = - { - .size = MON_COORDS_SIZE(32, 24), - .y_offset = 21, - }, - [SPECIES_MAGNETON] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_FARFETCHD] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_DODUO] = - { - .size = MON_COORDS_SIZE(40, 56), - .y_offset = 5, - }, - [SPECIES_DODRIO] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_SEEL] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_DEWGONG] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_GRIMER] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_MUK] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_SHELLDER] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 16, - }, - [SPECIES_CLOYSTER] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_GASTLY] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_HAUNTER] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_GENGAR] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_ONIX] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 2, - }, - [SPECIES_DROWZEE] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_HYPNO] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_KRABBY] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 13, - }, - [SPECIES_KINGLER] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_VOLTORB] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 19, - }, - [SPECIES_ELECTRODE] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 14, - }, - [SPECIES_EXEGGCUTE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_EXEGGUTOR] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_CUBONE] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 15, - }, - [SPECIES_MAROWAK] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 11, - }, - [SPECIES_HITMONLEE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_HITMONCHAN] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 4, - }, - [SPECIES_LICKITUNG] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_KOFFING] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_WEEZING] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_RHYHORN] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_RHYDON] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_CHANSEY] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_TANGELA] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 7, - }, - [SPECIES_KANGASKHAN] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_HORSEA] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 15, - }, - [SPECIES_SEADRA] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 7, - }, - [SPECIES_GOLDEEN] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_SEAKING] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_STARYU] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_STARMIE] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_MR_MIME] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_SCYTHER] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_JYNX] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_ELECTABUZZ] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 2, - }, - [SPECIES_MAGMAR] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_PINSIR] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_TAUROS] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 0, - }, - [SPECIES_MAGIKARP] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_GYARADOS] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 8, - }, - [SPECIES_LAPRAS] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 13, - }, - [SPECIES_DITTO] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 17, - }, - [SPECIES_EEVEE] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 9, - }, - [SPECIES_VAPOREON] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_JOLTEON] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_FLAREON] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_PORYGON] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 13, - }, - [SPECIES_OMANYTE] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 15, - }, - [SPECIES_OMASTAR] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 7, - }, - [SPECIES_KABUTO] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 17, - }, - [SPECIES_KABUTOPS] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_AERODACTYL] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_SNORLAX] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_ARTICUNO] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_ZAPDOS] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_MOLTRES] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_DRATINI] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 14, - }, - [SPECIES_DRAGONAIR] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_DRAGONITE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_MEWTWO] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_MEW] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 13, - }, - [SPECIES_CHIKORITA] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 13, - }, - [SPECIES_BAYLEEF] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_MEGANIUM] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_CYNDAQUIL] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 14, - }, - [SPECIES_QUILAVA] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_TYPHLOSION] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 0, - }, - [SPECIES_TOTODILE] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 15, - }, - [SPECIES_CROCONAW] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_FERALIGATR] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_SENTRET] = - { - .size = MON_COORDS_SIZE(32, 56), - .y_offset = 4, - }, - [SPECIES_FURRET] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 7, - }, - [SPECIES_HOOTHOOT] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 13, - }, - [SPECIES_NOCTOWL] = - { - .size = MON_COORDS_SIZE(40, 64), - .y_offset = 3, - }, - [SPECIES_LEDYBA] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 12, - }, - [SPECIES_LEDIAN] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 4, - }, - [SPECIES_SPINARAK] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 19, - }, - [SPECIES_ARIADOS] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_CROBAT] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_CHINCHOU] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 16, - }, - [SPECIES_LANTURN] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 11, - }, - [SPECIES_PICHU] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 12, - }, - [SPECIES_CLEFFA] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 20, - }, - [SPECIES_IGGLYBUFF] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 18, - }, - [SPECIES_TOGEPI] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 20, - }, - [SPECIES_TOGETIC] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 9, - }, - [SPECIES_NATU] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 20, - }, - [SPECIES_XATU] = - { - .size = MON_COORDS_SIZE(32, 56), - .y_offset = 7, - }, - [SPECIES_MAREEP] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 16, - }, - [SPECIES_FLAAFFY] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 10, - }, - [SPECIES_AMPHAROS] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_BELLOSSOM] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 14, - }, - [SPECIES_MARILL] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 14, - }, - [SPECIES_AZUMARILL] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_SUDOWOODO] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_POLITOED] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_HOPPIP] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_SKIPLOOM] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 15, - }, - [SPECIES_JUMPLUFF] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_AIPOM] = - { - .size = MON_COORDS_SIZE(40, 64), - .y_offset = 3, - }, - [SPECIES_SUNKERN] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 16, - }, - [SPECIES_SUNFLORA] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 8, - }, - [SPECIES_YANMA] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_WOOPER] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 16, - }, - [SPECIES_QUAGSIRE] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 7, - }, - [SPECIES_ESPEON] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_UMBREON] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 8, - }, - [SPECIES_MURKROW] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_SLOWKING] = - { - .size = MON_COORDS_SIZE(40, 64), - .y_offset = 1, - }, - [SPECIES_MISDREAVUS] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 12, - }, - [SPECIES_UNOWN] = - { - .size = MON_COORDS_SIZE(24, 40), - .y_offset = 15, - }, - [SPECIES_WOBBUFFET] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_GIRAFARIG] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_PINECO] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 10, - }, - [SPECIES_FORRETRESS] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_DUNSPARCE] = - { - .size = MON_COORDS_SIZE(56, 32), - .y_offset = 17, - }, - [SPECIES_GLIGAR] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 3, - }, - [SPECIES_STEELIX] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_SNUBBULL] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 13, - }, - [SPECIES_GRANBULL] = - { - .size = MON_COORDS_SIZE(40, 56), - .y_offset = 6, - }, - [SPECIES_QWILFISH] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 10, - }, - [SPECIES_SCIZOR] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_SHUCKLE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_HERACROSS] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_SNEASEL] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 5, - }, - [SPECIES_TEDDIURSA] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 13, - }, - [SPECIES_URSARING] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 1, - }, - [SPECIES_SLUGMA] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 13, - }, - [SPECIES_MAGCARGO] = - { - .size = MON_COORDS_SIZE(40, 56), - .y_offset = 13, - }, - [SPECIES_SWINUB] = - { - .size = MON_COORDS_SIZE(32, 24), - .y_offset = 20, - }, - [SPECIES_PILOSWINE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_CORSOLA] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_REMORAID] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 14, - }, - [SPECIES_OCTILLERY] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_DELIBIRD] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 8, - }, - [SPECIES_MANTINE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_SKARMORY] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_HOUNDOUR] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 11, - }, - [SPECIES_HOUNDOOM] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_KINGDRA] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 4, - }, - [SPECIES_PHANPY] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 16, - }, - [SPECIES_DONPHAN] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_PORYGON2] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 15, - }, - [SPECIES_STANTLER] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_SMEARGLE] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_TYROGUE] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 9, - }, - [SPECIES_HITMONTOP] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 5, - }, - [SPECIES_SMOOCHUM] = - { - .size = MON_COORDS_SIZE(24, 40), - .y_offset = 15, - }, - [SPECIES_ELEKID] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_MAGBY] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 13, - }, - [SPECIES_MILTANK] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_BLISSEY] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 6, - }, - [SPECIES_RAIKOU] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_ENTEI] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_SUICUNE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_LARVITAR] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 9, - }, - [SPECIES_PUPITAR] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 9, - }, - [SPECIES_TYRANITAR] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_LUGIA] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_HO_OH] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_CELEBI] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 14, - }, - [SPECIES_OLD_UNOWN_B] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_C] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_D] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_E] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_F] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_G] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_H] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_I] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_J] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_K] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_L] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_M] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_N] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_O] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_P] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_Q] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_R] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_S] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_T] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_U] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_V] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_W] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_X] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_Y] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_OLD_UNOWN_Z] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_TREECKO] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_GROVYLE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_SCEPTILE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_TORCHIC] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 8, - }, - [SPECIES_COMBUSKEN] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_BLAZIKEN] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_MUDKIP] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 12, - }, - [SPECIES_MARSHTOMP] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_SWAMPERT] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_POOCHYENA] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 12, - }, - [SPECIES_MIGHTYENA] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_ZIGZAGOON] = - { - .size = MON_COORDS_SIZE(64, 40), - .y_offset = 15, - }, - [SPECIES_LINOONE] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 3, - }, - [SPECIES_WURMPLE] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 14, - }, - [SPECIES_SILCOON] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 17, - }, - [SPECIES_BEAUTIFLY] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 9, - }, - [SPECIES_CASCOON] = - { - .size = MON_COORDS_SIZE(56, 32), - .y_offset = 16, - }, - [SPECIES_DUSTOX] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 15, - }, - [SPECIES_LOTAD] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 14, - }, - [SPECIES_LOMBRE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_LUDICOLO] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_SEEDOT] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 16, - }, - [SPECIES_NUZLEAF] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 8, - }, - [SPECIES_SHIFTRY] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_NINCADA] = - { - .size = MON_COORDS_SIZE(56, 32), - .y_offset = 18, - }, - [SPECIES_NINJASK] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_SHEDINJA] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_TAILLOW] = - { - .size = MON_COORDS_SIZE(48, 32), - .y_offset = 16, - }, - [SPECIES_SWELLOW] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_SHROOMISH] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 16, - }, - [SPECIES_BRELOOM] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_SPINDA] = - { - .size = MON_COORDS_SIZE(48, 64), - .y_offset = 8, - }, - [SPECIES_WINGULL] = - { - .size = MON_COORDS_SIZE(64, 32), - .y_offset = 24, - }, - [SPECIES_PELIPPER] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 4, - }, - [SPECIES_SURSKIT] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 15, - }, - [SPECIES_MASQUERAIN] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_WAILMER] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 15, - }, - [SPECIES_WAILORD] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 10, - }, - [SPECIES_SKITTY] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 11, - }, - [SPECIES_DELCATTY] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_KECLEON] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 7, - }, - [SPECIES_BALTOY] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 16, - }, - [SPECIES_CLAYDOL] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 6, - }, - [SPECIES_NOSEPASS] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 12, - }, - [SPECIES_TORKOAL] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_SABLEYE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_BARBOACH] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 11, - }, - [SPECIES_WHISCASH] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 9, - }, - [SPECIES_LUVDISC] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 24, - }, - [SPECIES_CORPHISH] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 12, - }, - [SPECIES_CRAWDAUNT] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_FEEBAS] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 13, - }, - [SPECIES_MILOTIC] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_CARVANHA] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 6, - }, - [SPECIES_SHARPEDO] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 3, - }, - [SPECIES_TRAPINCH] = - { - .size = MON_COORDS_SIZE(40, 32), - .y_offset = 16, - }, - [SPECIES_VIBRAVA] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 12, - }, - [SPECIES_FLYGON] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_MAKUHITA] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_HARIYAMA] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_ELECTRIKE] = - { - .size = MON_COORDS_SIZE(48, 32), - .y_offset = 18, - }, - [SPECIES_MANECTRIC] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 4, - }, - [SPECIES_NUMEL] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 15, - }, - [SPECIES_CAMERUPT] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 9, - }, - [SPECIES_SPHEAL] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 16, - }, - [SPECIES_SEALEO] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 10, - }, - [SPECIES_WALREIN] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_CACNEA] = - { - .size = MON_COORDS_SIZE(56, 32), - .y_offset = 16, - }, - [SPECIES_CACTURNE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_SNORUNT] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 11, - }, - [SPECIES_GLALIE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 10, - }, - [SPECIES_LUNATONE] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_SOLROCK] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_AZURILL] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 15, - }, - [SPECIES_SPOINK] = - { - .size = MON_COORDS_SIZE(32, 48), - .y_offset = 9, - }, - [SPECIES_GRUMPIG] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_PLUSLE] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 14, - }, - [SPECIES_MINUN] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 12, - }, - [SPECIES_MAWILE] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_MEDITITE] = - { - .size = MON_COORDS_SIZE(48, 40), - .y_offset = 12, - }, - [SPECIES_MEDICHAM] = - { - .size = MON_COORDS_SIZE(48, 64), - .y_offset = 1, - }, - [SPECIES_SWABLU] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 17, - }, - [SPECIES_ALTARIA] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_WYNAUT] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 12, - }, - [SPECIES_DUSKULL] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 10, - }, - [SPECIES_DUSCLOPS] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 5, - }, - [SPECIES_ROSELIA] = - { - .size = MON_COORDS_SIZE(56, 48), - .y_offset = 8, - }, - [SPECIES_SLAKOTH] = - { - .size = MON_COORDS_SIZE(56, 32), - .y_offset = 18, - }, - [SPECIES_VIGOROTH] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 0, - }, - [SPECIES_SLAKING] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 8, - }, - [SPECIES_GULPIN] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 18, - }, - [SPECIES_SWALOT] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_TROPIUS] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_WHISMUR] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 14, - }, - [SPECIES_LOUDRED] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 3, - }, - [SPECIES_EXPLOUD] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_CLAMPERL] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 14, - }, - [SPECIES_HUNTAIL] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 3, - }, - [SPECIES_GOREBYSS] = - { - .size = MON_COORDS_SIZE(64, 48), - .y_offset = 11, - }, - [SPECIES_ABSOL] = - { - .size = MON_COORDS_SIZE(48, 64), - .y_offset = 0, - }, - [SPECIES_SHUPPET] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 14, - }, - [SPECIES_BANETTE] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 12, - }, - [SPECIES_SEVIPER] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 8, - }, - [SPECIES_ZANGOOSE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 5, - }, - [SPECIES_RELICANTH] = - { - .size = MON_COORDS_SIZE(56, 56), - .y_offset = 11, - }, - [SPECIES_ARON] = - { - .size = MON_COORDS_SIZE(32, 24), - .y_offset = 20, - }, - [SPECIES_LAIRON] = - { - .size = MON_COORDS_SIZE(56, 40), - .y_offset = 13, - }, - [SPECIES_AGGRON] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_CASTFORM] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 17, - }, - [SPECIES_VOLBEAT] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_ILLUMISE] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 8, - }, - [SPECIES_LILEEP] = - { - .size = MON_COORDS_SIZE(48, 56), - .y_offset = 7, - }, - [SPECIES_CRADILY] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 0, - }, - [SPECIES_ANORITH] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 8, - }, - [SPECIES_ARMALDO] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_RALTS] = - { - .size = MON_COORDS_SIZE(24, 40), - .y_offset = 15, - }, - [SPECIES_KIRLIA] = - { - .size = MON_COORDS_SIZE(32, 56), - .y_offset = 6, - }, - [SPECIES_GARDEVOIR] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 1, - }, - [SPECIES_BAGON] = - { - .size = MON_COORDS_SIZE(40, 48), - .y_offset = 11, - }, - [SPECIES_SHELGON] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 9, - }, - [SPECIES_SALAMENCE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_BELDUM] = - { - .size = MON_COORDS_SIZE(40, 40), - .y_offset = 15, - }, - [SPECIES_METANG] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 7, - }, - [SPECIES_METAGROSS] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 6, - }, - [SPECIES_REGIROCK] = - { - .size = MON_COORDS_SIZE(56, 64), - .y_offset = 4, - }, - [SPECIES_REGICE] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_REGISTEEL] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 3, - }, - [SPECIES_KYOGRE] = - { - .size = MON_COORDS_SIZE(64, 56), - .y_offset = 4, - }, - [SPECIES_GROUDON] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_RAYQUAZA] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 0, - }, - [SPECIES_LATIAS] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_LATIOS] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 2, - }, - [SPECIES_JIRACHI] = - { - .size = MON_COORDS_SIZE(48, 48), - .y_offset = 13, - }, - [SPECIES_DEOXYS] = - { - .size = MON_COORDS_SIZE(64, 64), - .y_offset = 1, - }, - [SPECIES_CHIMECHO] = - { - .size = MON_COORDS_SIZE(24, 56), - .y_offset = 6, - }, - [SPECIES_EGG] = - { - .size = MON_COORDS_SIZE(24, 24), - .y_offset = 20, - }, - [SPECIES_UNOWN_B] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 16, - }, - [SPECIES_UNOWN_C] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 16, - }, - [SPECIES_UNOWN_D] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 16, - }, - [SPECIES_UNOWN_E] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 17, - }, - [SPECIES_UNOWN_F] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 17, - }, - [SPECIES_UNOWN_G] = - { - .size = MON_COORDS_SIZE(24, 40), - .y_offset = 14, - }, - [SPECIES_UNOWN_H] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 16, - }, - [SPECIES_UNOWN_I] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 16, - }, - [SPECIES_UNOWN_J] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 17, - }, - [SPECIES_UNOWN_K] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 17, - }, - [SPECIES_UNOWN_L] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 19, - }, - [SPECIES_UNOWN_M] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 19, - }, - [SPECIES_UNOWN_N] = - { - .size = MON_COORDS_SIZE(32, 24), - .y_offset = 20, - }, - [SPECIES_UNOWN_O] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 16, - }, - [SPECIES_UNOWN_P] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 19, - }, - [SPECIES_UNOWN_Q] = - { - .size = MON_COORDS_SIZE(32, 24), - .y_offset = 21, - }, - [SPECIES_UNOWN_R] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 19, - }, - [SPECIES_UNOWN_S] = - { - .size = MON_COORDS_SIZE(32, 40), - .y_offset = 12, - }, - [SPECIES_UNOWN_T] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 18, - }, - [SPECIES_UNOWN_U] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 18, - }, - [SPECIES_UNOWN_V] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 18, - }, - [SPECIES_UNOWN_W] = - { - .size = MON_COORDS_SIZE(32, 32), - .y_offset = 19, - }, - [SPECIES_UNOWN_X] = - { - .size = MON_COORDS_SIZE(24, 24), - .y_offset = 21, - }, - [SPECIES_UNOWN_Y] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 17, - }, - [SPECIES_UNOWN_Z] = - { - .size = MON_COORDS_SIZE(24, 32), - .y_offset = 16, - }, - [SPECIES_UNOWN_EMARK] = - { - .size = MON_COORDS_SIZE(24, 40), - .y_offset = 15, - }, - [SPECIES_UNOWN_QMARK] = - { - .size = MON_COORDS_SIZE(24, 40), - .y_offset = 13, - }, + [SPECIES_NONE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_BULBASAUR] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 14 }, + [SPECIES_IVYSAUR] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 10 }, + [SPECIES_VENUSAUR] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_CHARMANDER] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, + [SPECIES_CHARMELEON] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_CHARIZARD] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_SQUIRTLE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_WARTORTLE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_BLASTOISE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_CATERPIE] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 16 }, + [SPECIES_METAPOD] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 20 }, + [SPECIES_BUTTERFREE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_WEEDLE] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 18 }, + [SPECIES_KAKUNA] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 14 }, + [SPECIES_BEEDRILL] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 9 }, + [SPECIES_PIDGEY] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_PIDGEOTTO] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 11 }, + [SPECIES_PIDGEOT] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_RATTATA] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 16 }, + [SPECIES_RATICATE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_SPEAROW] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 15 }, + [SPECIES_FEAROW] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, + [SPECIES_EKANS] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_ARBOK] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_PIKACHU] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 9 }, + [SPECIES_RAICHU] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 4 }, + [SPECIES_SANDSHREW] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 14 }, + [SPECIES_SANDSLASH] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_NIDORAN_F] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 15 }, + [SPECIES_NIDORINA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_NIDOQUEEN] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 3 }, + [SPECIES_NIDORAN_M] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, + [SPECIES_NIDORINO] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_NIDOKING] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, + [SPECIES_CLEFAIRY] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 16 }, + [SPECIES_CLEFABLE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_VULPIX] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_NINETALES] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_JIGGLYPUFF] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 16 }, + [SPECIES_WIGGLYTUFF] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 8 }, + [SPECIES_ZUBAT] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_GOLBAT] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_ODDISH] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 15 }, + [SPECIES_GLOOM] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_VILEPLUME] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_PARAS] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, + [SPECIES_PARASECT] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_VENONAT] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_VENOMOTH] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_DIGLETT] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 18 }, + [SPECIES_DUGTRIO] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 13 }, + [SPECIES_MEOWTH] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, + [SPECIES_PERSIAN] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_PSYDUCK] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 9 }, + [SPECIES_GOLDUCK] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, + [SPECIES_MANKEY] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, + [SPECIES_PRIMEAPE] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_GROWLITHE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_ARCANINE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_POLIWAG] = { .size = MON_COORDS_SIZE(56, 32), .y_offset = 19 }, + [SPECIES_POLIWHIRL] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_POLIWRATH] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_ABRA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_KADABRA] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_ALAKAZAM] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_MACHOP] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, + [SPECIES_MACHOKE] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_MACHAMP] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_BELLSPROUT] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 15 }, + [SPECIES_WEEPINBELL] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_VICTREEBEL] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_TENTACOOL] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 9 }, + [SPECIES_TENTACRUEL] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_GEODUDE] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 18 }, + [SPECIES_GRAVELER] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_GOLEM] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_PONYTA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_RAPIDASH] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_SLOWPOKE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_SLOWBRO] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_MAGNEMITE] = { .size = MON_COORDS_SIZE(32, 24), .y_offset = 21 }, + [SPECIES_MAGNETON] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_FARFETCHD] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_DODUO] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 5 }, + [SPECIES_DODRIO] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_SEEL] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_DEWGONG] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_GRIMER] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_MUK] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_SHELLDER] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 16 }, + [SPECIES_CLOYSTER] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_GASTLY] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_HAUNTER] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_GENGAR] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_ONIX] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, + [SPECIES_DROWZEE] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_HYPNO] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_KRABBY] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 13 }, + [SPECIES_KINGLER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_VOLTORB] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 19 }, + [SPECIES_ELECTRODE] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 14 }, + [SPECIES_EXEGGCUTE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_EXEGGUTOR] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_CUBONE] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, + [SPECIES_MAROWAK] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 11 }, + [SPECIES_HITMONLEE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_HITMONCHAN] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 4 }, + [SPECIES_LICKITUNG] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_KOFFING] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_WEEZING] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_RHYHORN] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_RHYDON] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_CHANSEY] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_TANGELA] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 7 }, + [SPECIES_KANGASKHAN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_HORSEA] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 15 }, + [SPECIES_SEADRA] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 7 }, + [SPECIES_GOLDEEN] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_SEAKING] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_STARYU] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_STARMIE] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_MR_MIME] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_SCYTHER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_JYNX] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_ELECTABUZZ] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 2 }, + [SPECIES_MAGMAR] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_PINSIR] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_TAUROS] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, + [SPECIES_MAGIKARP] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_GYARADOS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 8 }, + [SPECIES_LAPRAS] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 13 }, + [SPECIES_DITTO] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 17 }, + [SPECIES_EEVEE] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 9 }, + [SPECIES_VAPOREON] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_JOLTEON] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_FLAREON] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_PORYGON] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 13 }, + [SPECIES_OMANYTE] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 15 }, + [SPECIES_OMASTAR] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 7 }, + [SPECIES_KABUTO] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 17 }, + [SPECIES_KABUTOPS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_AERODACTYL] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_SNORLAX] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_ARTICUNO] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_ZAPDOS] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_MOLTRES] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_DRATINI] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 14 }, + [SPECIES_DRAGONAIR] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_DRAGONITE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_MEWTWO] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_MEW] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 13 }, + [SPECIES_CHIKORITA] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 13 }, + [SPECIES_BAYLEEF] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_MEGANIUM] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_CYNDAQUIL] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 14 }, + [SPECIES_QUILAVA] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_TYPHLOSION] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, + [SPECIES_TOTODILE] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, + [SPECIES_CROCONAW] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_FERALIGATR] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_SENTRET] = { .size = MON_COORDS_SIZE(32, 56), .y_offset = 4 }, + [SPECIES_FURRET] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 7 }, + [SPECIES_HOOTHOOT] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 13 }, + [SPECIES_NOCTOWL] = { .size = MON_COORDS_SIZE(40, 64), .y_offset = 3 }, + [SPECIES_LEDYBA] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 12 }, + [SPECIES_LEDIAN] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 4 }, + [SPECIES_SPINARAK] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 19 }, + [SPECIES_ARIADOS] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_CROBAT] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_CHINCHOU] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 16 }, + [SPECIES_LANTURN] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 11 }, + [SPECIES_PICHU] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 12 }, + [SPECIES_CLEFFA] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 20 }, + [SPECIES_IGGLYBUFF] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 18 }, + [SPECIES_TOGEPI] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 20 }, + [SPECIES_TOGETIC] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 9 }, + [SPECIES_NATU] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 20 }, + [SPECIES_XATU] = { .size = MON_COORDS_SIZE(32, 56), .y_offset = 7 }, + [SPECIES_MAREEP] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 16 }, + [SPECIES_FLAAFFY] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 10 }, + [SPECIES_AMPHAROS] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_BELLOSSOM] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 14 }, + [SPECIES_MARILL] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, + [SPECIES_AZUMARILL] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_SUDOWOODO] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_POLITOED] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_HOPPIP] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_SKIPLOOM] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, + [SPECIES_JUMPLUFF] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_AIPOM] = { .size = MON_COORDS_SIZE(40, 64), .y_offset = 3 }, + [SPECIES_SUNKERN] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 16 }, + [SPECIES_SUNFLORA] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 8 }, + [SPECIES_YANMA] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_WOOPER] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 16 }, + [SPECIES_QUAGSIRE] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 7 }, + [SPECIES_ESPEON] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_UMBREON] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 8 }, + [SPECIES_MURKROW] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_SLOWKING] = { .size = MON_COORDS_SIZE(40, 64), .y_offset = 1 }, + [SPECIES_MISDREAVUS] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, + [SPECIES_UNOWN] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 15 }, + [SPECIES_WOBBUFFET] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_GIRAFARIG] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_PINECO] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 10 }, + [SPECIES_FORRETRESS] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_DUNSPARCE] = { .size = MON_COORDS_SIZE(56, 32), .y_offset = 17 }, + [SPECIES_GLIGAR] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 3 }, + [SPECIES_STEELIX] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_SNUBBULL] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 13 }, + [SPECIES_GRANBULL] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 6 }, + [SPECIES_QWILFISH] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 10 }, + [SPECIES_SCIZOR] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_SHUCKLE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_HERACROSS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_SNEASEL] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 5 }, + [SPECIES_TEDDIURSA] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 13 }, + [SPECIES_URSARING] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 1 }, + [SPECIES_SLUGMA] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 13 }, + [SPECIES_MAGCARGO] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 13 }, + [SPECIES_SWINUB] = { .size = MON_COORDS_SIZE(32, 24), .y_offset = 20 }, + [SPECIES_PILOSWINE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_CORSOLA] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_REMORAID] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 14 }, + [SPECIES_OCTILLERY] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_DELIBIRD] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 8 }, + [SPECIES_MANTINE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_SKARMORY] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_HOUNDOUR] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, + [SPECIES_HOUNDOOM] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_KINGDRA] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 4 }, + [SPECIES_PHANPY] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 16 }, + [SPECIES_DONPHAN] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_PORYGON2] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, + [SPECIES_STANTLER] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_SMEARGLE] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_TYROGUE] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 9 }, + [SPECIES_HITMONTOP] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 5 }, + [SPECIES_SMOOCHUM] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 15 }, + [SPECIES_ELEKID] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_MAGBY] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 13 }, + [SPECIES_MILTANK] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_BLISSEY] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, + [SPECIES_RAIKOU] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_ENTEI] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_SUICUNE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_LARVITAR] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 9 }, + [SPECIES_PUPITAR] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 9 }, + [SPECIES_TYRANITAR] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_LUGIA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_HO_OH] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_CELEBI] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 14 }, + [SPECIES_OLD_UNOWN_B] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_C] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_D] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_E] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_F] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_G] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_H] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_I] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_J] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_K] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_L] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_M] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_N] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_O] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_P] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_Q] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_R] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_S] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_T] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_U] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_V] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_W] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_X] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_Y] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_OLD_UNOWN_Z] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_TREECKO] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_GROVYLE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_SCEPTILE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_TORCHIC] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 8 }, + [SPECIES_COMBUSKEN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_BLAZIKEN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_MUDKIP] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 12 }, + [SPECIES_MARSHTOMP] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_SWAMPERT] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_POOCHYENA] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, + [SPECIES_MIGHTYENA] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_ZIGZAGOON] = { .size = MON_COORDS_SIZE(64, 40), .y_offset = 15 }, + [SPECIES_LINOONE] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 3 }, + [SPECIES_WURMPLE] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 14 }, + [SPECIES_SILCOON] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 17 }, + [SPECIES_BEAUTIFLY] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 9 }, + [SPECIES_CASCOON] = { .size = MON_COORDS_SIZE(56, 32), .y_offset = 16 }, + [SPECIES_DUSTOX] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 15 }, + [SPECIES_LOTAD] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 14 }, + [SPECIES_LOMBRE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_LUDICOLO] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_SEEDOT] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 16 }, + [SPECIES_NUZLEAF] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 8 }, + [SPECIES_SHIFTRY] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_NINCADA] = { .size = MON_COORDS_SIZE(56, 32), .y_offset = 18 }, + [SPECIES_NINJASK] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_SHEDINJA] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_TAILLOW] = { .size = MON_COORDS_SIZE(48, 32), .y_offset = 16 }, + [SPECIES_SWELLOW] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_SHROOMISH] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 16 }, + [SPECIES_BRELOOM] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_SPINDA] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 8 }, + [SPECIES_WINGULL] = { .size = MON_COORDS_SIZE(64, 32), .y_offset = 24 }, + [SPECIES_PELIPPER] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 4 }, + [SPECIES_SURSKIT] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 15 }, + [SPECIES_MASQUERAIN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_WAILMER] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 15 }, + [SPECIES_WAILORD] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 10 }, + [SPECIES_SKITTY] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 11 }, + [SPECIES_DELCATTY] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_KECLEON] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 7 }, + [SPECIES_BALTOY] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 16 }, + [SPECIES_CLAYDOL] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 6 }, + [SPECIES_NOSEPASS] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 12 }, + [SPECIES_TORKOAL] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_SABLEYE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_BARBOACH] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 11 }, + [SPECIES_WHISCASH] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 }, + [SPECIES_LUVDISC] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 24 }, + [SPECIES_CORPHISH] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 12 }, + [SPECIES_CRAWDAUNT] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_FEEBAS] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 13 }, + [SPECIES_MILOTIC] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_CARVANHA] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 6 }, + [SPECIES_SHARPEDO] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 3 }, + [SPECIES_TRAPINCH] = { .size = MON_COORDS_SIZE(40, 32), .y_offset = 16 }, + [SPECIES_VIBRAVA] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 12 }, + [SPECIES_FLYGON] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_MAKUHITA] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_HARIYAMA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_ELECTRIKE] = { .size = MON_COORDS_SIZE(48, 32), .y_offset = 18 }, + [SPECIES_MANECTRIC] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 4 }, + [SPECIES_NUMEL] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 15 }, + [SPECIES_CAMERUPT] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 9 }, + [SPECIES_SPHEAL] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 16 }, + [SPECIES_SEALEO] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 10 }, + [SPECIES_WALREIN] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_CACNEA] = { .size = MON_COORDS_SIZE(56, 32), .y_offset = 16 }, + [SPECIES_CACTURNE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_SNORUNT] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, + [SPECIES_GLALIE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 10 }, + [SPECIES_LUNATONE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_SOLROCK] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_AZURILL] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, + [SPECIES_SPOINK] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 9 }, + [SPECIES_GRUMPIG] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_PLUSLE] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 14 }, + [SPECIES_MINUN] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 12 }, + [SPECIES_MAWILE] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_MEDITITE] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 12 }, + [SPECIES_MEDICHAM] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 1 }, + [SPECIES_SWABLU] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 17 }, + [SPECIES_ALTARIA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_WYNAUT] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, + [SPECIES_DUSKULL] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 10 }, + [SPECIES_DUSCLOPS] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 5 }, + [SPECIES_ROSELIA] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 8 }, + [SPECIES_SLAKOTH] = { .size = MON_COORDS_SIZE(56, 32), .y_offset = 18 }, + [SPECIES_VIGOROTH] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, + [SPECIES_SLAKING] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, + [SPECIES_GULPIN] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 18 }, + [SPECIES_SWALOT] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_TROPIUS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_WHISMUR] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 14 }, + [SPECIES_LOUDRED] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 3 }, + [SPECIES_EXPLOUD] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_CLAMPERL] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 14 }, + [SPECIES_HUNTAIL] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 3 }, + [SPECIES_GOREBYSS] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 11 }, + [SPECIES_ABSOL] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 0 }, + [SPECIES_SHUPPET] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 14 }, + [SPECIES_BANETTE] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, + [SPECIES_SEVIPER] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 8 }, + [SPECIES_ZANGOOSE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 }, + [SPECIES_RELICANTH] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 11 }, + [SPECIES_ARON] = { .size = MON_COORDS_SIZE(32, 24), .y_offset = 20 }, + [SPECIES_LAIRON] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 13 }, + [SPECIES_AGGRON] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_CASTFORM] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 17 }, + [SPECIES_VOLBEAT] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_ILLUMISE] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 8 }, + [SPECIES_LILEEP] = { .size = MON_COORDS_SIZE(48, 56), .y_offset = 7 }, + [SPECIES_CRADILY] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, + [SPECIES_ANORITH] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 8 }, + [SPECIES_ARMALDO] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_RALTS] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 15 }, + [SPECIES_KIRLIA] = { .size = MON_COORDS_SIZE(32, 56), .y_offset = 6 }, + [SPECIES_GARDEVOIR] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 1 }, + [SPECIES_BAGON] = { .size = MON_COORDS_SIZE(40, 48), .y_offset = 11 }, + [SPECIES_SHELGON] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, + [SPECIES_SALAMENCE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_BELDUM] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 15 }, + [SPECIES_METANG] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 7 }, + [SPECIES_METAGROSS] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, + [SPECIES_REGIROCK] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 4 }, + [SPECIES_REGICE] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_REGISTEEL] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 3 }, + [SPECIES_KYOGRE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 4 }, + [SPECIES_GROUDON] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_RAYQUAZA] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 0 }, + [SPECIES_LATIAS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_LATIOS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 2 }, + [SPECIES_JIRACHI] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 13 }, + [SPECIES_DEOXYS] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 }, + [SPECIES_CHIMECHO] = { .size = MON_COORDS_SIZE(24, 56), .y_offset = 6 }, + [SPECIES_EGG] = { .size = MON_COORDS_SIZE(24, 24), .y_offset = 20 }, + [SPECIES_UNOWN_B] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 16 }, + [SPECIES_UNOWN_C] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 16 }, + [SPECIES_UNOWN_D] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 16 }, + [SPECIES_UNOWN_E] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 17 }, + [SPECIES_UNOWN_F] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 17 }, + [SPECIES_UNOWN_G] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 14 }, + [SPECIES_UNOWN_H] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 16 }, + [SPECIES_UNOWN_I] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 16 }, + [SPECIES_UNOWN_J] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 17 }, + [SPECIES_UNOWN_K] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 17 }, + [SPECIES_UNOWN_L] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 19 }, + [SPECIES_UNOWN_M] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 19 }, + [SPECIES_UNOWN_N] = { .size = MON_COORDS_SIZE(32, 24), .y_offset = 20 }, + [SPECIES_UNOWN_O] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 16 }, + [SPECIES_UNOWN_P] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 19 }, + [SPECIES_UNOWN_Q] = { .size = MON_COORDS_SIZE(32, 24), .y_offset = 21 }, + [SPECIES_UNOWN_R] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 19 }, + [SPECIES_UNOWN_S] = { .size = MON_COORDS_SIZE(32, 40), .y_offset = 12 }, + [SPECIES_UNOWN_T] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 18 }, + [SPECIES_UNOWN_U] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 18 }, + [SPECIES_UNOWN_V] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 18 }, + [SPECIES_UNOWN_W] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 19 }, + [SPECIES_UNOWN_X] = { .size = MON_COORDS_SIZE(24, 24), .y_offset = 21 }, + [SPECIES_UNOWN_Y] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 17 }, + [SPECIES_UNOWN_Z] = { .size = MON_COORDS_SIZE(24, 32), .y_offset = 16 }, + [SPECIES_UNOWN_EMARK] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 15 }, + [SPECIES_UNOWN_QMARK] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 13 }, }; From 91447796340c6738c610fd0b003209d54c72456e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 9 Sep 2022 08:49:16 -0400 Subject: [PATCH 113/155] Removed repeated extern consts in strings.h --- include/strings.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/strings.h b/include/strings.h index abcf5cc47c..eeada2b943 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2152,9 +2152,7 @@ extern const u8 gText_Switch2[]; extern const u8 gText_Item[]; extern const u8 gText_NotPkmnOtherTrainerWants[]; extern const u8 gText_ThatIsntAnEgg[]; -extern const u8 gText_PkmnCantBeTradedNow[]; extern const u8 gText_OtherTrainersPkmnCantBeTraded[]; -extern const u8 gText_EggCantBeTradedNow[]; extern const u8 gText_OtherTrainerCantAcceptPkmn[]; extern const u8 gText_CantTradeWithTrainer[]; From 431cb6fa7ccf7898c3dce308808e5cb26b422719 Mon Sep 17 00:00:00 2001 From: Blackforest92 Date: Fri, 9 Sep 2022 21:57:40 +0700 Subject: [PATCH 114/155] Tidying graphics - Trio Weather --- data/battle_anim_scripts.s | 32 +++++------------- .../backgrounds/windstorm_brew.pal | 19 +++++++++++ .../backgrounds/windstorm_brew.png | Bin 1067 -> 0 bytes .../battle_anims/sprites/primal_particles.png | Bin 510 -> 0 bytes include/constants/battle_anim.h | 5 ++- src/battle_anim_effects_3.c | 11 ------ src/battle_anim_flying.c | 4 +-- src/data/battle_anim.h | 2 -- src/graphics.c | 5 --- 9 files changed, 31 insertions(+), 47 deletions(-) create mode 100644 graphics/battle_anims/backgrounds/windstorm_brew.pal delete mode 100644 graphics/battle_anims/backgrounds/windstorm_brew.png delete mode 100644 graphics/battle_anims/sprites/primal_particles.png diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index f83d437a5d..601db597fe 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -24839,15 +24839,15 @@ General_PrimalReversion:: jumpargeq 0x1, ITEM_BLUE_ORB, General_PrimalReversion_Alpha General_PrimalReversion_Alpha: loadspritegfx ANIM_TAG_ALPHA_STONE - loadspritegfx ANIM_TAG_PRIMAL_PARTICLES + loadspritegfx ANIM_TAG_MEGA_PARTICLES loadspritegfx ANIM_TAG_ALPHA_SYMBOL monbg ANIM_ATTACKER setalpha 12, 8 loopsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER, 13, 3 createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) - call PrimalReversionParticles - call PrimalReversionParticles - call PrimalReversionParticles + call MegaEvolutionParticles + call MegaEvolutionParticles + call MegaEvolutionParticles waitforvisualfinish playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER createsprite gAlphaStoneSpriteTemplate, ANIM_ATTACKER, 41, 0, 0, 0, 0 @@ -24865,15 +24865,15 @@ General_PrimalReversion_Alpha: end General_PrimalReversion_Omega: loadspritegfx ANIM_TAG_OMEGA_STONE - loadspritegfx ANIM_TAG_PRIMAL_PARTICLES + loadspritegfx ANIM_TAG_MEGA_PARTICLES loadspritegfx ANIM_TAG_OMEGA_SYMBOL monbg ANIM_ATTACKER setalpha 12, 8 loopsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER, 13, 3 createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) - call PrimalReversionParticles - call PrimalReversionParticles - call PrimalReversionParticles + call MegaEvolutionParticles + call MegaEvolutionParticles + call MegaEvolutionParticles waitforvisualfinish playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER createsprite gOmegaStoneSpriteTemplate, ANIM_ATTACKER, 41, 0, 0, 0, 0 @@ -24889,22 +24889,6 @@ General_PrimalReversion_Omega: clearmonbg ANIM_ATK_PARTNER blendoff end -PrimalReversionParticles: - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 40, -10, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, -35, -10, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 15, -40, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, -10, -32, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 25, -20, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, -40, -20, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 5, -40, 13 - delay 3 - return General_AffectionHangedOn:: loadspritegfx ANIM_TAG_RED_HEART diff --git a/graphics/battle_anims/backgrounds/windstorm_brew.pal b/graphics/battle_anims/backgrounds/windstorm_brew.pal new file mode 100644 index 0000000000..2feb0f59e0 --- /dev/null +++ b/graphics/battle_anims/backgrounds/windstorm_brew.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +230 148 98 +255 255 222 +230 230 197 +213 205 172 +189 180 148 +172 156 123 +156 131 106 +0 0 0 +0 0 0 +0 0 0 +142 204 143 +123 180 122 +112 165 99 +89 130 87 +67 114 65 +55 91 56 diff --git a/graphics/battle_anims/backgrounds/windstorm_brew.png b/graphics/battle_anims/backgrounds/windstorm_brew.png deleted file mode 100644 index 2a28952662266dc252e5a0b850e41ed187241047..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1067 zcmV+`1l0S9P)%RwK{s1Cyb`=-00007bV*G`2jvO|3n4i=NfqV*000+sMObuGZ)S9NVRB^vM@&Re zPDdbiWpW@hE;Mn4q~QPn18_-1K~zY`O;wAbn=lO2{-ZRV0GkDBITKiH0B?i7-p6Tc zk_X`-`E)uRk#p9Z_?uaY6E8XsocW)~c|AAQS}Svm#PTJMx~rn&(b{PeKd!n;DRbh- zb46pAqZ`)InSeQ#6Cnc@@*?WOdM+d=!Dzgiv9Q&{b>D?gtx9~koHh)Z+1t-Kzx3?G zP-G>V0O+i`7b9@RFfITBG+YD=s0&e-b}yGORTi&-nF%)OTargNK ziYXW^Odmn}tu=+WbenTjrOY%`822G=0>`@Ls*IKdg?I_ zHWi&vqBHpX8d^+tG!nog7w>>cJjgCG4ZBfl>Y0Lo^wB^9JBP;)ap7Ky8+9`k(OAY* zMeStOZ*r?{x^i+hNXQt|p%Zdqq7ZkIQKoa@`x@qSQj-J1dZdKqeTN9eeQ6>jg%bg( z7?VPwzMVEkI+$E6DS(WSouh%gJJfb7XuiLQ99QRbQ@})s!5m$?lT6P>a#&V2baPsj z?EQ2hdf=3_dJnUZJJG&yV{ijiknlAXHS1GD`-~beh(o2Z8U=rrse#5qik$pWk`}_- z3pl7rf{2@(lgs)y6G(Cl3JS@it6Fp;JzuZai(pcc=3EH;pn&&0=YQflpr~>iMMSo4 z984uV?4~48YUIcd0pH(MMul$n(KUsv`uhIL!_mJD@e)ipqP#=iIXTze-Kdro&mv3E*Xy@V&5jnPo|Mo{zCT6WzS((@Avk zk=fg(aGdhVWn0hmU#YrVSL{;kQIfH^qkUV0bw;=USZwOmp(4~+LBedl`S2<7<+dWQ z{MO+6V*P!|QIcdtsr=3v!Z5c#h)2%Jlw)-^O{!K23arZr=$X_8&LLxKL~om%c{!mx zV?MB;%^gI2^leeb!{Hji`RaR(PJ_>FG~GPt&9s#$IWf~u^6@Mdz00_?jNa!T1l l#um@;gl~iLgz`0>e*mjVc!7vL=8gaW002ovPDHLkV1mAc^+W&w diff --git a/graphics/battle_anims/sprites/primal_particles.png b/graphics/battle_anims/sprites/primal_particles.png deleted file mode 100644 index 6fdf09d96e0d606f5253e5ed18da3c272120e6ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 510 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoQ!VDx|6+TY^QY`6?zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIi1;V5)EKCOG0EHAg;|it=M#{_S>O>_%)r2R1cVu< zYV%101=&kHeO=k_v+;>Y%TBb>0$R^-!qdeuMB;MkSzAA6Ljjftm4S70^!7P!X%c?J zx+ueSZqwV#8y5LIH!JaLcR5@*^ZAE0>`j^9Cfg`8ALfgA)2R6Tu2V|CBd6-7XF6I< zXE=;s`@AUD;Xm-|NOoDo&iNZcoH&Dx!^FC;kotR)G0UiF^6U!J>Hw}q4M{;9{;^}p4Yc+{(W|*rs(G7+07lj71mug zd;WDF7kn9csjh*UuAxbYp@o%^xs{P6 VL_^=Zwnsn>44$rjF6*2UngE>NybAyT diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index db2efd8d05..05d9f575a3 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -392,9 +392,8 @@ #define ANIM_TAG_STONE_PILLAR_MULTI (ANIM_SPRITES_START + 380) #define ANIM_TAG_ALPHA_SYMBOL (ANIM_SPRITES_START + 381) #define ANIM_TAG_OMEGA_SYMBOL (ANIM_SPRITES_START + 382) -#define ANIM_TAG_PRIMAL_PARTICLES (ANIM_SPRITES_START + 383) -#define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 384) -#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 385) +#define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 383) +#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 384) // battlers #define ANIM_ATTACKER 0 diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 3b9a9a8f8e..552fcf5170 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1239,17 +1239,6 @@ const struct SpriteTemplate gOmegaStoneSpriteTemplate = .callback = AnimSpriteOnMonPos, }; -const struct SpriteTemplate gPrimalParticlesSpriteTemplate = -{ - .tileTag = ANIM_TAG_PRIMAL_PARTICLES, - .paletteTag = ANIM_TAG_PRIMAL_PARTICLES, - .oam = &gOamData_AffineNormal_ObjBlend_16x16, - .anims = gPowerAbsorptionOrbAnimTable, - .images = NULL, - .affineAnims = gPowerAbsorptionOrbAffineAnimTable, - .callback = AnimPowerAbsorptionOrb, -}; - const struct SpriteTemplate gAlphaSymbolSpriteTemplate = { .tileTag = ANIM_TAG_ALPHA_SYMBOL, diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index 59d012f9ae..2735ea4478 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -1252,8 +1252,8 @@ void AnimTask_LoadWindstormBackground(u8 taskId) SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); GetBattleAnimBg1Data(&animBg); - AnimLoadCompressedBgGfx(animBg.bgId, gBattleAnimBgImage_Windstorm, animBg.tilesOffset); - AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimBgTilemap_Windstorm, 0); + AnimLoadCompressedBgGfx(animBg.bgId, gBattleAnimBgImage_Sandstorm, animBg.tilesOffset); + AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimBgTilemap_Sandstorm, 0); LoadCompressedPalette(gBattleAnimSpritePal_Windstorm, animBg.paletteId * 16, 32); if (gBattleAnimArgs[0] && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) diff --git a/src/data/battle_anim.h b/src/data/battle_anim.h index 6a67e0cd60..e6e03f06c1 100644 --- a/src/data/battle_anim.h +++ b/src/data/battle_anim.h @@ -1448,7 +1448,6 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_StonePillar, 0x1800, ANIM_TAG_STONE_PILLAR_MULTI}, {gBattleAnimSpriteGfx_AlphaSymbol, 0x0200, ANIM_TAG_ALPHA_SYMBOL}, {gBattleAnimSpriteGfx_OmegaSymbol, 0x0200, ANIM_TAG_OMEGA_SYMBOL}, - {gBattleAnimSpriteGfx_PrimalParticles, 0x0180, ANIM_TAG_PRIMAL_PARTICLES}, {gBattleAnimSpriteGfx_Orbs, 0x0180, ANIM_TAG_STEEL_BEAM}, {gBattleAnimSpriteGfx_AuraSphere, 0x200, ANIM_TAG_POLTERGEIST}, }; @@ -1899,7 +1898,6 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_StonePillar, ANIM_TAG_STONE_PILLAR_MULTI}, {gBattleAnimSpritePal_AlphaSymbol, ANIM_TAG_ALPHA_SYMBOL}, {gBattleAnimSpritePal_OmegaSymbol, ANIM_TAG_OMEGA_SYMBOL}, - {gBattleAnimSpritePal_PrimalParticles, ANIM_TAG_PRIMAL_PARTICLES}, {gBattleAnimSpritePal_SteelBeam, ANIM_TAG_STEEL_BEAM}, {gBattleAnimSpritePal_Poltergeist, ANIM_TAG_POLTERGEIST}, }; diff --git a/src/graphics.c b/src/graphics.c index 6a12dda1cc..306f35928f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -42,9 +42,6 @@ const u32 gBattleAnimSpritePal_AlphaSymbol[] = INCBIN_U32("graphics/battle_anims const u32 gBattleAnimSpriteGfx_OmegaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/omega_symbol.4bpp.lz"); const u32 gBattleAnimSpritePal_OmegaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/omega_symbol.gbapal.lz"); -const u32 gBattleAnimSpriteGfx_PrimalParticles[] = INCBIN_U32("graphics/battle_anims/sprites/primal_particles.4bpp.lz"); -const u32 gBattleAnimSpritePal_PrimalParticles[] = INCBIN_U32("graphics/battle_anims/sprites/primal_particles.gbapal.lz"); - const u32 gBattleAnimSpriteGfx_FlashCannonBall[] = INCBIN_U32("graphics/battle_anims/sprites/flash_cannon_ball.4bpp.lz"); const u32 gBattleAnimSpritePal_FlashCannonBall[] = INCBIN_U32("graphics/battle_anims/sprites/flash_cannon_ball.gbapal.lz"); @@ -1309,8 +1306,6 @@ const u32 gBattleAnimSpritePal_FlyingDirt[] = INCBIN_U32("graphics/battle_anims/ const u32 gBattleAnimBgTilemap_Sandstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/sandstorm_brew.bin.lz"); const u32 gBattleAnimBgImage_Sandstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/sandstorm_brew.4bpp.lz"); -const u32 gBattleAnimBgTilemap_Windstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/sandstorm_brew.bin.lz"); -const u32 gBattleAnimBgImage_Windstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/windstorm_brew.4bpp.lz"); const u32 gBattleAnimSpritePal_Windstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/windstorm_brew.gbapal.lz"); const u32 gBattleAnimSpriteGfx_MetalSoundWaves[] = INCBIN_U32("graphics/battle_anims/sprites/metal_sound_waves.4bpp.lz"); From d870d71dbe9437a1ec420be62b0b0aa35129a6bd Mon Sep 17 00:00:00 2001 From: Blackforest92 Date: Fri, 9 Sep 2022 22:26:29 +0700 Subject: [PATCH 115/155] Remove windstorm_brew leftovers --- include/graphics.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/graphics.h b/include/graphics.h index 197cb4bb41..808b320d4c 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -10085,9 +10085,6 @@ extern const u16 gSlotMachineReelTimePikachu_Pal[]; extern const u32 gBattleAnimBgTilemap_Sandstorm[]; extern const u32 gBattleAnimBgImage_Sandstorm[]; -extern const u32 gBattleAnimBgTilemap_Windstorm[]; -extern const u32 gBattleAnimBgImage_Windstorm[]; - // Pokedex Area Screen extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[]; extern const u16 gPokedexAreaScreenAreaUnknown_Pal[]; From 29529a0c47731a1901febe9ae7d8e6efc19fbf22 Mon Sep 17 00:00:00 2001 From: Blackforest92 Date: Fri, 9 Sep 2022 22:28:11 +0700 Subject: [PATCH 116/155] Remove primal_particle leftovers --- include/graphics.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/graphics.h b/include/graphics.h index 808b320d4c..4f8534f9a1 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -9631,8 +9631,6 @@ extern const u32 gBattleAnimSpriteGfx_MegaStone[]; extern const u32 gBattleAnimSpritePal_MegaStone[]; extern const u32 gBattleAnimSpriteGfx_MegaParticles[]; extern const u32 gBattleAnimSpritePal_MegaParticles[]; -extern const u32 gBattleAnimSpriteGfx_PrimalParticles[]; -extern const u32 gBattleAnimSpritePal_PrimalParticles[]; extern const u32 gBattleAnimSpriteGfx_MegaSymbol[]; extern const u32 gBattleAnimSpritePal_MegaSymbol[]; extern const u32 gBattleAnimSpriteGfx_FlashCannonBall[]; From e8832a265523d52149849f74298202aa89aed856 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 9 Sep 2022 14:56:12 -0300 Subject: [PATCH 117/155] Updated FORM_ITEM_HOLD check in GetFormChangeTargetSpeciesBoxMon --- src/pokemon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 63b3dae9dc..4dcec70b06 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8283,9 +8283,7 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 { case FORM_ITEM_HOLD: if ((heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) - || ability == formChanges[i].param2) - targetSpecies = formChanges[i].targetSpecies; - if ((heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) && ability == formChanges[i].param2) + && (ability == formChanges[i].param2 || formChanges[i].param2 == ABILITY_NONE)) targetSpecies = formChanges[i].targetSpecies; break; case FORM_ITEM_USE: From 12fee71008028e30bfc3bc446034a1390403bf01 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 9 Sep 2022 15:39:48 -0300 Subject: [PATCH 118/155] Merged FORM_ITEM_USE_TIME into FORM_ITEM_USE --- include/constants/pokemon.h | 5 ++-- src/data/items.h | 2 +- src/data/pokemon/form_change_tables.h | 17 +++++------- src/pokemon.c | 39 ++++++++++++++------------- 4 files changed, 30 insertions(+), 33 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 6912cfe6bb..98b32ffd51 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -322,9 +322,8 @@ #define FORM_ITEM_USE 2 #define FORM_MOVE 3 #define FORM_WITHDRAW 4 -#define FORM_ITEM_USE_TIME 5 -#define FORM_BATTLE_BEGIN 6 -#define FORM_BATTLE_END 7 +#define FORM_BATTLE_BEGIN 5 +#define FORM_BATTLE_END 6 #define NUM_MALE_LINK_FACILITY_CLASSES 8 #define NUM_FEMALE_LINK_FACILITY_CLASSES 8 diff --git a/src/data/items.h b/src/data/items.h index 08060db773..6649fb24b6 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -9071,7 +9071,7 @@ const struct Item gItems[] = .pocket = POCKET_KEY_ITEMS, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_FormChange, - .secondaryId = FORM_ITEM_USE_TIME, + .secondaryId = FORM_ITEM_USE, }, [ITEM_REVEAL_GLASS] = diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index ddcb4d9cbd..2531a10c9b 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -9,6 +9,8 @@ FORM_ITEM_HOLD: FORM_ITEM_USE: Form change activates when the item is used on the selected Pokémon. param1 = item to use + param2 = DAY if form change activates in the daytime, optional + NIGHT if form change activates at nighttime, optional FORM_MOVE: Form change activates when the Pokémon learns or forgets the move. @@ -20,13 +22,6 @@ FORM_WITHDRAW: Form change activates when the Pokémon is withdrawn from the PC or Daycare. no parameters -FORM_ITEM_USE_TIME: - Form change activates when the item is used on the selected Pokémon at the - appropriate time of day. - param1 = item to use - param2 = DAY if form change activates in the daytime - NIGHT if form change activates at nighttime - FORM_BATTLE_BEGIN: Form change activates when the Pokémon is sent out at the beginning of a battle param1 = item to hold, optional @@ -44,9 +39,9 @@ FORM_BATTLE_END: #define WHEN_LEARNED 0 #define WHEN_FORGOTTEN 1 -// FORM_ITEM_USE_TIME param2 Arguments -#define DAY 0 -#define NIGHT 1 +// FORM_ITEM_USE param2 Arguments +#define DAY 1 +#define NIGHT 2 #if P_NEW_POKEMON == TRUE static const struct FormChange sGiratinaFormChangeTable[] = { @@ -56,7 +51,7 @@ static const struct FormChange sGiratinaFormChangeTable[] = { }; static const struct FormChange sShayminFormChangeTable[] = { - {FORM_ITEM_USE_TIME, SPECIES_SHAYMIN_SKY, ITEM_GRACIDEA, DAY}, + {FORM_ITEM_USE, SPECIES_SHAYMIN_SKY, ITEM_GRACIDEA, DAY}, // {FORM_WITHDRAW, SPECIES_SHAYMIN}, {FORM_CHANGE_END}, }; diff --git a/src/pokemon.c b/src/pokemon.c index 722eaafe87..f735918083 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8273,30 +8273,33 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 targetSpecies = formChanges[i].targetSpecies; break; case FORM_ITEM_USE: + RtcCalcLocalTime(); if (arg == formChanges[i].param1) - targetSpecies = formChanges[i].targetSpecies; + { + if (!formChanges[i].param2) + { + targetSpecies = formChanges[i].targetSpecies; + } + else + { + switch (formChanges[i].param2) + { + case DAY: + if (gLocalTime.hours >= 12 && gLocalTime.hours < 24) + targetSpecies = formChanges[i].targetSpecies; + break; + case NIGHT: + if (gLocalTime.hours >= 0 && gLocalTime.hours < 12) + targetSpecies = formChanges[i].targetSpecies; + break; + } + } + } break; case FORM_MOVE: if (BoxMonKnowsMove(boxMon, formChanges[i].param1) != formChanges[i].param2) targetSpecies = formChanges[i].targetSpecies; break; - case FORM_ITEM_USE_TIME: - RtcCalcLocalTime(); - if (arg == formChanges[i].param1) - { - switch (formChanges[i].param2) - { - case DAY: - if (gLocalTime.hours >= 12 && gLocalTime.hours < 24) - targetSpecies = formChanges[i].targetSpecies; - break; - case NIGHT: - if (gLocalTime.hours >= 0 && gLocalTime.hours < 12) - targetSpecies = formChanges[i].targetSpecies; - break; - } - } - break; case FORM_BATTLE_BEGIN: case FORM_BATTLE_END: if (heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) From ceb0c67bcfc44ca202e22e9afa5638746a625bd8 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 9 Sep 2022 16:05:32 -0300 Subject: [PATCH 119/155] Modified check in case FORM_ITEM_USE of GetFormChangeTargetSpeciesBoxMon --- src/pokemon.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index f735918083..b421e5aced 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8273,26 +8273,23 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 targetSpecies = formChanges[i].targetSpecies; break; case FORM_ITEM_USE: - RtcCalcLocalTime(); if (arg == formChanges[i].param1) { - if (!formChanges[i].param2) + switch (formChanges[i].param2) { + case DAY: + RtcCalcLocalTime(); + if (gLocalTime.hours >= 12 && gLocalTime.hours < 24) + targetSpecies = formChanges[i].targetSpecies; + break; + case NIGHT: + RtcCalcLocalTime(); + if (gLocalTime.hours >= 0 && gLocalTime.hours < 12) + targetSpecies = formChanges[i].targetSpecies; + break; + default: targetSpecies = formChanges[i].targetSpecies; - } - else - { - switch (formChanges[i].param2) - { - case DAY: - if (gLocalTime.hours >= 12 && gLocalTime.hours < 24) - targetSpecies = formChanges[i].targetSpecies; - break; - case NIGHT: - if (gLocalTime.hours >= 0 && gLocalTime.hours < 12) - targetSpecies = formChanges[i].targetSpecies; - break; - } + break; } } break; From 503b85aa2daa9484647b961af062072c44c6cb76 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 9 Sep 2022 16:44:34 -0400 Subject: [PATCH 120/155] Generating music names for the debug menu based on their labels --- charmap.txt | 1 + src/debug.c | 1068 +++++++++++++++++++++++++-------------------------- 2 files changed, 535 insertions(+), 534 deletions(-) diff --git a/charmap.txt b/charmap.txt index 980a3e5dd8..2cb67a8613 100644 --- a/charmap.txt +++ b/charmap.txt @@ -79,6 +79,7 @@ SUPER_RE = A0 '?' = AC '.' = AD '-' = AE +'_' = AE @ For autogenerating strings based on label names. Not using {UNDERSCORE} on purpose due to how bad it looks. '·' = AF '…' = B0 '“' = B1 diff --git a/src/debug.c b/src/debug.c index 4cc1ac6168..19038723de 100644 --- a/src/debug.c +++ b/src/debug.c @@ -2839,544 +2839,544 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) } #define SOUND_LIST_BGM \ - X(MUS_LITTLEROOT_TEST, "MUS-LITTLEROOT-TEST") \ - X(MUS_GSC_ROUTE38, "MUS-GSC-ROUTE38") \ - X(MUS_CAUGHT, "MUS-CAUGHT") \ - X(MUS_VICTORY_WILD, "MUS-VICTORY-WILD") \ - X(MUS_VICTORY_GYM_LEADER, "MUS-VICTORY-GYM-LEADER") \ - X(MUS_VICTORY_LEAGUE, "MUS-VICTORY-LEAGUE") \ - X(MUS_C_COMM_CENTER, "MUS-C-COMM-CENTER") \ - X(MUS_GSC_PEWTER, "MUS-GSC-PEWTER") \ - X(MUS_C_VS_LEGEND_BEAST, "MUS-C-VS-LEGEND-BEAST") \ - X(MUS_ROUTE101, "MUS-ROUTE101") \ - X(MUS_ROUTE110, "MUS-ROUTE110") \ - X(MUS_ROUTE120, "MUS-ROUTE120") \ - X(MUS_PETALBURG, "MUS-PETALBURG") \ - X(MUS_OLDALE, "MUS-OLDALE") \ - X(MUS_GYM, "MUS-GYM") \ - X(MUS_SURF, "MUS-SURF") \ - X(MUS_PETALBURG_WOODS, "MUS-PETALBURG-WOODS") \ - X(MUS_LEVEL_UP, "MUS-LEVEL-UP") \ - X(MUS_HEAL, "MUS-HEAL") \ - X(MUS_OBTAIN_BADGE, "MUS-OBTAIN-BADGE") \ - X(MUS_OBTAIN_ITEM, "MUS-OBTAIN-ITEM") \ - X(MUS_EVOLVED, "MUS-EVOLVED") \ - X(MUS_OBTAIN_TMHM, "MUS-OBTAIN-TMHM") \ - X(MUS_LILYCOVE_MUSEUM, "MUS-LILYCOVE-MUSEUM") \ - X(MUS_ROUTE122, "MUS-ROUTE122") \ - X(MUS_OCEANIC_MUSEUM, "MUS-OCEANIC-MUSEUM") \ - X(MUS_EVOLUTION_INTRO, "MUS-EVOLUTION-INTRO") \ - X(MUS_EVOLUTION, "MUS-EVOLUTION") \ - X(MUS_MOVE_DELETED, "MUS-MOVE-DELETED") \ - X(MUS_ENCOUNTER_GIRL, "MUS-ENCOUNTER-GIRL") \ - X(MUS_ENCOUNTER_MALE, "MUS-ENCOUNTER-MALE") \ - X(MUS_ABANDONED_SHIP, "MUS-ABANDONED-SHIP") \ - X(MUS_FORTREE, "MUS-FORTREE") \ - X(MUS_BIRCH_LAB, "MUS-BIRCH-LAB") \ - X(MUS_B_TOWER_RS, "MUS-B-TOWER-RS") \ - X(MUS_ENCOUNTER_SWIMMER, "MUS-ENCOUNTER-SWIMMER") \ - X(MUS_CAVE_OF_ORIGIN, "MUS-CAVE-OF-ORIGIN") \ - X(MUS_OBTAIN_BERRY, "MUS-OBTAIN-BERRY") \ - X(MUS_AWAKEN_LEGEND, "MUS-AWAKEN-LEGEND") \ - X(MUS_SLOTS_JACKPOT, "MUS-SLOTS-JACKPOT") \ - X(MUS_SLOTS_WIN, "MUS-SLOTS-WIN") \ - X(MUS_TOO_BAD, "MUS-TOO-BAD") \ - X(MUS_ROULETTE, "MUS-ROULETTE") \ - X(MUS_LINK_CONTEST_P1, "MUS-LINK-CONTEST-P1") \ - X(MUS_LINK_CONTEST_P2, "MUS-LINK-CONTEST-P2") \ - X(MUS_LINK_CONTEST_P3, "MUS-LINK-CONTEST-P3") \ - X(MUS_LINK_CONTEST_P4, "MUS-LINK-CONTEST-P4") \ - X(MUS_ENCOUNTER_RICH, "MUS-ENCOUNTER-RICH") \ - X(MUS_VERDANTURF, "MUS-VERDANTURF") \ - X(MUS_RUSTBORO, "MUS-RUSTBORO") \ - X(MUS_POKE_CENTER, "MUS-POKE-CENTER") \ - X(MUS_ROUTE104, "MUS-ROUTE104") \ - X(MUS_ROUTE119, "MUS-ROUTE119") \ - X(MUS_CYCLING, "MUS-CYCLING") \ - X(MUS_POKE_MART, "MUS-POKE-MART") \ - X(MUS_LITTLEROOT, "MUS-LITTLEROOT") \ - X(MUS_MT_CHIMNEY, "MUS-MT-CHIMNEY") \ - X(MUS_ENCOUNTER_FEMALE, "MUS-ENCOUNTER-FEMALE") \ - X(MUS_LILYCOVE, "MUS-LILYCOVE") \ - X(MUS_ROUTE111, "MUS-ROUTE111") \ - X(MUS_HELP, "MUS-HELP") \ - X(MUS_UNDERWATER, "MUS-UNDERWATER") \ - X(MUS_VICTORY_TRAINER, "MUS-VICTORY-TRAINER") \ - X(MUS_TITLE, "MUS-TITLE") \ - X(MUS_INTRO, "MUS-INTRO") \ - X(MUS_ENCOUNTER_MAY, "MUS-ENCOUNTER-MAY") \ - X(MUS_ENCOUNTER_INTENSE, "MUS-ENCOUNTER-INTENSE") \ - X(MUS_ENCOUNTER_COOL, "MUS-ENCOUNTER-COOL") \ - X(MUS_ROUTE113, "MUS-ROUTE113") \ - X(MUS_ENCOUNTER_AQUA, "MUS-ENCOUNTER-AQUA") \ - X(MUS_FOLLOW_ME, "MUS-FOLLOW-ME") \ - X(MUS_ENCOUNTER_BRENDAN, "MUS-ENCOUNTER-BRENDAN") \ - X(MUS_EVER_GRANDE, "MUS-EVER-GRANDE") \ - X(MUS_ENCOUNTER_SUSPICIOUS, "MUS-ENCOUNTER-SUSPICIOUS") \ - X(MUS_VICTORY_AQUA_MAGMA, "MUS-VICTORY-AQUA-MAGMA") \ - X(MUS_CABLE_CAR, "MUS-CABLE-CAR") \ - X(MUS_GAME_CORNER, "MUS-GAME-CORNER") \ - X(MUS_DEWFORD, "MUS-DEWFORD") \ - X(MUS_SAFARI_ZONE, "MUS-SAFARI-ZONE") \ - X(MUS_VICTORY_ROAD, "MUS-VICTORY-ROAD") \ - X(MUS_AQUA_MAGMA_HIDEOUT, "MUS-AQUA-MAGMA-HIDEOUT") \ - X(MUS_SAILING, "MUS-SAILING") \ - X(MUS_MT_PYRE, "MUS-MT-PYRE") \ - X(MUS_SLATEPORT, "MUS-SLATEPORT") \ - X(MUS_MT_PYRE_EXTERIOR, "MUS-MT-PYRE-EXTERIOR") \ - X(MUS_SCHOOL, "MUS-SCHOOL") \ - X(MUS_HALL_OF_FAME, "MUS-HALL-OF-FAME") \ - X(MUS_FALLARBOR, "MUS-FALLARBOR") \ - X(MUS_SEALED_CHAMBER, "MUS-SEALED-CHAMBER") \ - X(MUS_CONTEST_WINNER, "MUS-CONTEST-WINNER") \ - X(MUS_CONTEST, "MUS-CONTEST") \ - X(MUS_ENCOUNTER_MAGMA, "MUS-ENCOUNTER-MAGMA") \ - X(MUS_INTRO_BATTLE, "MUS-INTRO-BATTLE") \ - X(MUS_WEATHER_KYOGRE, "MUS-WEATHER-KYOGRE") \ - X(MUS_WEATHER_GROUDON, "MUS-WEATHER-GROUDON") \ - X(MUS_SOOTOPOLIS, "MUS-SOOTOPOLIS") \ - X(MUS_CONTEST_RESULTS, "MUS-CONTEST-RESULTS") \ - X(MUS_HALL_OF_FAME_ROOM, "MUS-HALL-OF-FAME-ROOM") \ - X(MUS_TRICK_HOUSE, "MUS-TRICK-HOUSE") \ - X(MUS_ENCOUNTER_TWINS, "MUS-ENCOUNTER-TWINS") \ - X(MUS_ENCOUNTER_ELITE_FOUR, "MUS-ENCOUNTER-ELITE-FOUR") \ - X(MUS_ENCOUNTER_HIKER, "MUS-ENCOUNTER-HIKER") \ - X(MUS_CONTEST_LOBBY, "MUS-CONTEST-LOBBY") \ - X(MUS_ENCOUNTER_INTERVIEWER, "MUS-ENCOUNTER-INTERVIEWER") \ - X(MUS_ENCOUNTER_CHAMPION, "MUS-ENCOUNTER-CHAMPION") \ - X(MUS_CREDITS, "MUS-CREDITS") \ - X(MUS_END, "MUS-END") \ - X(MUS_B_FRONTIER, "MUS-B-FRONTIER") \ - X(MUS_B_ARENA, "MUS-B-ARENA") \ - X(MUS_OBTAIN_B_POINTS, "MUS-OBTAIN-B-POINTS") \ - X(MUS_REGISTER_MATCH_CALL, "MUS-REGISTER-MATCH-CALL") \ - X(MUS_B_PYRAMID, "MUS-B-PYRAMID") \ - X(MUS_B_PYRAMID_TOP, "MUS-B-PYRAMID-TOP") \ - X(MUS_B_PALACE, "MUS-B-PALACE") \ - X(MUS_RAYQUAZA_APPEARS, "MUS-RAYQUAZA-APPEARS") \ - X(MUS_B_TOWER, "MUS-B-TOWER") \ - X(MUS_OBTAIN_SYMBOL, "MUS-OBTAIN-SYMBOL") \ - X(MUS_B_DOME, "MUS-B-DOME") \ - X(MUS_B_PIKE, "MUS-B-PIKE") \ - X(MUS_B_FACTORY, "MUS-B-FACTORY") \ - X(MUS_VS_RAYQUAZA, "MUS-VS-RAYQUAZA") \ - X(MUS_VS_FRONTIER_BRAIN, "MUS-VS-FRONTIER-BRAIN") \ - X(MUS_VS_MEW, "MUS-VS-MEW") \ - X(MUS_B_DOME_LOBBY, "MUS-B-DOME-LOBBY") \ - X(MUS_VS_WILD, "MUS-VS-WILD") \ - X(MUS_VS_AQUA_MAGMA, "MUS-VS-AQUA-MAGMA") \ - X(MUS_VS_TRAINER, "MUS-VS-TRAINER") \ - X(MUS_VS_GYM_LEADER, "MUS-VS-GYM-LEADER") \ - X(MUS_VS_CHAMPION, "MUS-VS-CHAMPION") \ - X(MUS_VS_REGI, "MUS-VS-REGI") \ - X(MUS_VS_KYOGRE_GROUDON, "MUS-VS-KYOGRE-GROUDON") \ - X(MUS_VS_RIVAL, "MUS-VS-RIVAL") \ - X(MUS_VS_ELITE_FOUR, "MUS-VS-ELITE-FOUR") \ - X(MUS_VS_AQUA_MAGMA_LEADER, "MUS-VS-AQUA-MAGMA-LEADER") \ - X(MUS_RG_FOLLOW_ME, "MUS-RG-FOLLOW-ME") \ - X(MUS_RG_GAME_CORNER, "MUS-RG-GAME-CORNER") \ - X(MUS_RG_ROCKET_HIDEOUT, "MUS-RG-ROCKET-HIDEOUT") \ - X(MUS_RG_GYM, "MUS-RG-GYM") \ - X(MUS_RG_JIGGLYPUFF, "MUS-RG-JIGGLYPUFF") \ - X(MUS_RG_INTRO_FIGHT, "MUS-RG-INTRO-FIGHT") \ - X(MUS_RG_TITLE, "MUS-RG-TITLE") \ - X(MUS_RG_CINNABAR, "MUS-RG-CINNABAR") \ - X(MUS_RG_LAVENDER, "MUS-RG-LAVENDER") \ - X(MUS_RG_HEAL, "MUS-RG-HEAL") \ - X(MUS_RG_CYCLING, "MUS-RG-CYCLING") \ - X(MUS_RG_ENCOUNTER_ROCKET, "MUS-RG-ENCOUNTER-ROCKET") \ - X(MUS_RG_ENCOUNTER_GIRL, "MUS-RG-ENCOUNTER-GIRL") \ - X(MUS_RG_ENCOUNTER_BOY, "MUS-RG-ENCOUNTER-BOY") \ - X(MUS_RG_HALL_OF_FAME, "MUS-RG-HALL-OF-FAME") \ - X(MUS_RG_VIRIDIAN_FOREST, "MUS-RG-VIRIDIAN-FOREST") \ - X(MUS_RG_MT_MOON, "MUS-RG-MT-MOON") \ - X(MUS_RG_POKE_MANSION, "MUS-RG-POKE-MANSION") \ - X(MUS_RG_CREDITS, "MUS-RG-CREDITS") \ - X(MUS_RG_ROUTE1, "MUS-RG-ROUTE1") \ - X(MUS_RG_ROUTE24, "MUS-RG-ROUTE24") \ - X(MUS_RG_ROUTE3, "MUS-RG-ROUTE3") \ - X(MUS_RG_ROUTE11, "MUS-RG-ROUTE11") \ - X(MUS_RG_VICTORY_ROAD, "MUS-RG-VICTORY-ROAD") \ - X(MUS_RG_VS_GYM_LEADER, "MUS-RG-VS-GYM-LEADER") \ - X(MUS_RG_VS_TRAINER, "MUS-RG-VS-TRAINER") \ - X(MUS_RG_VS_WILD, "MUS-RG-VS-WILD") \ - X(MUS_RG_VS_CHAMPION, "MUS-RG-VS-CHAMPION") \ - X(MUS_RG_PALLET, "MUS-RG-PALLET") \ - X(MUS_RG_OAK_LAB, "MUS-RG-OAK-LAB") \ - X(MUS_RG_OAK, "MUS-RG-OAK") \ - X(MUS_RG_POKE_CENTER, "MUS-RG-POKE-CENTER") \ - X(MUS_RG_SS_ANNE, "MUS-RG-SS-ANNE") \ - X(MUS_RG_SURF, "MUS-RG-SURF") \ - X(MUS_RG_POKE_TOWER, "MUS-RG-POKE-TOWER") \ - X(MUS_RG_SILPH, "MUS-RG-SILPH") \ - X(MUS_RG_FUCHSIA, "MUS-RG-FUCHSIA") \ - X(MUS_RG_CELADON, "MUS-RG-CELADON") \ - X(MUS_RG_VICTORY_TRAINER, "MUS-RG-VICTORY-TRAINER") \ - X(MUS_RG_VICTORY_WILD, "MUS-RG-VICTORY-WILD") \ - X(MUS_RG_VICTORY_GYM_LEADER, "MUS-RG-VICTORY-GYM-LEADER") \ - X(MUS_RG_VERMILLION, "MUS-RG-VERMILLION") \ - X(MUS_RG_PEWTER, "MUS-RG-PEWTER") \ - X(MUS_RG_ENCOUNTER_RIVAL, "MUS-RG-ENCOUNTER-RIVAL") \ - X(MUS_RG_RIVAL_EXIT, "MUS-RG-RIVAL-EXIT") \ - X(MUS_RG_DEX_RATING, "MUS-RG-DEX-RATING") \ - X(MUS_RG_OBTAIN_KEY_ITEM, "MUS-RG-OBTAIN-KEY-ITEM") \ - X(MUS_RG_CAUGHT_INTRO, "MUS-RG-CAUGHT-INTRO") \ - X(MUS_RG_PHOTO, "MUS-RG-PHOTO") \ - X(MUS_RG_GAME_FREAK, "MUS-RG-GAME-FREAK") \ - X(MUS_RG_CAUGHT, "MUS-RG-CAUGHT") \ - X(MUS_RG_NEW_GAME_INSTRUCT, "MUS-RG-NEW-GAME-INSTRUCT") \ - X(MUS_RG_NEW_GAME_INTRO, "MUS-RG-NEW-GAME-INTRO") \ - X(MUS_RG_NEW_GAME_EXIT, "MUS-RG-NEW-GAME-EXIT") \ - X(MUS_RG_POKE_JUMP, "MUS-RG-POKE-JUMP") \ - X(MUS_RG_UNION_ROOM, "MUS-RG-UNION-ROOM") \ - X(MUS_RG_NET_CENTER, "MUS-RG-NET-CENTER") \ - X(MUS_RG_MYSTERY_GIFT, "MUS-RG-MYSTERY-GIFT") \ - X(MUS_RG_BERRY_PICK, "MUS-RG-BERRY-PICK") \ - X(MUS_RG_SEVII_CAVE, "MUS-RG-SEVII-CAVE") \ - X(MUS_RG_TEACHY_TV_SHOW, "MUS-RG-TEACHY-TV-SHOW") \ - X(MUS_RG_SEVII_ROUTE, "MUS-RG-SEVII-ROUTE") \ - X(MUS_RG_SEVII_DUNGEON, "MUS-RG-SEVII-DUNGEON") \ - X(MUS_RG_SEVII_123, "MUS-RG-SEVII-123") \ - X(MUS_RG_SEVII_45, "MUS-RG-SEVII-45") \ - X(MUS_RG_SEVII_67, "MUS-RG-SEVII-67") \ - X(MUS_RG_POKE_FLUTE, "MUS-RG-POKE-FLUTE") \ - X(MUS_RG_VS_DEOXYS, "MUS-RG-VS-DEOXYS") \ - X(MUS_RG_VS_MEWTWO, "MUS-RG-VS-MEWTWO") \ - X(MUS_RG_VS_LEGEND, "MUS-RG-VS-LEGEND") \ - X(MUS_RG_ENCOUNTER_GYM_LEADER, "MUS-RG-ENCOUNTER-GYM-LEADER") \ - X(MUS_RG_ENCOUNTER_DEOXYS, "MUS-RG-ENCOUNTER-DEOXYS") \ - X(MUS_RG_TRAINER_TOWER, "MUS-RG-TRAINER-TOWER") \ - X(MUS_RG_SLOW_PALLET, "MUS-RG-SLOW-PALLET") \ - X(MUS_RG_TEACHY_TV_MENU, "MUS-RG-TEACHY-TV-MENU") \ - X(PH_TRAP_BLEND, "PH-TRAP-BLEND") \ - X(PH_TRAP_HELD, "PH-TRAP-HELD") \ - X(PH_TRAP_SOLO, "PH-TRAP-SOLO") \ - X(PH_FACE_BLEND, "PH-FACE-BLEND") \ - X(PH_FACE_HELD, "PH-FACE-HELD") \ - X(PH_FACE_SOLO, "PH-FACE-SOLO") \ - X(PH_CLOTH_BLEND, "PH-CLOTH-BLEND") \ - X(PH_CLOTH_HELD, "PH-CLOTH-HELD") \ - X(PH_CLOTH_SOLO, "PH-CLOTH-SOLO") \ - X(PH_DRESS_BLEND, "PH-DRESS-BLEND") \ - X(PH_DRESS_HELD, "PH-DRESS-HELD") \ - X(PH_DRESS_SOLO, "PH-DRESS-SOLO") \ - X(PH_FLEECE_BLEND, "PH-FLEECE-BLEND") \ - X(PH_FLEECE_HELD, "PH-FLEECE-HELD") \ - X(PH_FLEECE_SOLO, "PH-FLEECE-SOLO") \ - X(PH_KIT_BLEND, "PH-KIT-BLEND") \ - X(PH_KIT_HELD, "PH-KIT-HELD") \ - X(PH_KIT_SOLO, "PH-KIT-SOLO") \ - X(PH_PRICE_BLEND, "PH-PRICE-BLEND") \ - X(PH_PRICE_HELD, "PH-PRICE-HELD") \ - X(PH_PRICE_SOLO, "PH-PRICE-SOLO") \ - X(PH_LOT_BLEND, "PH-LOT-BLEND") \ - X(PH_LOT_HELD, "PH-LOT-HELD") \ - X(PH_LOT_SOLO, "PH-LOT-SOLO") \ - X(PH_GOAT_BLEND, "PH-GOAT-BLEND") \ - X(PH_GOAT_HELD, "PH-GOAT-HELD") \ - X(PH_GOAT_SOLO, "PH-GOAT-SOLO") \ - X(PH_THOUGHT_BLEND, "PH-THOUGHT-BLEND") \ - X(PH_THOUGHT_HELD, "PH-THOUGHT-HELD") \ - X(PH_THOUGHT_SOLO, "PH-THOUGHT-SOLO") \ - X(PH_CHOICE_BLEND, "PH-CHOICE-BLEND") \ - X(PH_CHOICE_HELD, "PH-CHOICE-HELD") \ - X(PH_CHOICE_SOLO, "PH-CHOICE-SOLO") \ - X(PH_MOUTH_BLEND, "PH-MOUTH-BLEND") \ - X(PH_MOUTH_HELD, "PH-MOUTH-HELD") \ - X(PH_MOUTH_SOLO, "PH-MOUTH-SOLO") \ - X(PH_FOOT_BLEND, "PH-FOOT-BLEND") \ - X(PH_FOOT_HELD, "PH-FOOT-HELD") \ - X(PH_FOOT_SOLO, "PH-FOOT-SOLO") \ - X(PH_GOOSE_BLEND, "PH-GOOSE-BLEND") \ - X(PH_GOOSE_HELD, "PH-GOOSE-HELD") \ - X(PH_GOOSE_SOLO, "PH-GOOSE-SOLO") \ - X(PH_STRUT_BLEND, "PH-STRUT-BLEND") \ - X(PH_STRUT_HELD, "PH-STRUT-HELD") \ - X(PH_STRUT_SOLO, "PH-STRUT-SOLO") \ - X(PH_CURE_BLEND, "PH-CURE-BLEND") \ - X(PH_CURE_HELD, "PH-CURE-HELD") \ - X(PH_CURE_SOLO, "PH-CURE-SOLO") \ - X(PH_NURSE_BLEND, "PH-NURSE-BLEND") \ - X(PH_NURSE_HELD, "PH-NURSE-HELD") \ - X(PH_NURSE_SOLO, "PH-NURSE-SOLO") \ + X(MUS_LITTLEROOT_TEST) \ + X(MUS_GSC_ROUTE38) \ + X(MUS_CAUGHT) \ + X(MUS_VICTORY_WILD) \ + X(MUS_VICTORY_GYM_LEADER) \ + X(MUS_VICTORY_LEAGUE) \ + X(MUS_C_COMM_CENTER) \ + X(MUS_GSC_PEWTER) \ + X(MUS_C_VS_LEGEND_BEAST) \ + X(MUS_ROUTE101) \ + X(MUS_ROUTE110) \ + X(MUS_ROUTE120) \ + X(MUS_PETALBURG) \ + X(MUS_OLDALE) \ + X(MUS_GYM) \ + X(MUS_SURF) \ + X(MUS_PETALBURG_WOODS) \ + X(MUS_LEVEL_UP) \ + X(MUS_HEAL) \ + X(MUS_OBTAIN_BADGE) \ + X(MUS_OBTAIN_ITEM) \ + X(MUS_EVOLVED) \ + X(MUS_OBTAIN_TMHM) \ + X(MUS_LILYCOVE_MUSEUM) \ + X(MUS_ROUTE122) \ + X(MUS_OCEANIC_MUSEUM) \ + X(MUS_EVOLUTION_INTRO) \ + X(MUS_EVOLUTION) \ + X(MUS_MOVE_DELETED) \ + X(MUS_ENCOUNTER_GIRL) \ + X(MUS_ENCOUNTER_MALE) \ + X(MUS_ABANDONED_SHIP) \ + X(MUS_FORTREE) \ + X(MUS_BIRCH_LAB) \ + X(MUS_B_TOWER_RS) \ + X(MUS_ENCOUNTER_SWIMMER) \ + X(MUS_CAVE_OF_ORIGIN) \ + X(MUS_OBTAIN_BERRY) \ + X(MUS_AWAKEN_LEGEND) \ + X(MUS_SLOTS_JACKPOT) \ + X(MUS_SLOTS_WIN) \ + X(MUS_TOO_BAD) \ + X(MUS_ROULETTE) \ + X(MUS_LINK_CONTEST_P1) \ + X(MUS_LINK_CONTEST_P2) \ + X(MUS_LINK_CONTEST_P3) \ + X(MUS_LINK_CONTEST_P4) \ + X(MUS_ENCOUNTER_RICH) \ + X(MUS_VERDANTURF) \ + X(MUS_RUSTBORO) \ + X(MUS_POKE_CENTER) \ + X(MUS_ROUTE104) \ + X(MUS_ROUTE119) \ + X(MUS_CYCLING) \ + X(MUS_POKE_MART) \ + X(MUS_LITTLEROOT) \ + X(MUS_MT_CHIMNEY) \ + X(MUS_ENCOUNTER_FEMALE) \ + X(MUS_LILYCOVE) \ + X(MUS_ROUTE111) \ + X(MUS_HELP) \ + X(MUS_UNDERWATER) \ + X(MUS_VICTORY_TRAINER) \ + X(MUS_TITLE) \ + X(MUS_INTRO) \ + X(MUS_ENCOUNTER_MAY) \ + X(MUS_ENCOUNTER_INTENSE) \ + X(MUS_ENCOUNTER_COOL) \ + X(MUS_ROUTE113) \ + X(MUS_ENCOUNTER_AQUA) \ + X(MUS_FOLLOW_ME) \ + X(MUS_ENCOUNTER_BRENDAN) \ + X(MUS_EVER_GRANDE) \ + X(MUS_ENCOUNTER_SUSPICIOUS) \ + X(MUS_VICTORY_AQUA_MAGMA) \ + X(MUS_CABLE_CAR) \ + X(MUS_GAME_CORNER) \ + X(MUS_DEWFORD) \ + X(MUS_SAFARI_ZONE) \ + X(MUS_VICTORY_ROAD) \ + X(MUS_AQUA_MAGMA_HIDEOUT) \ + X(MUS_SAILING) \ + X(MUS_MT_PYRE) \ + X(MUS_SLATEPORT) \ + X(MUS_MT_PYRE_EXTERIOR) \ + X(MUS_SCHOOL) \ + X(MUS_HALL_OF_FAME) \ + X(MUS_FALLARBOR) \ + X(MUS_SEALED_CHAMBER) \ + X(MUS_CONTEST_WINNER) \ + X(MUS_CONTEST) \ + X(MUS_ENCOUNTER_MAGMA) \ + X(MUS_INTRO_BATTLE) \ + X(MUS_WEATHER_KYOGRE) \ + X(MUS_WEATHER_GROUDON) \ + X(MUS_SOOTOPOLIS) \ + X(MUS_CONTEST_RESULTS) \ + X(MUS_HALL_OF_FAME_ROOM) \ + X(MUS_TRICK_HOUSE) \ + X(MUS_ENCOUNTER_TWINS) \ + X(MUS_ENCOUNTER_ELITE_FOUR) \ + X(MUS_ENCOUNTER_HIKER) \ + X(MUS_CONTEST_LOBBY) \ + X(MUS_ENCOUNTER_INTERVIEWER) \ + X(MUS_ENCOUNTER_CHAMPION) \ + X(MUS_CREDITS) \ + X(MUS_END) \ + X(MUS_B_FRONTIER) \ + X(MUS_B_ARENA) \ + X(MUS_OBTAIN_B_POINTS) \ + X(MUS_REGISTER_MATCH_CALL) \ + X(MUS_B_PYRAMID) \ + X(MUS_B_PYRAMID_TOP) \ + X(MUS_B_PALACE) \ + X(MUS_RAYQUAZA_APPEARS) \ + X(MUS_B_TOWER) \ + X(MUS_OBTAIN_SYMBOL) \ + X(MUS_B_DOME) \ + X(MUS_B_PIKE) \ + X(MUS_B_FACTORY) \ + X(MUS_VS_RAYQUAZA) \ + X(MUS_VS_FRONTIER_BRAIN) \ + X(MUS_VS_MEW) \ + X(MUS_B_DOME_LOBBY) \ + X(MUS_VS_WILD) \ + X(MUS_VS_AQUA_MAGMA) \ + X(MUS_VS_TRAINER) \ + X(MUS_VS_GYM_LEADER) \ + X(MUS_VS_CHAMPION) \ + X(MUS_VS_REGI) \ + X(MUS_VS_KYOGRE_GROUDON) \ + X(MUS_VS_RIVAL) \ + X(MUS_VS_ELITE_FOUR) \ + X(MUS_VS_AQUA_MAGMA_LEADER) \ + X(MUS_RG_FOLLOW_ME) \ + X(MUS_RG_GAME_CORNER) \ + X(MUS_RG_ROCKET_HIDEOUT) \ + X(MUS_RG_GYM) \ + X(MUS_RG_JIGGLYPUFF) \ + X(MUS_RG_INTRO_FIGHT) \ + X(MUS_RG_TITLE) \ + X(MUS_RG_CINNABAR) \ + X(MUS_RG_LAVENDER) \ + X(MUS_RG_HEAL) \ + X(MUS_RG_CYCLING) \ + X(MUS_RG_ENCOUNTER_ROCKET) \ + X(MUS_RG_ENCOUNTER_GIRL) \ + X(MUS_RG_ENCOUNTER_BOY) \ + X(MUS_RG_HALL_OF_FAME) \ + X(MUS_RG_VIRIDIAN_FOREST) \ + X(MUS_RG_MT_MOON) \ + X(MUS_RG_POKE_MANSION) \ + X(MUS_RG_CREDITS) \ + X(MUS_RG_ROUTE1) \ + X(MUS_RG_ROUTE24) \ + X(MUS_RG_ROUTE3) \ + X(MUS_RG_ROUTE11) \ + X(MUS_RG_VICTORY_ROAD) \ + X(MUS_RG_VS_GYM_LEADER) \ + X(MUS_RG_VS_TRAINER) \ + X(MUS_RG_VS_WILD) \ + X(MUS_RG_VS_CHAMPION) \ + X(MUS_RG_PALLET) \ + X(MUS_RG_OAK_LAB) \ + X(MUS_RG_OAK) \ + X(MUS_RG_POKE_CENTER) \ + X(MUS_RG_SS_ANNE) \ + X(MUS_RG_SURF) \ + X(MUS_RG_POKE_TOWER) \ + X(MUS_RG_SILPH) \ + X(MUS_RG_FUCHSIA) \ + X(MUS_RG_CELADON) \ + X(MUS_RG_VICTORY_TRAINER) \ + X(MUS_RG_VICTORY_WILD) \ + X(MUS_RG_VICTORY_GYM_LEADER) \ + X(MUS_RG_VERMILLION) \ + X(MUS_RG_PEWTER) \ + X(MUS_RG_ENCOUNTER_RIVAL) \ + X(MUS_RG_RIVAL_EXIT) \ + X(MUS_RG_DEX_RATING) \ + X(MUS_RG_OBTAIN_KEY_ITEM) \ + X(MUS_RG_CAUGHT_INTRO) \ + X(MUS_RG_PHOTO) \ + X(MUS_RG_GAME_FREAK) \ + X(MUS_RG_CAUGHT) \ + X(MUS_RG_NEW_GAME_INSTRUCT) \ + X(MUS_RG_NEW_GAME_INTRO) \ + X(MUS_RG_NEW_GAME_EXIT) \ + X(MUS_RG_POKE_JUMP) \ + X(MUS_RG_UNION_ROOM) \ + X(MUS_RG_NET_CENTER) \ + X(MUS_RG_MYSTERY_GIFT) \ + X(MUS_RG_BERRY_PICK) \ + X(MUS_RG_SEVII_CAVE) \ + X(MUS_RG_TEACHY_TV_SHOW) \ + X(MUS_RG_SEVII_ROUTE) \ + X(MUS_RG_SEVII_DUNGEON) \ + X(MUS_RG_SEVII_123) \ + X(MUS_RG_SEVII_45) \ + X(MUS_RG_SEVII_67) \ + X(MUS_RG_POKE_FLUTE) \ + X(MUS_RG_VS_DEOXYS) \ + X(MUS_RG_VS_MEWTWO) \ + X(MUS_RG_VS_LEGEND) \ + X(MUS_RG_ENCOUNTER_GYM_LEADER) \ + X(MUS_RG_ENCOUNTER_DEOXYS) \ + X(MUS_RG_TRAINER_TOWER) \ + X(MUS_RG_SLOW_PALLET) \ + X(MUS_RG_TEACHY_TV_MENU) \ + X(PH_TRAP_BLEND) \ + X(PH_TRAP_HELD) \ + X(PH_TRAP_SOLO) \ + X(PH_FACE_BLEND) \ + X(PH_FACE_HELD) \ + X(PH_FACE_SOLO) \ + X(PH_CLOTH_BLEND) \ + X(PH_CLOTH_HELD) \ + X(PH_CLOTH_SOLO) \ + X(PH_DRESS_BLEND) \ + X(PH_DRESS_HELD) \ + X(PH_DRESS_SOLO) \ + X(PH_FLEECE_BLEND) \ + X(PH_FLEECE_HELD) \ + X(PH_FLEECE_SOLO) \ + X(PH_KIT_BLEND) \ + X(PH_KIT_HELD) \ + X(PH_KIT_SOLO) \ + X(PH_PRICE_BLEND) \ + X(PH_PRICE_HELD) \ + X(PH_PRICE_SOLO) \ + X(PH_LOT_BLEND) \ + X(PH_LOT_HELD) \ + X(PH_LOT_SOLO) \ + X(PH_GOAT_BLEND) \ + X(PH_GOAT_HELD) \ + X(PH_GOAT_SOLO) \ + X(PH_THOUGHT_BLEND) \ + X(PH_THOUGHT_HELD) \ + X(PH_THOUGHT_SOLO) \ + X(PH_CHOICE_BLEND) \ + X(PH_CHOICE_HELD) \ + X(PH_CHOICE_SOLO) \ + X(PH_MOUTH_BLEND) \ + X(PH_MOUTH_HELD) \ + X(PH_MOUTH_SOLO) \ + X(PH_FOOT_BLEND) \ + X(PH_FOOT_HELD) \ + X(PH_FOOT_SOLO) \ + X(PH_GOOSE_BLEND) \ + X(PH_GOOSE_HELD) \ + X(PH_GOOSE_SOLO) \ + X(PH_STRUT_BLEND) \ + X(PH_STRUT_HELD) \ + X(PH_STRUT_SOLO) \ + X(PH_CURE_BLEND) \ + X(PH_CURE_HELD) \ + X(PH_CURE_SOLO) \ + X(PH_NURSE_BLEND) \ + X(PH_NURSE_HELD) \ + X(PH_NURSE_SOLO) \ #define SOUND_LIST_SE \ - X(SE_USE_ITEM, "SE-USE-ITEM") \ - X(SE_PC_LOGIN, "SE-PC-LOGIN") \ - X(SE_PC_OFF, "SE-PC-OFF") \ - X(SE_PC_ON, "SE-PC-ON") \ - X(SE_SELECT, "SE-SELECT") \ - X(SE_WIN_OPEN, "SE-WIN-OPEN") \ - X(SE_WALL_HIT, "SE-WALL-HIT") \ - X(SE_DOOR, "SE-DOOR") \ - X(SE_EXIT, "SE-EXIT") \ - X(SE_LEDGE, "SE-LEDGE") \ - X(SE_BIKE_BELL, "SE-BIKE-BELL") \ - X(SE_NOT_EFFECTIVE, "SE-NOT-EFFECTIVE") \ - X(SE_EFFECTIVE, "SE-EFFECTIVE") \ - X(SE_SUPER_EFFECTIVE, "SE-SUPER-EFFECTIVE") \ - X(SE_BALL_OPEN, "SE-BALL-OPEN") \ - X(SE_FAINT, "SE-FAINT") \ - X(SE_FLEE, "SE-FLEE") \ - X(SE_SLIDING_DOOR, "SE-SLIDING-DOOR") \ - X(SE_SHIP, "SE-SHIP") \ - X(SE_BANG, "SE-BANG") \ - X(SE_PIN, "SE-PIN") \ - X(SE_BOO, "SE-BOO") \ - X(SE_BALL, "SE-BALL") \ - X(SE_CONTEST_PLACE, "SE-CONTEST-PLACE") \ - X(SE_A, "SE-A") \ - X(SE_I, "SE-I") \ - X(SE_U, "SE-U") \ - X(SE_E, "SE-E") \ - X(SE_O, "SE-O") \ - X(SE_N, "SE-N") \ - X(SE_SUCCESS, "SE-SUCCESS") \ - X(SE_FAILURE, "SE-FAILURE") \ - X(SE_EXP, "SE-EXP") \ - X(SE_BIKE_HOP, "SE-BIKE-HOP") \ - X(SE_SWITCH, "SE-SWITCH") \ - X(SE_CLICK, "SE-CLICK") \ - X(SE_FU_ZAKU, "SE-FU-ZAKU") \ - X(SE_CONTEST_CONDITION_LOSE, "SE-CONTEST-CONDITION-LOSE") \ - X(SE_LAVARIDGE_FALL_WARP, "SE-LAVARIDGE-FALL-WARP") \ - X(SE_ICE_STAIRS, "SE-ICE-STAIRS") \ - X(SE_ICE_BREAK, "SE-ICE-BREAK") \ - X(SE_ICE_CRACK, "SE-ICE-CRACK") \ - X(SE_FALL, "SE-FALL") \ - X(SE_UNLOCK, "SE-UNLOCK") \ - X(SE_WARP_IN, "SE-WARP-IN") \ - X(SE_WARP_OUT, "SE-WARP-OUT") \ - X(SE_REPEL, "SE-REPEL") \ - X(SE_ROTATING_GATE, "SE-ROTATING-GATE") \ - X(SE_TRUCK_MOVE, "SE-TRUCK-MOVE") \ - X(SE_TRUCK_STOP, "SE-TRUCK-STOP") \ - X(SE_TRUCK_UNLOAD, "SE-TRUCK-UNLOAD") \ - X(SE_TRUCK_DOOR, "SE-TRUCK-DOOR") \ - X(SE_BERRY_BLENDER, "SE-BERRY-BLENDER") \ - X(SE_CARD, "SE-CARD") \ - X(SE_SAVE, "SE-SAVE") \ - X(SE_BALL_BOUNCE_1, "SE-BALL-BOUNCE-1") \ - X(SE_BALL_BOUNCE_2, "SE-BALL-BOUNCE-2") \ - X(SE_BALL_BOUNCE_3, "SE-BALL-BOUNCE-3") \ - X(SE_BALL_BOUNCE_4, "SE-BALL-BOUNCE-4") \ - X(SE_BALL_TRADE, "SE-BALL-TRADE") \ - X(SE_BALL_THROW, "SE-BALL-THROW") \ - X(SE_NOTE_C, "SE-NOTE-C") \ - X(SE_NOTE_D, "SE-NOTE-D") \ - X(SE_NOTE_E, "SE-NOTE-E") \ - X(SE_NOTE_F, "SE-NOTE-F") \ - X(SE_NOTE_G, "SE-NOTE-G") \ - X(SE_NOTE_A, "SE-NOTE-A") \ - X(SE_NOTE_B, "SE-NOTE-B") \ - X(SE_NOTE_C_HIGH, "SE-NOTE-C-HIGH") \ - X(SE_PUDDLE, "SE-PUDDLE") \ - X(SE_BRIDGE_WALK, "SE-BRIDGE-WALK") \ - X(SE_ITEMFINDER, "SE-ITEMFINDER") \ - X(SE_DING_DONG, "SE-DING-DONG") \ - X(SE_BALLOON_RED, "SE-BALLOON-RED") \ - X(SE_BALLOON_BLUE, "SE-BALLOON-BLUE") \ - X(SE_BALLOON_YELLOW, "SE-BALLOON-YELLOW") \ - X(SE_BREAKABLE_DOOR, "SE-BREAKABLE-DOOR") \ - X(SE_MUD_BALL, "SE-MUD-BALL") \ - X(SE_FIELD_POISON, "SE-FIELD-POISON") \ - X(SE_ESCALATOR, "SE-ESCALATOR") \ - X(SE_THUNDERSTORM, "SE-THUNDERSTORM") \ - X(SE_THUNDERSTORM_STOP, "SE-THUNDERSTORM-STOP") \ - X(SE_DOWNPOUR, "SE-DOWNPOUR") \ - X(SE_DOWNPOUR_STOP, "SE-DOWNPOUR-STOP") \ - X(SE_RAIN, "SE-RAIN") \ - X(SE_RAIN_STOP, "SE-RAIN-STOP") \ - X(SE_THUNDER, "SE-THUNDER") \ - X(SE_THUNDER2, "SE-THUNDER2") \ - X(SE_ELEVATOR, "SE-ELEVATOR") \ - X(SE_LOW_HEALTH, "SE-LOW-HEALTH") \ - X(SE_EXP_MAX, "SE-EXP-MAX") \ - X(SE_ROULETTE_BALL, "SE-ROULETTE-BALL") \ - X(SE_ROULETTE_BALL2, "SE-ROULETTE-BALL2") \ - X(SE_TAILLOW_WING_FLAP, "SE-TAILLOW-WING-FLAP") \ - X(SE_SHOP, "SE-SHOP") \ - X(SE_CONTEST_HEART, "SE-CONTEST-HEART") \ - X(SE_CONTEST_CURTAIN_RISE, "SE-CONTEST-CURTAIN-RISE") \ - X(SE_CONTEST_CURTAIN_FALL, "SE-CONTEST-CURTAIN-FALL") \ - X(SE_CONTEST_ICON_CHANGE, "SE-CONTEST-ICON-CHANGE") \ - X(SE_CONTEST_ICON_CLEAR, "SE-CONTEST-ICON-CLEAR") \ - X(SE_CONTEST_MONS_TURN, "SE-CONTEST-MONS-TURN") \ - X(SE_SHINY, "SE-SHINY") \ - X(SE_INTRO_BLAST, "SE-INTRO-BLAST") \ - X(SE_MUGSHOT, "SE-MUGSHOT") \ - X(SE_APPLAUSE, "SE-APPLAUSE") \ - X(SE_VEND, "SE-VEND") \ - X(SE_ORB, "SE-ORB") \ - X(SE_DEX_SCROLL, "SE-DEX-SCROLL") \ - X(SE_DEX_PAGE, "SE-DEX-PAGE") \ - X(SE_POKENAV_ON, "SE-POKENAV-ON") \ - X(SE_POKENAV_OFF, "SE-POKENAV-OFF") \ - X(SE_DEX_SEARCH, "SE-DEX-SEARCH") \ - X(SE_EGG_HATCH, "SE-EGG-HATCH") \ - X(SE_BALL_TRAY_ENTER, "SE-BALL-TRAY-ENTER") \ - X(SE_BALL_TRAY_BALL, "SE-BALL-TRAY-BALL") \ - X(SE_BALL_TRAY_EXIT, "SE-BALL-TRAY-EXIT") \ - X(SE_GLASS_FLUTE, "SE-GLASS-FLUTE") \ - X(SE_M_THUNDERBOLT, "SE-M-THUNDERBOLT") \ - X(SE_M_THUNDERBOLT2, "SE-M-THUNDERBOLT2") \ - X(SE_M_HARDEN, "SE-M-HARDEN") \ - X(SE_M_NIGHTMARE, "SE-M-NIGHTMARE") \ - X(SE_M_VITAL_THROW, "SE-M-VITAL-THROW") \ - X(SE_M_VITAL_THROW2, "SE-M-VITAL-THROW2") \ - X(SE_M_BUBBLE, "SE-M-BUBBLE") \ - X(SE_M_BUBBLE2, "SE-M-BUBBLE2") \ - X(SE_M_BUBBLE3, "SE-M-BUBBLE3") \ - X(SE_M_RAIN_DANCE, "SE-M-RAIN-DANCE") \ - X(SE_M_CUT, "SE-M-CUT") \ - X(SE_M_STRING_SHOT, "SE-M-STRING-SHOT") \ - X(SE_M_STRING_SHOT2, "SE-M-STRING-SHOT2") \ - X(SE_M_ROCK_THROW, "SE-M-ROCK-THROW") \ - X(SE_M_GUST, "SE-M-GUST") \ - X(SE_M_GUST2, "SE-M-GUST2") \ - X(SE_M_DOUBLE_SLAP, "SE-M-DOUBLE-SLAP") \ - X(SE_M_DOUBLE_TEAM, "SE-M-DOUBLE-TEAM") \ - X(SE_M_RAZOR_WIND, "SE-M-RAZOR-WIND") \ - X(SE_M_ICY_WIND, "SE-M-ICY-WIND") \ - X(SE_M_THUNDER_WAVE, "SE-M-THUNDER-WAVE") \ - X(SE_M_COMET_PUNCH, "SE-M-COMET-PUNCH") \ - X(SE_M_MEGA_KICK, "SE-M-MEGA-KICK") \ - X(SE_M_MEGA_KICK2, "SE-M-MEGA-KICK2") \ - X(SE_M_CRABHAMMER, "SE-M-CRABHAMMER") \ - X(SE_M_JUMP_KICK, "SE-M-JUMP-KICK") \ - X(SE_M_FLAME_WHEEL, "SE-M-FLAME-WHEEL") \ - X(SE_M_FLAME_WHEEL2, "SE-M-FLAME-WHEEL2") \ - X(SE_M_FLAMETHROWER, "SE-M-FLAMETHROWER") \ - X(SE_M_FIRE_PUNCH, "SE-M-FIRE-PUNCH") \ - X(SE_M_TOXIC, "SE-M-TOXIC") \ - X(SE_M_SACRED_FIRE, "SE-M-SACRED-FIRE") \ - X(SE_M_SACRED_FIRE2, "SE-M-SACRED-FIRE2") \ - X(SE_M_EMBER, "SE-M-EMBER") \ - X(SE_M_TAKE_DOWN, "SE-M-TAKE-DOWN") \ - X(SE_M_BLIZZARD, "SE-M-BLIZZARD") \ - X(SE_M_BLIZZARD2, "SE-M-BLIZZARD2") \ - X(SE_M_SCRATCH, "SE-M-SCRATCH") \ - X(SE_M_VICEGRIP, "SE-M-VICEGRIP") \ - X(SE_M_WING_ATTACK, "SE-M-WING-ATTACK") \ - X(SE_M_FLY, "SE-M-FLY") \ - X(SE_M_SAND_ATTACK, "SE-M-SAND-ATTACK") \ - X(SE_M_RAZOR_WIND2, "SE-M-RAZOR-WIND2") \ - X(SE_M_BITE, "SE-M-BITE") \ - X(SE_M_HEADBUTT, "SE-M-HEADBUTT") \ - X(SE_M_SURF, "SE-M-SURF") \ - X(SE_M_HYDRO_PUMP, "SE-M-HYDRO-PUMP") \ - X(SE_M_WHIRLPOOL, "SE-M-WHIRLPOOL") \ - X(SE_M_HORN_ATTACK, "SE-M-HORN-ATTACK") \ - X(SE_M_TAIL_WHIP, "SE-M-TAIL-WHIP") \ - X(SE_M_MIST, "SE-M-MIST") \ - X(SE_M_POISON_POWDER, "SE-M-POISON-POWDER") \ - X(SE_M_BIND, "SE-M-BIND") \ - X(SE_M_DRAGON_RAGE, "SE-M-DRAGON-RAGE") \ - X(SE_M_SING, "SE-M-SING") \ - X(SE_M_PERISH_SONG, "SE-M-PERISH-SONG") \ - X(SE_M_PAY_DAY, "SE-M-PAY-DAY") \ - X(SE_M_DIG, "SE-M-DIG") \ - X(SE_M_DIZZY_PUNCH, "SE-M-DIZZY-PUNCH") \ - X(SE_M_SELF_DESTRUCT, "SE-M-SELF-DESTRUCT") \ - X(SE_M_EXPLOSION, "SE-M-EXPLOSION") \ - X(SE_M_ABSORB_2, "SE-M-ABSORB-2") \ - X(SE_M_ABSORB, "SE-M-ABSORB") \ - X(SE_M_SCREECH, "SE-M-SCREECH") \ - X(SE_M_BUBBLE_BEAM, "SE-M-BUBBLE-BEAM") \ - X(SE_M_BUBBLE_BEAM2, "SE-M-BUBBLE-BEAM2") \ - X(SE_M_SUPERSONIC, "SE-M-SUPERSONIC") \ - X(SE_M_BELLY_DRUM, "SE-M-BELLY-DRUM") \ - X(SE_M_METRONOME, "SE-M-METRONOME") \ - X(SE_M_BONEMERANG, "SE-M-BONEMERANG") \ - X(SE_M_LICK, "SE-M-LICK") \ - X(SE_M_PSYBEAM, "SE-M-PSYBEAM") \ - X(SE_M_FAINT_ATTACK, "SE-M-FAINT-ATTACK") \ - X(SE_M_SWORDS_DANCE, "SE-M-SWORDS-DANCE") \ - X(SE_M_LEER, "SE-M-LEER") \ - X(SE_M_SWAGGER, "SE-M-SWAGGER") \ - X(SE_M_SWAGGER2, "SE-M-SWAGGER2") \ - X(SE_M_HEAL_BELL, "SE-M-HEAL-BELL") \ - X(SE_M_CONFUSE_RAY, "SE-M-CONFUSE-RAY") \ - X(SE_M_SNORE, "SE-M-SNORE") \ - X(SE_M_BRICK_BREAK, "SE-M-BRICK-BREAK") \ - X(SE_M_GIGA_DRAIN, "SE-M-GIGA-DRAIN") \ - X(SE_M_PSYBEAM2, "SE-M-PSYBEAM2") \ - X(SE_M_SOLAR_BEAM, "SE-M-SOLAR-BEAM") \ - X(SE_M_PETAL_DANCE, "SE-M-PETAL-DANCE") \ - X(SE_M_TELEPORT, "SE-M-TELEPORT") \ - X(SE_M_MINIMIZE, "SE-M-MINIMIZE") \ - X(SE_M_SKETCH, "SE-M-SKETCH") \ - X(SE_M_SWIFT, "SE-M-SWIFT") \ - X(SE_M_REFLECT, "SE-M-REFLECT") \ - X(SE_M_BARRIER, "SE-M-BARRIER") \ - X(SE_M_DETECT, "SE-M-DETECT") \ - X(SE_M_LOCK_ON, "SE-M-LOCK-ON") \ - X(SE_M_MOONLIGHT, "SE-M-MOONLIGHT") \ - X(SE_M_CHARM, "SE-M-CHARM") \ - X(SE_M_CHARGE, "SE-M-CHARGE") \ - X(SE_M_STRENGTH, "SE-M-STRENGTH") \ - X(SE_M_HYPER_BEAM, "SE-M-HYPER-BEAM") \ - X(SE_M_WATERFALL, "SE-M-WATERFALL") \ - X(SE_M_REVERSAL, "SE-M-REVERSAL") \ - X(SE_M_ACID_ARMOR, "SE-M-ACID-ARMOR") \ - X(SE_M_SANDSTORM, "SE-M-SANDSTORM") \ - X(SE_M_TRI_ATTACK, "SE-M-TRI-ATTACK") \ - X(SE_M_TRI_ATTACK2, "SE-M-TRI-ATTACK2") \ - X(SE_M_ENCORE, "SE-M-ENCORE") \ - X(SE_M_ENCORE2, "SE-M-ENCORE2") \ - X(SE_M_BATON_PASS, "SE-M-BATON-PASS") \ - X(SE_M_MILK_DRINK, "SE-M-MILK-DRINK") \ - X(SE_M_ATTRACT, "SE-M-ATTRACT") \ - X(SE_M_ATTRACT2, "SE-M-ATTRACT2") \ - X(SE_M_MORNING_SUN, "SE-M-MORNING-SUN") \ - X(SE_M_FLATTER, "SE-M-FLATTER") \ - X(SE_M_SAND_TOMB, "SE-M-SAND-TOMB") \ - X(SE_M_GRASSWHISTLE, "SE-M-GRASSWHISTLE") \ - X(SE_M_SPIT_UP, "SE-M-SPIT-UP") \ - X(SE_M_DIVE, "SE-M-DIVE") \ - X(SE_M_EARTHQUAKE, "SE-M-EARTHQUAKE") \ - X(SE_M_TWISTER, "SE-M-TWISTER") \ - X(SE_M_SWEET_SCENT, "SE-M-SWEET-SCENT") \ - X(SE_M_YAWN, "SE-M-YAWN") \ - X(SE_M_SKY_UPPERCUT, "SE-M-SKY-UPPERCUT") \ - X(SE_M_STAT_INCREASE, "SE-M-STAT-INCREASE") \ - X(SE_M_HEAT_WAVE, "SE-M-HEAT-WAVE") \ - X(SE_M_UPROAR, "SE-M-UPROAR") \ - X(SE_M_HAIL, "SE-M-HAIL") \ - X(SE_M_COSMIC_POWER, "SE-M-COSMIC-POWER") \ - X(SE_M_TEETER_DANCE, "SE-M-TEETER-DANCE") \ - X(SE_M_STAT_DECREASE, "SE-M-STAT-DECREASE") \ - X(SE_M_HAZE, "SE-M-HAZE") \ - X(SE_M_HYPER_BEAM2, "SE-M-HYPER-BEAM2") \ - X(SE_RG_DOOR, "SE-RG-DOOR") \ - X(SE_RG_CARD_FLIP, "SE-RG-CARD-FLIP") \ - X(SE_RG_CARD_FLIPPING, "SE-RG-CARD-FLIPPING") \ - X(SE_RG_CARD_OPEN, "SE-RG-CARD-OPEN") \ - X(SE_RG_BAG_CURSOR, "SE-RG-BAG-CURSOR") \ - X(SE_RG_BAG_POCKET, "SE-RG-BAG-POCKET") \ - X(SE_RG_BALL_CLICK, "SE-RG-BALL-CLICK") \ - X(SE_RG_SHOP, "SE-RG-SHOP") \ - X(SE_RG_SS_ANNE_HORN, "SE-RG-SS-ANNE-HORN") \ - X(SE_RG_HELP_OPEN, "SE-RG-HELP-OPEN") \ - X(SE_RG_HELP_CLOSE, "SE-RG-HELP-CLOSE") \ - X(SE_RG_HELP_ERROR, "SE-RG-HELP-ERROR") \ - X(SE_RG_DEOXYS_MOVE, "SE-RG-DEOXYS-MOVE") \ - X(SE_RG_POKE_JUMP_SUCCESS, "SE-RG-POKE-JUMP-SUCCESS") \ - X(SE_RG_POKE_JUMP_FAILURE, "SE-RG-POKE-JUMP-FAILURE") \ - X(SE_PHONE_CALL, "SE-PHONE-CALL") \ - X(SE_PHONE_CLICK, "SE-PHONE-CLICK") \ - X(SE_ARENA_TIMEUP1, "SE-ARENA-TIMEUP1") \ - X(SE_ARENA_TIMEUP2, "SE-ARENA-TIMEUP2") \ - X(SE_PIKE_CURTAIN_CLOSE, "SE-PIKE-CURTAIN-CLOSE") \ - X(SE_PIKE_CURTAIN_OPEN, "SE-PIKE-CURTAIN-OPEN") \ - X(SE_SUDOWOODO_SHAKE, "SE-SUDOWOODO-SHAKE") \ + X(SE_USE_ITEM) \ + X(SE_PC_LOGIN) \ + X(SE_PC_OFF) \ + X(SE_PC_ON) \ + X(SE_SELECT) \ + X(SE_WIN_OPEN) \ + X(SE_WALL_HIT) \ + X(SE_DOOR) \ + X(SE_EXIT) \ + X(SE_LEDGE) \ + X(SE_BIKE_BELL) \ + X(SE_NOT_EFFECTIVE) \ + X(SE_EFFECTIVE) \ + X(SE_SUPER_EFFECTIVE) \ + X(SE_BALL_OPEN) \ + X(SE_FAINT) \ + X(SE_FLEE) \ + X(SE_SLIDING_DOOR) \ + X(SE_SHIP) \ + X(SE_BANG) \ + X(SE_PIN) \ + X(SE_BOO) \ + X(SE_BALL) \ + X(SE_CONTEST_PLACE) \ + X(SE_A) \ + X(SE_I) \ + X(SE_U) \ + X(SE_E) \ + X(SE_O) \ + X(SE_N) \ + X(SE_SUCCESS) \ + X(SE_FAILURE) \ + X(SE_EXP) \ + X(SE_BIKE_HOP) \ + X(SE_SWITCH) \ + X(SE_CLICK) \ + X(SE_FU_ZAKU) \ + X(SE_CONTEST_CONDITION_LOSE) \ + X(SE_LAVARIDGE_FALL_WARP) \ + X(SE_ICE_STAIRS) \ + X(SE_ICE_BREAK) \ + X(SE_ICE_CRACK) \ + X(SE_FALL) \ + X(SE_UNLOCK) \ + X(SE_WARP_IN) \ + X(SE_WARP_OUT) \ + X(SE_REPEL) \ + X(SE_ROTATING_GATE) \ + X(SE_TRUCK_MOVE) \ + X(SE_TRUCK_STOP) \ + X(SE_TRUCK_UNLOAD) \ + X(SE_TRUCK_DOOR) \ + X(SE_BERRY_BLENDER) \ + X(SE_CARD) \ + X(SE_SAVE) \ + X(SE_BALL_BOUNCE_1) \ + X(SE_BALL_BOUNCE_2) \ + X(SE_BALL_BOUNCE_3) \ + X(SE_BALL_BOUNCE_4) \ + X(SE_BALL_TRADE) \ + X(SE_BALL_THROW) \ + X(SE_NOTE_C) \ + X(SE_NOTE_D) \ + X(SE_NOTE_E) \ + X(SE_NOTE_F) \ + X(SE_NOTE_G) \ + X(SE_NOTE_A) \ + X(SE_NOTE_B) \ + X(SE_NOTE_C_HIGH) \ + X(SE_PUDDLE) \ + X(SE_BRIDGE_WALK) \ + X(SE_ITEMFINDER) \ + X(SE_DING_DONG) \ + X(SE_BALLOON_RED) \ + X(SE_BALLOON_BLUE) \ + X(SE_BALLOON_YELLOW) \ + X(SE_BREAKABLE_DOOR) \ + X(SE_MUD_BALL) \ + X(SE_FIELD_POISON) \ + X(SE_ESCALATOR) \ + X(SE_THUNDERSTORM) \ + X(SE_THUNDERSTORM_STOP) \ + X(SE_DOWNPOUR) \ + X(SE_DOWNPOUR_STOP) \ + X(SE_RAIN) \ + X(SE_RAIN_STOP) \ + X(SE_THUNDER) \ + X(SE_THUNDER2) \ + X(SE_ELEVATOR) \ + X(SE_LOW_HEALTH) \ + X(SE_EXP_MAX) \ + X(SE_ROULETTE_BALL) \ + X(SE_ROULETTE_BALL2) \ + X(SE_TAILLOW_WING_FLAP) \ + X(SE_SHOP) \ + X(SE_CONTEST_HEART) \ + X(SE_CONTEST_CURTAIN_RISE) \ + X(SE_CONTEST_CURTAIN_FALL) \ + X(SE_CONTEST_ICON_CHANGE) \ + X(SE_CONTEST_ICON_CLEAR) \ + X(SE_CONTEST_MONS_TURN) \ + X(SE_SHINY) \ + X(SE_INTRO_BLAST) \ + X(SE_MUGSHOT) \ + X(SE_APPLAUSE) \ + X(SE_VEND) \ + X(SE_ORB) \ + X(SE_DEX_SCROLL) \ + X(SE_DEX_PAGE) \ + X(SE_POKENAV_ON) \ + X(SE_POKENAV_OFF) \ + X(SE_DEX_SEARCH) \ + X(SE_EGG_HATCH) \ + X(SE_BALL_TRAY_ENTER) \ + X(SE_BALL_TRAY_BALL) \ + X(SE_BALL_TRAY_EXIT) \ + X(SE_GLASS_FLUTE) \ + X(SE_M_THUNDERBOLT) \ + X(SE_M_THUNDERBOLT2) \ + X(SE_M_HARDEN) \ + X(SE_M_NIGHTMARE) \ + X(SE_M_VITAL_THROW) \ + X(SE_M_VITAL_THROW2) \ + X(SE_M_BUBBLE) \ + X(SE_M_BUBBLE2) \ + X(SE_M_BUBBLE3) \ + X(SE_M_RAIN_DANCE) \ + X(SE_M_CUT) \ + X(SE_M_STRING_SHOT) \ + X(SE_M_STRING_SHOT2) \ + X(SE_M_ROCK_THROW) \ + X(SE_M_GUST) \ + X(SE_M_GUST2) \ + X(SE_M_DOUBLE_SLAP) \ + X(SE_M_DOUBLE_TEAM) \ + X(SE_M_RAZOR_WIND) \ + X(SE_M_ICY_WIND) \ + X(SE_M_THUNDER_WAVE) \ + X(SE_M_COMET_PUNCH) \ + X(SE_M_MEGA_KICK) \ + X(SE_M_MEGA_KICK2) \ + X(SE_M_CRABHAMMER) \ + X(SE_M_JUMP_KICK) \ + X(SE_M_FLAME_WHEEL) \ + X(SE_M_FLAME_WHEEL2) \ + X(SE_M_FLAMETHROWER) \ + X(SE_M_FIRE_PUNCH) \ + X(SE_M_TOXIC) \ + X(SE_M_SACRED_FIRE) \ + X(SE_M_SACRED_FIRE2) \ + X(SE_M_EMBER) \ + X(SE_M_TAKE_DOWN) \ + X(SE_M_BLIZZARD) \ + X(SE_M_BLIZZARD2) \ + X(SE_M_SCRATCH) \ + X(SE_M_VICEGRIP) \ + X(SE_M_WING_ATTACK) \ + X(SE_M_FLY) \ + X(SE_M_SAND_ATTACK) \ + X(SE_M_RAZOR_WIND2) \ + X(SE_M_BITE) \ + X(SE_M_HEADBUTT) \ + X(SE_M_SURF) \ + X(SE_M_HYDRO_PUMP) \ + X(SE_M_WHIRLPOOL) \ + X(SE_M_HORN_ATTACK) \ + X(SE_M_TAIL_WHIP) \ + X(SE_M_MIST) \ + X(SE_M_POISON_POWDER) \ + X(SE_M_BIND) \ + X(SE_M_DRAGON_RAGE) \ + X(SE_M_SING) \ + X(SE_M_PERISH_SONG) \ + X(SE_M_PAY_DAY) \ + X(SE_M_DIG) \ + X(SE_M_DIZZY_PUNCH) \ + X(SE_M_SELF_DESTRUCT) \ + X(SE_M_EXPLOSION) \ + X(SE_M_ABSORB_2) \ + X(SE_M_ABSORB) \ + X(SE_M_SCREECH) \ + X(SE_M_BUBBLE_BEAM) \ + X(SE_M_BUBBLE_BEAM2) \ + X(SE_M_SUPERSONIC) \ + X(SE_M_BELLY_DRUM) \ + X(SE_M_METRONOME) \ + X(SE_M_BONEMERANG) \ + X(SE_M_LICK) \ + X(SE_M_PSYBEAM) \ + X(SE_M_FAINT_ATTACK) \ + X(SE_M_SWORDS_DANCE) \ + X(SE_M_LEER) \ + X(SE_M_SWAGGER) \ + X(SE_M_SWAGGER2) \ + X(SE_M_HEAL_BELL) \ + X(SE_M_CONFUSE_RAY) \ + X(SE_M_SNORE) \ + X(SE_M_BRICK_BREAK) \ + X(SE_M_GIGA_DRAIN) \ + X(SE_M_PSYBEAM2) \ + X(SE_M_SOLAR_BEAM) \ + X(SE_M_PETAL_DANCE) \ + X(SE_M_TELEPORT) \ + X(SE_M_MINIMIZE) \ + X(SE_M_SKETCH) \ + X(SE_M_SWIFT) \ + X(SE_M_REFLECT) \ + X(SE_M_BARRIER) \ + X(SE_M_DETECT) \ + X(SE_M_LOCK_ON) \ + X(SE_M_MOONLIGHT) \ + X(SE_M_CHARM) \ + X(SE_M_CHARGE) \ + X(SE_M_STRENGTH) \ + X(SE_M_HYPER_BEAM) \ + X(SE_M_WATERFALL) \ + X(SE_M_REVERSAL) \ + X(SE_M_ACID_ARMOR) \ + X(SE_M_SANDSTORM) \ + X(SE_M_TRI_ATTACK) \ + X(SE_M_TRI_ATTACK2) \ + X(SE_M_ENCORE) \ + X(SE_M_ENCORE2) \ + X(SE_M_BATON_PASS) \ + X(SE_M_MILK_DRINK) \ + X(SE_M_ATTRACT) \ + X(SE_M_ATTRACT2) \ + X(SE_M_MORNING_SUN) \ + X(SE_M_FLATTER) \ + X(SE_M_SAND_TOMB) \ + X(SE_M_GRASSWHISTLE) \ + X(SE_M_SPIT_UP) \ + X(SE_M_DIVE) \ + X(SE_M_EARTHQUAKE) \ + X(SE_M_TWISTER) \ + X(SE_M_SWEET_SCENT) \ + X(SE_M_YAWN) \ + X(SE_M_SKY_UPPERCUT) \ + X(SE_M_STAT_INCREASE) \ + X(SE_M_HEAT_WAVE) \ + X(SE_M_UPROAR) \ + X(SE_M_HAIL) \ + X(SE_M_COSMIC_POWER) \ + X(SE_M_TEETER_DANCE) \ + X(SE_M_STAT_DECREASE) \ + X(SE_M_HAZE) \ + X(SE_M_HYPER_BEAM2) \ + X(SE_RG_DOOR) \ + X(SE_RG_CARD_FLIP) \ + X(SE_RG_CARD_FLIPPING) \ + X(SE_RG_CARD_OPEN) \ + X(SE_RG_BAG_CURSOR) \ + X(SE_RG_BAG_POCKET) \ + X(SE_RG_BALL_CLICK) \ + X(SE_RG_SHOP) \ + X(SE_RG_SS_ANNE_HORN) \ + X(SE_RG_HELP_OPEN) \ + X(SE_RG_HELP_CLOSE) \ + X(SE_RG_HELP_ERROR) \ + X(SE_RG_DEOXYS_MOVE) \ + X(SE_RG_POKE_JUMP_SUCCESS) \ + X(SE_RG_POKE_JUMP_FAILURE) \ + X(SE_PHONE_CALL) \ + X(SE_PHONE_CLICK) \ + X(SE_ARENA_TIMEUP1) \ + X(SE_ARENA_TIMEUP2) \ + X(SE_PIKE_CURTAIN_CLOSE) \ + X(SE_PIKE_CURTAIN_OPEN) \ + X(SE_SUDOWOODO_SHAKE) \ // Create BGM list -#define X(songId, name) static const u8 sBGMName_##songId[] = _(name); +#define X(songId) static const u8 sBGMName_##songId[] = _(#songId); SOUND_LIST_BGM #undef X -#define X(songId, name) sBGMName_##songId, +#define X(songId) sBGMName_##songId, static const u8 *const gBGMNames[] = { SOUND_LIST_BGM @@ -3384,15 +3384,15 @@ SOUND_LIST_BGM #undef X // Create SE list -#define X(songId, name) static const u8 sSEName_##songId[] = _(name); +#define X(songId) static const u8 sSEName_##songId[] = _(#songId); SOUND_LIST_SE #undef X -#define X(songId, name) sSEName_##songId, +#define X(songId) sSEName_##songId, static const u8 *const gSENames[] = { SOUND_LIST_SE }; #undef X -#endif +#endif //DEBUG_SYSTEM_ENABLE == TRUE From a462db5e69a47763ac40798a04b132c28c5be89a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 9 Sep 2022 23:34:05 -0400 Subject: [PATCH 121/155] Automated creation of MAP_GROUP_COUNT for the debug menu --- src/data/map_group_count.h | 1 + src/debug.c | 5 +---- tools/mapjson/mapjson.cpp | 16 +++++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 src/data/map_group_count.h diff --git a/src/data/map_group_count.h b/src/data/map_group_count.h new file mode 100644 index 0000000000..4fe8a21b3b --- /dev/null +++ b/src/data/map_group_count.h @@ -0,0 +1 @@ +static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; diff --git a/src/debug.c b/src/debug.c index 4cc1ac6168..e5a2d851af 100644 --- a/src/debug.c +++ b/src/debug.c @@ -282,10 +282,7 @@ extern u8 Debug_CheatStart[]; extern u8 PlayersHouse_2F_EventScript_SetWallClock[]; extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; - -// ******************************* -//Maps per map group COPY FROM /include/constants/map_groups.h -static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; +#include "data/map_group_count.h" // Text // Main Menu diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index 8de9ff8d01..4694bfaca2 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -386,6 +386,7 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { char dir_separator = file_dir.back(); ostringstream text; + ostringstream mapCountText; text << "#ifndef GUARD_CONSTANTS_MAP_GROUPS_H\n" << "#define GUARD_CONSTANTS_MAP_GROUPS_H\n\n"; @@ -424,15 +425,16 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { } text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n"; - - text << "// static const u8 MAP_GROUP_COUNT[] = {"; //DEBUG - for(int i=0; i Date: Sun, 11 Sep 2022 18:06:05 +0200 Subject: [PATCH 122/155] Fix Lure prices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change reflects the original prices used in Pokémon let's go pikachu/eevee --- src/data/items.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/items.h b/src/data/items.h index 6649fb24b6..b0b53c31f5 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -1560,7 +1560,7 @@ const struct Item gItems[] = { .name = _("Lure"), .itemId = ITEM_LURE, - .price = 350, + .price = 400, .holdEffectParam = 100, .description = sLureDesc, .pocket = POCKET_ITEMS, @@ -1574,7 +1574,7 @@ const struct Item gItems[] = { .name = _("Super Lure"), .itemId = ITEM_SUPER_LURE, - .price = 500, + .price = 700, .holdEffectParam = 200, .description = sSuperLureDesc, .pocket = POCKET_ITEMS, @@ -1588,7 +1588,7 @@ const struct Item gItems[] = { .name = _("Max Lure"), .itemId = ITEM_MAX_LURE, - .price = 700, + .price = 900, .holdEffectParam = 250, .description = sMaxLureDesc, .pocket = POCKET_ITEMS, From 69f01d73cd7da3d99e1dd6388ba3b4487d19ca72 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 11 Sep 2022 12:41:56 -0400 Subject: [PATCH 123/155] Added missing uses of Fairy type for Union Room and Battle Factory --- .../scripts.inc | 9 +++++++++ src/data/union_room.h | 1 + 2 files changed, 10 insertions(+) diff --git a/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc index d54cf83570..3167b17d81 100644 --- a/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc @@ -225,6 +225,7 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_CommentOnOpponentType:: call_if_eq VAR_0x8005, TYPE_ICE, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesIce call_if_eq VAR_0x8005, TYPE_DRAGON, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesDragon call_if_eq VAR_0x8005, TYPE_DARK, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesDark + call_if_eq VAR_0x8005, TYPE_FAIRY, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesFairy call_if_eq VAR_0x8005, NUMBER_OF_MON_TYPES, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentHasNoMostCommonType return @@ -296,6 +297,10 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesDark:: msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerSkilledInDarkType, MSGBOX_DEFAULT return +BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesFairy:: + msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerSkilledInFairyType, MSGBOX_DEFAULT + return + BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentHasNoMostCommonType:: msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerHasNoClearFavorite, MSGBOX_DEFAULT return @@ -559,6 +564,10 @@ BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerSkilledInDarkType: .string "The TRAINER is apparently skilled\n" .string "in the handling of the DARK type.$" +BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerSkilledInFairyType: + .string "The TRAINER is apparently skilled\n" + .string "in the handling of the FAIRY type.$" + BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerSkilledInSteelType: .string "The TRAINER is apparently skilled\n" .string "in the handling of the STEEL type.$" diff --git a/src/data/union_room.h b/src/data/union_room.h index cf4b12b5d5..07f8e48994 100644 --- a/src/data/union_room.h +++ b/src/data/union_room.h @@ -885,6 +885,7 @@ static const struct ListMenuItem sTradingBoardTypes[NUMBER_OF_MON_TYPES] = { { gTypeNames[TYPE_DRAGON], TYPE_DRAGON }, { gTypeNames[TYPE_STEEL], TYPE_STEEL }, { gTypeNames[TYPE_DARK], TYPE_DARK }, + { gTypeNames[TYPE_FAIRY], TYPE_FAIRY }, { sText_Exit, NUMBER_OF_MON_TYPES } }; From 61752a4977eb90826593cec40848efe1212529f0 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 11 Sep 2022 13:35:58 -0400 Subject: [PATCH 124/155] Added parenthesis to GET_SHINY_VALUE --- include/pokemon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pokemon.h b/include/pokemon.h index 63c5c74eb7..e48618328d 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -363,7 +363,7 @@ struct Evolution | (((personality) & 0x00000003) >> 0) \ ) % NUM_UNOWN_FORMS) -#define GET_SHINY_VALUE(otId, personality)HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality) +#define GET_SHINY_VALUE(otId, personality) (HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality)) extern u8 gPlayerPartyCount; extern struct Pokemon gPlayerParty[PARTY_SIZE]; From 65108c319265a7a5f232e0fa6af61d091823ad45 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 11 Sep 2022 14:14:49 -0400 Subject: [PATCH 125/155] Cleaned trailing whitespace --- INSTALL.md | 6 +- Makefile | 4 +- asm/macros/battle_ai_script.inc | 26 ++--- asm/macros/battle_anim_script.inc | 6 +- asm/macros/battle_script.inc | 100 +++++++++--------- asm/macros/event.inc | 10 +- data/battle_ai_scripts.s | 2 +- data/battle_scripts_1.s | 6 +- data/scripts/new_game.inc | 2 +- data/scripts/roulette.inc | 2 +- docs/legacy_WSL1_INSTALL.md | 4 +- gflib/text.c | 4 +- graphics_file_rules.mk | 20 ++-- include/battle.h | 2 +- include/global.h | 2 +- include/link_rfu.h | 6 +- include/pokenav.h | 2 +- include/union_room.h | 4 +- src/battle_anim_mons.c | 4 +- src/battle_script_commands.c | 2 +- src/battle_tent.c | 2 +- src/battle_transition.c | 24 ++--- src/data/field_effects/field_effect_objects.h | 2 +- src/decoration.c | 4 +- src/ereader_screen.c | 6 +- src/event_object_movement.c | 2 +- src/field_tasks.c | 18 ++-- src/link_rfu_2.c | 10 +- src/link_rfu_3.c | 2 +- src/metatile_behavior.c | 2 +- src/mystery_gift.c | 8 +- src/mystery_gift_menu.c | 2 +- src/mystery_gift_view.c | 18 ++-- src/pokedex_area_screen.c | 6 +- src/pokemon.c | 10 +- src/pokemon_summary_screen.c | 4 +- src/pokenav_menu_handler_gfx.c | 2 +- src/record_mixing.c | 4 +- src/roamer.c | 6 +- src/rom_header.s | 2 +- src/save.c | 2 +- src/script.c | 6 +- src/slot_machine.c | 20 ++-- src/sound.c | 2 +- src/trade.c | 2 +- src/tv.c | 8 +- src/union_room_player_avatar.c | 2 +- src/walda_phrase.c | 2 +- src/wild_encounter.c | 4 +- src/wonder_news.c | 2 +- sym_common.txt | 10 +- 51 files changed, 204 insertions(+), 204 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 2759124bee..5f2a1f05f1 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -106,7 +106,7 @@ cd /mnt/c/Users//Desktop/decomps > Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "/mnt/c/users//Desktop/decomp folder"`. > Note 3: Windows path names are case-insensitive so adhering to capitalization isn't needed - + If this works, then proceed to [Installation](#installation). Otherwise, ask for help on Discord or IRC (see [README.md](README.md)), or continue reading below for [Windows instructions using msys2](#windows-msys2). @@ -216,7 +216,7 @@ Note that the directory **must exist** in Windows. If you want to store pokeemer > Note 1: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "c:/users//Desktop/decomp folder"`. > Note 2: Windows path names are case-insensitive so adhering to capitalization isn't needed - + If this works, then proceed to [Installation](#installation). Otherwise, ask for help on Discord or IRC (see [README.md](README.md)). ## macOS @@ -539,7 +539,7 @@ devkitARM is now installed. devkitARM is now installed. ### Installing devkitARM on Arch Linux - + 1. Follow [devkitPro's instructions](https://devkitpro.org/wiki/devkitPro_pacman#Customising_Existing_Pacman_Install) to configure `pacman` to download devkitPro packages. 2. Install `gba-dev`: run the following command as root. diff --git a/Makefile b/Makefile index c36cc8e936..88303e7f39 100644 --- a/Makefile +++ b/Makefile @@ -254,7 +254,7 @@ tidynonmodern: tidymodern: rm -f $(MODERN_ROM_NAME) $(MODERN_ELF_NAME) $(MODERN_MAP_NAME) rm -rf $(MODERN_OBJ_DIR_NAME) - + ifneq ($(MODERN),0) $(C_BUILDDIR)/berry_crush.o: override CFLAGS += -Wno-address-of-packed-member endif @@ -410,7 +410,7 @@ LD_SCRIPT := ld_script.txt LD_SCRIPT_DEPS := $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld else LD_SCRIPT := ld_script_modern.txt -LD_SCRIPT_DEPS := +LD_SCRIPT_DEPS := endif $(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS) diff --git a/asm/macros/battle_ai_script.inc b/asm/macros/battle_ai_script.inc index 5341e5a431..78c8131f66 100644 --- a/asm/macros/battle_ai_script.inc +++ b/asm/macros/battle_ai_script.inc @@ -550,38 +550,38 @@ .2byte \param1 .4byte \param2 .endm - + @ useful script macros .macro get_curr_move_type get_type AI_TYPE_MOVE .endm - + .macro get_user_type1 get_type AI_TYPE1_USER .endm - + .macro get_user_type2 get_type AI_TYPE2_USER .endm - + .macro get_target_type1 get_type AI_TYPE1_TARGET .endm - + .macro get_target_type2 get_type AI_TYPE2_TARGET .endm - + .macro if_ability battler:req, ability:req, ptr:req check_ability \battler, \ability if_equal 1, \ptr .endm - + .macro if_no_ability battler:req, ability:req, ptr:req check_ability \battler, \ability if_equal 0, \ptr .endm - + .macro if_type battler:req, type:req, ptr:req is_of_type \battler, \type if_equal 1, \ptr @@ -591,20 +591,20 @@ is_of_type \battler, \type if_equal 0, \ptr .endm - + .macro if_target_faster ptr:req if_user_goes 1, \ptr .endm - + .macro if_user_faster ptr:req if_user_goes 0, \ptr .endm - + .macro if_double_battle ptr:req is_double_battle if_equal 1, \ptr .endm - + .macro if_not_double_battle ptr:req is_double_battle if_equal 0, \ptr @@ -613,7 +613,7 @@ .macro if_any_move_disabled battler:req, ptr:req if_any_move_disabled_or_encored \battler, 0, \ptr .endm - + .macro if_any_move_encored battler:req, ptr:req if_any_move_disabled_or_encored \battler, 1, \ptr .endm diff --git a/asm/macros/battle_anim_script.inc b/asm/macros/battle_anim_script.inc index 15c48c39f5..67632e9885 100644 --- a/asm/macros/battle_anim_script.inc +++ b/asm/macros/battle_anim_script.inc @@ -270,16 +270,16 @@ .macro stopsound .byte 0x2f .endm - + @ useful macros .macro jumpreteq value:req, ptr:req jumpargeq ARG_RET_ID, \value, \ptr .endm - + .macro jumprettrue ptr:req jumpreteq TRUE, \ptr .endm - + .macro jumpretfalse ptr:req jumpreteq FALSE, \ptr .endm diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 0a44f6075a..ccb887327f 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -410,33 +410,33 @@ .byte \endMode .byte \endState .endm - + @ Help macros for 5 uses of moveend command - + @ All cases .macro moveendall setbyte sMOVEEND_STATE, 0 moveend 0, 0 .endm - + @ Chosen case .macro moveendcase case:req setbyte sMOVEEND_STATE, \case moveend 1, 0 .endm - + @ All cases from (inclusive) .macro moveendfrom from:req setbyte sMOVEEND_STATE, \from moveend 0, 0 .endm - + @ All cases from 0 to (not inclusive) .macro moveendto to:req setbyte sMOVEEND_STATE, 0 moveend 2, \to .endm - + @ Cases from (inclusive) to (not inclusive) .macro moveendfromto from:req, to:req setbyte sMOVEEND_STATE, \from @@ -1252,165 +1252,165 @@ .byte 0xf8 .byte \position .endm - + @ various command changed to more readable macros .macro cancelmultiturnmoves battler:req various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES .endm - + .macro setmagiccoattarget battler:req various \battler, VARIOUS_SET_MAGIC_COAT_TARGET .endm - + .macro getifcantrunfrombattle battler:req various \battler, VARIOUS_IS_RUNNING_IMPOSSIBLE .endm - + .macro getmovetarget battler:req various \battler, VARIOUS_GET_MOVE_TARGET .endm - + .macro getbattlerfainted battler:req various \battler, VARIOUS_GET_BATTLER_FAINTED .endm - + .macro resetintimidatetracebits battler:req various \battler, VARIOUS_RESET_INTIMIDATE_TRACE_BITS .endm - + .macro updatechoicemoveonlvlup battler:req various \battler, VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP .endm - + .macro resetplayerfainted various BS_ATTACKER, VARIOUS_RESET_PLAYER_FAINTED .endm - + .macro palaceflavortext battler:req various \battler, VARIOUS_PALACE_FLAVOR_TEXT .endm - + .macro arenajudgmentwindow various BS_ATTACKER, VARIOUS_ARENA_JUDGMENT_WINDOW .endm - + .macro arenaopponentmonlost various BS_ATTACKER, VARIOUS_ARENA_OPPONENT_MON_LOST .endm - + .macro arenaplayermonlost various BS_ATTACKER, VARIOUS_ARENA_PLAYER_MON_LOST .endm - + .macro arenabothmonlost various BS_ATTACKER, VARIOUS_ARENA_BOTH_MONS_LOST .endm - + .macro forfeityesnobox battler:req various \battler, VARIOUS_EMIT_YESNOBOX .endm - + .macro arenadrawreftextbox various BS_ATTACKER, VARIOUS_DRAW_ARENA_REF_TEXT_BOX .endm - + .macro arenaerasereftextbox various BS_ATTACKER, VARIOUS_ERASE_ARENA_REF_TEXT_BOX .endm - + .macro arenajudgmentstring id:req various \id, VARIOUS_ARENA_JUDGMENT_STRING .endm - + .macro arenawaitmessage id:req various \id, VARIOUS_ARENA_WAIT_STRING .endm - + .macro waitcry battler:req various \battler, VARIOUS_WAIT_CRY .endm - + .macro returnopponentmon1toball battler:req various \battler, VARIOUS_RETURN_OPPONENT_MON1 .endm - + .macro returnopponentmon2toball battler:req various \battler, VARIOUS_RETURN_OPPONENT_MON2 .endm - + .macro volumedown various BS_ATTACKER, VARIOUS_VOLUME_DOWN .endm - + .macro volumeup various BS_ATTACKER, VARIOUS_VOLUME_UP .endm - + .macro setalreadystatusedmoveattempt battler:req various \battler, VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT .endm - + .macro palacetryescapestatus battler:req various \battler, VARIOUS_PALACE_TRY_ESCAPE_STATUS .endm - + .macro setoutcomeonteleport battler:req various \battler, VARIOUS_SET_TELEPORT_OUTCOME .endm - + .macro playtrainerdefeatbgm battler:req various \battler, VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC .endm - + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER, \stat | \stages << 4 | \down << 7 .endm - + .macro setmoveeffect effect:req setbyte cEFFECT_CHOOSER, \effect .endm - + .macro chosenstatus1animation battler:req, status:req chosenstatusanimation \battler, 0x0, \status .endm - + .macro chosenstatus2animation battler:req, status:req chosenstatusanimation \battler, 0x1, \status .endm - + .macro sethword dst:req, value:req setbyte \dst, (\value) & 0xFF setbyte \dst + 1, ((\value) >> 8) & 0xFF .endm - + .macro setword dst:req, value:req setbyte \dst, (\value) & 0xFF setbyte \dst + 1, ((\value) >> 8) & 0xFF setbyte \dst + 2, ((\value) >> 16) & 0xFF setbyte \dst + 3, ((\value) >> 24) & 0xFF .endm - + .macro copybyte dst:req, src:req copyarray \dst, \src, 0x1 .endm - + .macro copyhword dst:req, src:req copyarray \dst, \src, 0x2 .endm - + .macro copyword dst:req, src:req copyarray \dst, \src, 0x4 .endm - + .macro jumpifbytenotequal byte1:req, byte2:req, jumpptr:req jumpifarraynotequal \byte1, \byte2, 0x1, \jumpptr .endm - + .macro jumpifbyteequal byte1:req, byte2:req, jumpptr:req jumpifarrayequal \byte1, \byte2, 0x1, \jumpptr .endm - + .macro jumpifmove move:req, jumpptr:req jumpifhalfword CMP_EQUAL, gCurrentMove, \move, \jumpptr .endm @@ -1418,23 +1418,23 @@ .macro jumpifnotmove move:req, jumpptr:req jumpifhalfword CMP_NOT_EQUAL, gCurrentMove, \move, \jumpptr .endm - + .macro jumpifstatus3 battler:req, status:req, jumpptr:req jumpifstatus3condition \battler, \status, FALSE, \jumpptr .endm - + .macro jumpifnostatus3 battler:req, status:req, jumpptr:req jumpifstatus3condition \battler, \status, TRUE, \jumpptr .endm - + .macro jumpifmovehadnoeffect jumpptr:req jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_NO_EFFECT, \jumpptr .endm - + .macro jumpifbattletype flags:req, jumpptr:req jumpifword CMP_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr .endm - + .macro jumpifnotbattletype flags:req, jumpptr:req jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr .endm diff --git a/asm/macros/event.inc b/asm/macros/event.inc index cea21aeb28..77916efe13 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -276,7 +276,7 @@ .2byte SPECIAL_\function .endm - @ Blocks script execution until a command or C code manually unblocks it. Generally used with specific + @ Blocks script execution until a command or C code manually unblocks it. Generally used with specific @ commands and specials. Calling ScriptContext_Enable for instance will allow execution to continue. .macro waitstate .byte 0x27 @@ -985,7 +985,7 @@ .endm @ Gives the player a Pokémon of the specified species and level, holding the specified item. The trailing 0s are unused parameters. - @ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. + @ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. .macro givemon species:req, level:req, item=ITEM_NONE .byte 0x79 .2byte \species @@ -997,7 +997,7 @@ .endm @ Gives the player an Egg of the specified species. - @ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. + @ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. .macro giveegg species:req .byte 0x7a .2byte \species @@ -1415,7 +1415,7 @@ .2byte \out .endm - @ Gives 'count' coins to the player, up to a total of MAX_COINS. + @ Gives 'count' coins to the player, up to a total of MAX_COINS. @ If the player already has MAX_COINS then VAR_RESULT is set to TRUE, otherwise it is set to FALSE. .macro addcoins count:req .byte 0xb4 @@ -1887,7 +1887,7 @@ @ Gives 'amount' of the specified 'item' to the player and prints a message with fanfare. @ If the player doesn't have space for all the items then as many are added as possible, the - @ message indicates there is no room, and VAR_RESULT is set to FALSE. + @ message indicates there is no room, and VAR_RESULT is set to FALSE. @ Otherwise VAR_RESULT is set to TRUE, and the message indicates they have received the item(s). .macro giveitem item:req, amount=1 setorcopyvar VAR_0x8000, \item diff --git a/data/battle_ai_scripts.s b/data/battle_ai_scripts.s index c776c25327..df6cf1b6f3 100644 --- a/data/battle_ai_scripts.s +++ b/data/battle_ai_scripts.s @@ -1909,7 +1909,7 @@ AI_CV_Protect4: if_random_less_than 128, AI_CV_Protect_End score -1 goto AI_CV_Protect_End - + AI_CV_Protect3: get_last_used_bank_move AI_TARGET get_move_effect_from_result diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 39cdafceea..7e99911b19 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -15,7 +15,7 @@ .include "constants/constants.inc" .section script_data, "aw", %progbits - + .align 2 gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_HIT @@ -2826,7 +2826,7 @@ BattleScript_GiveExp:: setbyte sGIVEEXP_STATE, 0 getexp BS_TARGET end2 - + BattleScript_HandleFaintedMon:: checkteamslost BattleScript_LinkHandleFaintedMonMultiple jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_FaintedMonEnd @@ -4046,7 +4046,7 @@ BattleScript_IntimidatePrevented: printstring STRINGID_PREVENTEDFROMWORKING waitmessage B_WAIT_TIME_LONG goto BattleScript_IntimidateActivatesLoopIncrement - + BattleScript_DroughtActivates:: pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXINTENSIFIEDSUN diff --git a/data/scripts/new_game.inc b/data/scripts/new_game.inc index 7c5c3fc7de..e9c8dd8d56 100644 --- a/data/scripts/new_game.inc +++ b/data/scripts/new_game.inc @@ -38,7 +38,7 @@ EventScript_ResetAllBerries:: setberrytree BERRY_TREE_ROUTE_117_WEPEAR_3, ITEM_TO_BERRY(ITEM_WEPEAR_BERRY), BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_117_WEPEAR_2, ITEM_TO_BERRY(ITEM_WEPEAR_BERRY), BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_117_WEPEAR_1, ITEM_TO_BERRY(ITEM_WEPEAR_BERRY), BERRY_STAGE_BERRIES - + @ Route 112 setberrytree BERRY_TREE_ROUTE_112_RAWST_2, ITEM_TO_BERRY(ITEM_RAWST_BERRY), BERRY_STAGE_BERRIES setberrytree BERRY_TREE_ROUTE_112_PECHA_2, ITEM_TO_BERRY(ITEM_PECHA_BERRY), BERRY_STAGE_BERRIES diff --git a/data/scripts/roulette.inc b/data/scripts/roulette.inc index 7163a449aa..fcb09bef27 100644 --- a/data/scripts/roulette.inc +++ b/data/scripts/roulette.inc @@ -22,7 +22,7 @@ Roulette_EventScript_Play:: special PlayRoulette waitstate end - + Roulette_Text_PlayMinimumWagerIsX:: .string "The minimum wager at this table\n" .string "is {STR_VAR_1}. Do you want to play?$" diff --git a/docs/legacy_WSL1_INSTALL.md b/docs/legacy_WSL1_INSTALL.md index b9840d1c82..7d40960f3b 100644 --- a/docs/legacy_WSL1_INSTALL.md +++ b/docs/legacy_WSL1_INSTALL.md @@ -17,8 +17,8 @@ cd /mnt/c/Users//Downloads ``` - > Note 1: The Windows C:\ drive is called /mnt/c/ in WSL. - > Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "/mnt/c/users//Downloads folder"`. + > Note 1: The Windows C:\ drive is called /mnt/c/ in WSL. + > Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "/mnt/c/users//Downloads folder"`. > Note 3: Windows path names are case-insensitive so adhering to capitalization isn't needed 4. Once the directory has been changed to the folder containing the devkitPro pacman package, run the following commands to install devkitARM. diff --git a/gflib/text.c b/gflib/text.c index c7efdccce3..e7a7d5957b 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -73,7 +73,7 @@ static const u8 sDarkDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrow_alt static const u8 sUnusedFRLGBlankedDownArrow[] = INCBIN_U8("graphics/fonts/unused_frlg_blanked_down_arrow.4bpp"); static const u8 sUnusedFRLGDownArrow[] = INCBIN_U8("graphics/fonts/unused_frlg_down_arrow.4bpp"); static const u8 sDownArrowYCoords[] = { 0, 1, 2, 1 }; -static const u8 sWindowVerticalScrollSpeeds[] = { +static const u8 sWindowVerticalScrollSpeeds[] = { [OPTIONS_TEXT_SPEED_SLOW] = 1, [OPTIONS_TEXT_SPEED_MID] = 2, [OPTIONS_TEXT_SPEED_FAST] = 4, @@ -299,7 +299,7 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi else { sTempTextPrinter.textSpeed = 0; - + // Render all text (up to limit) at once for (j = 0; j < 0x400; ++j) { diff --git a/graphics_file_rules.mk b/graphics_file_rules.mk index 742f7d1b86..6f4d1e4227 100644 --- a/graphics_file_rules.mk +++ b/graphics_file_rules.mk @@ -93,35 +93,35 @@ $(TILESETGFXDIR)/secondary/sootopolis/tiles.4bpp: %.4bpp: %.png SOOTOPOLISANIMDIR := $(TILESETGFXDIR)/secondary/sootopolis/anim $(SOOTOPOLISANIMDIR)/stormy_water/0.4bpp: $(SOOTOPOLISANIMDIR)/stormy_water/0_kyogre.4bpp \ - $(SOOTOPOLISANIMDIR)/stormy_water/0_groudon.4bpp + $(SOOTOPOLISANIMDIR)/stormy_water/0_groudon.4bpp @cat $^ >$@ $(SOOTOPOLISANIMDIR)/stormy_water/1.4bpp: $(SOOTOPOLISANIMDIR)/stormy_water/1_kyogre.4bpp \ - $(SOOTOPOLISANIMDIR)/stormy_water/1_groudon.4bpp + $(SOOTOPOLISANIMDIR)/stormy_water/1_groudon.4bpp @cat $^ >$@ $(SOOTOPOLISANIMDIR)/stormy_water/2.4bpp: $(SOOTOPOLISANIMDIR)/stormy_water/2_kyogre.4bpp \ - $(SOOTOPOLISANIMDIR)/stormy_water/2_groudon.4bpp + $(SOOTOPOLISANIMDIR)/stormy_water/2_groudon.4bpp @cat $^ >$@ $(SOOTOPOLISANIMDIR)/stormy_water/3.4bpp: $(SOOTOPOLISANIMDIR)/stormy_water/3_kyogre.4bpp \ - $(SOOTOPOLISANIMDIR)/stormy_water/3_groudon.4bpp + $(SOOTOPOLISANIMDIR)/stormy_water/3_groudon.4bpp @cat $^ >$@ $(SOOTOPOLISANIMDIR)/stormy_water/4.4bpp: $(SOOTOPOLISANIMDIR)/stormy_water/4_kyogre.4bpp \ - $(SOOTOPOLISANIMDIR)/stormy_water/4_groudon.4bpp + $(SOOTOPOLISANIMDIR)/stormy_water/4_groudon.4bpp @cat $^ >$@ $(SOOTOPOLISANIMDIR)/stormy_water/5.4bpp: $(SOOTOPOLISANIMDIR)/stormy_water/5_kyogre.4bpp \ - $(SOOTOPOLISANIMDIR)/stormy_water/5_groudon.4bpp + $(SOOTOPOLISANIMDIR)/stormy_water/5_groudon.4bpp @cat $^ >$@ $(SOOTOPOLISANIMDIR)/stormy_water/6.4bpp: $(SOOTOPOLISANIMDIR)/stormy_water/6_kyogre.4bpp \ - $(SOOTOPOLISANIMDIR)/stormy_water/6_groudon.4bpp + $(SOOTOPOLISANIMDIR)/stormy_water/6_groudon.4bpp @cat $^ >$@ $(SOOTOPOLISANIMDIR)/stormy_water/7.4bpp: $(SOOTOPOLISANIMDIR)/stormy_water/7_kyogre.4bpp \ - $(SOOTOPOLISANIMDIR)/stormy_water/7_groudon.4bpp + $(SOOTOPOLISANIMDIR)/stormy_water/7_groudon.4bpp @cat $^ >$@ $(TILESETGFXDIR)/secondary/battle_frontier_outside_west/tiles.4bpp: %.4bpp: %.png @@ -671,7 +671,7 @@ $(OBJEVENTGFXDIR)/pics/effects/unknown_4F6D38/0.4bpp: %.4bpp: %.png $(INTERFACEGFXDIR)/selector_outline.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 8 -Wnum_tiles - + $(BATTRANSGFXDIR)/frontier_logo_center.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 43 -Wnum_tiles @@ -699,7 +699,7 @@ $(PKNAVGFXDIR)/header.4bpp: %.4bpp: %.png $(PKNAVGFXDIR)/device_outline.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 53 -Wnum_tiles - + $(PKNAVGFXDIR)/match_call/ui.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 13 -Wnum_tiles diff --git a/include/battle.h b/include/battle.h index 5cc5521859..e779dee3df 100644 --- a/include/battle.h +++ b/include/battle.h @@ -473,7 +473,7 @@ struct BattleStruct #define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7)) -// NOTE: The members of this struct have hard-coded offsets +// NOTE: The members of this struct have hard-coded offsets // in include/constants/battle_script_commands.h struct BattleScripting { diff --git a/include/global.h b/include/global.h index b1fd21d8b1..6e2cfa9b80 100644 --- a/include/global.h +++ b/include/global.h @@ -878,7 +878,7 @@ struct MysteryGiftSave struct WonderCardMetadata cardMetadata; u16 questionnaireWords[NUM_QUESTIONNAIRE_WORDS]; struct WonderNewsMetadata newsMetadata; - u32 trainerIds[2][5]; // Saved ids for 10 trainers, 5 each for battles and trades + u32 trainerIds[2][5]; // Saved ids for 10 trainers, 5 each for battles and trades }; // 0x36C 0x3598 // For external event data storage. The majority of these may have never been used. diff --git a/include/link_rfu.h b/include/link_rfu.h index 673b19ff90..1e434e8303 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -97,12 +97,12 @@ struct RfuGameCompatibilityData // wireless play (the kind the Pokémon games use) the gname data can be used for // anything the developers want. This struct is what GF decided to use it for. // It can be up to 13 bytes in size (RFU_GAME_NAME_LENGTH). -// The player's name is sent separately as the username ("uname"), and does not +// The player's name is sent separately as the username ("uname"), and does not // use a struct (gHostRfuUsername). struct __attribute__((packed, aligned(2))) RfuGameData { struct RfuGameCompatibilityData compatibility; - u8 partnerInfo[RFU_CHILD_MAX]; + u8 partnerInfo[RFU_CHILD_MAX]; u16 tradeSpecies:10; u16 tradeType:6; u8 activity:7; @@ -118,7 +118,7 @@ struct __attribute__((packed, aligned(2))) RfuGameData // Bits 0-2 are a shortened trainerId // Bit 3 is the player's gender // Bits 4-6 are unknown/unused -// Bit 7 is an 'active' flag +// Bit 7 is an 'active' flag #define PINFO_TID_MASK 0x7 #define PINFO_GENDER_SHIFT 3 #define PINFO_ACTIVE_FLAG (1 << 7) diff --git a/include/pokenav.h b/include/pokenav.h index 959998383f..c6a8bb253e 100644 --- a/include/pokenav.h +++ b/include/pokenav.h @@ -116,7 +116,7 @@ enum #define POKENAV_MENU_IDS_START 100000 enum { - POKENAV_MAIN_MENU = POKENAV_MENU_IDS_START, // The main menu where the player selects Hoenn Map/Condition/Match Call/Ribbons + POKENAV_MAIN_MENU = POKENAV_MENU_IDS_START, // The main menu where the player selects Hoenn Map/Condition/Match Call/Ribbons POKENAV_MAIN_MENU_CURSOR_ON_MAP, POKENAV_CONDITION_MENU, // The first Condition screen where the player selects Party or Search POKENAV_CONDITION_SEARCH_MENU, // The Condition search menu where the player selects a search parameter diff --git a/include/union_room.h b/include/union_room.h index acff4b5929..514a159850 100644 --- a/include/union_room.h +++ b/include/union_room.h @@ -7,7 +7,7 @@ // In the Union Room the player is only ever connected to ≤ 4 other players. // However, there can be up to MAX_UNION_ROOM_LEADERS (8) object events to -// represent leaders of recently discovered link groups, and each of those groups +// represent leaders of recently discovered link groups, and each of those groups // may have up to MAX_RFU_PLAYERS (5) players in it including the leader. // These players are represented on-screen by NPC sprites drawn around the leader. // Thus there can be 40 sprites of other players on-screen, in 8 groups of 5. @@ -16,7 +16,7 @@ // The maximum number of recently connected players that can be tracked. // Note that this is significantly less than NUM_UNION_ROOM_SPRITES, i.e. not // every player that can be shown in the Union Room can be tracked at once. -// Information such as a group member's gender can instead be read from partnerInfo +// Information such as a group member's gender can instead be read from partnerInfo // of the leader's RfuGameData by tracking at least all of the group leaders. #define MAX_RFU_PLAYER_LIST_SIZE 16 diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index 25817c0740..a5d4659a9d 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -495,7 +495,7 @@ static void TranslateSpriteInLissajousCurve(struct Sprite *sprite) sprite->y2 = Cos(sprite->sCirclePosY, sprite->sAmplitude); sprite->sCirclePosX += sprite->sCircleSpeedX; sprite->sCirclePosY += sprite->sCircleSpeedY; - + if (sprite->sCirclePosX >= 0x100) sprite->sCirclePosX -= 0x100; else if (sprite->sCirclePosX < 0) @@ -2429,7 +2429,7 @@ void AnimTask_AttackerPunchWithTrace(u8 taskId) dest = (task->tPaletteNum + 16) * 16; src = (gSprites[task->tBattlerSpriteId].oam.paletteNum + 0x10) * 0x10; - + // Set trace's priority based on battler's subpriority task->tPriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker); if (task->tPriority == 20 || task->tPriority == 40) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d2235027c7..fb5a7649a5 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6368,7 +6368,7 @@ static void Cmd_various(void) break; case VARIOUS_ARENA_JUDGMENT_WINDOW: i = BattleArena_ShowJudgmentWindow(&gBattleCommunication[0]); - + // BattleArena_ShowJudgmentWindow's last state was an intermediate step. // Return without advancing the current instruction so that it will be called again. if (i == ARENA_RESULT_RUNNING) diff --git a/src/battle_tent.c b/src/battle_tent.c index dba9e6e8a0..e51ac38a5a 100644 --- a/src/battle_tent.c +++ b/src/battle_tent.c @@ -390,7 +390,7 @@ static void GenerateOpponentMons(void) while (i != FRONTIER_PARTY_SIZE) { sRandMonId = monSet[Random() % numMons]; - + // Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++) { diff --git a/src/battle_transition.c b/src/battle_transition.c index bc289efa7f..3675421ee1 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -2434,7 +2434,7 @@ static bool8 Mugshot_WaitStartPlayerSlide(struct Task *task) { sTransitionData->BG0HOFS_Lower -= 8; sTransitionData->BG0HOFS_Upper += 8; - + // Start player's slide in once the opponent is finished if (IsTrainerPicSlideDone(task->tOpponentSpriteId)) { @@ -2770,7 +2770,7 @@ static bool8 Slice_Main(struct Task *task) { u16 *storeLoc1 = &gScanlineEffectRegBuffers[0][i]; u16 *storeLoc2 = &gScanlineEffectRegBuffers[0][i + DISPLAY_HEIGHT]; - + // Alternate rows if (i % 2) { @@ -3251,7 +3251,7 @@ static bool8 RectangularSpiral_Main(struct Task *task) // The line moved to a new position, draw the tile. done = FALSE; position = sRectangularSpiralLines[j].position; - + // Invert position for the two lines that start at the bottom. if ((j % 2) == 1) position = 637 - position; @@ -3281,7 +3281,7 @@ static bool8 RectangularSpiral_End(struct Task *task) static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, struct RectangularSpiralLine *line) { const s16 *moveData = moveDataTable[line->state]; - + // Has spiral finished? // Note that most move data arrays endsin SPIRAL_END but it is // only ever reached on the final array of spiraling outward. @@ -3294,9 +3294,9 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru sDebug_RectangularSpiralData = moveData[2]; sDebug_RectangularSpiralData = moveData[3]; - // Note that for the two lines originating at the bottom the + // Note that for the two lines originating at the bottom the // position is inverted, so the directions are flipped. - // i.e. position += 1 is right for the top lines and left + // i.e. position += 1 is right for the top lines and left // for their inverted partners on the bottom. switch (moveData[0]) { @@ -4170,13 +4170,13 @@ static void InitBlackWipe(s16 *data, s16 startX, s16 startY, s16 endX, s16 endY, static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact) { u8 numFinished; - + if (tWipeXDist > tWipeYDist) { // X has further to move, move it first tWipeCurrX += tWipeXMove; - // If it has been far enough since Y's + // If it has been far enough since Y's // last move then move it too tWipeTemp += tWipeYDist; if (tWipeTemp > tWipeXDist) @@ -4190,7 +4190,7 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact) // Y has further to move, move it first tWipeCurrY += tWipeYMove; - // If it has been far enough since X's + // If it has been far enough since X's // last move then move it too tWipeTemp += tWipeXDist; if (tWipeTemp > tWipeYDist) @@ -4201,9 +4201,9 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact) } numFinished = 0; - + // Has X coord reached end? - if ((tWipeXMove > 0 && tWipeCurrX >= tWipeEndX) + if ((tWipeXMove > 0 && tWipeCurrX >= tWipeEndX) || (tWipeXMove < 0 && tWipeCurrX <= tWipeEndX)) { numFinished++; @@ -4212,7 +4212,7 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact) } // Has Y coord reached end? - if ((tWipeYMove > 0 && tWipeCurrY >= tWipeEndY) + if ((tWipeYMove > 0 && tWipeCurrY >= tWipeEndY) || (tWipeYMove < 0 && tWipeCurrY <= tWipeEndY)) { numFinished++; diff --git a/src/data/field_effects/field_effect_objects.h b/src/data/field_effects/field_effect_objects.h index 938b6bfc55..d19adf6f0b 100755 --- a/src/data/field_effects/field_effect_objects.h +++ b/src/data/field_effects/field_effect_objects.h @@ -1147,7 +1147,7 @@ static const union AnimCmd *const sAnimTable_AshPuff[] = sAnim_AshPuff, }; -const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff = +const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff = { .tileTag = TAG_NONE, .paletteTag = FLDEFF_PAL_TAG_ASH, diff --git a/src/decoration.c b/src/decoration.c index cc740f189e..c5c7c02c34 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -1211,7 +1211,7 @@ static void ShowDecorationOnMap_(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight, { x = mapX + i; attributes = GetMetatileAttributesById(NUM_TILES_IN_PRIMARY + gDecorations[decoration].tiles[j * decWidth + i]); - if (MetatileBehavior_IsSecretBaseImpassable(attributes & METATILE_ATTR_BEHAVIOR_MASK) == TRUE + if (MetatileBehavior_IsSecretBaseImpassable(attributes & METATILE_ATTR_BEHAVIOR_MASK) == TRUE || (gDecorations[decoration].permission != DECORPERM_PASS_FLOOR && (attributes >> METATILE_ATTR_LAYER_SHIFT) != METATILE_LAYER_TYPE_NORMAL)) impassableFlag = MAPGRID_COLLISION_MASK; else @@ -1482,7 +1482,7 @@ static bool8 IsSecretBaseTrainerSpot(u8 behaviorAt, u16 layerType) // Can't place decoration where the player was standing when they interacted with the PC static bool8 IsntInitialPosition(u8 taskId, s16 x, s16 y, u16 layerType) { - if (x == gTasks[taskId].tInitialX + MAP_OFFSET + if (x == gTasks[taskId].tInitialX + MAP_OFFSET && y == gTasks[taskId].tInitialY + MAP_OFFSET && layerType != METATILE_LAYER_TYPE_NORMAL) return FALSE; diff --git a/src/ereader_screen.c b/src/ereader_screen.c index 3baff84a85..b6bf7133a0 100755 --- a/src/ereader_screen.c +++ b/src/ereader_screen.c @@ -112,7 +112,7 @@ static bool32 ValidateEReaderConnection(void) REG_IME = 0; *(u64 *)handshakes = *(u64 *)gLink.handshakeBuffer; REG_IME = backupIME; - + // Validate that we are player 1, the EReader is player 2, // and that players 3 and 4 are empty. if (handshakes[0] == SLAVE_HANDSHAKE && handshakes[1] == EREADER_HANDSHAKE @@ -154,8 +154,8 @@ enum { static u32 TryReceiveCard(u8 *state, u16 *timer) { - if (*state >= RECV_STATE_EXCHANGE - && *state <= RECV_STATE_WAIT_DISCONNECT + if (*state >= RECV_STATE_EXCHANGE + && *state <= RECV_STATE_WAIT_DISCONNECT && HasLinkErrorOccurred()) { // Return error status if an error occurs diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 87249af010..a63eeb22b8 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -2623,7 +2623,7 @@ bool8 ObjectEventIsTrainerAndCloseToPlayer(struct ObjectEvent *objectEvent) minY = objY - objectEvent->trainerRange_berryTreeId; maxX = objX + objectEvent->trainerRange_berryTreeId; maxY = objY + objectEvent->trainerRange_berryTreeId; - if (minX > playerX || maxX < playerX + if (minX > playerX || maxX < playerX || minY > playerY || maxY < playerY) return FALSE; diff --git a/src/field_tasks.c b/src/field_tasks.c index 099014a4d4..dec5cba800 100644 --- a/src/field_tasks.c +++ b/src/field_tasks.c @@ -251,7 +251,7 @@ static const struct PacifidlogMetatileOffsets *GetPacifidlogBridgeMetatileOffset static void TrySetPacifidlogBridgeMetatiles(const struct PacifidlogMetatileOffsets *offsets, s16 x, s16 y, bool32 redrawMap) { offsets = GetPacifidlogBridgeMetatileOffsets(offsets, MapGridGetMetatileBehaviorAt(x, y)); - + // If offsets is NULL, position is not a log (don't set it) if (offsets) { @@ -301,7 +301,7 @@ static bool32 ShouldRaisePacifidlogLogs(s16 newX, s16 newY, s16 oldX, s16 oldY) } else if (MetatileBehavior_IsPacifidlogHorizontalLogLeft(oldBehavior)) { - // Still on same one if moved from left to right + // Still on same one if moved from left to right if (newX > oldX) return FALSE; } @@ -340,13 +340,13 @@ static bool32 ShouldSinkPacifidlogLogs(s16 newX, s16 newY, s16 oldX, s16 oldY) } else if (MetatileBehavior_IsPacifidlogHorizontalLogLeft(newBehavior)) { - // Still on same one if moved from right to left + // Still on same one if moved from right to left if (newX < oldX) return FALSE; } else if (MetatileBehavior_IsPacifidlogHorizontalLogRight(newBehavior)) { - // Still on same one if moved from left to right + // Still on same one if moved from left to right if (newX > oldX) return FALSE; } @@ -371,7 +371,7 @@ static void PacifidlogBridgePerStepCallback(u8 taskId) case 0: tPrevX = x; tPrevY = y; - + // If player is already standing on a log when the callback // is set then immediately set it to submerged TrySetLogBridgeFullySubmerged(x, y, TRUE); @@ -424,7 +424,7 @@ static void PacifidlogBridgePerStepCallback(u8 taskId) { // If player's current position is a log submerge it fully. TrySetLogBridgeFullySubmerged(x, y, TRUE); - + // Player's previous position is not the other end of a log // they're standing on, try to raise their previous position. if (tToRaiseX != -1 && tToRaiseY != -1) @@ -499,7 +499,7 @@ static void FortreeBridgePerStepCallback(u8 taskId) case 0: tPrevX = x; tPrevY = y; - + // If player is already on bridge when callback is set then lower it immediately. if (MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(x, y))) { @@ -518,7 +518,7 @@ static void FortreeBridgePerStepCallback(u8 taskId) isFortreeBridgeCur = MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(x, y)); isFortreeBridgePrev = MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(prevX, prevY)); - + // Make sure player isn't below bridge elevation = PlayerGetElevation(); onBridgeElevation = FALSE; @@ -672,7 +672,7 @@ static void SootopolisGymIcePerStepCallback(u8 taskId) // End if player hasn't moved if (x == tPrevX && y == tPrevY) return; - + tPrevX = x; tPrevY = y; tileBehavior = MapGridGetMetatileBehaviorAt(x, y); diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c index 437cec2fdb..4730c74fde 100644 --- a/src/link_rfu_2.c +++ b/src/link_rfu_2.c @@ -61,7 +61,7 @@ struct SioInfo u8 filler[92]; }; -// Struct is mostly empty, presumably because usage of +// Struct is mostly empty, presumably because usage of // its fields was largely removed before release struct RfuDebug { @@ -1643,7 +1643,7 @@ bool32 RfuTryDisconnectLeavingChildren(void) { u8 childrenLeaving = 0; s32 i; - + // Check all children, get those waiting to be disconnected for (i = 0; i < RFU_CHILD_MAX; i++) { @@ -2123,7 +2123,7 @@ void SetUnionRoomChatPlayerData(u32 numPlayers) // Only trainerId is shifted by the number of children, so the active flag and gender // are only ever set for the first child partnerInfo |= ((PINFO_ACTIVE_FLAG - | ((gLinkPlayers[gRfu.linkPlayerIdx[i]].gender & 1) << PINFO_GENDER_SHIFT) + | ((gLinkPlayers[gRfu.linkPlayerIdx[i]].gender & 1) << PINFO_GENDER_SHIFT) | (gLinkPlayers[gRfu.linkPlayerIdx[i]].trainerId & PINFO_TID_MASK)) << (numConnectedChildren * 8)); numConnectedChildren++; if (numConnectedChildren == numPlayers - 1) @@ -2477,7 +2477,7 @@ static void LinkManagerCB_UnionRoom(u8 msg, u8 paramCount) rfu_LMAN_stopManager(FALSE); } - if (gRfuLinkStatus->parentChild == MODE_NEUTRAL + if (gRfuLinkStatus->parentChild == MODE_NEUTRAL && !lman.pcswitch_flag && FuncIsActiveTask(Task_UnionRoomListen) == TRUE) gRfu.state = RFUSTATE_UR_CONNECT; @@ -2816,7 +2816,7 @@ static bool32 IsPartnerActivityIncompatible(s16 activity, struct RfuGameData *pa } else if (activity == (ACTIVITY_TRADE | IN_UNION_ROOM)) { - // Verify that the trade offered hasn't changed + // Verify that the trade offered hasn't changed struct RfuGameData *original = &gRfu.parent; if (original->tradeSpecies == SPECIES_EGG) { diff --git a/src/link_rfu_3.c b/src/link_rfu_3.c index 1e1fe5b347..0825daea2c 100644 --- a/src/link_rfu_3.c +++ b/src/link_rfu_3.c @@ -824,7 +824,7 @@ void UpdateWirelessStatusIndicatorSprite(void) struct Sprite *sprite = &gSprites[gWirelessStatusIndicatorSpriteId]; u8 signalStrength = RFU_LINK_ICON_LEVEL4_MAX; u8 i = 0; - + // Get weakest signal strength if (gRfuLinkStatus->parentChild == MODE_PARENT) { diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 72d3ac632f..e35a5b29ac 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -795,7 +795,7 @@ u8 MetatileBehavior_GetBridgeType(u8 metatileBehavior) && metatileBehavior <= MB_BRIDGE_OVER_POND_HIGH) return metatileBehavior - MB_BRIDGE_OVER_OCEAN; - if (metatileBehavior >= MB_BRIDGE_OVER_POND_MED_EDGE_1 + if (metatileBehavior >= MB_BRIDGE_OVER_POND_MED_EDGE_1 && metatileBehavior <= MB_BRIDGE_OVER_POND_MED_EDGE_2) return BRIDGE_TYPE_POND_MED; diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 72fc2b3774..c4e63bfbb8 100755 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -171,8 +171,8 @@ static bool32 ValidateWonderCard(const struct WonderCard *card) return FALSE; if (card->type >= CARD_TYPE_COUNT) return FALSE; - if (!(card->sendType == SEND_TYPE_DISALLOWED - || card->sendType == SEND_TYPE_ALLOWED + if (!(card->sendType == SEND_TYPE_DISALLOWED + || card->sendType == SEND_TYPE_ALLOWED || card->sendType == SEND_TYPE_ALLOWED_ALWAYS)) return FALSE; if (card->bgType >= NUM_WONDER_BGS) @@ -429,7 +429,7 @@ u32 MysteryGift_CompareCardFlags(const u16 *flagId, const struct MysteryGiftLink u32 MysteryGift_CheckStamps(const u16 *stamp, const struct MysteryGiftLinkGameData *data, const void *unused) { int stampsMissing = data->maxStamps - GetNumStampsInMetadata(&data->cardMetadata, data->maxStamps); - + // Has full stamp card? if (stampsMissing == 0) return 1; @@ -598,7 +598,7 @@ void MysteryGift_TryIncrementStat(u32 stat, u32 trainerId) switch (stat) { case CARD_STAT_NUM_TRADES: - IncrementCardStatForNewTrainer(CARD_STAT_NUM_TRADES, + IncrementCardStatForNewTrainer(CARD_STAT_NUM_TRADES, trainerId, gSaveBlock1Ptr->mysteryGift.trainerIds[1], ARRAY_COUNT(gSaveBlock1Ptr->mysteryGift.trainerIds[1])); diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c index 92e544a27b..9e4796bb20 100644 --- a/src/mystery_gift_menu.c +++ b/src/mystery_gift_menu.c @@ -1240,7 +1240,7 @@ static void Task_MysteryGift(u8 taskId) } else if (gSpecialVar_Result == LINKUP_FAILED) { - // Link failed, return to link start menu + // Link failed, return to link start menu ClearScreenInBg0(TRUE); data->state = MG_STATE_SOURCE_PROMPT; } diff --git a/src/mystery_gift_view.c b/src/mystery_gift_view.c index 384e8ef74b..b059b183c8 100644 --- a/src/mystery_gift_view.c +++ b/src/mystery_gift_view.c @@ -340,7 +340,7 @@ static void BufferCardText(void) if (sWonderCardData->card.idNumber > 999999) sWonderCardData->card.idNumber = 999999; ConvertIntToDecimalStringN(sWonderCardData->idNumberText, sWonderCardData->card.idNumber, STR_CONV_MODE_LEFT_ALIGN, 6); - + // Copy body text for (i = 0; i < WONDER_CARD_BODY_TEXT_LINES; i++) { @@ -364,12 +364,12 @@ static void BufferCardText(void) break; case CARD_TYPE_LINK_STAT: sWonderCardData->giftText[0] = EOS; - + // Load stats stats[0] = sWonderCardData->cardMetadata.battlesWon < MAX_WONDER_CARD_STAT ? sWonderCardData->cardMetadata.battlesWon : MAX_WONDER_CARD_STAT; stats[1] = sWonderCardData->cardMetadata.battlesLost < MAX_WONDER_CARD_STAT ? sWonderCardData->cardMetadata.battlesLost : MAX_WONDER_CARD_STAT; stats[2] = sWonderCardData->cardMetadata.numTrades < MAX_WONDER_CARD_STAT ? sWonderCardData->cardMetadata.numTrades : MAX_WONDER_CARD_STAT; - + // Init stat text arrays for (i = 0; i < ARRAY_COUNT(sWonderCardData->statTextData); i++) { @@ -446,7 +446,7 @@ static void DrawCardWindow(u8 whichWindow) sCard_FooterTextOffsets[sWonderCardData->card.type], sCard_TextColorTable[sWonderCardData->gfx->footerTextPal], 0, sWonderCardData->footerLine1Text); - + // Print footer line 2 if (sWonderCardData->card.type != CARD_TYPE_LINK_STAT) { @@ -486,7 +486,7 @@ static void CreateCardSprites(void) { u8 i = 0; sWonderCardData->monIconSpriteId = SPRITE_NONE; - + // Create icon sprite if (sWonderCardData->cardMetadata.iconSpecies != SPECIES_NONE) { @@ -505,7 +505,7 @@ static void CreateCardSprites(void) sWonderCardData->stampSpriteIds[i][1] = SPRITE_NONE; sWonderCardData->stampSpriteIds[i][0] = CreateSprite(&sSpriteTemplate_StampShadow, 216 - 32 * i, 144, 8); if (sWonderCardData->cardMetadata.stampData[STAMP_SPECIES][i] != SPECIES_NONE) - sWonderCardData->stampSpriteIds[i][1] = CreateMonIconNoPersonality(GetIconSpeciesNoPersonality(sWonderCardData->cardMetadata.stampData[STAMP_SPECIES][i]), + sWonderCardData->stampSpriteIds[i][1] = CreateMonIconNoPersonality(GetIconSpeciesNoPersonality(sWonderCardData->cardMetadata.stampData[STAMP_SPECIES][i]), SpriteCallbackDummy, 216 - 32 * i, 136, 0, 0); @@ -520,7 +520,7 @@ static void DestroyCardSprites(void) // Destroy icon sprite if (sWonderCardData->monIconSpriteId != SPRITE_NONE) FreeAndDestroyMonIconSprite(&gSprites[sWonderCardData->monIconSpriteId]); - + // Destroy stamp sprites if (sWonderCardData->card.maxStamps != 0 && sWonderCardData->card.type == CARD_TYPE_STAMP) { @@ -865,7 +865,7 @@ u32 WonderNews_GetInput(u16 input) static void BufferNewsText(void) { u8 i = 0; - + // Copy title text memcpy(sWonderNewsData->titleText, sWonderNewsData->news.titleText, WONDER_NEWS_TEXT_LENGTH); sWonderNewsData->titleText[WONDER_NEWS_TEXT_LENGTH] = EOS; @@ -896,7 +896,7 @@ static void DrawNewsWindows(void) if (x < 0) x = 0; AddTextPrinterParameterized3(sWonderNewsData->windowIds[NEWS_WIN_TITLE], FONT_SHORT_COPY_1, x, 6, sNews_TextColorTable[sWonderNewsData->gfx->titleTextPal], 0, sWonderNewsData->titleText); - + // Print body text for (; i < WONDER_NEWS_BODY_TEXT_LINES; i++) AddTextPrinterParameterized3(sWonderNewsData->windowIds[NEWS_WIN_BODY], FONT_SHORT_COPY_1, 0, diff --git a/src/pokedex_area_screen.c b/src/pokedex_area_screen.c index dde86f1557..01cbacb447 100755 --- a/src/pokedex_area_screen.c +++ b/src/pokedex_area_screen.c @@ -560,7 +560,7 @@ static void DoAreaGlow(void) if (sPokedexAreaScreen->markerTimer > 12) { sPokedexAreaScreen->markerTimer = 0; - + // Flash the marker // With a max of 4, the marker will disappear twice sPokedexAreaScreen->markerFlashCounter++; @@ -737,7 +737,7 @@ static void CreateAreaMarkerSprites(void) static void DestroyAreaScreenSprites(void) { u16 i; - + // Destroy area marker sprites FreeSpriteTilesByTag(TAG_AREA_MARKER); FreeSpritePaletteByTag(TAG_AREA_MARKER); @@ -772,7 +772,7 @@ static void CreateAreaUnknownSprites(void) if (sPokedexAreaScreen->numOverworldAreas || sPokedexAreaScreen->numSpecialAreas) { - // The current species is present on the map, don't create any "Area Unknown" sprites + // The current species is present on the map, don't create any "Area Unknown" sprites for (i = 0; i < ARRAY_COUNT(sPokedexAreaScreen->areaUnknownSprites); i++) sPokedexAreaScreen->areaUnknownSprites[i] = NULL; } diff --git a/src/pokemon.c b/src/pokemon.c index e16bc64a64..b65f97bd85 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1848,7 +1848,7 @@ static const u8 sMonAnimationDelayTable[NUM_SPECIES - 1] = #define PP_UP_SHIFTS_INV(val) (u8)~(val), (u8)~((val) << 2), (u8)~((val) << 4), (u8)~((val) << 6) // PP Up bonuses are stored for a Pokémon as a single byte. -// There are 2 bits (a value 0-3) for each move slot that +// There are 2 bits (a value 0-3) for each move slot that // represent how many PP Ups have been applied. // The following arrays take a move slot id and return: // gPPUpGetMask - A mask to get the number of PP Ups applied to that move slot @@ -3119,7 +3119,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de spAttack = attacker->spAttack; spDefense = defender->spDefense; - // Get attacker hold item info + // Get attacker hold item info if (attacker->item == ITEM_ENIGMA_BERRY) { attackerHoldEffect = gEnigmaBerries[battlerIdAtk].holdEffect; @@ -5204,7 +5204,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov case 4: // ITEM5_PP_MAX dataUnsigned = (GetMonData(mon, MON_DATA_PP_BONUSES, NULL) & gPPUpGetMask[moveIndex]) >> (moveIndex * 2); temp2 = CalculatePPWithBonus(GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex); - + // Check if 3 PP Ups have been applied already, and that the move has a total PP of at least 5 (excludes Sketch) if (dataUnsigned < 3 && temp2 >= 5) { @@ -6918,7 +6918,7 @@ static bool8 ShouldSkipFriendshipChange(void) // Only the 'default' mode (MON_SPR_GFX_MODE_NORMAL) is used, which is set // up to allocate 4 sprites using the battler sprite templates (gBattlerSpriteTemplates). // MON_SPR_GFX_MODE_BATTLE is identical but never used. -// MON_SPR_GFX_MODE_FULL_PARTY is set up to allocate 7 sprites (party + trainer?) +// MON_SPR_GFX_MODE_FULL_PARTY is set up to allocate 7 sprites (party + trainer?) // using a generic 64x64 template, and is also never used. // Between the unnecessarily large sizes below, a mistake allocating the spritePointers @@ -6980,7 +6980,7 @@ struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 managerId, u8 mode) gfx->dataSize = 1; gfx->mode = MON_SPR_GFX_MODE_FULL_PARTY; break; - // case MON_SPR_GFX_MODE_BATTLE: + // case MON_SPR_GFX_MODE_BATTLE: case MON_SPR_GFX_MODE_NORMAL: default: gfx->numSprites = MAX_BATTLERS_COUNT; diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index aa55e42c70..74e1da2cc6 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -3879,7 +3879,7 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state) summary->species2, summary->pid); else - HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], summary->species2, summary->pid); @@ -3891,7 +3891,7 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state) if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], - summary->species2, + summary->species2, summary->pid); else HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], diff --git a/src/pokenav_menu_handler_gfx.c b/src/pokenav_menu_handler_gfx.c index bc55fa7515..ec8d67cbe2 100644 --- a/src/pokenav_menu_handler_gfx.c +++ b/src/pokenav_menu_handler_gfx.c @@ -904,7 +904,7 @@ static void StartOptionAnimations_Enter(void) // Not selected, set default position x = OPTION_DEFAULT_X; } - + // Slide new options in StartOptionSlide(gfx->iconSprites[i], OPTION_EXIT_X, x, 12); SetOptionInvisibility(gfx->iconSprites[i], FALSE); diff --git a/src/record_mixing.c b/src/record_mixing.c index b03d7be2f3..c899db25e7 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -879,7 +879,7 @@ static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *records, size for (i = 0; i < linkPlayerCount; i++) { mixMail = (void *)records + i * recordSize; - + // Count number of players that have at least // one daycare Pokémon with no held item if (canHoldItem[i][0] == TRUE || canHoldItem[i][1] == TRUE) @@ -945,7 +945,7 @@ static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *records, size case 4: // 4 players can swap, select which 2 pairings will swap ptr = idxs; - + // Swap pair 1 playerSlot1 = sDaycareMailSwapIds_4Player[tableId][0]; playerSlot2 = sDaycareMailSwapIds_4Player[tableId][1]; diff --git a/src/roamer.c b/src/roamer.c index c17ec490c8..e9dc72a993 100644 --- a/src/roamer.c +++ b/src/roamer.c @@ -127,7 +127,7 @@ void UpdateLocationHistoryForRoamer(void) void RoamerMoveToOtherLocationSet(void) { u8 mapNum = 0; - + if (!ROAMER->active) return; @@ -170,8 +170,8 @@ void RoamerMove(void) // Choose a new map (excluding the first) within this set // Also exclude a map if the roamer was there 2 moves ago mapNum = sRoamerLocations[locSet][(Random() % (NUM_LOCATIONS_PER_SET - 1)) + 1]; - if (!(sLocationHistory[2][MAP_GRP] == ROAMER_MAP_GROUP - && sLocationHistory[2][MAP_NUM] == mapNum) + if (!(sLocationHistory[2][MAP_GRP] == ROAMER_MAP_GROUP + && sLocationHistory[2][MAP_NUM] == mapNum) && mapNum != MAP_NUM(UNDEFINED)) break; } diff --git a/src/rom_header.s b/src/rom_header.s index c5fa5ddf40..75edcebd87 100644 --- a/src/rom_header.s +++ b/src/rom_header.s @@ -1,5 +1,5 @@ @ Note: ROM header data is empty space here. -@ It's populated by gbafix using data provided in the Makefile. +@ It's populated by gbafix using data provided in the Makefile. .global Start Start: diff --git a/src/save.c b/src/save.c index e7c91580e5..765fb045c3 100644 --- a/src/save.c +++ b/src/save.c @@ -913,7 +913,7 @@ u16 GetSaveBlocksPointersBaseOffset(void) for (i = 0; i < NUM_SECTORS_PER_SLOT; i++) { ReadFlashSector(i + slotOffset, gReadWriteSector); - + // Base offset for SaveBlock2 is calculated using the trainer id if (gReadWriteSector->id == SECTOR_ID_SAVEBLOCK2) return sector->data[offsetof(struct SaveBlock2, playerTrainerId[0])] + diff --git a/src/script.c b/src/script.c index 484f8e9662..c252c95f04 100644 --- a/src/script.c +++ b/src/script.c @@ -213,9 +213,9 @@ void ScriptContext_Init(void) sGlobalScriptContextStatus = CONTEXT_SHUTDOWN; } -// Runs the script until the script makes a wait* call, then returns true if -// there's more script to run, or false if the script has hit the end. -// This function also returns false if the context is finished +// Runs the script until the script makes a wait* call, then returns true if +// there's more script to run, or false if the script has hit the end. +// This function also returns false if the context is finished // or waiting (after a call to _Stop) bool8 ScriptContext_RunScript(void) { diff --git a/src/slot_machine.c b/src/slot_machine.c index dd2622e2be..3b82afde19 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -1880,7 +1880,7 @@ static u8 TrySelectBias_Regular(void) { s16 rval = Random() & 0xff; s16 value = sBiasProbabilities_Regular[whichBias][sSlotMachine->machineId]; - + // Boost odds of BIAS_POWER if it's a lucky game. if (whichBias == 0 && sSlotMachine->luckyGame == TRUE) { @@ -3668,7 +3668,7 @@ static void ReelTime_CheckExplode(struct Task *task) if (sSlotMachine->reelTimeDraw) { if (sSlotMachine->reelTimeSpinsLeft <= task->tExplodeChecks) - task->tState++; // RT_TASK_LAND + task->tState++; // RT_TASK_LAND } else if (task->tExplodeChecks > 3) { @@ -5309,7 +5309,7 @@ static const u8 sSpecialDrawOdds[NUM_SLOT_MACHINE_IDS][MAX_BET] = { }; static const u8 sBiasProbabilities_Special[][NUM_SLOT_MACHINE_IDS] = { - { + { // Probabilities for BIAS_STRAIGHT_7 [SLOT_MACHINE_UNLUCKIEST] = 25, [SLOT_MACHINE_UNLUCKIER] = 25, @@ -5318,7 +5318,7 @@ static const u8 sBiasProbabilities_Special[][NUM_SLOT_MACHINE_IDS] = { [SLOT_MACHINE_LUCKIER] = 40, [SLOT_MACHINE_LUCKIEST] = 50 }, - { + { // Probabilities for BIAS_REELTIME [SLOT_MACHINE_UNLUCKIEST] = 25, [SLOT_MACHINE_UNLUCKIER] = 25, @@ -5327,7 +5327,7 @@ static const u8 sBiasProbabilities_Special[][NUM_SLOT_MACHINE_IDS] = { [SLOT_MACHINE_LUCKIER] = 35, [SLOT_MACHINE_LUCKIEST] = 35 }, - { + { // Probabilities for BIAS_MIXED_7 [SLOT_MACHINE_UNLUCKIEST] = 25, [SLOT_MACHINE_UNLUCKIER] = 25, @@ -5339,7 +5339,7 @@ static const u8 sBiasProbabilities_Special[][NUM_SLOT_MACHINE_IDS] = { }; static const u8 sBiasProbabilities_Regular[][NUM_SLOT_MACHINE_IDS] = { - { + { // Probabilities for BIAS_POWER [SLOT_MACHINE_UNLUCKIEST] = 20, [SLOT_MACHINE_UNLUCKIER] = 25, @@ -5348,7 +5348,7 @@ static const u8 sBiasProbabilities_Regular[][NUM_SLOT_MACHINE_IDS] = { [SLOT_MACHINE_LUCKIER] = 25, [SLOT_MACHINE_LUCKIEST] = 25 }, - { + { // Probabilities for BIAS_AZURILL [SLOT_MACHINE_UNLUCKIEST] = 12, [SLOT_MACHINE_UNLUCKIER] = 15, @@ -5357,7 +5357,7 @@ static const u8 sBiasProbabilities_Regular[][NUM_SLOT_MACHINE_IDS] = { [SLOT_MACHINE_LUCKIER] = 19, [SLOT_MACHINE_LUCKIEST] = 22 }, - { + { // Probabilities for BIAS_LOTAD [SLOT_MACHINE_UNLUCKIEST] = 25, [SLOT_MACHINE_UNLUCKIER] = 25, @@ -5366,7 +5366,7 @@ static const u8 sBiasProbabilities_Regular[][NUM_SLOT_MACHINE_IDS] = { [SLOT_MACHINE_LUCKIER] = 30, [SLOT_MACHINE_LUCKIEST] = 40 }, - { + { // Probabilities for BIAS_CHERRY [SLOT_MACHINE_UNLUCKIEST] = 25, [SLOT_MACHINE_UNLUCKIER] = 25, @@ -5375,7 +5375,7 @@ static const u8 sBiasProbabilities_Regular[][NUM_SLOT_MACHINE_IDS] = { [SLOT_MACHINE_LUCKIER] = 15, [SLOT_MACHINE_LUCKIEST] = 15 }, - { + { // Probabilities for BIAS_REPLAY [SLOT_MACHINE_UNLUCKIEST] = 40, [SLOT_MACHINE_UNLUCKIER] = 40, diff --git a/src/sound.c b/src/sound.c index aa6fb32ee7..15ebee8312 100644 --- a/src/sound.c +++ b/src/sound.c @@ -377,7 +377,7 @@ void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode) u8 table; species--; - + // Set default values // May be overridden depending on mode. length = 140; diff --git a/src/trade.c b/src/trade.c index e24051e041..ba18e8d32c 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2465,7 +2465,7 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf else { // Player's Pokémon must be of the type the partner requested - if (gBaseStats[playerSpecies2].type1 != requestedType + if (gBaseStats[playerSpecies2].type1 != requestedType && gBaseStats[playerSpecies2].type2 != requestedType) return UR_TRADE_MSG_NOT_MON_PARTNER_WANTS; } diff --git a/src/tv.c b/src/tv.c index 2f3d17ee28..0c394acf76 100644 --- a/src/tv.c +++ b/src/tv.c @@ -2058,7 +2058,7 @@ static void SecretBaseVisit_CalculatePartyData(TVShow *show) { sTV_SecretBaseVisitMonsTemp[numPokemon].level = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL); sTV_SecretBaseVisitMonsTemp[numPokemon].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES); - + // Check all the Pokémon's moves, then randomly select one to save numMoves = 0; move = GetMonData(&gPlayerParty[i], MON_DATA_MOVE1); @@ -2093,7 +2093,7 @@ static void SecretBaseVisit_CalculatePartyData(TVShow *show) for (i = 0, sum = 0; i < numPokemon; i++) sum += sTV_SecretBaseVisitMonsTemp[i].level; - // Using the data calculated above, save the data to talk about on the show + // Using the data calculated above, save the data to talk about on the show // (average level, and one randomly selected species / move) show->secretBaseVisit.avgLevel = sum / numPokemon; j = Random() % numPokemon; @@ -2643,7 +2643,7 @@ void DoPokeNews(void) // News event is upcoming, make comment about countdown to event u16 dayCountdown = gSaveBlock1Ptr->pokeNews[i].dayCountdown; ConvertIntToDecimalStringN(gStringVar1, dayCountdown, STR_CONV_MODE_LEFT_ALIGN, 1); - + // Mark as inactive so the countdown TV airing doesn't repeat // Will be flagged as "upcoming" again by UpdatePokeNewsCountdown gSaveBlock1Ptr->pokeNews[i].state = POKENEWS_STATE_INACTIVE; @@ -2848,7 +2848,7 @@ static bool8 IsRecordMixShowAlreadySpawned(u8 kind, bool8 delete) static void SortPurchasesByQuantity(void) { u8 i, j; - + for (i = 0; i < SMARTSHOPPER_NUM_ITEMS - 1; i++) { for (j = i + 1; j < SMARTSHOPPER_NUM_ITEMS; j++) diff --git a/src/union_room_player_avatar.c b/src/union_room_player_avatar.c index beff4440d0..86a0f1a44e 100644 --- a/src/union_room_player_avatar.c +++ b/src/union_room_player_avatar.c @@ -569,7 +569,7 @@ bool32 TryInteractWithUnionRoomMember(struct RfuPlayerList *list, s16 *memberIdP for (memberId = 0; memberId < MAX_RFU_PLAYERS; memberId++) { s32 id = UR_PLAYER_SPRITE_ID(i, memberId); - + // Is the player in front of a group member position? if (x != sUnionRoomPlayerCoords[i][0] + sUnionRoomGroupOffsets[memberId][0] + 7) continue; diff --git a/src/walda_phrase.c b/src/walda_phrase.c index 025f900e5a..e5556b53e3 100644 --- a/src/walda_phrase.c +++ b/src/walda_phrase.c @@ -174,7 +174,7 @@ static bool32 TryCalculateWallpaper(u16 *backgroundClr, u16 *foregroundClr, u8 * if (GetWallpaperDataBits(data, 0, 3) != GetWallpaperDataBits(charsByTableId, TO_BIT_OFFSET(WALDA_PHRASE_LENGTH - 1) + 2, 3)) return FALSE; - // Perform some relatively arbitrary changes to the wallpaper data using the last byte (KEY) + // Perform some relatively arbitrary changes to the wallpaper data using the last byte (KEY) RotateWallpaperDataLeft(data, NUM_WALLPAPER_DATA_BYTES, 21); RotateWallpaperDataLeft(data, NUM_WALLPAPER_DATA_BYTES - 1, KEY & 0xF); MaskWallpaperData(data, NUM_WALLPAPER_DATA_BYTES - 1, KEY >> 4); diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 4f9697753e..01161e6ccb 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -64,7 +64,7 @@ static const struct WildPokemon sWildFeebas = {20, 25, SPECIES_FEEBAS}; static const u16 sRoute119WaterTileData[] = { -//yMin, yMax, numSpots in previous sections +//yMin, yMax, numSpots in previous sections 0, 45, 0, 46, 91, NUM_FISHING_SPOTS_1, 92, 139, NUM_FISHING_SPOTS_1 + NUM_FISHING_SPOTS_2, @@ -142,7 +142,7 @@ static bool8 CheckFeebas(void) feebasSpots[i] = FeebasRandom() % NUM_FISHING_SPOTS; if (feebasSpots[i] == 0) feebasSpots[i] = NUM_FISHING_SPOTS; - + // < 1 below is a pointless check, it will never be TRUE. // >= 4 to skip fishing spots 1-3, because these are inaccessible // spots at the top of the map, at (9,7), (7,13), and (15,16). diff --git a/src/wonder_news.c b/src/wonder_news.c index ec93d293ed..e083575d95 100644 --- a/src/wonder_news.c +++ b/src/wonder_news.c @@ -76,7 +76,7 @@ u16 RetrieveWonderNewsVal(void) struct WonderNewsMetadata *data = GetSavedWonderNewsMetadata(); u16 newsVal; - // Checks if Mystery Event is enabled, not Mystery Gift? + // Checks if Mystery Event is enabled, not Mystery Gift? if (!IsMysteryEventEnabled() || !ValidateSavedWonderNews()) return 0; diff --git a/sym_common.txt b/sym_common.txt index 407b183a7f..7eebcac74e 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -53,9 +53,9 @@ gReservedSpritePaletteCount: .include "tv.o" .include "mauville_old_man.o" .include "image_processing_effects.o" - + .space 0x4 - + .include "contest_painting.o" .include "field_specials.o" .include "evolution_scene.o" @@ -66,12 +66,12 @@ gReservedSpritePaletteCount: .include "battle_anim_throw.o" .include "battle_factory_screen.o" .include "apprentice.o" - + .space 0x8 - + .include "list_menu.o" .include "party_menu.o" - + .space 0x44 .include "ereader_screen.o" From e624f205ba26a05ba93c98df57a3a1f07fd6febe Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 11 Sep 2022 21:46:40 -0300 Subject: [PATCH 126/155] Added CompareStat checks for the hero duo's abilities --- src/battle_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 4b18fafb60..f20c4c5040 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4744,7 +4744,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_INTREPID_SWORD: - if (!gSpecialStatuses[battler].switchInAbilityDone) + if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_ATK, 1, FALSE); @@ -4753,7 +4753,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_DAUNTLESS_SHIELD: - if (!gSpecialStatuses[battler].switchInAbilityDone) + if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_DEF, 1, FALSE); From 717d06bd17d1f8e252273600d9a4bf853b8ddcec Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 11 Sep 2022 21:57:42 -0300 Subject: [PATCH 127/155] Fixed the hero duo's abilities in doubles --- src/battle_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/battle_util.c b/src/battle_util.c index f20c4c5040..64c2e75570 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4746,6 +4746,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_INTREPID_SWORD: if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) { + gBattlerAttacker = battler; gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_ATK, 1, FALSE); BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); @@ -4755,6 +4756,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_DAUNTLESS_SHIELD: if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)) { + gBattlerAttacker = battler; gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_DEF, 1, FALSE); BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); From fc65a483aa1f407d86dbf990bd48f9ac5a95fd19 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 11 Sep 2022 22:34:24 -0300 Subject: [PATCH 128/155] Fixed ability pop ups --- src/battle_interface.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index 5be969105f..ebd7a3ab37 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -3123,9 +3123,6 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle) const s16 (*coords)[2]; u8 spriteId1, spriteId2, battlerPosition, taskId; - - return; - if (gBattleScripting.abilityPopupOverwrite != 0) ability = gBattleScripting.abilityPopupOverwrite; From 806106b537cc84f45c6ca97b5253cd7a8a9a77e3 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 12 Sep 2022 12:12:26 +0200 Subject: [PATCH 129/155] removed flickering in debug menu @Jaizu --- src/debug.c | 61 +++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/src/debug.c b/src/debug.c index 4cc1ac6168..ac5c238313 100644 --- a/src/debug.c +++ b/src/debug.c @@ -175,6 +175,7 @@ struct DebugMonData static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate); void Debug_ShowMainMenu(void); static void Debug_DestroyMenu(u8); +static void Debug_DestroyMenu_Full(u8); static void DebugAction_Cancel(u8); static void DebugAction_DestroyExtraWindow(u8 taskId); @@ -697,6 +698,12 @@ static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMte gTasks[inputTaskId].data[1] = windowId; } static void Debug_DestroyMenu(u8 taskId) +{ + DestroyListMenuTask(gTasks[taskId].data[0], NULL, NULL); + RemoveWindow(gTasks[taskId].data[1]); + DestroyTask(taskId); +} +static void Debug_DestroyMenu_Full(u8 taskId) { DestroyListMenuTask(gTasks[taskId].data[0], NULL, NULL); ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); @@ -705,7 +712,7 @@ static void Debug_DestroyMenu(u8 taskId) } static void DebugAction_Cancel(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } static void DebugAction_DestroyExtraWindow(u8 taskId) @@ -737,7 +744,7 @@ static void DebugTask_HandleMenuInput_Main(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } } @@ -891,7 +898,7 @@ static void DebugAction_Util_HealParty(u8 taskId) PlaySE(SE_USE_ITEM); HealPlayerParty(); ScriptContext_Enable(); - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); } static void DebugAction_Util_Fly(u8 taskId) { @@ -913,7 +920,7 @@ static void DebugAction_Util_Fly(u8 taskId) FlagSet(FLAG_VISITED_EVER_GRANDE_CITY); FlagSet(FLAG_LANDMARK_POKEMON_LEAGUE); FlagSet(FLAG_LANDMARK_BATTLE_FRONTIER); - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); SetMainCallback2(CB2_OpenFlyMap); } @@ -1141,26 +1148,26 @@ static void DebugAction_Util_CheckSaveBlock(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, sizeof(struct PokemonStorage), STR_CONV_MODE_LEFT_ALIGN, 6); StringExpandPlaceholders(gStringVar4, gDebugText_SaveBlockSize); - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_ShowFieldMessageStringVar4); } static void DebugAction_Util_CheckWallClock(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(PlayersHouse_2F_EventScript_CheckWallClock); } static void DebugAction_Util_SetWallClock(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(PlayersHouse_2F_EventScript_SetWallClock); } static void DebugAction_Util_WatchCredits(u8 taskId) { struct Task* task = &gTasks[taskId]; - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); SetMainCallback2(CB2_StartCreditsSequence); } static void DebugAction_Util_Trainer_Name(u8 taskId) @@ -1174,14 +1181,14 @@ static void DebugAction_Util_Trainer_Gender(u8 taskId) gSaveBlock2Ptr->playerGender = 1; else gSaveBlock2Ptr->playerGender = 0; + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); - Debug_DestroyMenu(taskId); } static void DebugAction_Util_Trainer_Id(u8 taskId) { u32 trainerId = ((Random() << 16) | Random()); SetTrainerId(trainerId, gSaveBlock2Ptr->playerTrainerId); - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } @@ -1189,49 +1196,49 @@ static void DebugAction_Util_Trainer_Id(u8 taskId) // Actions Scripts static void DebugAction_Util_Script_1(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_1); } static void DebugAction_Util_Script_2(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_2); } static void DebugAction_Util_Script_3(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_3); } static void DebugAction_Util_Script_4(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_4); } static void DebugAction_Util_Script_5(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_5); } static void DebugAction_Util_Script_6(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_6); } static void DebugAction_Util_Script_7(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_7); } static void DebugAction_Util_Script_8(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_8); } @@ -1338,7 +1345,7 @@ static void DebugAction_Flags_SetPokedexFlags(u8 taskId) GetSetPokedexFlag(i + 1, FLAG_SET_CAUGHT); GetSetPokedexFlag(i + 1, FLAG_SET_SEEN); } - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } static void DebugAction_Flags_SwitchDex(u8 taskId) @@ -1426,7 +1433,7 @@ static void DebugAction_Flags_ToggleFrontierPass(u8 taskId) static void DebugAction_Flags_CollisionOnOff(u8 taskId) { #if DEBUG_FLAG_NO_COLLISION == 0 - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else @@ -1440,7 +1447,7 @@ static void DebugAction_Flags_CollisionOnOff(u8 taskId) static void DebugAction_Flags_EncounterOnOff(u8 taskId) { #if OW_FLAG_NO_ENCOUNTER == 0 - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else @@ -1454,7 +1461,7 @@ static void DebugAction_Flags_EncounterOnOff(u8 taskId) static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) { #if OW_FLAG_NO_TRAINER_SEE == 0 - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else @@ -1468,7 +1475,7 @@ static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) static void DebugAction_Flags_BagUseOnOff(u8 taskId) { #if B_FLAG_NO_BAG_USE == 0 - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else @@ -1482,7 +1489,7 @@ static void DebugAction_Flags_BagUseOnOff(u8 taskId) static void DebugAction_Flags_CatchingOnOff(u8 taskId) { #if B_FLAG_NO_CATCHING_USE == 0 - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else @@ -1841,7 +1848,7 @@ static void DebugAction_Give_AllTMs(u8 taskId) if (ItemIdToBattleMoveId(i) != MOVE_NONE && !CheckBagHasItem(i, 1)) AddBagItem(i, 1); } - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } @@ -2656,7 +2663,7 @@ static void DebugAction_Give_FillPC(u8 taskId) //Credit: Sierraffinity static void DebugAction_Give_CHEAT(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_CheatStart); } @@ -2673,7 +2680,7 @@ static void Task_WaitFadeAccessPC(u8 taskId) static void DebugAction_AccessPC(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); CleanupOverworldWindowsAndTilemaps(); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); CreateTask(Task_WaitFadeAccessPC, 0); From 5eb931225082972b013964c1a160989b7d69bd69 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 12 Sep 2022 21:14:15 -0300 Subject: [PATCH 130/155] Added missing labels in headers --- gflib/text.h | 1 - include/event_object_movement.h | 99 ++++++++++++++++----------------- include/field_effect.h | 2 +- include/field_player_avatar.h | 2 +- include/link.h | 2 +- include/menu.h | 2 +- include/palette.h | 22 ++++---- 7 files changed, 64 insertions(+), 66 deletions(-) diff --git a/gflib/text.h b/gflib/text.h index c07817290d..a88cb990e1 100644 --- a/gflib/text.h +++ b/gflib/text.h @@ -148,7 +148,6 @@ void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); void DecompressGlyphTile(const void *src_, void *dest_); void CopyGlyphToWindow(struct TextPrinter *x); void ClearTextSpan(struct TextPrinter *textPrinter, u32 width); -u8 GetMenuCursorDimensionByFont(u8, u8); void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter); void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter); diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 22cef49219..aad161553c 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -77,55 +77,55 @@ extern const struct SpriteFrameImage *const gBerryTreePicTablePointers[]; extern const u8 *const gBerryTreePaletteSlotTablePointers[]; void ResetObjectEvents(void); -u8 GetMoveDirectionAnimNum(u8); -u8 GetObjectEventIdByLocalIdAndMap(u8, u8, u8); -bool8 TryGetObjectEventIdByLocalIdAndMap(u8, u8, u8, u8 *); -u8 GetObjectEventIdByXY(s16, s16); -void SetObjectEventDirection(struct ObjectEvent *, u8); +u8 GetMoveDirectionAnimNum(u8 direction); +u8 GetObjectEventIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroupId); +bool8 TryGetObjectEventIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroupId, u8 *objectEventId); +u8 GetObjectEventIdByXY(s16 x, s16 y); +void SetObjectEventDirection(struct ObjectEvent *objectEvent, u8 direction); u8 GetFirstInactiveObjectEventId(void); -void RemoveObjectEventByLocalIdAndMap(u8, u8, u8); -void LoadPlayerObjectReflectionPalette(u16, u8); -void LoadSpecialObjectReflectionPalette(u16, u8); -void TryMoveObjectEventToMapCoords(u8, u8, u8, s16, s16); -void PatchObjectPalette(u16, u8); -void SpawnObjectEventsOnReturnToField(s16, s16); +void RemoveObjectEventByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup); +void LoadPlayerObjectReflectionPalette(u16 tag, u8 slot); +void LoadSpecialObjectReflectionPalette(u16 tag, u8 slot); +void TryMoveObjectEventToMapCoords(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); +void PatchObjectPalette(u16 paletteTag, u8 paletteSlot); +void SpawnObjectEventsOnReturnToField(s16 x, s16 y); void OverrideSecretBaseDecorationSpriteScript(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat); -void GetMapCoordsFromSpritePos(s16, s16, s16 *, s16 *); -u8 GetFaceDirectionAnimNum(u8); -void SetSpritePosToOffsetMapCoords(s16 *, s16 *, s16, s16); +void GetMapCoordsFromSpritePos(s16 x, s16 y, s16 *destX, s16 *destY); +u8 GetFaceDirectionAnimNum(u8 direction); +void SetSpritePosToOffsetMapCoords(s16 *x, s16 *y, s16 dx, s16 dy); void ObjectEventClearHeldMovement(struct ObjectEvent *); void ObjectEventClearHeldMovementIfActive(struct ObjectEvent *); -void TrySpawnObjectEvents(s16, s16); +void TrySpawnObjectEvents(s16 cameraX, s16 cameraY); u8 CreateObjectGraphicsSprite(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority); -u8 TrySpawnObjectEvent(u8, u8, u8); +u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup); u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 elevation); u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *); -void SetSpritePosToMapCoords(s16, s16, s16 *, s16 *); +void SetSpritePosToMapCoords(s16 mapX, s16 mapY, s16 *destX, s16 *destY); void CameraObjectReset1(void); void ObjectEventSetGraphicsId(struct ObjectEvent *, u8 graphicsId); -void ObjectEventTurn(struct ObjectEvent *, u8); -void ObjectEventTurnByLocalIdAndMap(u8, u8, u8, u8); +void ObjectEventTurn(struct ObjectEvent *, u8 direction); +void ObjectEventTurnByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, u8 direction); const struct ObjectEventGraphicsInfo *GetObjectEventGraphicsInfo(u8 graphicsId); -void SetObjectInvisibility(u8, u8, u8, bool8); +void SetObjectInvisibility(u8 localId, u8 mapNum, u8 mapGroup, bool8 invisible); void FreeAndReserveObjectSpritePalettes(void); void SetObjectEventSpritePosByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); -void ResetObjectSubpriority(u8, u8, u8); -void SetObjectSubpriority(u8, u8, u8, u8); -void AllowObjectAtPosTriggerGroundEffects(s16, s16); +void ResetObjectSubpriority(u8 localId, u8 mapNum, u8 mapGroup); +void SetObjectSubpriority(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority); +void AllowObjectAtPosTriggerGroundEffects(s16 x, s16 y); void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup); -void ShiftObjectEventCoords(struct ObjectEvent *, s16, s16); -void MoveObjectEventToMapCoords(struct ObjectEvent *, s16, s16); -void TryOverrideObjectEventTemplateCoords(u8, u8, u8); +void ShiftObjectEventCoords(struct ObjectEvent *, s16 x, s16 y); +void MoveObjectEventToMapCoords(struct ObjectEvent *, s16 x, s16 y); +void TryOverrideObjectEventTemplateCoords(u8 localId, u8 mapNum, u8 mapGroup); void InitObjectEventPalettes(u8 palSlot); void UpdateObjectEventCurrentMovement(struct ObjectEvent *, struct Sprite *, bool8(struct ObjectEvent *, struct Sprite *)); -u8 ObjectEventFaceOppositeDirection(struct ObjectEvent *, u8); -u8 GetOppositeDirection(u8); +u8 ObjectEventFaceOppositeDirection(struct ObjectEvent *, u8 direction); +u8 GetOppositeDirection(u8 direction); u8 GetWalkInPlaceFasterMovementAction(u32); u8 GetWalkInPlaceFastMovementAction(u32); u8 GetWalkInPlaceNormalMovementAction(u32); u8 GetWalkInPlaceSlowMovementAction(u32); -u8 GetCollisionAtCoords(struct ObjectEvent *, s16, s16, u32); -void MoveCoords(u8, s16 *, s16 *); +u8 GetCollisionAtCoords(struct ObjectEvent *, s16 x, s16 y, u32 dir); +void MoveCoords(u8 direction, s16 *x, s16 *y); bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *); u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *); u8 GetObjectEventIdByPosition(u16 x, u16 y, u8 elevation); @@ -168,22 +168,22 @@ u8 AddCameraObject(u8 linkedSpriteId); void UpdateObjectEventsForCameraUpdate(s16 x, s16 y); u8 GetWalkSlowMovementAction(u32); u8 GetJumpMovementAction(u32); -u8 ElevationToPriority(u8); +u8 ElevationToPriority(u8 elevation); void ObjectEventUpdateElevation(struct ObjectEvent *objEvent); -void SetObjectSubpriorityByElevation(u8, struct Sprite *, u8); +void SetObjectSubpriorityByElevation(u8 elevation, struct Sprite *, u8 subpriority); void UnfreezeObjectEvent(struct ObjectEvent *); u8 FindLockedObjectEventIndex(struct ObjectEvent *); -void SetAndStartSpriteAnim(struct Sprite *, u8, u8); +void SetAndStartSpriteAnim(struct Sprite *, u8 animNum, u8 animCmdIndex); bool8 SpriteAnimEnded(struct Sprite *); void UnfreezeObjectEvents(void); void FreezeObjectEventsExceptOne(u8 objectEventId); void FreezeObjectEventsExceptTwo(u8 objectEventId1, u8 objectEventId2); void FreezeObjectEvents(void); bool8 FreezeObjectEvent(struct ObjectEvent *objectEvent); -u8 GetMoveDirectionFastAnimNum(u8); -u8 GetMoveDirectionFasterAnimNum(u8); -u8 GetMoveDirectionFastestAnimNum(u8); -u8 GetLedgeJumpDirection(s16, s16, u8); +u8 GetMoveDirectionFastAnimNum(u8 direction); +u8 GetMoveDirectionFasterAnimNum(u8 direction); +u8 GetMoveDirectionFastestAnimNum(u8 direction); +u8 GetLedgeJumpDirection(s16 x, s16 y, u8 direction); void CameraObjectSetFollowedSpriteId(u8 objectId); u16 GetObjectPaletteTag(u8 palSlot); void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible); @@ -192,7 +192,7 @@ s16 GetFigure8YOffset(s16 idx); void CameraObjectReset2(void); u8 GetObjectEventBerryTreeId(u8 objectEventId); void SetBerryTreeJustPicked(u8 mapId, u8 mapNumber, u8 mapGroup); -bool8 IsBerryTreeSparkling(u8, u8, u8); +bool8 IsBerryTreeSparkling(u8 localId, u8 mapNum, u8 mapGroup); void MovementType_None(struct Sprite *); void MovementType_LookAround(struct Sprite *); @@ -250,7 +250,6 @@ void MovementType_RunInPlace(struct Sprite *); void MovementType_Invisible(struct Sprite *); void MovementType_WalkSlowlyInPlace(struct Sprite *); u8 GetSlideMovementAction(u32); -u8 GetJumpInPlaceMovementAction(u32); u8 GetJumpMovementAction(u32); u8 GetJump2MovementAction(u32); u8 CreateCopySpriteAt(struct Sprite *sprite, s16 x, s16 y, u8 subpriority); @@ -262,17 +261,17 @@ u8 MovementType_WanderAround_Step3(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step4(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step5(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step6(struct ObjectEvent *, struct Sprite *); -u8 GetVectorDirection(s16, s16, s16, s16); -u8 GetLimitedVectorDirection_SouthNorth(s16, s16, s16, s16); -u8 GetLimitedVectorDirection_WestEast(s16, s16, s16, s16); -u8 GetLimitedVectorDirection_WestNorth(s16, s16, s16, s16); -u8 GetLimitedVectorDirection_EastNorth(s16, s16, s16, s16); -u8 GetLimitedVectorDirection_WestSouth(s16, s16, s16, s16); -u8 GetLimitedVectorDirection_EastSouth(s16, s16, s16, s16); -u8 GetLimitedVectorDirection_SouthNorthWest(s16, s16, s16, s16); -u8 GetLimitedVectorDirection_SouthNorthEast(s16, s16, s16, s16); -u8 GetLimitedVectorDirection_NorthWestEast(s16, s16, s16, s16); -u8 GetLimitedVectorDirection_SouthWestEast(s16, s16, s16, s16); +u8 GetVectorDirection(s16 dx, s16 dy, s16 absdx, s16 absdy); +u8 GetLimitedVectorDirection_SouthNorth(s16 dx, s16 dy, s16 absdx, s16 absdy); +u8 GetLimitedVectorDirection_WestEast(s16 dx, s16 dy, s16 absdx, s16 absdy); +u8 GetLimitedVectorDirection_WestNorth(s16 dx, s16 dy, s16 absdx, s16 absdy); +u8 GetLimitedVectorDirection_EastNorth(s16 dx, s16 dy, s16 absdx, s16 absdy); +u8 GetLimitedVectorDirection_WestSouth(s16 dx, s16 dy, s16 absdx, s16 absdy); +u8 GetLimitedVectorDirection_EastSouth(s16 dx, s16 dy, s16 absdx, s16 absdy); +u8 GetLimitedVectorDirection_SouthNorthWest(s16 dx, s16 dy, s16 absdx, s16 absdy); +u8 GetLimitedVectorDirection_SouthNorthEast(s16 dx, s16 dy, s16 absdx, s16 absdy); +u8 GetLimitedVectorDirection_NorthWestEast(s16 dx, s16 dy, s16 absdx, s16 absdy); +u8 GetLimitedVectorDirection_SouthWestEast(s16 dx, s16 dy, s16 absdx, s16 absdy); u8 MovementType_LookAround_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_LookAround_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_LookAround_Step2(struct ObjectEvent *, struct Sprite *); diff --git a/include/field_effect.h b/include/field_effect.h index b35a8c8694..4cde29e8a3 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -18,7 +18,7 @@ void FieldEffectStop(struct Sprite *sprite, u8 id); u8 CreateTrainerSprite(u8 trainerSpriteID, s16 x, s16 y, u8 subpriority, u8 *buffer); void FldEff_TeleportWarpOut(void); void FieldEffectActiveListRemove(u8 id); -void MultiplyInvertedPaletteRGBComponents(u16, u8, u8, u8); +void MultiplyInvertedPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b); void FieldEffectActiveListAdd(u8 id); void FieldEffectScript_LoadTiles(u8 **script); void FieldEffectScript_LoadFadedPalette(u8 **script); diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 2bf2df2697..39fc886af8 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -38,7 +38,7 @@ void PlayerFreeze(void); void StopPlayerAvatar(void); void SetSpinStartFacingDir(u8); void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); -u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8); +u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8 state, u8 gender); void SetPlayerAvatarFieldMove(void); u8 GetPlayerAvatarGraphicsIdByCurrentState(void); void SetPlayerAvatarStateMask(u8 flags); diff --git a/include/link.h b/include/link.h index 120c25784e..7fa5e3fae6 100644 --- a/include/link.h +++ b/include/link.h @@ -284,7 +284,7 @@ void SerialCB(void); bool32 InUnionRoom(void); void LoadWirelessStatusIndicatorSpriteGfx(void); bool8 IsLinkTaskFinished(void); -void CreateWirelessStatusIndicatorSprite(u8, u8); +void CreateWirelessStatusIndicatorSprite(u8 x, u8 y); void SetLinkStandbyCallback(void); void SetWirelessCommType1(void); void CheckShouldAdvanceLinkState(void); diff --git a/include/menu.h b/include/menu.h index 43b564da28..0b0a42423d 100644 --- a/include/menu.h +++ b/include/menu.h @@ -92,7 +92,7 @@ void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos); u8 ChangeMenuGridCursorPosition(s8 deltaX, s8 deltaY); u8 GetStartMenuWindowId(void); -void ListMenuLoadStdPalAt(u8, u8); +void ListMenuLoadStdPalAt(u8 palOffset, u8 palId); u8 Menu_MoveCursor(s8 cursorDelta); u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta); void DrawStdWindowFrame(u8 windowId, bool8 CopyToVram); diff --git a/include/palette.h b/include/palette.h index 81a1e1caec..736fde96bb 100644 --- a/include/palette.h +++ b/include/palette.h @@ -52,22 +52,22 @@ extern u8 gPaletteDecompressionBuffer[]; extern u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE]; extern u16 gPlttBufferFaded[PLTT_BUFFER_SIZE]; -void LoadCompressedPalette(const u32 *, u16, u16); -void LoadPalette(const void *, u16, u16); -void FillPalette(u16, u16, u16); +void LoadCompressedPalette(const u32 *src, u16 offset, u16 size); +void LoadPalette(const void *src, u16 offset, u16 size); +void FillPalette(u16 value, u16 offset, u16 size); void TransferPlttBuffer(void); u8 UpdatePaletteFade(void); void ResetPaletteFade(void); -bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16); -void PaletteStruct_ResetById(u16); +bool8 BeginNormalPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 targetY, u16 blendColor); +void PaletteStruct_ResetById(u16 id); void ResetPaletteFadeControl(void); -void InvertPlttBuffer(u32); -void TintPlttBuffer(u32, s8, s8, s8); -void UnfadePlttBuffer(u32); -void BeginFastPaletteFade(u8); -void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); +void InvertPlttBuffer(u32 selectedPalettes); +void TintPlttBuffer(u32 selectedPalettes, s8 r, s8 g, s8 b); +void UnfadePlttBuffer(u32 selectedPalettes); +void BeginFastPaletteFade(u8 submode); +void BeginHardwarePaletteFade(u8 blendCnt, u8 delay, u8 y, u8 targetY, u8 shouldResetBlendRegisters); void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color); -void BlendPalettesUnfaded(u32, u8, u16); +void BlendPalettesUnfaded(u32 selectedPalettes, u8 coeff, u16 color); void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id); void TintPalette_GrayScale(u16 *palette, u16 count); void TintPalette_GrayScale2(u16 *palette, u16 count); From 222362e8045e653115cf4e4759c1a25732cea899 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Mon, 12 Sep 2022 21:26:22 -0300 Subject: [PATCH 131/155] Fixed Raquaza typo --- data/maps/SkyPillar_Top/map.json | 2 +- data/maps/SkyPillar_Top/scripts.inc | 2 +- include/constants/vars.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/maps/SkyPillar_Top/map.json b/data/maps/SkyPillar_Top/map.json index a980c6b07b..2fee121065 100644 --- a/data/maps/SkyPillar_Top/map.json +++ b/data/maps/SkyPillar_Top/map.json @@ -56,7 +56,7 @@ "x": 14, "y": 9, "elevation": 3, - "var": "VAR_SKY_PILLAR_RAQUAZA_CRY_DONE", + "var": "VAR_SKY_PILLAR_RAYQUAZA_CRY_DONE", "var_value": "0", "script": "SkyPillar_Top_EventScript_AwakenRayquaza" } diff --git a/data/maps/SkyPillar_Top/scripts.inc b/data/maps/SkyPillar_Top/scripts.inc index 7b65d9e257..19cd7e4f42 100644 --- a/data/maps/SkyPillar_Top/scripts.inc +++ b/data/maps/SkyPillar_Top/scripts.inc @@ -128,7 +128,7 @@ SkyPillar_Top_EventScript_AwakenRayquaza:: special RemoveCameraObject setvar VAR_SOOTOPOLIS_CITY_STATE, 5 setvar VAR_SKY_PILLAR_STATE, 1 - setvar VAR_SKY_PILLAR_RAQUAZA_CRY_DONE, 1 + setvar VAR_SKY_PILLAR_RAYQUAZA_CRY_DONE, 1 releaseall end diff --git a/include/constants/vars.h b/include/constants/vars.h index 8128b6f321..dbcb658ff5 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -231,7 +231,7 @@ #define VAR_SS_TIDAL_SCOTT_STATE 0x40D4 // Always equal to FLAG_MET_SCOTT_ON_SS_TIDAL #define VAR_ROAMER_POKEMON 0x40D5 // 0 = Latias, 1 = Latios #define VAR_TRAINER_HILL_IS_ACTIVE 0x40D6 -#define VAR_SKY_PILLAR_RAQUAZA_CRY_DONE 0x40D7 +#define VAR_SKY_PILLAR_RAYQUAZA_CRY_DONE 0x40D7 #define VAR_SOOTOPOLIS_WALLACE_STATE 0x40D8 #define VAR_HAS_TALKED_TO_SEAFLOOR_CAVERN_ENTRANCE_GRUNT 0x40D9 #define VAR_REGISTER_BIRCH_STATE 0x40DA From cb83a0920318b2e98782a9a10a098b8441a99913 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Mon, 12 Sep 2022 21:27:53 -0300 Subject: [PATCH 132/155] Fixed vars alignment --- include/constants/vars.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/vars.h b/include/constants/vars.h index dbcb658ff5..019585d66d 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -231,7 +231,7 @@ #define VAR_SS_TIDAL_SCOTT_STATE 0x40D4 // Always equal to FLAG_MET_SCOTT_ON_SS_TIDAL #define VAR_ROAMER_POKEMON 0x40D5 // 0 = Latias, 1 = Latios #define VAR_TRAINER_HILL_IS_ACTIVE 0x40D6 -#define VAR_SKY_PILLAR_RAYQUAZA_CRY_DONE 0x40D7 +#define VAR_SKY_PILLAR_RAYQUAZA_CRY_DONE 0x40D7 #define VAR_SOOTOPOLIS_WALLACE_STATE 0x40D8 #define VAR_HAS_TALKED_TO_SEAFLOOR_CAVERN_ENTRANCE_GRUNT 0x40D9 #define VAR_REGISTER_BIRCH_STATE 0x40DA From 14c6d8b91a49d214d3da2bba2b90e4cb9d811587 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Mon, 12 Sep 2022 21:32:42 -0300 Subject: [PATCH 133/155] Fixed alignment for the value of vars 0x4020 to 0x40FF --- include/constants/vars.h | 450 +++++++++++++++++++-------------------- 1 file changed, 225 insertions(+), 225 deletions(-) diff --git a/include/constants/vars.h b/include/constants/vars.h index 019585d66d..bd988c789b 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -46,235 +46,235 @@ #define VAR_OBJ_GFX_ID_F 0x401F // general purpose vars -#define VAR_RECYCLE_GOODS 0x4020 -#define VAR_REPEL_STEP_COUNT 0x4021 -#define VAR_ICE_STEP_COUNT 0x4022 -#define VAR_STARTER_MON 0x4023 // 0=Treecko, 1=Torchic, 2=Mudkip -#define VAR_MIRAGE_RND_H 0x4024 -#define VAR_MIRAGE_RND_L 0x4025 -#define VAR_SECRET_BASE_MAP 0x4026 -#define VAR_CYCLING_ROAD_RECORD_COLLISIONS 0x4027 -#define VAR_CYCLING_ROAD_RECORD_TIME_L 0x4028 -#define VAR_CYCLING_ROAD_RECORD_TIME_H 0x4029 -#define VAR_FRIENDSHIP_STEP_COUNTER 0x402A -#define VAR_POISON_STEP_COUNTER 0x402B -#define VAR_RESET_RTC_ENABLE 0x402C -#define VAR_ENIGMA_BERRY_AVAILABLE 0x402D -#define VAR_WONDER_NEWS_COUNTER 0x402E +#define VAR_RECYCLE_GOODS 0x4020 +#define VAR_REPEL_STEP_COUNT 0x4021 +#define VAR_ICE_STEP_COUNT 0x4022 +#define VAR_STARTER_MON 0x4023 // 0=Treecko, 1=Torchic, 2=Mudkip +#define VAR_MIRAGE_RND_H 0x4024 +#define VAR_MIRAGE_RND_L 0x4025 +#define VAR_SECRET_BASE_MAP 0x4026 +#define VAR_CYCLING_ROAD_RECORD_COLLISIONS 0x4027 +#define VAR_CYCLING_ROAD_RECORD_TIME_L 0x4028 +#define VAR_CYCLING_ROAD_RECORD_TIME_H 0x4029 +#define VAR_FRIENDSHIP_STEP_COUNTER 0x402A +#define VAR_POISON_STEP_COUNTER 0x402B +#define VAR_RESET_RTC_ENABLE 0x402C +#define VAR_ENIGMA_BERRY_AVAILABLE 0x402D +#define VAR_WONDER_NEWS_COUNTER 0x402E -#define VAR_FRONTIER_MANIAC_FACILITY 0x402F -#define VAR_FRONTIER_GAMBLER_CHALLENGE 0x4030 -#define VAR_FRONTIER_GAMBLER_SET_CHALLENGE 0x4031 -#define VAR_FRONTIER_GAMBLER_AMOUNT_BET 0x4032 -#define VAR_FRONTIER_GAMBLER_STATE 0x4033 +#define VAR_FRONTIER_MANIAC_FACILITY 0x402F +#define VAR_FRONTIER_GAMBLER_CHALLENGE 0x4030 +#define VAR_FRONTIER_GAMBLER_SET_CHALLENGE 0x4031 +#define VAR_FRONTIER_GAMBLER_AMOUNT_BET 0x4032 +#define VAR_FRONTIER_GAMBLER_STATE 0x4033 -#define VAR_DEOXYS_ROCK_STEP_COUNT 0x4034 -#define VAR_DEOXYS_ROCK_LEVEL 0x4035 -#define VAR_PC_BOX_TO_SEND_MON 0x4036 -#define VAR_ABNORMAL_WEATHER_LOCATION 0x4037 -#define VAR_ABNORMAL_WEATHER_STEP_COUNTER 0x4038 -#define VAR_SHOULD_END_ABNORMAL_WEATHER 0x4039 -#define VAR_FARAWAY_ISLAND_STEP_COUNTER 0x403A -#define VAR_REGICE_STEPS_1 0x403B -#define VAR_REGICE_STEPS_2 0x403C -#define VAR_REGICE_STEPS_3 0x403D -#define VAR_ALTERING_CAVE_WILD_SET 0x403E -#define VAR_DISTRIBUTE_EON_TICKET 0x403F // This var is read and written, but is always zero. The only way to obtain the Eon Ticket in Emerald is via Record Mixing -#define VAR_DAYS 0x4040 -#define VAR_FANCLUB_FAN_COUNTER 0x4041 -#define VAR_FANCLUB_LOSE_FAN_TIMER 0x4042 -#define VAR_DEPT_STORE_FLOOR 0x4043 -#define VAR_TRICK_HOUSE_LEVEL 0x4044 -#define VAR_POKELOT_PRIZE_ITEM 0x4045 -#define VAR_NATIONAL_DEX 0x4046 -#define VAR_SEEDOT_SIZE_RECORD 0x4047 -#define VAR_ASH_GATHER_COUNT 0x4048 -#define VAR_BIRCH_STATE 0x4049 -#define VAR_CRUISE_STEP_COUNT 0x404A -#define VAR_POKELOT_RND1 0x404B -#define VAR_POKELOT_RND2 0x404C -#define VAR_POKELOT_PRIZE_PLACE 0x404D -#define VAR_UNUSED_0x404E 0x404E // Unused Var -#define VAR_LOTAD_SIZE_RECORD 0x404F -#define VAR_LITTLEROOT_TOWN_STATE 0x4050 -#define VAR_OLDALE_TOWN_STATE 0x4051 -#define VAR_DEWFORD_TOWN_STATE 0x4052 // Unused Var -#define VAR_LAVARIDGE_TOWN_STATE 0x4053 -#define VAR_CURRENT_SECRET_BASE 0x4054 // was probably allocated for VAR_FALLARBOR_TOWN_STATE at one point -#define VAR_VERDANTURF_TOWN_STATE 0x4055 // Unused Var -#define VAR_PACIFIDLOG_TOWN_STATE 0x4056 // Unused Var -#define VAR_PETALBURG_CITY_STATE 0x4057 -#define VAR_SLATEPORT_CITY_STATE 0x4058 -#define VAR_MAUVILLE_CITY_STATE 0x4059 // Unused Var -#define VAR_RUSTBORO_CITY_STATE 0x405A -#define VAR_FORTREE_CITY_STATE 0x405B // Unused Var -#define VAR_LILYCOVE_CITY_STATE 0x405C // Unused Var -#define VAR_MOSSDEEP_CITY_STATE 0x405D -#define VAR_SOOTOPOLIS_CITY_STATE 0x405E -#define VAR_EVER_GRANDE_CITY_STATE 0x405F // Unused Var -#define VAR_ROUTE101_STATE 0x4060 -#define VAR_ROUTE102_STATE 0x4061 // Unused Var -#define VAR_ROUTE103_STATE 0x4062 // Unused Var -#define VAR_ROUTE104_STATE 0x4063 -#define VAR_ROUTE105_STATE 0x4064 // Unused Var -#define VAR_ROUTE106_STATE 0x4065 // Unused Var -#define VAR_ROUTE107_STATE 0x4066 // Unused Var -#define VAR_ROUTE108_STATE 0x4067 // Unused Var -#define VAR_ROUTE109_STATE 0x4068 // Unused Var -#define VAR_ROUTE110_STATE 0x4069 -#define VAR_ROUTE111_STATE 0x406A // Unused Var -#define VAR_ROUTE112_STATE 0x406B // Unused Var -#define VAR_ROUTE113_STATE 0x406C // Unused Var -#define VAR_ROUTE114_STATE 0x406D // Unused Var -#define VAR_ROUTE115_STATE 0x406E // Unused Var -#define VAR_ROUTE116_STATE 0x406F -#define VAR_ROUTE117_STATE 0x4070 // Unused Var -#define VAR_ROUTE118_STATE 0x4071 -#define VAR_ROUTE119_STATE 0x4072 -#define VAR_ROUTE120_STATE 0x4073 // Unused Var -#define VAR_ROUTE121_STATE 0x4074 -#define VAR_ROUTE122_STATE 0x4075 // Unused Var -#define VAR_ROUTE123_STATE 0x4076 // Unused Var -#define VAR_ROUTE124_STATE 0x4077 // Unused Var -#define VAR_ROUTE125_STATE 0x4078 // Unused Var -#define VAR_ROUTE126_STATE 0x4079 // Unused Var -#define VAR_ROUTE127_STATE 0x407A // Unused Var -#define VAR_ROUTE128_STATE 0x407B -#define VAR_ROUTE129_STATE 0x407C // Unused Var -#define VAR_ROUTE130_STATE 0x407D // Unused Var -#define VAR_ROUTE131_STATE 0x407E // Unused Var -#define VAR_ROUTE132_STATE 0x407F // Unused Var -#define VAR_ROUTE133_STATE 0x4080 // Unused Var -#define VAR_ROUTE134_STATE 0x4081 // Unused Var -#define VAR_LITTLEROOT_HOUSES_STATE_MAY 0x4082 -#define VAR_UNUSED_0x4083 0x4083 // Unused Var -#define VAR_BIRCH_LAB_STATE 0x4084 -#define VAR_PETALBURG_GYM_STATE 0x4085 // 0-1: Wally tutorial, 2-6: 0-4 badges, 7: Defeated Norman, 8: Rematch Norman -#define VAR_CONTEST_HALL_STATE 0x4086 -#define VAR_CABLE_CLUB_STATE 0x4087 -#define VAR_CONTEST_TYPE 0x4088 -#define VAR_SECRET_BASE_INITIALIZED 0x4089 -#define VAR_CONTEST_PRIZE_PICKUP 0x408A -#define VAR_UNUSED_0x408B 0x408B // Unused Var -#define VAR_LITTLEROOT_HOUSES_STATE_BRENDAN 0x408C -#define VAR_LITTLEROOT_RIVAL_STATE 0x408D -#define VAR_BOARD_BRINEY_BOAT_STATE 0x408E -#define VAR_DEVON_CORP_3F_STATE 0x408F -#define VAR_BRINEY_HOUSE_STATE 0x4090 -#define VAR_UNUSED_0x4091 0x4091 // Unused Var -#define VAR_LITTLEROOT_INTRO_STATE 0x4092 -#define VAR_MAUVILLE_GYM_STATE 0x4093 -#define VAR_LILYCOVE_MUSEUM_2F_STATE 0x4094 -#define VAR_LILYCOVE_FAN_CLUB_STATE 0x4095 -#define VAR_BRINEY_LOCATION 0x4096 -#define VAR_INIT_SECRET_BASE 0x4097 -#define VAR_PETALBURG_WOODS_STATE 0x4098 -#define VAR_LILYCOVE_CONTEST_LOBBY_STATE 0x4099 -#define VAR_RUSTURF_TUNNEL_STATE 0x409A -#define VAR_UNUSED_0x409B 0x409B // Unused Var -#define VAR_ELITE_4_STATE 0x409C -#define VAR_UNUSED_0x409D 0x409D // Unused Var -#define VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE 0x409E -#define VAR_MOSSDEEP_SPACE_CENTER_STATE 0x409F -#define VAR_SLATEPORT_HARBOR_STATE 0x40A0 -#define VAR_UNUSED_0x40A1 0x40A1 // Unused var -#define VAR_SEAFLOOR_CAVERN_STATE 0x40A2 -#define VAR_CABLE_CAR_STATION_STATE 0x40A3 -#define VAR_SAFARI_ZONE_STATE 0x40A4 // 0: In or out of SZ, 1: Player exiting SZ, 2: Player entering SZ -#define VAR_TRICK_HOUSE_BEING_WATCHED_STATE 0x40A5 -#define VAR_TRICK_HOUSE_FOUND_TRICK_MASTER 0x40A6 -#define VAR_TRICK_HOUSE_ENTRANCE_STATE 0x40A7 -#define VAR_UNUSED_0x40A8 0x40A8 // Unused Var -#define VAR_CYCLING_CHALLENGE_STATE 0x40A9 -#define VAR_SLATEPORT_MUSEUM_1F_STATE 0x40AA -#define VAR_TRICK_HOUSE_PUZZLE_1_STATE 0x40AB -#define VAR_TRICK_HOUSE_PUZZLE_2_STATE 0x40AC -#define VAR_TRICK_HOUSE_PUZZLE_3_STATE 0x40AD -#define VAR_TRICK_HOUSE_PUZZLE_4_STATE 0x40AE -#define VAR_TRICK_HOUSE_PUZZLE_5_STATE 0x40AF -#define VAR_TRICK_HOUSE_PUZZLE_6_STATE 0x40B0 -#define VAR_TRICK_HOUSE_PUZZLE_7_STATE 0x40B1 -#define VAR_TRICK_HOUSE_PUZZLE_8_STATE 0x40B2 -#define VAR_WEATHER_INSTITUTE_STATE 0x40B3 -#define VAR_SS_TIDAL_STATE 0x40B4 -#define VAR_TRICK_HOUSE_ENTER_FROM_CORRIDOR 0x40B5 -#define VAR_TRICK_HOUSE_PUZZLE_7_STATE_2 0x40B6 // Leftover from RS, never set -#define VAR_SLATEPORT_FAN_CLUB_STATE 0x40B7 -#define VAR_UNUSED_0x40B8 0x40B8 // Unused Var -#define VAR_MT_PYRE_STATE 0x40B9 -#define VAR_NEW_MAUVILLE_STATE 0x40BA -#define VAR_UNUSED_0x40BB 0x40BB // Unused Var -#define VAR_BRAVO_TRAINER_BATTLE_TOWER_ON 0x40BC -#define VAR_JAGGED_PASS_ASH_WEATHER 0x40BD -#define VAR_GLASS_WORKSHOP_STATE 0x40BE -#define VAR_METEOR_FALLS_STATE 0x40BF -#define VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE 0x40C0 -#define VAR_TRICK_HOUSE_PRIZE_PICKUP 0x40C1 -#define VAR_PACIFIDLOG_TM_RECEIVED_DAY 0x40C2 -#define VAR_VICTORY_ROAD_1F_STATE 0x40C3 -#define VAR_FOSSIL_RESURRECTION_STATE 0x40C4 -#define VAR_WHICH_FOSSIL_REVIVED 0x40C5 -#define VAR_STEVENS_HOUSE_STATE 0x40C6 -#define VAR_OLDALE_RIVAL_STATE 0x40C7 -#define VAR_JAGGED_PASS_STATE 0x40C8 -#define VAR_SCOTT_PETALBURG_ENCOUNTER 0x40C9 -#define VAR_SKY_PILLAR_STATE 0x40CA -#define VAR_MIRAGE_TOWER_STATE 0x40CB -#define VAR_FOSSIL_MANIAC_STATE 0x40CC -#define VAR_CABLE_CLUB_TUTORIAL_STATE 0x40CD -#define VAR_FRONTIER_BATTLE_MODE 0x40CE -#define VAR_FRONTIER_FACILITY 0x40CF -#define VAR_HAS_ENTERED_BATTLE_FRONTIER 0x40D0 // Var is used like a flag. -#define VAR_SCOTT_STATE 0x40D1 -#define VAR_SLATEPORT_OUTSIDE_MUSEUM_STATE 0x40D2 -#define VAR_DEX_UPGRADE_JOHTO_STARTER_STATE 0x40D3 -#define VAR_SS_TIDAL_SCOTT_STATE 0x40D4 // Always equal to FLAG_MET_SCOTT_ON_SS_TIDAL -#define VAR_ROAMER_POKEMON 0x40D5 // 0 = Latias, 1 = Latios -#define VAR_TRAINER_HILL_IS_ACTIVE 0x40D6 -#define VAR_SKY_PILLAR_RAYQUAZA_CRY_DONE 0x40D7 -#define VAR_SOOTOPOLIS_WALLACE_STATE 0x40D8 +#define VAR_DEOXYS_ROCK_STEP_COUNT 0x4034 +#define VAR_DEOXYS_ROCK_LEVEL 0x4035 +#define VAR_PC_BOX_TO_SEND_MON 0x4036 +#define VAR_ABNORMAL_WEATHER_LOCATION 0x4037 +#define VAR_ABNORMAL_WEATHER_STEP_COUNTER 0x4038 +#define VAR_SHOULD_END_ABNORMAL_WEATHER 0x4039 +#define VAR_FARAWAY_ISLAND_STEP_COUNTER 0x403A +#define VAR_REGICE_STEPS_1 0x403B +#define VAR_REGICE_STEPS_2 0x403C +#define VAR_REGICE_STEPS_3 0x403D +#define VAR_ALTERING_CAVE_WILD_SET 0x403E +#define VAR_DISTRIBUTE_EON_TICKET 0x403F // This var is read and written, but is always zero. The only way to obtain the Eon Ticket in Emerald is via Record Mixing +#define VAR_DAYS 0x4040 +#define VAR_FANCLUB_FAN_COUNTER 0x4041 +#define VAR_FANCLUB_LOSE_FAN_TIMER 0x4042 +#define VAR_DEPT_STORE_FLOOR 0x4043 +#define VAR_TRICK_HOUSE_LEVEL 0x4044 +#define VAR_POKELOT_PRIZE_ITEM 0x4045 +#define VAR_NATIONAL_DEX 0x4046 +#define VAR_SEEDOT_SIZE_RECORD 0x4047 +#define VAR_ASH_GATHER_COUNT 0x4048 +#define VAR_BIRCH_STATE 0x4049 +#define VAR_CRUISE_STEP_COUNT 0x404A +#define VAR_POKELOT_RND1 0x404B +#define VAR_POKELOT_RND2 0x404C +#define VAR_POKELOT_PRIZE_PLACE 0x404D +#define VAR_UNUSED_0x404E 0x404E // Unused Var +#define VAR_LOTAD_SIZE_RECORD 0x404F +#define VAR_LITTLEROOT_TOWN_STATE 0x4050 +#define VAR_OLDALE_TOWN_STATE 0x4051 +#define VAR_DEWFORD_TOWN_STATE 0x4052 // Unused Var +#define VAR_LAVARIDGE_TOWN_STATE 0x4053 +#define VAR_CURRENT_SECRET_BASE 0x4054 // was probably allocated for VAR_FALLARBOR_TOWN_STATE at one point +#define VAR_VERDANTURF_TOWN_STATE 0x4055 // Unused Var +#define VAR_PACIFIDLOG_TOWN_STATE 0x4056 // Unused Var +#define VAR_PETALBURG_CITY_STATE 0x4057 +#define VAR_SLATEPORT_CITY_STATE 0x4058 +#define VAR_MAUVILLE_CITY_STATE 0x4059 // Unused Var +#define VAR_RUSTBORO_CITY_STATE 0x405A +#define VAR_FORTREE_CITY_STATE 0x405B // Unused Var +#define VAR_LILYCOVE_CITY_STATE 0x405C // Unused Var +#define VAR_MOSSDEEP_CITY_STATE 0x405D +#define VAR_SOOTOPOLIS_CITY_STATE 0x405E +#define VAR_EVER_GRANDE_CITY_STATE 0x405F // Unused Var +#define VAR_ROUTE101_STATE 0x4060 +#define VAR_ROUTE102_STATE 0x4061 // Unused Var +#define VAR_ROUTE103_STATE 0x4062 // Unused Var +#define VAR_ROUTE104_STATE 0x4063 +#define VAR_ROUTE105_STATE 0x4064 // Unused Var +#define VAR_ROUTE106_STATE 0x4065 // Unused Var +#define VAR_ROUTE107_STATE 0x4066 // Unused Var +#define VAR_ROUTE108_STATE 0x4067 // Unused Var +#define VAR_ROUTE109_STATE 0x4068 // Unused Var +#define VAR_ROUTE110_STATE 0x4069 +#define VAR_ROUTE111_STATE 0x406A // Unused Var +#define VAR_ROUTE112_STATE 0x406B // Unused Var +#define VAR_ROUTE113_STATE 0x406C // Unused Var +#define VAR_ROUTE114_STATE 0x406D // Unused Var +#define VAR_ROUTE115_STATE 0x406E // Unused Var +#define VAR_ROUTE116_STATE 0x406F +#define VAR_ROUTE117_STATE 0x4070 // Unused Var +#define VAR_ROUTE118_STATE 0x4071 +#define VAR_ROUTE119_STATE 0x4072 +#define VAR_ROUTE120_STATE 0x4073 // Unused Var +#define VAR_ROUTE121_STATE 0x4074 +#define VAR_ROUTE122_STATE 0x4075 // Unused Var +#define VAR_ROUTE123_STATE 0x4076 // Unused Var +#define VAR_ROUTE124_STATE 0x4077 // Unused Var +#define VAR_ROUTE125_STATE 0x4078 // Unused Var +#define VAR_ROUTE126_STATE 0x4079 // Unused Var +#define VAR_ROUTE127_STATE 0x407A // Unused Var +#define VAR_ROUTE128_STATE 0x407B +#define VAR_ROUTE129_STATE 0x407C // Unused Var +#define VAR_ROUTE130_STATE 0x407D // Unused Var +#define VAR_ROUTE131_STATE 0x407E // Unused Var +#define VAR_ROUTE132_STATE 0x407F // Unused Var +#define VAR_ROUTE133_STATE 0x4080 // Unused Var +#define VAR_ROUTE134_STATE 0x4081 // Unused Var +#define VAR_LITTLEROOT_HOUSES_STATE_MAY 0x4082 +#define VAR_UNUSED_0x4083 0x4083 // Unused Var +#define VAR_BIRCH_LAB_STATE 0x4084 +#define VAR_PETALBURG_GYM_STATE 0x4085 // 0-1: Wally tutorial, 2-6: 0-4 badges, 7: Defeated Norman, 8: Rematch Norman +#define VAR_CONTEST_HALL_STATE 0x4086 +#define VAR_CABLE_CLUB_STATE 0x4087 +#define VAR_CONTEST_TYPE 0x4088 +#define VAR_SECRET_BASE_INITIALIZED 0x4089 +#define VAR_CONTEST_PRIZE_PICKUP 0x408A +#define VAR_UNUSED_0x408B 0x408B // Unused Var +#define VAR_LITTLEROOT_HOUSES_STATE_BRENDAN 0x408C +#define VAR_LITTLEROOT_RIVAL_STATE 0x408D +#define VAR_BOARD_BRINEY_BOAT_STATE 0x408E +#define VAR_DEVON_CORP_3F_STATE 0x408F +#define VAR_BRINEY_HOUSE_STATE 0x4090 +#define VAR_UNUSED_0x4091 0x4091 // Unused Var +#define VAR_LITTLEROOT_INTRO_STATE 0x4092 +#define VAR_MAUVILLE_GYM_STATE 0x4093 +#define VAR_LILYCOVE_MUSEUM_2F_STATE 0x4094 +#define VAR_LILYCOVE_FAN_CLUB_STATE 0x4095 +#define VAR_BRINEY_LOCATION 0x4096 +#define VAR_INIT_SECRET_BASE 0x4097 +#define VAR_PETALBURG_WOODS_STATE 0x4098 +#define VAR_LILYCOVE_CONTEST_LOBBY_STATE 0x4099 +#define VAR_RUSTURF_TUNNEL_STATE 0x409A +#define VAR_UNUSED_0x409B 0x409B // Unused Var +#define VAR_ELITE_4_STATE 0x409C +#define VAR_UNUSED_0x409D 0x409D // Unused Var +#define VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE 0x409E +#define VAR_MOSSDEEP_SPACE_CENTER_STATE 0x409F +#define VAR_SLATEPORT_HARBOR_STATE 0x40A0 +#define VAR_UNUSED_0x40A1 0x40A1 // Unused var +#define VAR_SEAFLOOR_CAVERN_STATE 0x40A2 +#define VAR_CABLE_CAR_STATION_STATE 0x40A3 +#define VAR_SAFARI_ZONE_STATE 0x40A4 // 0: In or out of SZ, 1: Player exiting SZ, 2: Player entering SZ +#define VAR_TRICK_HOUSE_BEING_WATCHED_STATE 0x40A5 +#define VAR_TRICK_HOUSE_FOUND_TRICK_MASTER 0x40A6 +#define VAR_TRICK_HOUSE_ENTRANCE_STATE 0x40A7 +#define VAR_UNUSED_0x40A8 0x40A8 // Unused Var +#define VAR_CYCLING_CHALLENGE_STATE 0x40A9 +#define VAR_SLATEPORT_MUSEUM_1F_STATE 0x40AA +#define VAR_TRICK_HOUSE_PUZZLE_1_STATE 0x40AB +#define VAR_TRICK_HOUSE_PUZZLE_2_STATE 0x40AC +#define VAR_TRICK_HOUSE_PUZZLE_3_STATE 0x40AD +#define VAR_TRICK_HOUSE_PUZZLE_4_STATE 0x40AE +#define VAR_TRICK_HOUSE_PUZZLE_5_STATE 0x40AF +#define VAR_TRICK_HOUSE_PUZZLE_6_STATE 0x40B0 +#define VAR_TRICK_HOUSE_PUZZLE_7_STATE 0x40B1 +#define VAR_TRICK_HOUSE_PUZZLE_8_STATE 0x40B2 +#define VAR_WEATHER_INSTITUTE_STATE 0x40B3 +#define VAR_SS_TIDAL_STATE 0x40B4 +#define VAR_TRICK_HOUSE_ENTER_FROM_CORRIDOR 0x40B5 +#define VAR_TRICK_HOUSE_PUZZLE_7_STATE_2 0x40B6 // Leftover from RS, never set +#define VAR_SLATEPORT_FAN_CLUB_STATE 0x40B7 +#define VAR_UNUSED_0x40B8 0x40B8 // Unused Var +#define VAR_MT_PYRE_STATE 0x40B9 +#define VAR_NEW_MAUVILLE_STATE 0x40BA +#define VAR_UNUSED_0x40BB 0x40BB // Unused Var +#define VAR_BRAVO_TRAINER_BATTLE_TOWER_ON 0x40BC +#define VAR_JAGGED_PASS_ASH_WEATHER 0x40BD +#define VAR_GLASS_WORKSHOP_STATE 0x40BE +#define VAR_METEOR_FALLS_STATE 0x40BF +#define VAR_SOOTOPOLIS_MYSTERY_EVENTS_STATE 0x40C0 +#define VAR_TRICK_HOUSE_PRIZE_PICKUP 0x40C1 +#define VAR_PACIFIDLOG_TM_RECEIVED_DAY 0x40C2 +#define VAR_VICTORY_ROAD_1F_STATE 0x40C3 +#define VAR_FOSSIL_RESURRECTION_STATE 0x40C4 +#define VAR_WHICH_FOSSIL_REVIVED 0x40C5 +#define VAR_STEVENS_HOUSE_STATE 0x40C6 +#define VAR_OLDALE_RIVAL_STATE 0x40C7 +#define VAR_JAGGED_PASS_STATE 0x40C8 +#define VAR_SCOTT_PETALBURG_ENCOUNTER 0x40C9 +#define VAR_SKY_PILLAR_STATE 0x40CA +#define VAR_MIRAGE_TOWER_STATE 0x40CB +#define VAR_FOSSIL_MANIAC_STATE 0x40CC +#define VAR_CABLE_CLUB_TUTORIAL_STATE 0x40CD +#define VAR_FRONTIER_BATTLE_MODE 0x40CE +#define VAR_FRONTIER_FACILITY 0x40CF +#define VAR_HAS_ENTERED_BATTLE_FRONTIER 0x40D0 // Var is used like a flag. +#define VAR_SCOTT_STATE 0x40D1 +#define VAR_SLATEPORT_OUTSIDE_MUSEUM_STATE 0x40D2 +#define VAR_DEX_UPGRADE_JOHTO_STARTER_STATE 0x40D3 +#define VAR_SS_TIDAL_SCOTT_STATE 0x40D4 // Always equal to FLAG_MET_SCOTT_ON_SS_TIDAL +#define VAR_ROAMER_POKEMON 0x40D5 // 0 = Latias, 1 = Latios +#define VAR_TRAINER_HILL_IS_ACTIVE 0x40D6 +#define VAR_SKY_PILLAR_RAYQUAZA_CRY_DONE 0x40D7 +#define VAR_SOOTOPOLIS_WALLACE_STATE 0x40D8 #define VAR_HAS_TALKED_TO_SEAFLOOR_CAVERN_ENTRANCE_GRUNT 0x40D9 -#define VAR_REGISTER_BIRCH_STATE 0x40DA -#define VAR_UNUSED_0x40DB 0x40DB // Unused Var -#define VAR_UNUSED_0x40DC 0x40DC // Unused Var -#define VAR_GIFT_PICHU_SLOT 0x40DD -#define VAR_GIFT_UNUSED_1 0x40DE // Var is written to, but never read -#define VAR_GIFT_UNUSED_2 0x40DF // Var is written to, but never read -#define VAR_GIFT_UNUSED_3 0x40E0 // Var is written to, but never read -#define VAR_GIFT_UNUSED_4 0x40E1 // Var is written to, but never read -#define VAR_GIFT_UNUSED_5 0x40E2 // Var is written to, but never read -#define VAR_GIFT_UNUSED_6 0x40E3 // Var is written to, but never read -#define VAR_GIFT_UNUSED_7 0x40E4 // var is written to, but never read -#define VAR_UNUSED_0x40E5 0x40E5 // Unused Var -#define VAR_DAILY_SLOTS 0x40E6 -#define VAR_DAILY_WILDS 0x40E7 -#define VAR_DAILY_BLENDER 0x40E8 -#define VAR_DAILY_PLANTED_BERRIES 0x40E9 -#define VAR_DAILY_PICKED_BERRIES 0x40EA -#define VAR_DAILY_ROULETTE 0x40EB -#define VAR_SECRET_BASE_STEP_COUNTER 0x40EC // Used by Secret Base TV programs -#define VAR_SECRET_BASE_LAST_ITEM_USED 0x40ED // Used by Secret Base TV programs -#define VAR_SECRET_BASE_LOW_TV_FLAGS 0x40EE // Used by Secret Base TV programs -#define VAR_SECRET_BASE_HIGH_TV_FLAGS 0x40EF // Used by Secret Base TV programs -#define VAR_SECRET_BASE_IS_NOT_LOCAL 0x40F0 // Set to TRUE while in another player's secret base. -#define VAR_DAILY_BP 0x40F1 -#define VAR_WALLY_CALL_STEP_COUNTER 0x40F2 -#define VAR_SCOTT_FORTREE_CALL_STEP_COUNTER 0x40F3 -#define VAR_ROXANNE_CALL_STEP_COUNTER 0x40F4 -#define VAR_SCOTT_BF_CALL_STEP_COUNTER 0x40F5 -#define VAR_RIVAL_RAYQUAZA_CALL_STEP_COUNTER 0x40F6 -#define VAR_UNUSED_0x40F7 0x40F7 // Unused Var -#define VAR_UNUSED_0x40F8 0x40F8 // Unused Var -#define VAR_UNUSED_0x40F9 0x40F9 // Unused Var -#define VAR_UNUSED_0x40FA 0x40FA // Unused Var -#define VAR_UNUSED_0x40FB 0x40FB // Unused Var -#define VAR_UNUSED_0x40FC 0x40FC // Unused Var -#define VAR_UNUSED_0x40FD 0x40FD // Unused Var -#define VAR_UNUSED_0x40FE 0x40FE // Unused Var -#define VAR_UNUSED_0x40FF 0x40FF // Unused Var +#define VAR_REGISTER_BIRCH_STATE 0x40DA +#define VAR_UNUSED_0x40DB 0x40DB // Unused Var +#define VAR_UNUSED_0x40DC 0x40DC // Unused Var +#define VAR_GIFT_PICHU_SLOT 0x40DD +#define VAR_GIFT_UNUSED_1 0x40DE // Var is written to, but never read +#define VAR_GIFT_UNUSED_2 0x40DF // Var is written to, but never read +#define VAR_GIFT_UNUSED_3 0x40E0 // Var is written to, but never read +#define VAR_GIFT_UNUSED_4 0x40E1 // Var is written to, but never read +#define VAR_GIFT_UNUSED_5 0x40E2 // Var is written to, but never read +#define VAR_GIFT_UNUSED_6 0x40E3 // Var is written to, but never read +#define VAR_GIFT_UNUSED_7 0x40E4 // var is written to, but never read +#define VAR_UNUSED_0x40E5 0x40E5 // Unused Var +#define VAR_DAILY_SLOTS 0x40E6 +#define VAR_DAILY_WILDS 0x40E7 +#define VAR_DAILY_BLENDER 0x40E8 +#define VAR_DAILY_PLANTED_BERRIES 0x40E9 +#define VAR_DAILY_PICKED_BERRIES 0x40EA +#define VAR_DAILY_ROULETTE 0x40EB +#define VAR_SECRET_BASE_STEP_COUNTER 0x40EC // Used by Secret Base TV programs +#define VAR_SECRET_BASE_LAST_ITEM_USED 0x40ED // Used by Secret Base TV programs +#define VAR_SECRET_BASE_LOW_TV_FLAGS 0x40EE // Used by Secret Base TV programs +#define VAR_SECRET_BASE_HIGH_TV_FLAGS 0x40EF // Used by Secret Base TV programs +#define VAR_SECRET_BASE_IS_NOT_LOCAL 0x40F0 // Set to TRUE while in another player's secret base. +#define VAR_DAILY_BP 0x40F1 +#define VAR_WALLY_CALL_STEP_COUNTER 0x40F2 +#define VAR_SCOTT_FORTREE_CALL_STEP_COUNTER 0x40F3 +#define VAR_ROXANNE_CALL_STEP_COUNTER 0x40F4 +#define VAR_SCOTT_BF_CALL_STEP_COUNTER 0x40F5 +#define VAR_RIVAL_RAYQUAZA_CALL_STEP_COUNTER 0x40F6 +#define VAR_UNUSED_0x40F7 0x40F7 // Unused Var +#define VAR_UNUSED_0x40F8 0x40F8 // Unused Var +#define VAR_UNUSED_0x40F9 0x40F9 // Unused Var +#define VAR_UNUSED_0x40FA 0x40FA // Unused Var +#define VAR_UNUSED_0x40FB 0x40FB // Unused Var +#define VAR_UNUSED_0x40FC 0x40FC // Unused Var +#define VAR_UNUSED_0x40FD 0x40FD // Unused Var +#define VAR_UNUSED_0x40FE 0x40FE // Unused Var +#define VAR_UNUSED_0x40FF 0x40FF // Unused Var -#define VARS_END 0x40FF -#define VARS_COUNT (VARS_END - VARS_START + 1) +#define VARS_END 0x40FF +#define VARS_COUNT (VARS_END - VARS_START + 1) #define SPECIAL_VARS_START 0x8000 // special vars From 96d190f5ad3e36a6fdebb28a0316b40c55d22732 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Mon, 12 Sep 2022 20:39:21 -0600 Subject: [PATCH 134/155] Updated Toxic Status Counter --- src/battle_ai_switch_items.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index f72459e8d5..184cea1c65 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -337,7 +337,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) { //Toxic moduloChance = 2; //50% - if (gBattleMons[gActiveBattler].status1 & (STATUS1_TOXIC_COUNTER > 2) + if (((gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_COUNTER) >= STATUS1_TOXIC_TURN(2)) && gBattleMons[gActiveBattler].hp >= (gBattleMons[gActiveBattler].maxHP / 3) && (Random() % (moduloChance*chanceReducer)) == 0) switchMon = TRUE; From 2d841a25f96854ffa449650cc1f04d7154883d0b Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Tue, 13 Sep 2022 15:45:01 -0300 Subject: [PATCH 135/155] Removed unused extern declaration of old gUnknown func --- src/item.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/item.c b/src/item.c index 0f5746027b..acb00acc75 100644 --- a/src/item.c +++ b/src/item.c @@ -15,8 +15,6 @@ #include "constants/items.h" #include "constants/hold_effects.h" -extern u16 gUnknown_0203CF30[]; - // this file's functions static bool8 CheckPyramidBagHasItem(u16 itemId, u16 count); static bool8 CheckPyramidBagHasSpace(u16 itemId, u16 count); From de32940fdf9e00d3f7c2b6a748219658f78a3a81 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 13 Sep 2022 16:26:36 -0300 Subject: [PATCH 136/155] Further removed trailing whitespaces --- asm/macros/battle_anim_script.inc | 6 +- asm/macros/battle_frontier/battle_tower.inc | 20 +- asm/macros/music_voice.inc | 4 +- data/battle_anim_scripts.s | 18 +- data/battle_scripts_1.s | 10 +- include/constants/battle_anim.h | 2 +- include/constants/battle_string_ids.h | 2 +- sound/direct_sound_data.inc | 2 +- src/battle_ai_switch_items.c | 14 +- src/battle_ai_util.c | 36 +- src/battle_anim.c | 2 +- src/battle_anim_effects_1.c | 2 +- src/battle_anim_ghost.c | 4 +- src/battle_anim_new.c | 472 +++++++++--------- src/battle_debug.c | 8 +- src/battle_interface.c | 2 +- src/battle_message.c | 6 +- src/battle_z_move.c | 58 +-- src/data/battle_moves.h | 6 +- src/data/pokemon/base_stats.h | 10 +- src/data/pokemon/form_change_table_pointers.h | 2 +- .../pokemon/form_species_table_pointers.h | 10 +- src/data/pokemon/level_up_learnsets.h | 30 +- src/data/pokemon/pokedex_orders.h | 28 +- src/data/text/move_descriptions.h | 70 +-- src/data/text/move_names.h | 2 +- src/daycare.c | 4 +- src/debug.c | 4 +- src/evolution_scene.c | 2 +- src/item_use.c | 2 +- src/pokemon.c | 14 +- src/pokemon_debug.c | 38 +- src/pokemon_summary_screen.c | 2 +- src/scrcmd.c | 2 +- src/start_menu.c | 2 +- src/wild_encounter.c | 2 +- tools/aif2pcm/main.c | 14 +- tools/gbagfx/font.c | 6 +- tools/jsonproc/inja.hpp | 2 +- tools/mapjson/mapjson.cpp | 14 +- tools/preproc/c_file.cpp | 4 +- tools/preproc/charmap.cpp | 2 +- tools/scaninc/source_file.cpp | 4 +- 43 files changed, 472 insertions(+), 472 deletions(-) diff --git a/asm/macros/battle_anim_script.inc b/asm/macros/battle_anim_script.inc index bdc1197486..a98a344fa1 100644 --- a/asm/macros/battle_anim_script.inc +++ b/asm/macros/battle_anim_script.inc @@ -283,7 +283,7 @@ .macro jumpretfalse ptr:req jumpreteq FALSE, \ptr .endm - + .macro jumpifdoublebattle ptr:req createvisualtask AnimTask_IsDoubleBattle, 0 jumprettrue \ptr @@ -305,7 +305,7 @@ .hword \launchtemplatearg7 .hword \launchtemplatearg8 .endm - + .macro launchtask launchtaskPtr launchtaskPriority launchtaskArgsNo launchtaskarg0 launchtaskarg1 launchtaskarg2 launchtaskarg3 launchtaskarg4 launchtaskarg5 launchtaskarg6 launchtaskarg7 launchtaskarg8 .byte 0x3 .word \launchtaskPtr @@ -321,7 +321,7 @@ .hword \launchtaskarg7 .hword \launchtaskarg8 .endm - + .macro setblends setblends_value .byte 0xC .hword \setblends_value diff --git a/asm/macros/battle_frontier/battle_tower.inc b/asm/macros/battle_frontier/battle_tower.inc index 46bbc392f6..49e72e7446 100644 --- a/asm/macros/battle_frontier/battle_tower.inc +++ b/asm/macros/battle_frontier/battle_tower.inc @@ -89,15 +89,15 @@ setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_INTERVIEW_DATA special CallBattleTowerFunc .endm - + @Custom multi-battle commands - + .macro choose_mons fadescreen 1 special ChooseHalfPartyForBattle @ choose 3 mons for battle waitstate .endm - + .macro multi_do type:req, partnerId:req, partnerPicId:req special ReducePlayerPartyToSelectedMons setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA @@ -113,26 +113,26 @@ special CallFrontierUtilFunc special LoadPlayerParty .endm - + .macro multi_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req, partnerPicId:req special SavePlayerParty trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons trainerbattle TRAINER_BATTLE_SET_TRAINER_B, \trainer2Id, 0, NULL, \trainer2LoseText @ set second trainer mons multi_do MULTI_BATTLE_2_VS_2, \partnerId, \partnerPicId .endm - + .macro multi_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req, partnerPicId:req special SavePlayerParty trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons multi_do MULTI_BATTLE_2_VS_1, \partnerId, \partnerPicId .endm - + @ Wild mons need to be assigned to gEnemyParty 0 and 3 slots, other slots need to be cleared out. .macro multi_wild partnerId:req, partnerPicId:req special SavePlayerParty multi_do MULTI_BATTLE_2_VS_WILD, \partnerId, \partnerPicId .endm - + .macro multi_do_fixed type:req, partnerId:req, partnerPicId:req setvar VAR_0x8004, SPECIAL_BATTLE_MULTI setvar VAR_0x8005, \type @@ -144,20 +144,20 @@ special CallFrontierUtilFunc special LoadPlayerParty .endm - + .macro multi_fixed_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req, partnerPicId:req special SavePlayerParty trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons trainerbattle TRAINER_BATTLE_SET_TRAINER_B, \trainer2Id, 0, NULL, \trainer2LoseText @ set second trainer mons multi_do_fixed MULTI_BATTLE_2_VS_2, \partnerId, \partnerPicId .endm - + .macro multi_fixed_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req, partnerPicId:req special SavePlayerParty trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons multi_do_fixed MULTI_BATTLE_2_VS_1, \partnerId, \partnerPicId .endm - + @ Wild mons need to be assigned to gEnemyParty 0 and 3 slots, other slots need to be cleared out. .macro multi_fixed_wild partnerId:req, partnerPicId:req special SavePlayerParty diff --git a/asm/macros/music_voice.inc b/asm/macros/music_voice.inc index 1460efe9e3..a4bbbcba63 100644 --- a/asm/macros/music_voice.inc +++ b/asm/macros/music_voice.inc @@ -150,13 +150,13 @@ .4byte \sample .byte 0xff, 0, 0xff, 0 .endm - + .macro cry_uncomp sample @ not compressed .byte 0x0, 60, 0, 0 .4byte \sample .byte 0xff, 0, 0xff, 0 .endm - + .macro cry_reverse_uncomp sample @ not compressed .byte 0x10, 60, 0, 0 .4byte \sample diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index f83d437a5d..a36eddb162 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -14196,7 +14196,7 @@ TerrainPulseElectric: createvisualtask AnimTask_SwayMon, 5, 0, 4, 51200, 24, ANIM_TARGET createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(27, 27, 0) goto TerrainPulseEnd - + TerrainPulseGrass: createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_DRAGON_PULSE, 0, 12, 12, RGB(11, 26, 11) waitforvisualfinish @@ -14218,7 +14218,7 @@ TerrainPulseFairy: createvisualtask AnimTask_SwayMon, 5, 0, 4, 51200, 24, ANIM_TARGET createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(31, 24, 31) goto TerrainPulseEnd - + TerrainPulsePsychic: createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_DRAGON_PULSE, 0, 12, 12, RGB(27, 0, 13) waitforvisualfinish @@ -24740,7 +24740,7 @@ General_RestoreBg: restorebg waitbgfadein end - + end General_ZMoveActivate: @@ -25263,8 +25263,8 @@ FinishSupersonicSkystrike: call UnsetPsychicBg waitforvisualfinish end - - + + Move_ACID_DOWNPOUR: loadspritegfx ANIM_TAG_BLUE_ORB @ reversal loadspritegfx ANIM_TAG_POISON_JAB @ poison jab @@ -25951,7 +25951,7 @@ NeverendingNightmareGeyser: createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 return - + Move_CORKSCREW_CRASH:: loadspritegfx ANIM_TAG_SPIKES @metal bits loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge @@ -26669,7 +26669,7 @@ HavocSpearSparkTarget: @ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc SOUND_PAN_ATTACKER 0x14 0x2 0x8000 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc SOUND_PAN_ATTACKER 0x14 0x2 0x8000 return - + Move_SHATTERED_PSYCHE:: loadspritegfx ANIM_TAG_IMPACT @hit @@ -29127,7 +29127,7 @@ OceanicOperettaExplosion: launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0x10 0x10 ANIM_TARGET 0x1 delay 0x6 return - + Move_SPLINTERED_STORMSHARDS:: loadspritegfx ANIM_TAG_ROCKS @rock @@ -29388,7 +29388,7 @@ SplinteredStormshardsFinishFadeReturn: return -Move_LETS_SNUGGLE_FOREVER:: +Move_LETS_SNUGGLE_FOREVER:: loadspritegfx ANIM_TAG_MAGENTA_HEART @sharm loadspritegfx ANIM_TAG_MUSIC_NOTES @music note loadspritegfx ANIM_TAG_SMALL_BUBBLES @fake tears diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 31c284e7dc..3c4b0ef2b7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -511,7 +511,7 @@ BattleScript_BeakBlastSetUp:: setbeakblast BS_ATTACKER printstring STRINGID_EMPTYSTRING3 waitmessage 1 - playanimation BS_ATTACKER, B_ANIM_BEAK_BLAST_SETUP, NULL + playanimation BS_ATTACKER, B_ANIM_BEAK_BLAST_SETUP, NULL printstring STRINGID_HEATUPBEAK waitmessage B_WAIT_TIME_LONG end2 @@ -601,7 +601,7 @@ BattleScript_ScaleShotEnd:: moveendcase MOVEEND_SYNCHRONIZE_TARGET moveendfrom MOVEEND_STATUS_IMMUNITY_ABILITIES end - + BattleScript_EffectSkyDrop: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_SkyDropTurn2 attackcanceler @@ -5648,7 +5648,7 @@ BattleScript_EffectRolePlay:: pause 20 destroyabilitypopup pause 40 -.endif +.endif printstring STRINGID_PKMNCOPIEDFOE waitmessage B_WAIT_TIME_LONG switchinabilities BS_ATTACKER @@ -9625,7 +9625,7 @@ BattleScript_StatUpZMove:: waitmessage B_WAIT_TIME_LONG BattleScript_StatUpZMoveEnd: return - + BattleScript_HealReplacementZMove:: playanimation BS_SCRIPTING B_ANIM_WISH_HEAL 0x0 printfromtable gZEffectStringIds @@ -9836,7 +9836,7 @@ BattleScript_NeutralizingGasExitsLoop: jumpifbytenotequal gBattlerTarget, sByteFour, BattleScript_NeutralizingGasExitsLoop @ SOMEHOW, comparing to gBattlersCount is problematic. restoretarget return - + BattleScript_MagicianActivates:: call BattleScript_AbilityPopUp call BattleScript_ItemSteal diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index db2efd8d05..0cdb878dfa 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -461,7 +461,7 @@ #define BG_WATER_2 41 #define BG_POISON 42 #define BG_AEROBLAST 43 -#define BG_HURRICANE 44 +#define BG_HURRICANE 44 #define BG_ELECTRIC_TERRAIN 45 #define BG_GRASSY_TERRAIN 46 #define BG_MISTY_TERRAIN 47 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 4ef2a3a82d..4bce51a455 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -379,7 +379,7 @@ #define STRINGID_PKMNBOXLANETTESPCFULL 378 #define STRINGID_TRAINER1WINTEXT 379 #define STRINGID_TRAINER2WINTEXT 380 - + #define STRINGID_ENDUREDSTURDY 381 #define STRINGID_POWERHERB 382 #define STRINGID_HURTBYITEM 383 diff --git a/sound/direct_sound_data.inc b/sound/direct_sound_data.inc index 4ce03dbedd..95c96fc1ec 100644 --- a/sound/direct_sound_data.inc +++ b/sound/direct_sound_data.inc @@ -3978,7 +3978,7 @@ Cry_Spectrier:: .align 2 Cry_Calyrex:: .incbin "sound/direct_sound_samples/cries/calyrex.bin" -/* +/* .align 2 Cry_Wyrdeer:: .incbin "sound/direct_sound_samples/cries/wyrdeer.bin" diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index f2a2efe557..69ba581228 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -793,17 +793,17 @@ static bool32 AiExpectsToFaintPlayer(void) bool32 canFaintPlayer; u32 i; u8 target = gBattleStruct->aiChosenTarget[gActiveBattler]; - + if (gBattleStruct->aiMoveOrAction[gActiveBattler] > 3) return FALSE; // AI not planning to use move - + if (GetBattlerSide(target) != GetBattlerSide(gActiveBattler) && CanIndexMoveFaintTarget(gActiveBattler, target, gBattleStruct->aiMoveOrAction[gActiveBattler], 0) && AI_WhoStrikesFirst(gActiveBattler, target, GetAIChosenMove(gActiveBattler)) == AI_IS_FASTER) { // We expect to faint the target and move first -> dont use an item return TRUE; } - + return FALSE; } @@ -818,10 +818,10 @@ static bool8 ShouldUseItem(void) if ((gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_RIGHT) || gStatuses3[gActiveBattler] & STATUS3_SKY_DROPPED) return FALSE; - + if (gStatuses3[gActiveBattler] & STATUS3_EMBARGO) return FALSE; - + if (AiExpectsToFaintPlayer()) return FALSE; @@ -948,14 +948,14 @@ static bool8 ShouldUseItem(void) static bool32 AI_ShouldHeal(u32 healAmount) { bool32 shouldHeal = FALSE; - + if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 4 || gBattleMons[gActiveBattler].hp == 0 || (healAmount != 0 && gBattleMons[gActiveBattler].maxHP - gBattleMons[gActiveBattler].hp > healAmount)) { // We have low enough HP to consider healing shouldHeal = !AI_OpponentCanFaintAiWithMod(healAmount); // if target can kill us even after we heal, why bother } - + return shouldHeal; } diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 75964664e3..e1654eb30c 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -793,7 +793,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, dmg *= 2; else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) dmg *= 3; - + if (dmg == 0) dmg = 1; } @@ -804,7 +804,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, RestoreBattlerData(battlerAtk); RestoreBattlerData(battlerDef); - + // convert multiper to AI_EFFECTIVENESS_xX *typeEffectiveness = AI_GetEffectiveness(effectivenessMultiplier); @@ -1159,11 +1159,11 @@ bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability) s32 AI_GetAbility(u32 battlerId) { u32 knownAbility = GetBattlerAbility(battlerId); - + // The AI knows its own ability. if (IsBattlerAIControlled(battlerId)) return knownAbility; - + // Check neutralizing gas, gastro acid if (knownAbility == ABILITY_NONE) return knownAbility; @@ -1183,10 +1183,10 @@ s32 AI_GetAbility(u32 battlerId) { abilityGuess = gBaseStats[gBattleMons[battlerId].species].abilities[Random() % NUM_ABILITY_SLOTS]; } - + return abilityGuess; } - + return ABILITY_NONE; // Unknown. } @@ -2691,7 +2691,7 @@ static bool32 AI_CanPoisonType(u8 battlerAttacker, u8 battlerTarget) static bool32 AI_CanBePoisoned(u8 battlerAtk, u8 battlerDef) { u16 ability = AI_DATA->abilities[battlerDef]; - + if (!(AI_CanPoisonType(battlerAtk, battlerDef)) || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD || gBattleMons[battlerDef].status1 & STATUS1_ANY @@ -3042,7 +3042,7 @@ bool32 IsValidDoubleBattle(u8 battlerAtk) u16 GetAllyChosenMove(u8 battlerId) { u8 partnerBattler = BATTLE_PARTNER(battlerId); - + if (!IsBattlerAlive(partnerBattler) || !IsBattlerAIControlled(partnerBattler)) return MOVE_NONE; else if (partnerBattler > battlerId) // Battler with the lower id chooses the move first. @@ -3444,7 +3444,7 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) if (AI_DATA->hpPercents[battlerAtk] < 80 && AI_RandLessThan(128)) return; - + if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; // Damaging moves would get a score boost from AI_TryToFaint or PreferStrongestMove so we don't consider them here @@ -3563,7 +3563,7 @@ void IncreaseParalyzeScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) { if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - + if (AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) { u8 atkSpeed = GetBattlerTotalSpeedStat(battlerAtk); @@ -3584,7 +3584,7 @@ void IncreaseSleepScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) { if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - + if (AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) *score += 2; else @@ -3602,7 +3602,7 @@ void IncreaseConfusionScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) { if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - + if (AI_CanConfuse(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_CURE_CONFUSION && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_CURE_STATUS) @@ -3633,26 +3633,26 @@ bool32 ShouldUseZMove(u8 battlerAtk, u8 battlerDef, u16 chosenMove) return FALSE; //don't use z move on partner if (gBattleStruct->zmove.used[battlerAtk]) return FALSE; //cant use z move twice - + if (IsViableZMove(battlerAtk, chosenMove)) { u8 effectiveness; - + if (gBattleMons[battlerDef].ability == ABILITY_DISGUISE && gBattleMons[battlerDef].species == SPECIES_MIMIKYU) return FALSE; // Don't waste a Z-Move busting disguise if (gBattleMons[battlerDef].ability == ABILITY_ICE_FACE && gBattleMons[battlerDef].species == SPECIES_EISCUE && IS_MOVE_PHYSICAL(chosenMove)) return FALSE; // Don't waste a Z-Move busting Ice Face - + if (IS_MOVE_STATUS(chosenMove) && !IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) return FALSE; else if (!IS_MOVE_STATUS(chosenMove) && IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) return FALSE; - + if (!IS_MOVE_STATUS(chosenMove) && AI_CalcDamage(chosenMove, battlerAtk, battlerDef, &effectiveness, FALSE) >= gBattleMons[battlerDef].hp) return FALSE; // don't waste damaging z move if can otherwise faint target - + return TRUE; } - + return FALSE; } diff --git a/src/battle_anim.c b/src/battle_anim.c index 2806160149..509369789c 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -219,7 +219,7 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo { s32 i; bool32 hideHpBoxes = (tableId == MOVE_TRANSFORM) ? FALSE : TRUE; - + if (!isMoveAnim) { switch (tableId) diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 048b37c660..93bb495241 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -6798,7 +6798,7 @@ static const union AffineAnimCmd sCompressTargetHorizontallyAffineAnimCmds[] = static void AnimTask_CompressTargetStep(u8 taskId) { struct Task* task = &gTasks[taskId]; - + if (!RunAffineAnimFromTaskData(task)) DestroyAnimVisualTask(taskId); } diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index 81cc6760c9..f21654e3e8 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -888,7 +888,7 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId) spriteId = CreateSprite(&gDarkVoidBlackHoleTemplate, baseX, baseY, 55); //dark void else spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); //destiny bond - + if (spriteId != MAX_SPRITES) { x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2); @@ -914,7 +914,7 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId) spriteId = CreateSprite(&gDarkVoidBlackHoleTemplate, baseX, baseY, 55); //dark void else spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); //destiny bond - + if (spriteId != MAX_SPRITES) { x = 48; diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 0a3d433b46..2134a8914d 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -85,7 +85,7 @@ static const union AffineAnimCmd sSquishTargetAffineAnimCmds[] = // GEN 4 // shadow sneak -const struct SpriteTemplate gShadowSneakImpactSpriteTemplate = +const struct SpriteTemplate gShadowSneakImpactSpriteTemplate = { .tileTag = ANIM_TAG_IMPACT, .paletteTag = ANIM_TAG_HANDS_AND_FEET, @@ -97,7 +97,7 @@ const struct SpriteTemplate gShadowSneakImpactSpriteTemplate = }; // power trick -const struct SpriteTemplate gPowerTrickSpriteTemplate = +const struct SpriteTemplate gPowerTrickSpriteTemplate = { .tileTag = ANIM_TAG_POWER_TRICK, .paletteTag = ANIM_TAG_POWER_TRICK, @@ -111,7 +111,7 @@ const struct SpriteTemplate gPowerTrickSpriteTemplate = //// GEN 5 //shell smash -const struct SpriteTemplate gShellSmashLeftShellSpriteTemplate = +const struct SpriteTemplate gShellSmashLeftShellSpriteTemplate = { .tileTag = ANIM_TAG_SHELL_RIGHT, .paletteTag = ANIM_TAG_SHELL_RIGHT, @@ -122,7 +122,7 @@ const struct SpriteTemplate gShellSmashLeftShellSpriteTemplate = .callback = AnimBite }; -const struct SpriteTemplate gShellSmashRightShellSpriteTemplate = +const struct SpriteTemplate gShellSmashRightShellSpriteTemplate = { .tileTag = ANIM_TAG_SHELL_LEFT, .paletteTag = ANIM_TAG_SHELL_LEFT, @@ -133,7 +133,7 @@ const struct SpriteTemplate gShellSmashRightShellSpriteTemplate = .callback = AnimBite }; -const struct SpriteTemplate gShellSmashPurpleRocksSpriteTemplate = +const struct SpriteTemplate gShellSmashPurpleRocksSpriteTemplate = { .tileTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_SHELL_RIGHT, @@ -352,7 +352,7 @@ const struct SpriteTemplate gSimpleBeamBrownTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = TranslateAnimSpriteToTargetMonLocation }; - + const struct SpriteTemplate gSimpleBeamPinkTemplate = { .tileTag = ANIM_TAG_GOLD_RING, @@ -411,12 +411,12 @@ const struct SpriteTemplate gQuickGuardArmImpactTemplate = }; //sky drop -static const union AffineAnimCmd sSkyDropFlyBallAffineAnimCmd_0[] = +static const union AffineAnimCmd sSkyDropFlyBallAffineAnimCmd_0[] = { - AFFINEANIMCMD_FRAME(0xa0, 0x100, 0x50, 0x0), + AFFINEANIMCMD_FRAME(0xa0, 0x100, 0x50, 0x0), AFFINEANIMCMD_END }; -static const union AffineAnimCmd *const sSkyDropFlyBallAffineAnimCmds[] = +static const union AffineAnimCmd *const sSkyDropFlyBallAffineAnimCmds[] = { sSkyDropFlyBallAffineAnimCmd_0 }; @@ -604,7 +604,7 @@ const struct SpriteTemplate gHornLeechHornTemplate = }; //dual chop -const struct SpriteTemplate gDualChopImpactTemplate = +const struct SpriteTemplate gDualChopImpactTemplate = { .tileTag = ANIM_TAG_IMPACT, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -971,7 +971,7 @@ const struct SpriteTemplate gTechnoBlastIceBlastTemplate = .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = TranslateAnimSpriteToTargetMonLocation -}; +}; const struct SpriteTemplate gTechnoBlastIceSparkTemplate = { .tileTag = ANIM_TAG_SPARK_2, @@ -1202,7 +1202,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_DrakeStrikePlayer[] = AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), AFFINEANIMCMD_END, }; -static const union AffineAnimCmd sSpriteAffineAnim_DrakeStrikeOpponent[] = +static const union AffineAnimCmd sSpriteAffineAnim_DrakeStrikeOpponent[] = { AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), AFFINEANIMCMD_END, @@ -1270,15 +1270,15 @@ const struct SpriteTemplate gForestsCurseIngrainTemplate = }; //petal blizzard -static const union AnimCmd sAnimCmd_PetalBlizzard1_0[] = +static const union AnimCmd sAnimCmd_PetalBlizzard1_0[] = { ANIMCMD_FRAME(0, 10), ANIMCMD_JUMP(0), }; -static const union AnimCmd *const sAnimCmdTable_PetalBlizzard1[] = +static const union AnimCmd *const sAnimCmdTable_PetalBlizzard1[] = { sAnimCmd_PetalBlizzard1_0, -}; +}; const struct SpriteTemplate gPetalBlizzardTwister1Template = { .tileTag = ANIM_TAG_FLOWER, @@ -1290,13 +1290,13 @@ const struct SpriteTemplate gPetalBlizzardTwister1Template = .callback = AnimMoveTwisterParticle }; static const u16 sPetalBlizzardFlowerOam[] = {0x0, 0x2000,0x0800,0x0}; //todo: convert to oam data -static const union AnimCmd sAnimCmd_PetalBlizzard2_0[] = +static const union AnimCmd sAnimCmd_PetalBlizzard2_0[] = { ANIMCMD_FRAME(0, 4), ANIMCMD_FRAME(4, 0), ANIMCMD_END, }; -static const union AnimCmd *const sAnimCmdTable_PetalBlizzard2[] = +static const union AnimCmd *const sAnimCmdTable_PetalBlizzard2[] = { sAnimCmd_PetalBlizzard2_0, }; @@ -2040,7 +2040,7 @@ const struct SpriteTemplate gPrecipiceBladesPlumeTemplate = }; //dragon ascent -static const union AffineAnimCmd sAffineAnimCmd_Drake[] = +static const union AffineAnimCmd sAffineAnimCmd_Drake[] = { AFFINEANIMCMD_FRAME(0, 0, 0, 1), //drake faces up AFFINEANIMCMD_END, @@ -2837,7 +2837,7 @@ const struct SpriteTemplate gCoreEnforcerBeamTemplate = .callback = SpriteCB_CoreEnforcerBeam }; -const struct SpriteTemplate gCoreEnforcerExplosionTemplate = +const struct SpriteTemplate gCoreEnforcerExplosionTemplate = { .tileTag = ANIM_TAG_EXPLOSION, .paletteTag = ANIM_TAG_EXPLOSION, @@ -3009,7 +3009,7 @@ const struct SpriteTemplate gPrismaticLaserChargeTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; - + const struct SpriteTemplate gPrismaticLaserYellowOutwardTemplate = { .tileTag = ANIM_TAG_GREEN_SPIKE, @@ -4111,7 +4111,7 @@ const struct SpriteTemplate gSteelBeamSpikeShardTemplate = // Z MOVES //activate -const struct SpriteTemplate gZMoveSymbolSpriteTemplate = +const struct SpriteTemplate gZMoveSymbolSpriteTemplate = { .tileTag = ANIM_TAG_Z_MOVE_SYMBOL, .paletteTag = ANIM_TAG_Z_MOVE_SYMBOL, @@ -4152,7 +4152,7 @@ const struct SpriteTemplate gYellowZMoveEnergySpriteTemplate = .callback = AnimEndureEnergy, }; // breakneck blitz -const struct SpriteTemplate gBreakneckBlitzDanceSpriteTemplate = +const struct SpriteTemplate gBreakneckBlitzDanceSpriteTemplate = { .tileTag = ANIM_TAG_HOLLOW_ORB, .paletteTag = ANIM_TAG_FLAT_ROCK, @@ -4162,7 +4162,7 @@ const struct SpriteTemplate gBreakneckBlitzDanceSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimDragonDanceOrb }; -const struct SpriteTemplate gBreakneckBlitzHitSpriteTemplate = +const struct SpriteTemplate gBreakneckBlitzHitSpriteTemplate = { .tileTag = ANIM_TAG_IMPACT, .paletteTag = ANIM_TAG_FLAT_ROCK, @@ -4173,7 +4173,7 @@ const struct SpriteTemplate gBreakneckBlitzHitSpriteTemplate = .callback = AnimHitSplatBasic }; // all out pummelling -const struct SpriteTemplate gAllOutPummelingOnslaughtSpriteTemplate = +const struct SpriteTemplate gAllOutPummelingOnslaughtSpriteTemplate = { .tileTag = ANIM_TAG_HANDS_AND_FEET, .paletteTag = ANIM_TAG_IMPACT, @@ -4196,7 +4196,7 @@ static const union AffineAnimCmd* const sSupersonicSkystrikeAffineAnimTable[] = sSupersonicSkystrikeAffinePlayerSide, sSupersonicSkystrikeAffineOpponentSide, }; -const struct SpriteTemplate gSupersonicSkystrikeFlySpriteTemplate = +const struct SpriteTemplate gSupersonicSkystrikeFlySpriteTemplate = { .tileTag = ANIM_TAG_BIRD, .paletteTag = ANIM_TAG_BIRD, @@ -4207,7 +4207,7 @@ const struct SpriteTemplate gSupersonicSkystrikeFlySpriteTemplate = .callback = AnimFlyBallAttack }; //acid downpour -const struct SpriteTemplate gAcidDownpourReversalSpriteTemplate = +const struct SpriteTemplate gAcidDownpourReversalSpriteTemplate = { .tileTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -4217,7 +4217,7 @@ const struct SpriteTemplate gAcidDownpourReversalSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimReversalOrb }; -const struct SpriteTemplate gAcidDownpourAuraSpriteTemplate = +const struct SpriteTemplate gAcidDownpourAuraSpriteTemplate = { .tileTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -4228,7 +4228,7 @@ const struct SpriteTemplate gAcidDownpourAuraSpriteTemplate = .callback = AnimParticleInVortex }; //tectonic rage -const struct SpriteTemplate gTectonicRageBlastBurnSpriteTemplate = +const struct SpriteTemplate gTectonicRageBlastBurnSpriteTemplate = { .tileTag = ANIM_TAG_FIRE_PLUME, .paletteTag = ANIM_TAG_FIRE_PLUME, @@ -4238,7 +4238,7 @@ const struct SpriteTemplate gTectonicRageBlastBurnSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimBlastBurnTargetPlume }; -const struct SpriteTemplate gTectonicRageExplosionSpriteTemplate = +const struct SpriteTemplate gTectonicRageExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_EXPLOSION_2, @@ -4250,7 +4250,7 @@ const struct SpriteTemplate gTectonicRageExplosionSpriteTemplate = }; // continental crush -const struct SpriteTemplate gContinentalCrushNeedleArmSpriteTemplate = +const struct SpriteTemplate gContinentalCrushNeedleArmSpriteTemplate = { .tileTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_ROCKS, @@ -4260,7 +4260,7 @@ const struct SpriteTemplate gContinentalCrushNeedleArmSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimNeedleArmSpike }; -const struct SpriteTemplate gContinentalCrushBigRockStompSpriteTemplate = +const struct SpriteTemplate gContinentalCrushBigRockStompSpriteTemplate = { .tileTag = ANIM_TAG_REALLY_BIG_ROCK, .paletteTag = ANIM_TAG_REALLY_BIG_ROCK, @@ -4270,7 +4270,7 @@ const struct SpriteTemplate gContinentalCrushBigRockStompSpriteTemplate = .affineAnims = sSpriteAffineAnimTable_LargeHailRock, .callback = SpriteCB_FallingObject }; -const struct SpriteTemplate gContinentalCrushFocusEnergySpriteTemplate = +const struct SpriteTemplate gContinentalCrushFocusEnergySpriteTemplate = { .tileTag = ANIM_TAG_FOCUS_ENERGY, .paletteTag = ANIM_TAG_ROCKS, @@ -4280,7 +4280,7 @@ const struct SpriteTemplate gContinentalCrushFocusEnergySpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEndureEnergy }; -const struct SpriteTemplate gContinentalCrushGrowingRockSpriteTemplate = +const struct SpriteTemplate gContinentalCrushGrowingRockSpriteTemplate = { .tileTag = ANIM_TAG_REALLY_BIG_ROCK, .paletteTag = ANIM_TAG_REALLY_BIG_ROCK, @@ -4290,7 +4290,7 @@ const struct SpriteTemplate gContinentalCrushGrowingRockSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gContinentalCrushEruptionSpriteTemplate = +const struct SpriteTemplate gContinentalCrushEruptionSpriteTemplate = { .tileTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_ROCKS, @@ -4302,7 +4302,7 @@ const struct SpriteTemplate gContinentalCrushEruptionSpriteTemplate = }; // savage spin out -const struct SpriteTemplate gSavageSpinOutStringBlastSpriteTemplate = +const struct SpriteTemplate gSavageSpinOutStringBlastSpriteTemplate = { .tileTag = ANIM_TAG_STRING, .paletteTag = ANIM_TAG_STRING, @@ -4312,7 +4312,7 @@ const struct SpriteTemplate gSavageSpinOutStringBlastSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimAirWaveCrescent }; -const struct SpriteTemplate gSavageSpinOutCacoonSpriteTemplate = +const struct SpriteTemplate gSavageSpinOutCacoonSpriteTemplate = { .tileTag = ANIM_TAG_COCOON, .paletteTag = ANIM_TAG_COCOON, @@ -4322,7 +4322,7 @@ const struct SpriteTemplate gSavageSpinOutCacoonSpriteTemplate = .affineAnims = gAffineAnims_Bite, .callback = AnimBite }; -const struct SpriteTemplate gSavageSpinOutGreenChargeSpriteTemplate = +const struct SpriteTemplate gSavageSpinOutGreenChargeSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_RAZOR_LEAF, @@ -4332,7 +4332,7 @@ const struct SpriteTemplate gSavageSpinOutGreenChargeSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gSavageSpinOutGreenCutSpriteTemplate = +const struct SpriteTemplate gSavageSpinOutGreenCutSpriteTemplate = { .tileTag = ANIM_TAG_CUT, .paletteTag = ANIM_TAG_RAZOR_LEAF, @@ -4342,7 +4342,7 @@ const struct SpriteTemplate gSavageSpinOutGreenCutSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimCuttingSlice }; -const struct SpriteTemplate gSavageSpinOutWhiteExplosionSpriteTemplate = +const struct SpriteTemplate gSavageSpinOutWhiteExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_AIR_WAVE_2, @@ -4354,7 +4354,7 @@ const struct SpriteTemplate gSavageSpinOutWhiteExplosionSpriteTemplate = }; // never ending nightmare -const struct SpriteTemplate gNeverEndingNightmareRingAttackerSpriteTemplate = +const struct SpriteTemplate gNeverEndingNightmareRingAttackerSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -4364,7 +4364,7 @@ const struct SpriteTemplate gNeverEndingNightmareRingAttackerSpriteTemplate = .affineAnims = gThinRingExpandingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gNeverEndingNightmareRingTargetSpriteTemplate = +const struct SpriteTemplate gNeverEndingNightmareRingTargetSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -4374,7 +4374,7 @@ const struct SpriteTemplate gNeverEndingNightmareRingTargetSpriteTemplate = .affineAnims = gThinRingShrinkingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gNeverEndingNightmareFocusEnergySpriteTemplate = +const struct SpriteTemplate gNeverEndingNightmareFocusEnergySpriteTemplate = { .tileTag = ANIM_TAG_FOCUS_ENERGY, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -4384,7 +4384,7 @@ const struct SpriteTemplate gNeverEndingNightmareFocusEnergySpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEndureEnergy }; -const struct SpriteTemplate gNeverEndingNightmareHandSpriteTemplate = +const struct SpriteTemplate gNeverEndingNightmareHandSpriteTemplate = { .tileTag = ANIM_TAG_ASSURANCE_HAND, .paletteTag = ANIM_TAG_ASSURANCE_HAND, @@ -4394,7 +4394,7 @@ const struct SpriteTemplate gNeverEndingNightmareHandSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimNeedleArmSpike }; -const struct SpriteTemplate gNeverEndingNightmareBlastBurnSpriteTemplate = +const struct SpriteTemplate gNeverEndingNightmareBlastBurnSpriteTemplate = { .tileTag = ANIM_TAG_FIRE_PLUME, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -4404,7 +4404,7 @@ const struct SpriteTemplate gNeverEndingNightmareBlastBurnSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimBlastBurnTargetPlume }; -const struct SpriteTemplate gNeverEndingNightmareGeyserHexSpriteTemplate = +const struct SpriteTemplate gNeverEndingNightmareGeyserHexSpriteTemplate = { .tileTag = ANIM_TAG_VERTICAL_HEX, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -4414,7 +4414,7 @@ const struct SpriteTemplate gNeverEndingNightmareGeyserHexSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_GeyserTarget }; -const struct SpriteTemplate gNeverEndingNightmareExplosionSpriteTemplate = +const struct SpriteTemplate gNeverEndingNightmareExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -4426,7 +4426,7 @@ const struct SpriteTemplate gNeverEndingNightmareExplosionSpriteTemplate = }; // corkscrew crash -const struct SpriteTemplate gCorkscrewCrashMetalBitSpriteTemplate = +const struct SpriteTemplate gCorkscrewCrashMetalBitSpriteTemplate = { .tileTag = ANIM_TAG_SPIKES, .paletteTag = ANIM_TAG_SPIKES, @@ -4436,7 +4436,7 @@ const struct SpriteTemplate gCorkscrewCrashMetalBitSpriteTemplate = .affineAnims = gAffineAnims_TearDrop, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gCorkscrewCrashChargeSpriteTemplate = +const struct SpriteTemplate gCorkscrewCrashChargeSpriteTemplate = { .tileTag = ANIM_TAG_CORKSCREW, .paletteTag = ANIM_TAG_CORKSCREW, @@ -4446,7 +4446,7 @@ const struct SpriteTemplate gCorkscrewCrashChargeSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gCorkscrewCrashCorkscrewFlyUpSpriteTemplate = +const struct SpriteTemplate gCorkscrewCrashCorkscrewFlyUpSpriteTemplate = { .tileTag = ANIM_TAG_CORKSCREW, .paletteTag = ANIM_TAG_CORKSCREW, @@ -4463,7 +4463,7 @@ static const union AffineAnimCmd sCorkscrewCrashFlyDownAffineOpponentSide[] = { static const union AffineAnimCmd* const sCorkscrewCrashFlyDownAffineAnimTable[] = { sCorkscrewCrashFlyDownAffineOpponentSide, }; -const struct SpriteTemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate = +const struct SpriteTemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate = { .tileTag = ANIM_TAG_CORKSCREW, .paletteTag = ANIM_TAG_CORKSCREW, @@ -4485,7 +4485,7 @@ static const union AffineAnimCmd* const sCorkscrewCrashStrikeAffineAnimTable[] = sCorkscrewCrashStrikePlayerAffineAnims, sCorkscrewCrashStrikeTargetAffineAnims, }; -const struct SpriteTemplate gCorkscrewCrashStrikeSpriteTemplate = +const struct SpriteTemplate gCorkscrewCrashStrikeSpriteTemplate = { .tileTag = ANIM_TAG_CORKSCREW, .paletteTag = ANIM_TAG_CORKSCREW, @@ -4502,7 +4502,7 @@ static const union AffineAnimCmd sCorkscrewCrashLeftAffineAnims[] = { static const union AffineAnimCmd* const sCorkscrewCrashLeftAffineAnimTable[] = { sCorkscrewCrashLeftAffineAnims, }; -const struct SpriteTemplate gCorkscrewCrashLeftUpSpriteTemplate = +const struct SpriteTemplate gCorkscrewCrashLeftUpSpriteTemplate = { .tileTag = ANIM_TAG_CORKSCREW, .paletteTag = ANIM_TAG_CORKSCREW, @@ -4512,7 +4512,7 @@ const struct SpriteTemplate gCorkscrewCrashLeftUpSpriteTemplate = .affineAnims = sCorkscrewCrashLeftAffineAnimTable, .callback = AnimAssistPawprint }; -const struct SpriteTemplate gCorkscrewCrashLeftDownSpriteTemplate = +const struct SpriteTemplate gCorkscrewCrashLeftDownSpriteTemplate = { .tileTag = ANIM_TAG_CORKSCREW, .paletteTag = ANIM_TAG_CORKSCREW, @@ -4529,7 +4529,7 @@ static const union AffineAnimCmd sCorkscrewCrashRightUpAffineAnims[] = { static const union AffineAnimCmd* const sCorkscrewCrashRightUpAffineAnimTable[] = { sCorkscrewCrashRightUpAffineAnims, }; -const struct SpriteTemplate gCorkscrewCrashRightUpSpriteTemplate = +const struct SpriteTemplate gCorkscrewCrashRightUpSpriteTemplate = { .tileTag = ANIM_TAG_CORKSCREW, .paletteTag = ANIM_TAG_CORKSCREW, @@ -4546,7 +4546,7 @@ static const union AffineAnimCmd sCorkscrewCrashRightDownAffineAnims[] = { static const union AffineAnimCmd* const sCorkscrewCrashRightDownAffineAnimTable[] = { sCorkscrewCrashRightDownAffineAnims, }; -const struct SpriteTemplate gCorkscrewCrashRightDownSpriteTemplate = +const struct SpriteTemplate gCorkscrewCrashRightDownSpriteTemplate = { .tileTag = ANIM_TAG_CORKSCREW, .paletteTag = ANIM_TAG_CORKSCREW, @@ -4558,7 +4558,7 @@ const struct SpriteTemplate gCorkscrewCrashRightDownSpriteTemplate = }; // inferno overdrive -const struct SpriteTemplate gInfernoOverdriveSuperpowerSpriteTemplate = +const struct SpriteTemplate gInfernoOverdriveSuperpowerSpriteTemplate = { .tileTag = ANIM_TAG_METEOR, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -4568,7 +4568,7 @@ const struct SpriteTemplate gInfernoOverdriveSuperpowerSpriteTemplate = .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, .callback = SpriteCB_GrowingSuperpower }; -const struct SpriteTemplate gInfernoOverdriveChargeSpriteTemplate = +const struct SpriteTemplate gInfernoOverdriveChargeSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -4578,7 +4578,7 @@ const struct SpriteTemplate gInfernoOverdriveChargeSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gInfernoOverdriveExplosionSpriteTemplate = +const struct SpriteTemplate gInfernoOverdriveExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_EXPLOSION_2, @@ -4590,7 +4590,7 @@ const struct SpriteTemplate gInfernoOverdriveExplosionSpriteTemplate = }; // hydro vortex -const struct SpriteTemplate gHydroVortexSuperpowerSpriteTemplate = +const struct SpriteTemplate gHydroVortexSuperpowerSpriteTemplate = { .tileTag = ANIM_TAG_METEOR, .paletteTag = ANIM_TAG_WATER_ORB, @@ -4600,7 +4600,7 @@ const struct SpriteTemplate gHydroVortexSuperpowerSpriteTemplate = .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, .callback = SpriteCB_GrowingSuperpower }; -const struct SpriteTemplate gHydroVortexHurricaneSpriteTemplate = +const struct SpriteTemplate gHydroVortexHurricaneSpriteTemplate = { .tileTag = ANIM_TAG_GUST, .paletteTag = ANIM_TAG_WATER_ORB, @@ -4610,7 +4610,7 @@ const struct SpriteTemplate gHydroVortexHurricaneSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEllipticalGust }; -const struct SpriteTemplate gHydroVortexImpactSpriteTemplate = +const struct SpriteTemplate gHydroVortexImpactSpriteTemplate = { .tileTag = ANIM_TAG_IMPACT, .paletteTag = ANIM_TAG_WATER_ORB, @@ -4622,7 +4622,7 @@ const struct SpriteTemplate gHydroVortexImpactSpriteTemplate = }; // bloom doom -const struct SpriteTemplate gBloomDoomPetalSpinSpriteTemplate = +const struct SpriteTemplate gBloomDoomPetalSpinSpriteTemplate = { .tileTag = ANIM_TAG_FLOWER, .paletteTag = ANIM_TAG_FLOWER, @@ -4632,7 +4632,7 @@ const struct SpriteTemplate gBloomDoomPetalSpinSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFireSpiralOutward }; -const struct SpriteTemplate gBloomDoomGreenChargeSpriteTemplate = +const struct SpriteTemplate gBloomDoomGreenChargeSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_RAZOR_LEAF, @@ -4642,7 +4642,7 @@ const struct SpriteTemplate gBloomDoomGreenChargeSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gBloomDoomHurricaneSpriteTemplate = +const struct SpriteTemplate gBloomDoomHurricaneSpriteTemplate = { .tileTag = ANIM_TAG_GUST, .paletteTag = ANIM_TAG_RAZOR_LEAF, @@ -4652,7 +4652,7 @@ const struct SpriteTemplate gBloomDoomHurricaneSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEllipticalGustAttacker, }; -const struct SpriteTemplate gBloomDoomFlowerGeyserSpriteTemplate = +const struct SpriteTemplate gBloomDoomFlowerGeyserSpriteTemplate = { .tileTag = ANIM_TAG_FLOWER, .paletteTag = ANIM_TAG_FLOWER, @@ -4662,7 +4662,7 @@ const struct SpriteTemplate gBloomDoomFlowerGeyserSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_Geyser }; -const struct SpriteTemplate gBloomDoomGreenBeamSpriteTemplate = +const struct SpriteTemplate gBloomDoomGreenBeamSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_RAZOR_LEAF, @@ -4672,7 +4672,7 @@ const struct SpriteTemplate gBloomDoomGreenBeamSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimHyperBeamOrb }; -const struct SpriteTemplate gBloomDoomPetalStarSpriteTemplate = +const struct SpriteTemplate gBloomDoomPetalStarSpriteTemplate = { .tileTag = ANIM_TAG_FLOWER, .paletteTag = ANIM_TAG_FLOWER, @@ -4682,7 +4682,7 @@ const struct SpriteTemplate gBloomDoomPetalStarSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimNeedleArmSpike }; -const struct SpriteTemplate gBloomDoomExplosionSpriteTemplate = +const struct SpriteTemplate gBloomDoomExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION, .paletteTag = ANIM_TAG_RAZOR_LEAF, @@ -4694,7 +4694,7 @@ const struct SpriteTemplate gBloomDoomExplosionSpriteTemplate = }; // gigavolt havoc -const struct SpriteTemplate gGigavoltHavocChargingSpearSpriteTemplate = +const struct SpriteTemplate gGigavoltHavocChargingSpearSpriteTemplate = { .tileTag = ANIM_TAG_HAVOC_SPEAR, .paletteTag = ANIM_TAG_HAVOC_SPEAR, @@ -4704,7 +4704,7 @@ const struct SpriteTemplate gGigavoltHavocChargingSpearSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gGigavoltHavocLaunchSpearSpriteTemplate = +const struct SpriteTemplate gGigavoltHavocLaunchSpearSpriteTemplate = { .tileTag = ANIM_TAG_HAVOC_SPEAR, .paletteTag = ANIM_TAG_HAVOC_SPEAR, @@ -4714,7 +4714,7 @@ const struct SpriteTemplate gGigavoltHavocLaunchSpearSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSuperpowerFireball }; -const struct SpriteTemplate gGigavoltHavocRingsSpriteTemplate = +const struct SpriteTemplate gGigavoltHavocRingsSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -4724,7 +4724,7 @@ const struct SpriteTemplate gGigavoltHavocRingsSpriteTemplate = .affineAnims = gThinRingExpandingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gGigavoltHavocGeyserSpriteTemplate = +const struct SpriteTemplate gGigavoltHavocGeyserSpriteTemplate = { .tileTag = ANIM_TAG_VERTICAL_HEX, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -4736,7 +4736,7 @@ const struct SpriteTemplate gGigavoltHavocGeyserSpriteTemplate = }; // shattered psyche -const struct SpriteTemplate gShatteredPsycheReflectHitSpriteTemplate = +const struct SpriteTemplate gShatteredPsycheReflectHitSpriteTemplate = { .tileTag = ANIM_TAG_BLUE_LIGHT_WALL, .paletteTag = ANIM_TAG_BLUE_LIGHT_WALL, @@ -4746,7 +4746,7 @@ const struct SpriteTemplate gShatteredPsycheReflectHitSpriteTemplate = .affineAnims = gAffineAnims_HitSplat, .callback = AnimHitSplatBasic }; -const struct SpriteTemplate gShatteredPsychePinkChargeSpriteTemplate = +const struct SpriteTemplate gShatteredPsychePinkChargeSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_PINK_PETAL, @@ -4756,7 +4756,7 @@ const struct SpriteTemplate gShatteredPsychePinkChargeSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gShatteredPsycheRingSpriteTemplate = +const struct SpriteTemplate gShatteredPsycheRingSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_PINK_PETAL, @@ -4768,7 +4768,7 @@ const struct SpriteTemplate gShatteredPsycheRingSpriteTemplate = }; // subzero slammer -const struct SpriteTemplate gSubzeroSlammerIceSpinSpriteTemplate = +const struct SpriteTemplate gSubzeroSlammerIceSpinSpriteTemplate = { .tileTag = ANIM_TAG_ICE_CRYSTALS, .paletteTag = ANIM_TAG_ICE_CRYSTALS, @@ -4778,7 +4778,7 @@ const struct SpriteTemplate gSubzeroSlammerIceSpinSpriteTemplate = .affineAnims = gAffineAnims_IceCrystalHit, .callback = AnimFireSpiralOutward }; -const struct SpriteTemplate gSubzeroSlammerExplosionSpriteTemplate = +const struct SpriteTemplate gSubzeroSlammerExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_EXPLOSION_2, @@ -4788,7 +4788,7 @@ const struct SpriteTemplate gSubzeroSlammerExplosionSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gSubzeroSlammerIceSwirlSpriteTemplate = +const struct SpriteTemplate gSubzeroSlammerIceSwirlSpriteTemplate = { .tileTag = ANIM_TAG_ICE_CRYSTALS, .paletteTag = ANIM_TAG_ICE_CRYSTALS, @@ -4836,7 +4836,7 @@ static const union AffineAnimCmd* const sDevastatingDrakeLeftAffineAnimTable[] = sDevastatingDrakeLeftAffineAnims, sDevastatingDrakeLeftAffineAnims, }; -const struct SpriteTemplate gDevastatingDrakePurpleEnergySpriteTemplate = +const struct SpriteTemplate gDevastatingDrakePurpleEnergySpriteTemplate = { .tileTag = ANIM_TAG_FOCUS_ENERGY, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -4846,7 +4846,7 @@ const struct SpriteTemplate gDevastatingDrakePurpleEnergySpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEndureEnergy }; -const struct SpriteTemplate gDevastatingDrakeShockwaveSpriteTemplate = +const struct SpriteTemplate gDevastatingDrakeShockwaveSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -4856,7 +4856,7 @@ const struct SpriteTemplate gDevastatingDrakeShockwaveSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingShockWaveOrb }; -const struct SpriteTemplate gDevastatingDrakeDrakeUpSpriteTemplate = +const struct SpriteTemplate gDevastatingDrakeDrakeUpSpriteTemplate = { .tileTag = ANIM_TAG_PURPLE_DRAKE, .paletteTag = ANIM_TAG_PURPLE_DRAKE, @@ -4866,7 +4866,7 @@ const struct SpriteTemplate gDevastatingDrakeDrakeUpSpriteTemplate = .affineAnims = sDevastatingDrakeFlyUpAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gDevastatingDrakeRightSpriteTemplate = +const struct SpriteTemplate gDevastatingDrakeRightSpriteTemplate = { .tileTag = ANIM_TAG_PURPLE_DRAKE, .paletteTag = ANIM_TAG_PURPLE_DRAKE, @@ -4876,7 +4876,7 @@ const struct SpriteTemplate gDevastatingDrakeRightSpriteTemplate = .affineAnims = sDevastatingDrakeRightAffineAnimTable, .callback = AnimAssistPawprint }; -const struct SpriteTemplate gDevastatingDrakeLeftSpriteTemplate = +const struct SpriteTemplate gDevastatingDrakeLeftSpriteTemplate = { .tileTag = ANIM_TAG_PURPLE_DRAKE, .paletteTag = ANIM_TAG_PURPLE_DRAKE, @@ -4886,7 +4886,7 @@ const struct SpriteTemplate gDevastatingDrakeLeftSpriteTemplate = .affineAnims = sDevastatingDrakeLeftAffineAnimTable, .callback = AnimAssistPawprint }; -const struct SpriteTemplate gDevastatingDrakeStrikeSpriteTemplate = +const struct SpriteTemplate gDevastatingDrakeStrikeSpriteTemplate = { .tileTag = ANIM_TAG_PURPLE_DRAKE, .paletteTag = ANIM_TAG_PURPLE_DRAKE, @@ -4896,7 +4896,7 @@ const struct SpriteTemplate gDevastatingDrakeStrikeSpriteTemplate = .affineAnims = sDevastatingDrakeStrikeAffineAnimTable, .callback = AnimFlyBallAttack }; -const struct SpriteTemplate gDevastatingDrakePurpleBlastSpriteTemplate = +const struct SpriteTemplate gDevastatingDrakePurpleBlastSpriteTemplate = { .tileTag = ANIM_TAG_FIRE_PLUME, .paletteTag = ANIM_TAG_FIRE_PLUME, @@ -4906,7 +4906,7 @@ const struct SpriteTemplate gDevastatingDrakePurpleBlastSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimBlastBurnTargetPlume }; -const struct SpriteTemplate gDevastatingDrakeHexSpriteTemplate = +const struct SpriteTemplate gDevastatingDrakeHexSpriteTemplate = { .tileTag = ANIM_TAG_VERTICAL_HEX, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -4916,7 +4916,7 @@ const struct SpriteTemplate gDevastatingDrakeHexSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_Geyser }; -const struct SpriteTemplate gDevastatingDrakeExplosionSpriteTemplate = +const struct SpriteTemplate gDevastatingDrakeExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION, .paletteTag = ANIM_TAG_EXPLOSION, @@ -4926,7 +4926,7 @@ const struct SpriteTemplate gDevastatingDrakeExplosionSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gDevastatingDrakeExplosion2SpriteTemplate = +const struct SpriteTemplate gDevastatingDrakeExplosion2SpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_EXPLOSION_2, @@ -4938,7 +4938,7 @@ const struct SpriteTemplate gDevastatingDrakeExplosion2SpriteTemplate = }; // black hole eclipse -const struct SpriteTemplate gBlackHoleEclipseShockwaveSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseShockwaveSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_BLACK_BALL_2, @@ -4948,7 +4948,7 @@ const struct SpriteTemplate gBlackHoleEclipseShockwaveSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingShockWaveOrb }; -const struct SpriteTemplate gBlackHoleEclipseBlueRingSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseBlueRingSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_ICE_CHUNK, @@ -4958,7 +4958,7 @@ const struct SpriteTemplate gBlackHoleEclipseBlueRingSpriteTemplate = .affineAnims = gThinRingExpandingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gBlackHoleEclipseBlackRingSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseBlackRingSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_HANDS_AND_FEET, @@ -4968,7 +4968,7 @@ const struct SpriteTemplate gBlackHoleEclipseBlackRingSpriteTemplate = .affineAnims = gThinRingExpandingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gBlackHoleEclipseRedExplosionSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseRedExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -4978,7 +4978,7 @@ const struct SpriteTemplate gBlackHoleEclipseRedExplosionSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gBlackHoleEclipseWispSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseWispSpriteTemplate = { .tileTag = ANIM_TAG_WISP_ORB, .paletteTag = ANIM_TAG_HANDS_AND_FEET, @@ -4988,7 +4988,7 @@ const struct SpriteTemplate gBlackHoleEclipseWispSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimWillOWispOrb }; -const struct SpriteTemplate gBlackHoleEclipseRedRingSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseRedRingSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -4998,7 +4998,7 @@ const struct SpriteTemplate gBlackHoleEclipseRedRingSpriteTemplate = .affineAnims = gThinRingExpandingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_ICE_CHUNK, @@ -5008,7 +5008,7 @@ const struct SpriteTemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate = .affineAnims = gThinRingShrinkingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5026,7 +5026,7 @@ static const union AffineAnimCmd gGrowingBackHoleTargetAffineCmds[] = { static const union AffineAnimCmd *const gGrowingBlackHoleTargetAffineAnimTable[] = { gGrowingBackHoleTargetAffineCmds, }; -const struct SpriteTemplate gBlackHoleEclipseHoleSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseHoleSpriteTemplate = { .tileTag = ANIM_TAG_SHADOW_BALL, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5044,7 +5044,7 @@ static const union AffineAnimCmd gShrinkingBlackHoleAffineCmds[] = { static const union AffineAnimCmd *const gShrinkingBlackHoleAffineAnimTable[] = { gShrinkingBlackHoleAffineCmds, }; -const struct SpriteTemplate gBlackHoleEclipseHoleShrinkSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseHoleShrinkSpriteTemplate = { .tileTag = ANIM_TAG_SHADOW_BALL, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5062,7 +5062,7 @@ static const union AffineAnimCmd gGrowingBackHoleAffineCmds[] = { static const union AffineAnimCmd *const gGrowingBlackHoleAffineAnimTable[] = { gGrowingBackHoleAffineCmds, }; -const struct SpriteTemplate gBlackHoleEclipseHoleUserSpriteTemplate = +const struct SpriteTemplate gBlackHoleEclipseHoleUserSpriteTemplate = { .tileTag = ANIM_TAG_SHADOW_BALL, .paletteTag = ANIM_TAG_HANDS_AND_FEET, @@ -5072,7 +5072,7 @@ const struct SpriteTemplate gBlackHoleEclipseHoleUserSpriteTemplate = .affineAnims = gGrowingBlackHoleAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gTargetTwinkleSpriteTemplate = +const struct SpriteTemplate gTargetTwinkleSpriteTemplate = { .tileTag = ANIM_TAG_SPARKLE_4, .paletteTag = ANIM_TAG_SPARKLE_4, @@ -5098,7 +5098,7 @@ static const union AffineAnimCmd *const sTwinkleTackleStarAffineAnimTable[] = { sTwinkleTackleStarPlayerAffineAnims, sTwinkleTackleStarOpponentAffineAnims }; -const struct SpriteTemplate gTwinkleTacklePinkStarSpriteTemplate = +const struct SpriteTemplate gTwinkleTacklePinkStarSpriteTemplate = { .tileTag = ANIM_TAG_SPARKLE_2, .paletteTag = ANIM_TAG_PINK_PETAL, @@ -5108,7 +5108,7 @@ const struct SpriteTemplate gTwinkleTacklePinkStarSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimGrantingStars }; -const struct SpriteTemplate gTwinkleTacklePinkRingSpriteTemplate = +const struct SpriteTemplate gTwinkleTacklePinkRingSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_PINK_PETAL, @@ -5118,7 +5118,7 @@ const struct SpriteTemplate gTwinkleTacklePinkRingSpriteTemplate = .affineAnims = gThinRingExpandingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gTwinkleTackleStarGrowSpriteTemplate = +const struct SpriteTemplate gTwinkleTackleStarGrowSpriteTemplate = { .tileTag = ANIM_TAG_YELLOW_STAR, .paletteTag = ANIM_TAG_YELLOW_STAR, @@ -5128,7 +5128,7 @@ const struct SpriteTemplate gTwinkleTackleStarGrowSpriteTemplate = .affineAnims = sTwinkleTackleStarAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gTwinkleTackleTwinkleSpriteTemplate = +const struct SpriteTemplate gTwinkleTackleTwinkleSpriteTemplate = { .tileTag = ANIM_TAG_SPARKLE_4, .paletteTag = ANIM_TAG_SPARKLE_4, @@ -5138,7 +5138,7 @@ const struct SpriteTemplate gTwinkleTackleTwinkleSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_TwinkleOnBattler }; -const struct SpriteTemplate gTwinkleTackleDigStarSpriteTemplate = +const struct SpriteTemplate gTwinkleTackleDigStarSpriteTemplate = { .tileTag = ANIM_TAG_YELLOW_STAR, .paletteTag = ANIM_TAG_YELLOW_STAR, @@ -5148,7 +5148,7 @@ const struct SpriteTemplate gTwinkleTackleDigStarSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimDirtPlumeParticle }; -const struct SpriteTemplate gTwinkleTackleYellowImpactSpriteTemplate = +const struct SpriteTemplate gTwinkleTackleYellowImpactSpriteTemplate = { .tileTag = ANIM_TAG_IMPACT, .paletteTag = ANIM_TAG_YELLOW_STAR, @@ -5158,7 +5158,7 @@ const struct SpriteTemplate gTwinkleTackleYellowImpactSpriteTemplate = .affineAnims = gAffineAnims_HitSplat, .callback = AnimHitSplatBasic }; -const struct SpriteTemplate gTwinkleTackleImpactStarsSpriteTemplate = +const struct SpriteTemplate gTwinkleTackleImpactStarsSpriteTemplate = { .tileTag = ANIM_TAG_PAIN_SPLIT, .paletteTag = ANIM_TAG_YELLOW_STAR, @@ -5170,7 +5170,7 @@ const struct SpriteTemplate gTwinkleTackleImpactStarsSpriteTemplate = }; // catastrokpika -const struct SpriteTemplate gCatastrokpikaSuperpowerSpriteTemplate = +const struct SpriteTemplate gCatastrokpikaSuperpowerSpriteTemplate = { .tileTag = ANIM_TAG_METEOR, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -5182,7 +5182,7 @@ const struct SpriteTemplate gCatastrokpikaSuperpowerSpriteTemplate = }; // 10e6 volt thunderbolt -const struct SpriteTemplate g10MillionVoltBoltYellowFlySpriteTemplate = +const struct SpriteTemplate g10MillionVoltBoltYellowFlySpriteTemplate = { .tileTag = ANIM_TAG_ROUND_SHADOW, .paletteTag = ANIM_TAG_SPARK_2, @@ -5192,7 +5192,7 @@ const struct SpriteTemplate g10MillionVoltBoltYellowFlySpriteTemplate = .affineAnims = gAffineAnims_FlyBallUp, .callback = AnimFlyBallUp }; -const struct SpriteTemplate g10MillionVoltBoltShockwaveSpriteTemplate = +const struct SpriteTemplate g10MillionVoltBoltShockwaveSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -5202,7 +5202,7 @@ const struct SpriteTemplate g10MillionVoltBoltShockwaveSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingShockWaveOrbOnTarget, }; -const struct SpriteTemplate g10MillionVoltBoltRedBeamSpriteTemplate = +const struct SpriteTemplate g10MillionVoltBoltRedBeamSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5212,7 +5212,7 @@ const struct SpriteTemplate g10MillionVoltBoltRedBeamSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimHyperBeamOrb }; -const struct SpriteTemplate g10MillionVoltBoltBlueBeamSpriteTemplate = +const struct SpriteTemplate g10MillionVoltBoltBlueBeamSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5222,7 +5222,7 @@ const struct SpriteTemplate g10MillionVoltBoltBlueBeamSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimHyperBeamOrb }; -const struct SpriteTemplate g10MillionVoltBoltPinkBeamSpriteTemplate = +const struct SpriteTemplate g10MillionVoltBoltPinkBeamSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_BERRY_EATEN, @@ -5232,7 +5232,7 @@ const struct SpriteTemplate g10MillionVoltBoltPinkBeamSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimHyperBeamOrb }; -const struct SpriteTemplate g10MillionVoltBoltYellowBeamSpriteTemplate = +const struct SpriteTemplate g10MillionVoltBoltYellowBeamSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ELECTRIC_ORBS, @@ -5242,7 +5242,7 @@ const struct SpriteTemplate g10MillionVoltBoltYellowBeamSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimHyperBeamOrb }; -const struct SpriteTemplate g10MillionVoltBoltGreenBeamSpriteTemplate = +const struct SpriteTemplate g10MillionVoltBoltGreenBeamSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_LEAF, @@ -5252,7 +5252,7 @@ const struct SpriteTemplate g10MillionVoltBoltGreenBeamSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimHyperBeamOrb }; -const struct SpriteTemplate g10MillionVoltBoltPurpleBeamSpriteTemplate = +const struct SpriteTemplate g10MillionVoltBoltPurpleBeamSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -5264,7 +5264,7 @@ const struct SpriteTemplate g10MillionVoltBoltPurpleBeamSpriteTemplate = }; // stoked sparksurfer -const struct SpriteTemplate gStokedSparksurferFlySpriteTemplate = +const struct SpriteTemplate gStokedSparksurferFlySpriteTemplate = { .tileTag = ANIM_TAG_ROUND_SHADOW, .paletteTag = ANIM_TAG_SPARK_2, @@ -5276,7 +5276,7 @@ const struct SpriteTemplate gStokedSparksurferFlySpriteTemplate = }; // extreme evoboost -const struct SpriteTemplate gExtremeEvoboostRedChargeUpSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostRedChargeUpSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5286,7 +5286,7 @@ const struct SpriteTemplate gExtremeEvoboostRedChargeUpSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gExtremeEvoboostPinkChargeUpSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostPinkChargeUpSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_BERRY_EATEN, @@ -5296,7 +5296,7 @@ const struct SpriteTemplate gExtremeEvoboostPinkChargeUpSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gExtremeEvoboostIceChargeUpSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostIceChargeUpSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_ICE_CHUNK, @@ -5306,7 +5306,7 @@ const struct SpriteTemplate gExtremeEvoboostIceChargeUpSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gExtremeEvoboostBlackChargeUpSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostBlackChargeUpSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_WISP_ORB, @@ -5316,7 +5316,7 @@ const struct SpriteTemplate gExtremeEvoboostBlackChargeUpSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gExtremeEvoboostBlueChargeUpSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostBlueChargeUpSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5326,7 +5326,7 @@ const struct SpriteTemplate gExtremeEvoboostBlueChargeUpSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gExtremeEvoboostPurpleChargeUpSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostPurpleChargeUpSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -5336,7 +5336,7 @@ const struct SpriteTemplate gExtremeEvoboostPurpleChargeUpSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gExtremeEvoboostYellowChargeUpSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostYellowChargeUpSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -5346,7 +5346,7 @@ const struct SpriteTemplate gExtremeEvoboostYellowChargeUpSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gExtremeEvoboostGreenChargeUpSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostGreenChargeUpSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_LEAF, @@ -5356,7 +5356,7 @@ const struct SpriteTemplate gExtremeEvoboostGreenChargeUpSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gExtremeEvoboostRedChargeCircleSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostRedChargeCircleSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5366,7 +5366,7 @@ const struct SpriteTemplate gExtremeEvoboostRedChargeCircleSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimExtremeEvoboostCircle }; -const struct SpriteTemplate gExtremeEvoboostPinkChargeCircleSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostPinkChargeCircleSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_BERRY_EATEN, @@ -5376,7 +5376,7 @@ const struct SpriteTemplate gExtremeEvoboostPinkChargeCircleSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimExtremeEvoboostCircle }; -const struct SpriteTemplate gExtremeEvoboostIceChargeCircleSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostIceChargeCircleSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_ICE_CHUNK, @@ -5386,7 +5386,7 @@ const struct SpriteTemplate gExtremeEvoboostIceChargeCircleSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimExtremeEvoboostCircle }; -const struct SpriteTemplate gExtremeEvoboostBlackChargeCircleSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostBlackChargeCircleSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_WISP_ORB, @@ -5396,7 +5396,7 @@ const struct SpriteTemplate gExtremeEvoboostBlackChargeCircleSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimExtremeEvoboostCircle }; -const struct SpriteTemplate gExtremeEvoboostBlueChargeCircleSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostBlueChargeCircleSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5406,7 +5406,7 @@ const struct SpriteTemplate gExtremeEvoboostBlueChargeCircleSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimExtremeEvoboostCircle }; -const struct SpriteTemplate gExtremeEvoboostPurpleChargeCircleSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostPurpleChargeCircleSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -5416,7 +5416,7 @@ const struct SpriteTemplate gExtremeEvoboostPurpleChargeCircleSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimExtremeEvoboostCircle }; -const struct SpriteTemplate gExtremeEvoboostYellowChargeCircleSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostYellowChargeCircleSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -5426,7 +5426,7 @@ const struct SpriteTemplate gExtremeEvoboostYellowChargeCircleSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimExtremeEvoboostCircle }; -const struct SpriteTemplate gExtremeEvoboostGreenChargeCircleSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostGreenChargeCircleSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_LEAF, @@ -5436,7 +5436,7 @@ const struct SpriteTemplate gExtremeEvoboostGreenChargeCircleSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimExtremeEvoboostCircle }; -const struct SpriteTemplate gExtremeEvoboostRedStockpileSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostRedStockpileSpriteTemplate = { .tileTag = ANIM_TAG_WATER_ORB, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5446,7 +5446,7 @@ const struct SpriteTemplate gExtremeEvoboostRedStockpileSpriteTemplate = .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, .callback = AnimPowerAbsorptionOrb }; -const struct SpriteTemplate gExtremeEvoboostPinkStockpileSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostPinkStockpileSpriteTemplate = { .tileTag = ANIM_TAG_WATER_ORB, .paletteTag = ANIM_TAG_BERRY_EATEN, @@ -5456,7 +5456,7 @@ const struct SpriteTemplate gExtremeEvoboostPinkStockpileSpriteTemplate = .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, .callback = AnimPowerAbsorptionOrb }; -const struct SpriteTemplate gExtremeEvoboostIceStockpileSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostIceStockpileSpriteTemplate = { .tileTag = ANIM_TAG_WATER_ORB, .paletteTag = ANIM_TAG_ICE_CHUNK, @@ -5466,7 +5466,7 @@ const struct SpriteTemplate gExtremeEvoboostIceStockpileSpriteTemplate = .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, .callback = AnimPowerAbsorptionOrb }; -const struct SpriteTemplate gExtremeEvoboostBlackStockpileSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostBlackStockpileSpriteTemplate = { .tileTag = ANIM_TAG_WATER_ORB, .paletteTag = ANIM_TAG_WISP_ORB, @@ -5476,7 +5476,7 @@ const struct SpriteTemplate gExtremeEvoboostBlackStockpileSpriteTemplate = .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, .callback = AnimPowerAbsorptionOrb }; -const struct SpriteTemplate gExtremeEvoboostBlueStockpileSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostBlueStockpileSpriteTemplate = { .tileTag = ANIM_TAG_WATER_ORB, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5486,7 +5486,7 @@ const struct SpriteTemplate gExtremeEvoboostBlueStockpileSpriteTemplate = .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, .callback = AnimPowerAbsorptionOrb }; -const struct SpriteTemplate gExtremeEvoboostPurpleStockpileSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostPurpleStockpileSpriteTemplate = { .tileTag = ANIM_TAG_WATER_ORB, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -5496,7 +5496,7 @@ const struct SpriteTemplate gExtremeEvoboostPurpleStockpileSpriteTemplate = .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, .callback = AnimPowerAbsorptionOrb }; -const struct SpriteTemplate gExtremeEvoboostYellowStockpileSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostYellowStockpileSpriteTemplate = { .tileTag = ANIM_TAG_WATER_ORB, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -5506,7 +5506,7 @@ const struct SpriteTemplate gExtremeEvoboostYellowStockpileSpriteTemplate = .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, .callback = AnimPowerAbsorptionOrb }; -const struct SpriteTemplate gExtremeEvoboostGreenStockpileSpriteTemplate = +const struct SpriteTemplate gExtremeEvoboostGreenStockpileSpriteTemplate = { .tileTag = ANIM_TAG_WATER_ORB, .paletteTag = ANIM_TAG_LEAF, @@ -5518,7 +5518,7 @@ const struct SpriteTemplate gExtremeEvoboostGreenStockpileSpriteTemplate = }; // pulverizing pancake -const struct SpriteTemplate gPulverizingPancakeRedDetectSpriteTemplate = +const struct SpriteTemplate gPulverizingPancakeRedDetectSpriteTemplate = { .tileTag = ANIM_TAG_SPARKLE_4, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5528,7 +5528,7 @@ const struct SpriteTemplate gPulverizingPancakeRedDetectSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpinningSparkle }; -const struct SpriteTemplate gPulverizingPancakeExplosionSpriteTemplate = +const struct SpriteTemplate gPulverizingPancakeExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION, .paletteTag = ANIM_TAG_ELECTRIC_ORBS, @@ -5538,7 +5538,7 @@ const struct SpriteTemplate gPulverizingPancakeExplosionSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gPulverizingPancakeYellowRingSpriteTemplate = +const struct SpriteTemplate gPulverizingPancakeYellowRingSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_ELECTRIC_ORBS, @@ -5550,7 +5550,7 @@ const struct SpriteTemplate gPulverizingPancakeYellowRingSpriteTemplate = }; // genesis supernova -const struct SpriteTemplate gGenesisSupernovaOrbRiseSpriteTemplate = +const struct SpriteTemplate gGenesisSupernovaOrbRiseSpriteTemplate = { .tileTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_JAB, @@ -5560,7 +5560,7 @@ const struct SpriteTemplate gGenesisSupernovaOrbRiseSpriteTemplate = .affineAnims = gAffineAnims_Bubble, .callback = AnimAssistPawprint }; -const struct SpriteTemplate gGenesisSupernovaReversalSpriteTemplate = +const struct SpriteTemplate gGenesisSupernovaReversalSpriteTemplate = { .tileTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_JAB, @@ -5570,7 +5570,7 @@ const struct SpriteTemplate gGenesisSupernovaReversalSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimReversalOrb }; -const struct SpriteTemplate gGenesisSupernovaSpinUpSpriteTemplate = +const struct SpriteTemplate gGenesisSupernovaSpinUpSpriteTemplate = { .tileTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_JAB, @@ -5580,7 +5580,7 @@ const struct SpriteTemplate gGenesisSupernovaSpinUpSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gGenesisSupernovaChargeSpriteTemplate = +const struct SpriteTemplate gGenesisSupernovaChargeSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_POISON_JAB, @@ -5590,7 +5590,7 @@ const struct SpriteTemplate gGenesisSupernovaChargeSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gGenesisSupernovaSuperpowerSpriteTemplate = +const struct SpriteTemplate gGenesisSupernovaSuperpowerSpriteTemplate = { .tileTag = ANIM_TAG_METEOR, .paletteTag = ANIM_TAG_WISP_ORB, @@ -5600,7 +5600,7 @@ const struct SpriteTemplate gGenesisSupernovaSuperpowerSpriteTemplate = .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, .callback = SpriteCB_GrowingSuperpower }; -const struct SpriteTemplate gGenesisSupernovaBubbleSpriteTemplate = +const struct SpriteTemplate gGenesisSupernovaBubbleSpriteTemplate = { .tileTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_JAB, @@ -5610,7 +5610,7 @@ const struct SpriteTemplate gGenesisSupernovaBubbleSpriteTemplate = .affineAnims = gAffineAnims_Bubble, .callback = AnimBubbleEffect }; -const struct SpriteTemplate gGenesisSupernovaExplosionSpriteTemplate = +const struct SpriteTemplate gGenesisSupernovaExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION, .paletteTag = ANIM_TAG_WISP_ORB, @@ -5650,7 +5650,7 @@ static const union AffineAnimCmd *const sArrowRaidFlyLeftAffineAnimTable[] = { sArrowRaidFlyLeftAffineAnims, sArrowRaidFlyLeftAffineAnims }; -const struct SpriteTemplate gArrowRaidExplosionSpriteTemplate = +const struct SpriteTemplate gArrowRaidExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -5660,7 +5660,7 @@ const struct SpriteTemplate gArrowRaidExplosionSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gArrowRaidFlyUpSpriteTemplate = +const struct SpriteTemplate gArrowRaidFlyUpSpriteTemplate = { .tileTag = ANIM_TAG_ROUND_SHADOW, .paletteTag = ANIM_TAG_LEAF, @@ -5670,7 +5670,7 @@ const struct SpriteTemplate gArrowRaidFlyUpSpriteTemplate = .affineAnims = gAffineAnims_FlyBallUp, .callback = AnimFlyBallUp }; -const struct SpriteTemplate gArrowRaidFlyRightSpriteTemplate = +const struct SpriteTemplate gArrowRaidFlyRightSpriteTemplate = { .tileTag = ANIM_TAG_BIRD, .paletteTag = ANIM_TAG_LEAF, @@ -5680,7 +5680,7 @@ const struct SpriteTemplate gArrowRaidFlyRightSpriteTemplate = .affineAnims = sArrowRaidFlyRightAffineAnimTable, .callback = AnimAssistPawprint }; -const struct SpriteTemplate gArrowRaidFlyLeftSpriteTemplate = +const struct SpriteTemplate gArrowRaidFlyLeftSpriteTemplate = { .tileTag = ANIM_TAG_BIRD, .paletteTag = ANIM_TAG_LEAF, @@ -5690,7 +5690,7 @@ const struct SpriteTemplate gArrowRaidFlyLeftSpriteTemplate = .affineAnims = sArrowRaidFlyLeftAffineAnimTable, .callback = AnimAssistPawprint }; -const struct SpriteTemplate gArrowRaidFlyStrikeSpriteTemplate = +const struct SpriteTemplate gArrowRaidFlyStrikeSpriteTemplate = { .tileTag = ANIM_TAG_BIRD, .paletteTag = ANIM_TAG_LEAF, @@ -5707,7 +5707,7 @@ static const union AffineAnimCmd sArrowRaidArrowUpAffineAnims[] = { static const union AffineAnimCmd *const sArrowRaidArrowUpAffineAnimTable[] = { sArrowRaidArrowUpAffineAnims, }; -const struct SpriteTemplate gArrowRaidArrowUpSpriteTemplate = +const struct SpriteTemplate gArrowRaidArrowUpSpriteTemplate = { .tileTag = ANIM_TAG_SPIRIT_ARROW, .paletteTag = ANIM_TAG_SPIRIT_ARROW, @@ -5724,7 +5724,7 @@ static const union AffineAnimCmd sArrowRaidArrowRightUpAffineAnims[] = { static const union AffineAnimCmd *const sArrowRaidArrowRightUpAffineAnimTable[] = { sArrowRaidArrowRightUpAffineAnims, }; -const struct SpriteTemplate gArrowRaidRightUpSpriteTemplate = +const struct SpriteTemplate gArrowRaidRightUpSpriteTemplate = { .tileTag = ANIM_TAG_SPIRIT_ARROW, .paletteTag = ANIM_TAG_SPIRIT_ARROW, @@ -5741,7 +5741,7 @@ static const union AffineAnimCmd sArrowRaidRightDownAffineAnims[] = { static const union AffineAnimCmd *const sArrowRaidRightDownAffineAnimTable[] = { sArrowRaidRightDownAffineAnims, }; -const struct SpriteTemplate gArrowRaidRightDownSpriteTemplate = +const struct SpriteTemplate gArrowRaidRightDownSpriteTemplate = { .tileTag = ANIM_TAG_SPIRIT_ARROW, .paletteTag = ANIM_TAG_SPIRIT_ARROW, @@ -5758,7 +5758,7 @@ static const union AffineAnimCmd sArrowRaidArrowLeftUpAffineAnims[] = { static const union AffineAnimCmd *const sArrowRaidLeftUpAffineAnimTable[] = { sArrowRaidArrowLeftUpAffineAnims, }; -const struct SpriteTemplate gArrowRaidLeftUpSpriteTemplate = +const struct SpriteTemplate gArrowRaidLeftUpSpriteTemplate = { .tileTag = ANIM_TAG_SPIRIT_ARROW, .paletteTag = ANIM_TAG_SPIRIT_ARROW, @@ -5775,7 +5775,7 @@ static const union AffineAnimCmd sArrowRaidFaceUpLeftAffineAnims[] = { static const union AffineAnimCmd *const sArrowRaidFaceUpLeftAffineAnimTable[] = { sArrowRaidFaceUpLeftAffineAnims, }; -const struct SpriteTemplate gArrowRaidFaceUpLeftSpriteTemplate = +const struct SpriteTemplate gArrowRaidFaceUpLeftSpriteTemplate = { .tileTag = ANIM_TAG_SPIRIT_ARROW, .paletteTag = ANIM_TAG_SPIRIT_ARROW, @@ -5792,7 +5792,7 @@ static const union AffineAnimCmd sArrowRaidArrowFaceRightAffineAnims[] = { static const union AffineAnimCmd *const sArrowRaidArrowFaceRightAffineAnimTable[] = { sArrowRaidArrowFaceRightAffineAnims }; -const struct SpriteTemplate gArrowRaidRightSpriteTemplate = +const struct SpriteTemplate gArrowRaidRightSpriteTemplate = { .tileTag = ANIM_TAG_SPIRIT_ARROW, .paletteTag = ANIM_TAG_SPIRIT_ARROW, @@ -5809,7 +5809,7 @@ static const union AffineAnimCmd sArrowRaidLeftDownAffineAnims[] = { static const union AffineAnimCmd *const sArrowRaidLeftDownAffineAnimTable[] = { sArrowRaidLeftDownAffineAnims }; -const struct SpriteTemplate gArrowRaidLeftDownSpriteTemplate = +const struct SpriteTemplate gArrowRaidLeftDownSpriteTemplate = { .tileTag = ANIM_TAG_SPIRIT_ARROW, .paletteTag = ANIM_TAG_SPIRIT_ARROW, @@ -5826,7 +5826,7 @@ static const union AffineAnimCmd sArrowRaidOnslaughtAffineAnims[] = { static const union AffineAnimCmd *const sArrowRaidOnslaughtAffineAnimTable[] = { sArrowRaidOnslaughtAffineAnims }; -const struct SpriteTemplate gArrowRaidArrowOnslaughtSpriteTemplate = +const struct SpriteTemplate gArrowRaidArrowOnslaughtSpriteTemplate = { .tileTag = ANIM_TAG_SPIRIT_ARROW, .paletteTag = ANIM_TAG_SPIRIT_ARROW, @@ -5838,7 +5838,7 @@ const struct SpriteTemplate gArrowRaidArrowOnslaughtSpriteTemplate = }; // malicious moonsault -const struct SpriteTemplate gMaliciousMoonsaultRedFlySpriteTemplate = +const struct SpriteTemplate gMaliciousMoonsaultRedFlySpriteTemplate = { .tileTag = ANIM_TAG_ROUND_SHADOW, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5848,7 +5848,7 @@ const struct SpriteTemplate gMaliciousMoonsaultRedFlySpriteTemplate = .affineAnims = gAffineAnims_FlyBallUp, .callback = AnimFlyBallUp }; -const struct SpriteTemplate gMaliciousMoonsaultRedBounceSpriteTemplate = +const struct SpriteTemplate gMaliciousMoonsaultRedBounceSpriteTemplate = { .tileTag = ANIM_TAG_ROUND_SHADOW, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5858,7 +5858,7 @@ const struct SpriteTemplate gMaliciousMoonsaultRedBounceSpriteTemplate = .affineAnims = gAffineAnims_BounceBallLand, .callback = AnimBounceBallLand }; -const struct SpriteTemplate gMaliciousMoonsaultRedImpactSpriteTemplate = +const struct SpriteTemplate gMaliciousMoonsaultRedImpactSpriteTemplate = { .tileTag = ANIM_TAG_IMPACT, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5868,7 +5868,7 @@ const struct SpriteTemplate gMaliciousMoonsaultRedImpactSpriteTemplate = .affineAnims = gAffineAnims_HitSplat, .callback = AnimHitSplatBasic }; -const struct SpriteTemplate gMaliciousMoonsaultFireblastSpriteTemplate = +const struct SpriteTemplate gMaliciousMoonsaultFireblastSpriteTemplate = { .tileTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -5878,7 +5878,7 @@ const struct SpriteTemplate gMaliciousMoonsaultFireblastSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFireCross }; -const struct SpriteTemplate gMaliciousMoonsaultExplosionSpriteTemplate = +const struct SpriteTemplate gMaliciousMoonsaultExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_EXPLOSION_2, @@ -5900,7 +5900,7 @@ const struct SpriteTemplate gOceanOperaSpotlightSpriteTemplate = .affineAnims = gSpotlightAffineAnimTable, .callback = AnimOceanicOperettaSpotlight, }; -const struct SpriteTemplate gOceanOperaBlueFlareSpriteTemplate = +const struct SpriteTemplate gOceanOperaBlueFlareSpriteTemplate = { .tileTag = ANIM_TAG_FOCUS_ENERGY, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5910,7 +5910,7 @@ const struct SpriteTemplate gOceanOperaBlueFlareSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEndureEnergy }; -const struct SpriteTemplate gOceanOperaBlueChargeSpriteTemplate = +const struct SpriteTemplate gOceanOperaBlueChargeSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5920,7 +5920,7 @@ const struct SpriteTemplate gOceanOperaBlueChargeSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gOceanOperaBlueRingSpriteTemplate = +const struct SpriteTemplate gOceanOperaBlueRingSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5930,7 +5930,7 @@ const struct SpriteTemplate gOceanOperaBlueRingSpriteTemplate = .affineAnims = gThinRingShrinkingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gOceanOperaMovingOrbsSpriteTemplate = +const struct SpriteTemplate gOceanOperaMovingOrbsSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5940,7 +5940,7 @@ const struct SpriteTemplate gOceanOperaMovingOrbsSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimThrowMistBall }; -const struct SpriteTemplate gOceanOperaBlueOrbsSpriteTemplate = +const struct SpriteTemplate gOceanOperaBlueOrbsSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5950,7 +5950,7 @@ const struct SpriteTemplate gOceanOperaBlueOrbsSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimBite }; -const struct SpriteTemplate gOceanOperaExpandingRingSpriteTemplate = +const struct SpriteTemplate gOceanOperaExpandingRingSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5960,7 +5960,7 @@ const struct SpriteTemplate gOceanOperaExpandingRingSpriteTemplate = .affineAnims = gThinRingExpandingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gOceanOperaExplosionSpriteTemplate = +const struct SpriteTemplate gOceanOperaExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5970,7 +5970,7 @@ const struct SpriteTemplate gOceanOperaExplosionSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gOceanOperaSparkleSpriteTemplate = +const struct SpriteTemplate gOceanOperaSparkleSpriteTemplate = { .tileTag = ANIM_TAG_SPARKLE_2, .paletteTag = ANIM_TAG_WATER_ORB, @@ -5982,7 +5982,7 @@ const struct SpriteTemplate gOceanOperaSparkleSpriteTemplate = }; // splintered stormshards -const struct SpriteTemplate gSplinteredShardsFlySpriteTemplate = +const struct SpriteTemplate gSplinteredShardsFlySpriteTemplate = { .tileTag = ANIM_TAG_ROUND_SHADOW, .paletteTag = ANIM_TAG_ROCKS, @@ -5992,7 +5992,7 @@ const struct SpriteTemplate gSplinteredShardsFlySpriteTemplate = .affineAnims = gAffineAnims_FlyBallUp, .callback = AnimFlyBallUp }; -const struct SpriteTemplate gSplinteredShardsExplosionSpriteTemplate = +const struct SpriteTemplate gSplinteredShardsExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION, .paletteTag = ANIM_TAG_ROCKS, @@ -6002,7 +6002,7 @@ const struct SpriteTemplate gSplinteredShardsExplosionSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gSplinteredShardsRisingSpearSpriteTemplate = +const struct SpriteTemplate gSplinteredShardsRisingSpearSpriteTemplate = { .tileTag = ANIM_TAG_ICICLE_SPEAR, .paletteTag = ANIM_TAG_ROCKS, @@ -6019,7 +6019,7 @@ static const union AffineAnimCmd sSplinteredShardsOpponentSteepAffineAnims[] = { static const union AffineAnimCmd *const sSplinteredShardsOpponentSteepAffineAnimTable[] = { sSplinteredShardsOpponentSteepAffineAnims, }; -const struct SpriteTemplate gSplinteredShardsSplinterOpponentSteepSpriteTemplate = +const struct SpriteTemplate gSplinteredShardsSplinterOpponentSteepSpriteTemplate = { .tileTag = ANIM_TAG_ICICLE_SPEAR, .paletteTag = ANIM_TAG_ROCKS, @@ -6036,7 +6036,7 @@ static const union AffineAnimCmd sSplinteredShardsOpponentShallowAffineAnims[] = static const union AffineAnimCmd *const sSplinteredShardsOpponentShallowAffineAnimTable[] = { sSplinteredShardsOpponentShallowAffineAnims }; -const struct SpriteTemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate = +const struct SpriteTemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate = { .tileTag = ANIM_TAG_ICICLE_SPEAR, .paletteTag = ANIM_TAG_ROCKS, @@ -6053,7 +6053,7 @@ static const union AffineAnimCmd sSplinteredShardsPlayerSteepAffineAnims[] = { static const union AffineAnimCmd *const sSplinteredShardsPlayerSteepAffineAnimTable[] = { sSplinteredShardsPlayerSteepAffineAnims }; -const struct SpriteTemplate gSplinteredShardsSplinterPlayerSteepSpriteTemplate = +const struct SpriteTemplate gSplinteredShardsSplinterPlayerSteepSpriteTemplate = { .tileTag = ANIM_TAG_ICICLE_SPEAR, .paletteTag = ANIM_TAG_ROCKS, @@ -6070,7 +6070,7 @@ static const union AffineAnimCmd sSplinteredShardsPlayerShallowAffineAnims[] = { static const union AffineAnimCmd *const sSplinteredShardsPlayerShallowAffineAnimTable[] = { sSplinteredShardsPlayerShallowAffineAnims }; -const struct SpriteTemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate = +const struct SpriteTemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate = { .tileTag = ANIM_TAG_ICICLE_SPEAR, .paletteTag = ANIM_TAG_ROCKS, @@ -6082,7 +6082,7 @@ const struct SpriteTemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate }; // lets snuggle forever -const struct SpriteTemplate gSnuggleForeverEyesSpriteTemplate = +const struct SpriteTemplate gSnuggleForeverEyesSpriteTemplate = { .tileTag = ANIM_TAG_SPARKLE_4, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -6092,7 +6092,7 @@ const struct SpriteTemplate gSnuggleForeverEyesSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpinningSparkle }; -const struct SpriteTemplate gSnuggleForeverStarSpriteTemplate = +const struct SpriteTemplate gSnuggleForeverStarSpriteTemplate = { .tileTag = ANIM_TAG_PAIN_SPLIT, .paletteTag = ANIM_TAG_DUCK, @@ -6102,7 +6102,7 @@ const struct SpriteTemplate gSnuggleForeverStarSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimDizzyPunchDuck }; -const struct SpriteTemplate gSnuggleForeverHeartSpriteTemplate = +const struct SpriteTemplate gSnuggleForeverHeartSpriteTemplate = { .tileTag = ANIM_TAG_MAGENTA_HEART, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -6114,7 +6114,7 @@ const struct SpriteTemplate gSnuggleForeverHeartSpriteTemplate = }; // clangorous soulblaze -const struct SpriteTemplate gClangoorousSoulblazeWhiteFlySpriteTemplate = +const struct SpriteTemplate gClangoorousSoulblazeWhiteFlySpriteTemplate = { .tileTag = ANIM_TAG_ROUND_SHADOW, .paletteTag = ANIM_TAG_AIR_WAVE_2, @@ -6124,7 +6124,7 @@ const struct SpriteTemplate gClangoorousSoulblazeWhiteFlySpriteTemplate = .affineAnims = gAffineAnims_FlyBallUp, .callback = AnimFlyBallUp }; -const struct SpriteTemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate = +const struct SpriteTemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate = { .tileTag = ANIM_TAG_WATER_ORB, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -6134,7 +6134,7 @@ const struct SpriteTemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate = .affineAnims = gAffineAnims_Whirlpool, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gClangoorousSoulblazePurpleChargeSpriteTemplate = +const struct SpriteTemplate gClangoorousSoulblazePurpleChargeSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -6144,7 +6144,7 @@ const struct SpriteTemplate gClangoorousSoulblazePurpleChargeSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gClangoorousSoulblazePulseSpriteTemplate = +const struct SpriteTemplate gClangoorousSoulblazePulseSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -6155,8 +6155,8 @@ const struct SpriteTemplate gClangoorousSoulblazePulseSpriteTemplate = .callback = TranslateAnimSpriteToTargetMonLocation }; -// guardian of alola -const struct SpriteTemplate gGuardianOfAlolaFistSpriteTemplate = +// guardian of alola +const struct SpriteTemplate gGuardianOfAlolaFistSpriteTemplate = { .tileTag = ANIM_TAG_HORSESHOE_SIDE_FIST, .paletteTag = ANIM_TAG_HORSESHOE_SIDE_FIST, @@ -6166,7 +6166,7 @@ const struct SpriteTemplate gGuardianOfAlolaFistSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimStompFoot }; -const struct SpriteTemplate gGuardianOfAlolaDirtGeyserSpriteTemplate = +const struct SpriteTemplate gGuardianOfAlolaDirtGeyserSpriteTemplate = { .tileTag = ANIM_TAG_MUD_SAND, .paletteTag = ANIM_TAG_MUD_SAND, @@ -6186,7 +6186,7 @@ static const union AffineAnimCmd sSearingSunrazeSmashWormholeGrowingAffineAnims[ static const union AffineAnimCmd *const sSearingSunrazeSmashWormholeGrowingAffineAnimTable[] = { sSearingSunrazeSmashWormholeGrowingAffineAnims }; -const struct SpriteTemplate gSearingSunrazeSmashGrowWormholeSpriteTemplate = +const struct SpriteTemplate gSearingSunrazeSmashGrowWormholeSpriteTemplate = { .tileTag = ANIM_TAG_SHADOW_BALL, .paletteTag = ANIM_TAG_WATER_ORB, @@ -6196,7 +6196,7 @@ const struct SpriteTemplate gSearingSunrazeSmashGrowWormholeSpriteTemplate = .affineAnims = sSearingSunrazeSmashWormholeGrowingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate = +const struct SpriteTemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_WATER_ORB, @@ -6206,7 +6206,7 @@ const struct SpriteTemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate = .affineAnims = gThinRingShrinkingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gSearingSunrazeSmashWhiteRingInwardsSpriteTemplate = +const struct SpriteTemplate gSearingSunrazeSmashWhiteRingInwardsSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_AIR_WAVE_2, @@ -6216,7 +6216,7 @@ const struct SpriteTemplate gSearingSunrazeSmashWhiteRingInwardsSpriteTemplate = .affineAnims = gThinRingShrinkingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gSearingSunrazeSmashCrossImpactSpriteTemplate = +const struct SpriteTemplate gSearingSunrazeSmashCrossImpactSpriteTemplate = { .tileTag = ANIM_TAG_CROSS_IMPACT, .paletteTag = ANIM_TAG_AIR_WAVE_2, @@ -6226,7 +6226,7 @@ const struct SpriteTemplate gSearingSunrazeSmashCrossImpactSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimCrossImpact }; -const struct SpriteTemplate gSearingSunrazeSmashWhiteCutSpriteTemplate = +const struct SpriteTemplate gSearingSunrazeSmashWhiteCutSpriteTemplate = { .tileTag = ANIM_TAG_CUT, .paletteTag = ANIM_TAG_AIR_WAVE_2, @@ -6236,7 +6236,7 @@ const struct SpriteTemplate gSearingSunrazeSmashWhiteCutSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimCuttingSlice }; -const struct SpriteTemplate gSearingSunrazeSmashInfernoOrbSpriteTemplate = +const struct SpriteTemplate gSearingSunrazeSmashInfernoOrbSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -6246,7 +6246,7 @@ const struct SpriteTemplate gSearingSunrazeSmashInfernoOrbSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingChargeOrb }; -const struct SpriteTemplate gSearingSunrazeSmashShockwaveSpriteTemplate = +const struct SpriteTemplate gSearingSunrazeSmashShockwaveSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -6256,7 +6256,7 @@ const struct SpriteTemplate gSearingSunrazeSmashShockwaveSpriteTemplate = .affineAnims = gAffineAnims_GrowingElectricOrb, .callback = AnimGrowingShockWaveOrbOnTarget }; -const struct SpriteTemplate gSearingSunrazeSmashRedFlySpriteTemplate = +const struct SpriteTemplate gSearingSunrazeSmashRedFlySpriteTemplate = { .tileTag = ANIM_TAG_ROUND_SHADOW, .paletteTag = ANIM_TAG_VERTICAL_HEX, @@ -6268,7 +6268,7 @@ const struct SpriteTemplate gSearingSunrazeSmashRedFlySpriteTemplate = }; // menacing moonraze maelstrom -const struct SpriteTemplate gMoonrazeMaelstromBlueBuffSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromBlueBuffSpriteTemplate = { .tileTag = ANIM_TAG_FOCUS_ENERGY, .paletteTag = ANIM_TAG_WATER_ORB, @@ -6278,7 +6278,7 @@ const struct SpriteTemplate gMoonrazeMaelstromBlueBuffSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEndureEnergy }; -const struct SpriteTemplate gMoonrazeMaelstromBlackBuffSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromBlackBuffSpriteTemplate = { .tileTag = ANIM_TAG_FOCUS_ENERGY, .paletteTag = ANIM_TAG_HANDS_AND_FEET, @@ -6288,7 +6288,7 @@ const struct SpriteTemplate gMoonrazeMaelstromBlackBuffSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEndureEnergy }; -const struct SpriteTemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate = { .tileTag = ANIM_TAG_FOCUS_ENERGY, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -6298,7 +6298,7 @@ const struct SpriteTemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEndureEnergy }; -const struct SpriteTemplate gMoonrazeMaelstromBlackSparklesSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromBlackSparklesSpriteTemplate = { .tileTag = ANIM_TAG_SPARKLE_2, .paletteTag = ANIM_TAG_HANDS_AND_FEET, @@ -6308,27 +6308,27 @@ const struct SpriteTemplate gMoonrazeMaelstromBlackSparklesSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimGrantingStars }; -const struct SpriteTemplate gMoonrazeMaelstromBlueRingSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromBlueRingSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_WATER_ORB, .oam = &gOamData_AffineDouble_ObjBlend_64x64, .anims = gDummySpriteAnimTable, - .images = NULL, + .images = NULL, .affineAnims = gThinRingShrinkingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gMoonrazeMaelstromWhiteRingSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromWhiteRingSpriteTemplate = { .tileTag = ANIM_TAG_THIN_RING, .paletteTag = ANIM_TAG_AIR_WAVE_2, .oam = &gOamData_AffineDouble_ObjBlend_64x64, .anims = gDummySpriteAnimTable, - .images = NULL, + .images = NULL, .affineAnims = gThinRingShrinkingAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gMoonrazeMaelstromSuperpowerSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromSuperpowerSpriteTemplate = { .tileTag = ANIM_TAG_METEOR, .paletteTag = ANIM_TAG_HANDS_AND_FEET, @@ -6338,7 +6338,7 @@ const struct SpriteTemplate gMoonrazeMaelstromSuperpowerSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSuperpowerFireball }; -const struct SpriteTemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate = { .tileTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_HANDS_AND_FEET, @@ -6348,7 +6348,7 @@ const struct SpriteTemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimParticleInVortex }; -const struct SpriteTemplate gMoonrazeMaelstromBeamSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromBeamSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -6358,7 +6358,7 @@ const struct SpriteTemplate gMoonrazeMaelstromBeamSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimHyperBeamOrb }; -const struct SpriteTemplate gMoonrazeMaelstromExplosionSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -6368,7 +6368,7 @@ const struct SpriteTemplate gMoonrazeMaelstromExplosionSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gMoonrazeMaelstromShockwaveSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromShockwaveSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_POISON_BUBBLE, @@ -6386,7 +6386,7 @@ static const union AffineAnimCmd sMoonrazeMaelstromWormholeAffineAnims[] = { static const union AffineAnimCmd *const sMoonrazeMaelstromWormholeAffineAnimTable[] = { sMoonrazeMaelstromWormholeAffineAnims }; -const struct SpriteTemplate gMoonrazeMaelstromWormholeSpriteTemplate = +const struct SpriteTemplate gMoonrazeMaelstromWormholeSpriteTemplate = { .tileTag = ANIM_TAG_SHADOW_BALL, .paletteTag = ANIM_TAG_WATER_ORB, @@ -6398,7 +6398,7 @@ const struct SpriteTemplate gMoonrazeMaelstromWormholeSpriteTemplate = }; // light that burns the sky -const struct SpriteTemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate = +const struct SpriteTemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate = { .tileTag = ANIM_TAG_SPARK_2, .paletteTag = ANIM_TAG_LEAF, @@ -6408,7 +6408,7 @@ const struct SpriteTemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate = .affineAnims = gAffineAnims_FlashingSpark, .callback = AnimSparkElectricityFlashing }; -const struct SpriteTemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate = +const struct SpriteTemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate = { .tileTag = ANIM_TAG_FIRE_PLUME, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -6426,7 +6426,7 @@ static const struct OamData sGeyserOam = .size = SPRITE_SIZE(32x32), .priority = 1, //Above sprites }; -const struct SpriteTemplate gLightThatBurnsTheSkyExplosionSpriteTemplate = +const struct SpriteTemplate gLightThatBurnsTheSkyExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_2, .paletteTag = ANIM_TAG_EXPLOSION_2, @@ -6438,7 +6438,7 @@ const struct SpriteTemplate gLightThatBurnsTheSkyExplosionSpriteTemplate = }; // soul stealing 7star strike -const struct SpriteTemplate gSoulStealBlackFlySpriteTemplate = +const struct SpriteTemplate gSoulStealBlackFlySpriteTemplate = { .tileTag = ANIM_TAG_ROUND_SHADOW, .paletteTag = ANIM_TAG_HANDS_AND_FEET, @@ -6448,7 +6448,7 @@ const struct SpriteTemplate gSoulStealBlackFlySpriteTemplate = .affineAnims = gAffineAnims_FlyBallUp, .callback = AnimFlyBallUp }; -const struct SpriteTemplate gSoulStealIceBuffSpriteTemplate = +const struct SpriteTemplate gSoulStealIceBuffSpriteTemplate = { .tileTag = ANIM_TAG_FOCUS_ENERGY, .paletteTag = ANIM_TAG_ICE_CRYSTALS, @@ -6458,7 +6458,7 @@ const struct SpriteTemplate gSoulStealIceBuffSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEndureEnergy }; -const struct SpriteTemplate gSoulStealBlueFistSpriteTemplate = +const struct SpriteTemplate gSoulStealBlueFistSpriteTemplate = { .tileTag = ANIM_TAG_HANDS_AND_FEET, .paletteTag = ANIM_TAG_ICE_CRYSTALS, @@ -6468,7 +6468,7 @@ const struct SpriteTemplate gSoulStealBlueFistSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimJumpKick }; -const struct SpriteTemplate gSoulStealBlueStarSpriteTemplate = +const struct SpriteTemplate gSoulStealBlueStarSpriteTemplate = { .tileTag = ANIM_TAG_PAIN_SPLIT, .paletteTag = ANIM_TAG_ICE_CRYSTALS, @@ -6478,7 +6478,7 @@ const struct SpriteTemplate gSoulStealBlueStarSpriteTemplate = .affineAnims = gAffineAnims_Bite, .callback = AnimSoulStealingStar }; -const struct SpriteTemplate gSoulStealBlueParalyzeSpriteTemplate = +const struct SpriteTemplate gSoulStealBlueParalyzeSpriteTemplate = { .tileTag = ANIM_TAG_SPARK_2, .paletteTag = ANIM_TAG_ICE_CRYSTALS, @@ -6488,7 +6488,7 @@ const struct SpriteTemplate gSoulStealBlueParalyzeSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimElectricity }; -const struct SpriteTemplate gSoulStealBlastburnSpriteTemplate = +const struct SpriteTemplate gSoulStealBlastburnSpriteTemplate = { .tileTag = ANIM_TAG_FIRE_PLUME, .paletteTag = ANIM_TAG_WISP_FIRE, @@ -6498,7 +6498,7 @@ const struct SpriteTemplate gSoulStealBlastburnSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFirePlume }; -const struct SpriteTemplate gSoulStealExplosionSpriteTemplate = +const struct SpriteTemplate gSoulStealExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION, .paletteTag = ANIM_TAG_WISP_FIRE, @@ -6508,7 +6508,7 @@ const struct SpriteTemplate gSoulStealExplosionSpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpriteOnMonPos }; -const struct SpriteTemplate gSoulStealZStarSpriteTemplate = +const struct SpriteTemplate gSoulStealZStarSpriteTemplate = { .tileTag = ANIM_TAG_SNORE_Z, .paletteTag = ANIM_TAG_SNORE_Z, @@ -6572,7 +6572,7 @@ void AnimTask_AllBanksInvisibleExceptAttackerAndTarget(u8 taskId) static u8 LoadBattleAnimTarget(u8 arg) { u8 battler; - + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { switch (gBattleAnimArgs[arg]) @@ -6598,7 +6598,7 @@ static u8 LoadBattleAnimTarget(u8 arg) else battler = gBattleAnimTarget; } - + return battler; } @@ -7276,7 +7276,7 @@ static void SpriteCB_PyroBallRockBounceStep(struct Sprite *sprite) { s8 initialVerticalVelocity; s8 initialHorizontalVelocity; - + if (sprite->y2 > 0) //Rock returned back down { if (gBattleAnimArgs[2] || sMovingBackHorizontally) //Finished moving from left to right @@ -7357,7 +7357,7 @@ static void SpriteCB_PyroBallLaunch(struct Sprite *sprite) static void SpriteCB_AcidLaunchSingleTarget(struct Sprite *sprite) { s16 l1, l2; - + if (!gBattleAnimArgs[3]) StartSpriteAnim(sprite, 2); @@ -7550,7 +7550,7 @@ static void AnimHappyHourCoinShower(struct Sprite *sprite) { if (gBattleAnimArgs[3] != 0) SetAverageBattlerPositions(gBattleAnimAttacker, 0, &sprite->x, &sprite->y); //coin shower on attacker - + sprite->x += gBattleAnimArgs[0]; sprite->y += 14; StartSpriteAnim(sprite, gBattleAnimArgs[1]); @@ -7707,7 +7707,7 @@ void AnimTask_GetTimeOfDay(u8 taskId) gBattleAnimArgs[0] = 1; else if (gLocalTime.hours >= 17 && gLocalTime.hours < 20) gBattleAnimArgs[0] = 2; - + DestroyAnimVisualTask(taskId); } @@ -7717,7 +7717,7 @@ void AnimTask_GetLycanrocForm(u8 taskId) gBattleAnimArgs[0] = 1; else gBattleAnimArgs[0] = 0; - + gBattleAnimArgs[0] = 0; DestroyAnimVisualTask(taskId); } @@ -7766,7 +7766,7 @@ static void AnimOceanicOperettaSpotlight(struct Sprite *sprite) static void AnimTask_WaitAffineAnim(u8 taskId) { struct Task* task = &gTasks[taskId]; - + if (!RunAffineAnimFromTaskData(task)) DestroyAnimVisualTask(taskId); } @@ -7775,7 +7775,7 @@ void AnimTask_SquishTarget(u8 taskId) { struct Task* task = &gTasks[taskId]; u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); - + PrepareAffineAnimInTaskData(task, spriteId, sSquishTargetAffineAnimCmds); task->func = AnimTask_WaitAffineAnim; } diff --git a/src/battle_debug.c b/src/battle_debug.c index 9911154022..8e869df9cb 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -817,7 +817,7 @@ static void SwitchToAiPointsView(u8 taskId) GetStructPtr(taskId)->aiViewState = 0; } -static const u8 *const sAiInfoItemNames[] = +static const u8 *const sAiInfoItemNames[] = { sText_Ability, sText_HeldItem, @@ -829,13 +829,13 @@ static void PutAiInfoText(struct BattleDebugMenu *data) u8 *text = malloc(0x50); FillWindowPixelBuffer(data->aiMovesWindowId, 0x11); - + // item names for (i = 0; i < ARRAY_COUNT(sAiInfoItemNames); i++) { AddTextPrinterParameterized(data->aiMovesWindowId, 1, sAiInfoItemNames[i], 3, i * 15, 0, NULL); } - + // items info for (i = 0; i < gBattlersCount; i++) { @@ -2004,7 +2004,7 @@ static const u8 sText_HoldEffectRoomService[] = _("Room Service"); static const u8 sText_HoldEffectBlunderPolicy[] = _("Blunder Policy"); static const u8 sText_HoldEffectHeavyDutyBoots[] = _("Heavy Duty Boots"); static const u8 sText_HoldEffectThroatSpray[] = _("Throat Spray"); -static const u8 *const sHoldEffectNames[] = +static const u8 *const sHoldEffectNames[] = { [HOLD_EFFECT_NONE] = sText_HoldEffectNone, [HOLD_EFFECT_RESTORE_HP] = sText_HoldEffectRestoreHp, diff --git a/src/battle_interface.c b/src/battle_interface.c index 5be969105f..7eea5f3564 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -3123,7 +3123,7 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle) const s16 (*coords)[2]; u8 spriteId1, spriteId2, battlerPosition, taskId; - + return; if (gBattleScripting.abilityPopupOverwrite != 0) diff --git a/src/battle_message.c b/src/battle_message.c index 8298accf1f..e56269eb5f 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1383,7 +1383,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_TARGETTOOHEAVY - BATTLESTRINGS_TABLE_START] = sText_TargetTooHeavy, }; -const u16 gZEffectStringIds[] = +const u16 gZEffectStringIds[] = { [B_MSG_Z_RESET_STATS] = STRINGID_ZMOVERESETSSTATS, [B_MSG_Z_ALL_STATS_UP]= STRINGID_ZMOVEALLSTATSUP, @@ -1394,7 +1394,7 @@ const u16 gZEffectStringIds[] = [B_MSG_Z_HP_TRAP] = STRINGID_ZMOVEHPTRAP, }; -const u16 gMentalHerbCureStringIds[] = +const u16 gMentalHerbCureStringIds[] = { [B_MSG_MENTALHERBCURE_INFATUATION] = STRINGID_ATKGOTOVERINFATUATION, [B_MSG_MENTALHERBCURE_TAUNT] = STRINGID_BUFFERENDS, @@ -1409,7 +1409,7 @@ const u16 gTerrainStringIds[] = STRINGID_TERRAINBECOMESMISTY, STRINGID_TERRAINBECOMESGRASSY, STRINGID_TERRAINBECOMESELECTRIC, STRINGID_TERRAINBECOMESPSYCHIC, STRINGID_TERRAINREMOVED, }; -const u16 gTerrainEndingStringIds[] = +const u16 gTerrainEndingStringIds[] = { STRINGID_MISTYTERRAINENDS, STRINGID_GRASSYTERRAINENDS, STRINGID_ELECTRICTERRAINENDS, STRINGID_PSYCHICTERRAINENDS }; diff --git a/src/battle_z_move.c b/src/battle_z_move.c index d41e28ac23..c257df5990 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -165,23 +165,23 @@ bool32 IsViableZMove(u8 battlerId, u16 move) u32 item; u16 holdEffect; u16 species; - + if (gBattleStruct->zmove.used[battlerId]) return FALSE; - + species = gBattleMons[battlerId].species; item = gBattleMons[battlerId].item; if (gBattleTypeFlags & (BATTLE_TYPE_SAFARI | BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_FRONTIER)) return FALSE; - + #ifdef ITEM_Z_RING if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT)) && !CheckBagHasItem(ITEM_Z_RING, 1)) return FALSE; #endif - + if (mega->alreadyEvolved[battlerPosition]) return FALSE; // Trainer has mega evolved - + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { if (IsPartnerMonFromSameTrainer(battlerId) && (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)]))) @@ -194,10 +194,10 @@ bool32 IsViableZMove(u8 battlerId, u16 move) else #endif if (item == ITEM_ENIGMA_BERRY) - return FALSE; // HoldEffect = gEnigmaBerries[battlerId].holdEffect; + return FALSE; // HoldEffect = gEnigmaBerries[battlerId].holdEffect; else holdEffect = ItemId_GetHoldEffect(item); - + #ifdef ITEM_ULTRANECROZIUM_Z if (holdEffect == HOLD_EFFECT_Z_CRYSTAL || item == ITEM_ULTRANECROZIUM_Z) #else @@ -210,18 +210,18 @@ bool32 IsViableZMove(u8 battlerId, u16 move) gBattleStruct->zmove.chosenZMove = zMove; // Signature z move exists return TRUE; } - + if (move != MOVE_NONE && zMove != MOVE_Z_STATUS && gBattleMoves[move].type == ItemId_GetSecondaryId(item)) { if (IS_MOVE_STATUS(move)) gBattleStruct->zmove.chosenZMove = move; else gBattleStruct->zmove.chosenZMove = GetTypeBasedZMove(move, battlerId); - + return TRUE; } } - + return FALSE; } @@ -248,7 +248,7 @@ bool32 IsZMoveUsable(u8 battlerId, u16 moveIndex) bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex) { bool32 viableZMove = IsZMoveUsable(battlerId, moveIndex); - + if (gBattleStruct->zmove.viable && !viableZMove) HideZMoveTriggerSprite(); // Was a viable z move, now is not -> slide out else if (!gBattleStruct->zmove.viable && viableZMove) @@ -271,11 +271,11 @@ bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex) void CreateZMoveTriggerSprite(u8 battlerId, bool8 viable) { s16 x, y; - + LoadSpritePalette(&sSpritePalette_ZMoveTrigger); if (GetSpriteTileStartByTag(TAG_ZMOVE_TRIGGER_TILE) == 0xFFFF) LoadCompressedSpriteSheetUsingHeap(&sSpriteSheet_ZMoveTrigger); - + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { x = gSprites[gHealthboxSpriteIds[battlerId]].x - DOUBLES_Z_TRIGGER_POS_X_SLIDE; @@ -286,10 +286,10 @@ void CreateZMoveTriggerSprite(u8 battlerId, bool8 viable) x = gSprites[gHealthboxSpriteIds[battlerId]].x - SINGLES_Z_TRIGGER_POS_X_SLIDE; y = gSprites[gHealthboxSpriteIds[battlerId]].y - SINGLES_Z_TRIGGER_POS_Y_DIFF, 0; } - + if (gBattleStruct->zmove.triggerSpriteId == 0xFF) gBattleStruct->zmove.triggerSpriteId = CreateSprite(&sSpriteTemplate_ZMoveTrigger, x, y, 0); - + gSprites[gBattleStruct->zmove.triggerSpriteId].tBattler = battlerId; gSprites[gBattleStruct->zmove.triggerSpriteId].tHide = (viable == TRUE) ? FALSE : TRUE; } @@ -375,14 +375,14 @@ void DestroyZMoveTriggerSprite(void) FreeSpriteTilesByTag(TAG_ZMOVE_TRIGGER_TILE); if (gBattleStruct->zmove.triggerSpriteId != 0xFF) DestroySprite(&gSprites[gBattleStruct->zmove.triggerSpriteId]); - + gBattleStruct->zmove.triggerSpriteId = 0xFF; } static u16 GetSignatureZMove(u16 move, u16 species, u16 item) { u32 i; - + // Check signature z move for (i = 0; i < ARRAY_COUNT(sSignatureZMoves); ++i) { @@ -396,7 +396,7 @@ static u16 GetSignatureZMove(u16 move, u16 species, u16 item) static u16 GetTypeBasedZMove(u16 move, u8 battler) { u8 moveType = gBattleMoves[move].type; - + // Get z move from type if (moveType < TYPE_FIRE) return MOVE_BREAKNECK_BLITZ + moveType; @@ -411,7 +411,7 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) u32 i; struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[gActiveBattler][4]); u16 move = moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]; - + PlaySE(SE_SELECT); gBattleStruct->zmove.viewing = TRUE; if (zmove != MOVE_NONE) @@ -421,15 +421,15 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) { MoveSelectionDestroyCursorAt(i); StringCopy(gDisplayedStringBattle, gText_EmptyString2); - BattlePutTextOnWindow(gDisplayedStringBattle, i + 3); + BattlePutTextOnWindow(gDisplayedStringBattle, i + 3); } if (IS_MOVE_STATUS(move)) { u8 zEffect = gBattleMoves[move].zMoveEffect; - + gDisplayedStringBattle[0] = EOS; - + if (zEffect == Z_EFFECT_CURSE) { if (moveInfo->monType1 == TYPE_GHOST || moveInfo->monType2 == TYPE_GHOST || moveInfo->monType3 == TYPE_GHOST) @@ -437,7 +437,7 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) else zEffect = Z_EFFECT_ATK_UP_1; } - + switch (zEffect) { case Z_EFFECT_RESET_STATS: @@ -501,7 +501,7 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) ExpandBattleTextBuffPlaceholders(gBattleTextBuff1, gDisplayedStringBattle + 4); break; } - + BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_NAME_3); gDisplayedStringBattle[0] = CHAR_Z; gDisplayedStringBattle[1] = CHAR_HYPHEN; @@ -584,11 +584,11 @@ void SetZEffect(void) else gBattleStruct->zmove.effect = Z_EFFECT_ATK_UP_1; } - + gBattleScripting.savedStatChanger = gBattleScripting.statChanger; // Save used move's stat changer (e.g. for Z-Growl) gBattleScripting.battler = gBattlerAttacker; - - switch (gBattleStruct->zmove.effect) + + switch (gBattleStruct->zmove.effect) { case Z_EFFECT_RESET_STATS: for (i = 0; i < NUM_BATTLE_STATS - 1; i++) @@ -645,7 +645,7 @@ void SetZEffect(void) gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; break; case Z_EFFECT_ATK_UP_1 ... Z_EFFECT_EVSN_UP_1: - SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1, 1, FALSE); + SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1, 1, FALSE); BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); gBattlescriptCurrInstr = BattleScript_StatUpZMove; break; @@ -663,7 +663,7 @@ void SetZEffect(void) gBattlescriptCurrInstr += 3; break; } - + gBattleStruct->zmove.zStatusActive = FALSE; } diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 4b5cde44c0..89e1a042c6 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11881,7 +11881,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .zMovePower = 180, .zMoveEffect = Z_EFFECT_NONE, }, - + [MOVE_ZIPPY_ZAP] = { #if B_UPDATED_MOVE_DATA >= GEN_8 @@ -12193,7 +12193,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, - + [MOVE_DYNAMAX_CANNON] = { .effect = EFFECT_DYNAMAX_DOUBLE_DMG, @@ -13105,7 +13105,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, }, - + [MOVE_THUNDER_CAGE] = { .effect = EFFECT_TRAP, diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index 41b5143cf1..6b866e92ef 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -859,7 +859,7 @@ .bodyColor = color, \ .noFlip = FALSE, \ } - + #define MORPEKO_BASE_STATS \ { \ .baseHP = 58, \ @@ -883,7 +883,7 @@ .bodyColor = BODY_COLOR_YELLOW, \ .noFlip = FALSE, \ } - + #define ZARUDE_BASE_STATS \ { \ .baseHP = 105, \ @@ -22755,7 +22755,7 @@ const struct BaseStats gBaseStats[] = .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, - + [SPECIES_BASCULEGION] = { .baseHP = 120, @@ -26464,7 +26464,7 @@ const struct BaseStats gBaseStats[] = [SPECIES_MINIOR_CORE_BLUE] = MINIOR_CORE_BASE_STATS(BODY_COLOR_BLUE), [SPECIES_MINIOR_CORE_INDIGO] = MINIOR_CORE_BASE_STATS(BODY_COLOR_BLUE), [SPECIES_MINIOR_CORE_VIOLET] = MINIOR_CORE_BASE_STATS(BODY_COLOR_PURPLE), - + [SPECIES_MIMIKYU_BUSTED] = MIMIKYU_BASE_STATS, [SPECIES_NECROZMA_DUSK_MANE] = @@ -26563,7 +26563,7 @@ const struct BaseStats gBaseStats[] = [SPECIES_ALCREMIE_RUBY_SWIRL] = ALCREMIE_BASE_STATS(BODY_COLOR_YELLOW), [SPECIES_ALCREMIE_CARAMEL_SWIRL] = ALCREMIE_BASE_STATS(BODY_COLOR_BROWN), [SPECIES_ALCREMIE_RAINBOW_SWIRL] = ALCREMIE_BASE_STATS(BODY_COLOR_YELLOW), - + [SPECIES_EISCUE_NOICE_FACE] = { .baseHP = 75, diff --git a/src/data/pokemon/form_change_table_pointers.h b/src/data/pokemon/form_change_table_pointers.h index 85685e50ef..0668855cc4 100644 --- a/src/data/pokemon/form_change_table_pointers.h +++ b/src/data/pokemon/form_change_table_pointers.h @@ -1,4 +1,4 @@ -const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] = +const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] = { #if P_NEW_POKEMON == TRUE [SPECIES_GIRATINA] = sGiratinaFormChangeTable, diff --git a/src/data/pokemon/form_species_table_pointers.h b/src/data/pokemon/form_species_table_pointers.h index 71a210e402..dee4e5813f 100644 --- a/src/data/pokemon/form_species_table_pointers.h +++ b/src/data/pokemon/form_species_table_pointers.h @@ -19,8 +19,8 @@ const u16 *const gFormSpeciesIdTables[NUM_SPECIES] = [SPECIES_MEOWTH] = sMeowthFormSpeciesIdTable, [SPECIES_PERSIAN] = sPersianFormSpeciesIdTable, [SPECIES_ALAKAZAM] = sAlakazamFormSpeciesIdTable, - [SPECIES_GROWLITHE] = sGrowlitheFormSpeciesIdTable, - [SPECIES_ARCANINE] = sArcanineFormSpeciesIdTable, + [SPECIES_GROWLITHE] = sGrowlitheFormSpeciesIdTable, + [SPECIES_ARCANINE] = sArcanineFormSpeciesIdTable, [SPECIES_GEODUDE] = sGeodudeFormSpeciesIdTable, [SPECIES_GRAVELER] = sGravelerFormSpeciesIdTable, [SPECIES_GOLEM] = sGolemFormSpeciesIdTable, @@ -113,7 +113,7 @@ const u16 *const gFormSpeciesIdTables[NUM_SPECIES] = [SPECIES_LILLIGANT] = sLilligantFormSpeciesIdTable, [SPECIES_DARUMAKA] = sDarumakaFormSpeciesIdTable, [SPECIES_DARMANITAN] = sDarmanitanFormSpeciesIdTable, - [SPECIES_YAMASK] = sYamaskFormSpeciesIdTable, + [SPECIES_YAMASK] = sYamaskFormSpeciesIdTable, [SPECIES_ZORUA] = sZoruaFormSpeciesIdTable, [SPECIES_ZOROARK] = sZoroarkFormSpeciesIdTable, [SPECIES_DEERLING] = sDeerlingFormSpeciesIdTable, @@ -139,7 +139,7 @@ const u16 *const gFormSpeciesIdTables[NUM_SPECIES] = [SPECIES_GOODRA] = sGoodraFormSpeciesIdTable, [SPECIES_PUMPKABOO] = sPumpkabooFormSpeciesIdTable, [SPECIES_GOURGEIST] = sGourgeistFormSpeciesIdTable, - [SPECIES_AVALUGG] = sAvaluggFormSpeciesIdTable, + [SPECIES_AVALUGG] = sAvaluggFormSpeciesIdTable, [SPECIES_XERNEAS] = sXerneasFormSpeciesIdTable, [SPECIES_ZYGARDE] = sZygardeFormSpeciesIdTable, [SPECIES_DIANCIE] = sDiancieFormSpeciesIdTable, @@ -394,7 +394,7 @@ const u16 *const gFormSpeciesIdTables[NUM_SPECIES] = [SPECIES_TORNADUS_THERIAN] = sTornadusFormSpeciesIdTable, [SPECIES_THUNDURUS_THERIAN] = sThundurusFormSpeciesIdTable, [SPECIES_LANDORUS_THERIAN] = sLandorusFormSpeciesIdTable, - [SPECIES_ENAMORUS_THERIAN] = sEnamorusFormSpeciesIdTable, + [SPECIES_ENAMORUS_THERIAN] = sEnamorusFormSpeciesIdTable, // Kyurem [SPECIES_KYUREM_WHITE] = sKyuremFormSpeciesIdTable, [SPECIES_KYUREM_BLACK] = sKyuremFormSpeciesIdTable, diff --git a/src/data/pokemon/level_up_learnsets.h b/src/data/pokemon/level_up_learnsets.h index a8c696f1f4..d06e4d00be 100644 --- a/src/data/pokemon/level_up_learnsets.h +++ b/src/data/pokemon/level_up_learnsets.h @@ -18095,8 +18095,8 @@ static const struct LevelUpMove sWyrdeerLevelUpLearnset[] = { LEVEL_UP_MOVE(15, MOVE_CALM_MIND), //LEVEL_UP_MOVE(21, MOVE_PSYSHIELD_BASH), LEVEL_UP_MOVE(29, MOVE_EXTRASENSORY), - //LEVEL_UP_MOVE(37, MOVE_ZEN_HEADBUTT), - LEVEL_UP_MOVE(47, MOVE_DOUBLE_EDGE), + //LEVEL_UP_MOVE(37, MOVE_ZEN_HEADBUTT), + LEVEL_UP_MOVE(47, MOVE_DOUBLE_EDGE), LEVEL_UP_END }; @@ -18105,7 +18105,7 @@ static const struct LevelUpMove sKleavorLevelUpLearnset[] = { LEVEL_UP_MOVE( 6, MOVE_SILVER_WIND), LEVEL_UP_MOVE(11, MOVE_AERIAL_ACE), LEVEL_UP_MOVE(14, MOVE_DOUBLE_HIT), - //LEVEL_UP_MOVE(14, MOVE_STEALTH_ROCK), + //LEVEL_UP_MOVE(14, MOVE_STEALTH_ROCK), //LEVEL_UP_MOVE(18, MOVE_AIR_SLASH), LEVEL_UP_MOVE(25, MOVE_SWORDS_DANCE), //LEVEL_UP_MOVE(29, MOVE_STONE_AXE), @@ -18121,8 +18121,8 @@ static const struct LevelUpMove sUrsalunaLevelUpLearnset[] = { LEVEL_UP_MOVE(18, MOVE_SLASH), //LEVEL_UP_MOVE(25, MOVE_PLAY_ROUGH), //LEVEL_UP_MOVE(34, MOVE_HIGH_HORSEPOWER), - LEVEL_UP_MOVE(43, MOVE_DOUBLE_EDGE), - //LEVEL_UP_MOVE(47, MOVE_HEADLONG_RUSH), + LEVEL_UP_MOVE(43, MOVE_DOUBLE_EDGE), + //LEVEL_UP_MOVE(47, MOVE_HEADLONG_RUSH), LEVEL_UP_END }; @@ -18135,7 +18135,7 @@ static const struct LevelUpMove sBasculegionLevelUpLearnset[] = { LEVEL_UP_MOVE(25, MOVE_CRUNCH), LEVEL_UP_MOVE(25, MOVE_SHADOW_BALL), //LEVEL_UP_MOVE(34, MOVE_WAVE_CRASH), - LEVEL_UP_MOVE(43, MOVE_DOUBLE_EDGE), + LEVEL_UP_MOVE(43, MOVE_DOUBLE_EDGE), LEVEL_UP_END }; @@ -18145,9 +18145,9 @@ static const struct LevelUpMove sSneaslerLevelUpLearnset[] = { //LEVEL_UP_MOVE(11, MOVE_DIRE_CLAW), LEVEL_UP_MOVE(11, MOVE_SWIFT), LEVEL_UP_MOVE(18, MOVE_SLASH), - //LEVEL_UP_MOVE(25, MOVE_POISON_JAB), - LEVEL_UP_MOVE(34, MOVE_SWORDS_DANCE), - //LEVEL_UP_MOVE(43, MOVE_CLOSE_COMBAT), + //LEVEL_UP_MOVE(25, MOVE_POISON_JAB), + LEVEL_UP_MOVE(34, MOVE_SWORDS_DANCE), + //LEVEL_UP_MOVE(43, MOVE_CLOSE_COMBAT), LEVEL_UP_END }; @@ -18938,7 +18938,7 @@ static const struct LevelUpMove sGrowlitheHisuianLevelUpLearnset[] = { LEVEL_UP_MOVE( 9, MOVE_BITE), //LEVEL_UP_MOVE(15, MOVE_FIRE_FANG), LEVEL_UP_MOVE(21, MOVE_ROCK_SLIDE), - LEVEL_UP_MOVE(29, MOVE_CRUNCH), + LEVEL_UP_MOVE(29, MOVE_CRUNCH), LEVEL_UP_MOVE(37, MOVE_DOUBLE_EDGE), //LEVEL_UP_MOVE(47, MOVE_FLARE_BLITZ), LEVEL_UP_END @@ -18951,7 +18951,7 @@ static const struct LevelUpMove sArcanineHisuianLevelUpLearnset[] = { //LEVEL_UP_MOVE(15, MOVE_FIRE_FANG), LEVEL_UP_MOVE(21, MOVE_ROCK_SLIDE), LEVEL_UP_MOVE(29, MOVE_CRUNCH), - //LEVEL_UP_MOVE(29, MOVE_RAGING_FURY), + //LEVEL_UP_MOVE(29, MOVE_RAGING_FURY), LEVEL_UP_MOVE(37, MOVE_DOUBLE_EDGE), //LEVEL_UP_MOVE(47, MOVE_FLARE_BLITZ), LEVEL_UP_END @@ -19015,9 +19015,9 @@ static const struct LevelUpMove sSneaselHisuianLevelUpLearnset[] = { LEVEL_UP_MOVE( 6, MOVE_ROCK_SMASH), LEVEL_UP_MOVE(11, MOVE_SWIFT), LEVEL_UP_MOVE(18, MOVE_SLASH), - //LEVEL_UP_MOVE(25, MOVE_POISON_JAB), - LEVEL_UP_MOVE(34, MOVE_SWORDS_DANCE), - //LEVEL_UP_MOVE(43, MOVE_CLOSE_COMBAT), + //LEVEL_UP_MOVE(25, MOVE_POISON_JAB), + LEVEL_UP_MOVE(34, MOVE_SWORDS_DANCE), + //LEVEL_UP_MOVE(43, MOVE_CLOSE_COMBAT), LEVEL_UP_END }; @@ -19116,7 +19116,7 @@ static const struct LevelUpMove sGoodraHisuianLevelUpLearnset[] = { }; static const struct LevelUpMove sAvaluggHisuianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ROCK_SLIDE), + //LEVEL_UP_MOVE( 0, MOVE_ROCK_SLIDE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 5, MOVE_POWDER_SNOW), //LEVEL_UP_MOVE( 9, MOVE_ICE_SHARD), diff --git a/src/data/pokemon/pokedex_orders.h b/src/data/pokemon/pokedex_orders.h index 0ca5ccb417..e1d8cc4792 100644 --- a/src/data/pokemon/pokedex_orders.h +++ b/src/data/pokemon/pokedex_orders.h @@ -1423,7 +1423,7 @@ const u16 gPokedexOrder_Weight[] = NATIONAL_DEX_ESPEON, NATIONAL_DEX_FROSLASS, NATIONAL_DEX_UMBREON, - //NATIONAL_DEX_SNEASEL, //Hisuian Form + //NATIONAL_DEX_SNEASEL, //Hisuian Form NATIONAL_DEX_HUNTAIL, NATIONAL_DEX_CARNIVINE, NATIONAL_DEX_WATCHOG, @@ -1577,7 +1577,7 @@ const u16 gPokedexOrder_Weight[] = NATIONAL_DEX_GLISCOR, NATIONAL_DEX_DUBWOOL, NATIONAL_DEX_SNEASLER, - //NATIONAL_DEX_BRAVIARY, //Hisuian Form + //NATIONAL_DEX_BRAVIARY, //Hisuian Form NATIONAL_DEX_PURUGLY, //NATIONAL_DEX_MANECTRIC, // Mega NATIONAL_DEX_GOTHITELLE, @@ -1600,7 +1600,7 @@ const u16 gPokedexOrder_Weight[] = NATIONAL_DEX_HAKAMO_O, NATIONAL_DEX_ALAKAZAM, NATIONAL_DEX_HITMONTOP, - NATIONAL_DEX_ENAMORUS, + NATIONAL_DEX_ENAMORUS, NATIONAL_DEX_GARDEVOIR, NATIONAL_DEX_KELDEO, NATIONAL_DEX_GRANBULL, @@ -1660,7 +1660,7 @@ const u16 gPokedexOrder_Weight[] = NATIONAL_DEX_HEATMOR, //NATIONAL_DEX_LURANTIS, // Totem-sized //NATIONAL_DEX_ZAPDOS, // Galarian Form - //NATIONAL_DEX_SAMUROTT, // Hisuian Form + //NATIONAL_DEX_SAMUROTT, // Hisuian Form NATIONAL_DEX_MR_RIME, NATIONAL_DEX_WHIRLIPEDE, //NATIONAL_DEX_PINSIR, // Mega @@ -1823,7 +1823,7 @@ const u16 gPokedexOrder_Weight[] = NATIONAL_DEX_FERROTHORN, NATIONAL_DEX_MUDBRAY, NATIONAL_DEX_ZACIAN, // Hero of Many Battles - NATIONAL_DEX_BASCULEGION, + NATIONAL_DEX_BASCULEGION, //NATIONAL_DEX_CHARIZARD, // Mega X NATIONAL_DEX_SHELGON, //NATIONAL_DEX_SALAMENCE, // Mega @@ -1933,7 +1933,7 @@ const u16 gPokedexOrder_Weight[] = //NATIONAL_DEX_AVALUGG, //Hisuian Form NATIONAL_DEX_TYRANTRUM, NATIONAL_DEX_RHYPERIOR, - NATIONAL_DEX_URSALUNA, + NATIONAL_DEX_URSALUNA, NATIONAL_DEX_MAMOSWINE, // 661.4 - 667.0 lbs / 300.0 - 307.1 kg NATIONAL_DEX_GOLEM, @@ -2642,7 +2642,7 @@ const u16 gPokedexOrder_Height[] = NATIONAL_DEX_GURDURR, NATIONAL_DEX_LEAVANNY, NATIONAL_DEX_WHIRLIPEDE, - //NATIONAL_DEX_LILLIGANT, //Hisuian Form + //NATIONAL_DEX_LILLIGANT, //Hisuian Form NATIONAL_DEX_CARRACOSTA, NATIONAL_DEX_FRILLISH, NATIONAL_DEX_ALOMOMOLA, @@ -2697,7 +2697,7 @@ const u16 gPokedexOrder_Height[] = NATIONAL_DEX_DUBWOOL, NATIONAL_DEX_BARRASKEWDA, NATIONAL_DEX_FROSMOTH, - NATIONAL_DEX_SNEASLER, + NATIONAL_DEX_SNEASLER, // 4'07" / 1.4m //NATIONAL_DEX_BEEDRILL, // Mega //NATIONAL_DEX_RATICATE, // Alolan Form, Totem-sized @@ -2734,7 +2734,7 @@ const u16 gPokedexOrder_Height[] = NATIONAL_DEX_ZWEILOUS, //NATIONAL_DEX_TORNADUS, // Therian Forme NATIONAL_DEX_KELDEO, - //NATIONAL_DEX_AVALUGG, // Hisuian Form + //NATIONAL_DEX_AVALUGG, // Hisuian Form //NATIONAL_DEX_GUMSHOOS, // Totem-sized NATIONAL_DEX_CINDERACE, NATIONAL_DEX_EISCUE, @@ -2805,7 +2805,7 @@ const u16 gPokedexOrder_Height[] = NATIONAL_DEX_HYPNO, NATIONAL_DEX_ZAPDOS, //NATIONAL_DEX_ZAPDOS, // Galarian Form - //NATIONAL_DEX_TYPHLOSION, // Hisuian Form + //NATIONAL_DEX_TYPHLOSION, // Hisuian Form NATIONAL_DEX_NOCTOWL, NATIONAL_DEX_GARDEVOIR, //NATIONAL_DEX_GARDEVOIR, // Mega @@ -2818,15 +2818,15 @@ const u16 gPokedexOrder_Height[] = NATIONAL_DEX_EMBOAR, NATIONAL_DEX_ZEBSTRIKA, NATIONAL_DEX_ZOROARK, - //NATIONAL_DEX_ZOROARK, // Hisuian Form + //NATIONAL_DEX_ZOROARK, // Hisuian Form NATIONAL_DEX_DRUDDIGON, NATIONAL_DEX_BISHARP, NATIONAL_DEX_BOUFFALANT, - //NATIONAL_DEX_BRAVIARY, // Hisuian Form + //NATIONAL_DEX_BRAVIARY, // Hisuian Form NATIONAL_DEX_VOLCARONA, NATIONAL_DEX_CHESNAUGHT, NATIONAL_DEX_DECIDUEYE, - //NATIONAL_DEX_DECIDUEYE, // Hisuian Form + //NATIONAL_DEX_DECIDUEYE, // Hisuian Form NATIONAL_DEX_KOMMO_O, NATIONAL_DEX_TOXTRICITY, NATIONAL_DEX_GRAPPLOCT, @@ -3010,7 +3010,7 @@ const u16 gPokedexOrder_Height[] = NATIONAL_DEX_MUDSDALE, NATIONAL_DEX_MELMETAL, NATIONAL_DEX_STONJOURNER, - NATIONAL_DEX_OVERQWIL, + NATIONAL_DEX_OVERQWIL, // 8'06" / 2.6m NATIONAL_DEX_BEARTIC, //NATIONAL_DEX_VIKAVOLT, // Totem-sized diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h index ac7c910d7e..a4a1941adc 100644 --- a/src/data/text/move_descriptions.h +++ b/src/data/text/move_descriptions.h @@ -2691,144 +2691,144 @@ static const u8 sVeeveeVolleyDescription[] = _( static const u8 sDoubleIronBashDescription[] = _( "The user spins and hits with\n" "its arms. May cause flinch."); - + // GEN 8 static const u8 sDynamaxCannonDescription[] = _( "Fires a strong beam. Deals\n" "2x damage to Dynamaxed foes."); - + static const u8 sSnipeShotDescription[] = _( "The user ignores effects\n" "that draw in moves."); - + static const u8 sJawLockDescription[] = _( "Prevents the user and\n" "the target from escaping."); - + static const u8 sStuffCheeksDescription[] = _( "Consumes the user's Berry,\n" "then sharply raises Def."); - + static const u8 sNoRetreatDescription[] = _( "Raises all of the user's\n" "stats but prevents escape."); - + static const u8 sTarShotDescription[] = _( "Lowers the foe's Speed and\n" "makes it weak to Fire."); - + static const u8 sMagicPowderDescription[] = _( "Magic powder changes the\n" "target into a Psychic-type."); - + static const u8 sDragonDartsDescription[] = _( "The user attacks twice. Two\n" "targets are hit once each."); - + static const u8 sTeatimeDescription[] = _( "All Pokémon have teatime\n" "and eat their Berries."); - + static const u8 sOctolockDescription[] = _( "Traps the foe to lower Def\n" "and Sp. Def fall each turn."); - + static const u8 sBoltBeakDescription[] = _( "Double power if the user\n" "moves before the target."); - + static const u8 sFishiousRendDescription[] = _( "Double power if the user\n" "moves before the target."); - + static const u8 sCourtChangeDescription[] = _( "The user swaps effects on\n" "either side of the field."); - + static const u8 sClangorousSoulDescription[] = _( "The user uses some of its\n" "HP to raise all its stats."); - + static const u8 sBodyPressDescription[] = _( "Does more damage the\n" "higher the user's Def."); - + static const u8 sDecorateDescription[] = _( "The user sharply raises\n" "the target's Atk and Sp.Atk"); - + static const u8 sDrumBeatingDescription[] = _( "Plays a drum to attack.\n" "The foe's Speed is lowered."); - + static const u8 sSnapTrapDescription[] = _( "Snares the target in a snap\n" "trap for four to five turns."); - + static const u8 sPyroBallDescription[] = _( "Launches a fiery ball at the\n" "target. It may cause a burn."); - + static const u8 sBehemothBladeDescription[] = _( "Strikes as a sword. Deals 2x\n" "damage to Dynamaxed foes."); - + static const u8 sBehemothBashDescription[] = _( "Attacks as a shield. Deals 2x\n" "damage to Dynamaxed foes."); - + static const u8 sAuraWheelDescription[] = _( "Raises Speed to attack. The\n" "Type is based on its form."); - + static const u8 sBreakingSwipeDescription[] = _( "Swings its tail to attack.\n" "Lowers the Atk of those hit."); - + static const u8 sBranchPokeDescription[] = _( "The user pokes the target\n" "with a pointed branch."); - + static const u8 sOverdriveDescription[] = _( "The user twangs its guitar,\n" "causing strong vibrations."); - + static const u8 sAppleAcidDescription[] = _( "Attacks with tart apple acid\n" "to lower the foe's Sp. Def."); - + static const u8 sGravAppleDescription[] = _( "Drops an apple from above.\n" "Lowers the foe's Defense."); - + static const u8 sSpiritBreakDescription[] = _( "Attacks with spirit-breaking\n" "force. Lowers Sp. Atk."); - + static const u8 sStrangeSteamDescription[] = _( "Emits a strange steam to\n" "potentially confuse the foe."); - + static const u8 sLifeDewDescription[] = _( "Scatters water to restore\n" "the HP of itself and allies."); - + static const u8 sObstructDescription[] = _( "Protects itself, harshly\n" "lowering Def on contact."); - + static const u8 sFalseSurrenderDescription[] = _( "Bows to stab the foe\n" "with hair. It never misses."); - + static const u8 sMeteorAssaultDescription[] = _( "Attacks with a thick leek.\n" "The user must then rest."); - + static const u8 sEternabeamDescription[] = _( "Eternatus' strongest move.\n" "The user rests next turn."); - + static const u8 sSteelBeamDescription[] = _( "Fires a beam of steel from\n" "its body. It hurts the user."); diff --git a/src/data/text/move_names.h b/src/data/text/move_names.h index ffa00e3f63..5f0a741cb4 100644 --- a/src/data/text/move_names.h +++ b/src/data/text/move_names.h @@ -1604,7 +1604,7 @@ static const u8 sText_Menacing_Moonraze_Maelstrom[] = _("Menacing Moonraze Maels static const u8 sText_Light_That_Burns_The_Sky[] = _("Light That Burns The Sky"); static const u8 sText_Soul_Stealing_7_Star_Strike[] = _("Soul Stealing 7 Star Strike"); -const u8 *const gZMoveNames[] = +const u8 *const gZMoveNames[] = { [MOVE_BREAKNECK_BLITZ - FIRST_Z_MOVE] = sText_Breakneck_Blitz, [MOVE_ALL_OUT_PUMMELING - FIRST_Z_MOVE] = sText_All_Out_Pummeling, diff --git a/src/daycare.c b/src/daycare.c index 6108c6daa8..18bc45eb01 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -261,7 +261,7 @@ static u16 TakeSelectedPokemonFromDaycare(struct DaycareMon *daycareMon) CalculateMonStats(&pokemon); species = newSpecies; } - + if (GetMonData(&pokemon, MON_DATA_LEVEL) != MAX_LEVEL) { experience = GetMonData(&pokemon, MON_DATA_EXP) + daycareMon->steps; @@ -1359,7 +1359,7 @@ static u8 ModifyBreedingScoreForOvalCharm(u8 score) return 88; } } - + return score; } diff --git a/src/debug.c b/src/debug.c index 4cc1ac6168..950c82c8d7 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1493,7 +1493,7 @@ static void DebugAction_Flags_CatchingOnOff(u8 taskId) FlagToggle(B_FLAG_NO_CATCHING); #endif } - + // ******************************* // Actions Variables static void DebugAction_Vars_Vars(u8 taskId) @@ -2589,7 +2589,7 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu } //Pokedex entry - nationalDexNum = SpeciesToNationalPokedexNum(species); + nationalDexNum = SpeciesToNationalPokedexNum(species); switch(sentToPc) { case MON_GIVEN_TO_PARTY: diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 91a3122226..39cf8e4c23 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -565,7 +565,7 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon) SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, &data); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, &data); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_ENCRYPT_SEPARATOR, &data); - + #if P_SHEDINJA_BALL >= GEN_4 SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_POKEBALL, &ball); RemoveBagItem(ball, 1); diff --git a/src/item_use.c b/src/item_use.c index 44da679857..913c0700fa 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -1188,7 +1188,7 @@ void ItemUseInBattle_EnigmaBerry(u8 taskId) } } -void ItemUseOutOfBattle_FormChange(u8 taskId) +void ItemUseOutOfBattle_FormChange(u8 taskId) { gItemUseCB = ItemUseCB_FormChange; gTasks[taskId].data[0] = FALSE; diff --git a/src/pokemon.c b/src/pokemon.c index f36f8acf25..c04d9236bf 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3307,7 +3307,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, | (gSaveBlock2Ptr->playerTrainerId[1] << 8) | (gSaveBlock2Ptr->playerTrainerId[2] << 16) | (gSaveBlock2Ptr->playerTrainerId[3] << 24); - + if (CheckBagHasItem(ITEM_SHINY_CHARM, 1)) { u32 shinyValue; @@ -3415,7 +3415,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, } } #endif - + } if (gBaseStats[species].abilities[1]) @@ -5292,7 +5292,7 @@ u16 GetAbilityBySpecies(u16 species, u8 abilityNum) gLastUsedAbility = gBaseStats[species].abilities[abilityNum]; else gLastUsedAbility = ABILITY_NONE; - + if (abilityNum >= NUM_NORMAL_ABILITY_SLOTS) // if abilityNum is empty hidden ability, look for other hidden abilities { for (i = NUM_NORMAL_ABILITY_SLOTS; i < NUM_ABILITY_SLOTS && gLastUsedAbility == ABILITY_NONE; i++) @@ -5300,12 +5300,12 @@ u16 GetAbilityBySpecies(u16 species, u8 abilityNum) gLastUsedAbility = gBaseStats[species].abilities[i]; } } - + for (i = 0; i < NUM_ABILITY_SLOTS && gLastUsedAbility == ABILITY_NONE; i++) // look for any non-empty ability { gLastUsedAbility = gBaseStats[species].abilities[i]; } - + return gLastUsedAbility; } @@ -6346,7 +6346,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem, s { partnerSpecies = GetMonData(tradePartner, MON_DATA_SPECIES, 0); partnerHeldItem = GetMonData(tradePartner, MON_DATA_HELD_ITEM, 0); - + if (partnerHeldItem == ITEM_ENIGMA_BERRY) partnerHoldEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect; else @@ -7717,7 +7717,7 @@ void SetWildMonHeldItem(void) { if (GetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, NULL) != ITEM_NONE) continue; // prevent ovewriting previously set item - + rnd = Random() % 100; species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES, 0); if (gMapHeader.mapLayoutId == LAYOUT_ALTERING_CAVE) diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 8775889fdf..4168b75242 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -337,7 +337,7 @@ const u8 gFrontAnimNames[][34] = [ANIM_SHAKE_GLOW_WHITE_SLOW] = _("SHAKE GLOW WHITE SLOW"), [ANIM_SHAKE_GLOW_PURPLE_SLOW] = _("SHAKE GLOW PURPLE SLOW"), }; -const u8 gBattleBackgroundNames[][30] = +const u8 gBattleBackgroundNames[][30] = { [MAP_BATTLE_SCENE_NORMAL] = _("NORMAL "), [MAP_BATTLE_SCENE_GYM] = _("GYM "), @@ -354,7 +354,7 @@ const u8 gBattleBackgroundNames[][30] = [MAP_BATTLE_SCENE_KYOGRE] = _("KYOGRE "), [MAP_BATTLE_SCENE_RAYQUAZA] = _("RAYQUAZA "), }; -const u8 gBattleBackgroundTerrainNames[][26] = +const u8 gBattleBackgroundTerrainNames[][26] = { [BATTLE_TERRAIN_GRASS] = _("NORMAL - GRASS "), [BATTLE_TERRAIN_LONG_GRASS] = _("NORMAL - LONG GRASS "), @@ -403,13 +403,13 @@ static void PrintInstructionsOnWindow(struct PokemonDebugMenu *data) u8 textInstructionsSubmenuOneGender[] = _("{START_BUTTON} Shiny {SELECT_BUTTON} Gender\n{B_BUTTON} Back {A_BUTTON} Submenu 2$"); u8 textInstructionsSubmenuTwo[] = _("{START_BUTTON} Shiny\n{B_BUTTON} Back$"); u8 textInstructionsSubmenuTwoGender[] = _("{START_BUTTON} Shiny {SELECT_BUTTON} Gender\n{B_BUTTON} Back$"); - + u8 textBottom[] = _("BACK:\nFRONT:\nBG:$"); u8 textBottomForms[] = _("BACK:\nFRONT:\nBG:\nFORMS:$"); u8 textBottomSubmenuTwo[] = _("B coords:\nF coords:\nF elev:"); u16 species = data->modifyArrows.currValue; - + u8 textL[] = _("{L_BUTTON}"); u8 textR[] = _("{R_BUTTON}"); @@ -481,7 +481,7 @@ static void PrintDigitChars(struct PokemonDebugMenu *data) for (i = 0; i < data->modifyArrows.maxDigits; i++) text[i] = data->modifyArrows.charDigits[i]; - + text[i++] = CHAR_SPACE; text[i++] = CHAR_HYPHEN; @@ -490,7 +490,7 @@ static void PrintDigitChars(struct PokemonDebugMenu *data) if (data->isFemale) text[i++] = CHAR_FEMALE; else - text[i++] = CHAR_MALE; + text[i++] = CHAR_MALE; text[i++] = CHAR_HYPHEN; } @@ -641,7 +641,7 @@ static bool32 TryMoveDigit(struct PokemonDebugModifyArrows *modArrows, bool32 mo if (charDigits[modArrows->currentDigit] == CHAR_0) { charDigits[modArrows->currentDigit] = CHAR_9; - + for (i = modArrows->currentDigit - 1; i >= 0; i--) { if (charDigits[i] == CHAR_0) @@ -796,7 +796,7 @@ static u8 GetBattlerSpriteFinal_YCustom(u16 species, s8 offset_picCoords, s8 off //FrontPicCoords offset = gMonFrontPicCoords[species].y_offset + offset_picCoords; - + //Elevation offset -= GetElevationValue(species) + offset_elevation; @@ -805,7 +805,7 @@ static u8 GetBattlerSpriteFinal_YCustom(u16 species, s8 offset_picCoords, s8 off if (y > DISPLAY_HEIGHT - MON_PIC_HEIGHT + 8) y = DISPLAY_HEIGHT - MON_PIC_HEIGHT + 8; - + return y; } @@ -839,7 +839,7 @@ static void LoadAndCreateEnemyShadowSpriteCustom(struct PokemonDebugMenu *data, data->frontShadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, x, y + 29, 0xC8); gSprites[data->frontShadowSpriteId].data[0] = data->frontspriteId; - + gSprites[data->frontShadowSpriteId].callback = SpriteCB_EnemyShadowCustom; gSprites[data->frontShadowSpriteId].oam.priority = 0; gSprites[data->frontShadowSpriteId].invisible = invisible; @@ -945,7 +945,7 @@ static void LoadBattleBg(u8 battleBgType, u8 battleTerrain) LZDecompressVram(gBattleTerrainTiles_Rayquaza, (void*)(BG_CHAR_ADDR(2))); LZDecompressVram(gBattleTerrainTilemap_Rayquaza, (void*)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_Rayquaza, 0x20, 0x60); - break; + break; } } static void PrintBattleBgName(u8 taskId) @@ -1005,7 +1005,7 @@ static void UpdateBattleBg(u8 taskId, bool8 increment) { if (increment) data->battleBgType += 1; - else + else data->battleBgType -= 1; } @@ -1148,7 +1148,7 @@ void CB2_Debug_Pokemon(void) data->battleBgType = 0; data->battleTerrain = 0; LoadBattleBg(data->battleBgType , data->battleTerrain); - + gMain.state++; break; case 2: @@ -1377,7 +1377,7 @@ static void UpdateSubmenuOneOptionValue(u8 taskId, bool8 increment) data->animIdFront = sMonFrontAnimIdsTable[modArrows->currValue - 1]; UpdateMonAnimNames(taskId); ResetOffsetSpriteValues(data); - + UpdateBattlerValue(data); ReloadPokemonSprites(data); while (!(gMain.intrCheck & INTR_FLAG_VBLANK)); @@ -1486,7 +1486,7 @@ static void Handle_Input_Debug_Pokemon(u8 taskId) if (JOY_NEW(START_BUTTON)) { data->isShiny = !data->isShiny; - + if(data->isShiny) PlaySE(SE_SHINY); @@ -1641,7 +1641,7 @@ static void Handle_Input_Debug_Pokemon(u8 taskId) data->submenuYpos[2] += 1; if (data->submenuYpos[2] >= 3) data->submenuYpos[2] = 0; - + data->yPosModifyArrows.currentDigit = data->submenuYpos[2]; gSprites[data->yPosModifyArrows.arrowSpriteId[0]].y = OPTIONS_ARROW_Y + data->yPosModifyArrows.currentDigit * 12; } @@ -1672,7 +1672,7 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data) u16 species = data->currentmonId; s16 offset_y; u8 front_x = sBattlerCoords[0][1].x; - u8 front_y; + u8 front_y; DestroySprite(&gSprites[data->frontspriteId]); DestroySprite(&gSprites[data->backspriteId]); @@ -1706,7 +1706,7 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data) gSprites[data->frontspriteId].oam.priority = 0; //Front Shadow LoadAndCreateEnemyShadowSpriteCustom(data, species); - + //Back HandleLoadSpecialPokePic(FALSE, gMonSpritesGfxPtr->sprites.ptr[2], species, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY)); BattleLoadOpponentMonSpriteGfxCustom(species, data->isFemale, data->isShiny, 5); @@ -1720,7 +1720,7 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data) //Icon Sprite data->iconspriteId = CreateMonIcon(species, SpriteCB_MonIcon, DEBUG_ICON_X, DEBUG_ICON_Y, 4, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY)); gSprites[data->iconspriteId].oam.priority = 0; - + //Modify Arrows LoadSpritePalette(&gSpritePalette_Arrow); data->modifyArrows.arrowSpriteId[0] = CreateSprite(&gSpriteTemplate_Arrow, MODIFY_DIGITS_ARROW_X + (data->modifyArrows.currentDigit * 6), MODIFY_DIGITS_ARROW1_Y, 0); diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 66bfa817cc..a0193ff6e7 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -3742,7 +3742,7 @@ static void PrintMoveDetails(u16 move) ShowSplitIcon(GetBattleMoveSplit(move)); #endif PrintMovePowerAndAccuracy(move); - + if (moveEffect != EFFECT_PLACEHOLDER) PrintTextOnWindow(windowId, gMoveDescriptionPointers[move - 1], 6, 1, 0, 0); else diff --git a/src/scrcmd.c b/src/scrcmd.c index 2813a37f37..e5ea3d5e11 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1885,7 +1885,7 @@ bool8 ScrCmd_setwildbattle(struct ScriptContext *ctx) gIsScriptedWildDouble = FALSE; } else - { + { CreateScriptedDoubleWildMon(species, level, item, species2, level2, item2); gIsScriptedWildDouble = TRUE; } diff --git a/src/start_menu.c b/src/start_menu.c index a0cff087cd..b79b25741b 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -324,7 +324,7 @@ static void BuildNormalStartMenu(void) } static void BuildDebugStartMenu(void) -{ +{ AddStartMenuAction(MENU_ACTION_DEBUG); if (FlagGet(FLAG_SYS_POKEDEX_GET) == TRUE) AddStartMenuAction(MENU_ACTION_POKEDEX); diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 4e8aceb2b3..8bf8c45e0e 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -1006,7 +1006,7 @@ bool8 TryDoDoubleWildBattle(void) { if (GetSafariZoneFlag() || GetMonsStateToDoubles() != PLAYER_HAS_TWO_USABLE_MONS) return FALSE; -#if B_FLAG_FORCE_DOUBLE_WILD != 0 +#if B_FLAG_FORCE_DOUBLE_WILD != 0 else if (FlagGet(B_FLAG_FORCE_DOUBLE_WILD)) return TRUE; #endif diff --git a/tools/aif2pcm/main.c b/tools/aif2pcm/main.c index 720db1acae..0824b92da8 100644 --- a/tools/aif2pcm/main.c +++ b/tools/aif2pcm/main.c @@ -238,7 +238,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data) { FATAL_ERROR("More than one MARK Chunk in file!\n"); } - + markers = calloc(num_markers, sizeof(struct Marker)); // Read each marker. @@ -289,7 +289,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data) // Skip NoLooping sustain loop. pos += 4; } - + // Skip release loop, we don't need it. pos += 6; } @@ -303,7 +303,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data) { uint8_t *sample_data = (uint8_t *)malloc(num_samples * sizeof(uint8_t)); memcpy(sample_data, &aif->data[pos], num_samples); - + aif_data->samples8 = sample_data; aif_data->real_num_samples = num_samples; } @@ -316,7 +316,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data) { sample_data_swapped[i] = __builtin_bswap16(sample_data[i]); } - + aif_data->samples16 = sample_data_swapped; aif_data->real_num_samples = num_samples; free(sample_data); @@ -329,12 +329,12 @@ void read_aif(struct Bytes *aif, AifData *aif_data) pos += chunk_size; } } - + if (markers) { // Resolve loop points. struct Marker *cur_marker = markers; - + // Grab loop start point. for (int i = 0; i < num_markers; i++, cur_marker++) { @@ -573,7 +573,7 @@ void aif2pcm(const char *aif_filename, const char *pcm_filename, bool compress) struct Bytes *aif = read_bytearray(aif_filename); AifData aif_data = {0}; read_aif(aif, &aif_data); - + // Convert 16-bit to 8-bit if necessary if (aif_data.sample_size == 16) { diff --git a/tools/gbagfx/font.c b/tools/gbagfx/font.c index 0dd6fbc3ee..1251b5c647 100644 --- a/tools/gbagfx/font.c +++ b/tools/gbagfx/font.c @@ -26,7 +26,7 @@ static void ConvertFromLatinFont(unsigned char *src, unsigned char *dest, unsign unsigned int pixelsX = (column * 16) + ((glyphTile & 1) * 8); for (unsigned int i = 0; i < 8; i++) { - unsigned int pixelsY = (row * 16) + ((glyphTile >> 1) * 8) + i; + unsigned int pixelsY = (row * 16) + ((glyphTile >> 1) * 8) + i; unsigned int destPixelsOffset = (pixelsY * 64) + (pixelsX / 4); dest[destPixelsOffset] = src[srcPixelsOffset + 1]; @@ -75,7 +75,7 @@ static void ConvertFromHalfwidthJapaneseFont(unsigned char *src, unsigned char * for (unsigned int i = 0; i < 8; i++) { unsigned int pixelsY = (row * 16) + (glyphTile * 8) + i; unsigned int destPixelsOffset = (pixelsY * 32) + (pixelsX / 4); - + dest[destPixelsOffset] = src[srcPixelsOffset + 1]; dest[destPixelsOffset + 1] = src[srcPixelsOffset]; @@ -233,7 +233,7 @@ void ReadHalfwidthJapaneseFont(char *path, struct Image *image) FATAL_ERROR("The file size (%d) is not a multiple of %d.\n", fileSize, glyphSize); int numGlyphs = fileSize / glyphSize; - + if (numGlyphs % 16 != 0) FATAL_ERROR("The number of glyphs (%d) is not a multiple of 16.\n", numGlyphs); diff --git a/tools/jsonproc/inja.hpp b/tools/jsonproc/inja.hpp index d5bf5bcba4..21478ea115 100755 --- a/tools/jsonproc/inja.hpp +++ b/tools/jsonproc/inja.hpp @@ -1675,7 +1675,7 @@ class FunctionStorage { #include #include -#include +#include #include // #include "bytecode.hpp" diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index 8de9ff8d01..9b02350f04 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -77,8 +77,8 @@ string generate_map_header_text(Json map_data, Json layouts_data, string version ostringstream text; - text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/" - << map_data["name"].string_value() + text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/" + << map_data["name"].string_value() << "/map.json\n@\n\n"; text << map_data["name"].string_value() << ":\n" @@ -128,8 +128,8 @@ string generate_map_connections_text(Json map_data) { ostringstream text; - text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/" - << map_data["name"].string_value() + text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/" + << map_data["name"].string_value() << "/map.json\n@\n\n"; text << map_data["name"].string_value() << "_MapConnectionsList:\n"; @@ -154,8 +154,8 @@ string generate_map_events_text(Json map_data) { ostringstream text; - text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/" - << map_data["name"].string_value() + text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/" + << map_data["name"].string_value() << "/map.json\n@\n\n"; string objects_label, warps_label, coords_label, bgs_label; @@ -399,7 +399,7 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { text << "// " << group.string_value() << "\n"; vector map_ids; size_t max_length = 0; - + int map_count = 0; //DEBUG for (auto &map_name : groups_data[group.string_value()].array_items()) { diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp index 17a08cc9f7..508c628731 100644 --- a/tools/preproc/c_file.cpp +++ b/tools/preproc/c_file.cpp @@ -383,7 +383,7 @@ void CFile::TryConvertIncbin() if (m_buffer[m_pos] == '\\') RaiseError("unexpected escape in path string"); - + m_pos++; } @@ -418,7 +418,7 @@ void CFile::TryConvertIncbin() m_pos++; } - + if (m_buffer[m_pos] != ')') RaiseError("expected ')'"); diff --git a/tools/preproc/charmap.cpp b/tools/preproc/charmap.cpp index a7bedfe26f..a0c631026c 100644 --- a/tools/preproc/charmap.cpp +++ b/tools/preproc/charmap.cpp @@ -119,7 +119,7 @@ Lhs CharmapReader::ReadLhs() break; } } - + if (m_buffer[m_pos] == '\'') { m_pos++; diff --git a/tools/scaninc/source_file.cpp b/tools/scaninc/source_file.cpp index df31282f80..9d188eb738 100644 --- a/tools/scaninc/source_file.cpp +++ b/tools/scaninc/source_file.cpp @@ -41,7 +41,7 @@ SourceFileType GetFileType(std::string& path) return SourceFileType::Inc; else FATAL_ERROR("Unrecognized extension \"%s\"\n", extension.c_str()); - + // Unreachable return SourceFileType::Cpp; } @@ -84,7 +84,7 @@ SourceFile::SourceFile(std::string path) else incbins.insert(outputPath); } - + new (&m_source_file.asm_wrapper) SourceFile::InnerUnion::AsmWrapper{incbins, includes}; } } From 2c205140357062d1d1d1c0ec6bb34493cb4255e9 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Wed, 14 Sep 2022 13:39:35 +0200 Subject: [PATCH 137/155] improved debug menu function declaration consistency --- src/debug.c | 62 ++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/debug.c b/src/debug.c index ac5c238313..e40ed4afee 100644 --- a/src/debug.c +++ b/src/debug.c @@ -174,33 +174,33 @@ struct DebugMonData // Define functions static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate); void Debug_ShowMainMenu(void); -static void Debug_DestroyMenu(u8); -static void Debug_DestroyMenu_Full(u8); -static void DebugAction_Cancel(u8); +static void Debug_DestroyMenu(u8 taskId); +static void Debug_DestroyMenu_Full(u8 taskId); +static void DebugAction_Cancel(u8 taskId); static void DebugAction_DestroyExtraWindow(u8 taskId); -static void DebugAction_Util_Script_1(u8); -static void DebugAction_Util_Script_2(u8); -static void DebugAction_Util_Script_3(u8); -static void DebugAction_Util_Script_4(u8); -static void DebugAction_Util_Script_5(u8); -static void DebugAction_Util_Script_6(u8); -static void DebugAction_Util_Script_7(u8); -static void DebugAction_Util_Script_8(u8); +static void DebugAction_Util_Script_1(u8 taskId); +static void DebugAction_Util_Script_2(u8 taskId); +static void DebugAction_Util_Script_3(u8 taskId); +static void DebugAction_Util_Script_4(u8 taskId); +static void DebugAction_Util_Script_5(u8 taskId); +static void DebugAction_Util_Script_6(u8 taskId); +static void DebugAction_Util_Script_7(u8 taskId); +static void DebugAction_Util_Script_8(u8 taskId); -static void DebugAction_OpenUtilitiesMenu(u8); -static void DebugAction_OpenScriptsMenu(u8); -static void DebugAction_OpenFlagsMenu(u8); -static void DebugAction_OpenVariablesMenu(u8); -static void DebugAction_OpenGiveMenu(u8); -static void DebugAction_OpenSoundMenu(u8); -static void DebugTask_HandleMenuInput_Main(u8); -static void DebugTask_HandleMenuInput_Utilities(u8); -static void DebugTask_HandleMenuInput_Scripts(u8); -static void DebugTask_HandleMenuInput_Flags(u8); -static void DebugTask_HandleMenuInput_Vars(u8); -static void DebugTask_HandleMenuInput_Give(u8); -static void DebugTask_HandleMenuInput_Sound(u8); +static void DebugAction_OpenUtilitiesMenu(u8 taskId); +static void DebugAction_OpenScriptsMenu(u8 taskId); +static void DebugAction_OpenFlagsMenu(u8 taskId); +static void DebugAction_OpenVariablesMenu(u8 taskId); +static void DebugAction_OpenGiveMenu(u8 taskId); +static void DebugAction_OpenSoundMenu(u8 taskId); +static void DebugTask_HandleMenuInput_Main(u8 taskId); +static void DebugTask_HandleMenuInput_Utilities(u8 taskId); +static void DebugTask_HandleMenuInput_Scripts(u8 taskId); +static void DebugTask_HandleMenuInput_Flags(u8 taskId); +static void DebugTask_HandleMenuInput_Vars(u8 taskId); +static void DebugTask_HandleMenuInput_Give(u8 taskId); +static void DebugTask_HandleMenuInput_Sound(u8 taskId); static void DebugAction_Util_HealParty(u8 taskId); static void DebugAction_Util_Fly(u8 taskId); @@ -210,13 +210,13 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId); static void DebugAction_Util_Warp_SelectWarp(u8 taskId); static void DebugAction_Util_RunningShoes(u8 taskId); static void DebugAction_Util_PoisonMons(u8 taskId); -static void DebugAction_Util_CheckSaveBlock(u8); -static void DebugAction_Util_CheckWallClock(u8); -static void DebugAction_Util_SetWallClock(u8); -static void DebugAction_Util_WatchCredits(u8); -static void DebugAction_Util_Trainer_Name(u8); -static void DebugAction_Util_Trainer_Gender(u8); -static void DebugAction_Util_Trainer_Id(u8); +static void DebugAction_Util_CheckSaveBlock(u8 taskId); +static void DebugAction_Util_CheckWallClock(u8 taskId); +static void DebugAction_Util_SetWallClock(u8 taskId); +static void DebugAction_Util_WatchCredits(u8 taskId); +static void DebugAction_Util_Trainer_Name(u8 taskId); +static void DebugAction_Util_Trainer_Gender(u8 taskId); +static void DebugAction_Util_Trainer_Id(u8 taskId); static void DebugAction_Flags_Flags(u8 taskId); static void DebugAction_Flags_FlagsSelect(u8 taskId); From 1e03b4747fa259d735dd958f6ea3b1dd7097f822 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Wed, 14 Sep 2022 13:43:26 +0200 Subject: [PATCH 138/155] debug menu: object events now frozen while open --- src/debug.c | 2 ++ src/field_control_avatar.c | 1 + src/start_menu.c | 1 + 3 files changed, 4 insertions(+) diff --git a/src/debug.c b/src/debug.c index e40ed4afee..38da0696f6 100644 --- a/src/debug.c +++ b/src/debug.c @@ -709,6 +709,7 @@ static void Debug_DestroyMenu_Full(u8 taskId) ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); RemoveWindow(gTasks[taskId].data[1]); DestroyTask(taskId); + UnfreezeObjectEvents(); } static void DebugAction_Cancel(u8 taskId) { @@ -725,6 +726,7 @@ static void DebugAction_DestroyExtraWindow(u8 taskId) DestroyTask(taskId); ScriptContext_Enable(); + UnfreezeObjectEvents(); } diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index d407cc0279..c325b63e5c 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -201,6 +201,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (input->input_field_1_2) { PlaySE(SE_WIN_OPEN); + FreezeObjectEvents(); Debug_ShowMainMenu(); return TRUE; } diff --git a/src/start_menu.c b/src/start_menu.c index a0cff087cd..388b2ce35a 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -761,6 +761,7 @@ static bool8 StartMenuDebugCallback(void) HideStartMenuDebug(); // Hide start menu without enabling movement #if DEBUG_SYSTEM_ENABLE == TRUE + FreezeObjectEvents(); Debug_ShowMainMenu(); #endif From ef4e64c2f7d00053a16cc06672762ba8875c4aa1 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Wed, 14 Sep 2022 14:51:03 +0200 Subject: [PATCH 139/155] -added a submenu to set the weather -lowest flag is 1 --- src/debug.c | 171 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 148 insertions(+), 23 deletions(-) diff --git a/src/debug.c b/src/debug.c index 38da0696f6..464835d3da 100644 --- a/src/debug.c +++ b/src/debug.c @@ -18,6 +18,7 @@ #include "event_scripts.h" #include "field_message_box.h" #include "field_screen_effect.h" +#include "field_weather.h" #include "international_string_util.h" #include "item.h" #include "item_icon.h" @@ -55,6 +56,7 @@ #include "constants/rgb.h" #include "constants/songs.h" #include "constants/species.h" +#include "constants/weather.h" #if DEBUG_SYSTEM_ENABLE == TRUE // ******************************* @@ -76,6 +78,7 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES, DEBUG_UTIL_MENU_ITEM_POISON_MONS, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK, + DEBUG_UTIL_MENU_ITEM_WEATHER, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS, @@ -135,6 +138,8 @@ enum { //Sound #define DEBUG_NUMBER_DISPLAY_WIDTH 10 #define DEBUG_NUMBER_DISPLAY_HEIGHT 4 +#define DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH 15 +#define DEBUG_NUMBER_DISPLAY_MEDIUM_HEIGHT 3 #define DEBUG_NUMBER_DISPLAY_SOUND_WIDTH 20 #define DEBUG_NUMBER_DISPLAY_SOUND_HEIGHT 6 @@ -211,6 +216,8 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId); static void DebugAction_Util_RunningShoes(u8 taskId); static void DebugAction_Util_PoisonMons(u8 taskId); static void DebugAction_Util_CheckSaveBlock(u8 taskId); +static void DebugAction_Util_Weather(u8 taskId); +static void DebugAction_Util_Weather_SelectId(u8 taskId); static void DebugAction_Util_CheckWallClock(u8 taskId); static void DebugAction_Util_SetWallClock(u8 taskId); static void DebugAction_Util_WatchCredits(u8 taskId); @@ -317,6 +324,8 @@ static const u8 gDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {S static const u8 gDebugText_Util_RunningShoes[] = _("Toggle Running Shoes"); static const u8 gDebugText_Util_PoisonMons[] = _("Poison all mons"); static const u8 gDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); +static const u8 gDebugText_Util_Weather[] = _("Set weather"); +static const u8 gDebugText_Util_Weather_ID[] = _("Weather Id: {STR_VAR_3}\n{STR_VAR_1}\n{STR_VAR_2}"); static const u8 gDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); static const u8 gDebugText_Util_SetWallClock[] = _("Set Wall Clock"); static const u8 gDebugText_Util_WatchCredits[] = _("Watch Credits"); @@ -437,6 +446,7 @@ static const struct ListMenuItem sDebugMenu_Items_Utilities[] = [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = {gDebugText_Util_RunningShoes, DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES}, [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {gDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {gDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = {gDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {gDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {gDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {gDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, @@ -515,6 +525,7 @@ static void (*const sDebugMenu_Actions_Utilities[])(u8) = [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = DebugAction_Util_RunningShoes, [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather, [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, @@ -595,6 +606,16 @@ static const struct WindowTemplate sDebugNumberDisplayWindowTemplate = .paletteNum = 15, .baseBlock = 1, }; +static const struct WindowTemplate sDebugNumberDisplayMediumWindowTemplate = +{ + .bg = 0, + .tilemapLeft = 30 - DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH - 1, + .tilemapTop = 1, + .width = DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH, + .height = 2 * DEBUG_NUMBER_DISPLAY_MEDIUM_HEIGHT, + .paletteNum = 15, + .baseBlock = 1, +}; static const struct WindowTemplate sDebugNumberDisplayLargeWindowTemplate = { .bg = 0, @@ -1023,23 +1044,23 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > max_value - 1) + if (gTasks[taskId].data[3] > max_value - 1) gTasks[taskId].data[3] = max_value - 1; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < 2) + if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; } @@ -1075,16 +1096,16 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId) if (gMain.newKeys & DPAD_ANY) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > 10) + if (gTasks[taskId].data[3] > 10) gTasks[taskId].data[3] = 10; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0) + if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } @@ -1154,6 +1175,110 @@ static void DebugAction_Util_CheckSaveBlock(u8 taskId) LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_ShowFieldMessageStringVar4); } + +static const u8 sWeatherNames[22][24] = { + [WEATHER_NONE] = _("NONE"), + [WEATHER_SUNNY_CLOUDS] = _("SUNNY CLOUDS"), + [WEATHER_SUNNY] = _("SUNNY"), + [WEATHER_RAIN] = _("RAIN"), + [WEATHER_SNOW] = _("SNOW"), + [WEATHER_RAIN_THUNDERSTORM] = _("RAIN THUNDERSTORM"), + [WEATHER_FOG_HORIZONTAL] = _("FOG HORIZONTAL"), + [WEATHER_VOLCANIC_ASH] = _("VOLCANIC ASH"), + [WEATHER_SANDSTORM] = _("SANDSTORM"), + [WEATHER_FOG_DIAGONAL] = _("FOG DIAGONAL"), + [WEATHER_UNDERWATER] = _("UNDERWATER"), + [WEATHER_SHADE] = _("SHADE"), + [WEATHER_DROUGHT] = _("DROUGHT"), + [WEATHER_DOWNPOUR] = _("DOWNPOUR"), + [WEATHER_UNDERWATER_BUBBLES] = _("UNDERWATER BUBBLES"), + [WEATHER_ABNORMAL] = _("ABNORMAL(NOT WORKING)"), + [WEATHER_ROUTE119_CYCLE] = _("ROUTE119 CYCLE"), + [WEATHER_ROUTE123_CYCLE] = _("ROUTE123 CYCLE"), +}; +static const u8 sText_WeatherNotDefined[] = _("NOT DEFINED!!!"); +static void DebugAction_Util_Weather(u8 taskId) +{ + u8 windowId; + + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugNumberDisplayMediumWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + CopyWindowToVram(windowId, 3); + + //Display initial ID + StringCopy(gStringVar2, gText_DigitIndicator[0]); + ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 2); + StringCopyPadded(gStringVar1, sWeatherNames[0], CHAR_SPACE, 30); + StringExpandPlaceholders(gStringVar4, gDebugText_Util_Weather_ID); + AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Util_Weather_SelectId; + gTasks[taskId].data[2] = windowId; + gTasks[taskId].data[3] = 0; //Current ID + gTasks[taskId].data[4] = 0; //Digit Selected +} +static void DebugAction_Util_Weather_SelectId(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if (gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if (gTasks[taskId].data[3] > WEATHER_ROUTE123_CYCLE) + gTasks[taskId].data[3] = WEATHER_ROUTE123_CYCLE; + } + if (gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if (gTasks[taskId].data[3] < WEATHER_NONE) + gTasks[taskId].data[3] = WEATHER_NONE; + } + if (gMain.newKeys & DPAD_LEFT) + { + if (gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if (gMain.newKeys & DPAD_RIGHT) + { + if (gTasks[taskId].data[4] < 2) + gTasks[taskId].data[4] += 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + + if (gTasks[taskId].data[3] <= 15 || gTasks[taskId].data[3] >= 20) + StringCopyPadded(gStringVar1, sWeatherNames[gTasks[taskId].data[3]], CHAR_SPACE, 30); + else + StringCopyPadded(gStringVar1, sText_WeatherNotDefined, CHAR_SPACE, 30); + + StringExpandPlaceholders(gStringVar4, gDebugText_Util_Weather_ID); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + if (gTasks[taskId].data[3] <= 14 || gTasks[taskId].data[3] >= 20) + { + gTasks[taskId].data[5] = gTasks[taskId].data[3]; + SetWeather(gTasks[taskId].data[5]); + } + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} + static void DebugAction_Util_CheckWallClock(u8 taskId) { Debug_DestroyMenu_Full(taskId); @@ -1179,7 +1304,7 @@ static void DebugAction_Util_Trainer_Name(u8 taskId) } static void DebugAction_Util_Trainer_Gender(u8 taskId) { - if(gSaveBlock2Ptr->playerGender == 0) // 0 Male, 1 Female + if (gSaveBlock2Ptr->playerGender == 0) // 0 Male, 1 Female gSaveBlock2Ptr->playerGender = 1; else gSaveBlock2Ptr->playerGender = 0; @@ -1262,10 +1387,10 @@ static void DebugAction_Flags_Flags(u8 taskId) CopyWindowToVram(windowId, 3); //Display initial Flag - ConvertIntToDecimalStringN(gStringVar1, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); - ConvertIntToHexStringN(gStringVar2, 0, STR_CONV_MODE_LEFT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); + ConvertIntToHexStringN(gStringVar2, 1, STR_CONV_MODE_LEFT_ALIGN, 3); StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex); - if (FlagGet(0) == TRUE) + if (FlagGet(FLAG_TEMP_1) == TRUE) StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); else StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); @@ -1275,8 +1400,8 @@ static void DebugAction_Flags_Flags(u8 taskId) gTasks[taskId].func = DebugAction_Flags_FlagsSelect; gTasks[taskId].data[2] = windowId; - gTasks[taskId].data[3] = 0; //Current Flag - gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[3] = FLAG_TEMP_1; //Current Flag + gTasks[taskId].data[4] = 0; //Digit Selected } static void DebugAction_Flags_FlagsSelect(u8 taskId) { @@ -1301,8 +1426,8 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) { PlaySE(SE_SELECT); gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if (gTasks[taskId].data[3] < 0){ - gTasks[taskId].data[3] = 0; + if (gTasks[taskId].data[3] < 1){ + gTasks[taskId].data[3] = 1; } } if (gMain.newKeys & DPAD_LEFT) @@ -1541,7 +1666,7 @@ static void DebugAction_Vars_Select(u8 taskId) if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > VARS_END) + if (gTasks[taskId].data[3] > VARS_END) gTasks[taskId].data[3] = VARS_END; } if (gMain.newKeys & DPAD_DOWN) @@ -1553,7 +1678,7 @@ static void DebugAction_Vars_Select(u8 taskId) if (gMain.newKeys & DPAD_LEFT) { gTasks[taskId].data[4] -= 1; - if(gTasks[taskId].data[4] < 0) + if (gTasks[taskId].data[4] < 0) gTasks[taskId].data[4] = 0; } if (gMain.newKeys & DPAD_RIGHT) @@ -1613,7 +1738,7 @@ static void DebugAction_Vars_Select(u8 taskId) } static void DebugAction_Vars_SetValue(u8 taskId) { - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { if (gTasks[taskId].data[6] + sPowersOfTen[gTasks[taskId].data[4]] <= 32000) gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]]; @@ -1623,7 +1748,7 @@ static void DebugAction_Vars_SetValue(u8 taskId) if (gTasks[taskId].data[6] >= 32000) gTasks[taskId].data[6] = 32000 - 1; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[6] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[6] < 0){ @@ -1719,7 +1844,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] >= ITEMS_COUNT) + if (gTasks[taskId].data[3] >= ITEMS_COUNT) gTasks[taskId].data[3] = ITEMS_COUNT - 1; } if (gMain.newKeys & DPAD_DOWN) @@ -1730,7 +1855,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) } if (gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } if (gMain.newKeys & DPAD_RIGHT) @@ -2150,7 +2275,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0) + if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } From 20190ac85a7f5b744a799567033459052c151f7f Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 15 Sep 2022 18:34:15 -0400 Subject: [PATCH 140/155] fix ai switch semi invulnerable --- src/battle_ai_switch_items.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 4948113a21..f6ce4622f1 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -370,7 +370,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) //Pass Wish Heal //Semi-Invulnerable - if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) + if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) { if (FindMonThatAbsorbsOpponentsMove()) //If find absorber default to switch switchMon = TRUE; if (!AI_OpponentCanFaintAiWithMod(0) @@ -380,6 +380,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) && !WillAIStrikeFirst() && !AI_OpponentCanFaintAiWithMod(0)) switchMon = FALSE; + } } if (switchMon) From 95a3ead254a27afcc1054418f056a660f95d35bf Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 15 Sep 2022 22:10:39 -0400 Subject: [PATCH 141/155] styling fix --- src/battle_ai_switch_items.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index f6ce4622f1..3c3410e30b 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -370,7 +370,8 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) //Pass Wish Heal //Semi-Invulnerable - if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) { + if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) + { if (FindMonThatAbsorbsOpponentsMove()) //If find absorber default to switch switchMon = TRUE; if (!AI_OpponentCanFaintAiWithMod(0) From 672f572ff8b288a7a421032ed7a36e6596c229b4 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 16 Sep 2022 11:04:30 -0300 Subject: [PATCH 142/155] Config to limit the moves called by Metronome (by generation) --- include/constants/battle_config.h | 1 + src/battle_script_commands.c | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index b8d7c9f8ae..4b6c0cc1ec 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -86,6 +86,7 @@ #define B_HEAL_BLOCKING GEN_LATEST // In Gen5+, Heal Block prevents healing by Black Sludge, Leftovers, Shell Bell. Affected Pokémon will not consume held HP-restoring Berries or Berry Juice. // Draining abilities will not heal but will prevent damage. In Gen6+, Heal Block prevents the use of most HP-draining moves. #define B_ROOTED_GROUNDING GEN_LATEST // In Gen4+, Ingrain causes the affected Pokémon to become grounded. +#define B_METRONOME_MOVES GEN_LATEST // This config will determine up to which generation will Metronome pull moves from. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b03220066d..f5884d206d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -11472,9 +11472,23 @@ static void Cmd_mimicattackcopy(void) static void Cmd_metronome(void) { +#if B_METRONOME_MOVES >= GEN_8 + u16 moveCount = MOVES_COUNT_GEN8; +#elif B_METRONOME_MOVES >= GEN_7 + u16 moveCount = MOVES_COUNT_GEN7; +#elif B_METRONOME_MOVES >= GEN_6 + u16 moveCount = MOVES_COUNT_GEN6; +#elif B_METRONOME_MOVES >= GEN_5 + u16 moveCount = MOVES_COUNT_GEN5; +#elif B_METRONOME_MOVES >= GEN_4 + u16 moveCount = MOVES_COUNT_GEN4; +#elif B_METRONOME_MOVES >= GEN_3 + u16 moveCount = MOVES_COUNT_GEN3; +#endif + while (TRUE) { - gCurrentMove = (Random() % (MOVES_COUNT - 1)) + 1; + gCurrentMove = (Random() % (moveCount - 1)) + 1; if (gBattleMoves[gCurrentMove].effect == EFFECT_PLACEHOLDER) continue; From 5f74781a7d540036e2ba20d7cc7b028bccb80b40 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Sat, 17 Sep 2022 17:44:50 -0600 Subject: [PATCH 143/155] Remove ACE_POKEMON_FUNCTIONALITY --- include/constants/battle_ai.h | 2 +- src/battle_ai_switch_items.c | 28 ++++++++++++++-------------- src/battle_controller_opponent.c | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index 5dbbccf489..e45ce035c2 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -56,7 +56,7 @@ #define AI_FLAG_STALL (1 << 13) // AI stalls battle and prefers secondary damage/trapping/etc. TODO not finished #define AI_FLAG_SCREENER (1 << 14) // AI prefers screening effects like reflect, mist, etc. TODO unfinished #define AI_FLAG_SMART_SWITCHING (1 << 15) // AI includes a lot more switching checks -#define AI_FLAG_ACE_POKEMON (1 << 16) // AI has Ace Pokemon. The last Pokemon in the party will not used until last remaining. +//#define AI_FLAG_ACE_POKEMON (1 << 16) // AI has Ace Pokemon. The last Pokemon in the party will not used until last remaining. // 'other' ai logic flags #define AI_FLAG_ROAMING (1 << 29) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 7493be32b9..6642810cfd 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -109,9 +109,9 @@ static bool8 ShouldSwitchIfWonderGuard(void) continue; if (i == gBattlerPartyIndexes[gActiveBattler]) continue; - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && i == (CalculateEnemyPartyCount()-1)) - continue; + continue;*/ for (opposingBattler = GetBattlerAtPosition(opposingPosition), j = 0; j < MAX_MON_MOVES; j++) { @@ -202,9 +202,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && i == (CalculateEnemyPartyCount()-1)) - continue; + continue;*/ species = GetMonData(&party[i], MON_DATA_SPECIES); @@ -283,9 +283,9 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) for (i = firstId; i < lastId; i++) { - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && i == (CalculateEnemyPartyCount()-1)) - break; + break;*/ //Look for mon in party that is able to be switched into and has ability that sets terrain if (GetMonData(&party[i], MON_DATA_HP) != 0 @@ -574,9 +574,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && i == (CalculateEnemyPartyCount()-1)) - continue; + continue;*/ species = GetMonData(&party[i], MON_DATA_SPECIES); @@ -666,9 +666,9 @@ bool32 ShouldSwitch(void) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && i == (CalculateEnemyPartyCount()-1)) - continue; + continue;*/ availableToSwitch++; } @@ -756,9 +756,9 @@ void AI_TrySwitchOrUseItem(void) continue; if (monToSwitchId == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && monToSwitchId == (CalculateEnemyPartyCount()-1)) - continue; + continue;*/ break; } @@ -957,8 +957,8 @@ u8 GetMostSuitableMonToSwitchInto(void) || i == *(gBattleStruct->monToSwitchIntoId + battlerIn1) || i == *(gBattleStruct->monToSwitchIntoId + battlerIn2) || (GetMonAbility(&party[i]) == ABILITY_TRUANT && IsTruantMonVulnerable(gActiveBattler, opposingBattler)) // While not really invalid per say, not really wise to switch into this mon. - || (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON - && i == (CalculateEnemyPartyCount()-1))) //Save Ace Pokemon for last + /*|| (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1))*/) //Save Ace Pokemon for last invalidMons |= gBitTable[i]; else aliveCount++; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 07cf95589f..7cd44d7095 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1699,9 +1699,9 @@ static void OpponentHandleChoosePokemon(void) if (GetMonData(&gEnemyParty[chosenMonId], MON_DATA_HP) != 0 && chosenMonId != gBattlerPartyIndexes[battler1] && chosenMonId != gBattlerPartyIndexes[battler2] - && (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + /*&& (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && (!(chosenMonId == (CalculateEnemyPartyCount()-1)) - || CountAIAliveNonEggMonsExcept(PARTY_SIZE) == pokemonInBattle))) + || CountAIAliveNonEggMonsExcept(PARTY_SIZE) == pokemonInBattle))*/) { break; } From 293a880238b6e8707f43fd0d5d7dea3eeb4b9c7a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 18 Sep 2022 00:50:21 -0300 Subject: [PATCH 144/155] Apply suggestions from code review --- include/constants/battle_ai.h | 2 +- src/battle_ai_switch_items.c | 28 ++++++++++++++-------------- src/battle_controller_opponent.c | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index e45ce035c2..1cfb9cd4dc 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -56,7 +56,7 @@ #define AI_FLAG_STALL (1 << 13) // AI stalls battle and prefers secondary damage/trapping/etc. TODO not finished #define AI_FLAG_SCREENER (1 << 14) // AI prefers screening effects like reflect, mist, etc. TODO unfinished #define AI_FLAG_SMART_SWITCHING (1 << 15) // AI includes a lot more switching checks -//#define AI_FLAG_ACE_POKEMON (1 << 16) // AI has Ace Pokemon. The last Pokemon in the party will not used until last remaining. +#define AI_FLAG_ACE_POKEMON (1 << 16) // AI has an Ace Pokemon. The last Pokemon in the party will not be used until it's the last one remaining. // 'other' ai logic flags #define AI_FLAG_ROAMING (1 << 29) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 6642810cfd..6f5de84c40 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -109,9 +109,9 @@ static bool8 ShouldSwitchIfWonderGuard(void) continue; if (i == gBattlerPartyIndexes[gActiveBattler]) continue; - /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && i == (CalculateEnemyPartyCount()-1)) - continue;*/ + continue; for (opposingBattler = GetBattlerAtPosition(opposingPosition), j = 0; j < MAX_MON_MOVES; j++) { @@ -202,9 +202,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && i == (CalculateEnemyPartyCount()-1)) - continue;*/ + continue; species = GetMonData(&party[i], MON_DATA_SPECIES); @@ -283,9 +283,9 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) for (i = firstId; i < lastId; i++) { - /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && i == (CalculateEnemyPartyCount()-1)) - break;*/ + break; //Look for mon in party that is able to be switched into and has ability that sets terrain if (GetMonData(&party[i], MON_DATA_HP) != 0 @@ -574,9 +574,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && i == (CalculateEnemyPartyCount()-1)) - continue;*/ + continue; species = GetMonData(&party[i], MON_DATA_SPECIES); @@ -666,9 +666,9 @@ bool32 ShouldSwitch(void) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && i == (CalculateEnemyPartyCount()-1)) - continue;*/ + continue; availableToSwitch++; } @@ -756,9 +756,9 @@ void AI_TrySwitchOrUseItem(void) continue; if (monToSwitchId == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; - /*if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON && monToSwitchId == (CalculateEnemyPartyCount()-1)) - continue;*/ + continue; break; } @@ -957,8 +957,8 @@ u8 GetMostSuitableMonToSwitchInto(void) || i == *(gBattleStruct->monToSwitchIntoId + battlerIn1) || i == *(gBattleStruct->monToSwitchIntoId + battlerIn2) || (GetMonAbility(&party[i]) == ABILITY_TRUANT && IsTruantMonVulnerable(gActiveBattler, opposingBattler)) // While not really invalid per say, not really wise to switch into this mon. - /*|| (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON - && i == (CalculateEnemyPartyCount()-1))*/) //Save Ace Pokemon for last + || ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON) + && i == (CalculateEnemyPartyCount() - 1))) //Save Ace Pokemon for last invalidMons |= gBitTable[i]; else aliveCount++; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 7cd44d7095..bf8f7f8698 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1699,9 +1699,9 @@ static void OpponentHandleChoosePokemon(void) if (GetMonData(&gEnemyParty[chosenMonId], MON_DATA_HP) != 0 && chosenMonId != gBattlerPartyIndexes[battler1] && chosenMonId != gBattlerPartyIndexes[battler2] - /*&& (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON - && (!(chosenMonId == (CalculateEnemyPartyCount()-1)) - || CountAIAliveNonEggMonsExcept(PARTY_SIZE) == pokemonInBattle))*/) + && (!(AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON) + || chosenMonId != CalculateEnemyPartyCount() - 1 + || CountAIAliveNonEggMonsExcept(PARTY_SIZE) == pokemonInBattle)) { break; } From 41ae8ecdb7625c80c42ebf3a74e23cb12ae7124b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 18 Sep 2022 00:51:34 -0300 Subject: [PATCH 145/155] Update src/battle_controller_opponent.c --- src/battle_controller_opponent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index bf8f7f8698..5a307cfc9c 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1701,7 +1701,7 @@ static void OpponentHandleChoosePokemon(void) && chosenMonId != gBattlerPartyIndexes[battler2] && (!(AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON) || chosenMonId != CalculateEnemyPartyCount() - 1 - || CountAIAliveNonEggMonsExcept(PARTY_SIZE) == pokemonInBattle)) + || CountAIAliveNonEggMonsExcept(PARTY_SIZE) == pokemonInBattle)) { break; } From add3625589e2d9c6ae044fbf4965902420f66213 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 18 Sep 2022 22:47:30 -0400 Subject: [PATCH 146/155] fix natural cure, shed skin, early bird check in ShouldSwitchIfGameStatePrompt --- src/battle_ai_switch_items.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 6f5de84c40..5876e8b474 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -312,7 +312,9 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) switchMon = FALSE; //Checks to see if active Pokemon can do something against sleep - if (monAbility == (ABILITY_NATURAL_CURE | ABILITY_SHED_SKIN | ABILITY_EARLY_BIRD) + if ((monAbility == ABILITY_NATURAL_CURE + || monAbility == ABILITY_SHED_SKIN + || monAbility == ABILITY_EARLY_BIRD) || holdEffect == (HOLD_EFFECT_CURE_SLP | HOLD_EFFECT_CURE_STATUS) || HasMove(gActiveBattler, MOVE_SLEEP_TALK) || (HasMoveEffect(gActiveBattler, MOVE_SNORE) && AI_GetTypeEffectiveness(MOVE_SNORE, gActiveBattler, opposingBattler) >= UQ_4_12(1.0)) From c137b01dd8ce0a5352c01164a756e18f6856dbbb Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Mon, 19 Sep 2022 04:19:19 -0300 Subject: [PATCH 147/155] Update debug.c --- src/debug.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/debug.c b/src/debug.c index 7c99ad2c28..27c6638635 100644 --- a/src/debug.c +++ b/src/debug.c @@ -2813,8 +2813,8 @@ static void DebugAction_AccessPC(u8 taskId) // ******************************* // Sound Scripts -static const u8 *const gBGMNames[]; -static const u8 *const gSENames[]; +static const u8 *const sBGMNames[]; +static const u8 *const sSENames[]; static void DebugAction_Sound_SE(u8 taskId) { u8 windowId; @@ -2832,7 +2832,7 @@ static void DebugAction_Sound_SE(u8 taskId) //Display initial ID StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - StringCopyPadded(gStringVar1, gSENames[0], CHAR_SPACE, 35); + StringCopyPadded(gStringVar1, sSENames[0], CHAR_SPACE, 35); StringExpandPlaceholders(gStringVar4, gDebugText_Sound_SE_ID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); @@ -2872,7 +2872,7 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId) } StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringCopyPadded(gStringVar1, gSENames[gTasks[taskId].data[3]-1], CHAR_SPACE, 35); + StringCopyPadded(gStringVar1, sSENames[gTasks[taskId].data[3]-1], CHAR_SPACE, 35); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringExpandPlaceholders(gStringVar4, gDebugText_Sound_SE_ID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -2909,7 +2909,7 @@ static void DebugAction_Sound_MUS(u8 taskId) //Display initial ID StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, START_MUS, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - StringCopyPadded(gStringVar1, gBGMNames[0], CHAR_SPACE, 35); + StringCopyPadded(gStringVar1, sBGMNames[0], CHAR_SPACE, 35); StringExpandPlaceholders(gStringVar4, gDebugText_Sound_MUS_ID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); @@ -2949,7 +2949,7 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) } StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringCopyPadded(gStringVar1, gBGMNames[gTasks[taskId].data[3]-START_MUS], CHAR_SPACE, 35); + StringCopyPadded(gStringVar1, sBGMNames[gTasks[taskId].data[3]-START_MUS], CHAR_SPACE, 35); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringExpandPlaceholders(gStringVar4, gDebugText_Sound_MUS_ID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -3508,7 +3508,7 @@ SOUND_LIST_BGM #undef X #define X(songId) sBGMName_##songId, -static const u8 *const gBGMNames[] = +static const u8 *const sBGMNames[] = { SOUND_LIST_BGM }; @@ -3520,7 +3520,7 @@ SOUND_LIST_SE #undef X #define X(songId) sSEName_##songId, -static const u8 *const gSENames[] = +static const u8 *const sSENames[] = { SOUND_LIST_SE }; From 5f67335212106b2fa633c9888c59085784b6472f Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Mon, 19 Sep 2022 05:20:09 -0300 Subject: [PATCH 148/155] Fixed typo in BoxMonKnowsMove --- include/party_menu.h | 2 +- src/party_menu.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/party_menu.h b/include/party_menu.h index b00fd73240..d7cf15b889 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -55,7 +55,7 @@ void ItemUseCB_PPUp(u8 taskId, TaskFunc task); u16 ItemIdToBattleMoveId(u16 item); bool8 IsMoveHm(u16 move); bool8 MonKnowsMove(struct Pokemon *mon, u16 move); -bool8 BoxMonKnowsMove(struct BoxPokemon *mon, u16 move); +bool8 BoxMonKnowsMove(struct BoxPokemon *boxMon, u16 move); void ItemUseCB_TMHM(u8 taskId, TaskFunc task); void ItemUseCB_RareCandy(u8 taskId, TaskFunc task); void ItemUseCB_SacredAsh(u8 taskId, TaskFunc task); diff --git a/src/party_menu.c b/src/party_menu.c index a93f66ebbe..da9a4ca891 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -4892,13 +4892,13 @@ bool8 MonKnowsMove(struct Pokemon *mon, u16 move) return FALSE; } -bool8 BoxMonKnowsMove(struct BoxPokemon *mon, u16 move) +bool8 BoxMonKnowsMove(struct BoxPokemon *boxMon, u16 move) { u8 i; for (i = 0; i < MAX_MON_MOVES; i++) { - if (GetMonData(mon, MON_DATA_MOVE1 + i) == move) + if (GetBoxMonData(boxMon, MON_DATA_MOVE1 + i) == move) return TRUE; } return FALSE; From d04a852e914f92e1069c386d5c5f8f59920b21b0 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Tue, 20 Sep 2022 02:31:20 -0300 Subject: [PATCH 149/155] Update debug.c --- src/debug.c | 434 ++++++++++++++++++++++++++-------------------------- 1 file changed, 217 insertions(+), 217 deletions(-) diff --git a/src/debug.c b/src/debug.c index 27c6638635..f56131968a 100644 --- a/src/debug.c +++ b/src/debug.c @@ -294,100 +294,100 @@ extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; // Text // Main Menu -static const u8 gDebugText_Utilities[] = _("Utilities"); -static const u8 gDebugText_Scripts[] = _("Scripts"); -static const u8 gDebugText_Flags[] = _("Flags"); -static const u8 gDebugText_Vars[] = _("Variables"); -static const u8 gDebugText_Give[] = _("Give X"); -static const u8 gDebugText_Sound[] = _("Sound"); -static const u8 gDebugText_Cancel[] = _("Cancel"); +static const u8 sDebugText_Utilities[] = _("Utilities"); +static const u8 sDebugText_Scripts[] = _("Scripts"); +static const u8 sDebugText_Flags[] = _("Flags"); +static const u8 sDebugText_Vars[] = _("Variables"); +static const u8 sDebugText_Give[] = _("Give X"); +static const u8 sDebugText_Sound[] = _("Sound"); +static const u8 sDebugText_Cancel[] = _("Cancel"); // Script menu -static const u8 gDebugText_Util_Script_1[] = _("Script 1"); -static const u8 gDebugText_Util_Script_2[] = _("Script 2"); -static const u8 gDebugText_Util_Script_3[] = _("Script 3"); -static const u8 gDebugText_Util_Script_4[] = _("Script 4"); -static const u8 gDebugText_Util_Script_5[] = _("Script 5"); -static const u8 gDebugText_Util_Script_6[] = _("Script 6"); -static const u8 gDebugText_Util_Script_7[] = _("Script 7"); -static const u8 gDebugText_Util_Script_8[] = _("Script 8"); +static const u8 sDebugText_Util_Script_1[] = _("Script 1"); +static const u8 sDebugText_Util_Script_2[] = _("Script 2"); +static const u8 sDebugText_Util_Script_3[] = _("Script 3"); +static const u8 sDebugText_Util_Script_4[] = _("Script 4"); +static const u8 sDebugText_Util_Script_5[] = _("Script 5"); +static const u8 sDebugText_Util_Script_6[] = _("Script 6"); +static const u8 sDebugText_Util_Script_7[] = _("Script 7"); +static const u8 sDebugText_Util_Script_8[] = _("Script 8"); // Util Menu -static const u8 gDebugText_Util_HealParty[] = _("Heal Party"); -static const u8 gDebugText_Util_Fly[] = _("Fly to map"); -static const u8 gDebugText_Util_WarpToMap[] = _("Warp to map warp"); -static const u8 gDebugText_Util_WarpToMap_SelectMapGroup[] = _("Group: {STR_VAR_1} \n \n\n{STR_VAR_3} "); -static const u8 gDebugText_Util_WarpToMap_SelectMap[] = _("Map: {STR_VAR_1} \nMapSec: \n{STR_VAR_2} \n{STR_VAR_3} "); -static const u8 gDebugText_Util_WarpToMap_SelectWarp[] = _("Warp: \n{STR_VAR_1} \n \n{STR_VAR_3} "); -static const u8 gDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}"); -static const u8 gDebugText_Util_RunningShoes[] = _("Toggle Running Shoes"); -static const u8 gDebugText_Util_PoisonMons[] = _("Poison all mons"); -static const u8 gDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); -static const u8 gDebugText_Util_Weather[] = _("Set weather"); -static const u8 gDebugText_Util_Weather_ID[] = _("Weather Id: {STR_VAR_3}\n{STR_VAR_1}\n{STR_VAR_2}"); -static const u8 gDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); -static const u8 gDebugText_Util_SetWallClock[] = _("Set Wall Clock"); -static const u8 gDebugText_Util_WatchCredits[] = _("Watch Credits"); -static const u8 gDebugText_Util_Trainer_Name[] = _("Trainer name"); -static const u8 gDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); -static const u8 gDebugText_Util_Trainer_Id[] = _("New Trainer Id"); +static const u8 sDebugText_Util_HealParty[] = _("Heal Party"); +static const u8 sDebugText_Util_Fly[] = _("Fly to map"); +static const u8 sDebugText_Util_WarpToMap[] = _("Warp to map warp"); +static const u8 sDebugText_Util_WarpToMap_SelectMapGroup[] = _("Group: {STR_VAR_1} \n \n\n{STR_VAR_3} "); +static const u8 sDebugText_Util_WarpToMap_SelectMap[] = _("Map: {STR_VAR_1} \nMapSec: \n{STR_VAR_2} \n{STR_VAR_3} "); +static const u8 sDebugText_Util_WarpToMap_SelectWarp[] = _("Warp: \n{STR_VAR_1} \n \n{STR_VAR_3} "); +static const u8 sDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}"); +static const u8 sDebugText_Util_RunningShoes[] = _("Toggle Running Shoes"); +static const u8 sDebugText_Util_PoisonMons[] = _("Poison all mons"); +static const u8 sDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); +static const u8 sDebugText_Util_Weather[] = _("Set weather"); +static const u8 sDebugText_Util_Weather_ID[] = _("Weather Id: {STR_VAR_3}\n{STR_VAR_1}\n{STR_VAR_2}"); +static const u8 sDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); +static const u8 sDebugText_Util_SetWallClock[] = _("Set Wall Clock"); +static const u8 sDebugText_Util_WatchCredits[] = _("Watch Credits"); +static const u8 sDebugText_Util_Trainer_Name[] = _("Trainer name"); +static const u8 sDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); +static const u8 sDebugText_Util_Trainer_Id[] = _("New Trainer Id"); // Flags Menu -static const u8 gDebugText_Flags_Flags[] = _("Set Flag XXXX"); -static const u8 gDebugText_Flags_SetPokedexFlags[] = _("All Pokédex Flags"); -static const u8 gDebugText_Flags_SwitchDex[] = _("Pokédex ON/OFF"); -static const u8 gDebugText_Flags_SwitchNationalDex[] = _("NatDex ON/OFF"); -static const u8 gDebugText_Flags_SwitchPokeNav[] = _("PokéNav ON/OFF"); -static const u8 gDebugText_Flags_ToggleFlyFlags[] = _("Fly Flags ON/OFF"); -static const u8 gDebugText_Flags_ToggleAllBadges[] = _("All badges ON/OFF"); -static const u8 gDebugText_Flags_ToggleFrontierPass[] = _("Frontier Pass ON/OFF"); -static const u8 gDebugText_Flags_SwitchCollision[] = _("Collision ON/OFF"); -static const u8 gDebugText_Flags_SwitchEncounter[] = _("Encounter ON/OFF"); -static const u8 gDebugText_Flags_SwitchTrainerSee[] = _("TrainerSee ON/OFF"); -static const u8 gDebugText_Flags_SwitchBagUse[] = _("BagUse ON/OFF"); -static const u8 gDebugText_Flags_SwitchCatching[] = _("Catching ON/OFF"); -static const u8 gDebugText_Flags_Flag[] = _("Flag: {STR_VAR_1} \n{STR_VAR_2} \n{STR_VAR_3}"); -static const u8 gDebugText_Flags_FlagHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); -static const u8 gDebugText_Flags_FlagSet[] = _("TRUE"); -static const u8 gDebugText_Flags_FlagUnset[] = _("FALSE"); +static const u8 sDebugText_Flags_Flags[] = _("Set Flag XXXX"); +static const u8 sDebugText_Flags_SetPokedexFlags[] = _("All Pokédex Flags"); +static const u8 sDebugText_Flags_SwitchDex[] = _("Pokédex ON/OFF"); +static const u8 sDebugText_Flags_SwitchNationalDex[] = _("NatDex ON/OFF"); +static const u8 sDebugText_Flags_SwitchPokeNav[] = _("PokéNav ON/OFF"); +static const u8 sDebugText_Flags_ToggleFlyFlags[] = _("Fly Flags ON/OFF"); +static const u8 sDebugText_Flags_ToggleAllBadges[] = _("All badges ON/OFF"); +static const u8 sDebugText_Flags_ToggleFrontierPass[] = _("Frontier Pass ON/OFF"); +static const u8 sDebugText_Flags_SwitchCollision[] = _("Collision ON/OFF"); +static const u8 sDebugText_Flags_SwitchEncounter[] = _("Encounter ON/OFF"); +static const u8 sDebugText_Flags_SwitchTrainerSee[] = _("TrainerSee ON/OFF"); +static const u8 sDebugText_Flags_SwitchBagUse[] = _("BagUse ON/OFF"); +static const u8 sDebugText_Flags_SwitchCatching[] = _("Catching ON/OFF"); +static const u8 sDebugText_Flags_Flag[] = _("Flag: {STR_VAR_1} \n{STR_VAR_2} \n{STR_VAR_3}"); +static const u8 sDebugText_Flags_FlagHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); +static const u8 sDebugText_Flags_FlagSet[] = _("TRUE"); +static const u8 sDebugText_Flags_FlagUnset[] = _("FALSE"); // Variables Menu -static const u8 gDebugText_Vars_Vars[] = _("Set Vars XXXX"); -static const u8 gDebugText_Vars_VariableHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); -static const u8 gDebugText_Vars_Variable[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); -static const u8 gDebugText_Vars_VariableValueSet[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); +static const u8 sDebugText_Vars_Vars[] = _("Set Vars XXXX"); +static const u8 sDebugText_Vars_VariableHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); +static const u8 sDebugText_Vars_Variable[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); +static const u8 sDebugText_Vars_VariableValueSet[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); // Give Menu -static const u8 gDebugText_Give_GiveItem[] = _("Give item XXXX"); -static const u8 gDebugText_ItemQuantity[] = _("Quantity: \n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 gDebugText_ItemID[] = _("Item Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 gDebugText_Give_AllTMs[] = _("Give all TMs"); -static const u8 gDebugText_Give_GivePokemonSimple[] = _("Pkm(lvl)"); -static const u8 gDebugText_Give_GivePokemonComplex[] = _("Pkm(l,s,n,a,IV,mov)"); -static const u8 gDebugText_PokemonID[] = _("Species: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 gDebugText_PokemonLevel[] = _("Level: \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonShiny[] = _("Shiny: \n {STR_VAR_2} \n \n "); -static const u8 gDebugText_PokemonNature[] = _("NatureId: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonAbility[] = _("AbilityNum: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonIVs[] = _("All IVs: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_0[] = _("IV HP: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_1[] = _("IV Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_2[] = _("IV Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_3[] = _("IV Speed: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_4[] = _("IV Sp. Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonIV_5[] = _("IV Sp. Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 gDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 gDebugText_Give_MaxMoney[] = _("Max Money"); -static const u8 gDebugText_Give_MaxCoins[] = _("Max Coins"); -static const u8 gDebugText_Give_BattlePoints[] = _("Max Battle Points"); -static const u8 gDebugText_Give_DaycareEgg[] = _("Daycare Egg"); -static const u8 gDebugText_Give_FillPc[] = _("Fill Pc"); -static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); -static const u8 gDebugText_AccessPC[] = _("Access PC"); +static const u8 sDebugText_Give_GiveItem[] = _("Give item XXXX"); +static const u8 sDebugText_ItemQuantity[] = _("Quantity: \n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 sDebugText_ItemID[] = _("Item Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 sDebugText_Give_AllTMs[] = _("Give all TMs"); +static const u8 sDebugText_Give_GivePokemonSimple[] = _("Pkm(lvl)"); +static const u8 sDebugText_Give_GivePokemonComplex[] = _("Pkm(l,s,n,a,IV,mov)"); +static const u8 sDebugText_PokemonID[] = _("Species: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); +static const u8 sDebugText_PokemonLevel[] = _("Level: \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 sDebugText_PokemonShiny[] = _("Shiny: \n {STR_VAR_2} \n \n "); +static const u8 sDebugText_PokemonNature[] = _("NatureId: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 sDebugText_PokemonAbility[] = _("AbilityNum: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 sDebugText_PokemonIVs[] = _("All IVs: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 sDebugText_PokemonIV_0[] = _("IV HP: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 sDebugText_PokemonIV_1[] = _("IV Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 sDebugText_PokemonIV_2[] = _("IV Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 sDebugText_PokemonIV_3[] = _("IV Speed: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 sDebugText_PokemonIV_4[] = _("IV Sp. Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 sDebugText_PokemonIV_5[] = _("IV Sp. Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); +static const u8 sDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 sDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 sDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 sDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); +static const u8 sDebugText_Give_MaxMoney[] = _("Max Money"); +static const u8 sDebugText_Give_MaxCoins[] = _("Max Coins"); +static const u8 sDebugText_Give_BattlePoints[] = _("Max Battle Points"); +static const u8 sDebugText_Give_DaycareEgg[] = _("Daycare Egg"); +static const u8 sDebugText_Give_FillPc[] = _("Fill Pc"); +static const u8 sDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); +static const u8 sDebugText_AccessPC[] = _("Access PC"); // Sound Mneu -static const u8 gDebugText_Sound_SE[] = _("Effects"); -static const u8 gDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); -static const u8 gDebugText_Sound_MUS[] = _("Music"); -static const u8 gDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); -static const u8 gDebugText_Sound_Empty[] = _(""); +static const u8 sDebugText_Sound_SE[] = _("Effects"); +static const u8 sDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); +static const u8 sDebugText_Sound_MUS[] = _("Music"); +static const u8 sDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); +static const u8 sDebugText_Sound_Empty[] = _(""); static const u8 digitInidicator_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); static const u8 digitInidicator_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); @@ -426,79 +426,79 @@ static const s32 sPowersOfTen[] = // List Menu Items static const struct ListMenuItem sDebugMenu_Items_Main[] = { - [DEBUG_MENU_ITEM_UTILITIES] = {gDebugText_Utilities, DEBUG_MENU_ITEM_UTILITIES}, - [DEBUG_MENU_ITEM_SCRIPTS] = {gDebugText_Scripts, DEBUG_MENU_ITEM_SCRIPTS}, - [DEBUG_MENU_ITEM_FLAGS] = {gDebugText_Flags, DEBUG_MENU_ITEM_FLAGS}, - [DEBUG_MENU_ITEM_VARS] = {gDebugText_Vars, DEBUG_MENU_ITEM_VARS}, - [DEBUG_MENU_ITEM_GIVE] = {gDebugText_Give, DEBUG_MENU_ITEM_GIVE}, - [DEBUG_MENU_ITEM_SOUND] = {gDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, - [DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, - [DEBUG_MENU_ITEM_CANCEL] = {gDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} + [DEBUG_MENU_ITEM_UTILITIES] = {sDebugText_Utilities, DEBUG_MENU_ITEM_UTILITIES}, + [DEBUG_MENU_ITEM_SCRIPTS] = {sDebugText_Scripts, DEBUG_MENU_ITEM_SCRIPTS}, + [DEBUG_MENU_ITEM_FLAGS] = {sDebugText_Flags, DEBUG_MENU_ITEM_FLAGS}, + [DEBUG_MENU_ITEM_VARS] = {sDebugText_Vars, DEBUG_MENU_ITEM_VARS}, + [DEBUG_MENU_ITEM_GIVE] = {sDebugText_Give, DEBUG_MENU_ITEM_GIVE}, + [DEBUG_MENU_ITEM_SOUND] = {sDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, + [DEBUG_MENU_ITEM_ACCESS_PC] = {sDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, + [DEBUG_MENU_ITEM_CANCEL] = {sDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} }; static const struct ListMenuItem sDebugMenu_Items_Utilities[] = { - [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {gDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, - [DEBUG_UTIL_MENU_ITEM_FLY] = {gDebugText_Util_Fly, DEBUG_UTIL_MENU_ITEM_FLY}, - [DEBUG_UTIL_MENU_ITEM_WARP] = {gDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, - [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = {gDebugText_Util_RunningShoes, DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES}, - [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {gDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {gDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, - [DEBUG_UTIL_MENU_ITEM_WEATHER] = {gDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {gDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {gDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {gDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = {gDebugText_Util_Trainer_Name, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {gDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {gDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {sDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, + [DEBUG_UTIL_MENU_ITEM_FLY] = {sDebugText_Util_Fly, DEBUG_UTIL_MENU_ITEM_FLY}, + [DEBUG_UTIL_MENU_ITEM_WARP] = {sDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, + [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = {sDebugText_Util_RunningShoes, DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES}, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {sDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {sDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {sDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {sDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = {sDebugText_Util_Trainer_Name, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {sDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {sDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, }; static const struct ListMenuItem sDebugMenu_Items_Scripts[] = { - [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = {gDebugText_Util_Script_1, DEBUG_UTIL_MENU_ITEM_SCRIPT_1}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = {gDebugText_Util_Script_2, DEBUG_UTIL_MENU_ITEM_SCRIPT_2}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = {gDebugText_Util_Script_3, DEBUG_UTIL_MENU_ITEM_SCRIPT_3}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = {gDebugText_Util_Script_4, DEBUG_UTIL_MENU_ITEM_SCRIPT_4}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = {gDebugText_Util_Script_5, DEBUG_UTIL_MENU_ITEM_SCRIPT_5}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = {gDebugText_Util_Script_6, DEBUG_UTIL_MENU_ITEM_SCRIPT_6}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = {gDebugText_Util_Script_7, DEBUG_UTIL_MENU_ITEM_SCRIPT_7}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = {gDebugText_Util_Script_8, DEBUG_UTIL_MENU_ITEM_SCRIPT_8}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = {sDebugText_Util_Script_1, DEBUG_UTIL_MENU_ITEM_SCRIPT_1}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = {sDebugText_Util_Script_2, DEBUG_UTIL_MENU_ITEM_SCRIPT_2}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = {sDebugText_Util_Script_3, DEBUG_UTIL_MENU_ITEM_SCRIPT_3}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = {sDebugText_Util_Script_4, DEBUG_UTIL_MENU_ITEM_SCRIPT_4}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = {sDebugText_Util_Script_5, DEBUG_UTIL_MENU_ITEM_SCRIPT_5}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = {sDebugText_Util_Script_6, DEBUG_UTIL_MENU_ITEM_SCRIPT_6}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = {sDebugText_Util_Script_7, DEBUG_UTIL_MENU_ITEM_SCRIPT_7}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = {sDebugText_Util_Script_8, DEBUG_UTIL_MENU_ITEM_SCRIPT_8}, }; static const struct ListMenuItem sDebugMenu_Items_Flags[] = { - [DEBUG_FLAG_MENU_ITEM_FLAGS] = {gDebugText_Flags_Flags, DEBUG_FLAG_MENU_ITEM_FLAGS}, - [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = {gDebugText_Flags_SetPokedexFlags, DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS}, - [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = {gDebugText_Flags_SwitchDex, DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF}, - [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = {gDebugText_Flags_SwitchNationalDex, DEBUG_FLAG_MENU_ITEM_NATDEXONOFF}, - [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = {gDebugText_Flags_SwitchPokeNav, DEBUG_FLAG_MENU_ITEM_POKENAVONOFF}, - [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = {gDebugText_Flags_ToggleFlyFlags, DEBUG_FLAG_MENU_ITEM_FLYANYWHERE}, - [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = {gDebugText_Flags_ToggleAllBadges, DEBUG_FLAG_MENU_ITEM_GETALLBADGES}, - [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = {gDebugText_Flags_ToggleFrontierPass, DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS}, - [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = {gDebugText_Flags_SwitchCollision, DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = {gDebugText_Flags_SwitchEncounter, DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF] = {gDebugText_Flags_SwitchTrainerSee, DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = {gDebugText_Flags_SwitchBagUse, DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = {gDebugText_Flags_SwitchCatching, DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_FLAGS] = {sDebugText_Flags_Flags, DEBUG_FLAG_MENU_ITEM_FLAGS}, + [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = {sDebugText_Flags_SetPokedexFlags, DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS}, + [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = {sDebugText_Flags_SwitchDex, DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF}, + [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = {sDebugText_Flags_SwitchNationalDex, DEBUG_FLAG_MENU_ITEM_NATDEXONOFF}, + [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = {sDebugText_Flags_SwitchPokeNav, DEBUG_FLAG_MENU_ITEM_POKENAVONOFF}, + [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = {sDebugText_Flags_ToggleFlyFlags, DEBUG_FLAG_MENU_ITEM_FLYANYWHERE}, + [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = {sDebugText_Flags_ToggleAllBadges, DEBUG_FLAG_MENU_ITEM_GETALLBADGES}, + [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = {sDebugText_Flags_ToggleFrontierPass, DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS}, + [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = {sDebugText_Flags_SwitchCollision, DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = {sDebugText_Flags_SwitchEncounter, DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF] = {sDebugText_Flags_SwitchTrainerSee, DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = {sDebugText_Flags_SwitchBagUse, DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF}, + [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = {sDebugText_Flags_SwitchCatching, DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF}, }; static const struct ListMenuItem sDebugMenu_Items_Vars[] = { - [DEBUG_VARS_MENU_ITEM_VARS] = {gDebugText_Vars_Vars, DEBUG_FLAG_MENU_ITEM_FLAGS}, + [DEBUG_VARS_MENU_ITEM_VARS] = {sDebugText_Vars_Vars, DEBUG_FLAG_MENU_ITEM_FLAGS}, }; static const struct ListMenuItem sDebugMenu_Items_Give[] = { - [DEBUG_GIVE_MENU_ITEM_ITEM_X] = {gDebugText_Give_GiveItem, DEBUG_GIVE_MENU_ITEM_ITEM_X}, - [DEBUG_GIVE_MENU_ITEM_ALLTMS] = {gDebugText_Give_AllTMs, DEBUG_GIVE_MENU_ITEM_ALLTMS}, - [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {gDebugText_Give_GivePokemonSimple, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE}, - [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {gDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, - [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = {gDebugText_Give_MaxMoney, DEBUG_GIVE_MENU_ITEM_MAX_MONEY}, - [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = {gDebugText_Give_MaxCoins, DEBUG_GIVE_MENU_ITEM_MAX_COINS}, - [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = {gDebugText_Give_BattlePoints, DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS}, - [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {gDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, - [DEBUG_GIVE_MENU_ITEM_FILL_PC] = {gDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC}, - [DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, + [DEBUG_GIVE_MENU_ITEM_ITEM_X] = {sDebugText_Give_GiveItem, DEBUG_GIVE_MENU_ITEM_ITEM_X}, + [DEBUG_GIVE_MENU_ITEM_ALLTMS] = {sDebugText_Give_AllTMs, DEBUG_GIVE_MENU_ITEM_ALLTMS}, + [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {sDebugText_Give_GivePokemonSimple, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE}, + [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {sDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, + [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = {sDebugText_Give_MaxMoney, DEBUG_GIVE_MENU_ITEM_MAX_MONEY}, + [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = {sDebugText_Give_MaxCoins, DEBUG_GIVE_MENU_ITEM_MAX_COINS}, + [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = {sDebugText_Give_BattlePoints, DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS}, + [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {sDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, + [DEBUG_GIVE_MENU_ITEM_FILL_PC] = {sDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC}, + [DEBUG_GIVE_MENU_ITEM_CHEAT] = {sDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, }; static const struct ListMenuItem sDebugMenu_Items_Sound[] = { - [DEBUG_SOUND_MENU_ITEM_SE] = {gDebugText_Sound_SE, DEBUG_SOUND_MENU_ITEM_SE}, - [DEBUG_SOUND_MENU_ITEM_MUS] = {gDebugText_Sound_MUS, DEBUG_SOUND_MENU_ITEM_MUS}, + [DEBUG_SOUND_MENU_ITEM_SE] = {sDebugText_Sound_SE, DEBUG_SOUND_MENU_ITEM_SE}, + [DEBUG_SOUND_MENU_ITEM_MUS] = {sDebugText_Sound_MUS, DEBUG_SOUND_MENU_ITEM_MUS}, }; // ******************************* @@ -960,9 +960,9 @@ static void DebugAction_Util_Warp_Warp(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); ConvertIntToDecimalStringN(gStringVar2, MAP_GROUPS_COUNT-1, STR_CONV_MODE_LEADING_ZEROS, 2); - StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); + StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax); StringCopy(gStringVar3, gText_DigitIndicator[0]); - StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMapGroup); + StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMapGroup); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Util_Warp_SelectMapGroup; @@ -1003,9 +1003,9 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); ConvertIntToDecimalStringN(gStringVar2, MAP_GROUPS_COUNT - 1, STR_CONV_MODE_LEADING_ZEROS, 2); - StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); + StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMapGroup); + StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMapGroup); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -1017,10 +1017,10 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1, STR_CONV_MODE_LEADING_ZEROS, 2); - StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); + StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax); GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMap); + StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMap); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Util_Warp_SelectMap; @@ -1063,10 +1063,10 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1, STR_CONV_MODE_LEADING_ZEROS, 2); - StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax); + StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax); GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMap); + StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMap); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -1078,7 +1078,7 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); - StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectWarp); + StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectWarp); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Util_Warp_SelectWarp; } @@ -1108,7 +1108,7 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId) StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); - StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectWarp); + StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectWarp); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -1161,12 +1161,12 @@ static void DebugAction_Util_PoisonMons(u8 taskId) static void DebugAction_Util_CheckSaveBlock(u8 taskId) { - static const u8 gDebugText_SaveBlockSize[] = _("SaveBlock1 is {STR_VAR_1} bytes long.\nMax size is 15872 bytes.\pSaveBlock2 is {STR_VAR_2} bytes long.\nMax size is 3968 bytes.\pPokemonStorage is {STR_VAR_3} bytes long.\nMax size is 35712 bytes."); + static const u8 sDebugText_SaveBlockSize[] = _("SaveBlock1 is {STR_VAR_1} bytes long.\nMax size is 15872 bytes.\pSaveBlock2 is {STR_VAR_2} bytes long.\nMax size is 3968 bytes.\pPokemonStorage is {STR_VAR_3} bytes long.\nMax size is 35712 bytes."); ConvertIntToDecimalStringN(gStringVar1, sizeof(struct SaveBlock1), STR_CONV_MODE_LEFT_ALIGN, 6); ConvertIntToDecimalStringN(gStringVar2, sizeof(struct SaveBlock2), STR_CONV_MODE_LEFT_ALIGN, 6); ConvertIntToDecimalStringN(gStringVar3, sizeof(struct PokemonStorage), STR_CONV_MODE_LEFT_ALIGN, 6); - StringExpandPlaceholders(gStringVar4, gDebugText_SaveBlockSize); + StringExpandPlaceholders(gStringVar4, sDebugText_SaveBlockSize); Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); @@ -1212,7 +1212,7 @@ static void DebugAction_Util_Weather(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar1, sWeatherNames[0], CHAR_SPACE, 30); - StringExpandPlaceholders(gStringVar4, gDebugText_Util_Weather_ID); + StringExpandPlaceholders(gStringVar4, sDebugText_Util_Weather_ID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Util_Weather_SelectId; @@ -1257,7 +1257,7 @@ static void DebugAction_Util_Weather_SelectId(u8 taskId) else StringCopyPadded(gStringVar1, sText_WeatherNotDefined, CHAR_SPACE, 30); - StringExpandPlaceholders(gStringVar4, gDebugText_Util_Weather_ID); + StringExpandPlaceholders(gStringVar4, sDebugText_Util_Weather_ID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -1386,13 +1386,13 @@ static void DebugAction_Flags_Flags(u8 taskId) //Display initial Flag ConvertIntToDecimalStringN(gStringVar1, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); ConvertIntToHexStringN(gStringVar2, 1, STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex); + StringExpandPlaceholders(gStringVar1, sDebugText_Flags_FlagHex); if (FlagGet(FLAG_TEMP_1) == TRUE) - StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_Flags_FlagSet, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); StringCopy(gStringVar3, gText_DigitIndicator[0]); - StringExpandPlaceholders(gStringVar4, gDebugText_Flags_Flag); + StringExpandPlaceholders(gStringVar4, sDebugText_Flags_Flag); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Flags_FlagsSelect; @@ -1450,13 +1450,13 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) { ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex); + StringExpandPlaceholders(gStringVar1, sDebugText_Flags_FlagHex); if (FlagGet(gTasks[taskId].data[3]) == TRUE) - StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_Flags_FlagSet, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringExpandPlaceholders(gStringVar4, gDebugText_Flags_Flag); + StringExpandPlaceholders(gStringVar4, sDebugText_Flags_Flag); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } } @@ -1644,11 +1644,11 @@ static void DebugAction_Vars_Vars(u8 taskId) //Display initial Variable ConvertIntToDecimalStringN(gStringVar1, VARS_START, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, VARS_START, STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, gDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); ConvertIntToDecimalStringN(gStringVar3, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[0]); - StringExpandPlaceholders(gStringVar4, gDebugText_Vars_Variable); + StringExpandPlaceholders(gStringVar4, sDebugText_Vars_Variable); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Vars_Select; @@ -1691,7 +1691,7 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, gDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value, if 65535 the value hasnt been set gTasks[taskId].data[5] = 0; else @@ -1700,7 +1700,7 @@ static void DebugAction_Vars_Select(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit //Combine str's to full window string - StringExpandPlaceholders(gStringVar4, gDebugText_Vars_Variable); + StringExpandPlaceholders(gStringVar4, sDebugText_Vars_Variable); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -1712,7 +1712,7 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, gDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value if 65535 the value hasnt been set gTasks[taskId].data[5] = 0; else @@ -1720,7 +1720,7 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[5], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit - StringExpandPlaceholders(gStringVar4, gDebugText_Vars_VariableValueSet); + StringExpandPlaceholders(gStringVar4, sDebugText_Vars_VariableValueSet); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].data[6] = gTasks[taskId].data[5]; //New value selector @@ -1787,12 +1787,12 @@ static void DebugAction_Vars_SetValue(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, gDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[6], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit - StringExpandPlaceholders(gStringVar4, gDebugText_Vars_VariableValueSet); + StringExpandPlaceholders(gStringVar4, sDebugText_Vars_VariableValueSet); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } } @@ -1820,7 +1820,7 @@ static void DebugAction_Give_Item(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); CopyItemName(1, gStringVar1); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_ItemID); + StringExpandPlaceholders(gStringVar4, sDebugText_ItemID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Give_Item_SelectId; @@ -1865,7 +1865,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) CopyItemName(gTasks[taskId].data[3], gStringVar1); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - StringExpandPlaceholders(gStringVar4, gDebugText_ItemID); + StringExpandPlaceholders(gStringVar4, sDebugText_ItemID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon @@ -1887,7 +1887,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_ItemQuantity); + StringExpandPlaceholders(gStringVar4, sDebugText_ItemQuantity); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Give_Item_SelectQuantity; @@ -1935,7 +1935,7 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_ItemQuantity); + StringExpandPlaceholders(gStringVar4, sDebugText_ItemQuantity); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -2015,7 +2015,7 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 3); StringCopy(gStringVar1, gSpeciesNames[1]); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); //Set task data @@ -2053,7 +2053,7 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 4); StringCopy(gStringVar1, gSpeciesNames[1]); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId; @@ -2101,7 +2101,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) StringCopy(gStringVar1, gSpeciesNames[gTasks[taskId].data[3]]); //CopyItemName(gTasks[taskId].data[3], gStringVar1); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 4); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); @@ -2120,7 +2120,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonLevel); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonLevel); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectLevel; @@ -2166,7 +2166,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonLevel); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonLevel); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -2189,8 +2189,8 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonShiny); + StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonShiny); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectShiny; @@ -2226,12 +2226,12 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) } if (gTasks[taskId].data[3] == 1) - StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_Flags_FlagSet, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonShiny); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonShiny); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -2245,7 +2245,7 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar1, gNatureNamePointers[0]); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonNature); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonNature); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectNature; @@ -2280,7 +2280,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar1, gNatureNamePointers[gTasks[taskId].data[3]]); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonNature); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonNature); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -2296,7 +2296,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); abilityId = GetAbilityBySpecies(sDebugMonData->mon_speciesId, 0); StringCopy(gStringVar1, gAbilityNames[abilityId]); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonAbility); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonAbility); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectAbility; @@ -2340,7 +2340,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar1, gAbilityNames[abilityId]); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonAbility); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonAbility); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -2353,7 +2353,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_0); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_0); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; @@ -2400,22 +2400,22 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) switch (gTasks[taskId].data[7]) { case 0: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_0); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_0); break; case 1: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_1); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_1); break; case 2: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_2); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_2); break; case 3: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_3); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_3); break; case 4: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_4); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_4); break; case 5: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_5); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_5); break; } AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -2459,22 +2459,22 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) switch (gTasks[taskId].data[7]) { case 0: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_0); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_0); break; case 1: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_1); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_1); break; case 2: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_2); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_2); break; case 3: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_3); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_3); break; case 4: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_4); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_4); break; case 5: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonIV_5); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_5); break; } AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -2491,7 +2491,7 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3); - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_0); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_0); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_Move; @@ -2540,16 +2540,16 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) switch (gTasks[taskId].data[7]) { case 0: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_0); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_0); break; case 1: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_1); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_1); break; case 2: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_2); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_2); break; case 3: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_3); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_3); break; } AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -2592,16 +2592,16 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) switch (gTasks[taskId].data[7]) { case 0: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_0); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_0); break; case 1: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_1); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_1); break; case 2: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_2); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_2); break; case 3: - StringExpandPlaceholders(gStringVar4, gDebugText_PokemonMove_3); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_3); break; } AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -2833,7 +2833,7 @@ static void DebugAction_Sound_SE(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringCopyPadded(gStringVar1, sSENames[0], CHAR_SPACE, 35); - StringExpandPlaceholders(gStringVar4, gDebugText_Sound_SE_ID); + StringExpandPlaceholders(gStringVar4, sDebugText_Sound_SE_ID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); StopMapMusic(); //Stop map music to better hear sounds @@ -2874,7 +2874,7 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); StringCopyPadded(gStringVar1, sSENames[gTasks[taskId].data[3]-1], CHAR_SPACE, 35); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - StringExpandPlaceholders(gStringVar4, gDebugText_Sound_SE_ID); + StringExpandPlaceholders(gStringVar4, sDebugText_Sound_SE_ID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -2910,7 +2910,7 @@ static void DebugAction_Sound_MUS(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, START_MUS, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringCopyPadded(gStringVar1, sBGMNames[0], CHAR_SPACE, 35); - StringExpandPlaceholders(gStringVar4, gDebugText_Sound_MUS_ID); + StringExpandPlaceholders(gStringVar4, sDebugText_Sound_MUS_ID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); StopMapMusic(); //Stop map music to better hear new music @@ -2951,7 +2951,7 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); StringCopyPadded(gStringVar1, sBGMNames[gTasks[taskId].data[3]-START_MUS], CHAR_SPACE, 35); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - StringExpandPlaceholders(gStringVar4, gDebugText_Sound_MUS_ID); + StringExpandPlaceholders(gStringVar4, sDebugText_Sound_MUS_ID); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } From cad8922d7bf1824deea5aaa996ef9f88983acbff Mon Sep 17 00:00:00 2001 From: StubbornOne Date: Wed, 21 Sep 2022 23:42:40 +0800 Subject: [PATCH 150/155] Replace battle-type flags in GetAiLogicData with BATTLE_TYPE_HAS_AI --- src/battle_ai_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 312ff853ca..78dcf24ca0 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -258,7 +258,7 @@ void GetAiLogicData(void) memset(AI_DATA, 0, sizeof(struct AiLogicData)); - if (!(gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER)) + if (!(gBattleTypeFlags & BATTLE_TYPE_HAS_AI) && !IsWildMonSmart()) return; From 64405250ae718597e16601127381703369905076 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 24 Sep 2022 08:50:48 -0300 Subject: [PATCH 151/155] Updated IsViableZMove --- src/battle_z_move.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/battle_z_move.c b/src/battle_z_move.c index c257df5990..b61e5e1892 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -174,10 +174,8 @@ bool32 IsViableZMove(u8 battlerId, u16 move) if (gBattleTypeFlags & (BATTLE_TYPE_SAFARI | BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_FRONTIER)) return FALSE; - #ifdef ITEM_Z_RING - if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT)) && !CheckBagHasItem(ITEM_Z_RING, 1)) + if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT)) && !CheckBagHasItem(ITEM_Z_POWER_RING, 1)) return FALSE; - #endif if (mega->alreadyEvolved[battlerPosition]) return FALSE; // Trainer has mega evolved From c64593cb9c387d63334538ba537f589961ff5727 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 24 Sep 2022 09:04:15 -0300 Subject: [PATCH 152/155] Fixed LTBTS's animation --- data/battle_anim_scripts.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index c9dbfd2eec..e5f32e09ac 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -30451,11 +30451,11 @@ LightThatBurnsTheSkyGreenSparks: launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c 0x0 0x28 0x0 0x3 launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c 0x40 0x28 0x1 0x3 launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c 0x0 0x28 0x2 0x3 launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x2 0x3 delay 0x10 return From 696d90880e8fb5d9d249ade203b09b774982427e Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 24 Sep 2022 09:33:31 -0300 Subject: [PATCH 153/155] Made Z-Moves always show the right type --- src/battle_z_move.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/battle_z_move.c b/src/battle_z_move.c index c257df5990..fa4cbc0c3e 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -54,6 +54,7 @@ static void ZMoveSelectionDisplayPower(u16 move, u16 zMove); static void ShowZMoveTriggerSprite(void); static bool32 AreStatsMaxed(u8 battlerId, u8 n); static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove); +static void ZMoveSelectionDisplayMoveType(u16 zMove); // Const Data static const struct SignatureZMove sSignatureZMoves[] = @@ -522,6 +523,7 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_NAME_1); ZMoveSelectionDisplayPpNumber(); + ZMoveSelectionDisplayMoveType(zmove); MoveSelectionCreateCursorAt(0, 0); return TRUE; } @@ -561,6 +563,23 @@ static void ZMoveSelectionDisplayPpNumber(void) BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_PP_REMAINING); } +static void ZMoveSelectionDisplayMoveType(u16 zMove) +{ + u8 *txtPtr; + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[gActiveBattler][4]); + u8 zMoveType; + + GET_MOVE_TYPE(zMove, zMoveType); + + txtPtr = StringCopy(gDisplayedStringBattle, gText_MoveInterfaceType); + *(txtPtr)++ = EXT_CTRL_CODE_BEGIN; + *(txtPtr)++ = EXT_CTRL_CODE_FONT; + *(txtPtr)++ = FONT_NORMAL; + + StringCopy(txtPtr, gTypeNames[zMoveType]); + BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_TYPE); +} + const u8 *GetZMoveName(u16 move) { if (IsZMove(move)) From c22671d2a2f79ed349457bd3ce9c65fa2648597f Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sat, 24 Sep 2022 12:12:31 -0400 Subject: [PATCH 154/155] add overwrittenAbilities field --- include/battle.h | 1 + src/battle_ai_util.c | 4 ++++ src/battle_main.c | 5 +++++ src/battle_script_commands.c | 18 +++++++++--------- src/battle_util.c | 8 +++----- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/include/battle.h b/include/battle.h index d92eded3e5..b328b46bb2 100644 --- a/include/battle.h +++ b/include/battle.h @@ -646,6 +646,7 @@ struct BattleStruct // When using a move which hits multiple opponents which is then bounced by a target, we need to make sure, the move hits both opponents, the one with bounce, and the one without. u8 attackerBeforeBounce:2; u8 targetsDone[MAX_BATTLERS_COUNT]; // Each battler as a bit. + u16 overwrittenAbilities[MAX_BATTLERS_COUNT]; // abilities overwritten during battle (keep separate from battle history in case of switching) }; #define F_DYNAMIC_TYPE_1 (1 << 6) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index a57500d726..344dd16577 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1163,6 +1163,10 @@ s32 AI_GetAbility(u32 battlerId) { u32 knownAbility = GetBattlerAbility(battlerId); + // We've had ability overwritten by e.g. Worry Seed. It is not part of AI_PARTY in case of switching + if (gBattleStruct->overwrittenAbilities[battlerId]) + return gBattleStruct->overwrittenAbilities[battlerId]; + // The AI knows its own ability. if (IsBattlerAIControlled(battlerId)) return knownAbility; diff --git a/src/battle_main.c b/src/battle_main.c index dc7fbf9c3a..baed941ebe 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2940,6 +2940,7 @@ static void BattleStartClearSetData(void) gBattleStruct->lastTakenMoveFrom[i][3] = MOVE_NONE; gBattleStruct->AI_monToSwitchIntoId[i] = PARTY_SIZE; gBattleStruct->skyDropTargets[i] = 0xFF; + gBattleStruct->overwrittenAbilities[i] = ABILITY_NONE; } gLastUsedMove = 0; @@ -3126,6 +3127,8 @@ void SwitchInClearSetData(void) // Reset damage to prevent things like red card activating if the switched-in mon is holding it gSpecialStatuses[gActiveBattler].physicalDmg = 0; gSpecialStatuses[gActiveBattler].specialDmg = 0; + + gBattleStruct->overwrittenAbilities[gActiveBattler] = ABILITY_NONE; Ai_UpdateSwitchInData(gActiveBattler); } @@ -3228,6 +3231,8 @@ void FaintClearSetData(void) if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) UndoMegaEvolution(gBattlerPartyIndexes[gActiveBattler]); + gBattleStruct->overwrittenAbilities[gActiveBattler] = ABILITY_NONE; + // If the fainted mon was involved in a Sky Drop if (gBattleStruct->skyDropTargets[gActiveBattler] != 0xFF) { diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index f5884d206d..de6a81cac6 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8081,8 +8081,7 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 8; return; case VARIOUS_TRACE_ABILITY: - gBattleMons[gActiveBattler].ability = gBattleStruct->tracedAbility[gActiveBattler]; - RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability); + gBattleMons[gActiveBattler].ability = gBattleStruct->overwrittenAbilities[gActiveBattler] = gBattleStruct->tracedAbility[gActiveBattler]; break; case VARIOUS_TRY_ILLUSION_OFF: if (GetIllusionMonPtr(gActiveBattler) != NULL) @@ -8557,7 +8556,7 @@ static void Cmd_various(void) if (gBattleMons[gBattlerTarget].ability == ABILITY_NEUTRALIZING_GAS) gSpecialStatuses[gBattlerTarget].neutralizingGasRemoved = TRUE; - gBattleMons[gBattlerTarget].ability = ABILITY_SIMPLE; + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = ABILITY_SIMPLE; gBattlescriptCurrInstr += 7; } return; @@ -8575,7 +8574,7 @@ static void Cmd_various(void) } else { - gBattleMons[gBattlerTarget].ability = gBattleMons[gBattlerAttacker].ability; + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = gBattleMons[gBattlerAttacker].ability; gBattlescriptCurrInstr += 7; } return; @@ -11388,7 +11387,8 @@ static void Cmd_transformdataexecution(void) for (i = 0; i < offsetof(struct BattlePokemon, pp); i++) battleMonAttacker[i] = battleMonTarget[i]; - + + gBattleStruct->overwrittenAbilities[gBattlerAttacker] = GetBattlerAbility(gBattlerTarget); for (i = 0; i < MAX_MON_MOVES; i++) { if (gBattleMoves[gBattleMons[gBattlerAttacker].moves[i]].pp < 5) @@ -12912,7 +12912,7 @@ static void Cmd_trycopyability(void) else { gBattleScripting.abilityPopupOverwrite = gBattleMons[gBattlerAttacker].ability; - gBattleMons[gBattlerAttacker].ability = defAbility; + gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = defAbility; gLastUsedAbility = defAbility; gBattlescriptCurrInstr += 5; } @@ -13078,8 +13078,8 @@ static void Cmd_tryswapabilities(void) else { u16 abilityAtk = gBattleMons[gBattlerAttacker].ability; - gBattleMons[gBattlerAttacker].ability = gBattleMons[gBattlerTarget].ability; - gBattleMons[gBattlerTarget].ability = abilityAtk; + gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability; + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = abilityAtk; gBattlescriptCurrInstr += 5; } @@ -14457,7 +14457,7 @@ static void Cmd_tryworryseed(void) } else { - gBattleMons[gBattlerTarget].ability = ABILITY_INSOMNIA; + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = ABILITY_INSOMNIA; gBattlescriptCurrInstr += 5; } } diff --git a/src/battle_util.c b/src/battle_util.c index 64c2e75570..9039f49d6b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5294,7 +5294,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_STANCE_CHANGE: break; default: - gLastUsedAbility = gBattleMons[gBattlerAttacker].ability = ABILITY_MUMMY; + gLastUsedAbility = gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = ABILITY_MUMMY; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MummyActivates; effect++; @@ -5326,10 +5326,8 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move break; default: gLastUsedAbility = gBattleMons[gBattlerAttacker].ability; - gBattleMons[gBattlerAttacker].ability = gBattleMons[gBattlerTarget].ability; - gBattleMons[gBattlerTarget].ability = gLastUsedAbility; - RecordAbilityBattle(gBattlerAttacker, gBattleMons[gBattlerAttacker].ability); - RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); + gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability; + gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = gLastUsedAbility; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_WanderingSpiritActivates; effect++; From 0fa8e20d0877415b57f9e51bbbc83ece04aaa778 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 24 Sep 2022 14:20:07 -0300 Subject: [PATCH 155/155] Style changes from upstream --- src/battle_script_commands.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 5958daa344..71088540e0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5777,12 +5777,15 @@ static void Cmd_moveend(void) case MOVEEND_SYMBIOSIS: for (i = 0; i < gBattlersCount; i++) { - if (((B_SYMBIOSIS_GEMS >= GEN_7 && gSpecialStatuses[i].gemBoost) || gSpecialStatuses[i].berryReduced) - && SYMBIOSIS_CHECK(i, i ^ BIT_FLANK)) + if ((gSpecialStatuses[i].berryReduced + #if B_SYMBIOSIS_GEMS >= GEN_7 + || gSpecialStatuses[i].gemBoost + #endif + ) && SYMBIOSIS_CHECK(i, BATTLE_PARTNER(i))) { - BestowItem(i ^ BIT_FLANK, i); - gLastUsedAbility = gBattleMons[i ^ BIT_FLANK].ability; - gBattleScripting.battler = gBattlerAbility = i ^ BIT_FLANK; + BestowItem(BATTLE_PARTNER(i), i); + gLastUsedAbility = gBattleMons[BATTLE_PARTNER(i)].ability; + gBattleScripting.battler = gBattlerAbility = BATTLE_PARTNER(i); gBattlerAttacker = i; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SymbiosisActivates; @@ -7290,20 +7293,20 @@ static void BestowItem(u32 battlerAtk, u32 battlerDef) // Called by Cmd_removeitem. itemId represents the item that was removed, not being given. static bool32 TrySymbiosis(u32 battler, u32 itemId) { - u32 ally = battler ^ BIT_FLANK; - if (!gBattleStruct->itemStolen[gBattlerPartyIndexes[battler]].stolen && gBattleStruct->changedItems[battler] == ITEM_NONE && GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_EJECT_BUTTON && GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_EJECT_PACK - && !(B_SYMBIOSIS_GEMS >= GEN_7 && gSpecialStatuses[battler].gemBoost) + #if B_SYMBIOSIS_GEMS >= GEN_7 + && !(gSpecialStatuses[battler].gemBoost) + #endif && gCurrentMove != MOVE_FLING //Fling and damage-reducing berries are handled separately. && !gSpecialStatuses[battler].berryReduced - && SYMBIOSIS_CHECK(battler, ally)) + && SYMBIOSIS_CHECK(battler, BATTLE_PARTNER(battler))) { - BestowItem(ally, battler); - gLastUsedAbility = gBattleMons[ally].ability; - gBattleScripting.battler = gBattlerAbility = ally; + BestowItem(BATTLE_PARTNER(battler), battler); + gLastUsedAbility = gBattleMons[BATTLE_PARTNER(battler)].ability; + gBattleScripting.battler = gBattlerAbility = BATTLE_PARTNER(battler); gBattlerAttacker = battler; BattleScriptPush(gBattlescriptCurrInstr + 2); gBattlescriptCurrInstr = BattleScript_SymbiosisActivates; @@ -9844,11 +9847,11 @@ static void Cmd_various(void) CourtChangeSwapSideStatuses(); break; case VARIOUS_TRY_SYMBIOSIS: //called by Bestow, Fling, and Bug Bite, which don't work with Cmd_removeitem. - if (SYMBIOSIS_CHECK(gActiveBattler, gActiveBattler ^ BIT_FLANK)) + if (SYMBIOSIS_CHECK(gActiveBattler, BATTLE_PARTNER(gActiveBattler))) { - BestowItem(gActiveBattler ^ BIT_FLANK, gActiveBattler); - gLastUsedAbility = gBattleMons[gActiveBattler ^ BIT_FLANK].ability; - gBattleScripting.battler = gBattlerAbility = gActiveBattler ^ BIT_FLANK; + BestowItem(BATTLE_PARTNER(gActiveBattler), gActiveBattler); + gLastUsedAbility = gBattleMons[BATTLE_PARTNER(gActiveBattler)].ability; + gBattleScripting.battler = gBattlerAbility = BATTLE_PARTNER(gActiveBattler); gBattlerAttacker = gActiveBattler; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SymbiosisActivates;