Merge branch 'master' into document-eventscripts

This commit is contained in:
GriffinR
2019-09-17 18:01:20 -04:00
committed by GitHub
49 changed files with 1225 additions and 982 deletions

View File

@@ -10227,17 +10227,17 @@ static void atkF0_givecaughtmon(void)
{
if (GiveMonToPlayer(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]]) != MON_GIVEN_TO_PARTY)
{
if (!sub_813B21C())
if (!ShouldShowBoxWasFullMessage())
{
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_STORAGE_UNKNOWN)));
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON)));
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2);
}
else
{
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_STORAGE_UNKNOWN)));
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); // box the mon was sent to
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2);
StringCopy(gStringVar3, GetBoxNamePtr(get_unknown_box_id()));
StringCopy(gStringVar3, GetBoxNamePtr(GetPCBoxToSendMon())); //box the mon was going to be sent to
gBattleCommunication[MULTISTRING_CHOOSER] = 2;
}

View File

@@ -25,7 +25,7 @@ static void InitTimeBasedEvents(void)
void DoTimeBasedEvents(void)
{
if (FlagGet(FLAG_SYS_CLOCK_SET) && !sub_813B9C0())
if (FlagGet(FLAG_SYS_CLOCK_SET) && !InPokemonCenter())
{
RtcCalcLocalTime();
UpdatePerDay(&gLocalTime);

View File

@@ -0,0 +1,99 @@
static const u16 sFrontierExchangeCorner_Decor1[] =
{
DECOR_KISS_POSTER,
DECOR_KISS_CUSHION,
DECOR_SMOOCHUM_DOLL,
DECOR_TOGEPI_DOLL,
DECOR_MEOWTH_DOLL,
DECOR_CLEFAIRY_DOLL,
DECOR_DITTO_DOLL,
DECOR_CYNDAQUIL_DOLL,
DECOR_CHIKORITA_DOLL,
DECOR_TOTODILE_DOLL,
0xFFFF
};
static const u16 sFrontierExchangeCorner_Decor2[] =
{
DECOR_LAPRAS_DOLL,
DECOR_SNORLAX_DOLL,
DECOR_VENUSAUR_DOLL,
DECOR_CHARIZARD_DOLL,
DECOR_BLASTOISE_DOLL,
0xFFFF
};
static const u16 sFrontierExchangeCorner_Vitamins[] =
{
ITEM_PROTEIN,
ITEM_CALCIUM,
ITEM_IRON,
ITEM_ZINC,
ITEM_CARBOS,
ITEM_HP_UP,
0xFFFF
};
static const u16 sFrontierExchangeCorner_HoldItems[] =
{
ITEM_LEFTOVERS,
ITEM_WHITE_HERB,
ITEM_QUICK_CLAW,
ITEM_MENTAL_HERB,
ITEM_BRIGHT_POWDER,
ITEM_CHOICE_BAND,
ITEM_KINGS_ROCK,
ITEM_FOCUS_BAND,
ITEM_SCOPE_LENS,
0xFFFF
};
static const u8 *const sFrontierExchangeCorner_Decor1Descriptions[] =
{
BattleFrontier_BattlePointExchangeServiceCorner_Text_2601AA,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2601D0,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260201,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26022F,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26025B,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260287,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2602B5,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2602E0,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26030F,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26033E,
gText_Exit,
};
static const u8 *const sFrontierExchangeCorner_Decor2Descriptions[] =
{
BattleFrontier_BattlePointExchangeServiceCorner_Text_26036C,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26036C,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26036C,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26036C,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26036C,
gText_Exit
};
static const u8 *const sFrontierExchangeCorner_VitaminsDescriptions[] =
{
BattleFrontier_BattlePointExchangeServiceCorner_Text_260397,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2603BE,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2603E6,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26040E,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260436,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26045C,
gText_Exit
};
static const u8 *const sFrontierExchangeCorner_HoldItemsDescriptions[] =
{
BattleFrontier_BattlePointExchangeServiceCorner_Text_26047A,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2604AC,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2604D8,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26050F,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260542,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260575,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2605A8,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2605E2,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260613,
gText_Exit
};

View File

@@ -1,35 +1,4 @@
#define TUTOR_MOVE_MEGA_PUNCH 0
#define TUTOR_MOVE_SWORDS_DANCE 1
#define TUTOR_MOVE_MEGA_KICK 2
#define TUTOR_MOVE_BODY_SLAM 3
#define TUTOR_MOVE_DOUBLE_EDGE 4
#define TUTOR_MOVE_COUNTER 5
#define TUTOR_MOVE_SEISMIC_TOSS 6
#define TUTOR_MOVE_MIMIC 7
#define TUTOR_MOVE_METRONOME 8
#define TUTOR_MOVE_SOFT_BOILED 9
#define TUTOR_MOVE_DREAM_EATER 10
#define TUTOR_MOVE_THUNDER_WAVE 11
#define TUTOR_MOVE_EXPLOSION 12
#define TUTOR_MOVE_ROCK_SLIDE 13
#define TUTOR_MOVE_SUBSTITUTE 14
#define TUTOR_MOVE_DYNAMIC_PUNCH 15
#define TUTOR_MOVE_ROLLOUT 16
#define TUTOR_MOVE_PSYCH_UP 17
#define TUTOR_MOVE_SNORE 18
#define TUTOR_MOVE_ICY_WIND 19
#define TUTOR_MOVE_ENDURE 20
#define TUTOR_MOVE_MUD_SLAP 21
#define TUTOR_MOVE_ICE_PUNCH 22
#define TUTOR_MOVE_SWAGGER 23
#define TUTOR_MOVE_SLEEP_TALK 24
#define TUTOR_MOVE_SWIFT 25
#define TUTOR_MOVE_DEFENSE_CURL 26
#define TUTOR_MOVE_THUNDER_PUNCH 27
#define TUTOR_MOVE_FIRE_PUNCH 28
#define TUTOR_MOVE_FURY_CUTTER 29
const u16 gTutorMoves[] =
const u16 gTutorMoves[TUTOR_MOVE_COUNT] =
{
[TUTOR_MOVE_MEGA_PUNCH] = MOVE_MEGA_PUNCH,
[TUTOR_MOVE_SWORDS_DANCE] = MOVE_SWORDS_DANCE,

File diff suppressed because it is too large Load Diff

View File

@@ -794,15 +794,15 @@ static void sub_81A17A0(void)
case 0:
break;
case 1:
sub_813A878(0);
FrontierGamblerSetWonOrLost(FALSE);
VarSet(VAR_TEMP_0, gSaveBlock2Ptr->frontier.field_CA8);
break;
case 4:
sub_813A878(0);
FrontierGamblerSetWonOrLost(FALSE);
VarSet(VAR_TEMP_0, gSaveBlock2Ptr->frontier.field_CA8);
break;
case 3:
sub_813A878(1);
FrontierGamblerSetWonOrLost(TRUE);
VarSet(VAR_TEMP_0, gSaveBlock2Ptr->frontier.field_CA8);
break;
case 2:

View File

@@ -541,16 +541,16 @@ static void DisplaySentToPCMessage(void)
{
u8 stringToDisplay = 0;
if (!sub_813B260())
if (!IsDestinationBoxFull())
{
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_STORAGE_UNKNOWN)));
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON)));
StringCopy(gStringVar2, gNamingScreenData->destBuffer);
}
else
{
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_STORAGE_UNKNOWN)));
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON)));
StringCopy(gStringVar2, gNamingScreenData->destBuffer);
StringCopy(gStringVar3, GetBoxNamePtr(get_unknown_box_id()));
StringCopy(gStringVar3, GetBoxNamePtr(GetPCBoxToSendMon()));
stringToDisplay = 2;
}

View File

@@ -48,6 +48,13 @@ enum
WIN_OPTIONS
};
#define YPOS_TEXTSPEED (MENUITEM_TEXTSPEED * 16)
#define YPOS_BATTLESCENE (MENUITEM_BATTLESCENE * 16)
#define YPOS_BATTLESTYLE (MENUITEM_BATTLESTYLE * 16)
#define YPOS_SOUND (MENUITEM_SOUND * 16)
#define YPOS_BUTTONMODE (MENUITEM_BUTTONMODE * 16)
#define YPOS_FRAMETYPE (MENUITEM_FRAMETYPE * 16)
// this file's functions
static void Task_OptionMenuFadeIn(u8 taskId);
static void Task_OptionMenuProcessInput(u8 taskId);
@@ -80,13 +87,13 @@ static const u8 sEqualSignGfx[] = INCBIN_U8("graphics/misc/option_menu_equals_si
static const u8 *const sOptionMenuItemsNames[MENUITEM_COUNT] =
{
gText_TextSpeed,
gText_BattleScene,
gText_BattleStyle,
gText_Sound,
gText_ButtonMode,
gText_Frame,
gText_OptionMenuCancel,
[MENUITEM_TEXTSPEED] = gText_TextSpeed,
[MENUITEM_BATTLESCENE] = gText_BattleScene,
[MENUITEM_BATTLESTYLE] = gText_BattleStyle,
[MENUITEM_SOUND] = gText_Sound,
[MENUITEM_BUTTONMODE] = gText_ButtonMode,
[MENUITEM_FRAMETYPE] = gText_Frame,
[MENUITEM_CANCEL] = gText_OptionMenuCancel,
};
static const struct WindowTemplate sOptionMenuWinTemplates[] =
@@ -280,12 +287,12 @@ static void Task_OptionMenuProcessInput(u8 taskId)
if (gTasks[taskId].data[TD_MENUSELECTION] > 0)
gTasks[taskId].data[TD_MENUSELECTION]--;
else
gTasks[taskId].data[TD_MENUSELECTION] = 6;
gTasks[taskId].data[TD_MENUSELECTION] = MENUITEM_CANCEL;
HighlightOptionMenuItem(gTasks[taskId].data[TD_MENUSELECTION]);
}
else if (gMain.newKeys & DPAD_DOWN)
{
if (gTasks[taskId].data[TD_MENUSELECTION] <= 5)
if (gTasks[taskId].data[TD_MENUSELECTION] < MENUITEM_CANCEL)
gTasks[taskId].data[TD_MENUSELECTION]++;
else
gTasks[taskId].data[TD_MENUSELECTION] = 0;
@@ -431,7 +438,7 @@ static void TextSpeed_DrawChoices(u8 selection)
styles[2] = 0;
styles[selection] = 1;
DrawOptionMenuChoice(gText_TextSpeedSlow, 104, 0, styles[0]);
DrawOptionMenuChoice(gText_TextSpeedSlow, 104, YPOS_TEXTSPEED, styles[0]);
widthSlow = GetStringWidth(1, gText_TextSpeedSlow, 0);
widthMid = GetStringWidth(1, gText_TextSpeedMid, 0);
@@ -439,9 +446,9 @@ static void TextSpeed_DrawChoices(u8 selection)
widthMid -= 94;
xMid = (widthSlow - widthMid - widthFast) / 2 + 104;
DrawOptionMenuChoice(gText_TextSpeedMid, xMid, 0, styles[1]);
DrawOptionMenuChoice(gText_TextSpeedMid, xMid, YPOS_TEXTSPEED, styles[1]);
DrawOptionMenuChoice(gText_TextSpeedFast, GetStringRightAlignXOffset(1, gText_TextSpeedFast, 198), 0, styles[2]);
DrawOptionMenuChoice(gText_TextSpeedFast, GetStringRightAlignXOffset(1, gText_TextSpeedFast, 198), YPOS_TEXTSPEED, styles[2]);
}
static u8 BattleScene_ProcessInput(u8 selection)
@@ -463,8 +470,8 @@ static void BattleScene_DrawChoices(u8 selection)
styles[1] = 0;
styles[selection] = 1;
DrawOptionMenuChoice(gText_BattleSceneOn, 104, 16, styles[0]);
DrawOptionMenuChoice(gText_BattleSceneOff, GetStringRightAlignXOffset(1, gText_BattleSceneOff, 198), 16, styles[1]);
DrawOptionMenuChoice(gText_BattleSceneOn, 104, YPOS_BATTLESCENE, styles[0]);
DrawOptionMenuChoice(gText_BattleSceneOff, GetStringRightAlignXOffset(1, gText_BattleSceneOff, 198), YPOS_BATTLESCENE, styles[1]);
}
static u8 BattleStyle_ProcessInput(u8 selection)
@@ -486,8 +493,8 @@ static void BattleStyle_DrawChoices(u8 selection)
styles[1] = 0;
styles[selection] = 1;
DrawOptionMenuChoice(gText_BattleStyleShift, 104, 32, styles[0]);
DrawOptionMenuChoice(gText_BattleStyleSet, GetStringRightAlignXOffset(1, gText_BattleStyleSet, 198), 32, styles[1]);
DrawOptionMenuChoice(gText_BattleStyleShift, 104, YPOS_BATTLESTYLE, styles[0]);
DrawOptionMenuChoice(gText_BattleStyleSet, GetStringRightAlignXOffset(1, gText_BattleStyleSet, 198), YPOS_BATTLESTYLE, styles[1]);
}
static u8 Sound_ProcessInput(u8 selection)
@@ -510,8 +517,8 @@ static void Sound_DrawChoices(u8 selection)
styles[1] = 0;
styles[selection] = 1;
DrawOptionMenuChoice(gText_SoundMono, 104, 48, styles[0]);
DrawOptionMenuChoice(gText_SoundStereo, GetStringRightAlignXOffset(1, gText_SoundStereo, 198), 48, styles[1]);
DrawOptionMenuChoice(gText_SoundMono, 104, YPOS_SOUND, styles[0]);
DrawOptionMenuChoice(gText_SoundStereo, GetStringRightAlignXOffset(1, gText_SoundStereo, 198), YPOS_SOUND, styles[1]);
}
static u8 FrameType_ProcessInput(u8 selection)
@@ -568,8 +575,8 @@ static void FrameType_DrawChoices(u8 selection)
text[i] = EOS;
DrawOptionMenuChoice(gText_FrameType, 104, 80, 0);
DrawOptionMenuChoice(text, 128, 80, 1);
DrawOptionMenuChoice(gText_FrameType, 104, YPOS_FRAMETYPE, 0);
DrawOptionMenuChoice(text, 128, YPOS_FRAMETYPE, 1);
}
static u8 ButtonMode_ProcessInput(u8 selection)
@@ -605,7 +612,7 @@ static void ButtonMode_DrawChoices(u8 selection)
styles[2] = 0;
styles[selection] = 1;
DrawOptionMenuChoice(gText_ButtonTypeNormal, 104, 64, styles[0]);
DrawOptionMenuChoice(gText_ButtonTypeNormal, 104, YPOS_BUTTONMODE, styles[0]);
widthNormal = GetStringWidth(1, gText_ButtonTypeNormal, 0);
widthLR = GetStringWidth(1, gText_ButtonTypeLR, 0);
@@ -613,9 +620,9 @@ static void ButtonMode_DrawChoices(u8 selection)
widthLR -= 94;
xLR = (widthNormal - widthLR - widthLA) / 2 + 104;
DrawOptionMenuChoice(gText_ButtonTypeLR, xLR, 64, styles[1]);
DrawOptionMenuChoice(gText_ButtonTypeLR, xLR, YPOS_BUTTONMODE, styles[1]);
DrawOptionMenuChoice(gText_ButtonTypeLEqualsA, GetStringRightAlignXOffset(1, gText_ButtonTypeLEqualsA, 198), 64, styles[2]);
DrawOptionMenuChoice(gText_ButtonTypeLEqualsA, GetStringRightAlignXOffset(1, gText_ButtonTypeLEqualsA, 198), YPOS_BUTTONMODE, styles[2]);
}
static void DrawTextOption(void)

View File

@@ -1759,7 +1759,7 @@ void CB2_ContinueSavedGame(void)
static void FieldClearVBlankHBlankCallbacks(void)
{
if (warp0_in_pokecenter() == TRUE)
if (UsedPokemonCenterWarp() == TRUE)
CloseLink();
if (gWirelessCommType != 0)

View File

@@ -4329,7 +4329,7 @@ u8 SendMonToPC(struct Pokemon* mon)
{
s32 boxNo, boxPos;
set_unknown_box_id(VarGet(VAR_STORAGE_UNKNOWN));
SetPCBoxToSendMon(VarGet(VAR_PC_BOX_TO_SEND_MON));
boxNo = StorageGetCurrentBox();
@@ -4344,9 +4344,9 @@ u8 SendMonToPC(struct Pokemon* mon)
CopyMon(checkingMon, &mon->box, sizeof(mon->box));
gSpecialVar_MonBoxId = boxNo;
gSpecialVar_MonBoxPos = boxPos;
if (get_unknown_box_id() != boxNo)
FlagClear(FLAG_SYS_STORAGE_UNKNOWN_FLAG);
VarSet(VAR_STORAGE_UNKNOWN, boxNo);
if (GetPCBoxToSendMon() != boxNo)
FlagClear(FLAG_SHOWN_BOX_WAS_FULL_MESSAGE);
VarSet(VAR_PC_BOX_TO_SEND_MON, boxNo);
return MON_GIVEN_TO_PC;
}
}

View File

@@ -453,7 +453,7 @@ EWRAM_DATA static bool8 sInPartyMenu = 0;
EWRAM_DATA static u8 sCurrentBoxOption = 0;
EWRAM_DATA static u8 gUnknown_02039D0E = 0;
EWRAM_DATA static u8 sWhichToReshow = 0;
EWRAM_DATA static u8 gUnknown_02039D10 = 0;
EWRAM_DATA static u8 sLastUsedBox = 0;
EWRAM_DATA static u16 gUnknown_02039D12 = 0;
EWRAM_DATA static struct Pokemon gUnknown_02039D14 = {0};
EWRAM_DATA static s8 sBoxCursorArea = 0;
@@ -2167,7 +2167,7 @@ static void Cb2_EnterPSS(u8 boxOption)
gUnknown_02039D12 = 0;
sPSSData->state = 0;
sPSSData->taskId = CreateTask(Cb_InitPSS, 3);
gUnknown_02039D10 = StorageGetCurrentBox();
sLastUsedBox = StorageGetCurrentBox();
SetMainCallback2(Cb2_PSS);
}
}
@@ -4366,10 +4366,10 @@ static bool8 DoShowPartyMenu(void)
static void sub_80CABE0(void)
{
if (gUnknown_02039D10 != StorageGetCurrentBox())
if (sLastUsedBox != StorageGetCurrentBox())
{
FlagClear(FLAG_SYS_STORAGE_UNKNOWN_FLAG);
VarSet(VAR_STORAGE_UNKNOWN, StorageGetCurrentBox());
FlagClear(FLAG_SHOWN_BOX_WAS_FULL_MESSAGE);
VarSet(VAR_PC_BOX_TO_SEND_MON, StorageGetCurrentBox());
}
}

View File

@@ -24,6 +24,7 @@
#include "region_map.h"
#include "constants/region_map_sections.h"
#include "heal_location.h"
#include "constants/field_specials.h"
#include "constants/heal_locations.h"
#include "constants/map_types.h"
#include "constants/rgb.h"
@@ -1144,20 +1145,20 @@ static void RegionMap_InitializeStateBasedOnSSTidalLocation(void)
x = 0;
switch (GetSSTidalLocation(&mapGroup, &mapNum, &xOnMap, &yOnMap))
{
case 1:
case SS_TIDAL_LOCATION_SLATEPORT:
gRegionMap->mapSecId = MAPSEC_SLATEPORT_CITY;
break;
case 2:
case SS_TIDAL_LOCATION_LILYCOVE:
gRegionMap->mapSecId = MAPSEC_LILYCOVE_CITY;
break;
case 3:
case SS_TIDAL_LOCATION_ROUTE124:
gRegionMap->mapSecId = MAPSEC_ROUTE_124;
break;
case 4:
case SS_TIDAL_LOCATION_ROUTE131:
gRegionMap->mapSecId = MAPSEC_ROUTE_131;
break;
default:
case 0:
case SS_TIDAL_LOCATION_OTHER:
mapHeader = Overworld_GetMapHeaderByGroupAndId(mapGroup, mapNum);
gRegionMap->mapSecId = mapHeader->regionMapSectionId;

View File

@@ -13,6 +13,7 @@
#include "strings.h"
#include "task.h"
#include "text.h"
#include "constants/field_specials.h"
#include "constants/items.h"
#include "constants/songs.h"
@@ -1493,8 +1494,8 @@ static void sub_80E2578(void)
count = temp;
if (count == 7)
{
gSpecialVar_0x8004 = 11;
sub_813A128();
gSpecialVar_0x8004 = SCROLL_MULTI_SS_TIDAL_DESTINATION;
ShowScrollableMultichoice();
}
else
{

View File

@@ -2786,11 +2786,11 @@ bool8 GetPriceReduction(u8 newsKind)
{
u8 i;
if (newsKind == 0)
if (newsKind == POKENEWS_NONE)
{
return FALSE;
}
for (i = 0; i < 16; i ++)
for (i = 0; i < POKE_NEWS_COUNT; i ++)
{
if (gSaveBlock1Ptr->pokeNews[i].kind == newsKind)
{