summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGriffinR <griffin.richards@comcast.net>2019-10-11 17:25:07 -0400
committerhuderlem <huderlem@gmail.com>2019-10-15 17:09:47 -0500
commit348bb002a8016d9c4bb6f6968dbc359b4d346aa9 (patch)
tree430850474a335290829efa1874d11ffc3aa9c591 /src
parenta0b3f5d9e34e65c1948325bd4177a734bfde6bb4 (diff)
Document Gym scripts first half
Diffstat (limited to 'src')
-rw-r--r--src/field_control_avatar.c2
-rw-r--r--src/field_screen_effect.c2
-rw-r--r--src/field_specials.c19
-rw-r--r--src/scrcmd.c2
4 files changed, 10 insertions, 15 deletions
diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c
index bde49b663..9a0388ae0 100644
--- a/src/field_control_avatar.c
+++ b/src/field_control_avatar.c
@@ -583,7 +583,7 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior)
}
if (ShouldDoRoxanneCall() == TRUE)
{
- ScriptContext1_SetupScript(RustboroCity_Gym_EventScript_21307B);
+ ScriptContext1_SetupScript(RustboroCity_Gym_EventScript_RegisterRoxanne);
return TRUE;
}
if (ShouldDoRivalRayquazaCall() == TRUE)
diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c
index e1563eeb9..18faf0e60 100644
--- a/src/field_screen_effect.c
+++ b/src/field_screen_effect.c
@@ -970,7 +970,7 @@ static u8 sub_80B003C(s32 centerX, s32 centerY, s32 initialFlashRadius, s32 dest
#undef tFlashRadiusDelta
#undef tClearScanlineEffect
-void sub_80B009C(u8 flashLevel)
+void AnimateFlash(u8 flashLevel)
{
u8 curFlashLevel = Overworld_GetFlashLevel();
u8 value = 0;
diff --git a/src/field_specials.c b/src/field_specials.c
index a6cd0e0d1..4057cf299 100644
--- a/src/field_specials.c
+++ b/src/field_specials.c
@@ -636,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},
@@ -644,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++)
@@ -735,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);
@@ -758,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;
diff --git a/src/scrcmd.c b/src/scrcmd.c
index efff17722..bdeee0524 100644
--- a/src/scrcmd.c
+++ b/src/scrcmd.c
@@ -607,7 +607,7 @@ bool8 ScrCmd_incrementgamestat(struct ScriptContext *ctx)
bool8 ScrCmd_animateflash(struct ScriptContext *ctx)
{
- sub_80B009C(ScriptReadByte(ctx));
+ AnimateFlash(ScriptReadByte(ctx));
ScriptContext1_Stop();
return TRUE;
}