Merge branch 'master' into document-gyms2

This commit is contained in:
GriffinR
2019-10-16 04:22:34 -04:00
committed by GitHub
361 changed files with 10599 additions and 11080 deletions
+11 -16
View File
@@ -55,6 +55,7 @@
#include "constants/heal_locations.h"
#include "constants/map_types.h"
#include "constants/maps.h"
#include "constants/tv.h"
#include "constants/script_menu.h"
#include "constants/songs.h"
#include "constants/species.h"
@@ -635,6 +636,7 @@ static void LoadLinkPartnerEventObjectSpritePalette(u8 graphicsId, u8 localEvent
}
}
// NOTE: Coordinates are +7, +7 from actual in-map coordinates
static const struct UCoords8 sMauvilleGymSwitchCoords[] =
{
{ 7, 22},
@@ -643,26 +645,24 @@ static const struct UCoords8 sMauvilleGymSwitchCoords[] =
{15, 16}
};
// Flips the switches on the ground when the player steps on them.
void MauvilleGymSpecial1(void)
// Presses the stepped-on switch and raises the rest
void MauvilleGymPressSwitch(void)
{
u8 i;
for (i = 0; i < ARRAY_COUNT(sMauvilleGymSwitchCoords); i++)
{
if (i == gSpecialVar_0x8004)
{
MapGridSetMetatileIdAt(sMauvilleGymSwitchCoords[i].x, sMauvilleGymSwitchCoords[i].y, METATILE_ID(MauvilleGym, PressedSwitch));
}
else
{
MapGridSetMetatileIdAt(sMauvilleGymSwitchCoords[i].x, sMauvilleGymSwitchCoords[i].y, METATILE_ID(MauvilleGym, RaisedSwitch));
}
}
}
void MauvilleGymSpecial2(void)
// Sets the gym barriers back to the default state; their alt state is handled by MauvilleCity_Gym_EventScript_SetAltBarriers
void MauvilleGymSetDefaultBarriers(void)
{
int x, y;
// All switches/barriers are within these coord ranges -7
for (y = 12; y < 24; y++)
{
for (x = 7; x < 16; x++)
@@ -734,13 +734,9 @@ void MauvilleGymSpecial2(void)
break;
case METATILE_ID(MauvilleGym, FloorTile):
if (MapGridGetMetatileIdAt(x, y - 1) == METATILE_ID(MauvilleGym, GreenBeamV1_On))
{
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamV2_On) | METATILE_COLLISION_MASK);
}
else
{
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamV2_On) | METATILE_COLLISION_MASK);
}
break;
case METATILE_ID(MauvilleGym, PoleBottom_Off):
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamV1_On) | METATILE_COLLISION_MASK);
@@ -757,7 +753,7 @@ void MauvilleGymSpecial2(void)
}
// Presses all switches and deactivates all beams.
void MauvilleGymSpecial3(void)
void MauvilleGymDeactivatePuzzle(void)
{
int i, x, y;
const struct UCoords8 *switchCoords = sMauvilleGymSwitchCoords;
@@ -3737,12 +3733,11 @@ bool32 IsTrainerRegistered(void)
}
// Always returns FALSE
bool32 sub_813B514(void)
bool32 ShouldDistributeEonTicket(void)
{
if (!VarGet(VAR_ALWAYS_ZERO_0x403F))
{
if (!VarGet(VAR_DISTRIBUTE_EON_TICKET))
return FALSE;
}
return TRUE;
}