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] 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())