summaryrefslogtreecommitdiff
path: root/src/misc/script_pokemon_util_80F99CC.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/script_pokemon_util_80F99CC.c')
-rw-r--r--src/misc/script_pokemon_util_80F99CC.c65
1 files changed, 32 insertions, 33 deletions
diff --git a/src/misc/script_pokemon_util_80F99CC.c b/src/misc/script_pokemon_util_80F99CC.c
index 2b48cc0d8..f930df8e2 100644
--- a/src/misc/script_pokemon_util_80F99CC.c
+++ b/src/misc/script_pokemon_util_80F99CC.c
@@ -9,16 +9,15 @@
#include "party_menu.h"
#include "pokemon.h"
#include "pokemon_summary_screen.h"
-#include "rom4.h"
+#include "overworld.h"
#include "script.h"
#include "script_pokemon_80F9.h"
+#include "songs.h"
#include "sound.h"
#include "string_util.h"
#include "task.h"
#include "text.h"
-
-
extern u8 gPlayerPartyCount;
extern u16 gSpecialVar_0x8004;
extern u16 gSpecialVar_0x8005;
@@ -59,7 +58,7 @@ void sub_80F9A4C(void)
void sub_80F9A8C(u8 taskId)
{
- if(!gPaletteFade.active)
+ if (!gPaletteFade.active)
{
gPaletteFade.bufferTransferDisabled = 1;
OpenPartyMenu((u8) gTasks[taskId].data[0], 0);
@@ -69,10 +68,10 @@ void sub_80F9A8C(u8 taskId)
bool8 sub_80F9ACC(void)
{
- switch(EWRAM_1B000.unk264)
+ switch (EWRAM_1B000.unk264)
{
case 0:
- if(EWRAM_1B000.unk266 < gPlayerPartyCount)
+ if (EWRAM_1B000.unk266 < gPlayerPartyCount)
{
TryCreatePartyMenuMonIcon(EWRAM_1B000.unk260, EWRAM_1B000.unk266, &gPlayerParty[EWRAM_1B000.unk266]);
EWRAM_1B000.unk266++;
@@ -92,7 +91,7 @@ bool8 sub_80F9ACC(void)
EWRAM_1B000.unk264++;
break;
case 3:
- if(sub_806BD58(EWRAM_1B000.unk260, EWRAM_1B000.unk266) != 1)
+ if (sub_806BD58(EWRAM_1B000.unk260, EWRAM_1B000.unk266) != 1)
{
EWRAM_1B000.unk266++;
break;
@@ -116,7 +115,7 @@ bool8 sub_80F9ACC(void)
EWRAM_1B000.unk264++;
break;
case 7: // the only case that can return true.
- if(sub_806B58C(EWRAM_1B000.unk266) != 1)
+ if (sub_806B58C(EWRAM_1B000.unk266) != 1)
{
EWRAM_1B000.unk266++;
break;
@@ -135,9 +134,9 @@ void sub_80F9C00(void)
{
u8 i;
- for(i = 0; i < gPlayerPartyCount; i++)
+ for (i = 0; i < gPlayerPartyCount; i++)
{
- switch(sub_80AE47C(&gPlayerParty[i]))
+ switch (sub_80AE47C(&gPlayerParty[i]))
{
case 0:
case 3:
@@ -154,18 +153,18 @@ void sub_80F9C00(void)
void sub_80F9C6C(u8 var)
{
- if(!gPaletteFade.active)
+ if (!gPaletteFade.active)
{
- switch(sub_806BD80(var))
+ switch (sub_806BD80(var))
{
case 1:
- PlaySE(5);
+ PlaySE(SE_SELECT);
gUnknown_02038694 = sub_806CA38(var);
gSpecialVar_0x8004 = gUnknown_02038694;
sub_8123138(var);
break;
case 2:
- PlaySE(5);
+ PlaySE(SE_SELECT);
gUnknown_02038694 = 0xFF;
gSpecialVar_0x8004 = 0xFF;
sub_8123138(var);
@@ -176,10 +175,10 @@ void sub_80F9C6C(u8 var)
bool8 sub_80F9CE8(void) // this is the same function as sub_80F9ACC except case 6 calls a different function. why
{
- switch(EWRAM_1B000.unk264)
+ switch (EWRAM_1B000.unk264)
{
case 0:
- if(EWRAM_1B000.unk266 < gPlayerPartyCount)
+ if (EWRAM_1B000.unk266 < gPlayerPartyCount)
{
TryCreatePartyMenuMonIcon(EWRAM_1B000.unk260, EWRAM_1B000.unk266, &gPlayerParty[EWRAM_1B000.unk266]);
EWRAM_1B000.unk266++;
@@ -199,7 +198,7 @@ bool8 sub_80F9CE8(void) // this is the same function as sub_80F9ACC except case
EWRAM_1B000.unk264++;
break;
case 3:
- if(sub_806BD58(EWRAM_1B000.unk260, EWRAM_1B000.unk266) != 1)
+ if (sub_806BD58(EWRAM_1B000.unk260, EWRAM_1B000.unk266) != 1)
{
EWRAM_1B000.unk266++;
break;
@@ -223,7 +222,7 @@ bool8 sub_80F9CE8(void) // this is the same function as sub_80F9ACC except case
EWRAM_1B000.unk264++;
break;
case 7: // the only case that can return true.
- if(sub_806B58C(EWRAM_1B000.unk266) != 1)
+ if (sub_806B58C(EWRAM_1B000.unk266) != 1)
{
EWRAM_1B000.unk266++;
break;
@@ -242,9 +241,9 @@ void sub_80F9E1C(void)
{
u8 i;
- for(i = 0; i < gPlayerPartyCount; i++)
+ for (i = 0; i < gPlayerPartyCount; i++)
{
- if(!sub_8040574(&gPlayerParty[i]))
+ if (!sub_8040574(&gPlayerParty[i]))
sub_806BC3C(i, 0x9A);
else
sub_806BC3C(i, 0x8C);
@@ -253,18 +252,18 @@ void sub_80F9E1C(void)
void sub_80F9E64(u8 var)
{
- if(!gPaletteFade.active)
+ if (!gPaletteFade.active)
{
- switch(sub_806BD80(var))
+ switch (sub_806BD80(var))
{
case 1:
- PlaySE(5);
+ PlaySE(SE_SELECT);
gSpecialVar_0x8004 = sub_806CA38(var);
gSpecialVar_0x8005 = sub_8040574(&gPlayerParty[gSpecialVar_0x8004]);
sub_8123138(var);
break;
case 2:
- PlaySE(5);
+ PlaySE(SE_SELECT);
gSpecialVar_0x8004 = 0xFF;
sub_8123138(var);
}
@@ -278,23 +277,23 @@ void sub_80F9EEC(void)
gFieldCallback = sub_8080990;
}
-void sub_80F9F3C(void) // count pokemon moves
+void ScrSpecial_CountPokemonMoves(void) // count pokemon moves
{
u8 i;
gScriptResult = 0;
- for(i = 0; i < 4; i++) // checks MOVE1-MOVE4
- if(GetMonData(&gPlayerParty[gSpecialVar_0x8004], i + 13))
+ for (i = 0; i < 4; i++) // checks MOVE1-MOVE4
+ if (GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_MOVE1 + i))
gScriptResult++;
}
-void sub_80F9F84(void)
+void ScrSpecial_GetPokemonNicknameAndMoveName(void)
{
- struct Pokemon *party = &gPlayerParty[gSpecialVar_0x8004];
- u16 data = GetMonData(party, gSpecialVar_0x8005 + 13);
+ struct Pokemon *pkmn = &gPlayerParty[gSpecialVar_0x8004];
+ u16 data = GetMonData(pkmn, MON_DATA_MOVE1 + gSpecialVar_0x8005);
- GetMonNickname(party, gStringVar1);
+ GetMonNickname(pkmn, gStringVar1);
StringCopy(gStringVar2, gMoveNames[data]);
}
@@ -431,7 +430,7 @@ void sub_80FA0DC(void)
SetMonMoveSlot(&gPlayerParty[gSpecialVar_0x8004], 0, gSpecialVar_0x8005);
RemoveMonPPBonus(&gPlayerParty[gSpecialVar_0x8004], gSpecialVar_0x8005);
- for(i = gSpecialVar_0x8005; i < 3; i++)
+ for (i = gSpecialVar_0x8005; i < 3; i++)
sub_80F9FDC(&gPlayerParty[gSpecialVar_0x8004], i, i + 1);
}
@@ -440,6 +439,6 @@ void sub_80FA148(void)
struct Pokemon *party = &gPlayerParty[gSpecialVar_0x8004];
gScriptResult = 0;
- if(GetMonData(party, MON_DATA_IS_EGG))
+ if (GetMonData(party, MON_DATA_IS_EGG))
gScriptResult = 1;
}