summaryrefslogtreecommitdiff
path: root/src/scrcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scrcmd.c')
-rw-r--r--src/scrcmd.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/src/scrcmd.c b/src/scrcmd.c
index 4c8895ab8..610547dd8 100644
--- a/src/scrcmd.c
+++ b/src/scrcmd.c
@@ -27,19 +27,18 @@
#include "event_obj_lock.h"
#include "menu.h"
#include "money.h"
-#include "mossdeep_gym.h"
#include "mystery_event_script.h"
#include "palette.h"
#include "party_menu.h"
#include "pokemon_storage_system.h"
#include "random.h"
#include "overworld.h"
+#include "rotating_tile_puzzle.h"
#include "rtc.h"
#include "script.h"
#include "script_menu.h"
#include "script_movement.h"
#include "script_pokemon_80F8.h"
-#include "script_pokemon_81B9.h"
#include "shop.h"
#include "slot_machine.h"
#include "sound.h"
@@ -68,7 +67,7 @@ extern const SpecialFunc gSpecials[];
extern const u8 *gStdScripts[];
extern const u8 *gStdScripts_End[];
-void sub_809BDB4(void);
+static void CloseBrailleWindow(void);
// This is defined in here so the optimizer can't see its value when compiling
// script.c.
@@ -607,7 +606,7 @@ bool8 ScrCmd_incrementgamestat(struct ScriptContext *ctx)
bool8 ScrCmd_animateflash(struct ScriptContext *ctx)
{
- sub_80B009C(ScriptReadByte(ctx));
+ AnimateFlash(ScriptReadByte(ctx));
ScriptContext1_Stop();
return TRUE;
}
@@ -815,7 +814,7 @@ bool8 ScrCmd_warpteleport(struct ScriptContext *ctx)
return TRUE;
}
-bool8 ScrCmd_warpD7(struct ScriptContext *ctx)
+bool8 ScrCmd_warpmossdeepgym(struct ScriptContext *ctx)
{
u8 mapGroup = ScriptReadByte(ctx);
u8 mapNum = ScriptReadByte(ctx);
@@ -824,7 +823,7 @@ bool8 ScrCmd_warpD7(struct ScriptContext *ctx)
u16 y = VarGet(ScriptReadHalfword(ctx));
SetWarpDestination(mapGroup, mapNum, warpId, x, y);
- sub_80AF87C();
+ DoMossdeepGymWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}
@@ -1528,9 +1527,9 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx)
return FALSE;
}
-bool8 ScrCmd_cmdDA(struct ScriptContext *ctx)
+bool8 ScrCmd_closebraillemessage(struct ScriptContext *ctx)
{
- sub_809BDB4();
+ CloseBrailleWindow();
return FALSE;
}
@@ -1612,10 +1611,10 @@ bool8 ScrCmd_buffermovename(struct ScriptContext *ctx)
bool8 ScrCmd_buffernumberstring(struct ScriptContext *ctx)
{
u8 stringVarIndex = ScriptReadByte(ctx);
- u16 v1 = VarGet(ScriptReadHalfword(ctx));
- u8 v2 = CountDigits(v1);
+ u16 num = VarGet(ScriptReadHalfword(ctx));
+ u8 numDigits = CountDigits(num);
- ConvertIntToDecimalStringN(sScriptStringVars[stringVarIndex], v1, 0, v2);
+ ConvertIntToDecimalStringN(sScriptStringVars[stringVarIndex], num, STR_CONV_MODE_LEFT_ALIGN, numDigits);
return FALSE;
}
@@ -1930,15 +1929,15 @@ bool8 ScrCmd_setberrytree(struct ScriptContext *ctx)
bool8 ScrCmd_getpricereduction(struct ScriptContext *ctx)
{
- u16 value = VarGet(ScriptReadHalfword(ctx));
+ u16 newsKind = VarGet(ScriptReadHalfword(ctx));
- gSpecialVar_Result = GetPriceReduction(value);
+ gSpecialVar_Result = GetPriceReduction(newsKind);
return FALSE;
}
bool8 ScrCmd_choosecontestmon(struct ScriptContext *ctx)
{
- sub_81B9404();
+ ChooseContestMon();
ScriptContext1_Stop();
return TRUE;
}
@@ -2149,31 +2148,31 @@ bool8 ScrCmd_takecoins(struct ScriptContext *ctx)
return FALSE;
}
-bool8 ScrCmd_mossdeepgym1(struct ScriptContext *ctx)
+bool8 ScrCmd_moverotatingtileobjects(struct ScriptContext *ctx)
{
- u16 v1 = VarGet(ScriptReadHalfword(ctx));
+ u16 puzzleNumber = VarGet(ScriptReadHalfword(ctx));
- sMovingNpcId = MossdeepGym_MoveEvents(v1);
+ sMovingNpcId = MoveRotatingTileObjects(puzzleNumber);
return FALSE;
}
-bool8 ScrCmd_mossdeepgym2(struct ScriptContext *ctx)
+bool8 ScrCmd_turnrotatingtileobjects(struct ScriptContext *ctx)
{
- MossdeepGym_TurnEvents();
+ TurnRotatingTileObjects();
return FALSE;
}
-bool8 ScrCmd_mossdeepgym3(struct ScriptContext *ctx)
+bool8 ScrCmd_initrotatingtilepuzzle(struct ScriptContext *ctx)
{
- u16 v1 = VarGet(ScriptReadHalfword(ctx));
+ u16 isTrickHouse = VarGet(ScriptReadHalfword(ctx));
- InitMossdeepGymTiles(v1);
+ InitRotatingTilePuzzle(isTrickHouse);
return FALSE;
}
-bool8 ScrCmd_mossdeepgym4(struct ScriptContext *ctx)
+bool8 ScrCmd_freerotatingtilepuzzle(struct ScriptContext *ctx)
{
- FinishMossdeepGymTiles();
+ FreeRotatingTilePuzzle();
return FALSE;
}
@@ -2218,6 +2217,8 @@ bool8 ScrCmd_checkmonobedience(struct ScriptContext *ctx)
return FALSE;
}
+// TODO: Should be renamed. Name implies general usage, but its specifically for Wonder Card
+// See GetSavedRamScriptIfValid, which is NULL if ValidateReceivedWonderCard returns FALSE
bool8 ScrCmd_gotoram(struct ScriptContext *ctx)
{
const u8* v1 = GetSavedRamScriptIfValid();
@@ -2255,7 +2256,7 @@ bool8 ScrCmd_setmonmetlocation(struct ScriptContext *ctx)
return FALSE;
}
-void sub_809BDB4(void)
+static void CloseBrailleWindow(void)
{
ClearStdWindowAndFrame(gBrailleWindowId, 1);
RemoveWindow(gBrailleWindowId);
@@ -2279,7 +2280,7 @@ bool8 ScrCmd_buffertrainername(struct ScriptContext *ctx)
return FALSE;
}
-void sub_809BE48(u16 npcId)
+void SetMovingNpcId(u16 npcId)
{
sMovingNpcId = npcId;
}