From 7eb178c36e5d4c5dba5f600346228969f4e33b9a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Mar 2018 08:49:22 -0400 Subject: Start decompiling contest_effect --- src/contest_effect.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/contest_effect.c (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c new file mode 100644 index 000000000..f1606517b --- /dev/null +++ b/src/contest_effect.c @@ -0,0 +1,33 @@ +#include "global.h" +#include "ewram.h" +#include "contest.h" + +extern bool8 const gComboStarterLookupTable[]; + +bool8 AreMovesContestCombo(u16 lastMove, u16 nextMove) { + u8 nextMoveComboMoves[4]; + u8 lastMoveComboStarterId = gContestMoves[lastMove].comboStarterId; + nextMoveComboMoves[0] = gContestMoves[nextMove].comboMoves[0]; + nextMoveComboMoves[1] = gContestMoves[nextMove].comboMoves[1]; + nextMoveComboMoves[2] = gContestMoves[nextMove].comboMoves[2]; + nextMoveComboMoves[3] = gContestMoves[nextMove].comboMoves[3]; + + if (lastMoveComboStarterId == 0) + return 0; + + if (lastMoveComboStarterId == nextMoveComboMoves[0] || lastMoveComboStarterId == nextMoveComboMoves[1] || lastMoveComboStarterId == nextMoveComboMoves[2] || lastMoveComboStarterId == nextMoveComboMoves[3]) + return gComboStarterLookupTable[lastMoveComboStarterId]; + + return 0; +} + +void ContestEffect_00(void) +{ +} + +void ContestEffect_01(void) +{ + sContestantStatus[shared192D0.unk11].unk10_2 = TRUE; + sub_80B13EC(shared192D0.unk11, 0); +} + -- cgit v1.2.3 From 8a61d647fc81ca392dbcf7458db5b528a1a744a6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Mar 2018 10:24:30 -0400 Subject: through ContestEffect_08 --- src/contest_effect.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index f1606517b..abc630dd8 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -2,8 +2,12 @@ #include "ewram.h" #include "contest.h" +u8 sub_80B9120(void); + extern bool8 const gComboStarterLookupTable[]; +#define curContestant (&sContestantStatus[shared192D0.unk11]) + bool8 AreMovesContestCombo(u16 lastMove, u16 nextMove) { u8 nextMoveComboMoves[4]; u8 lastMoveComboStarterId = gContestMoves[lastMove].comboStarterId; @@ -27,7 +31,61 @@ void ContestEffect_00(void) void ContestEffect_01(void) { - sContestantStatus[shared192D0.unk11].unk10_2 = TRUE; - sub_80B13EC(shared192D0.unk11, 0); + curContestant->unk10_2 = TRUE; + SetContestantStatusUnk13(shared192D0.unk11, 0); +} + +void ContestEffect_02(void) +{ + curContestant->unk11_3 = TRUE; + SetContestantStatusUnk13(shared192D0.unk11, 1); +} + +void ContestEffect_03(void) +{ + curContestant->unk10_3 = TRUE; + curContestant->disappointedRepeat = FALSE; + curContestant->moveRepeatCount = 0; +} + +void ContestEffect_04(void) +{ + curContestant->unk12 = 1; + SetContestantStatusUnk13(shared192D0.unk11, 2); } +void ContestEffect_05(void) +{ + curContestant->unk10_1 = TRUE; + SetContestantStatusUnk13(shared192D0.unk11, 3); +} + +void ContestEffect_06(void) +{ + curContestant->unkF = 20; + SetContestantStatusUnk13(shared192D0.unk11, 4); +} + +void ContestEffect_07(void) +{ + curContestant->unk10_0 = TRUE; + SetContestantStatusUnk13(shared192D0.unk11, 5); +} + +void ContestEffect_08(void) +{ + u8 idx = 0; + u8 a = shared192D0.unk11; + + if (shared192D0.unk0[a] != 0) { + int i; + for (i = 0; i < 4 && shared192D0.unk0[a] - 1 != shared192D0.unk0[i]; i++) + ; + shared192D0.unk8 = i; + shared192D0.unk9 = 0xFF; + idx = sub_80B9120(); + } + if (idx == 0) + SetContestantStatusUnk14(shared192D0.unk11, 0x36); + SetContestantStatusUnk13(shared192D0.unk11, 48); +} -- cgit v1.2.3 From a8c57a0dd6cf3e3759dda41f7f2c6d89173262e7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Mar 2018 11:12:55 -0400 Subject: through ContestEffect_16 --- src/contest_effect.c | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 2 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index abc630dd8..60dd2f320 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -1,8 +1,10 @@ #include "global.h" #include "ewram.h" +#include "random.h" #include "contest.h" u8 sub_80B9120(void); +bool8 sub_80B90C0(u8); extern bool8 const gComboStarterLookupTable[]; @@ -79,13 +81,124 @@ void ContestEffect_08(void) if (shared192D0.unk0[a] != 0) { int i; + for (i = 0; i < 4 && shared192D0.unk0[a] - 1 != shared192D0.unk0[i]; i++) ; - shared192D0.unk8 = i; - shared192D0.unk9 = 0xFF; + shared192D0.unk8[0] = i; + shared192D0.unk8[1] = 0xFF; + idx = sub_80B9120(); + } + if (idx == 0) + SetContestantStatusUnk14(shared192D0.unk11, 0x36); + SetContestantStatusUnk13(shared192D0.unk11, 48); +} + +void ContestEffect_09(void) +{ + u8 idx = 0; + u8 a = shared192D0.unk11; + + if (shared192D0.unk0[a] != 0) { + int i; + int j = 0; + + for (i = 0; i < 4; i++) + if (shared192D0.unk0[a] > shared192D0.unk0[i]) + shared192D0.unk8[j++] = i; + shared192D0.unk8[j] = 0xFF; idx = sub_80B9120(); } if (idx == 0) SetContestantStatusUnk14(shared192D0.unk11, 0x36); SetContestantStatusUnk13(shared192D0.unk11, 48); } + +void ContestEffect_14(void) +{ + u8 r0 = Random() % 10; + int r1 = 20; + if (r0 >= 2) + { + r1 = 60; + if (r0 < 8) + r1 = 40; + } + shared192D0.unk4 = r1; + ContestEffect_08(); +} + +void ContestEffect_15(void) { + u8 r7 = 0; + u8 r6 = shared192D0.unk11; + + if (shared192D0.unk0[r6] != 0) + { + int r5; + + for (r5 = 0; r5 < 4; r5++) + { + if (shared192D0.unk0[r6] > shared192D0.unk0[r5]) + { + shared192D0.unk8[0] = r5; + shared192D0.unk8[1] = 0xFF; + { + u8 r0 = Random() % 10; + int r1 = 0; + if (r0 > 0) + { + r1 = 10; + if (r0 > 2) + { + r1 = 20; + if (r0 > 4) + { + r1 = 30; + if (r0 > 6) + { + r1 = 60; + if (r0 <= 8) + r1 = 40; + } + } + } + } + shared192D0.unk4 = r1; + } + if (sub_80B9120()) + r7++; + } + } + } + SetContestantStatusUnk13(shared192D0.unk11, 48); + if (r7 == 0) + SetContestantStatusUnk14(shared192D0.unk11, 0x36); +} + +void ContestEffect_16(void) +{ + bool32 r9 = FALSE; + u8 r7 = shared192D0.unk11; + + if (shared192D0.unk0[shared192D0.unk11] != 0) + { + int r6; + + for (r6 = 0; r6 < 4; r6++) + { + if (shared192D0.unk0[r7] > shared192D0.unk0[r6] && + sContestantStatus[r6].unk15_4 && + sub_80B90C0(r6)) + { + sContestantStatus[r6].unk15_4 = FALSE; + sContestantStatus[r6].unk15_5 = TRUE; + SetContestantStatusUnk13(r6, 8); + r9 = TRUE; + } + } + } + SetContestantStatusUnk13(shared192D0.unk11, 7); + if (!r9) + { + SetContestantStatusUnk14(shared192D0.unk11, 0x36); + } +} -- cgit v1.2.3 From af266c9e1bc286e80a451db7e2f95116655a4827 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Mar 2018 11:43:53 -0400 Subject: through ContestEffect_24 --- src/contest_effect.c | 114 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 91 insertions(+), 23 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 60dd2f320..7a6ffc0b0 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -5,6 +5,7 @@ u8 sub_80B9120(void); bool8 sub_80B90C0(u8); +void sub_80B9038(u8); extern bool8 const gComboStarterLookupTable[]; @@ -117,12 +118,12 @@ void ContestEffect_14(void) { u8 r0 = Random() % 10; int r1 = 20; - if (r0 >= 2) - { + if (r0 < 2) + r1 = 20; + else if (r0 < 8) + r1 = 40; + else r1 = 60; - if (r0 < 8) - r1 = 40; - } shared192D0.unk4 = r1; ContestEffect_08(); } @@ -143,25 +144,19 @@ void ContestEffect_15(void) { shared192D0.unk8[1] = 0xFF; { u8 r0 = Random() % 10; - int r1 = 0; - if (r0 > 0) - { + int r1; + if (r0 == 0) + r1 = 0; + else if (r0 <= 2) r1 = 10; - if (r0 > 2) - { - r1 = 20; - if (r0 > 4) - { - r1 = 30; - if (r0 > 6) - { - r1 = 60; - if (r0 <= 8) - r1 = 40; - } - } - } - } + else if (r0 <= 4) + r1 = 20; + else if (r0 <= 6) + r1 = 30; + else if (r0 <= 8) + r1 = 40; + else + r1 = 60; shared192D0.unk4 = r1; } if (sub_80B9120()) @@ -202,3 +197,76 @@ void ContestEffect_16(void) SetContestantStatusUnk14(shared192D0.unk11, 0x36); } } + +void ContestEffect_17(void) +{ + u8 r9 = 0; + u8 r8 = shared192D0.unk11; + + if (shared192D0.unk0[shared192D0.unk11] != 0) + { + int r5; + + for (r5 = 0; r5 < 4; r5++) + { + if (shared192D0.unk0[r8] > shared192D0.unk0[r5]) + { + if (sContestantStatus[r5].unk15_4) + shared192D0.unk4 = 50; + else + shared192D0.unk4 = 10; + shared192D0.unk8[0] = r5; + shared192D0.unk8[1] = 0xFF; + if (sub_80B9120()) + r9++; + } + } + } + SetContestantStatusUnk13(shared192D0.unk11, 48); + if (r9 == 0) + SetContestantStatusUnk14(shared192D0.unk11, 0x36); +} + +void ContestEffect_18(void) +{ + curContestant->unk11_2 = TRUE; + ContestEffect_09(); + SetContestantStatusUnk13(shared192D0.unk11, 48); +} + +void ContestEffect_19(void) +{ + u16 move = curContestant->currMove; + sub_80B9038(gContestMoves[move].contestCategory); + SetContestantStatusUnk13(shared192D0.unk11, 48); +} + +void ContestEffect_20(void) +{ + sub_80B9038(CONTEST_CATEGORY_COOL); + SetContestantStatusUnk13(shared192D0.unk11, 48); +} + +void ContestEffect_21(void) +{ + sub_80B9038(CONTEST_CATEGORY_BEAUTY); + SetContestantStatusUnk13(shared192D0.unk11, 48); +} + +void ContestEffect_22(void) +{ + sub_80B9038(CONTEST_CATEGORY_CUTE); + SetContestantStatusUnk13(shared192D0.unk11, 48); +} + +void ContestEffect_23(void) +{ + sub_80B9038(CONTEST_CATEGORY_SMART); + SetContestantStatusUnk13(shared192D0.unk11, 48); +} + +void ContestEffect_24(void) +{ + sub_80B9038(CONTEST_CATEGORY_TOUGH); + SetContestantStatusUnk13(shared192D0.unk11, 48); +} -- cgit v1.2.3 From 18e6512599ad5a52ee0046f2504a7b357cc80894 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Mar 2018 12:01:29 -0400 Subject: ContestEffect_25 --- src/contest_effect.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 7a6ffc0b0..c38cb2f96 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -270,3 +270,34 @@ void ContestEffect_24(void) sub_80B9038(CONTEST_CATEGORY_TOUGH); SetContestantStatusUnk13(shared192D0.unk11, 48); } + +void ContestEffect_25(void) +{ + bool32 r4 = FALSE; + + if (shared192D0.unk0[shared192D0.unk11] != 3) + { + int r5; + + for (r5 = 0; r5 < 4; r5++) + { + if (shared192D0.unk0[shared192D0.unk11] + 1 == shared192D0.unk0[r5]) + { + if (sub_80B90C0(r5)) + { + sub_80B157C(r5); + SetContestantStatusUnk13(r5, 10); + r4 = TRUE; + } + else + { + SetContestantStatusUnk13(r5, 60); + r4 = TRUE; + } + } + } + } + SetContestantStatusUnk13(shared192D0.unk11, 9); + if (!r4) + SetContestantStatusUnk14(shared192D0.unk11, 0x36); +} -- cgit v1.2.3 From 90556b6b3eabc0a90cf7fdcf54826e362053f4c0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Mar 2018 15:50:16 -0400 Subject: ContestEffect_26 --- src/contest_effect.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index c38cb2f96..bbd56493b 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -301,3 +301,78 @@ void ContestEffect_25(void) if (!r4) SetContestantStatusUnk14(shared192D0.unk11, 0x36); } + +void ContestEffect_26(void) +{ + u8 r9 = 0; + bool32 sp18 = FALSE; + u8 sp00[5]; + int r6; + int r4; + s16 sp08[4]; + s16 sp10[4]; + + memset(sp00, 0xFF, ARRAY_COUNT(sp00)); + for (r6 = 0, r4 = 0; r6 < 4; r6++) + { + if (shared192D0.unk0[shared192D0.unk11] < shared192D0.unk0[r6] && + !sContestantStatus[r6].unkC_0 && !Contest_IsMonsTurnDisabled(r6)) + sp00[r4++] = r6; + } + + if (r4 == 1) + { + sp10[0] = 60; + } + else if (r4 == 2) + { + sp10[0] = 30; + sp10[1] = 30; + } + else if (r4 == 3) + { + sp10[0] = 20; + sp10[1] = 20; + sp10[2] = 20; + } + else + { + for (r6 = 0; r6 < 4; r6++) + sp10[r6] = 0; + } + for (r6 = 0; r6 < 4; r6++) + { + if (sContestantStatus[r6].unk15_4 && sub_80B214C(r6)) + sp08[r6] = gComboStarterLookupTable[gContestMoves[sContestantStatus[r6].prevMove].comboStarterId] * 10; + else + sp08[r6] = 0; + sp08[r6] -= (sContestantStatus[r6].unkD / 10) * 10; + } + if (sp10[0] != 0) + { + for (r6 = 0; sp00[r6] != 0xFF; r6++) + { + if (Random() % 100 < sp10[r6] + sp08[sp00[r6]]) + { + if (sub_80B90C0(sp00[r6])) + { + sub_80B157C(sp00[r6]); + SetContestantStatusUnk13(sp00[r6], 10); + r9++; + } else + sp18 = TRUE; + } else + sp18 = TRUE; + if (sp18) + { + sp18 = FALSE; + SetContestantStatusUnk13(sp00[r6], 60); + r9++; + } + shared192D0.unkD[sp00[r6]] = 1; + } + } + SetContestantStatusUnk13(shared192D0.unk11, 11); + if (r9 == 0) + SetContestantStatusUnk14(shared192D0.unk11, 0x36); +} -- cgit v1.2.3 From d66f96520c03faf342e04502aa94462f14d3701d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Mar 2018 16:48:14 -0400 Subject: through ContestEffect_30 --- src/contest_effect.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index bbd56493b..546ab0fc8 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -376,3 +376,70 @@ void ContestEffect_26(void) if (r9 == 0) SetContestantStatusUnk14(shared192D0.unk11, 0x36); } + +void ContestEffect_27(void) +{ + u8 r8 = 0; + int r6; + + for (r6 = 0; r6 < 4; r6++) + { + if (shared192D0.unk0[shared192D0.unk11] > shared192D0.unk0[r6] && + sContestantStatus[r6].unkD > 0 && + sub_80B90C0(r6)) + { + sContestantStatus[r6].unkD = 0; + sContestantStatus[r6].unk10_4 = 2; + SetContestantStatusUnk13(r6, 13); + r8++; + } + } + + SetContestantStatusUnk13(shared192D0.unk11, 12); + if (r8 == 0) + SetContestantStatusUnk14(shared192D0.unk11, 0x39); +} + +void ContestEffect_28(void) +{ + u8 r7 = 0; + int r5; + + for (r5 = 0; r5 < 4; r5++) + { + if (shared192D0.unk0[shared192D0.unk11] > shared192D0.unk0[r5]) + { + if (sContestantStatus[r5].unkD > 0) + shared192D0.unk4 = 40; + else + shared192D0.unk4 = 10; + shared192D0.unk8[0] = r5; + shared192D0.unk8[1] = 0xFF; + if (sub_80B9120()) + r7++; + } + } + SetContestantStatusUnk13(shared192D0.unk11, 14); + if (r7 == 0) + SetContestantStatusUnk14(shared192D0.unk11, 0x39); +} + +void ContestEffect_29(void) +{ + if (gUnknown_02038696[shared192D0.unk11] == 0) + { + u16 move = curContestant->currMove; + curContestant->appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal; + SetContestantStatusUnk13(shared192D0.unk11, 15); + } +} + +void ContestEffect_30(void) +{ + if (gUnknown_02038696[shared192D0.unk11] == 3) + { + u16 move = curContestant->currMove; + curContestant->appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal; + SetContestantStatusUnk13(shared192D0.unk11, 16); + } +} -- cgit v1.2.3 From f03b1700f867164cfbaf337821503a83fa7272b7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Mar 2018 17:19:59 -0400 Subject: through ContestEffect_33 --- src/contest_effect.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 546ab0fc8..415732003 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -6,6 +6,7 @@ u8 sub_80B9120(void); bool8 sub_80B90C0(u8); void sub_80B9038(u8); +s16 sub_80B9224(s16); extern bool8 const gComboStarterLookupTable[]; @@ -443,3 +444,64 @@ void ContestEffect_30(void) SetContestantStatusUnk13(shared192D0.unk11, 16); } } + +void ContestEffect_31(void) +{ + int r1; + int r3; + + for (r1 = 0, r3 = 0; r1 < 4; r1++) + { + if (shared192D0.unk0[shared192D0.unk11] > shared192D0.unk0[r1]) + r3 += sContestantStatus[r1].appeal2; + } + if (r3 < 0) + r3 = 0; + if (shared192D0.unk0[shared192D0.unk11] == 0 || r3 == 0) + SetContestantStatusUnk13(shared192D0.unk11, 18); + else + { + curContestant->appeal2 += r3 / 2; + SetContestantStatusUnk13(shared192D0.unk11, 17); + } + sContestantStatus[shared192D0.unk11].appeal2 = sub_80B9224(sContestantStatus[shared192D0.unk11].appeal2); +} + +void ContestEffect_32(void) +{ + s16 r6 = 0; + + if (shared192D0.unk0[shared192D0.unk11] != 0) + { + int i; + for (i = 0; i < 4; i++) + { + if (shared192D0.unk0[shared192D0.unk11] - 1 == shared192D0.unk0[i]) + r6 = sContestantStatus[i].appeal2; + } + } + if (shared192D0.unk0[shared192D0.unk11] == 0 || r6 <= 0) + SetContestantStatusUnk13(shared192D0.unk11, 20); + else + { + curContestant->appeal2 += r6; + SetContestantStatusUnk13(shared192D0.unk11, 19); + } +} + +void ContestEffect_33(void) +{ + u8 r3 = shared192D0.unk0[shared192D0.unk11]; + if (r3 == 0) + sContestantStatus[shared192D0.unk11].appeal2 = 10; + else + sContestantStatus[shared192D0.unk11].appeal2 = 20 * r3; + if (r3 == 0) + SetContestantStatusUnk13(shared192D0.unk11, 21); + else if (r3 == 1) + SetContestantStatusUnk13(shared192D0.unk11, 22); + else if (r3 == 2) + SetContestantStatusUnk13(shared192D0.unk11, 23); + else + SetContestantStatusUnk13(shared192D0.unk11, 24); +} -- cgit v1.2.3 From d0b42dd4ea1ae0c0d1cc33207718e8e07c3f5763 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Mar 2018 17:33:23 -0400 Subject: ContestEffect_34 --- src/contest_effect.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 415732003..86eb78dac 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -505,3 +505,33 @@ void ContestEffect_33(void) else SetContestantStatusUnk13(shared192D0.unk11, 24); } + +void ContestEffect_34(void) +{ + u8 r0 = Random() % 10; + s16 r4; + + if (r0 < 3) + { + r4 = 10; + SetContestantStatusUnk13(shared192D0.unk11, 26); + } else if (r0 < 6) + { + r4 = 20; + SetContestantStatusUnk13(shared192D0.unk11, 27); + } else if (r0 < 8) + { + r4 = 40; + SetContestantStatusUnk13(shared192D0.unk11, 28); + } else if (r0 < 9) + { + r4 = 60; + SetContestantStatusUnk13(shared192D0.unk11, 29); + } + else + { + r4 = 80; + SetContestantStatusUnk13(shared192D0.unk11, 30); + } + curContestant->appeal2 = r4; +} -- cgit v1.2.3 From b7b58d04f074f4f30aaa22a630f0c25d4550a440 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 29 Mar 2018 22:08:43 -0400 Subject: ContestEffect_35 (not even close) --- src/contest_effect.c | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 86eb78dac..83ac56a14 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -535,3 +535,147 @@ void ContestEffect_34(void) } curContestant->appeal2 = r4; } + +#ifdef NONMATCHING +// Not even close, send help +void ContestEffect_35(void) +{ + s8 r4; + + for (r4 = shared192D0.unk0[shared192D0.unk11] - 1; r4 >= 0; r4--) + { + s8 r2; + for (r2 = 0; r2 < 4; r2++) + { + if (shared192D0.unk0[r2] == r4) + break; + } + if (!(sContestantStatus[r2].unkB_7 || sContestantStatus[r2].unkC_0 || sContestantStatus[r2].unkC_1)) + { + u16 move = curContestant->currMove; + const struct ContestMove *contestMove = gContestMoves + move; + if (contestMove->contestCategory == gContestMoves[sContestantStatus[r2].currMove].contestCategory) + { + curContestant->appeal2 += gContestEffects[contestMove->effect].appeal * 2; + SetContestantStatusUnk13(shared192D0.unk11, 31); + } + break; + } + } +} +#else +__attribute__((naked)) void ContestEffect_35(void) +{ + asm_unified("\tpush {r4-r7,lr}\n" + "\tldr r1, _080B8940 @ =gSharedMem + 0x192D0\n" + "\tldrb r0, [r1, 0x11]\n" + "\tadds r0, r1\n" + "\tmovs r2, 0\n" + "\tldrsb r2, [r0, r2]\n" + "\tsubs r0, r2, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r4, r0, 24\n" + "\tmov r12, r1\n" + "\tcmp r2, 0\n" + "\tbeq _080B8994\n" + "\tldrb r5, [r1]\n" + "\tmov r6, r12\n" + "\tsubs r6, 0x70\n" + "_080B88EA:\n" + "\tmovs r2, 0\n" + "\tlsls r0, r4, 24\n" + "\tasrs r1, r0, 24\n" + "\tadds r4, r0, 0\n" + "\tcmp r5, r1\n" + "\tbeq _080B8910\n" + "\tldr r3, _080B8940 @ =gSharedMem + 0x192D0\n" + "_080B88F8:\n" + "\tlsls r0, r2, 24\n" + "\tmovs r2, 0x80\n" + "\tlsls r2, 17\n" + "\tadds r0, r2\n" + "\tlsrs r2, r0, 24\n" + "\tasrs r0, 24\n" + "\tcmp r0, 0x3\n" + "\tbgt _080B8910\n" + "\tadds r0, r3\n" + "\tldrb r0, [r0]\n" + "\tcmp r0, r1\n" + "\tbne _080B88F8\n" + "_080B8910:\n" + "\tlsls r2, 24\n" + "\tasrs r1, r2, 24\n" + "\tlsls r0, r1, 3\n" + "\tsubs r0, r1\n" + "\tlsls r0, 2\n" + "\tadds r3, r0, r6\n" + "\tldrb r1, [r3, 0xB]\n" + "\tmovs r0, 0x80\n" + "\tands r0, r1\n" + "\tadds r7, r2, 0\n" + "\tcmp r0, 0\n" + "\tbne _080B8932\n" + "\tldrb r1, [r3, 0xC]\n" + "\tmovs r0, 0x7\n" + "\tands r0, r1\n" + "\tcmp r0, 0\n" + "\tbeq _080B8944\n" + "_080B8932:\n" + "\tmovs r1, 0xFF\n" + "\tlsls r1, 24\n" + "\tadds r0, r4, r1\n" + "\tlsrs r4, r0, 24\n" + "\tcmp r0, 0\n" + "\tblt _080B8994\n" + "\tb _080B88EA\n" + "\t.align 2, 0\n" + "_080B8940: .4byte gSharedMem + 0x192D0\n" + "_080B8944:\n" + "\tmov r2, r12\n" + "\tldrb r1, [r2, 0x11]\n" + "\tlsls r0, r1, 3\n" + "\tsubs r0, r1\n" + "\tlsls r0, 2\n" + "\tmov r3, r12\n" + "\tsubs r3, 0x70\n" + "\tadds r5, r0, r3\n" + "\tldrh r0, [r5, 0x6]\n" + "\tldr r4, _080B899C @ =gContestMoves\n" + "\tlsls r0, 3\n" + "\tadds r6, r0, r4\n" + "\tldrb r2, [r6, 0x1]\n" + "\tlsls r2, 29\n" + "\tasrs r1, r7, 24\n" + "\tlsls r0, r1, 3\n" + "\tsubs r0, r1\n" + "\tlsls r0, 2\n" + "\tadds r0, r3\n" + "\tldrh r0, [r0, 0x6]\n" + "\tlsls r0, 3\n" + "\tadds r0, r4\n" + "\tldrb r0, [r0, 0x1]\n" + "\tlsls r0, 29\n" + "\tcmp r2, r0\n" + "\tbne _080B8994\n" + "\tldr r1, _080B89A0 @ =gContestEffects\n" + "\tldrb r0, [r6]\n" + "\tlsls r0, 2\n" + "\tadds r0, r1\n" + "\tldrb r0, [r0, 0x1]\n" + "\tlsls r0, 1\n" + "\tldrh r1, [r5, 0x2]\n" + "\tadds r0, r1\n" + "\tstrh r0, [r5, 0x2]\n" + "\tmov r2, r12\n" + "\tldrb r0, [r2, 0x11]\n" + "\tmovs r1, 0x1F\n" + "\tbl SetContestantStatusUnk13\n" + "_080B8994:\n" + "\tpop {r4-r7}\n" + "\tpop {r0}\n" + "\tbx r0\n" + "\t.align 2, 0\n" + "_080B899C: .4byte gContestMoves\n" + "_080B89A0: .4byte gContestEffects"); +} +#endif -- cgit v1.2.3 From f1bae90be3aca017e19776c26906ddfd13147c0f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Mar 2018 08:46:22 -0400 Subject: through ContestEffect_38 --- src/contest_effect.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 83ac56a14..1d4f9d448 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -679,3 +679,60 @@ __attribute__((naked)) void ContestEffect_35(void) "_080B89A0: .4byte gContestEffects"); } #endif + +void ContestEffect_36(void) +{ + if (shared192D0.unk0[shared192D0.unk11] != 0) + { + u16 move = curContestant->currMove; + int i; + + for (i = 0; i < 4; i++) + { + if (shared192D0.unk0[shared192D0.unk11] - 1 == shared192D0.unk0[i] && + gContestMoves[move].contestCategory != gContestMoves[sContestantStatus[i].currMove].contestCategory) + { + curContestant->appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2; + SetContestantStatusUnk13(shared192D0.unk11, 32); + break; + } + } + } +} + +void ContestEffect_37(void) +{ + if (shared192D0.unk0[shared192D0.unk11] != 0) + { + int i; + + for (i = 0; i < 4; i++) + { + if (shared192D0.unk0[shared192D0.unk11] - 1 == shared192D0.unk0[i]) + { + if (curContestant->appeal2 > sContestantStatus[i].appeal2) + { + curContestant->appeal2 *= 2; + SetContestantStatusUnk13(shared192D0.unk11, 33); + } + else if (curContestant->appeal2 < sContestantStatus[i].appeal2) + { + curContestant->appeal2 = 0; + SetContestantStatusUnk13(shared192D0.unk11, 34); + } + } + } + } +} + +void ContestEffect_38(void) +{ + if (curContestant->unkD < 30) + { + curContestant->unkD += 10; + curContestant->unk10_4 = 1; + SetContestantStatusUnk13(shared192D0.unk11, 35); + } + else + SetContestantStatusUnk13(shared192D0.unk11, 58); +} -- cgit v1.2.3 From b71650219f89ce9d7de6d9377b9cd7c47e975b4d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Mar 2018 10:42:20 -0400 Subject: through ContestEffect_40 --- src/contest_effect.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 1d4f9d448..fe6b18d99 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -736,3 +736,53 @@ void ContestEffect_38(void) else SetContestantStatusUnk13(shared192D0.unk11, 58); } + +void ContestEffect_39(void) +{ + curContestant->unk11_5 = TRUE; + if (curContestant->unkD != 0) + SetContestantStatusUnk13(shared192D0.unk11, 36); + else + SetContestantStatusUnk13(shared192D0.unk11, 59); +} + +void ContestEffect_40(void) +{ + s8 i; + s8 j; + u8 sp00[4]; + + if (sContest.turnNumber != 4) + { + for (i = 0; i < 4; i++) + sp00[i] = sContestantStatus[i].unk19; + + sp00[shared192D0.unk11] = 0xFF; + + for (i = 0; i < 4; i++) + { + for (j = 0; j < 4; j++) + { + if (j != shared192D0.unk11 && + i == sp00[j] && + sp00[j] == sContestantStatus[j].unk19) + { + sp00[j]++; + break; + } + } + if (j == 4) + break; + } + + sp00[shared192D0.unk11] = 0; + curContestant->unk10_6 = 1; + + for (i = 0; i < 4; i++) + { + sContestantStatus[i].unk19 = sp00[i]; + } + curContestant->unk11_0 = 1; + SetContestantStatusUnk13(shared192D0.unk11, 37); + } +} -- cgit v1.2.3 From b125a4057419ab9efe6dbd1e911abd5de2200b9b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Mar 2018 12:26:28 -0400 Subject: through ContestEffect_43 --- src/contest_effect.c | 153 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 144 insertions(+), 9 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index fe6b18d99..c484882ff 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -30,22 +30,26 @@ bool8 AreMovesContestCombo(u16 lastMove, u16 nextMove) { } void ContestEffect_00(void) +// A highly appealing move. { } void ContestEffect_01(void) +// After this move, the user is more easily startled. { curContestant->unk10_2 = TRUE; SetContestantStatusUnk13(shared192D0.unk11, 0); } void ContestEffect_02(void) +// Makes a great appeal, but allows no more to the end. { curContestant->unk11_3 = TRUE; SetContestantStatusUnk13(shared192D0.unk11, 1); } void ContestEffect_03(void) +// Can be used repeatedly without boring the JUDGE. { curContestant->unk10_3 = TRUE; curContestant->disappointedRepeat = FALSE; @@ -53,30 +57,35 @@ void ContestEffect_03(void) } void ContestEffect_04(void) +// Can avoid being startled by others once. { curContestant->unk12 = 1; SetContestantStatusUnk13(shared192D0.unk11, 2); } void ContestEffect_05(void) +// Can avoid being startled by others. { curContestant->unk10_1 = TRUE; SetContestantStatusUnk13(shared192D0.unk11, 3); } void ContestEffect_06(void) +// Can avoid being startled by others a little. { curContestant->unkF = 20; SetContestantStatusUnk13(shared192D0.unk11, 4); } void ContestEffect_07(void) +// After this move, the user is less likely to be startled. { curContestant->unk10_0 = TRUE; SetContestantStatusUnk13(shared192D0.unk11, 5); } void ContestEffect_08(void) +// Slightly startles the POKéMON in front. { u8 idx = 0; u8 a = shared192D0.unk11; @@ -84,8 +93,11 @@ void ContestEffect_08(void) if (shared192D0.unk0[a] != 0) { int i; - for (i = 0; i < 4 && shared192D0.unk0[a] - 1 != shared192D0.unk0[i]; i++) - ; + for (i = 0; i < 4; i++) + { + if (shared192D0.unk0[a] - 1 == shared192D0.unk0[i]) + break; + } shared192D0.unk8[0] = i; shared192D0.unk8[1] = 0xFF; idx = sub_80B9120(); @@ -96,6 +108,7 @@ void ContestEffect_08(void) } void ContestEffect_09(void) +// Slightly startles those that have made appeals. { u8 idx = 0; u8 a = shared192D0.unk11; @@ -116,6 +129,7 @@ void ContestEffect_09(void) } void ContestEffect_14(void) +// Startles the POKéMON that appealed before the user. { u8 r0 = Random() % 10; int r1 = 20; @@ -129,7 +143,9 @@ void ContestEffect_14(void) ContestEffect_08(); } -void ContestEffect_15(void) { +void ContestEffect_15(void) +// Startles all POKéMON that appealed before the user. +{ u8 r7 = 0; u8 r6 = shared192D0.unk11; @@ -171,6 +187,7 @@ void ContestEffect_15(void) { } void ContestEffect_16(void) +// Shifts the JUDGE’s attention from others. { bool32 r9 = FALSE; u8 r7 = shared192D0.unk11; @@ -200,6 +217,7 @@ void ContestEffect_16(void) } void ContestEffect_17(void) +// Startles the POKéMON that has the JUDGE’s attention. { u8 r9 = 0; u8 r8 = shared192D0.unk11; @@ -229,6 +247,7 @@ void ContestEffect_17(void) } void ContestEffect_18(void) +// Jams the others, and misses one turn of appeals. { curContestant->unk11_2 = TRUE; ContestEffect_09(); @@ -236,6 +255,7 @@ void ContestEffect_18(void) } void ContestEffect_19(void) +// Startles POKéMON that made a same-type appeal. { u16 move = curContestant->currMove; sub_80B9038(gContestMoves[move].contestCategory); @@ -243,36 +263,42 @@ void ContestEffect_19(void) } void ContestEffect_20(void) +// Badly startles POKéMON that made COOL appeals. { sub_80B9038(CONTEST_CATEGORY_COOL); SetContestantStatusUnk13(shared192D0.unk11, 48); } void ContestEffect_21(void) +// Badly startles POKéMON that made BEAUTY appeals. { sub_80B9038(CONTEST_CATEGORY_BEAUTY); SetContestantStatusUnk13(shared192D0.unk11, 48); } void ContestEffect_22(void) +// Badly startles POKéMON that made CUTE appeals. { sub_80B9038(CONTEST_CATEGORY_CUTE); SetContestantStatusUnk13(shared192D0.unk11, 48); } void ContestEffect_23(void) +// Badly startles POKéMON that made SMART appeals. { sub_80B9038(CONTEST_CATEGORY_SMART); SetContestantStatusUnk13(shared192D0.unk11, 48); } void ContestEffect_24(void) +// Badly startles POKéMON that made TOUGH appeals. { sub_80B9038(CONTEST_CATEGORY_TOUGH); SetContestantStatusUnk13(shared192D0.unk11, 48); } void ContestEffect_25(void) +// Makes one POKéMON after the user nervous. { bool32 r4 = FALSE; @@ -304,6 +330,7 @@ void ContestEffect_25(void) } void ContestEffect_26(void) +// Makes all POKéMON after the user nervous. { u8 r9 = 0; bool32 sp18 = FALSE; @@ -379,6 +406,7 @@ void ContestEffect_26(void) } void ContestEffect_27(void) +// Worsens the condition of those that made appeals. { u8 r8 = 0; int r6; @@ -402,6 +430,7 @@ void ContestEffect_27(void) } void ContestEffect_28(void) +// Badly startles POKéMON in good condition. { u8 r7 = 0; int r5; @@ -426,6 +455,7 @@ void ContestEffect_28(void) } void ContestEffect_29(void) +// The appeal works great if performed first. { if (gUnknown_02038696[shared192D0.unk11] == 0) { @@ -436,6 +466,7 @@ void ContestEffect_29(void) } void ContestEffect_30(void) +// The appeal works great if performed last. { if (gUnknown_02038696[shared192D0.unk11] == 3) { @@ -446,6 +477,7 @@ void ContestEffect_30(void) } void ContestEffect_31(void) +// Makes the appeal as good as those before it. { int r1; int r3; @@ -468,6 +500,7 @@ void ContestEffect_31(void) } void ContestEffect_32(void) +// Makes the appeal as good as the one before it. { s16 r6 = 0; @@ -490,6 +523,7 @@ void ContestEffect_32(void) } void ContestEffect_33(void) +// The appeal works better the later it is performed. { u8 r3 = shared192D0.unk0[shared192D0.unk11]; if (r3 == 0) @@ -507,6 +541,7 @@ void ContestEffect_33(void) } void ContestEffect_34(void) +// The appeal’s quality varies depending on its timing. { u8 r0 = Random() % 10; s16 r4; @@ -539,24 +574,25 @@ void ContestEffect_34(void) #ifdef NONMATCHING // Not even close, send help void ContestEffect_35(void) +// Works well if it’s the same type as the one before. { s8 r4; + s8 r2; - for (r4 = shared192D0.unk0[shared192D0.unk11] - 1; r4 >= 0; r4--) + for (r4 = shared192D0.unk0[shared192D0.unk11]; r4 > 0; r4--) { - s8 r2; for (r2 = 0; r2 < 4; r2++) { - if (shared192D0.unk0[r2] == r4) + if (shared192D0.unk0[r2] == r4 - 1) break; } if (!(sContestantStatus[r2].unkB_7 || sContestantStatus[r2].unkC_0 || sContestantStatus[r2].unkC_1)) { u16 move = curContestant->currMove; - const struct ContestMove *contestMove = gContestMoves + move; - if (contestMove->contestCategory == gContestMoves[sContestantStatus[r2].currMove].contestCategory) + + if (gContestMoves[move].contestCategory == gContestMoves[sContestantStatus[r2].currMove].contestCategory) { - curContestant->appeal2 += gContestEffects[contestMove->effect].appeal * 2; + curContestant->appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2; SetContestantStatusUnk13(shared192D0.unk11, 31); } break; @@ -681,6 +717,7 @@ __attribute__((naked)) void ContestEffect_35(void) #endif void ContestEffect_36(void) +// Works well if different in type than the one before. { if (shared192D0.unk0[shared192D0.unk11] != 0) { @@ -701,6 +738,7 @@ void ContestEffect_36(void) } void ContestEffect_37(void) +// Affected by how well the appeal in front goes. { if (shared192D0.unk0[shared192D0.unk11] != 0) { @@ -726,6 +764,7 @@ void ContestEffect_37(void) } void ContestEffect_38(void) +// Ups the user’s condition. Helps prevent nervousness. { if (curContestant->unkD < 30) { @@ -738,6 +777,7 @@ void ContestEffect_38(void) } void ContestEffect_39(void) +// The appeal works well if the user’s condition is good. { curContestant->unk11_5 = TRUE; if (curContestant->unkD != 0) @@ -747,6 +787,7 @@ void ContestEffect_39(void) } void ContestEffect_40(void) +// The next appeal can be made earlier next turn. { s8 i; s8 j; @@ -786,3 +827,97 @@ void ContestEffect_40(void) SetContestantStatusUnk13(shared192D0.unk11, 37); } } + +void ContestEffect_41(void) +// The next appeal can be made later next turn. +{ + s8 i; + s8 j; + u8 sp00[4]; + + if (sContest.turnNumber != 4) + { + for (i = 0; i < 4; i++) + sp00[i] = sContestantStatus[i].unk19; + + sp00[shared192D0.unk11] = 0xFF; + + for (i = 3; i > -1; i--) + { + for (j = 0; j < 4; j++) + { + if (j != shared192D0.unk11 && + i == sp00[j] && + sp00[j] == sContestantStatus[j].unk19) + { + sp00[j]--; + break; + } + } + if (j == 4) + break; + } + + sp00[shared192D0.unk11] = 3; + curContestant->unk10_6 = 1; + + for (i = 0; i < 4; i++) + { + sContestantStatus[i].unk19 = sp00[i]; + } + curContestant->unk11_0 = 2; + SetContestantStatusUnk13(shared192D0.unk11, 38); + } +} + +void ContestEffect_42(void) +// Makes the next turn’s order more easily scrambled. +{ + // dummied out? +} + +void ContestEffect_43(void) +// Scrambles the order of appeals on the next turn. +{ + s8 i; + s8 j; + u8 sp00[4]; + u8 sp04[4]; + + if (sContest.turnNumber != 4) + { + for (i = 0; i < 4; i++) + { + sp00[i] = sContestantStatus[i].unk19; + sp04[i] = i; + } + + for (i = 0; i < 4; i++) + { + u8 r4 = Random() % (4 - i); + + for (j = 0; j < 4; j++) + { + if (sp04[j] != 0xFF) + { + if (r4 == 0) + { + sp00[j] = i; + sp04[j] = 0xFF; + break; + } + else + r4--; + } + } + } + + for (i = 0; i < 4; i++) + { + sContestantStatus[i].unk19 = sp00[i]; + sContestantStatus[i].unk10_6 = 2; + } + curContestant->unk11_0 = 3; + SetContestantStatusUnk13(shared192D0.unk11, 39); + } +} -- cgit v1.2.3 From 9007978827e723c6d4fb4978ae8dc94f8a3900ab Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Mar 2018 12:43:00 -0400 Subject: through ContestEffect_47 --- src/contest_effect.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index c484882ff..d5e9ca2e4 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -7,6 +7,7 @@ u8 sub_80B9120(void); bool8 sub_80B90C0(u8); void sub_80B9038(u8); s16 sub_80B9224(s16); +s16 sub_80B9268(s16); extern bool8 const gComboStarterLookupTable[]; @@ -921,3 +922,84 @@ void ContestEffect_43(void) SetContestantStatusUnk13(shared192D0.unk11, 39); } } + +void ContestEffect_44(void) +// An appeal that excites the audience in any CONTEST. +{ + if (gContestMoves[curContestant->currMove].contestCategory != gSpecialVar_ContestCategory) + { + curContestant->unk11_4 = TRUE; + } +} + +void ContestEffect_45(void) +// Badly startles all POKéMON that made good appeals. +{ + int i; + u8 r7 = 0; + + for (i = 0; i < 4; i++) + { + if (shared192D0.unk0[shared192D0.unk11] > shared192D0.unk0[i]) + { + if (sContestantStatus[i].appeal2 > 0) + { + shared192D0.unk4 = sContestantStatus[i].appeal2 / 2; + shared192D0.unk4 = sub_80B9268(shared192D0.unk4); + } + else + shared192D0.unk4 = 10; + shared192D0.unk8[0] = i; + shared192D0.unk8[1] = 0xFF; + if (sub_80B9120()) + r7++; + } + } + if (r7 == 0) + SetContestantStatusUnk14(shared192D0.unk11, 0x36); + SetContestantStatusUnk13(shared192D0.unk11, 48); +} + +void ContestEffect_46(void) +// The appeal works best the more the crowd is excited. +{ + s16 appeal; + + if (sContest.applauseLevel == 0) + { + appeal = 10; + SetContestantStatusUnk13(shared192D0.unk11, 26); + } + else if (sContest.applauseLevel == 1) + { + appeal = 20; + SetContestantStatusUnk13(shared192D0.unk11, 27); + } + else if (sContest.applauseLevel == 2) + { + appeal = 30; + SetContestantStatusUnk13(shared192D0.unk11, 28); + } + else if (sContest.applauseLevel == 3) + { + appeal = 50; + SetContestantStatusUnk13(shared192D0.unk11, 29); + } + else + { + appeal = 60; + SetContestantStatusUnk13(shared192D0.unk11, 30); + } + curContestant->appeal2 = appeal; +} + +void ContestEffect_47(void) +// Temporarily stops the crowd from growing excited. +{ + if (!shared19328.bits_8) + { + shared19328.bits_8 = TRUE; + shared19328.bits_9 = shared192D0.unk11; + SetContestantStatusUnk13(shared192D0.unk11, 61); + } +} -- cgit v1.2.3 From e8b47004b3e429a6d322853631b2375408d9563c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Mar 2018 13:06:58 -0400 Subject: through nonmatching sub_80B90C0 --- src/contest_effect.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 2 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index d5e9ca2e4..e28334b12 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -3,9 +3,9 @@ #include "random.h" #include "contest.h" -u8 sub_80B9120(void); -bool8 sub_80B90C0(u8); void sub_80B9038(u8); +bool8 sub_80B90C0(u8); +u8 sub_80B9120(void); s16 sub_80B9224(s16); s16 sub_80B9268(s16); @@ -1003,3 +1003,104 @@ void ContestEffect_47(void) SetContestantStatusUnk13(shared192D0.unk11, 61); } } + +void sub_80B9038(u8 category) +{ + int i; + int r7 = 0; + + for (i = 0; i < 4; i++) + { + if (shared192D0.unk0[shared192D0.unk11] > shared192D0.unk0[i]) + { + if (category == gContestMoves[sContestantStatus[i].currMove].contestCategory) + shared192D0.unk4 = 40; + else + shared192D0.unk4 = 10; + shared192D0.unk8[0] = i; + shared192D0.unk8[1] = 0xFF; + if (sub_80B9120()) + r7++; + } + } + + if (r7 == 0) + SetContestantStatusUnk14(shared192D0.unk11, 0x36); +} + +#ifdef NONMATCHING +bool8 sub_80B90C0(u8 i) +{ + shared192D0.unkD[i] = 1; + if (sContestantStatus[i].unk10_1) + SetContestantStatusUnk13(i, 45); + else if (sContestantStatus[i].unk12 == 0) + { + if (sContestantStatus[i].unkB_7 || sContestantStatus[i].unkC_1) + return FALSE; + return TRUE; + } + else + { + sContestantStatus[i].unk12--; + SetContestantStatusUnk13(i, 44); + } + return FALSE; +} +#else +__attribute__((naked)) bool8 sub_80B90C0(u8 i) +{ + asm_unified("\tpush {lr}\n" + "\tlsls r0, 24\n" + "\tlsrs r3, r0, 24\n" + "\tldr r2, _080B90EC @ =gSharedMem + 0x192D0\n" + "\tadds r0, r2, 0\n" + "\tadds r0, 0xD\n" + "\tadds r0, r3, r0\n" + "\tmovs r1, 0x1\n" + "\tstrb r1, [r0]\n" + "\tlsls r0, r3, 3\n" + "\tsubs r0, r3\n" + "\tlsls r0, 2\n" + "\tsubs r2, 0x70\n" + "\tadds r2, r0, r2\n" + "\tldrb r1, [r2, 0x10]\n" + "\tmovs r0, 0x2\n" + "\tands r0, r1\n" + "\tcmp r0, 0\n" + "\tbeq _080B90F0\n" + "\tadds r0, r3, 0\n" + "\tmovs r1, 0x2D\n" + "\tb _080B9116\n" + "\t.align 2, 0\n" + "_080B90EC: .4byte gSharedMem + 0x192D0\n" + "_080B90F0:\n" + "\tldrb r0, [r2, 0x12]\n" + "\tcmp r0, 0\n" + "\tbne _080B910E\n" + "\tldrb r1, [r2, 0xB]\n" + "\tmovs r0, 0x80\n" + "\tands r0, r1\n" + "\tcmp r0, 0\n" + "\tbne _080B911A\n" + "\tldrb r1, [r2, 0xC]\n" + "\tmovs r0, 0x6\n" + "\tands r0, r1\n" + "\tcmp r0, 0\n" + "\tbne _080B911A\n" + "\tmovs r0, 0x1\n" + "\tb _080B911C\n" + "_080B910E:\n" + "\tsubs r0, 0x1\n" + "\tstrb r0, [r2, 0x12]\n" + "\tadds r0, r3, 0\n" + "\tmovs r1, 0x2C\n" + "_080B9116:\n" + "\tbl SetContestantStatusUnk13\n" + "_080B911A:\n" + "\tmovs r0, 0\n" + "_080B911C:\n" + "\tpop {r1}\n" + "\tbx r1"); +} +#endif -- cgit v1.2.3 From e6a71d1c3759fa3f5b4d71a8cd08b21905948a8c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Mar 2018 15:11:41 -0400 Subject: Remainder of contest_effect.o(.text) --- src/contest_effect.c | 100 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 84 insertions(+), 16 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index e28334b12..ae9be3aaf 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -3,11 +3,14 @@ #include "random.h" #include "contest.h" -void sub_80B9038(u8); -bool8 sub_80B90C0(u8); -u8 sub_80B9120(void); -s16 sub_80B9224(s16); -s16 sub_80B9268(s16); +static void sub_80B9038(u8); +static bool8 sub_80B90C0(u8); +static u8 sub_80B9120(void); +static void sub_80B9200(u8, u8); +static s16 RoundTowardsZero(s16); +static s16 RoundUp(s16); + +#define abs(x) ((x) >= 0 ? (x) : -(x)) extern bool8 const gComboStarterLookupTable[]; @@ -497,7 +500,7 @@ void ContestEffect_31(void) curContestant->appeal2 += r3 / 2; SetContestantStatusUnk13(shared192D0.unk11, 17); } - sContestantStatus[shared192D0.unk11].appeal2 = sub_80B9224(sContestantStatus[shared192D0.unk11].appeal2); + sContestantStatus[shared192D0.unk11].appeal2 = RoundTowardsZero(sContestantStatus[shared192D0.unk11].appeal2); } void ContestEffect_32(void) @@ -945,7 +948,7 @@ void ContestEffect_45(void) if (sContestantStatus[i].appeal2 > 0) { shared192D0.unk4 = sContestantStatus[i].appeal2 / 2; - shared192D0.unk4 = sub_80B9268(shared192D0.unk4); + shared192D0.unk4 = RoundUp(shared192D0.unk4); } else shared192D0.unk4 = 10; @@ -1004,7 +1007,7 @@ void ContestEffect_47(void) } } -void sub_80B9038(u8 category) +static void sub_80B9038(u8 category) { int i; int r7 = 0; @@ -1029,26 +1032,24 @@ void sub_80B9038(u8 category) } #ifdef NONMATCHING -bool8 sub_80B90C0(u8 i) +static bool8 sub_80B90C0(u8 i) { shared192D0.unkD[i] = 1; if (sContestantStatus[i].unk10_1) - SetContestantStatusUnk13(i, 45); - else if (sContestantStatus[i].unk12 == 0) { - if (sContestantStatus[i].unkB_7 || sContestantStatus[i].unkC_1) - return FALSE; - return TRUE; + SetContestantStatusUnk13(i, 45); } - else + else if (sContestantStatus[i].unk12 != 0) { sContestantStatus[i].unk12--; SetContestantStatusUnk13(i, 44); } + else if (!sContestantStatus[i].unkB_7 && sContestantStatus[i].unkC_1 == 0) + return TRUE; return FALSE; } #else -__attribute__((naked)) bool8 sub_80B90C0(u8 i) +static __attribute__((naked)) bool8 sub_80B90C0(u8 i) { asm_unified("\tpush {lr}\n" "\tlsls r0, 24\n" @@ -1104,3 +1105,70 @@ __attribute__((naked)) bool8 sub_80B90C0(u8 i) "\tbx r1"); } #endif + +static bool8 sub_80B9120(void) +{ + s16 sp00[4] = {0}; + int i; + + for (i = 0; shared192D0.unk8[i] != 0xFF; i++) + { + u8 r4 = shared192D0.unk8[i]; + if (sub_80B90C0(r4)) + { + shared192D0.unk6 = shared192D0.unk4; + if (sContestantStatus[r4].unk10_2) + shared192D0.unk6 *= 2; + if (sContestantStatus[r4].unk10_0) + { + shared192D0.unk6 = 10; + SetContestantStatusUnk13(r4, 47); + } + else if ((shared192D0.unk6 -= sContestantStatus[r4].unkF) <= 0) + { + shared192D0.unk6 = 0; + SetContestantStatusUnk13(r4, 46); + } + else + { + sub_80B9200(r4, shared192D0.unk6); + sub_80B141C(r4, shared192D0.unk6); + sp00[r4] = shared192D0.unk6; + } + } + } + + for (i = 0; i < 4; i++) + { + if (sp00[i] != 0) + return TRUE; + } + return FALSE; +} + +static void sub_80B9200(u8 i, u8 jam) +{ + sContestantStatus[i].appeal2 -= jam; + sContestantStatus[i].unkE += jam; +} + +static s16 RoundTowardsZero(s16 score) +{ + s16 r1 = abs(score) % 10; + if (score < 0) + { + if (r1 != 0) + score -= 10 - r1; + } + else + score -= r1; + return score; +} + +static s16 RoundUp(s16 score) +{ + s16 r1 = abs(score) % 10; + if (r1 != 0) + score += 10 - r1; + return score; +} -- cgit v1.2.3 From ca3d39512ce4857f6389888045c5d6d562331302 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Mar 2018 15:48:09 -0400 Subject: Decompile contest effect data --- src/contest_effect.c | 140 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 45 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index ae9be3aaf..699da6740 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -3,6 +3,54 @@ #include "random.h" #include "contest.h" +static void ContestEffect_00(void); +static void ContestEffect_01(void); +static void ContestEffect_02(void); +static void ContestEffect_03(void); +static void ContestEffect_04(void); +static void ContestEffect_05(void); +static void ContestEffect_06(void); +static void ContestEffect_07(void); +static void ContestEffect_08(void); +static void ContestEffect_09(void); +static void ContestEffect_08(void); +static void ContestEffect_09(void); +static void ContestEffect_08(void); +static void ContestEffect_09(void); +static void ContestEffect_14(void); +static void ContestEffect_15(void); +static void ContestEffect_16(void); +static void ContestEffect_17(void); +static void ContestEffect_18(void); +static void ContestEffect_19(void); +static void ContestEffect_20(void); +static void ContestEffect_21(void); +static void ContestEffect_22(void); +static void ContestEffect_23(void); +static void ContestEffect_24(void); +static void ContestEffect_25(void); +static void ContestEffect_26(void); +static void ContestEffect_27(void); +static void ContestEffect_28(void); +static void ContestEffect_29(void); +static void ContestEffect_30(void); +static void ContestEffect_31(void); +static void ContestEffect_32(void); +static void ContestEffect_33(void); +static void ContestEffect_34(void); +static void ContestEffect_35(void); +static void ContestEffect_36(void); +static void ContestEffect_37(void); +static void ContestEffect_38(void); +static void ContestEffect_39(void); +static void ContestEffect_40(void); +static void ContestEffect_41(void); +static void ContestEffect_42(void); +static void ContestEffect_43(void); +static void ContestEffect_44(void); +static void ContestEffect_45(void); +static void ContestEffect_46(void); +static void ContestEffect_47(void); static void sub_80B9038(u8); static bool8 sub_80B90C0(u8); static u8 sub_80B9120(void); @@ -12,7 +60,9 @@ static s16 RoundUp(s16); #define abs(x) ((x) >= 0 ? (x) : -(x)) -extern bool8 const gComboStarterLookupTable[]; +#include "data/contest_moves.h" + +//extern bool8 const gComboStarterLookupTable[]; #define curContestant (&sContestantStatus[shared192D0.unk11]) @@ -33,26 +83,26 @@ bool8 AreMovesContestCombo(u16 lastMove, u16 nextMove) { return 0; } -void ContestEffect_00(void) +static void ContestEffect_00(void) // A highly appealing move. { } -void ContestEffect_01(void) +static void ContestEffect_01(void) // After this move, the user is more easily startled. { curContestant->unk10_2 = TRUE; SetContestantStatusUnk13(shared192D0.unk11, 0); } -void ContestEffect_02(void) +static void ContestEffect_02(void) // Makes a great appeal, but allows no more to the end. { curContestant->unk11_3 = TRUE; SetContestantStatusUnk13(shared192D0.unk11, 1); } -void ContestEffect_03(void) +static void ContestEffect_03(void) // Can be used repeatedly without boring the JUDGE. { curContestant->unk10_3 = TRUE; @@ -60,35 +110,35 @@ void ContestEffect_03(void) curContestant->moveRepeatCount = 0; } -void ContestEffect_04(void) +static void ContestEffect_04(void) // Can avoid being startled by others once. { curContestant->unk12 = 1; SetContestantStatusUnk13(shared192D0.unk11, 2); } -void ContestEffect_05(void) +static void ContestEffect_05(void) // Can avoid being startled by others. { curContestant->unk10_1 = TRUE; SetContestantStatusUnk13(shared192D0.unk11, 3); } -void ContestEffect_06(void) +static void ContestEffect_06(void) // Can avoid being startled by others a little. { curContestant->unkF = 20; SetContestantStatusUnk13(shared192D0.unk11, 4); } -void ContestEffect_07(void) +static void ContestEffect_07(void) // After this move, the user is less likely to be startled. { curContestant->unk10_0 = TRUE; SetContestantStatusUnk13(shared192D0.unk11, 5); } -void ContestEffect_08(void) +static void ContestEffect_08(void) // Slightly startles the POKéMON in front. { u8 idx = 0; @@ -111,7 +161,7 @@ void ContestEffect_08(void) SetContestantStatusUnk13(shared192D0.unk11, 48); } -void ContestEffect_09(void) +static void ContestEffect_09(void) // Slightly startles those that have made appeals. { u8 idx = 0; @@ -132,7 +182,7 @@ void ContestEffect_09(void) SetContestantStatusUnk13(shared192D0.unk11, 48); } -void ContestEffect_14(void) +static void ContestEffect_14(void) // Startles the POKéMON that appealed before the user. { u8 r0 = Random() % 10; @@ -147,7 +197,7 @@ void ContestEffect_14(void) ContestEffect_08(); } -void ContestEffect_15(void) +static void ContestEffect_15(void) // Startles all POKéMON that appealed before the user. { u8 r7 = 0; @@ -190,7 +240,7 @@ void ContestEffect_15(void) SetContestantStatusUnk14(shared192D0.unk11, 0x36); } -void ContestEffect_16(void) +static void ContestEffect_16(void) // Shifts the JUDGE’s attention from others. { bool32 r9 = FALSE; @@ -220,7 +270,7 @@ void ContestEffect_16(void) } } -void ContestEffect_17(void) +static void ContestEffect_17(void) // Startles the POKéMON that has the JUDGE’s attention. { u8 r9 = 0; @@ -250,7 +300,7 @@ void ContestEffect_17(void) SetContestantStatusUnk14(shared192D0.unk11, 0x36); } -void ContestEffect_18(void) +static void ContestEffect_18(void) // Jams the others, and misses one turn of appeals. { curContestant->unk11_2 = TRUE; @@ -258,7 +308,7 @@ void ContestEffect_18(void) SetContestantStatusUnk13(shared192D0.unk11, 48); } -void ContestEffect_19(void) +static void ContestEffect_19(void) // Startles POKéMON that made a same-type appeal. { u16 move = curContestant->currMove; @@ -266,42 +316,42 @@ void ContestEffect_19(void) SetContestantStatusUnk13(shared192D0.unk11, 48); } -void ContestEffect_20(void) +static void ContestEffect_20(void) // Badly startles POKéMON that made COOL appeals. { sub_80B9038(CONTEST_CATEGORY_COOL); SetContestantStatusUnk13(shared192D0.unk11, 48); } -void ContestEffect_21(void) +static void ContestEffect_21(void) // Badly startles POKéMON that made BEAUTY appeals. { sub_80B9038(CONTEST_CATEGORY_BEAUTY); SetContestantStatusUnk13(shared192D0.unk11, 48); } -void ContestEffect_22(void) +static void ContestEffect_22(void) // Badly startles POKéMON that made CUTE appeals. { sub_80B9038(CONTEST_CATEGORY_CUTE); SetContestantStatusUnk13(shared192D0.unk11, 48); } -void ContestEffect_23(void) +static void ContestEffect_23(void) // Badly startles POKéMON that made SMART appeals. { sub_80B9038(CONTEST_CATEGORY_SMART); SetContestantStatusUnk13(shared192D0.unk11, 48); } -void ContestEffect_24(void) +static void ContestEffect_24(void) // Badly startles POKéMON that made TOUGH appeals. { sub_80B9038(CONTEST_CATEGORY_TOUGH); SetContestantStatusUnk13(shared192D0.unk11, 48); } -void ContestEffect_25(void) +static void ContestEffect_25(void) // Makes one POKéMON after the user nervous. { bool32 r4 = FALSE; @@ -333,7 +383,7 @@ void ContestEffect_25(void) SetContestantStatusUnk14(shared192D0.unk11, 0x36); } -void ContestEffect_26(void) +static void ContestEffect_26(void) // Makes all POKéMON after the user nervous. { u8 r9 = 0; @@ -409,7 +459,7 @@ void ContestEffect_26(void) SetContestantStatusUnk14(shared192D0.unk11, 0x36); } -void ContestEffect_27(void) +static void ContestEffect_27(void) // Worsens the condition of those that made appeals. { u8 r8 = 0; @@ -433,7 +483,7 @@ void ContestEffect_27(void) SetContestantStatusUnk14(shared192D0.unk11, 0x39); } -void ContestEffect_28(void) +static void ContestEffect_28(void) // Badly startles POKéMON in good condition. { u8 r7 = 0; @@ -458,7 +508,7 @@ void ContestEffect_28(void) SetContestantStatusUnk14(shared192D0.unk11, 0x39); } -void ContestEffect_29(void) +static void ContestEffect_29(void) // The appeal works great if performed first. { if (gUnknown_02038696[shared192D0.unk11] == 0) @@ -469,7 +519,7 @@ void ContestEffect_29(void) } } -void ContestEffect_30(void) +static void ContestEffect_30(void) // The appeal works great if performed last. { if (gUnknown_02038696[shared192D0.unk11] == 3) @@ -480,7 +530,7 @@ void ContestEffect_30(void) } } -void ContestEffect_31(void) +static void ContestEffect_31(void) // Makes the appeal as good as those before it. { int r1; @@ -503,7 +553,7 @@ void ContestEffect_31(void) sContestantStatus[shared192D0.unk11].appeal2 = RoundTowardsZero(sContestantStatus[shared192D0.unk11].appeal2); } -void ContestEffect_32(void) +static void ContestEffect_32(void) // Makes the appeal as good as the one before it. { s16 r6 = 0; @@ -526,7 +576,7 @@ void ContestEffect_32(void) } } -void ContestEffect_33(void) +static void ContestEffect_33(void) // The appeal works better the later it is performed. { u8 r3 = shared192D0.unk0[shared192D0.unk11]; @@ -544,7 +594,7 @@ void ContestEffect_33(void) SetContestantStatusUnk13(shared192D0.unk11, 24); } -void ContestEffect_34(void) +static void ContestEffect_34(void) // The appeal’s quality varies depending on its timing. { u8 r0 = Random() % 10; @@ -577,7 +627,7 @@ void ContestEffect_34(void) #ifdef NONMATCHING // Not even close, send help -void ContestEffect_35(void) +static void ContestEffect_35(void) // Works well if it’s the same type as the one before. { s8 r4; @@ -720,7 +770,7 @@ __attribute__((naked)) void ContestEffect_35(void) } #endif -void ContestEffect_36(void) +static void ContestEffect_36(void) // Works well if different in type than the one before. { if (shared192D0.unk0[shared192D0.unk11] != 0) @@ -741,7 +791,7 @@ void ContestEffect_36(void) } } -void ContestEffect_37(void) +static void ContestEffect_37(void) // Affected by how well the appeal in front goes. { if (shared192D0.unk0[shared192D0.unk11] != 0) @@ -767,7 +817,7 @@ void ContestEffect_37(void) } } -void ContestEffect_38(void) +static void ContestEffect_38(void) // Ups the user’s condition. Helps prevent nervousness. { if (curContestant->unkD < 30) @@ -780,7 +830,7 @@ void ContestEffect_38(void) SetContestantStatusUnk13(shared192D0.unk11, 58); } -void ContestEffect_39(void) +static void ContestEffect_39(void) // The appeal works well if the user’s condition is good. { curContestant->unk11_5 = TRUE; @@ -790,7 +840,7 @@ void ContestEffect_39(void) SetContestantStatusUnk13(shared192D0.unk11, 59); } -void ContestEffect_40(void) +static void ContestEffect_40(void) // The next appeal can be made earlier next turn. { s8 i; @@ -832,7 +882,7 @@ void ContestEffect_40(void) } } -void ContestEffect_41(void) +static void ContestEffect_41(void) // The next appeal can be made later next turn. { s8 i; @@ -874,13 +924,13 @@ void ContestEffect_41(void) } } -void ContestEffect_42(void) +static void ContestEffect_42(void) // Makes the next turn’s order more easily scrambled. { // dummied out? } -void ContestEffect_43(void) +static void ContestEffect_43(void) // Scrambles the order of appeals on the next turn. { s8 i; @@ -926,7 +976,7 @@ void ContestEffect_43(void) } } -void ContestEffect_44(void) +static void ContestEffect_44(void) // An appeal that excites the audience in any CONTEST. { if (gContestMoves[curContestant->currMove].contestCategory != gSpecialVar_ContestCategory) @@ -935,7 +985,7 @@ void ContestEffect_44(void) } } -void ContestEffect_45(void) +static void ContestEffect_45(void) // Badly startles all POKéMON that made good appeals. { int i; @@ -963,7 +1013,7 @@ void ContestEffect_45(void) SetContestantStatusUnk13(shared192D0.unk11, 48); } -void ContestEffect_46(void) +static void ContestEffect_46(void) // The appeal works best the more the crowd is excited. { s16 appeal; @@ -996,7 +1046,7 @@ void ContestEffect_46(void) curContestant->appeal2 = appeal; } -void ContestEffect_47(void) +static void ContestEffect_47(void) // Temporarily stops the crowd from growing excited. { if (!shared19328.bits_8) -- cgit v1.2.3 From 32b86c14aa57c6e055670daf76f8e1dbccfe00c3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 30 Mar 2018 17:07:25 -0400 Subject: rename some funcs and fields --- src/contest_effect.c | 446 +++++++++++++++++++++++++-------------------------- 1 file changed, 219 insertions(+), 227 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 699da6740..ae082b0e5 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -13,10 +13,6 @@ static void ContestEffect_06(void); static void ContestEffect_07(void); static void ContestEffect_08(void); static void ContestEffect_09(void); -static void ContestEffect_08(void); -static void ContestEffect_09(void); -static void ContestEffect_08(void); -static void ContestEffect_09(void); static void ContestEffect_14(void); static void ContestEffect_15(void); static void ContestEffect_16(void); @@ -51,9 +47,9 @@ static void ContestEffect_44(void); static void ContestEffect_45(void); static void ContestEffect_46(void); static void ContestEffect_47(void); -static void sub_80B9038(u8); +static void JamByMoveCategory(u8); static bool8 sub_80B90C0(u8); -static u8 sub_80B9120(void); +static u8 WasAtLeastOneOpponentJammed(void); static void sub_80B9200(u8, u8); static s16 RoundTowardsZero(s16); static s16 RoundUp(s16); @@ -62,10 +58,6 @@ static s16 RoundUp(s16); #include "data/contest_moves.h" -//extern bool8 const gComboStarterLookupTable[]; - -#define curContestant (&sContestantStatus[shared192D0.unk11]) - bool8 AreMovesContestCombo(u16 lastMove, u16 nextMove) { u8 nextMoveComboMoves[4]; u8 lastMoveComboStarterId = gContestMoves[lastMove].comboStarterId; @@ -91,95 +83,95 @@ static void ContestEffect_00(void) static void ContestEffect_01(void) // After this move, the user is more easily startled. { - curContestant->unk10_2 = TRUE; - SetContestantStatusUnk13(shared192D0.unk11, 0); + sContestantStatus[shared192D0.contestant].moreEasilyStartled = TRUE; + SetContestantEffectStringID(shared192D0.contestant, 0); } static void ContestEffect_02(void) // Makes a great appeal, but allows no more to the end. { - curContestant->unk11_3 = TRUE; - SetContestantStatusUnk13(shared192D0.unk11, 1); + sContestantStatus[shared192D0.contestant].exploded = TRUE; + SetContestantEffectStringID(shared192D0.contestant, 1); } static void ContestEffect_03(void) // Can be used repeatedly without boring the JUDGE. { - curContestant->unk10_3 = TRUE; - curContestant->disappointedRepeat = FALSE; - curContestant->moveRepeatCount = 0; + sContestantStatus[shared192D0.contestant].usedRepeatableMove = TRUE; + sContestantStatus[shared192D0.contestant].disappointedRepeat = FALSE; + sContestantStatus[shared192D0.contestant].moveRepeatCount = 0; } static void ContestEffect_04(void) // Can avoid being startled by others once. { - curContestant->unk12 = 1; - SetContestantStatusUnk13(shared192D0.unk11, 2); + sContestantStatus[shared192D0.contestant].jamSafetyCount = 1; + SetContestantEffectStringID(shared192D0.contestant, 2); } static void ContestEffect_05(void) // Can avoid being startled by others. { - curContestant->unk10_1 = TRUE; - SetContestantStatusUnk13(shared192D0.unk11, 3); + sContestantStatus[shared192D0.contestant].immune = TRUE; + SetContestantEffectStringID(shared192D0.contestant, 3); } static void ContestEffect_06(void) // Can avoid being startled by others a little. { - curContestant->unkF = 20; - SetContestantStatusUnk13(shared192D0.unk11, 4); + sContestantStatus[shared192D0.contestant].jamReduction = 20; + SetContestantEffectStringID(shared192D0.contestant, 4); } static void ContestEffect_07(void) // After this move, the user is less likely to be startled. { - curContestant->unk10_0 = TRUE; - SetContestantStatusUnk13(shared192D0.unk11, 5); + sContestantStatus[shared192D0.contestant].resistant = TRUE; + SetContestantEffectStringID(shared192D0.contestant, 5); } static void ContestEffect_08(void) // Slightly startles the POKéMON in front. { u8 idx = 0; - u8 a = shared192D0.unk11; + u8 a = shared192D0.contestant; - if (shared192D0.unk0[a] != 0) { + if (shared192D0.turnOrder[a] != 0) { int i; for (i = 0; i < 4; i++) { - if (shared192D0.unk0[a] - 1 == shared192D0.unk0[i]) + if (shared192D0.turnOrder[a] - 1 == shared192D0.turnOrder[i]) break; } shared192D0.unk8[0] = i; shared192D0.unk8[1] = 0xFF; - idx = sub_80B9120(); + idx = WasAtLeastOneOpponentJammed(); } if (idx == 0) - SetContestantStatusUnk14(shared192D0.unk11, 0x36); - SetContestantStatusUnk13(shared192D0.unk11, 48); + SetContestantEffectStringID2(shared192D0.contestant, 0x36); + SetContestantEffectStringID(shared192D0.contestant, 48); } static void ContestEffect_09(void) // Slightly startles those that have made appeals. { u8 idx = 0; - u8 a = shared192D0.unk11; + u8 a = shared192D0.contestant; - if (shared192D0.unk0[a] != 0) { + if (shared192D0.turnOrder[a] != 0) { int i; int j = 0; for (i = 0; i < 4; i++) - if (shared192D0.unk0[a] > shared192D0.unk0[i]) + if (shared192D0.turnOrder[a] > shared192D0.turnOrder[i]) shared192D0.unk8[j++] = i; shared192D0.unk8[j] = 0xFF; - idx = sub_80B9120(); + idx = WasAtLeastOneOpponentJammed(); } if (idx == 0) - SetContestantStatusUnk14(shared192D0.unk11, 0x36); - SetContestantStatusUnk13(shared192D0.unk11, 48); + SetContestantEffectStringID2(shared192D0.contestant, 0x36); + SetContestantEffectStringID(shared192D0.contestant, 48); } static void ContestEffect_14(void) @@ -193,7 +185,7 @@ static void ContestEffect_14(void) r1 = 40; else r1 = 60; - shared192D0.unk4 = r1; + shared192D0.jam = r1; ContestEffect_08(); } @@ -201,15 +193,15 @@ static void ContestEffect_15(void) // Startles all POKéMON that appealed before the user. { u8 r7 = 0; - u8 r6 = shared192D0.unk11; + u8 r6 = shared192D0.contestant; - if (shared192D0.unk0[r6] != 0) + if (shared192D0.turnOrder[r6] != 0) { int r5; for (r5 = 0; r5 < 4; r5++) { - if (shared192D0.unk0[r6] > shared192D0.unk0[r5]) + if (shared192D0.turnOrder[r6] > shared192D0.turnOrder[r5]) { shared192D0.unk8[0] = r5; shared192D0.unk8[1] = 0xFF; @@ -228,45 +220,45 @@ static void ContestEffect_15(void) r1 = 40; else r1 = 60; - shared192D0.unk4 = r1; + shared192D0.jam = r1; } - if (sub_80B9120()) + if (WasAtLeastOneOpponentJammed()) r7++; } } } - SetContestantStatusUnk13(shared192D0.unk11, 48); + SetContestantEffectStringID(shared192D0.contestant, 48); if (r7 == 0) - SetContestantStatusUnk14(shared192D0.unk11, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, 0x36); } static void ContestEffect_16(void) // Shifts the JUDGE’s attention from others. { bool32 r9 = FALSE; - u8 r7 = shared192D0.unk11; + u8 r7 = shared192D0.contestant; - if (shared192D0.unk0[shared192D0.unk11] != 0) + if (shared192D0.turnOrder[shared192D0.contestant] != 0) { int r6; for (r6 = 0; r6 < 4; r6++) { - if (shared192D0.unk0[r7] > shared192D0.unk0[r6] && - sContestantStatus[r6].unk15_4 && + if (shared192D0.turnOrder[r7] > shared192D0.turnOrder[r6] && + sContestantStatus[r6].hasJudgesAttention && sub_80B90C0(r6)) { - sContestantStatus[r6].unk15_4 = FALSE; + sContestantStatus[r6].hasJudgesAttention = FALSE; sContestantStatus[r6].unk15_5 = TRUE; - SetContestantStatusUnk13(r6, 8); + SetContestantEffectStringID(r6, 8); r9 = TRUE; } } } - SetContestantStatusUnk13(shared192D0.unk11, 7); + SetContestantEffectStringID(shared192D0.contestant, 7); if (!r9) { - SetContestantStatusUnk14(shared192D0.unk11, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, 0x36); } } @@ -274,81 +266,81 @@ static void ContestEffect_17(void) // Startles the POKéMON that has the JUDGE’s attention. { u8 r9 = 0; - u8 r8 = shared192D0.unk11; + u8 r8 = shared192D0.contestant; - if (shared192D0.unk0[shared192D0.unk11] != 0) + if (shared192D0.turnOrder[shared192D0.contestant] != 0) { int r5; for (r5 = 0; r5 < 4; r5++) { - if (shared192D0.unk0[r8] > shared192D0.unk0[r5]) + if (shared192D0.turnOrder[r8] > shared192D0.turnOrder[r5]) { - if (sContestantStatus[r5].unk15_4) - shared192D0.unk4 = 50; + if (sContestantStatus[r5].hasJudgesAttention) + shared192D0.jam = 50; else - shared192D0.unk4 = 10; + shared192D0.jam = 10; shared192D0.unk8[0] = r5; shared192D0.unk8[1] = 0xFF; - if (sub_80B9120()) + if (WasAtLeastOneOpponentJammed()) r9++; } } } - SetContestantStatusUnk13(shared192D0.unk11, 48); + SetContestantEffectStringID(shared192D0.contestant, 48); if (r9 == 0) - SetContestantStatusUnk14(shared192D0.unk11, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, 0x36); } static void ContestEffect_18(void) // Jams the others, and misses one turn of appeals. { - curContestant->unk11_2 = TRUE; + sContestantStatus[shared192D0.contestant].turnSkipped = TRUE; ContestEffect_09(); - SetContestantStatusUnk13(shared192D0.unk11, 48); + SetContestantEffectStringID(shared192D0.contestant, 48); } static void ContestEffect_19(void) // Startles POKéMON that made a same-type appeal. { - u16 move = curContestant->currMove; - sub_80B9038(gContestMoves[move].contestCategory); - SetContestantStatusUnk13(shared192D0.unk11, 48); + u16 move = sContestantStatus[shared192D0.contestant].currMove; + JamByMoveCategory(gContestMoves[move].contestCategory); + SetContestantEffectStringID(shared192D0.contestant, 48); } static void ContestEffect_20(void) // Badly startles POKéMON that made COOL appeals. { - sub_80B9038(CONTEST_CATEGORY_COOL); - SetContestantStatusUnk13(shared192D0.unk11, 48); + JamByMoveCategory(CONTEST_CATEGORY_COOL); + SetContestantEffectStringID(shared192D0.contestant, 48); } static void ContestEffect_21(void) // Badly startles POKéMON that made BEAUTY appeals. { - sub_80B9038(CONTEST_CATEGORY_BEAUTY); - SetContestantStatusUnk13(shared192D0.unk11, 48); + JamByMoveCategory(CONTEST_CATEGORY_BEAUTY); + SetContestantEffectStringID(shared192D0.contestant, 48); } static void ContestEffect_22(void) // Badly startles POKéMON that made CUTE appeals. { - sub_80B9038(CONTEST_CATEGORY_CUTE); - SetContestantStatusUnk13(shared192D0.unk11, 48); + JamByMoveCategory(CONTEST_CATEGORY_CUTE); + SetContestantEffectStringID(shared192D0.contestant, 48); } static void ContestEffect_23(void) // Badly startles POKéMON that made SMART appeals. { - sub_80B9038(CONTEST_CATEGORY_SMART); - SetContestantStatusUnk13(shared192D0.unk11, 48); + JamByMoveCategory(CONTEST_CATEGORY_SMART); + SetContestantEffectStringID(shared192D0.contestant, 48); } static void ContestEffect_24(void) // Badly startles POKéMON that made TOUGH appeals. { - sub_80B9038(CONTEST_CATEGORY_TOUGH); - SetContestantStatusUnk13(shared192D0.unk11, 48); + JamByMoveCategory(CONTEST_CATEGORY_TOUGH); + SetContestantEffectStringID(shared192D0.contestant, 48); } static void ContestEffect_25(void) @@ -356,31 +348,31 @@ static void ContestEffect_25(void) { bool32 r4 = FALSE; - if (shared192D0.unk0[shared192D0.unk11] != 3) + if (shared192D0.turnOrder[shared192D0.contestant] != 3) { int r5; for (r5 = 0; r5 < 4; r5++) { - if (shared192D0.unk0[shared192D0.unk11] + 1 == shared192D0.unk0[r5]) + if (shared192D0.turnOrder[shared192D0.contestant] + 1 == shared192D0.turnOrder[r5]) { if (sub_80B90C0(r5)) { - sub_80B157C(r5); - SetContestantStatusUnk13(r5, 10); + MakeContestantNervous(r5); + SetContestantEffectStringID(r5, 10); r4 = TRUE; } else { - SetContestantStatusUnk13(r5, 60); + SetContestantEffectStringID(r5, 60); r4 = TRUE; } } } } - SetContestantStatusUnk13(shared192D0.unk11, 9); + SetContestantEffectStringID(shared192D0.contestant, 9); if (!r4) - SetContestantStatusUnk14(shared192D0.unk11, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, 0x36); } static void ContestEffect_26(void) @@ -397,8 +389,8 @@ static void ContestEffect_26(void) memset(sp00, 0xFF, ARRAY_COUNT(sp00)); for (r6 = 0, r4 = 0; r6 < 4; r6++) { - if (shared192D0.unk0[shared192D0.unk11] < shared192D0.unk0[r6] && - !sContestantStatus[r6].unkC_0 && !Contest_IsMonsTurnDisabled(r6)) + if (shared192D0.turnOrder[shared192D0.contestant] < shared192D0.turnOrder[r6] && + !sContestantStatus[r6].nervous && !Contest_IsMonsTurnDisabled(r6)) sp00[r4++] = r6; } @@ -424,11 +416,11 @@ static void ContestEffect_26(void) } for (r6 = 0; r6 < 4; r6++) { - if (sContestantStatus[r6].unk15_4 && sub_80B214C(r6)) + if (sContestantStatus[r6].hasJudgesAttention && sub_80B214C(r6)) sp08[r6] = gComboStarterLookupTable[gContestMoves[sContestantStatus[r6].prevMove].comboStarterId] * 10; else sp08[r6] = 0; - sp08[r6] -= (sContestantStatus[r6].unkD / 10) * 10; + sp08[r6] -= (sContestantStatus[r6].condition / 10) * 10; } if (sp10[0] != 0) { @@ -438,8 +430,8 @@ static void ContestEffect_26(void) { if (sub_80B90C0(sp00[r6])) { - sub_80B157C(sp00[r6]); - SetContestantStatusUnk13(sp00[r6], 10); + MakeContestantNervous(sp00[r6]); + SetContestantEffectStringID(sp00[r6], 10); r9++; } else sp18 = TRUE; @@ -448,15 +440,15 @@ static void ContestEffect_26(void) if (sp18) { sp18 = FALSE; - SetContestantStatusUnk13(sp00[r6], 60); + SetContestantEffectStringID(sp00[r6], 60); r9++; } shared192D0.unkD[sp00[r6]] = 1; } } - SetContestantStatusUnk13(shared192D0.unk11, 11); + SetContestantEffectStringID(shared192D0.contestant, 11); if (r9 == 0) - SetContestantStatusUnk14(shared192D0.unk11, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, 0x36); } static void ContestEffect_27(void) @@ -467,20 +459,20 @@ static void ContestEffect_27(void) for (r6 = 0; r6 < 4; r6++) { - if (shared192D0.unk0[shared192D0.unk11] > shared192D0.unk0[r6] && - sContestantStatus[r6].unkD > 0 && + if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[r6] && + sContestantStatus[r6].condition > 0 && sub_80B90C0(r6)) { - sContestantStatus[r6].unkD = 0; + sContestantStatus[r6].condition = 0; sContestantStatus[r6].unk10_4 = 2; - SetContestantStatusUnk13(r6, 13); + SetContestantEffectStringID(r6, 13); r8++; } } - SetContestantStatusUnk13(shared192D0.unk11, 12); + SetContestantEffectStringID(shared192D0.contestant, 12); if (r8 == 0) - SetContestantStatusUnk14(shared192D0.unk11, 0x39); + SetContestantEffectStringID2(shared192D0.contestant, 0x39); } static void ContestEffect_28(void) @@ -491,42 +483,42 @@ static void ContestEffect_28(void) for (r5 = 0; r5 < 4; r5++) { - if (shared192D0.unk0[shared192D0.unk11] > shared192D0.unk0[r5]) + if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[r5]) { - if (sContestantStatus[r5].unkD > 0) - shared192D0.unk4 = 40; + if (sContestantStatus[r5].condition > 0) + shared192D0.jam = 40; else - shared192D0.unk4 = 10; + shared192D0.jam = 10; shared192D0.unk8[0] = r5; shared192D0.unk8[1] = 0xFF; - if (sub_80B9120()) + if (WasAtLeastOneOpponentJammed()) r7++; } } - SetContestantStatusUnk13(shared192D0.unk11, 14); + SetContestantEffectStringID(shared192D0.contestant, 14); if (r7 == 0) - SetContestantStatusUnk14(shared192D0.unk11, 0x39); + SetContestantEffectStringID2(shared192D0.contestant, 0x39); } static void ContestEffect_29(void) // The appeal works great if performed first. { - if (gUnknown_02038696[shared192D0.unk11] == 0) + if (gUnknown_02038696[shared192D0.contestant] == 0) { - u16 move = curContestant->currMove; - curContestant->appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal; - SetContestantStatusUnk13(shared192D0.unk11, 15); + u16 move = sContestantStatus[shared192D0.contestant].currMove; + sContestantStatus[shared192D0.contestant].appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal; + SetContestantEffectStringID(shared192D0.contestant, 15); } } static void ContestEffect_30(void) // The appeal works great if performed last. { - if (gUnknown_02038696[shared192D0.unk11] == 3) + if (gUnknown_02038696[shared192D0.contestant] == 3) { - u16 move = curContestant->currMove; - curContestant->appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal; - SetContestantStatusUnk13(shared192D0.unk11, 16); + u16 move = sContestantStatus[shared192D0.contestant].currMove; + sContestantStatus[shared192D0.contestant].appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal; + SetContestantEffectStringID(shared192D0.contestant, 16); } } @@ -538,19 +530,19 @@ static void ContestEffect_31(void) for (r1 = 0, r3 = 0; r1 < 4; r1++) { - if (shared192D0.unk0[shared192D0.unk11] > shared192D0.unk0[r1]) + if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[r1]) r3 += sContestantStatus[r1].appeal2; } if (r3 < 0) r3 = 0; - if (shared192D0.unk0[shared192D0.unk11] == 0 || r3 == 0) - SetContestantStatusUnk13(shared192D0.unk11, 18); + if (shared192D0.turnOrder[shared192D0.contestant] == 0 || r3 == 0) + SetContestantEffectStringID(shared192D0.contestant, 18); else { - curContestant->appeal2 += r3 / 2; - SetContestantStatusUnk13(shared192D0.unk11, 17); + sContestantStatus[shared192D0.contestant].appeal2 += r3 / 2; + SetContestantEffectStringID(shared192D0.contestant, 17); } - sContestantStatus[shared192D0.unk11].appeal2 = RoundTowardsZero(sContestantStatus[shared192D0.unk11].appeal2); + sContestantStatus[shared192D0.contestant].appeal2 = RoundTowardsZero(sContestantStatus[shared192D0.contestant].appeal2); } static void ContestEffect_32(void) @@ -558,40 +550,40 @@ static void ContestEffect_32(void) { s16 r6 = 0; - if (shared192D0.unk0[shared192D0.unk11] != 0) + if (shared192D0.turnOrder[shared192D0.contestant] != 0) { int i; for (i = 0; i < 4; i++) { - if (shared192D0.unk0[shared192D0.unk11] - 1 == shared192D0.unk0[i]) + if (shared192D0.turnOrder[shared192D0.contestant] - 1 == shared192D0.turnOrder[i]) r6 = sContestantStatus[i].appeal2; } } - if (shared192D0.unk0[shared192D0.unk11] == 0 || r6 <= 0) - SetContestantStatusUnk13(shared192D0.unk11, 20); + if (shared192D0.turnOrder[shared192D0.contestant] == 0 || r6 <= 0) + SetContestantEffectStringID(shared192D0.contestant, 20); else { - curContestant->appeal2 += r6; - SetContestantStatusUnk13(shared192D0.unk11, 19); + sContestantStatus[shared192D0.contestant].appeal2 += r6; + SetContestantEffectStringID(shared192D0.contestant, 19); } } static void ContestEffect_33(void) // The appeal works better the later it is performed. { - u8 r3 = shared192D0.unk0[shared192D0.unk11]; + u8 r3 = shared192D0.turnOrder[shared192D0.contestant]; if (r3 == 0) - sContestantStatus[shared192D0.unk11].appeal2 = 10; + sContestantStatus[shared192D0.contestant].appeal2 = 10; else - sContestantStatus[shared192D0.unk11].appeal2 = 20 * r3; + sContestantStatus[shared192D0.contestant].appeal2 = 20 * r3; if (r3 == 0) - SetContestantStatusUnk13(shared192D0.unk11, 21); + SetContestantEffectStringID(shared192D0.contestant, 21); else if (r3 == 1) - SetContestantStatusUnk13(shared192D0.unk11, 22); + SetContestantEffectStringID(shared192D0.contestant, 22); else if (r3 == 2) - SetContestantStatusUnk13(shared192D0.unk11, 23); + SetContestantEffectStringID(shared192D0.contestant, 23); else - SetContestantStatusUnk13(shared192D0.unk11, 24); + SetContestantEffectStringID(shared192D0.contestant, 24); } static void ContestEffect_34(void) @@ -603,26 +595,26 @@ static void ContestEffect_34(void) if (r0 < 3) { r4 = 10; - SetContestantStatusUnk13(shared192D0.unk11, 26); + SetContestantEffectStringID(shared192D0.contestant, 26); } else if (r0 < 6) { r4 = 20; - SetContestantStatusUnk13(shared192D0.unk11, 27); + SetContestantEffectStringID(shared192D0.contestant, 27); } else if (r0 < 8) { r4 = 40; - SetContestantStatusUnk13(shared192D0.unk11, 28); + SetContestantEffectStringID(shared192D0.contestant, 28); } else if (r0 < 9) { r4 = 60; - SetContestantStatusUnk13(shared192D0.unk11, 29); + SetContestantEffectStringID(shared192D0.contestant, 29); } else { r4 = 80; - SetContestantStatusUnk13(shared192D0.unk11, 30); + SetContestantEffectStringID(shared192D0.contestant, 30); } - curContestant->appeal2 = r4; + sContestantStatus[shared192D0.contestant].appeal2 = r4; } #ifdef NONMATCHING @@ -633,21 +625,21 @@ static void ContestEffect_35(void) s8 r4; s8 r2; - for (r4 = shared192D0.unk0[shared192D0.unk11]; r4 > 0; r4--) + for (r4 = shared192D0.turnOrder[shared192D0.contestant]; r4 > 0; r4--) { for (r2 = 0; r2 < 4; r2++) { - if (shared192D0.unk0[r2] == r4 - 1) + if (shared192D0.turnOrder[r2] == r4 - 1) break; } - if (!(sContestantStatus[r2].unkB_7 || sContestantStatus[r2].unkC_0 || sContestantStatus[r2].unkC_1)) + if (!(sContestantStatus[r2].noMoreTurns || sContestantStatus[r2].nervous || sContestantStatus[r2].numTurnsSkipped)) { - u16 move = curContestant->currMove; + u16 move = sContestantStatus[shared192D0.contestant].currMove; if (gContestMoves[move].contestCategory == gContestMoves[sContestantStatus[r2].currMove].contestCategory) { - curContestant->appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2; - SetContestantStatusUnk13(shared192D0.unk11, 31); + sContestantStatus[shared192D0.contestant].appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2; + SetContestantEffectStringID(shared192D0.contestant, 31); } break; } @@ -759,7 +751,7 @@ __attribute__((naked)) void ContestEffect_35(void) "\tmov r2, r12\n" "\tldrb r0, [r2, 0x11]\n" "\tmovs r1, 0x1F\n" - "\tbl SetContestantStatusUnk13\n" + "\tbl SetContestantEffectStringID\n" "_080B8994:\n" "\tpop {r4-r7}\n" "\tpop {r0}\n" @@ -773,18 +765,18 @@ __attribute__((naked)) void ContestEffect_35(void) static void ContestEffect_36(void) // Works well if different in type than the one before. { - if (shared192D0.unk0[shared192D0.unk11] != 0) + if (shared192D0.turnOrder[shared192D0.contestant] != 0) { - u16 move = curContestant->currMove; + u16 move = sContestantStatus[shared192D0.contestant].currMove; int i; for (i = 0; i < 4; i++) { - if (shared192D0.unk0[shared192D0.unk11] - 1 == shared192D0.unk0[i] && + if (shared192D0.turnOrder[shared192D0.contestant] - 1 == shared192D0.turnOrder[i] && gContestMoves[move].contestCategory != gContestMoves[sContestantStatus[i].currMove].contestCategory) { - curContestant->appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2; - SetContestantStatusUnk13(shared192D0.unk11, 32); + sContestantStatus[shared192D0.contestant].appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2; + SetContestantEffectStringID(shared192D0.contestant, 32); break; } } @@ -794,23 +786,23 @@ static void ContestEffect_36(void) static void ContestEffect_37(void) // Affected by how well the appeal in front goes. { - if (shared192D0.unk0[shared192D0.unk11] != 0) + if (shared192D0.turnOrder[shared192D0.contestant] != 0) { int i; for (i = 0; i < 4; i++) { - if (shared192D0.unk0[shared192D0.unk11] - 1 == shared192D0.unk0[i]) + if (shared192D0.turnOrder[shared192D0.contestant] - 1 == shared192D0.turnOrder[i]) { - if (curContestant->appeal2 > sContestantStatus[i].appeal2) + if (sContestantStatus[shared192D0.contestant].appeal2 > sContestantStatus[i].appeal2) { - curContestant->appeal2 *= 2; - SetContestantStatusUnk13(shared192D0.unk11, 33); + sContestantStatus[shared192D0.contestant].appeal2 *= 2; + SetContestantEffectStringID(shared192D0.contestant, 33); } - else if (curContestant->appeal2 < sContestantStatus[i].appeal2) + else if (sContestantStatus[shared192D0.contestant].appeal2 < sContestantStatus[i].appeal2) { - curContestant->appeal2 = 0; - SetContestantStatusUnk13(shared192D0.unk11, 34); + sContestantStatus[shared192D0.contestant].appeal2 = 0; + SetContestantEffectStringID(shared192D0.contestant, 34); } } } @@ -820,24 +812,24 @@ static void ContestEffect_37(void) static void ContestEffect_38(void) // Ups the user’s condition. Helps prevent nervousness. { - if (curContestant->unkD < 30) + if (sContestantStatus[shared192D0.contestant].condition < 30) { - curContestant->unkD += 10; - curContestant->unk10_4 = 1; - SetContestantStatusUnk13(shared192D0.unk11, 35); + sContestantStatus[shared192D0.contestant].condition += 10; + sContestantStatus[shared192D0.contestant].unk10_4 = 1; + SetContestantEffectStringID(shared192D0.contestant, 35); } else - SetContestantStatusUnk13(shared192D0.unk11, 58); + SetContestantEffectStringID(shared192D0.contestant, 58); } static void ContestEffect_39(void) // The appeal works well if the user’s condition is good. { - curContestant->unk11_5 = TRUE; - if (curContestant->unkD != 0) - SetContestantStatusUnk13(shared192D0.unk11, 36); + sContestantStatus[shared192D0.contestant].unk11_5 = TRUE; + if (sContestantStatus[shared192D0.contestant].condition != 0) + SetContestantEffectStringID(shared192D0.contestant, 36); else - SetContestantStatusUnk13(shared192D0.unk11, 59); + SetContestantEffectStringID(shared192D0.contestant, 59); } static void ContestEffect_40(void) @@ -852,13 +844,13 @@ static void ContestEffect_40(void) for (i = 0; i < 4; i++) sp00[i] = sContestantStatus[i].unk19; - sp00[shared192D0.unk11] = 0xFF; + sp00[shared192D0.contestant] = 0xFF; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { - if (j != shared192D0.unk11 && + if (j != shared192D0.contestant && i == sp00[j] && sp00[j] == sContestantStatus[j].unk19) { @@ -870,15 +862,15 @@ static void ContestEffect_40(void) break; } - sp00[shared192D0.unk11] = 0; - curContestant->unk10_6 = 1; + sp00[shared192D0.contestant] = 0; + sContestantStatus[shared192D0.contestant].unk10_6 = 1; for (i = 0; i < 4; i++) { sContestantStatus[i].unk19 = sp00[i]; } - curContestant->unk11_0 = 1; - SetContestantStatusUnk13(shared192D0.unk11, 37); + sContestantStatus[shared192D0.contestant].unk11_0 = 1; + SetContestantEffectStringID(shared192D0.contestant, 37); } } @@ -894,13 +886,13 @@ static void ContestEffect_41(void) for (i = 0; i < 4; i++) sp00[i] = sContestantStatus[i].unk19; - sp00[shared192D0.unk11] = 0xFF; + sp00[shared192D0.contestant] = 0xFF; for (i = 3; i > -1; i--) { for (j = 0; j < 4; j++) { - if (j != shared192D0.unk11 && + if (j != shared192D0.contestant && i == sp00[j] && sp00[j] == sContestantStatus[j].unk19) { @@ -912,15 +904,15 @@ static void ContestEffect_41(void) break; } - sp00[shared192D0.unk11] = 3; - curContestant->unk10_6 = 1; + sp00[shared192D0.contestant] = 3; + sContestantStatus[shared192D0.contestant].unk10_6 = 1; for (i = 0; i < 4; i++) { sContestantStatus[i].unk19 = sp00[i]; } - curContestant->unk11_0 = 2; - SetContestantStatusUnk13(shared192D0.unk11, 38); + sContestantStatus[shared192D0.contestant].unk11_0 = 2; + SetContestantEffectStringID(shared192D0.contestant, 38); } } @@ -971,17 +963,17 @@ static void ContestEffect_43(void) sContestantStatus[i].unk19 = sp00[i]; sContestantStatus[i].unk10_6 = 2; } - curContestant->unk11_0 = 3; - SetContestantStatusUnk13(shared192D0.unk11, 39); + sContestantStatus[shared192D0.contestant].unk11_0 = 3; + SetContestantEffectStringID(shared192D0.contestant, 39); } } static void ContestEffect_44(void) // An appeal that excites the audience in any CONTEST. { - if (gContestMoves[curContestant->currMove].contestCategory != gSpecialVar_ContestCategory) + if (gContestMoves[sContestantStatus[shared192D0.contestant].currMove].contestCategory != gSpecialVar_ContestCategory) { - curContestant->unk11_4 = TRUE; + sContestantStatus[shared192D0.contestant].unk11_4 = TRUE; } } @@ -993,24 +985,24 @@ static void ContestEffect_45(void) for (i = 0; i < 4; i++) { - if (shared192D0.unk0[shared192D0.unk11] > shared192D0.unk0[i]) + if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[i]) { if (sContestantStatus[i].appeal2 > 0) { - shared192D0.unk4 = sContestantStatus[i].appeal2 / 2; - shared192D0.unk4 = RoundUp(shared192D0.unk4); + shared192D0.jam = sContestantStatus[i].appeal2 / 2; + shared192D0.jam = RoundUp(shared192D0.jam); } else - shared192D0.unk4 = 10; + shared192D0.jam = 10; shared192D0.unk8[0] = i; shared192D0.unk8[1] = 0xFF; - if (sub_80B9120()) + if (WasAtLeastOneOpponentJammed()) r7++; } } if (r7 == 0) - SetContestantStatusUnk14(shared192D0.unk11, 0x36); - SetContestantStatusUnk13(shared192D0.unk11, 48); + SetContestantEffectStringID2(shared192D0.contestant, 0x36); + SetContestantEffectStringID(shared192D0.contestant, 48); } static void ContestEffect_46(void) @@ -1021,80 +1013,80 @@ static void ContestEffect_46(void) if (sContest.applauseLevel == 0) { appeal = 10; - SetContestantStatusUnk13(shared192D0.unk11, 26); + SetContestantEffectStringID(shared192D0.contestant, 26); } else if (sContest.applauseLevel == 1) { appeal = 20; - SetContestantStatusUnk13(shared192D0.unk11, 27); + SetContestantEffectStringID(shared192D0.contestant, 27); } else if (sContest.applauseLevel == 2) { appeal = 30; - SetContestantStatusUnk13(shared192D0.unk11, 28); + SetContestantEffectStringID(shared192D0.contestant, 28); } else if (sContest.applauseLevel == 3) { appeal = 50; - SetContestantStatusUnk13(shared192D0.unk11, 29); + SetContestantEffectStringID(shared192D0.contestant, 29); } else { appeal = 60; - SetContestantStatusUnk13(shared192D0.unk11, 30); + SetContestantEffectStringID(shared192D0.contestant, 30); } - curContestant->appeal2 = appeal; + sContestantStatus[shared192D0.contestant].appeal2 = appeal; } static void ContestEffect_47(void) // Temporarily stops the crowd from growing excited. { - if (!shared19328.bits_8) + if (!shared19328.excitementFrozen) { - shared19328.bits_8 = TRUE; - shared19328.bits_9 = shared192D0.unk11; - SetContestantStatusUnk13(shared192D0.unk11, 61); + shared19328.excitementFrozen = TRUE; + shared19328.excitementFreezer = shared192D0.contestant; + SetContestantEffectStringID(shared192D0.contestant, 61); } } -static void sub_80B9038(u8 category) +static void JamByMoveCategory(u8 category) { int i; int r7 = 0; for (i = 0; i < 4; i++) { - if (shared192D0.unk0[shared192D0.unk11] > shared192D0.unk0[i]) + if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[i]) { if (category == gContestMoves[sContestantStatus[i].currMove].contestCategory) - shared192D0.unk4 = 40; + shared192D0.jam = 40; else - shared192D0.unk4 = 10; + shared192D0.jam = 10; shared192D0.unk8[0] = i; shared192D0.unk8[1] = 0xFF; - if (sub_80B9120()) + if (WasAtLeastOneOpponentJammed()) r7++; } } if (r7 == 0) - SetContestantStatusUnk14(shared192D0.unk11, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, 0x36); } #ifdef NONMATCHING static bool8 sub_80B90C0(u8 i) { shared192D0.unkD[i] = 1; - if (sContestantStatus[i].unk10_1) + if (sContestantStatus[i].immune) { - SetContestantStatusUnk13(i, 45); + SetContestantEffectStringID(i, 45); } - else if (sContestantStatus[i].unk12 != 0) + else if (sContestantStatus[i].jamSafetyCount != 0) { - sContestantStatus[i].unk12--; - SetContestantStatusUnk13(i, 44); + sContestantStatus[i].jamSafetyCount--; + SetContestantEffectStringID(i, 44); } - else if (!sContestantStatus[i].unkB_7 && sContestantStatus[i].unkC_1 == 0) + else if (!sContestantStatus[i].noMoreTurns && sContestantStatus[i].numTurnsSkipped == 0) return TRUE; return FALSE; } @@ -1147,7 +1139,7 @@ static __attribute__((naked)) bool8 sub_80B90C0(u8 i) "\tadds r0, r3, 0\n" "\tmovs r1, 0x2C\n" "_080B9116:\n" - "\tbl SetContestantStatusUnk13\n" + "\tbl SetContestantEffectStringID\n" "_080B911A:\n" "\tmovs r0, 0\n" "_080B911C:\n" @@ -1156,7 +1148,7 @@ static __attribute__((naked)) bool8 sub_80B90C0(u8 i) } #endif -static bool8 sub_80B9120(void) +static bool8 WasAtLeastOneOpponentJammed(void) { s16 sp00[4] = {0}; int i; @@ -1166,24 +1158,24 @@ static bool8 sub_80B9120(void) u8 r4 = shared192D0.unk8[i]; if (sub_80B90C0(r4)) { - shared192D0.unk6 = shared192D0.unk4; - if (sContestantStatus[r4].unk10_2) - shared192D0.unk6 *= 2; - if (sContestantStatus[r4].unk10_0) + shared192D0.jam2 = shared192D0.jam; + if (sContestantStatus[r4].moreEasilyStartled) + shared192D0.jam2 *= 2; + if (sContestantStatus[r4].resistant) { - shared192D0.unk6 = 10; - SetContestantStatusUnk13(r4, 47); + shared192D0.jam2 = 10; + SetContestantEffectStringID(r4, 47); } - else if ((shared192D0.unk6 -= sContestantStatus[r4].unkF) <= 0) + else if ((shared192D0.jam2 -= sContestantStatus[r4].jamReduction) <= 0) { - shared192D0.unk6 = 0; - SetContestantStatusUnk13(r4, 46); + shared192D0.jam2 = 0; + SetContestantEffectStringID(r4, 46); } else { - sub_80B9200(r4, shared192D0.unk6); - sub_80B141C(r4, shared192D0.unk6); - sp00[r4] = shared192D0.unk6; + sub_80B9200(r4, shared192D0.jam2); + sub_80B141C(r4, shared192D0.jam2); + sp00[r4] = shared192D0.jam2; } } } -- cgit v1.2.3 From ba9792e303bf8705334d2645167ae5e5a921460a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 31 Mar 2018 09:57:43 -0400 Subject: more renaming; wtf was that struct INCBIN_U8 nonsense --- src/contest_effect.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index ae082b0e5..6025453ca 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -54,8 +54,6 @@ static void sub_80B9200(u8, u8); static s16 RoundTowardsZero(s16); static s16 RoundUp(s16); -#define abs(x) ((x) >= 0 ? (x) : -(x)) - #include "data/contest_moves.h" bool8 AreMovesContestCombo(u16 lastMove, u16 nextMove) { @@ -144,8 +142,8 @@ static void ContestEffect_08(void) if (shared192D0.turnOrder[a] - 1 == shared192D0.turnOrder[i]) break; } - shared192D0.unk8[0] = i; - shared192D0.unk8[1] = 0xFF; + shared192D0.jamQueue[0] = i; + shared192D0.jamQueue[1] = 0xFF; idx = WasAtLeastOneOpponentJammed(); } if (idx == 0) @@ -165,8 +163,8 @@ static void ContestEffect_09(void) for (i = 0; i < 4; i++) if (shared192D0.turnOrder[a] > shared192D0.turnOrder[i]) - shared192D0.unk8[j++] = i; - shared192D0.unk8[j] = 0xFF; + shared192D0.jamQueue[j++] = i; + shared192D0.jamQueue[j] = 0xFF; idx = WasAtLeastOneOpponentJammed(); } if (idx == 0) @@ -178,7 +176,8 @@ static void ContestEffect_14(void) // Startles the POKéMON that appealed before the user. { u8 r0 = Random() % 10; - int r1 = 20; + int r1; + if (r0 < 2) r1 = 20; else if (r0 < 8) @@ -203,11 +202,12 @@ static void ContestEffect_15(void) { if (shared192D0.turnOrder[r6] > shared192D0.turnOrder[r5]) { - shared192D0.unk8[0] = r5; - shared192D0.unk8[1] = 0xFF; + shared192D0.jamQueue[0] = r5; + shared192D0.jamQueue[1] = 0xFF; { u8 r0 = Random() % 10; int r1; + if (r0 == 0) r1 = 0; else if (r0 <= 2) @@ -280,8 +280,8 @@ static void ContestEffect_17(void) shared192D0.jam = 50; else shared192D0.jam = 10; - shared192D0.unk8[0] = r5; - shared192D0.unk8[1] = 0xFF; + shared192D0.jamQueue[0] = r5; + shared192D0.jamQueue[1] = 0xFF; if (WasAtLeastOneOpponentJammed()) r9++; } @@ -489,8 +489,8 @@ static void ContestEffect_28(void) shared192D0.jam = 40; else shared192D0.jam = 10; - shared192D0.unk8[0] = r5; - shared192D0.unk8[1] = 0xFF; + shared192D0.jamQueue[0] = r5; + shared192D0.jamQueue[1] = 0xFF; if (WasAtLeastOneOpponentJammed()) r7++; } @@ -994,8 +994,8 @@ static void ContestEffect_45(void) } else shared192D0.jam = 10; - shared192D0.unk8[0] = i; - shared192D0.unk8[1] = 0xFF; + shared192D0.jamQueue[0] = i; + shared192D0.jamQueue[1] = 0xFF; if (WasAtLeastOneOpponentJammed()) r7++; } @@ -1062,8 +1062,8 @@ static void JamByMoveCategory(u8 category) shared192D0.jam = 40; else shared192D0.jam = 10; - shared192D0.unk8[0] = i; - shared192D0.unk8[1] = 0xFF; + shared192D0.jamQueue[0] = i; + shared192D0.jamQueue[1] = 0xFF; if (WasAtLeastOneOpponentJammed()) r7++; } @@ -1153,9 +1153,9 @@ static bool8 WasAtLeastOneOpponentJammed(void) s16 sp00[4] = {0}; int i; - for (i = 0; shared192D0.unk8[i] != 0xFF; i++) + for (i = 0; shared192D0.jamQueue[i] != 0xFF; i++) { - u8 r4 = shared192D0.unk8[i]; + u8 r4 = shared192D0.jamQueue[i]; if (sub_80B90C0(r4)) { shared192D0.jam2 = shared192D0.jam; -- cgit v1.2.3 From 15651e3011ec6858ce3364f8e14a72545e2ade0b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 31 Mar 2018 10:56:32 -0400 Subject: more renaming --- src/contest_effect.c | 57 ++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 6025453ca..1b81929c5 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -48,7 +48,7 @@ static void ContestEffect_45(void); static void ContestEffect_46(void); static void ContestEffect_47(void); static void JamByMoveCategory(u8); -static bool8 sub_80B90C0(u8); +static bool8 CanUnnerveContestant(u8); static u8 WasAtLeastOneOpponentJammed(void); static void sub_80B9200(u8, u8); static s16 RoundTowardsZero(s16); @@ -246,7 +246,7 @@ static void ContestEffect_16(void) { if (shared192D0.turnOrder[r7] > shared192D0.turnOrder[r6] && sContestantStatus[r6].hasJudgesAttention && - sub_80B90C0(r6)) + CanUnnerveContestant(r6)) { sContestantStatus[r6].hasJudgesAttention = FALSE; sContestantStatus[r6].unk15_5 = TRUE; @@ -356,7 +356,7 @@ static void ContestEffect_25(void) { if (shared192D0.turnOrder[shared192D0.contestant] + 1 == shared192D0.turnOrder[r5]) { - if (sub_80B90C0(r5)) + if (CanUnnerveContestant(r5)) { MakeContestantNervous(r5); SetContestantEffectStringID(r5, 10); @@ -428,7 +428,7 @@ static void ContestEffect_26(void) { if (Random() % 100 < sp10[r6] + sp08[sp00[r6]]) { - if (sub_80B90C0(sp00[r6])) + if (CanUnnerveContestant(sp00[r6])) { MakeContestantNervous(sp00[r6]); SetContestantEffectStringID(sp00[r6], 10); @@ -443,7 +443,7 @@ static void ContestEffect_26(void) SetContestantEffectStringID(sp00[r6], 60); r9++; } - shared192D0.unkD[sp00[r6]] = 1; + shared192D0.unnervedPokes[sp00[r6]] = 1; } } SetContestantEffectStringID(shared192D0.contestant, 11); @@ -461,10 +461,10 @@ static void ContestEffect_27(void) { if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[r6] && sContestantStatus[r6].condition > 0 && - sub_80B90C0(r6)) + CanUnnerveContestant(r6)) { sContestantStatus[r6].condition = 0; - sContestantStatus[r6].unk10_4 = 2; + sContestantStatus[r6].conditionMod = 2; SetContestantEffectStringID(r6, 13); r8++; } @@ -815,7 +815,7 @@ static void ContestEffect_38(void) if (sContestantStatus[shared192D0.contestant].condition < 30) { sContestantStatus[shared192D0.contestant].condition += 10; - sContestantStatus[shared192D0.contestant].unk10_4 = 1; + sContestantStatus[shared192D0.contestant].conditionMod = 1; SetContestantEffectStringID(shared192D0.contestant, 35); } else @@ -825,7 +825,7 @@ static void ContestEffect_38(void) static void ContestEffect_39(void) // The appeal works well if the user’s condition is good. { - sContestantStatus[shared192D0.contestant].unk11_5 = TRUE; + sContestantStatus[shared192D0.contestant].appealTripleCondition = TRUE; if (sContestantStatus[shared192D0.contestant].condition != 0) SetContestantEffectStringID(shared192D0.contestant, 36); else @@ -842,7 +842,7 @@ static void ContestEffect_40(void) if (sContest.turnNumber != 4) { for (i = 0; i < 4; i++) - sp00[i] = sContestantStatus[i].unk19; + sp00[i] = sContestantStatus[i].nextTurnOrder; sp00[shared192D0.contestant] = 0xFF; @@ -852,7 +852,7 @@ static void ContestEffect_40(void) { if (j != shared192D0.contestant && i == sp00[j] && - sp00[j] == sContestantStatus[j].unk19) + sp00[j] == sContestantStatus[j].nextTurnOrder) { sp00[j]++; break; @@ -863,13 +863,13 @@ static void ContestEffect_40(void) } sp00[shared192D0.contestant] = 0; - sContestantStatus[shared192D0.contestant].unk10_6 = 1; + sContestantStatus[shared192D0.contestant].turnOrderMod = 1; for (i = 0; i < 4; i++) { - sContestantStatus[i].unk19 = sp00[i]; + sContestantStatus[i].nextTurnOrder = sp00[i]; } - sContestantStatus[shared192D0.contestant].unk11_0 = 1; + sContestantStatus[shared192D0.contestant].turnOrderModAction = 1; SetContestantEffectStringID(shared192D0.contestant, 37); } } @@ -884,7 +884,7 @@ static void ContestEffect_41(void) if (sContest.turnNumber != 4) { for (i = 0; i < 4; i++) - sp00[i] = sContestantStatus[i].unk19; + sp00[i] = sContestantStatus[i].nextTurnOrder; sp00[shared192D0.contestant] = 0xFF; @@ -894,7 +894,7 @@ static void ContestEffect_41(void) { if (j != shared192D0.contestant && i == sp00[j] && - sp00[j] == sContestantStatus[j].unk19) + sp00[j] == sContestantStatus[j].nextTurnOrder) { sp00[j]--; break; @@ -905,13 +905,13 @@ static void ContestEffect_41(void) } sp00[shared192D0.contestant] = 3; - sContestantStatus[shared192D0.contestant].unk10_6 = 1; + sContestantStatus[shared192D0.contestant].turnOrderMod = 1; for (i = 0; i < 4; i++) { - sContestantStatus[i].unk19 = sp00[i]; + sContestantStatus[i].nextTurnOrder = sp00[i]; } - sContestantStatus[shared192D0.contestant].unk11_0 = 2; + sContestantStatus[shared192D0.contestant].turnOrderModAction = 2; SetContestantEffectStringID(shared192D0.contestant, 38); } } @@ -934,7 +934,7 @@ static void ContestEffect_43(void) { for (i = 0; i < 4; i++) { - sp00[i] = sContestantStatus[i].unk19; + sp00[i] = sContestantStatus[i].nextTurnOrder; sp04[i] = i; } @@ -960,10 +960,10 @@ static void ContestEffect_43(void) for (i = 0; i < 4; i++) { - sContestantStatus[i].unk19 = sp00[i]; - sContestantStatus[i].unk10_6 = 2; + sContestantStatus[i].nextTurnOrder = sp00[i]; + sContestantStatus[i].turnOrderMod = 2; } - sContestantStatus[shared192D0.contestant].unk11_0 = 3; + sContestantStatus[shared192D0.contestant].turnOrderModAction = 3; SetContestantEffectStringID(shared192D0.contestant, 39); } } @@ -973,7 +973,7 @@ static void ContestEffect_44(void) { if (gContestMoves[sContestantStatus[shared192D0.contestant].currMove].contestCategory != gSpecialVar_ContestCategory) { - sContestantStatus[shared192D0.contestant].unk11_4 = TRUE; + sContestantStatus[shared192D0.contestant].overrideCategoryExcitementMod = TRUE; } } @@ -1074,9 +1074,10 @@ static void JamByMoveCategory(u8 category) } #ifdef NONMATCHING -static bool8 sub_80B90C0(u8 i) +static bool8 CanUnnerveContestant(u8 i) { - shared192D0.unkD[i] = 1; + // For whatever reason, i is copied to r4. I cannot optimize this out. + shared192D0.unnervedPokes[i] = 1; if (sContestantStatus[i].immune) { SetContestantEffectStringID(i, 45); @@ -1091,7 +1092,7 @@ static bool8 sub_80B90C0(u8 i) return FALSE; } #else -static __attribute__((naked)) bool8 sub_80B90C0(u8 i) +static __attribute__((naked)) bool8 CanUnnerveContestant(u8 i) { asm_unified("\tpush {lr}\n" "\tlsls r0, 24\n" @@ -1156,7 +1157,7 @@ static bool8 WasAtLeastOneOpponentJammed(void) for (i = 0; shared192D0.jamQueue[i] != 0xFF; i++) { u8 r4 = shared192D0.jamQueue[i]; - if (sub_80B90C0(r4)) + if (CanUnnerveContestant(r4)) { shared192D0.jam2 = shared192D0.jam; if (sContestantStatus[r4].moreEasilyStartled) -- cgit v1.2.3 From f12861136737dbfeda72f50bc771c3613a651952 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 31 Mar 2018 11:58:36 -0400 Subject: Even more field/var renaming --- src/contest_effect.c | 384 +++++++++++++++++++++++++-------------------------- 1 file changed, 192 insertions(+), 192 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 1b81929c5..68d37701c 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -50,7 +50,7 @@ static void ContestEffect_47(void); static void JamByMoveCategory(u8); static bool8 CanUnnerveContestant(u8); static u8 WasAtLeastOneOpponentJammed(void); -static void sub_80B9200(u8, u8); +static void JamContestant(u8, u8); static s16 RoundTowardsZero(s16); static s16 RoundUp(s16); @@ -175,88 +175,88 @@ static void ContestEffect_09(void) static void ContestEffect_14(void) // Startles the POKéMON that appealed before the user. { - u8 r0 = Random() % 10; - int r1; + u8 rval = Random() % 10; + int jam; - if (r0 < 2) - r1 = 20; - else if (r0 < 8) - r1 = 40; + if (rval < 2) + jam = 20; + else if (rval < 8) + jam = 40; else - r1 = 60; - shared192D0.jam = r1; + jam = 60; + shared192D0.jam = jam; ContestEffect_08(); } static void ContestEffect_15(void) // Startles all POKéMON that appealed before the user. { - u8 r7 = 0; - u8 r6 = shared192D0.contestant; + u8 numStartled = 0; + u8 contestant = shared192D0.contestant; - if (shared192D0.turnOrder[r6] != 0) + if (shared192D0.turnOrder[contestant] != 0) { - int r5; + int i; - for (r5 = 0; r5 < 4; r5++) + for (i = 0; i < 4; i++) { - if (shared192D0.turnOrder[r6] > shared192D0.turnOrder[r5]) + if (shared192D0.turnOrder[contestant] > shared192D0.turnOrder[i]) { - shared192D0.jamQueue[0] = r5; + shared192D0.jamQueue[0] = i; shared192D0.jamQueue[1] = 0xFF; { - u8 r0 = Random() % 10; - int r1; - - if (r0 == 0) - r1 = 0; - else if (r0 <= 2) - r1 = 10; - else if (r0 <= 4) - r1 = 20; - else if (r0 <= 6) - r1 = 30; - else if (r0 <= 8) - r1 = 40; + u8 rval = Random() % 10; + int jam; + + if (rval == 0) + jam = 0; + else if (rval <= 2) + jam = 10; + else if (rval <= 4) + jam = 20; + else if (rval <= 6) + jam = 30; + else if (rval <= 8) + jam = 40; else - r1 = 60; - shared192D0.jam = r1; + jam = 60; + shared192D0.jam = jam; } if (WasAtLeastOneOpponentJammed()) - r7++; + numStartled++; } } } SetContestantEffectStringID(shared192D0.contestant, 48); - if (r7 == 0) + if (numStartled == 0) SetContestantEffectStringID2(shared192D0.contestant, 0x36); } static void ContestEffect_16(void) // Shifts the JUDGE’s attention from others. { - bool32 r9 = FALSE; - u8 r7 = shared192D0.contestant; + bool32 hitAny = FALSE; + u8 contestant = shared192D0.contestant; if (shared192D0.turnOrder[shared192D0.contestant] != 0) { - int r6; + int i; - for (r6 = 0; r6 < 4; r6++) + for (i = 0; i < 4; i++) { - if (shared192D0.turnOrder[r7] > shared192D0.turnOrder[r6] && - sContestantStatus[r6].hasJudgesAttention && - CanUnnerveContestant(r6)) + if (shared192D0.turnOrder[contestant] > shared192D0.turnOrder[i] && + sContestantStatus[i].hasJudgesAttention && + CanUnnerveContestant(i)) { - sContestantStatus[r6].hasJudgesAttention = FALSE; - sContestantStatus[r6].unk15_5 = TRUE; - SetContestantEffectStringID(r6, 8); - r9 = TRUE; + sContestantStatus[i].hasJudgesAttention = FALSE; + sContestantStatus[i].judgesAttentionWasRemoved = TRUE; + SetContestantEffectStringID(i, 8); + hitAny = TRUE; } } } SetContestantEffectStringID(shared192D0.contestant, 7); - if (!r9) + if (!hitAny) { SetContestantEffectStringID2(shared192D0.contestant, 0x36); } @@ -265,30 +265,30 @@ static void ContestEffect_16(void) static void ContestEffect_17(void) // Startles the POKéMON that has the JUDGE’s attention. { - u8 r9 = 0; - u8 r8 = shared192D0.contestant; + u8 numStartled = 0; + u8 contestant = shared192D0.contestant; if (shared192D0.turnOrder[shared192D0.contestant] != 0) { - int r5; + int i; - for (r5 = 0; r5 < 4; r5++) + for (i = 0; i < 4; i++) { - if (shared192D0.turnOrder[r8] > shared192D0.turnOrder[r5]) + if (shared192D0.turnOrder[contestant] > shared192D0.turnOrder[i]) { - if (sContestantStatus[r5].hasJudgesAttention) + if (sContestantStatus[i].hasJudgesAttention) shared192D0.jam = 50; else shared192D0.jam = 10; - shared192D0.jamQueue[0] = r5; + shared192D0.jamQueue[0] = i; shared192D0.jamQueue[1] = 0xFF; if (WasAtLeastOneOpponentJammed()) - r9++; + numStartled++; } } } SetContestantEffectStringID(shared192D0.contestant, 48); - if (r9 == 0) + if (numStartled == 0) SetContestantEffectStringID2(shared192D0.contestant, 0x36); } @@ -346,157 +346,157 @@ static void ContestEffect_24(void) static void ContestEffect_25(void) // Makes one POKéMON after the user nervous. { - bool32 r4 = FALSE; + bool32 hitAny = FALSE; if (shared192D0.turnOrder[shared192D0.contestant] != 3) { - int r5; + int i; - for (r5 = 0; r5 < 4; r5++) + for (i = 0; i < 4; i++) { - if (shared192D0.turnOrder[shared192D0.contestant] + 1 == shared192D0.turnOrder[r5]) + if (shared192D0.turnOrder[shared192D0.contestant] + 1 == shared192D0.turnOrder[i]) { - if (CanUnnerveContestant(r5)) + if (CanUnnerveContestant(i)) { - MakeContestantNervous(r5); - SetContestantEffectStringID(r5, 10); - r4 = TRUE; + MakeContestantNervous(i); + SetContestantEffectStringID(i, 10); + hitAny = TRUE; } else { - SetContestantEffectStringID(r5, 60); - r4 = TRUE; + SetContestantEffectStringID(i, 60); + hitAny = TRUE; } } } } SetContestantEffectStringID(shared192D0.contestant, 9); - if (!r4) + if (!hitAny) SetContestantEffectStringID2(shared192D0.contestant, 0x36); } static void ContestEffect_26(void) // Makes all POKéMON after the user nervous. { - u8 r9 = 0; - bool32 sp18 = FALSE; - u8 sp00[5]; - int r6; - int r4; - s16 sp08[4]; - s16 sp10[4]; - - memset(sp00, 0xFF, ARRAY_COUNT(sp00)); - for (r6 = 0, r4 = 0; r6 < 4; r6++) + u8 numUnnerved = 0; + bool32 contestantUnnerved = FALSE; + u8 contestantIds[5]; + int i; + int numAfter; + s16 oddsMod[4]; + s16 odds[4]; + + memset(contestantIds, 0xFF, ARRAY_COUNT(contestantIds)); + for (i = 0, numAfter = 0; i < 4; i++) { - if (shared192D0.turnOrder[shared192D0.contestant] < shared192D0.turnOrder[r6] && - !sContestantStatus[r6].nervous && !Contest_IsMonsTurnDisabled(r6)) - sp00[r4++] = r6; + if (shared192D0.turnOrder[shared192D0.contestant] < shared192D0.turnOrder[i] && + !sContestantStatus[i].nervous && !Contest_IsMonsTurnDisabled(i)) + contestantIds[numAfter++] = i; } - if (r4 == 1) + if (numAfter == 1) { - sp10[0] = 60; + odds[0] = 60; } - else if (r4 == 2) + else if (numAfter == 2) { - sp10[0] = 30; - sp10[1] = 30; + odds[0] = 30; + odds[1] = 30; } - else if (r4 == 3) + else if (numAfter == 3) { - sp10[0] = 20; - sp10[1] = 20; - sp10[2] = 20; + odds[0] = 20; + odds[1] = 20; + odds[2] = 20; } else { - for (r6 = 0; r6 < 4; r6++) - sp10[r6] = 0; + for (i = 0; i < 4; i++) + odds[i] = 0; } - for (r6 = 0; r6 < 4; r6++) + for (i = 0; i < 4; i++) { - if (sContestantStatus[r6].hasJudgesAttention && sub_80B214C(r6)) - sp08[r6] = gComboStarterLookupTable[gContestMoves[sContestantStatus[r6].prevMove].comboStarterId] * 10; + if (sContestantStatus[i].hasJudgesAttention && sub_80B214C(i)) + oddsMod[i] = gComboStarterLookupTable[gContestMoves[sContestantStatus[i].prevMove].comboStarterId] * 10; else - sp08[r6] = 0; - sp08[r6] -= (sContestantStatus[r6].condition / 10) * 10; + oddsMod[i] = 0; + oddsMod[i] -= (sContestantStatus[i].condition / 10) * 10; } - if (sp10[0] != 0) + if (odds[0] != 0) { - for (r6 = 0; sp00[r6] != 0xFF; r6++) + for (i = 0; contestantIds[i] != 0xFF; i++) { - if (Random() % 100 < sp10[r6] + sp08[sp00[r6]]) + if (Random() % 100 < odds[i] + oddsMod[contestantIds[i]]) { - if (CanUnnerveContestant(sp00[r6])) + if (CanUnnerveContestant(contestantIds[i])) { - MakeContestantNervous(sp00[r6]); - SetContestantEffectStringID(sp00[r6], 10); - r9++; + MakeContestantNervous(contestantIds[i]); + SetContestantEffectStringID(contestantIds[i], 10); + numUnnerved++; } else - sp18 = TRUE; + contestantUnnerved = TRUE; } else - sp18 = TRUE; - if (sp18) + contestantUnnerved = TRUE; + if (contestantUnnerved) { - sp18 = FALSE; - SetContestantEffectStringID(sp00[r6], 60); - r9++; + contestantUnnerved = FALSE; + SetContestantEffectStringID(contestantIds[i], 60); + numUnnerved++; } - shared192D0.unnervedPokes[sp00[r6]] = 1; + shared192D0.unnervedPokes[contestantIds[i]] = 1; } } SetContestantEffectStringID(shared192D0.contestant, 11); - if (r9 == 0) + if (numUnnerved == 0) SetContestantEffectStringID2(shared192D0.contestant, 0x36); } static void ContestEffect_27(void) // Worsens the condition of those that made appeals. { - u8 r8 = 0; - int r6; + u8 numHit = 0; + int i; - for (r6 = 0; r6 < 4; r6++) + for (i = 0; i < 4; i++) { - if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[r6] && - sContestantStatus[r6].condition > 0 && - CanUnnerveContestant(r6)) + if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[i] && + sContestantStatus[i].condition > 0 && + CanUnnerveContestant(i)) { - sContestantStatus[r6].condition = 0; - sContestantStatus[r6].conditionMod = 2; - SetContestantEffectStringID(r6, 13); - r8++; + sContestantStatus[i].condition = 0; + sContestantStatus[i].conditionMod = 2; + SetContestantEffectStringID(i, 13); + numHit++; } } SetContestantEffectStringID(shared192D0.contestant, 12); - if (r8 == 0) + if (numHit == 0) SetContestantEffectStringID2(shared192D0.contestant, 0x39); } static void ContestEffect_28(void) // Badly startles POKéMON in good condition. { - u8 r7 = 0; - int r5; + u8 numHit = 0; + int i; - for (r5 = 0; r5 < 4; r5++) + for (i = 0; i < 4; i++) { - if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[r5]) + if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[i]) { - if (sContestantStatus[r5].condition > 0) + if (sContestantStatus[i].condition > 0) shared192D0.jam = 40; else shared192D0.jam = 10; - shared192D0.jamQueue[0] = r5; + shared192D0.jamQueue[0] = i; shared192D0.jamQueue[1] = 0xFF; if (WasAtLeastOneOpponentJammed()) - r7++; + numHit++; } } SetContestantEffectStringID(shared192D0.contestant, 14); - if (r7 == 0) + if (numHit == 0) SetContestantEffectStringID2(shared192D0.contestant, 0x39); } @@ -525,21 +525,21 @@ static void ContestEffect_30(void) static void ContestEffect_31(void) // Makes the appeal as good as those before it. { - int r1; - int r3; + int i; + int appealSum; - for (r1 = 0, r3 = 0; r1 < 4; r1++) + for (i = 0, appealSum = 0; i < 4; i++) { - if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[r1]) - r3 += sContestantStatus[r1].appeal2; + if (shared192D0.turnOrder[shared192D0.contestant] > shared192D0.turnOrder[i]) + appealSum += sContestantStatus[i].appeal2; } - if (r3 < 0) - r3 = 0; - if (shared192D0.turnOrder[shared192D0.contestant] == 0 || r3 == 0) + if (appealSum < 0) + appealSum = 0; + if (shared192D0.turnOrder[shared192D0.contestant] == 0 || appealSum == 0) SetContestantEffectStringID(shared192D0.contestant, 18); else { - sContestantStatus[shared192D0.contestant].appeal2 += r3 / 2; + sContestantStatus[shared192D0.contestant].appeal2 += appealSum / 2; SetContestantEffectStringID(shared192D0.contestant, 17); } sContestantStatus[shared192D0.contestant].appeal2 = RoundTowardsZero(sContestantStatus[shared192D0.contestant].appeal2); @@ -548,7 +548,7 @@ static void ContestEffect_31(void) static void ContestEffect_32(void) // Makes the appeal as good as the one before it. { - s16 r6 = 0; + s16 appeal = 0; if (shared192D0.turnOrder[shared192D0.contestant] != 0) { @@ -556,14 +556,14 @@ static void ContestEffect_32(void) for (i = 0; i < 4; i++) { if (shared192D0.turnOrder[shared192D0.contestant] - 1 == shared192D0.turnOrder[i]) - r6 = sContestantStatus[i].appeal2; + appeal = sContestantStatus[i].appeal2; } } - if (shared192D0.turnOrder[shared192D0.contestant] == 0 || r6 <= 0) + if (shared192D0.turnOrder[shared192D0.contestant] == 0 || appeal <= 0) SetContestantEffectStringID(shared192D0.contestant, 20); else { - sContestantStatus[shared192D0.contestant].appeal2 += r6; + sContestantStatus[shared192D0.contestant].appeal2 += appeal; SetContestantEffectStringID(shared192D0.contestant, 19); } } @@ -571,16 +571,16 @@ static void ContestEffect_32(void) static void ContestEffect_33(void) // The appeal works better the later it is performed. { - u8 r3 = shared192D0.turnOrder[shared192D0.contestant]; - if (r3 == 0) + u8 whichTurn = shared192D0.turnOrder[shared192D0.contestant]; + if (whichTurn == 0) sContestantStatus[shared192D0.contestant].appeal2 = 10; else - sContestantStatus[shared192D0.contestant].appeal2 = 20 * r3; - if (r3 == 0) + sContestantStatus[shared192D0.contestant].appeal2 = 20 * whichTurn; + if (whichTurn == 0) SetContestantEffectStringID(shared192D0.contestant, 21); - else if (r3 == 1) + else if (whichTurn == 1) SetContestantEffectStringID(shared192D0.contestant, 22); - else if (r3 == 2) + else if (whichTurn == 2) SetContestantEffectStringID(shared192D0.contestant, 23); else SetContestantEffectStringID(shared192D0.contestant, 24); @@ -589,32 +589,32 @@ static void ContestEffect_33(void) static void ContestEffect_34(void) // The appeal’s quality varies depending on its timing. { - u8 r0 = Random() % 10; - s16 r4; + u8 rval = Random() % 10; + s16 appeal; - if (r0 < 3) + if (rval < 3) { - r4 = 10; + appeal = 10; SetContestantEffectStringID(shared192D0.contestant, 26); - } else if (r0 < 6) + } else if (rval < 6) { - r4 = 20; + appeal = 20; SetContestantEffectStringID(shared192D0.contestant, 27); - } else if (r0 < 8) + } else if (rval < 8) { - r4 = 40; + appeal = 40; SetContestantEffectStringID(shared192D0.contestant, 28); - } else if (r0 < 9) + } else if (rval < 9) { - r4 = 60; + appeal = 60; SetContestantEffectStringID(shared192D0.contestant, 29); } else { - r4 = 80; + appeal = 80; SetContestantEffectStringID(shared192D0.contestant, 30); } - sContestantStatus[shared192D0.contestant].appeal2 = r4; + sContestantStatus[shared192D0.contestant].appeal2 = appeal; } #ifdef NONMATCHING @@ -837,24 +837,24 @@ static void ContestEffect_40(void) { s8 i; s8 j; - u8 sp00[4]; + u8 turnOrder[4]; if (sContest.turnNumber != 4) { for (i = 0; i < 4; i++) - sp00[i] = sContestantStatus[i].nextTurnOrder; + turnOrder[i] = sContestantStatus[i].nextTurnOrder; - sp00[shared192D0.contestant] = 0xFF; + turnOrder[shared192D0.contestant] = 0xFF; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { if (j != shared192D0.contestant && - i == sp00[j] && - sp00[j] == sContestantStatus[j].nextTurnOrder) + i == turnOrder[j] && + turnOrder[j] == sContestantStatus[j].nextTurnOrder) { - sp00[j]++; + turnOrder[j]++; break; } } @@ -862,12 +862,12 @@ static void ContestEffect_40(void) break; } - sp00[shared192D0.contestant] = 0; + turnOrder[shared192D0.contestant] = 0; sContestantStatus[shared192D0.contestant].turnOrderMod = 1; for (i = 0; i < 4; i++) { - sContestantStatus[i].nextTurnOrder = sp00[i]; + sContestantStatus[i].nextTurnOrder = turnOrder[i]; } sContestantStatus[shared192D0.contestant].turnOrderModAction = 1; SetContestantEffectStringID(shared192D0.contestant, 37); @@ -879,24 +879,24 @@ static void ContestEffect_41(void) { s8 i; s8 j; - u8 sp00[4]; + u8 turnOrder[4]; if (sContest.turnNumber != 4) { for (i = 0; i < 4; i++) - sp00[i] = sContestantStatus[i].nextTurnOrder; + turnOrder[i] = sContestantStatus[i].nextTurnOrder; - sp00[shared192D0.contestant] = 0xFF; + turnOrder[shared192D0.contestant] = 0xFF; for (i = 3; i > -1; i--) { for (j = 0; j < 4; j++) { if (j != shared192D0.contestant && - i == sp00[j] && - sp00[j] == sContestantStatus[j].nextTurnOrder) + i == turnOrder[j] && + turnOrder[j] == sContestantStatus[j].nextTurnOrder) { - sp00[j]--; + turnOrder[j]--; break; } } @@ -904,12 +904,12 @@ static void ContestEffect_41(void) break; } - sp00[shared192D0.contestant] = 3; + turnOrder[shared192D0.contestant] = 3; sContestantStatus[shared192D0.contestant].turnOrderMod = 1; for (i = 0; i < 4; i++) { - sContestantStatus[i].nextTurnOrder = sp00[i]; + sContestantStatus[i].nextTurnOrder = turnOrder[i]; } sContestantStatus[shared192D0.contestant].turnOrderModAction = 2; SetContestantEffectStringID(shared192D0.contestant, 38); @@ -927,15 +927,15 @@ static void ContestEffect_43(void) { s8 i; s8 j; - u8 sp00[4]; - u8 sp04[4]; + u8 turnOrder[4]; + u8 unselectedContestants[4]; if (sContest.turnNumber != 4) { for (i = 0; i < 4; i++) { - sp00[i] = sContestantStatus[i].nextTurnOrder; - sp04[i] = i; + turnOrder[i] = sContestantStatus[i].nextTurnOrder; + unselectedContestants[i] = i; } for (i = 0; i < 4; i++) @@ -944,12 +944,12 @@ static void ContestEffect_43(void) for (j = 0; j < 4; j++) { - if (sp04[j] != 0xFF) + if (unselectedContestants[j] != 0xFF) { if (r4 == 0) { - sp00[j] = i; - sp04[j] = 0xFF; + turnOrder[j] = i; + unselectedContestants[j] = 0xFF; break; } else @@ -960,7 +960,7 @@ static void ContestEffect_43(void) for (i = 0; i < 4; i++) { - sContestantStatus[i].nextTurnOrder = sp00[i]; + sContestantStatus[i].nextTurnOrder = turnOrder[i]; sContestantStatus[i].turnOrderMod = 2; } sContestantStatus[shared192D0.contestant].turnOrderModAction = 3; @@ -1052,7 +1052,7 @@ static void ContestEffect_47(void) static void JamByMoveCategory(u8 category) { int i; - int r7 = 0; + int numJammed = 0; for (i = 0; i < 4; i++) { @@ -1065,11 +1065,11 @@ static void JamByMoveCategory(u8 category) shared192D0.jamQueue[0] = i; shared192D0.jamQueue[1] = 0xFF; if (WasAtLeastOneOpponentJammed()) - r7++; + numJammed++; } } - if (r7 == 0) + if (numJammed == 0) SetContestantEffectStringID2(shared192D0.contestant, 0x36); } @@ -1151,7 +1151,7 @@ static __attribute__((naked)) bool8 CanUnnerveContestant(u8 i) static bool8 WasAtLeastOneOpponentJammed(void) { - s16 sp00[4] = {0}; + s16 jamBuffer[4] = {0}; int i; for (i = 0; shared192D0.jamQueue[i] != 0xFF; i++) @@ -1174,25 +1174,25 @@ static bool8 WasAtLeastOneOpponentJammed(void) } else { - sub_80B9200(r4, shared192D0.jam2); + JamContestant(r4, shared192D0.jam2); sub_80B141C(r4, shared192D0.jam2); - sp00[r4] = shared192D0.jam2; + jamBuffer[r4] = shared192D0.jam2; } } } for (i = 0; i < 4; i++) { - if (sp00[i] != 0) + if (jamBuffer[i] != 0) return TRUE; } return FALSE; } -static void sub_80B9200(u8 i, u8 jam) +static void JamContestant(u8 i, u8 jam) { sContestantStatus[i].appeal2 -= jam; - sContestantStatus[i].unkE += jam; + sContestantStatus[i].jam += jam; } static s16 RoundTowardsZero(s16 score) -- cgit v1.2.3 From 707970c982bbe758cc48ce6f772616eaf80b647a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 31 Mar 2018 13:11:13 -0400 Subject: CONTEST_STRING enums --- src/contest_effect.c | 152 +++++++++++++++++++++++++-------------------------- 1 file changed, 76 insertions(+), 76 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 68d37701c..42202e955 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -82,14 +82,14 @@ static void ContestEffect_01(void) // After this move, the user is more easily startled. { sContestantStatus[shared192D0.contestant].moreEasilyStartled = TRUE; - SetContestantEffectStringID(shared192D0.contestant, 0); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_MORE_CONSCIOUS); } static void ContestEffect_02(void) // Makes a great appeal, but allows no more to the end. { sContestantStatus[shared192D0.contestant].exploded = TRUE; - SetContestantEffectStringID(shared192D0.contestant, 1); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_NO_APPEAL); } static void ContestEffect_03(void) @@ -104,28 +104,28 @@ static void ContestEffect_04(void) // Can avoid being startled by others once. { sContestantStatus[shared192D0.contestant].jamSafetyCount = 1; - SetContestantEffectStringID(shared192D0.contestant, 2); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_SETTLE_DOWN); } static void ContestEffect_05(void) // Can avoid being startled by others. { sContestantStatus[shared192D0.contestant].immune = TRUE; - SetContestantEffectStringID(shared192D0.contestant, 3); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_OBLIVIOUS_TO_OTHERS); } static void ContestEffect_06(void) // Can avoid being startled by others a little. { sContestantStatus[shared192D0.contestant].jamReduction = 20; - SetContestantEffectStringID(shared192D0.contestant, 4); + SetContestantEffectStringID(shared192D0.contestant,CONTEST_STRING_LESS_AWARE); } static void ContestEffect_07(void) // After this move, the user is less likely to be startled. { sContestantStatus[shared192D0.contestant].resistant = TRUE; - SetContestantEffectStringID(shared192D0.contestant, 5); + SetContestantEffectStringID(shared192D0.contestant,CONTEST_STRING_STOPPED_CARING); } static void ContestEffect_08(void) @@ -147,8 +147,8 @@ static void ContestEffect_08(void) idx = WasAtLeastOneOpponentJammed(); } if (idx == 0) - SetContestantEffectStringID2(shared192D0.contestant, 0x36); - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } static void ContestEffect_09(void) @@ -168,8 +168,8 @@ static void ContestEffect_09(void) idx = WasAtLeastOneOpponentJammed(); } if (idx == 0) - SetContestantEffectStringID2(shared192D0.contestant, 0x36); - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } static void ContestEffect_14(void) @@ -227,9 +227,9 @@ static void ContestEffect_15(void) } } } - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); if (numStartled == 0) - SetContestantEffectStringID2(shared192D0.contestant, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } static void ContestEffect_16(void) @@ -250,15 +250,15 @@ static void ContestEffect_16(void) { sContestantStatus[i].hasJudgesAttention = FALSE; sContestantStatus[i].judgesAttentionWasRemoved = TRUE; - SetContestantEffectStringID(i, 8); + SetContestantEffectStringID(i, CONTEST_STRING_JUDGE_LOOK_AWAY2); hitAny = TRUE; } } } - SetContestantEffectStringID(shared192D0.contestant, 7); + SetContestantEffectStringID(shared192D0.contestant,CONTEST_STRING_DAZZLE_ATTEMPT); if (!hitAny) { - SetContestantEffectStringID2(shared192D0.contestant, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } } @@ -287,9 +287,9 @@ static void ContestEffect_17(void) } } } - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); if (numStartled == 0) - SetContestantEffectStringID2(shared192D0.contestant, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } static void ContestEffect_18(void) @@ -297,7 +297,7 @@ static void ContestEffect_18(void) { sContestantStatus[shared192D0.contestant].turnSkipped = TRUE; ContestEffect_09(); - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } static void ContestEffect_19(void) @@ -305,42 +305,42 @@ static void ContestEffect_19(void) { u16 move = sContestantStatus[shared192D0.contestant].currMove; JamByMoveCategory(gContestMoves[move].contestCategory); - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } static void ContestEffect_20(void) // Badly startles POKéMON that made COOL appeals. { JamByMoveCategory(CONTEST_CATEGORY_COOL); - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } static void ContestEffect_21(void) // Badly startles POKéMON that made BEAUTY appeals. { JamByMoveCategory(CONTEST_CATEGORY_BEAUTY); - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } static void ContestEffect_22(void) // Badly startles POKéMON that made CUTE appeals. { JamByMoveCategory(CONTEST_CATEGORY_CUTE); - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } static void ContestEffect_23(void) // Badly startles POKéMON that made SMART appeals. { JamByMoveCategory(CONTEST_CATEGORY_SMART); - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } static void ContestEffect_24(void) // Badly startles POKéMON that made TOUGH appeals. { JamByMoveCategory(CONTEST_CATEGORY_TOUGH); - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } static void ContestEffect_25(void) @@ -359,20 +359,20 @@ static void ContestEffect_25(void) if (CanUnnerveContestant(i)) { MakeContestantNervous(i); - SetContestantEffectStringID(i, 10); + SetContestantEffectStringID(i, CONTEST_STRING_NERVOUS); hitAny = TRUE; } else { - SetContestantEffectStringID(i, 60); + SetContestantEffectStringID(i, CONTEST_STRING_UNAFFECTED); hitAny = TRUE; } } } } - SetContestantEffectStringID(shared192D0.contestant, 9); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_UNNERVE_ATTEMPT); if (!hitAny) - SetContestantEffectStringID2(shared192D0.contestant, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } static void ContestEffect_26(void) @@ -431,7 +431,7 @@ static void ContestEffect_26(void) if (CanUnnerveContestant(contestantIds[i])) { MakeContestantNervous(contestantIds[i]); - SetContestantEffectStringID(contestantIds[i], 10); + SetContestantEffectStringID(contestantIds[i], CONTEST_STRING_NERVOUS); numUnnerved++; } else contestantUnnerved = TRUE; @@ -440,15 +440,15 @@ static void ContestEffect_26(void) if (contestantUnnerved) { contestantUnnerved = FALSE; - SetContestantEffectStringID(contestantIds[i], 60); + SetContestantEffectStringID(contestantIds[i], CONTEST_STRING_UNAFFECTED); numUnnerved++; } shared192D0.unnervedPokes[contestantIds[i]] = 1; } } - SetContestantEffectStringID(shared192D0.contestant, 11); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_UNNERVE_WAITING); if (numUnnerved == 0) - SetContestantEffectStringID2(shared192D0.contestant, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } static void ContestEffect_27(void) @@ -465,14 +465,14 @@ static void ContestEffect_27(void) { sContestantStatus[i].condition = 0; sContestantStatus[i].conditionMod = 2; - SetContestantEffectStringID(i, 13); + SetContestantEffectStringID(i, CONTEST_STRING_REGAINED_FORM); numHit++; } } - SetContestantEffectStringID(shared192D0.contestant, 12); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_TAUNT_WELL); if (numHit == 0) - SetContestantEffectStringID2(shared192D0.contestant, 0x39); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_IGNORED); } static void ContestEffect_28(void) @@ -495,9 +495,9 @@ static void ContestEffect_28(void) numHit++; } } - SetContestantEffectStringID(shared192D0.contestant, 14); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_JAM_WELL); if (numHit == 0) - SetContestantEffectStringID2(shared192D0.contestant, 0x39); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_IGNORED); } static void ContestEffect_29(void) @@ -507,7 +507,7 @@ static void ContestEffect_29(void) { u16 move = sContestantStatus[shared192D0.contestant].currMove; sContestantStatus[shared192D0.contestant].appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal; - SetContestantEffectStringID(shared192D0.contestant, 15); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_HUSTLE_STANDOUT); } } @@ -518,7 +518,7 @@ static void ContestEffect_30(void) { u16 move = sContestantStatus[shared192D0.contestant].currMove; sContestantStatus[shared192D0.contestant].appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal; - SetContestantEffectStringID(shared192D0.contestant, 16); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_WORK_HARD_UNNOTICED); } } @@ -536,11 +536,11 @@ static void ContestEffect_31(void) if (appealSum < 0) appealSum = 0; if (shared192D0.turnOrder[shared192D0.contestant] == 0 || appealSum == 0) - SetContestantEffectStringID(shared192D0.contestant, 18); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_NOT_WELL); else { sContestantStatus[shared192D0.contestant].appeal2 += appealSum / 2; - SetContestantEffectStringID(shared192D0.contestant, 17); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_WORK_BEFORE); } sContestantStatus[shared192D0.contestant].appeal2 = RoundTowardsZero(sContestantStatus[shared192D0.contestant].appeal2); } @@ -560,11 +560,11 @@ static void ContestEffect_32(void) } } if (shared192D0.turnOrder[shared192D0.contestant] == 0 || appeal <= 0) - SetContestantEffectStringID(shared192D0.contestant, 20); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_NOT_WELL2); else { sContestantStatus[shared192D0.contestant].appeal2 += appeal; - SetContestantEffectStringID(shared192D0.contestant, 19); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_WORK_PRECEDING); } } @@ -577,13 +577,13 @@ static void ContestEffect_33(void) else sContestantStatus[shared192D0.contestant].appeal2 = 20 * whichTurn; if (whichTurn == 0) - SetContestantEffectStringID(shared192D0.contestant, 21); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_NOT_SHOWN_WELL); else if (whichTurn == 1) - SetContestantEffectStringID(shared192D0.contestant, 22); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL); else if (whichTurn == 2) - SetContestantEffectStringID(shared192D0.contestant, 23); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL); else - SetContestantEffectStringID(shared192D0.contestant, 24); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY); } static void ContestEffect_34(void) @@ -595,24 +595,24 @@ static void ContestEffect_34(void) if (rval < 3) { appeal = 10; - SetContestantEffectStringID(shared192D0.contestant, 26); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_NOT_VERY_WELL); } else if (rval < 6) { appeal = 20; - SetContestantEffectStringID(shared192D0.contestant, 27); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL2); } else if (rval < 8) { appeal = 40; - SetContestantEffectStringID(shared192D0.contestant, 28); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL2); } else if (rval < 9) { appeal = 60; - SetContestantEffectStringID(shared192D0.contestant, 29); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_VERY_WELL); } else { appeal = 80; - SetContestantEffectStringID(shared192D0.contestant, 30); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY2); } sContestantStatus[shared192D0.contestant].appeal2 = appeal; } @@ -639,7 +639,7 @@ static void ContestEffect_35(void) if (gContestMoves[move].contestCategory == gContestMoves[sContestantStatus[r2].currMove].contestCategory) { sContestantStatus[shared192D0.contestant].appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2; - SetContestantEffectStringID(shared192D0.contestant, 31); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_SAME_TYPE_GOOD); } break; } @@ -776,7 +776,7 @@ static void ContestEffect_36(void) gContestMoves[move].contestCategory != gContestMoves[sContestantStatus[i].currMove].contestCategory) { sContestantStatus[shared192D0.contestant].appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2; - SetContestantEffectStringID(shared192D0.contestant, 32); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_DIFF_TYPE_GOOD); break; } } @@ -797,12 +797,12 @@ static void ContestEffect_37(void) if (sContestantStatus[shared192D0.contestant].appeal2 > sContestantStatus[i].appeal2) { sContestantStatus[shared192D0.contestant].appeal2 *= 2; - SetContestantEffectStringID(shared192D0.contestant, 33); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_STOOD_OUT_AS_MUCH); } else if (sContestantStatus[shared192D0.contestant].appeal2 < sContestantStatus[i].appeal2) { sContestantStatus[shared192D0.contestant].appeal2 = 0; - SetContestantEffectStringID(shared192D0.contestant, 34); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_NOT_AS_WELL); } } } @@ -816,10 +816,10 @@ static void ContestEffect_38(void) { sContestantStatus[shared192D0.contestant].condition += 10; sContestantStatus[shared192D0.contestant].conditionMod = 1; - SetContestantEffectStringID(shared192D0.contestant, 35); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_CONDITION_ROSE); } else - SetContestantEffectStringID(shared192D0.contestant, 58); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_NO_CONDITION_IMPROVE); } static void ContestEffect_39(void) @@ -827,9 +827,9 @@ static void ContestEffect_39(void) { sContestantStatus[shared192D0.contestant].appealTripleCondition = TRUE; if (sContestantStatus[shared192D0.contestant].condition != 0) - SetContestantEffectStringID(shared192D0.contestant, 36); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_HOT_STATUS); else - SetContestantEffectStringID(shared192D0.contestant, 59); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_BAD_CONDITION_WEAK_APPEAL); } static void ContestEffect_40(void) @@ -870,7 +870,7 @@ static void ContestEffect_40(void) sContestantStatus[i].nextTurnOrder = turnOrder[i]; } sContestantStatus[shared192D0.contestant].turnOrderModAction = 1; - SetContestantEffectStringID(shared192D0.contestant, 37); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_MOVE_UP_LINE); } } @@ -912,7 +912,7 @@ static void ContestEffect_41(void) sContestantStatus[i].nextTurnOrder = turnOrder[i]; } sContestantStatus[shared192D0.contestant].turnOrderModAction = 2; - SetContestantEffectStringID(shared192D0.contestant, 38); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_MOVE_BACK_LINE); } } @@ -964,7 +964,7 @@ static void ContestEffect_43(void) sContestantStatus[i].turnOrderMod = 2; } sContestantStatus[shared192D0.contestant].turnOrderModAction = 3; - SetContestantEffectStringID(shared192D0.contestant, 39); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_SCRAMBLE_ORDER); } } @@ -1001,8 +1001,8 @@ static void ContestEffect_45(void) } } if (r7 == 0) - SetContestantEffectStringID2(shared192D0.contestant, 0x36); - SetContestantEffectStringID(shared192D0.contestant, 48); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } static void ContestEffect_46(void) @@ -1013,27 +1013,27 @@ static void ContestEffect_46(void) if (sContest.applauseLevel == 0) { appeal = 10; - SetContestantEffectStringID(shared192D0.contestant, 26); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_NOT_VERY_WELL); } else if (sContest.applauseLevel == 1) { appeal = 20; - SetContestantEffectStringID(shared192D0.contestant, 27); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL2); } else if (sContest.applauseLevel == 2) { appeal = 30; - SetContestantEffectStringID(shared192D0.contestant, 28); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL2); } else if (sContest.applauseLevel == 3) { appeal = 50; - SetContestantEffectStringID(shared192D0.contestant, 29); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_VERY_WELL); } else { appeal = 60; - SetContestantEffectStringID(shared192D0.contestant, 30); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY2); } sContestantStatus[shared192D0.contestant].appeal2 = appeal; } @@ -1045,7 +1045,7 @@ static void ContestEffect_47(void) { shared19328.excitementFrozen = TRUE; shared19328.excitementFreezer = shared192D0.contestant; - SetContestantEffectStringID(shared192D0.contestant, 61); + SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTRACTED_ATTENTION); } } @@ -1070,7 +1070,7 @@ static void JamByMoveCategory(u8 category) } if (numJammed == 0) - SetContestantEffectStringID2(shared192D0.contestant, 0x36); + SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } #ifdef NONMATCHING @@ -1080,12 +1080,12 @@ static bool8 CanUnnerveContestant(u8 i) shared192D0.unnervedPokes[i] = 1; if (sContestantStatus[i].immune) { - SetContestantEffectStringID(i, 45); + SetContestantEffectStringID(i, CONTEST_STRING_AVOID_SEEING); } else if (sContestantStatus[i].jamSafetyCount != 0) { sContestantStatus[i].jamSafetyCount--; - SetContestantEffectStringID(i, 44); + SetContestantEffectStringID(i, CONTEST_STRING_AVERT_GAZE); } else if (!sContestantStatus[i].noMoreTurns && sContestantStatus[i].numTurnsSkipped == 0) return TRUE; @@ -1165,12 +1165,12 @@ static bool8 WasAtLeastOneOpponentJammed(void) if (sContestantStatus[r4].resistant) { shared192D0.jam2 = 10; - SetContestantEffectStringID(r4, 47); + SetContestantEffectStringID(r4, CONTEST_STRING_LITTLE_DISTRACTED); } else if ((shared192D0.jam2 -= sContestantStatus[r4].jamReduction) <= 0) { shared192D0.jam2 = 0; - SetContestantEffectStringID(r4, 46); + SetContestantEffectStringID(r4, CONTEST_STRING_NOT_FAZED); } else { -- cgit v1.2.3 From 20f41da2d2538c81d53ece27d17ead845a40ccd5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 31 Mar 2018 14:03:53 -0400 Subject: Still more renaming of vars --- src/contest_effect.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 42202e955..f3b44d4aa 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -940,20 +940,20 @@ static void ContestEffect_43(void) for (i = 0; i < 4; i++) { - u8 r4 = Random() % (4 - i); + u8 rval = Random() % (4 - i); for (j = 0; j < 4; j++) { if (unselectedContestants[j] != 0xFF) { - if (r4 == 0) + if (rval == 0) { turnOrder[j] = i; unselectedContestants[j] = 0xFF; break; } else - r4--; + rval--; } } } @@ -981,7 +981,7 @@ static void ContestEffect_45(void) // Badly startles all POKéMON that made good appeals. { int i; - u8 r7 = 0; + u8 numJammed = 0; for (i = 0; i < 4; i++) { @@ -997,10 +997,10 @@ static void ContestEffect_45(void) shared192D0.jamQueue[0] = i; shared192D0.jamQueue[1] = 0xFF; if (WasAtLeastOneOpponentJammed()) - r7++; + numJammed++; } } - if (r7 == 0) + if (numJammed == 0) SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } @@ -1156,27 +1156,27 @@ static bool8 WasAtLeastOneOpponentJammed(void) for (i = 0; shared192D0.jamQueue[i] != 0xFF; i++) { - u8 r4 = shared192D0.jamQueue[i]; - if (CanUnnerveContestant(r4)) + u8 contestant = shared192D0.jamQueue[i]; + if (CanUnnerveContestant(contestant)) { shared192D0.jam2 = shared192D0.jam; - if (sContestantStatus[r4].moreEasilyStartled) + if (sContestantStatus[contestant].moreEasilyStartled) shared192D0.jam2 *= 2; - if (sContestantStatus[r4].resistant) + if (sContestantStatus[contestant].resistant) { shared192D0.jam2 = 10; - SetContestantEffectStringID(r4, CONTEST_STRING_LITTLE_DISTRACTED); + SetContestantEffectStringID(contestant, CONTEST_STRING_LITTLE_DISTRACTED); } - else if ((shared192D0.jam2 -= sContestantStatus[r4].jamReduction) <= 0) + else if ((shared192D0.jam2 -= sContestantStatus[contestant].jamReduction) <= 0) { shared192D0.jam2 = 0; - SetContestantEffectStringID(r4, CONTEST_STRING_NOT_FAZED); + SetContestantEffectStringID(contestant, CONTEST_STRING_NOT_FAZED); } else { - JamContestant(r4, shared192D0.jam2); - sub_80B141C(r4, shared192D0.jam2); - jamBuffer[r4] = shared192D0.jam2; + JamContestant(contestant, shared192D0.jam2); + SetStartledString(contestant, shared192D0.jam2); + jamBuffer[contestant] = shared192D0.jam2; } } } @@ -1197,21 +1197,21 @@ static void JamContestant(u8 i, u8 jam) static s16 RoundTowardsZero(s16 score) { - s16 r1 = abs(score) % 10; + s16 absScore = abs(score) % 10; if (score < 0) { - if (r1 != 0) - score -= 10 - r1; + if (absScore != 0) + score -= 10 - absScore; } else - score -= r1; + score -= absScore; return score; } static s16 RoundUp(s16 score) { - s16 r1 = abs(score) % 10; - if (r1 != 0) - score += 10 - r1; + s16 absScore = abs(score) % 10; + if (absScore != 0) + score += 10 - absScore; return score; } -- cgit v1.2.3 From 989a6449a360702d067b6ce63a065effc767dff8 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 5 Apr 2018 20:07:59 -0700 Subject: Give descriptive names to Contest effect functions --- src/contest_effect.c | 182 +++++++++++++++++++++++++-------------------------- 1 file changed, 91 insertions(+), 91 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index f3b44d4aa..604bccd07 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -3,50 +3,50 @@ #include "random.h" #include "contest.h" -static void ContestEffect_00(void); -static void ContestEffect_01(void); -static void ContestEffect_02(void); -static void ContestEffect_03(void); -static void ContestEffect_04(void); -static void ContestEffect_05(void); -static void ContestEffect_06(void); -static void ContestEffect_07(void); -static void ContestEffect_08(void); -static void ContestEffect_09(void); -static void ContestEffect_14(void); -static void ContestEffect_15(void); -static void ContestEffect_16(void); -static void ContestEffect_17(void); -static void ContestEffect_18(void); -static void ContestEffect_19(void); -static void ContestEffect_20(void); -static void ContestEffect_21(void); -static void ContestEffect_22(void); -static void ContestEffect_23(void); -static void ContestEffect_24(void); -static void ContestEffect_25(void); -static void ContestEffect_26(void); -static void ContestEffect_27(void); -static void ContestEffect_28(void); -static void ContestEffect_29(void); -static void ContestEffect_30(void); -static void ContestEffect_31(void); -static void ContestEffect_32(void); -static void ContestEffect_33(void); -static void ContestEffect_34(void); -static void ContestEffect_35(void); -static void ContestEffect_36(void); -static void ContestEffect_37(void); -static void ContestEffect_38(void); -static void ContestEffect_39(void); -static void ContestEffect_40(void); -static void ContestEffect_41(void); -static void ContestEffect_42(void); -static void ContestEffect_43(void); -static void ContestEffect_44(void); -static void ContestEffect_45(void); -static void ContestEffect_46(void); -static void ContestEffect_47(void); +static void ContestEffect_HighlyAppealing(void); +static void ContestEffect_UserMoreEasilyStartled(void); +static void ContestEffect_GreatAppealButNoMoreMoves(void); +static void ContestEffect_RepetitionNotBoring(void); +static void ContestEffect_AvoidStartleOnce(void); +static void ContestEffect_AvoidStartle(void); +static void ContestEffect_AvoidStartleSlightly(void); +static void ContestEffect_UserLessEasilyStartled(void); +static void ContestEffect_StartleFrontMon(void); +static void ContestEffect_StartlePrevMons(void); +static void ContestEffect_StartlePrevMon2(void); +static void ContestEffect_StartlePrevMons2(void); +static void ContestEffect_ShiftJudgeAttention(void); +static void ContestEffect_StartleMonWithJudgesAttention(void); +static void ContestEffect_JamsOthersButMissOneTurn(void); +static void ContestEffect_StartleMonsSameTypeAppeal(void); +static void ContestEffect_StartleMonsCoolAppeal(void); +static void ContestEffect_StartleMonsBeautyAppeal(void); +static void ContestEffect_StartleMonsCuteAppeal(void); +static void ContestEffect_StartleMonsSmartAppeal(void); +static void ContestEffect_StartleMonsToughAppeal(void); +static void ContestEffect_MakeFollowingMonNervous(void); +static void ContestEffect_MakeFollowingMonsNervous(void); +static void ContestEffect_WorsenConditionOfPrevMons(void); +static void ContestEffect_BadlyStartlesMonsInGoodCondition(void); +static void ContestEffect_BetterIfFirst(void); +static void ContestEffect_BetterIfLast(void); +static void ContestEffect_AppealAsGoodAsPrevOnes(void); +static void ContestEffect_AppealAsGoodAsPrevOne(void); +static void ContestEffect_BetterWhenLater(void); +static void ContestEffect_QualityDependsOnTiming(void); +static void ContestEffect_BetterIfSameType(void); +static void ContestEffect_BetterIfDiffType(void); +static void ContestEffect_AffectedByPrevAppeal(void); +static void ContestEffect_ImproveConditionPreventNervousness(void); +static void ContestEffect_BetterWithGoodCondition(void); +static void ContestEffect_NextAppealEarlier(void); +static void ContestEffect_NextAppealLater(void); +static void ContestEffect_MakeScramblingTurnOrderEasier(void); +static void ContestEffect_ScrambleNextTurnOrder(void); +static void ContestEffect_ExciteAudienceInAnyContest(void); +static void ContestEffect_BadlyStartleMonsWithGoodAppeals(void); +static void ContestEffect_BetterWhenAudienceExcited(void); +static void ContestEffect_DontExciteAudience(void); static void JamByMoveCategory(u8); static bool8 CanUnnerveContestant(u8); static u8 WasAtLeastOneOpponentJammed(void); @@ -73,63 +73,63 @@ bool8 AreMovesContestCombo(u16 lastMove, u16 nextMove) { return 0; } -static void ContestEffect_00(void) // A highly appealing move. +static void ContestEffect_HighlyAppealing(void) { } -static void ContestEffect_01(void) // After this move, the user is more easily startled. +static void ContestEffect_UserMoreEasilyStartled(void) { sContestantStatus[shared192D0.contestant].moreEasilyStartled = TRUE; SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_MORE_CONSCIOUS); } -static void ContestEffect_02(void) // Makes a great appeal, but allows no more to the end. +static void ContestEffect_GreatAppealButNoMoreMoves(void) { sContestantStatus[shared192D0.contestant].exploded = TRUE; SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_NO_APPEAL); } -static void ContestEffect_03(void) // Can be used repeatedly without boring the JUDGE. +static void ContestEffect_RepetitionNotBoring(void) { sContestantStatus[shared192D0.contestant].usedRepeatableMove = TRUE; sContestantStatus[shared192D0.contestant].disappointedRepeat = FALSE; sContestantStatus[shared192D0.contestant].moveRepeatCount = 0; } -static void ContestEffect_04(void) // Can avoid being startled by others once. +static void ContestEffect_AvoidStartleOnce(void) { sContestantStatus[shared192D0.contestant].jamSafetyCount = 1; SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_SETTLE_DOWN); } -static void ContestEffect_05(void) // Can avoid being startled by others. +static void ContestEffect_AvoidStartle(void) { sContestantStatus[shared192D0.contestant].immune = TRUE; SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_OBLIVIOUS_TO_OTHERS); } -static void ContestEffect_06(void) // Can avoid being startled by others a little. +static void ContestEffect_AvoidStartleSlightly(void) { sContestantStatus[shared192D0.contestant].jamReduction = 20; SetContestantEffectStringID(shared192D0.contestant,CONTEST_STRING_LESS_AWARE); } -static void ContestEffect_07(void) // After this move, the user is less likely to be startled. +static void ContestEffect_UserLessEasilyStartled(void) { sContestantStatus[shared192D0.contestant].resistant = TRUE; SetContestantEffectStringID(shared192D0.contestant,CONTEST_STRING_STOPPED_CARING); } -static void ContestEffect_08(void) // Slightly startles the POKéMON in front. +static void ContestEffect_StartleFrontMon(void) { u8 idx = 0; u8 a = shared192D0.contestant; @@ -151,8 +151,8 @@ static void ContestEffect_08(void) SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -static void ContestEffect_09(void) // Slightly startles those that have made appeals. +static void ContestEffect_StartlePrevMons(void) { u8 idx = 0; u8 a = shared192D0.contestant; @@ -172,8 +172,8 @@ static void ContestEffect_09(void) SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -static void ContestEffect_14(void) // Startles the POKéMON that appealed before the user. +static void ContestEffect_StartlePrevMon2(void) { u8 rval = Random() % 10; int jam; @@ -185,11 +185,11 @@ static void ContestEffect_14(void) else jam = 60; shared192D0.jam = jam; - ContestEffect_08(); + ContestEffect_StartleFrontMon(); } -static void ContestEffect_15(void) // Startles all POKéMON that appealed before the user. +static void ContestEffect_StartlePrevMons2(void) { u8 numStartled = 0; u8 contestant = shared192D0.contestant; @@ -232,8 +232,8 @@ static void ContestEffect_15(void) SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } -static void ContestEffect_16(void) // Shifts the JUDGE’s attention from others. +static void ContestEffect_ShiftJudgeAttention(void) { bool32 hitAny = FALSE; u8 contestant = shared192D0.contestant; @@ -262,8 +262,8 @@ static void ContestEffect_16(void) } } -static void ContestEffect_17(void) // Startles the POKéMON that has the JUDGE’s attention. +static void ContestEffect_StartleMonWithJudgesAttention(void) { u8 numStartled = 0; u8 contestant = shared192D0.contestant; @@ -292,59 +292,59 @@ static void ContestEffect_17(void) SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } -static void ContestEffect_18(void) // Jams the others, and misses one turn of appeals. +static void ContestEffect_JamsOthersButMissOneTurn(void) { sContestantStatus[shared192D0.contestant].turnSkipped = TRUE; - ContestEffect_09(); + ContestEffect_StartlePrevMons(); SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -static void ContestEffect_19(void) // Startles POKéMON that made a same-type appeal. +static void ContestEffect_StartleMonsSameTypeAppeal(void) { u16 move = sContestantStatus[shared192D0.contestant].currMove; JamByMoveCategory(gContestMoves[move].contestCategory); SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -static void ContestEffect_20(void) // Badly startles POKéMON that made COOL appeals. +static void ContestEffect_StartleMonsCoolAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_COOL); SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -static void ContestEffect_21(void) // Badly startles POKéMON that made BEAUTY appeals. +static void ContestEffect_StartleMonsBeautyAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_BEAUTY); SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -static void ContestEffect_22(void) // Badly startles POKéMON that made CUTE appeals. +static void ContestEffect_StartleMonsCuteAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_CUTE); SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -static void ContestEffect_23(void) // Badly startles POKéMON that made SMART appeals. +static void ContestEffect_StartleMonsSmartAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_SMART); SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -static void ContestEffect_24(void) // Badly startles POKéMON that made TOUGH appeals. +static void ContestEffect_StartleMonsToughAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_TOUGH); SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -static void ContestEffect_25(void) // Makes one POKéMON after the user nervous. +static void ContestEffect_MakeFollowingMonNervous(void) { bool32 hitAny = FALSE; @@ -375,8 +375,8 @@ static void ContestEffect_25(void) SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } -static void ContestEffect_26(void) // Makes all POKéMON after the user nervous. +static void ContestEffect_MakeFollowingMonsNervous(void) { u8 numUnnerved = 0; bool32 contestantUnnerved = FALSE; @@ -451,8 +451,8 @@ static void ContestEffect_26(void) SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } -static void ContestEffect_27(void) // Worsens the condition of those that made appeals. +static void ContestEffect_WorsenConditionOfPrevMons(void) { u8 numHit = 0; int i; @@ -475,8 +475,8 @@ static void ContestEffect_27(void) SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_IGNORED); } -static void ContestEffect_28(void) // Badly startles POKéMON in good condition. +static void ContestEffect_BadlyStartlesMonsInGoodCondition(void) { u8 numHit = 0; int i; @@ -500,8 +500,8 @@ static void ContestEffect_28(void) SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_IGNORED); } -static void ContestEffect_29(void) // The appeal works great if performed first. +static void ContestEffect_BetterIfFirst(void) { if (gUnknown_02038696[shared192D0.contestant] == 0) { @@ -511,8 +511,8 @@ static void ContestEffect_29(void) } } -static void ContestEffect_30(void) // The appeal works great if performed last. +static void ContestEffect_BetterIfLast(void) { if (gUnknown_02038696[shared192D0.contestant] == 3) { @@ -522,8 +522,8 @@ static void ContestEffect_30(void) } } -static void ContestEffect_31(void) // Makes the appeal as good as those before it. +static void ContestEffect_AppealAsGoodAsPrevOnes(void) { int i; int appealSum; @@ -545,8 +545,8 @@ static void ContestEffect_31(void) sContestantStatus[shared192D0.contestant].appeal2 = RoundTowardsZero(sContestantStatus[shared192D0.contestant].appeal2); } -static void ContestEffect_32(void) // Makes the appeal as good as the one before it. +static void ContestEffect_AppealAsGoodAsPrevOne(void) { s16 appeal = 0; @@ -568,8 +568,8 @@ static void ContestEffect_32(void) } } -static void ContestEffect_33(void) // The appeal works better the later it is performed. +static void ContestEffect_BetterWhenLater(void) { u8 whichTurn = shared192D0.turnOrder[shared192D0.contestant]; if (whichTurn == 0) @@ -586,8 +586,8 @@ static void ContestEffect_33(void) SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY); } -static void ContestEffect_34(void) // The appeal’s quality varies depending on its timing. +static void ContestEffect_QualityDependsOnTiming(void) { u8 rval = Random() % 10; s16 appeal; @@ -619,8 +619,8 @@ static void ContestEffect_34(void) #ifdef NONMATCHING // Not even close, send help -static void ContestEffect_35(void) // Works well if it’s the same type as the one before. +static void ContestEffect_BetterIfSameType(void) { s8 r4; s8 r2; @@ -646,7 +646,7 @@ static void ContestEffect_35(void) } } #else -__attribute__((naked)) void ContestEffect_35(void) +__attribute__((naked)) void ContestEffect_BetterIfSameType(void) { asm_unified("\tpush {r4-r7,lr}\n" "\tldr r1, _080B8940 @ =gSharedMem + 0x192D0\n" @@ -762,8 +762,8 @@ __attribute__((naked)) void ContestEffect_35(void) } #endif -static void ContestEffect_36(void) // Works well if different in type than the one before. +static void ContestEffect_BetterIfDiffType(void) { if (shared192D0.turnOrder[shared192D0.contestant] != 0) { @@ -783,8 +783,8 @@ static void ContestEffect_36(void) } } -static void ContestEffect_37(void) // Affected by how well the appeal in front goes. +static void ContestEffect_AffectedByPrevAppeal(void) { if (shared192D0.turnOrder[shared192D0.contestant] != 0) { @@ -809,8 +809,8 @@ static void ContestEffect_37(void) } } -static void ContestEffect_38(void) // Ups the user’s condition. Helps prevent nervousness. +static void ContestEffect_ImproveConditionPreventNervousness(void) { if (sContestantStatus[shared192D0.contestant].condition < 30) { @@ -822,8 +822,8 @@ static void ContestEffect_38(void) SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_NO_CONDITION_IMPROVE); } -static void ContestEffect_39(void) // The appeal works well if the user’s condition is good. +static void ContestEffect_BetterWithGoodCondition(void) { sContestantStatus[shared192D0.contestant].appealTripleCondition = TRUE; if (sContestantStatus[shared192D0.contestant].condition != 0) @@ -832,8 +832,8 @@ static void ContestEffect_39(void) SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_BAD_CONDITION_WEAK_APPEAL); } -static void ContestEffect_40(void) // The next appeal can be made earlier next turn. +static void ContestEffect_NextAppealEarlier(void) { s8 i; s8 j; @@ -874,8 +874,8 @@ static void ContestEffect_40(void) } } -static void ContestEffect_41(void) // The next appeal can be made later next turn. +static void ContestEffect_NextAppealLater(void) { s8 i; s8 j; @@ -916,14 +916,14 @@ static void ContestEffect_41(void) } } -static void ContestEffect_42(void) // Makes the next turn’s order more easily scrambled. +static void ContestEffect_MakeScramblingTurnOrderEasier(void) { // dummied out? } -static void ContestEffect_43(void) // Scrambles the order of appeals on the next turn. +static void ContestEffect_ScrambleNextTurnOrder(void) { s8 i; s8 j; @@ -968,8 +968,8 @@ static void ContestEffect_43(void) } } -static void ContestEffect_44(void) // An appeal that excites the audience in any CONTEST. +static void ContestEffect_ExciteAudienceInAnyContest(void) { if (gContestMoves[sContestantStatus[shared192D0.contestant].currMove].contestCategory != gSpecialVar_ContestCategory) { @@ -977,8 +977,8 @@ static void ContestEffect_44(void) } } -static void ContestEffect_45(void) // Badly startles all POKéMON that made good appeals. +static void ContestEffect_BadlyStartleMonsWithGoodAppeals(void) { int i; u8 numJammed = 0; @@ -1005,8 +1005,8 @@ static void ContestEffect_45(void) SetContestantEffectStringID(shared192D0.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -static void ContestEffect_46(void) // The appeal works best the more the crowd is excited. +static void ContestEffect_BetterWhenAudienceExcited(void) { s16 appeal; @@ -1038,8 +1038,8 @@ static void ContestEffect_46(void) sContestantStatus[shared192D0.contestant].appeal2 = appeal; } -static void ContestEffect_47(void) // Temporarily stops the crowd from growing excited. +static void ContestEffect_DontExciteAudience(void) { if (!shared19328.excitementFrozen) { -- cgit v1.2.3 From bdc22ceb2ca2ccfc68f3be1b45df31a5a147ced3 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 5 Apr 2018 20:18:42 -0700 Subject: Match CanUnnerveContestant() --- src/contest_effect.c | 64 ++++------------------------------------------------ 1 file changed, 5 insertions(+), 59 deletions(-) (limited to 'src/contest_effect.c') diff --git a/src/contest_effect.c b/src/contest_effect.c index 604bccd07..2932d8e6e 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -1073,81 +1073,27 @@ static void JamByMoveCategory(u8 category) SetContestantEffectStringID2(shared192D0.contestant, CONTEST_STRING_MESSED_UP2); } -#ifdef NONMATCHING static bool8 CanUnnerveContestant(u8 i) { - // For whatever reason, i is copied to r4. I cannot optimize this out. shared192D0.unnervedPokes[i] = 1; if (sContestantStatus[i].immune) { SetContestantEffectStringID(i, CONTEST_STRING_AVOID_SEEING); + return FALSE; } else if (sContestantStatus[i].jamSafetyCount != 0) { sContestantStatus[i].jamSafetyCount--; SetContestantEffectStringID(i, CONTEST_STRING_AVERT_GAZE); + return FALSE; } else if (!sContestantStatus[i].noMoreTurns && sContestantStatus[i].numTurnsSkipped == 0) + { return TRUE; + } + return FALSE; } -#else -static __attribute__((naked)) bool8 CanUnnerveContestant(u8 i) -{ - asm_unified("\tpush {lr}\n" - "\tlsls r0, 24\n" - "\tlsrs r3, r0, 24\n" - "\tldr r2, _080B90EC @ =gSharedMem + 0x192D0\n" - "\tadds r0, r2, 0\n" - "\tadds r0, 0xD\n" - "\tadds r0, r3, r0\n" - "\tmovs r1, 0x1\n" - "\tstrb r1, [r0]\n" - "\tlsls r0, r3, 3\n" - "\tsubs r0, r3\n" - "\tlsls r0, 2\n" - "\tsubs r2, 0x70\n" - "\tadds r2, r0, r2\n" - "\tldrb r1, [r2, 0x10]\n" - "\tmovs r0, 0x2\n" - "\tands r0, r1\n" - "\tcmp r0, 0\n" - "\tbeq _080B90F0\n" - "\tadds r0, r3, 0\n" - "\tmovs r1, 0x2D\n" - "\tb _080B9116\n" - "\t.align 2, 0\n" - "_080B90EC: .4byte gSharedMem + 0x192D0\n" - "_080B90F0:\n" - "\tldrb r0, [r2, 0x12]\n" - "\tcmp r0, 0\n" - "\tbne _080B910E\n" - "\tldrb r1, [r2, 0xB]\n" - "\tmovs r0, 0x80\n" - "\tands r0, r1\n" - "\tcmp r0, 0\n" - "\tbne _080B911A\n" - "\tldrb r1, [r2, 0xC]\n" - "\tmovs r0, 0x6\n" - "\tands r0, r1\n" - "\tcmp r0, 0\n" - "\tbne _080B911A\n" - "\tmovs r0, 0x1\n" - "\tb _080B911C\n" - "_080B910E:\n" - "\tsubs r0, 0x1\n" - "\tstrb r0, [r2, 0x12]\n" - "\tadds r0, r3, 0\n" - "\tmovs r1, 0x2C\n" - "_080B9116:\n" - "\tbl SetContestantEffectStringID\n" - "_080B911A:\n" - "\tmovs r0, 0\n" - "_080B911C:\n" - "\tpop {r1}\n" - "\tbx r1"); -} -#endif static bool8 WasAtLeastOneOpponentJammed(void) { -- cgit v1.2.3