mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 04:04:17 +01:00
Apply style suggestions from code review
This commit is contained in:
parent
13cc640b78
commit
4017fc3e20
@ -52,7 +52,7 @@ Debug_FlagsNotSetMessage::
|
|||||||
Debug_FlagsNotSetMessage_Text:
|
Debug_FlagsNotSetMessage_Text:
|
||||||
.string "Feature unavailable!\n"
|
.string "Feature unavailable!\n"
|
||||||
.string "Please define a usable flag in:\l"
|
.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::
|
Debug_Script_1::
|
||||||
end
|
end
|
||||||
|
@ -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_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_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_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_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 debug function in the Utility submenu to disable catching of wild Pokémon can be used.
|
#define B_FLAG_NO_CATCHING 0 // If this flag is set, the ability to catch wild Pokémon is disabled.
|
||||||
|
|
||||||
// Var Settings
|
// Var Settings
|
||||||
// To use the following features in scripting, replace the 0s with the var ID you're assigning it to.
|
// To use the following features in scripting, replace the 0s with the var ID you're assigning it to.
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include "berry.h"
|
#include "berry.h"
|
||||||
#include "bg.h"
|
#include "bg.h"
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "debug.h"
|
|
||||||
#include "decompress.h"
|
#include "decompress.h"
|
||||||
#include "dma3.h"
|
#include "dma3.h"
|
||||||
#include "event_data.h"
|
#include "event_data.h"
|
||||||
|
409
src/debug.c
409
src/debug.c
@ -151,7 +151,6 @@ enum { //Sound
|
|||||||
// EWRAM
|
// EWRAM
|
||||||
static EWRAM_DATA struct DebugMonData *sDebugMonData = NULL;
|
static EWRAM_DATA struct DebugMonData *sDebugMonData = NULL;
|
||||||
|
|
||||||
|
|
||||||
// *******************************
|
// *******************************
|
||||||
struct DebugMonData
|
struct DebugMonData
|
||||||
{
|
{
|
||||||
@ -172,7 +171,6 @@ struct DebugMonData
|
|||||||
u16 mon_move_3;
|
u16 mon_move_3;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// *******************************
|
// *******************************
|
||||||
// Define functions
|
// Define functions
|
||||||
static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate);
|
static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate);
|
||||||
@ -285,12 +283,6 @@ extern u8 Debug_ShowFieldMessageStringVar4[];
|
|||||||
extern u8 Debug_CheatStart[];
|
extern u8 Debug_CheatStart[];
|
||||||
extern u8 PlayersHouse_2F_EventScript_SetWallClock[];
|
extern u8 PlayersHouse_2F_EventScript_SetWallClock[];
|
||||||
extern u8 PlayersHouse_2F_EventScript_CheckWallClock[];
|
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];
|
|
||||||
|
|
||||||
|
|
||||||
// *******************************
|
// *******************************
|
||||||
@ -319,7 +311,7 @@ static const u8 gDebugText_Util_Script_8[] = _("Script 8");
|
|||||||
static const u8 gDebugText_Util_HealParty[] = _("Heal Party");
|
static const u8 gDebugText_Util_HealParty[] = _("Heal Party");
|
||||||
static const u8 gDebugText_Util_Fly[] = _("Fly to map");
|
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[] = _("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_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_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_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_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}");
|
||||||
@ -449,7 +441,6 @@ static const struct ListMenuItem sDebugMenu_Items_Utilities[] =
|
|||||||
[DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {gDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK},
|
[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_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_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_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_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_GENDER] = {gDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER},
|
||||||
@ -478,7 +469,7 @@ static const struct ListMenuItem sDebugMenu_Items_Flags[] =
|
|||||||
[DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = {gDebugText_Flags_ToggleFrontierPass, DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS},
|
[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_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_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_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_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_CATCHING_ONOFF] = {gDebugText_Flags_SwitchCatching, DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF},
|
||||||
};
|
};
|
||||||
@ -494,7 +485,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_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_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_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_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_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_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_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT},
|
||||||
@ -528,7 +519,6 @@ static void (*const sDebugMenu_Actions_Utilities[])(u8) =
|
|||||||
[DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock,
|
[DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock,
|
||||||
[DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock,
|
[DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock,
|
||||||
[DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock,
|
[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_WATCHCREDITS] = DebugAction_Util_WatchCredits,
|
||||||
[DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = DebugAction_Util_Trainer_Name,
|
[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_GENDER] = DebugAction_Util_Trainer_Gender,
|
||||||
@ -557,7 +547,7 @@ static void (*const sDebugMenu_Actions_Flags[])(u8) =
|
|||||||
[DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = DebugAction_Flags_ToggleFrontierPass,
|
[DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = DebugAction_Flags_ToggleFrontierPass,
|
||||||
[DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = DebugAction_Flags_CollisionOnOff,
|
[DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = DebugAction_Flags_CollisionOnOff,
|
||||||
[DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = DebugAction_Flags_EncounterOnOff,
|
[DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = DebugAction_Flags_EncounterOnOff,
|
||||||
[DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF]= DebugAction_Flags_TrainerSeeOnOff,
|
[DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF] = DebugAction_Flags_TrainerSeeOnOff,
|
||||||
[DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = DebugAction_Flags_BagUseOnOff,
|
[DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = DebugAction_Flags_BagUseOnOff,
|
||||||
[DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = DebugAction_Flags_CatchingOnOff,
|
[DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = DebugAction_Flags_CatchingOnOff,
|
||||||
};
|
};
|
||||||
@ -573,7 +563,7 @@ static void (*const sDebugMenu_Actions_Give[])(u8) =
|
|||||||
[DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = DebugAction_Give_PokemonComplex,
|
[DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = DebugAction_Give_PokemonComplex,
|
||||||
[DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = DebugAction_Give_MaxMoney,
|
[DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = DebugAction_Give_MaxMoney,
|
||||||
[DEBUG_GIVE_MENU_ITEM_MAX_COINS] = DebugAction_Give_MaxCoins,
|
[DEBUG_GIVE_MENU_ITEM_MAX_COINS] = DebugAction_Give_MaxCoins,
|
||||||
[DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS]= DebugAction_Give_MaxBattlePoints,
|
[DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = DebugAction_Give_MaxBattlePoints,
|
||||||
[DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg,
|
[DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg,
|
||||||
[DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC,
|
[DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC,
|
||||||
[DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT,
|
[DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT,
|
||||||
@ -944,7 +934,6 @@ static void DebugAction_Util_Warp_Warp(u8 taskId)
|
|||||||
|
|
||||||
CopyWindowToVram(windowId, 3);
|
CopyWindowToVram(windowId, 3);
|
||||||
|
|
||||||
|
|
||||||
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
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);
|
StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax);
|
||||||
@ -965,31 +954,31 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId)
|
|||||||
if (gMain.newKeys & DPAD_ANY)
|
if (gMain.newKeys & DPAD_ANY)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||||
if(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;
|
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]];
|
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;
|
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;
|
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;
|
gTasks[taskId].data[4] += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
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);
|
StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax);
|
||||||
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
||||||
StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMapGroup);
|
StringExpandPlaceholders(gStringVar4, gDebugText_Util_WarpToMap_SelectMapGroup);
|
||||||
@ -1003,7 +992,7 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId)
|
|||||||
gTasks[taskId].data[4] = 0;
|
gTasks[taskId].data[4] = 0;
|
||||||
|
|
||||||
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
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);
|
StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax);
|
||||||
GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0);
|
GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0);
|
||||||
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
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)
|
if (gMain.newKeys & DPAD_ANY)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
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]];
|
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;
|
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;
|
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;
|
gTasks[taskId].data[4] += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
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);
|
StringExpandPlaceholders(gStringVar1, gDebugText_Util_WarpToMap_SelMax);
|
||||||
GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0);
|
GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0);
|
||||||
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
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];
|
gTasks[taskId].data[7] = gTasks[taskId].data[3];
|
||||||
//WARP
|
//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();
|
DoWarp();
|
||||||
ResetInitialPlayerAvatarState();
|
ResetInitialPlayerAvatarState();
|
||||||
DebugAction_DestroyExtraWindow(taskId);
|
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);
|
ConvertIntToDecimalStringN(gStringVar1, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS);
|
||||||
ConvertIntToHexStringN(gStringVar2, 0, STR_CONV_MODE_LEFT_ALIGN, 3);
|
ConvertIntToHexStringN(gStringVar2, 0, STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||||
StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex);
|
StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex);
|
||||||
if(FlagGet(0) == TRUE)
|
if (FlagGet(0) == TRUE)
|
||||||
StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15);
|
StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15);
|
||||||
else
|
else
|
||||||
StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15);
|
StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15);
|
||||||
@ -1301,38 +1291,38 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
gTasks[taskId].data[3] = FLAGS_COUNT - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(gMain.newKeys & DPAD_DOWN)
|
if (gMain.newKeys & DPAD_DOWN)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
gTasks[taskId].data[3] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(gMain.newKeys & DPAD_LEFT)
|
if (gMain.newKeys & DPAD_LEFT)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
gTasks[taskId].data[4] -= 1;
|
gTasks[taskId].data[4] -= 1;
|
||||||
if(gTasks[taskId].data[4] < 0)
|
if (gTasks[taskId].data[4] < 0)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[4] = 0;
|
gTasks[taskId].data[4] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(gMain.newKeys & DPAD_RIGHT)
|
if (gMain.newKeys & DPAD_RIGHT)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
gTasks[taskId].data[4] += 1;
|
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);
|
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);
|
ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||||
StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex);
|
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);
|
StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15);
|
||||||
else
|
else
|
||||||
StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15);
|
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)
|
static void DebugAction_Flags_SwitchDex(u8 taskId)
|
||||||
{
|
{
|
||||||
if(FlagGet(FLAG_SYS_POKEDEX_GET))
|
if (FlagGet(FLAG_SYS_POKEDEX_GET))
|
||||||
{
|
|
||||||
FlagClear(FLAG_SYS_POKEDEX_GET);
|
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
}else{
|
else
|
||||||
FlagSet(FLAG_SYS_POKEDEX_GET);
|
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
}
|
FlagToggle(FLAG_SYS_POKEDEX_GET);
|
||||||
}
|
}
|
||||||
static void DebugAction_Flags_SwitchNatDex(u8 taskId)
|
static void DebugAction_Flags_SwitchNatDex(u8 taskId)
|
||||||
{
|
{
|
||||||
if(IsNationalPokedexEnabled())
|
if (IsNationalPokedexEnabled())
|
||||||
{
|
{
|
||||||
DisableNationalPokedex();
|
DisableNationalPokedex();
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
EnableNationalPokedex();
|
EnableNationalPokedex();
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void DebugAction_Flags_SwitchPokeNav(u8 taskId)
|
static void DebugAction_Flags_SwitchPokeNav(u8 taskId)
|
||||||
{
|
{
|
||||||
if(FlagGet(FLAG_SYS_POKENAV_GET))
|
if (FlagGet(FLAG_SYS_POKENAV_GET))
|
||||||
{
|
|
||||||
FlagClear(FLAG_SYS_POKENAV_GET);
|
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
}else{
|
else
|
||||||
FlagSet(FLAG_SYS_POKENAV_GET);
|
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
}
|
FlagToggle(FLAG_SYS_POKENAV_GET);
|
||||||
}
|
}
|
||||||
static void DebugAction_Flags_ToggleFlyFlags(u8 taskId)
|
static void DebugAction_Flags_ToggleFlyFlags(u8 taskId)
|
||||||
{
|
{
|
||||||
// Sound effect
|
// Sound effect
|
||||||
if(FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER))
|
if (FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER))
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
else
|
else
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
|
|
||||||
FlagToggle(FLAG_VISITED_LITTLEROOT_TOWN);
|
FlagToggle(FLAG_VISITED_LITTLEROOT_TOWN);
|
||||||
FlagToggle(FLAG_VISITED_OLDALE_TOWN);
|
FlagToggle(FLAG_VISITED_OLDALE_TOWN);
|
||||||
FlagToggle(FLAG_VISITED_DEWFORD_TOWN);
|
FlagToggle(FLAG_VISITED_DEWFORD_TOWN);
|
||||||
@ -1424,10 +1411,11 @@ static void DebugAction_Flags_ToggleFlyFlags(u8 taskId)
|
|||||||
static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId)
|
static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId)
|
||||||
{
|
{
|
||||||
// Sound effect
|
// Sound effect
|
||||||
if(FlagGet(FLAG_BADGE08_GET))
|
if (FlagGet(FLAG_BADGE08_GET))
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
else
|
else
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
|
|
||||||
FlagToggle(FLAG_BADGE01_GET);
|
FlagToggle(FLAG_BADGE01_GET);
|
||||||
FlagToggle(FLAG_BADGE02_GET);
|
FlagToggle(FLAG_BADGE02_GET);
|
||||||
FlagToggle(FLAG_BADGE03_GET);
|
FlagToggle(FLAG_BADGE03_GET);
|
||||||
@ -1440,7 +1428,7 @@ static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId)
|
|||||||
static void DebugAction_Flags_ToggleFrontierPass(u8 taskId)
|
static void DebugAction_Flags_ToggleFrontierPass(u8 taskId)
|
||||||
{
|
{
|
||||||
// Sound effect
|
// Sound effect
|
||||||
if(FlagGet(FLAG_SYS_FRONTIER_PASS))
|
if (FlagGet(FLAG_SYS_FRONTIER_PASS))
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
else
|
else
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
@ -1453,48 +1441,39 @@ static void DebugAction_Flags_CollisionOnOff(u8 taskId)
|
|||||||
LockPlayerFieldControls();
|
LockPlayerFieldControls();
|
||||||
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
|
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
|
||||||
#else
|
#else
|
||||||
if(FlagGet(DEBUG_FLAG_NO_COLLISION))
|
if (FlagGet(DEBUG_FLAG_NO_COLLISION))
|
||||||
{
|
|
||||||
FlagClear(DEBUG_FLAG_NO_COLLISION);
|
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
}else{
|
else
|
||||||
FlagSet(DEBUG_FLAG_NO_COLLISION);
|
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
}
|
FlagToggle(DEBUG_FLAG_NO_COLLISION);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
static void DebugAction_Flags_EncounterOnOff(u8 taskId)
|
static void DebugAction_Flags_EncounterOnOff(u8 taskId)
|
||||||
{
|
{
|
||||||
#if DEBUG_FLAG_NO_ENCOUNTER == 0
|
#if OW_FLAG_NO_ENCOUNTER == 0
|
||||||
Debug_DestroyMenu(taskId);
|
Debug_DestroyMenu(taskId);
|
||||||
LockPlayerFieldControls();
|
LockPlayerFieldControls();
|
||||||
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
|
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
|
||||||
#else
|
#else
|
||||||
if(FlagGet(DEBUG_FLAG_NO_ENCOUNTER))
|
if (FlagGet(OW_FLAG_NO_ENCOUNTER))
|
||||||
{
|
|
||||||
FlagClear(DEBUG_FLAG_NO_ENCOUNTER);
|
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
}else{
|
else
|
||||||
FlagSet(DEBUG_FLAG_NO_ENCOUNTER);
|
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
}
|
FlagToggle(OW_FLAG_NO_ENCOUNTER);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId)
|
static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId)
|
||||||
{
|
{
|
||||||
#if DEBUG_FLAG_NO_TRAINER_SEE == 0
|
#if OW_FLAG_NO_TRAINER_SEE == 0
|
||||||
Debug_DestroyMenu(taskId);
|
Debug_DestroyMenu(taskId);
|
||||||
LockPlayerFieldControls();
|
LockPlayerFieldControls();
|
||||||
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
|
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
|
||||||
#else
|
#else
|
||||||
if(FlagGet(DEBUG_FLAG_NO_TRAINER_SEE))
|
if (FlagGet(OW_FLAG_NO_TRAINER_SEE))
|
||||||
{
|
|
||||||
FlagClear(DEBUG_FLAG_NO_TRAINER_SEE);
|
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
}else{
|
else
|
||||||
FlagSet(DEBUG_FLAG_NO_TRAINER_SEE);
|
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
}
|
FlagToggle(OW_FLAG_NO_TRAINER_SEE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
static void DebugAction_Flags_BagUseOnOff(u8 taskId)
|
static void DebugAction_Flags_BagUseOnOff(u8 taskId)
|
||||||
@ -1504,14 +1483,11 @@ static void DebugAction_Flags_BagUseOnOff(u8 taskId)
|
|||||||
LockPlayerFieldControls();
|
LockPlayerFieldControls();
|
||||||
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
|
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
|
||||||
#else
|
#else
|
||||||
if(FlagGet(B_FLAG_NO_BAG_USE))
|
if (FlagGet(B_FLAG_NO_BAG_USE))
|
||||||
{
|
|
||||||
FlagClear(B_FLAG_NO_BAG_USE);
|
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
}else{
|
else
|
||||||
FlagSet(B_FLAG_NO_BAG_USE);
|
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
}
|
FlagToggle(B_FLAG_NO_BAG_USE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
static void DebugAction_Flags_CatchingOnOff(u8 taskId)
|
static void DebugAction_Flags_CatchingOnOff(u8 taskId)
|
||||||
@ -1521,14 +1497,11 @@ static void DebugAction_Flags_CatchingOnOff(u8 taskId)
|
|||||||
LockPlayerFieldControls();
|
LockPlayerFieldControls();
|
||||||
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
|
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
|
||||||
#else
|
#else
|
||||||
if(FlagGet(B_FLAG_NO_CATCHING))
|
if (FlagGet(B_FLAG_NO_CATCHING))
|
||||||
{
|
|
||||||
FlagClear(B_FLAG_NO_CATCHING);
|
|
||||||
PlaySE(SE_PC_OFF);
|
PlaySE(SE_PC_OFF);
|
||||||
}else{
|
else
|
||||||
FlagSet(B_FLAG_NO_CATCHING);
|
|
||||||
PlaySE(SE_PC_LOGIN);
|
PlaySE(SE_PC_LOGIN);
|
||||||
}
|
FlagToggle(B_FLAG_NO_CATCHING);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1567,35 +1540,29 @@ static void DebugAction_Vars_Vars(u8 taskId)
|
|||||||
|
|
||||||
static void DebugAction_Vars_Select(u8 taskId)
|
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]];
|
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;
|
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]];
|
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;
|
gTasks[taskId].data[3] = VARS_START;
|
||||||
}
|
}
|
||||||
}
|
if (gMain.newKeys & DPAD_LEFT)
|
||||||
if(gMain.newKeys & DPAD_LEFT)
|
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[4] -= 1;
|
gTasks[taskId].data[4] -= 1;
|
||||||
if(gTasks[taskId].data[4] < 0)
|
if(gTasks[taskId].data[4] < 0)
|
||||||
{
|
|
||||||
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;
|
gTasks[taskId].data[4] += 1;
|
||||||
if(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;
|
||||||
gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_VARIABLES-1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gMain.newKeys & DPAD_ANY)
|
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)
|
if (gTasks[taskId].data[6] + sPowersOfTen[gTasks[taskId].data[4]] <= 32000)
|
||||||
gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]];
|
gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||||
else
|
else
|
||||||
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 (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]];
|
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;
|
gTasks[taskId].data[6] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(gMain.newKeys & DPAD_LEFT)
|
if (gMain.newKeys & DPAD_LEFT)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[4] -= 1;
|
gTasks[taskId].data[4] -= 1;
|
||||||
if(gTasks[taskId].data[4] < 0)
|
if (gTasks[taskId].data[4] < 0)
|
||||||
{
|
{
|
||||||
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;
|
gTasks[taskId].data[4] += 1;
|
||||||
if(gTasks[taskId].data[4] > 4)
|
if (gTasks[taskId].data[4] > 4)
|
||||||
{
|
{
|
||||||
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);
|
PlaySE(SE_SELECT);
|
||||||
|
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
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]];
|
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;
|
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;
|
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;
|
gTasks[taskId].data[4] += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1822,26 +1789,26 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId)
|
|||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
|
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
gTasks[taskId].data[3] = 99;
|
||||||
}
|
}
|
||||||
if(gMain.newKeys & DPAD_DOWN)
|
if (gMain.newKeys & DPAD_DOWN)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
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;
|
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;
|
gTasks[taskId].data[4] += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1880,9 +1847,11 @@ static void DebugAction_Give_AllTMs(u8 taskId)
|
|||||||
{
|
{
|
||||||
u16 i;
|
u16 i;
|
||||||
PlayFanfare(MUS_OBTAIN_TMHM);
|
PlayFanfare(MUS_OBTAIN_TMHM);
|
||||||
for (i = ITEM_TM01; i <= ITEM_TM50; i++)
|
for (i = ITEM_TM01; i <= ITEM_HM08; i++)
|
||||||
if(!CheckBagHasItem(i, 1))
|
{
|
||||||
|
if (ItemIdToBattleMoveId(i) != MOVE_NONE && !CheckBagHasItem(i, 1))
|
||||||
AddBagItem(i, 1);
|
AddBagItem(i, 1);
|
||||||
|
}
|
||||||
Debug_DestroyMenu(taskId);
|
Debug_DestroyMenu(taskId);
|
||||||
ScriptContext_Enable();
|
ScriptContext_Enable();
|
||||||
}
|
}
|
||||||
@ -1937,12 +1906,7 @@ static void DebugAction_Give_PokemonSimple(u8 taskId)
|
|||||||
gTasks[taskId].data[5] = 0; //Complex?
|
gTasks[taskId].data[5] = 0; //Complex?
|
||||||
FreeMonIconPalettes(); //Free space for new pallete
|
FreeMonIconPalettes(); //Free space for new pallete
|
||||||
LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon
|
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
|
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
|
gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID
|
||||||
}
|
}
|
||||||
static void DebugAction_Give_PokemonComplex(u8 taskId)
|
static void DebugAction_Give_PokemonComplex(u8 taskId)
|
||||||
@ -1972,7 +1936,6 @@ static void DebugAction_Give_PokemonComplex(u8 taskId)
|
|||||||
StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID);
|
StringExpandPlaceholders(gStringVar4, gDebugText_PokemonID);
|
||||||
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
||||||
|
|
||||||
|
|
||||||
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId;
|
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId;
|
||||||
gTasks[taskId].data[2] = windowId;
|
gTasks[taskId].data[2] = windowId;
|
||||||
gTasks[taskId].data[3] = 1; //Current ID
|
gTasks[taskId].data[3] = 1; //Current ID
|
||||||
@ -1980,12 +1943,7 @@ static void DebugAction_Give_PokemonComplex(u8 taskId)
|
|||||||
gTasks[taskId].data[5] = 1; //Complex?
|
gTasks[taskId].data[5] = 1; //Complex?
|
||||||
FreeMonIconPalettes(); //Free space for new palletes
|
FreeMonIconPalettes(); //Free space for new palletes
|
||||||
LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon
|
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
|
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
|
gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID
|
||||||
gTasks[taskId].data[7] = 0; //iterator
|
gTasks[taskId].data[7] = 0; //iterator
|
||||||
}
|
}
|
||||||
@ -1996,30 +1954,26 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId)
|
|||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
|
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||||
if(gTasks[taskId].data[3] > SPECIES_CELEBI && gTasks[taskId].data[3] < SPECIES_TREECKO)
|
if (gTasks[taskId].data[3] >= NUM_SPECIES)
|
||||||
gTasks[taskId].data[3] = SPECIES_TREECKO;
|
|
||||||
if(gTasks[taskId].data[3] >= NUM_SPECIES)
|
|
||||||
gTasks[taskId].data[3] = NUM_SPECIES - 1;
|
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]];
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||||
if(gTasks[taskId].data[3] < SPECIES_TREECKO && gTasks[taskId].data[3] > SPECIES_CELEBI)
|
if (gTasks[taskId].data[3] < 1)
|
||||||
gTasks[taskId].data[3] = SPECIES_CELEBI;
|
|
||||||
if(gTasks[taskId].data[3] < 1)
|
|
||||||
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;
|
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;
|
gTasks[taskId].data[4] += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2033,12 +1987,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId)
|
|||||||
FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]);
|
FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]);
|
||||||
FreeMonIconPalettes(); //Free space for new pallete
|
FreeMonIconPalettes(); //Free space for new pallete
|
||||||
LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon
|
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
|
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;
|
gSprites[gTasks[taskId].data[6]].oam.priority = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2071,26 +2020,26 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId)
|
|||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
|
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
gTasks[taskId].data[3] = 100;
|
||||||
}
|
}
|
||||||
if(gMain.newKeys & DPAD_DOWN)
|
if (gMain.newKeys & DPAD_DOWN)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
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;
|
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;
|
gTasks[taskId].data[4] += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2143,20 +2092,20 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId)
|
|||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
|
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
gTasks[taskId].data[3] = 1;
|
||||||
}
|
}
|
||||||
if(gMain.newKeys & DPAD_DOWN)
|
if (gMain.newKeys & DPAD_DOWN)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
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);
|
StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15);
|
||||||
else
|
else
|
||||||
StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15);
|
StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15);
|
||||||
@ -2194,13 +2143,13 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId)
|
|||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
|
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
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]];
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||||
if(gTasks[taskId].data[3] < 0)
|
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)
|
static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId)
|
||||||
{
|
{
|
||||||
u8 abilityId;
|
u8 abilityId;
|
||||||
u8 abilityCount = 2 - 1; //-1 for proper iteration
|
u8 abilityCount = NUM_ABILITY_SLOTS - 1; //-1 for proper iteration
|
||||||
u8 i = 0;
|
u8 i = 0;
|
||||||
#ifdef POKEMON_EXPANSION
|
|
||||||
abilityCount = NUM_ABILITY_SLOTS - 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (gMain.newKeys & DPAD_ANY)
|
if (gMain.newKeys & DPAD_ANY)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
|
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
gTasks[taskId].data[3] = abilityCount;
|
||||||
}
|
}
|
||||||
if(gMain.newKeys & DPAD_DOWN)
|
if (gMain.newKeys & DPAD_DOWN)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
gTasks[taskId].data[3] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2305,26 +2251,26 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId)
|
|||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
|
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
gTasks[taskId].data[3] = 31;
|
||||||
}
|
}
|
||||||
if(gMain.newKeys & DPAD_DOWN)
|
if (gMain.newKeys & DPAD_DOWN)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
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;
|
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;
|
gTasks[taskId].data[4] += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2444,26 +2390,26 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId)
|
|||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
|
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
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]];
|
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;
|
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;
|
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;
|
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[4] = sDebugMonData->mon_iv_satk;
|
||||||
IVs[5] = sDebugMonData->mon_iv_sdef;
|
IVs[5] = sDebugMonData->mon_iv_sdef;
|
||||||
|
|
||||||
|
|
||||||
//Nature
|
//Nature
|
||||||
if (nature == NUM_NATURES || nature == 0xFF)
|
if (nature == NUM_NATURES || nature == 0xFF)
|
||||||
nature = Random() % NUM_NATURES;
|
nature = Random() % NUM_NATURES;
|
||||||
|
|
||||||
//Shinyness
|
//Shininess
|
||||||
if (isShiny == 1)
|
if (isShiny == 1)
|
||||||
{
|
{
|
||||||
u32 personality;
|
u32 personality;
|
||||||
@ -2608,21 +2553,9 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu
|
|||||||
else
|
else
|
||||||
CreateMonWithNature(&mon, species, level, 32, nature);
|
CreateMonWithNature(&mon, species, level, 32, nature);
|
||||||
|
|
||||||
//EVs/IVs
|
//IVs
|
||||||
for (i = 0; i < NUM_STATS; i++)
|
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];
|
iv_val = IVs[i];
|
||||||
if (iv_val != 32 && iv_val != 0xFF)
|
if (iv_val != 32 && iv_val != 0xFF)
|
||||||
SetMonData(&mon, MON_DATA_HP_IV + i, &iv_val);
|
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);
|
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
|
// give player the mon
|
||||||
//sentToPc = GiveMonToPlayer(&mon);
|
|
||||||
SetMonData(&mon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName);
|
SetMonData(&mon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName);
|
||||||
SetMonData(&mon, MON_DATA_OT_GENDER, &gSaveBlock2Ptr->playerGender);
|
SetMonData(&mon, MON_DATA_OT_GENDER, &gSaveBlock2Ptr->playerGender);
|
||||||
for (i = 0; i < PARTY_SIZE; i++)
|
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_ANY)
|
||||||
{
|
{
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
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]];
|
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;
|
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;
|
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;
|
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_ANY)
|
||||||
{
|
{
|
||||||
if(gMain.newKeys & DPAD_UP)
|
if (gMain.newKeys & DPAD_UP)
|
||||||
{
|
{
|
||||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
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;
|
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]];
|
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;
|
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;
|
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;
|
gTasks[taskId].data[4] += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include "bike.h"
|
#include "bike.h"
|
||||||
#include "coins.h"
|
#include "coins.h"
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "debug.h"
|
|
||||||
#include "event_data.h"
|
#include "event_data.h"
|
||||||
#include "event_object_lock.h"
|
#include "event_object_lock.h"
|
||||||
#include "event_object_movement.h"
|
#include "event_object_movement.h"
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "battle_setup.h"
|
#include "battle_setup.h"
|
||||||
#include "debug.h"
|
|
||||||
#include "event_data.h"
|
#include "event_data.h"
|
||||||
#include "event_object_movement.h"
|
#include "event_object_movement.h"
|
||||||
#include "field_effect.h"
|
#include "field_effect.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user