summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2018-03-29 11:12:55 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2018-03-29 11:12:55 -0400
commita8c57a0dd6cf3e3759dda41f7f2c6d89173262e7 (patch)
treecb8b0ae83cbc0eea161e6d5171cdc648eb7dff20 /src
parent8a61d647fc81ca392dbcf7458db5b528a1a744a6 (diff)
through ContestEffect_16
Diffstat (limited to 'src')
-rw-r--r--src/contest_effect.c117
1 files changed, 115 insertions, 2 deletions
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);
+ }
+}