Merge branch 'master' into contest

This commit is contained in:
PikalaxALT
2018-05-11 09:25:26 -04:00
51 changed files with 4132 additions and 9099 deletions

View File

@@ -1830,7 +1830,7 @@ static void FreeRestoreBattleData(void)
gScanlineEffect.state = 3;
gMain.inBattle = 0;
ZeroEnemyPartyMons();
m4aSongNumStop(0x5A);
m4aSongNumStop(SE_HINSI);
FreeMonSpritesGfx();
FreeBattleSpritesData();
FreeBattleResources();
@@ -5224,7 +5224,7 @@ static void ReturnFromBattleToOverworld(void)
SetRoamerInactive();
}
m4aSongNumStop(0x5A);
m4aSongNumStop(SE_HINSI);
SetMainCallback2(gMain.savedCallback);
}

View File

@@ -3357,7 +3357,7 @@ static void atk23_getexp(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gBattleMons[0].hp && !gBattleStruct->wildVictorySong)
{
BattleStopLowHpSound();
PlayBGM(0x161);
PlayBGM(MUS_KACHI2);
gBattleStruct->wildVictorySong++;
}

View File

@@ -51,8 +51,6 @@ struct TrainerBattleParameter
u8 ptrType;
};
extern void (*gFieldCallback)(void);
extern bool8 InBattlePyramid(void);
extern bool8 InBattlePike(void);
extern bool32 InTrainerHill(void);

View File

@@ -13,7 +13,6 @@
extern bool8 gBikeCyclingChallenge;
extern u8 gBikeCollisions;
extern u8 sub_8093514(u8 direction);
extern u8 sub_808B980(u8 direction);
extern u8 sub_808B9BC(u8 direction);
extern u8 sub_808B9A4(u8 direction);

View File

@@ -38,8 +38,6 @@
#include "decoration.h"
#include "graphics.h"
extern void (*gFieldCallback)(void);
// Static type declarations
#define OVERWORLD_PLACE_DECOR_SELECTOR_PAL_TAG 0xbe5
@@ -1294,7 +1292,7 @@ void sub_8128060(u8 taskId)
gTasks[taskId].data[2] = 2;
break;
case 2:
if (sub_80ABDFC() == TRUE)
if (IsWeatherNotFadingIn() == TRUE)
{
gTasks[taskId].data[12] = 0;
sub_8128FD8(taskId);
@@ -1710,7 +1708,7 @@ void sub_8128C64(u8 taskId)
data[2] ++;
break;
case 3:
if (sub_80ABDFC() == TRUE)
if (IsWeatherNotFadingIn() == TRUE)
{
gTasks[taskId].func = sub_812764C;
}
@@ -2220,7 +2218,7 @@ void sub_81298EC(u8 taskId)
gTasks[taskId].data[2] = 3;
break;
case 3:
if (sub_80ABDFC() == TRUE)
if (IsWeatherNotFadingIn() == TRUE)
{
StringExpandPlaceholders(gStringVar4, gText_DecorationReturnedToPC);
DisplayItemMessageOnField(taskId, gStringVar4, sub_8129D64);
@@ -2290,7 +2288,7 @@ void sub_8129ABC(u8 taskId)
data[2] = 2;
break;
case 2:
if (sub_80ABDFC() == TRUE)
if (IsWeatherNotFadingIn() == TRUE)
{
data[12] = 1;
sub_8129B34(taskId);
@@ -2616,7 +2614,7 @@ void sub_812A2C4(u8 taskId)
data[2] ++;
break;
case 3:
if (sub_80ABDFC() == TRUE)
if (IsWeatherNotFadingIn() == TRUE)
{
gTasks[taskId].func = sub_8126B80;
}

View File

@@ -25,6 +25,7 @@
#include "window.h"
#include "constants/abilities.h"
#include "daycare.h"
#include "overworld.h"
#include "battle.h" // to get rid of later
struct EggHatchData
@@ -44,8 +45,6 @@ struct EggHatchData
u8 textColor[3];
};
extern void (*gFieldCallback)(void);
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
extern const u8 gBattleTextboxTiles[];
extern const u8 gBattleTextboxTilemap[];
@@ -575,10 +574,10 @@ static void Task_EggHatchPlayBGM(u8 taskID)
play_some_sound();
}
if (gTasks[taskID].data[0] == 1)
PlayBGM(376);
PlayBGM(MUS_ME_SHINKA);
if (gTasks[taskID].data[0] > 60)
{
PlayBGM(377);
PlayBGM(MUS_SHINKA);
DestroyTask(taskID);
// UB: task is destroyed, yet the value is incremented
}

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,7 @@ bool8 FldEff_UseTeleport(void)
void sub_817C94C(void)
{
FieldEffectActiveListRemove(FLDEFF_USE_TELEPORT);
sub_80B7FC8();
CreateTeleportFieldEffectTask();
}

View File

@@ -7,7 +7,6 @@
#include "script_menu.h"
#include "task.h"
extern void (*gFieldCallback)(void);
extern void (*gUnknown_0300485C)(void);
extern void Overworld_PlaySpecialMapMusic(void);

View File

@@ -271,8 +271,6 @@ EWRAM_DATA struct ListBuffer2 *gUnknown_0203CE78 = 0;
EWRAM_DATA u16 gSpecialVar_ItemId = 0;
EWRAM_DATA struct TempWallyStruct *gUnknown_0203CE80 = 0;
void (*gFieldCallback)(void);
extern u8 *gPocketNamesStringsTable[];
extern u8 gUnknown_08D9A88C[];
extern struct ListMenuTemplate gUnknown_08613F9C;

View File

@@ -91,7 +91,6 @@ extern u8* sub_806CF78(u16);
extern void sub_81B89F0(void);
extern u8 GetItemEffectType(u16);
extern struct MapConnection *sub_8088A8C(s16, s16);
extern void (*gFieldCallback)(void);
void MapPostLoadHook_UseItem(void);
void sub_80AF6D4(void);
@@ -167,7 +166,7 @@ void MapPostLoadHook_UseItem(void)
void Task_CallItemUseOnFieldCallback(u8 taskId)
{
if (sub_80ABDFC() == 1)
if (IsWeatherNotFadingIn() == 1)
gUnknown_0203A0F4(taskId);
}

View File

@@ -38,6 +38,7 @@
#include "roamer.h"
// #include "rotating_gate.h"
#include "safari_zone.h"
#include "save.h"
#include "script.h"
// #include "script_pokemon_80C4.h"
#include "secret_base.h"
@@ -87,12 +88,11 @@ extern const struct MapHeader *const *const gMapGroups[];
extern const s32 gMaxFlashLevel;
extern const u16 gUnknown_82EC7C4[];
extern u16 gSaveFileStatus;
extern u16 gUnknown_03005DA8;
extern bool8 (*gUnknown_03005DB0)(void);
extern u8 gUnknown_03005DB4;
extern u8 gFieldLinkPlayerCount;
extern MainCallback gFieldCallback;
u16 gUnknown_03005DA8;
MainCallback gFieldCallback;
bool8 (*gUnknown_03005DB0)(void);
u8 gUnknown_03005DB4;
u8 gFieldLinkPlayerCount;
// functions
extern void HealPlayerParty(void);
@@ -713,7 +713,7 @@ void sub_8084D5C(s16 a1, s16 a2)
{
u8 currMapType = Overworld_GetMapTypeOfSaveblockLocation();
u8 destMapType = GetMapTypeByGroupAndId(sWarpDestination.mapGroup, sWarpDestination.mapNum);
if (is_light_level_1_2_3_5_or_6(currMapType) && is_light_level_1_2_3_5_or_6(destMapType) != TRUE)
if (is_map_type_1_2_3_5_or_6(currMapType) && is_map_type_1_2_3_5_or_6(destMapType) != TRUE)
sub_8084DD4(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, a1 - 7, a2 - 6);
}
@@ -872,7 +872,7 @@ static void mli0_load_map(u32 a1)
LoadMapObjTemplatesFromHeader();
}
v2 = is_light_level_1_2_3_5_or_6(gMapHeader.mapType);
v2 = is_map_type_1_2_3_5_or_6(gMapHeader.mapType);
indoors = Overworld_MapTypeIsIndoors(gMapHeader.mapType);
sub_80EB218();
@@ -1365,7 +1365,7 @@ u8 get_map_light_from_warp0(void)
return GetMapTypeByWarpData(&gUnknown_020322DC);
}
bool8 is_light_level_1_2_3_5_or_6(u8 mapType)
bool8 is_map_type_1_2_3_5_or_6(u8 mapType)
{
if (mapType == MAP_TYPE_ROUTE
|| mapType == MAP_TYPE_TOWN

View File

@@ -436,7 +436,7 @@ void Mailbox_DoRedrawMailboxMenuAfterReturn(void)
static void ItemStorage_HandleReturnToProcessInput(u8 taskId)
{
if (sub_80ABDFC() == TRUE)
if (IsWeatherNotFadingIn() == TRUE)
gTasks[taskId].func = ItemStorageMenuProcessInput;
}
@@ -673,7 +673,7 @@ static void pal_fill_for_maplights_or_black(void)
static void Mailbox_HandleReturnToProcessInput(u8 taskId)
{
if(sub_80ABDFC() == TRUE)
if(IsWeatherNotFadingIn() == TRUE)
gTasks[taskId].func = Mailbox_ProcessInput;
}

View File

@@ -29,6 +29,7 @@
#include "battle_message.h"
#include "safari_zone.h"
#include "lilycove_lady.h"
#include "overworld.h"
#define POKEBLOCK_MAX_FEEL 99
#define FIELD_E75_COUNT 7
@@ -70,7 +71,6 @@ enum
};
extern u16 gSpecialVar_ItemId;
extern void (*gFieldCallback)(void);
extern const u16 gUnknown_0860F074[];

View File

@@ -1810,7 +1810,7 @@ void sub_81C174C(u8 taskId)
}
else
{
PlaySE(0x20);
PlaySE(SE_HAZURE);
sub_81C18F4(taskId);
}
}

View File

@@ -40,8 +40,6 @@
#include "tv.h"
#include "secret_base.h"
extern void (*gFieldCallback)(void);
extern void mapldr_default(void);
// Static type declarations
@@ -416,7 +414,7 @@ bool8 sub_80E909C(void)
void sub_80E90C8(u8 taskId)
{
FieldObjectTurn(&gMapObjects[gPlayerAvatar.mapObjectId], DIR_NORTH);
if (sub_80ABDFC() == TRUE)
if (IsWeatherNotFadingIn() == TRUE)
{
EnableBothScriptContexts();
DestroyTask(taskId);

View File

@@ -81,7 +81,7 @@ void UpdateShoalTideFlag(void)
1, // 23
};
if (is_light_level_1_2_3_5_or_6(get_map_light_from_warp0()))
if (is_map_type_1_2_3_5_or_6(get_map_light_from_warp0()))
{
RtcCalcLocalTime();
if (tide[gLocalTime.hours])

View File

@@ -19,6 +19,7 @@
#include "gpu_regs.h"
#include "trig.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#define VERSION_BANNER_SHAPE 1
#define VERSION_BANNER_RIGHT_TILEOFFSET 64
@@ -574,7 +575,7 @@ void CB2_InitTitleScreen(void)
| DISPCNT_OBJ_ON
| DISPCNT_WIN0_ON
| DISPCNT_OBJWIN_ON);
m4aSongNumStart(0x19D);
m4aSongNumStart(MUS_TITLE3);
gMain.state = 5;
break;
case 5:

View File

@@ -6,8 +6,7 @@
#include "main.h"
#include "text.h"
#include "new_game.h"
extern void (*gFieldCallback)(void);
#include "overworld.h"
extern const u8 gText_Peekaboo[];