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 --- asm/contest_effect.s | 85 ------------------------------------------------ include/contest.h | 1 + include/contest_effect.h | 6 ++++ ld_script.txt | 2 ++ src/contest.c | 2 +- src/contest_ai.c | 2 +- src/contest_effect.c | 33 +++++++++++++++++++ 7 files changed, 44 insertions(+), 87 deletions(-) create mode 100644 include/contest_effect.h create mode 100644 src/contest_effect.c diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 341cb0903..57ff6dfd0 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,91 +5,6 @@ .text - thumb_func_start AreMovesContestCombo -AreMovesContestCombo: @ 80B7D24 - push {r4,lr} - sub sp, 0x4 - lsls r0, 16 - lsls r1, 16 - ldr r2, _080B7D78 @ =gContestMoves - lsrs r0, 13 - adds r0, r2 - ldrb r4, [r0, 0x2] - mov r3, sp - lsrs r1, 13 - adds r1, r2 - ldrb r0, [r1, 0x3] - strb r0, [r3] - mov r2, sp - ldrb r0, [r1, 0x4] - strb r0, [r2, 0x1] - ldrb r0, [r1, 0x5] - strb r0, [r2, 0x2] - mov r0, sp - ldrb r1, [r1, 0x6] - strb r1, [r0, 0x3] - cmp r4, 0 - beq _080B7D80 - mov r0, sp - ldrb r0, [r0] - cmp r4, r0 - beq _080B7D6E - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r4, r0 - beq _080B7D6E - mov r0, sp - ldrb r0, [r0, 0x2] - cmp r4, r0 - beq _080B7D6E - cmp r4, r1 - bne _080B7D80 -_080B7D6E: - ldr r0, _080B7D7C @ =gComboStarterLookupTable - adds r0, r4, r0 - ldrb r0, [r0] - b _080B7D82 - .align 2, 0 -_080B7D78: .4byte gContestMoves -_080B7D7C: .4byte gComboStarterLookupTable -_080B7D80: - movs r0, 0 -_080B7D82: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end AreMovesContestCombo - - thumb_func_start ContestEffect_00 -ContestEffect_00: @ 80B7D8C - bx lr - thumb_func_end ContestEffect_00 - - thumb_func_start ContestEffect_01 -ContestEffect_01: @ 80B7D90 - push {lr} - ldr r3, _080B7DB8 @ =gSharedMem + 0x192D0 - ldrb r1, [r3, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r3, 0 - subs r1, 0x70 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x10] - ldrb r0, [r3, 0x11] - movs r1, 0 - bl sub_80B13EC - pop {r0} - bx r0 - .align 2, 0 -_080B7DB8: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_01 - thumb_func_start ContestEffect_02 ContestEffect_02: @ 80B7DBC push {lr} diff --git a/include/contest.h b/include/contest.h index 557b9e5c4..f8879f8a5 100644 --- a/include/contest.h +++ b/include/contest.h @@ -277,5 +277,6 @@ extern u16 gUnknown_02038688[4]; extern u8 gContestFinalStandings[4]; extern u8 gUnknown_02038696[4]; extern u8 gUnknown_0203869B; +void sub_80B13EC(u8 a, u8 b); #endif // GUARD_CONTEST_H diff --git a/include/contest_effect.h b/include/contest_effect.h new file mode 100644 index 000000000..2840bf106 --- /dev/null +++ b/include/contest_effect.h @@ -0,0 +1,6 @@ +#ifndef POKERUBY_GBA_CONTEST_EFFECT_H +#define POKERUBY_GBA_CONTEST_EFFECT_H + +extern bool8 AreMovesContestCombo(u16, u16); + +#endif //POKERUBY_GBA_CONTEST_EFFECT_H diff --git a/ld_script.txt b/ld_script.txt index 619e06350..2eae4d81c 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -160,6 +160,7 @@ SECTIONS { src/script_menu.o(.text); src/naming_screen.o(.text); src/money.o(.text); + src/contest_effect.o(.text); asm/contest_effect.o(.text); src/record_mixing.o(.text); src/debug/sound_check_menu.o(.text); @@ -594,6 +595,7 @@ SECTIONS { src/script_menu.o(.rodata); src/naming_screen.o(.rodata); src/money.o(.rodata); + src/contest_effect.o(.rodata); data/contest_effect.o(.rodata); src/record_mixing.o(.data); src/record_mixing.o(.rodata); diff --git a/src/contest.c b/src/contest.c index 84e5d807b..c27844beb 100644 --- a/src/contest.c +++ b/src/contest.c @@ -8,6 +8,7 @@ #include "battle_anim.h" #include "blend_palette.h" #include "contest.h" +#include "contest_effect.h" #include "contest_link_80C857C.h" #include "data2.h" #include "decompress.h" @@ -35,7 +36,6 @@ extern u8 gUnknown_020297ED; -extern u8 AreMovesContestCombo(u16, u16); // I don't think this is a bool extern void sub_80C8A38(u8); extern void sub_80C8AD0(u8); extern void sub_80C8C80(u8); diff --git a/src/contest_ai.c b/src/contest_ai.c index 1e249083b..63894635b 100644 --- a/src/contest_ai.c +++ b/src/contest_ai.c @@ -2,9 +2,9 @@ #include "contest.h" #include "random.h" #include "contest_ai.h" +#include "contest_effect.h" #include "ewram.h" -extern u8 AreMovesContestCombo(u16, u16); extern bool8 sub_80B214C(u8); extern bool8 Contest_IsMonsTurnDisabled(u8); 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 --- asm/contest_effect.s | 343 ++++++++++----------------------------------------- include/contest.h | 7 +- src/contest.c | 14 +-- src/contest_effect.c | 62 +++++++++- 4 files changed, 138 insertions(+), 288 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 57ff6dfd0..523f4d85b 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,217 +5,6 @@ .text - thumb_func_start ContestEffect_02 -ContestEffect_02: @ 80B7DBC - push {lr} - ldr r3, _080B7DE4 @ =gSharedMem + 0x192D0 - ldrb r1, [r3, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r3, 0 - subs r1, 0x70 - adds r0, r1 - ldrb r1, [r0, 0x11] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x11] - ldrb r0, [r3, 0x11] - movs r1, 0x1 - bl sub_80B13EC - pop {r0} - bx r0 - .align 2, 0 -_080B7DE4: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_02 - - thumb_func_start ContestEffect_03 -ContestEffect_03: @ 80B7DE8 - push {r4,lr} - ldr r3, _080B7E30 @ =gSharedMem + 0x192D0 - ldrb r1, [r3, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r4, r3, 0 - subs r4, 0x70 - adds r0, r4 - ldrb r1, [r0, 0x10] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x10] - ldrb r0, [r3, 0x11] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x15] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x15] - ldrb r0, [r3, 0x11] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0xB] - movs r0, 0x71 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xB] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080B7E30: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_03 - - thumb_func_start ContestEffect_04 -ContestEffect_04: @ 80B7E34 - push {lr} - ldr r2, _080B7E58 @ =gSharedMem + 0x192D0 - ldrb r1, [r2, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r2, 0 - subs r1, 0x70 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0, 0x12] - ldrb r0, [r2, 0x11] - movs r1, 0x2 - bl sub_80B13EC - pop {r0} - bx r0 - .align 2, 0 -_080B7E58: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_04 - - thumb_func_start ContestEffect_05 -ContestEffect_05: @ 80B7E5C - push {lr} - ldr r3, _080B7E84 @ =gSharedMem + 0x192D0 - ldrb r1, [r3, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r3, 0 - subs r1, 0x70 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0, 0x10] - ldrb r0, [r3, 0x11] - movs r1, 0x3 - bl sub_80B13EC - pop {r0} - bx r0 - .align 2, 0 -_080B7E84: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_05 - - thumb_func_start ContestEffect_06 -ContestEffect_06: @ 80B7E88 - push {lr} - ldr r2, _080B7EAC @ =gSharedMem + 0x192D0 - ldrb r1, [r2, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r2, 0 - subs r1, 0x70 - adds r0, r1 - movs r1, 0x14 - strb r1, [r0, 0xF] - ldrb r0, [r2, 0x11] - movs r1, 0x4 - bl sub_80B13EC - pop {r0} - bx r0 - .align 2, 0 -_080B7EAC: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_06 - - thumb_func_start ContestEffect_07 -ContestEffect_07: @ 80B7EB0 - push {lr} - ldr r3, _080B7ED8 @ =gSharedMem + 0x192D0 - ldrb r1, [r3, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r3, 0 - subs r1, 0x70 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x10] - ldrb r0, [r3, 0x11] - movs r1, 0x5 - bl sub_80B13EC - pop {r0} - bx r0 - .align 2, 0 -_080B7ED8: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_07 - - thumb_func_start ContestEffect_08 -ContestEffect_08: @ 80B7EDC - push {r4,lr} - movs r2, 0 - ldr r3, _080B7F38 @ =gSharedMem + 0x192D0 - ldrb r0, [r3, 0x11] - adds r1, r0, r3 - ldrb r0, [r1] - cmp r0, 0 - beq _080B7F1A - subs r0, 0x1 - ldrb r4, [r3] - cmp r0, r4 - beq _080B7F0A - adds r4, r3, 0 - adds r3, r1, 0 -_080B7EF8: - adds r2, 0x1 - cmp r2, 0x3 - bgt _080B7F0A - ldrb r0, [r3] - subs r0, 0x1 - adds r1, r2, r4 - ldrb r1, [r1] - cmp r0, r1 - bne _080B7EF8 -_080B7F0A: - ldr r1, _080B7F38 @ =gSharedMem + 0x192D0 - strb r2, [r1, 0x8] - movs r0, 0xFF - strb r0, [r1, 0x9] - bl sub_80B9120 - lsls r0, 24 - lsrs r2, r0, 24 -_080B7F1A: - cmp r2, 0 - bne _080B7F28 - ldr r0, _080B7F38 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl sub_80B1404 -_080B7F28: - ldr r0, _080B7F38 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80B13EC - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080B7F38: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_08 - thumb_func_start ContestEffect_09 ContestEffect_09: @ 80B7F3C push {r4-r6,lr} @@ -257,12 +46,12 @@ _080B7F7C: ldr r0, _080B7F9C @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x36 - bl sub_80B1404 + bl SetContestantStatusUnk14 _080B7F8A: ldr r0, _080B7F9C @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 pop {r4-r6} pop {r0} bx r0 @@ -362,13 +151,13 @@ _080B804A: mov r1, r8 ldrb r0, [r1, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 cmp r7, 0 bne _080B8062 mov r1, r8 ldrb r0, [r1, 0x11] movs r1, 0x36 - bl sub_80B1404 + bl SetContestantStatusUnk14 _080B8062: pop {r3} mov r8, r3 @@ -429,7 +218,7 @@ _080B8094: strb r0, [r5] adds r0, r4, 0 movs r1, 0x8 - bl sub_80B13EC + bl SetContestantStatusUnk13 movs r0, 0x1 mov r9, r0 _080B80D8: @@ -441,14 +230,14 @@ _080B80E0: mov r1, r10 ldrb r0, [r1, 0x11] movs r1, 0x7 - bl sub_80B13EC + bl SetContestantStatusUnk13 mov r2, r9 cmp r2, 0 bne _080B80FA mov r1, r10 ldrb r0, [r1, 0x11] movs r1, 0x36 - bl sub_80B1404 + bl SetContestantStatusUnk14 _080B80FA: pop {r3-r5} mov r8, r3 @@ -525,13 +314,13 @@ _080B8172: _080B817C: ldrb r0, [r6, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 mov r0, r9 cmp r0, 0 bne _080B8192 ldrb r0, [r6, 0x11] movs r1, 0x36 - bl sub_80B1404 + bl SetContestantStatusUnk14 _080B8192: pop {r3,r4} mov r8, r3 @@ -561,7 +350,7 @@ ContestEffect_18: @ 80B81A4 bl ContestEffect_09 ldrb r0, [r4, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 pop {r4} pop {r0} bx r0 @@ -590,7 +379,7 @@ ContestEffect_19: @ 80B81D4 bl sub_80B9038 ldrb r0, [r4, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 pop {r4} pop {r0} bx r0 @@ -607,7 +396,7 @@ ContestEffect_20: @ 80B8210 ldr r0, _080B8228 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 pop {r0} bx r0 .align 2, 0 @@ -622,7 +411,7 @@ ContestEffect_21: @ 80B822C ldr r0, _080B8244 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 pop {r0} bx r0 .align 2, 0 @@ -637,7 +426,7 @@ ContestEffect_22: @ 80B8248 ldr r0, _080B8260 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 pop {r0} bx r0 .align 2, 0 @@ -652,7 +441,7 @@ ContestEffect_23: @ 80B8264 ldr r0, _080B827C @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 pop {r0} bx r0 .align 2, 0 @@ -667,7 +456,7 @@ ContestEffect_24: @ 80B8280 ldr r0, _080B8298 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 pop {r0} bx r0 .align 2, 0 @@ -714,7 +503,7 @@ _080B82E4: adds r0, r4, 0 movs r1, 0x3C _080B82E8: - bl sub_80B13EC + bl SetContestantStatusUnk13 movs r4, 0x1 _080B82EE: adds r5, 0x1 @@ -723,12 +512,12 @@ _080B82EE: _080B82F4: ldrb r0, [r7, 0x11] movs r1, 0x9 - bl sub_80B13EC + bl SetContestantStatusUnk13 cmp r4, 0 bne _080B8308 ldrb r0, [r7, 0x11] movs r1, 0x36 - bl sub_80B1404 + bl SetContestantStatusUnk14 _080B8308: pop {r4-r7} pop {r0} @@ -922,7 +711,7 @@ _080B8442: bl sub_80B157C ldrb r0, [r4] movs r1, 0xA - bl sub_80B13EC + bl SetContestantStatusUnk13 mov r0, r9 adds r0, 0x1 lsls r0, 24 @@ -943,7 +732,7 @@ _080B84A2: str r2, [sp, 0x18] ldrb r0, [r4] movs r1, 0x3C - bl sub_80B13EC + bl SetContestantStatusUnk13 mov r0, r9 adds r0, 0x1 lsls r0, 24 @@ -963,13 +752,13 @@ _080B84CA: ldr r4, _080B84F4 @ =gSharedMem + 0x192D0 ldrb r0, [r4, 0x11] movs r1, 0xB - bl sub_80B13EC + bl SetContestantStatusUnk13 mov r3, r9 cmp r3, 0 bne _080B84E2 ldrb r0, [r4, 0x11] movs r1, 0x36 - bl sub_80B1404 + bl SetContestantStatusUnk14 _080B84E2: add sp, 0x1C pop {r3-r5} @@ -1025,7 +814,7 @@ _080B850A: strb r1, [r5, 0x3] adds r0, r4, 0 movs r1, 0xD - bl sub_80B13EC + bl SetContestantStatusUnk13 mov r0, r8 adds r0, 0x1 lsls r0, 24 @@ -1039,13 +828,13 @@ _080B8556: ldr r4, _080B8580 @ =gSharedMem + 0x192D0 ldrb r0, [r4, 0x11] movs r1, 0xC - bl sub_80B13EC + bl SetContestantStatusUnk13 mov r0, r8 cmp r0, 0 bne _080B8576 ldrb r0, [r4, 0x11] movs r1, 0x39 - bl sub_80B1404 + bl SetContestantStatusUnk14 _080B8576: pop {r3} mov r8, r3 @@ -1105,12 +894,12 @@ _080B85CE: ldr r4, _080B85F4 @ =gSharedMem + 0x192D0 ldrb r0, [r4, 0x11] movs r1, 0xE - bl sub_80B13EC + bl SetContestantStatusUnk13 cmp r7, 0 bne _080B85EC ldrb r0, [r4, 0x11] movs r1, 0x39 - bl sub_80B1404 + bl SetContestantStatusUnk14 _080B85EC: pop {r4-r7} pop {r0} @@ -1150,7 +939,7 @@ ContestEffect_29: @ 80B85F8 strh r0, [r1, 0x2] ldrb r0, [r4, 0x11] movs r1, 0xF - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B8636: pop {r4} pop {r0} @@ -1193,7 +982,7 @@ ContestEffect_30: @ 80B864C strh r0, [r1, 0x2] ldrb r0, [r4, 0x11] movs r1, 0x10 - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B868A: pop {r4} pop {r0} @@ -1246,7 +1035,7 @@ _080B86D2: _080B86E2: adds r0, r2, 0 movs r1, 0x12 - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B8710 .align 2, 0 _080B86EC: .4byte gSharedMem + 0x192D0 @@ -1265,7 +1054,7 @@ _080B86F0: strh r0, [r1, 0x2] ldrb r0, [r4, 0x11] movs r1, 0x11 - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B8710: ldr r4, _080B873C @ =gSharedMem + 0x192D0 ldrb r1, [r4, 0x11] @@ -1334,7 +1123,7 @@ _080B876C: _080B8788: ldrb r0, [r4, 0x11] movs r1, 0x14 - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B87B2 .align 2, 0 _080B8794: .4byte gSharedMem + 0x192D0 @@ -1350,7 +1139,7 @@ _080B8798: strh r0, [r1, 0x2] ldrb r0, [r4, 0x11] movs r1, 0x13 - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B87B2: pop {r4-r7} pop {r0} @@ -1394,7 +1183,7 @@ _080B87EE: mov r1, r12 ldrb r0, [r1, 0x11] movs r1, 0x15 - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B882A _080B8800: cmp r3, 0x1 @@ -1402,7 +1191,7 @@ _080B8800: mov r1, r12 ldrb r0, [r1, 0x11] movs r1, 0x16 - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B882A _080B8810: cmp r3, 0x2 @@ -1410,13 +1199,13 @@ _080B8810: mov r1, r12 ldrb r0, [r1, 0x11] movs r1, 0x17 - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B882A _080B8820: mov r1, r12 ldrb r0, [r1, 0x11] movs r1, 0x18 - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B882A: pop {r0} bx r0 @@ -1439,7 +1228,7 @@ ContestEffect_34: @ 80B8830 ldr r0, _080B8858 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x1A - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B88B0 .align 2, 0 _080B8858: .4byte gSharedMem + 0x192D0 @@ -1450,7 +1239,7 @@ _080B885C: ldr r0, _080B8870 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x1B - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B88B0 .align 2, 0 _080B8870: .4byte gSharedMem + 0x192D0 @@ -1461,7 +1250,7 @@ _080B8874: ldr r0, _080B8888 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x1C - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B88B0 .align 2, 0 _080B8888: .4byte gSharedMem + 0x192D0 @@ -1472,7 +1261,7 @@ _080B888C: ldr r0, _080B88A0 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x1D - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B88B0 .align 2, 0 _080B88A0: .4byte gSharedMem + 0x192D0 @@ -1481,7 +1270,7 @@ _080B88A4: ldr r0, _080B88C8 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x1E - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B88B0: ldr r0, _080B88C8 @ =gSharedMem + 0x192D0 ldrb r2, [r0, 0x11] @@ -1603,7 +1392,7 @@ _080B8944: mov r2, r12 ldrb r0, [r2, 0x11] movs r1, 0x1F - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B8994: pop {r4-r7} pop {r0} @@ -1679,7 +1468,7 @@ _080B89D4: strh r0, [r1, 0x2] ldrb r0, [r6, 0x11] movs r1, 0x20 - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B8A3C .align 2, 0 _080B8A28: .4byte gSharedMem + 0x192D0 @@ -1737,7 +1526,7 @@ _080B8A60: strh r0, [r2, 0x2] ldrb r0, [r4, 0x11] movs r1, 0x21 - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B8AA8 .align 2, 0 _080B8A94: .4byte gSharedMem + 0x192D0 @@ -1748,7 +1537,7 @@ _080B8A98: strh r0, [r2, 0x2] ldrb r0, [r4, 0x11] movs r1, 0x22 - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B8AA8: adds r6, 0x1C adds r5, 0x1 @@ -1793,14 +1582,14 @@ ContestEffect_38: @ 80B8AB8 strb r1, [r0, 0x10] ldrb r0, [r4, 0x11] movs r1, 0x23 - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B8B08 .align 2, 0 _080B8AFC: .4byte gSharedMem + 0x192D0 _080B8B00: adds r0, r2, 0 movs r1, 0x3A - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B8B08: pop {r4,r5} pop {r0} @@ -1834,14 +1623,14 @@ ContestEffect_39: @ 80B8B10 beq _080B8B4C adds r0, r1, 0 movs r1, 0x24 - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B8B54 .align 2, 0 _080B8B48: .4byte gSharedMem + 0x192D0 _080B8B4C: adds r0, r1, 0 movs r1, 0x3B - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B8B54: pop {r4} pop {r0} @@ -1996,7 +1785,7 @@ _080B8C32: strb r0, [r1, 0x11] ldrb r0, [r7, 0x11] movs r1, 0x25 - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B8C76: add sp, 0x4 pop {r3} @@ -2158,7 +1947,7 @@ _080B8D62: strb r0, [r1, 0x11] ldrb r0, [r7, 0x11] movs r1, 0x26 - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B8DA6: add sp, 0x4 pop {r3,r4} @@ -2301,7 +2090,7 @@ _080B8E66: strb r1, [r0, 0x11] ldrb r0, [r4, 0x11] movs r1, 0x27 - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B8EAE: add sp, 0x8 pop {r4-r7} @@ -2401,12 +2190,12 @@ _080B8F52: ldr r0, _080B8F78 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x36 - bl sub_80B1404 + bl SetContestantStatusUnk14 _080B8F68: ldr r0, _080B8F78 @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x30 - bl sub_80B13EC + bl SetContestantStatusUnk13 pop {r4-r7} pop {r0} bx r0 @@ -2426,7 +2215,7 @@ ContestEffect_46: @ 80B8F7C adds r0, 0xCC ldrb r0, [r0, 0x11] movs r1, 0x1A - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B8FDE .align 2, 0 _080B8F98: .4byte gSharedMem + 0x19204 @@ -2437,7 +2226,7 @@ _080B8F9C: adds r0, 0xCC ldrb r0, [r0, 0x11] movs r1, 0x1B - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B8FDE _080B8FAE: cmp r1, 0x2 @@ -2446,7 +2235,7 @@ _080B8FAE: adds r0, 0xCC ldrb r0, [r0, 0x11] movs r1, 0x1C - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B8FDE _080B8FC0: cmp r1, 0x3 @@ -2455,14 +2244,14 @@ _080B8FC0: adds r0, 0xCC ldrb r0, [r0, 0x11] movs r1, 0x1D - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B8FDE _080B8FD2: movs r4, 0x3C adds r0, 0xCC ldrb r0, [r0, 0x11] movs r1, 0x1E - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B8FDE: ldr r0, _080B8FF4 @ =gSharedMem + 0x192D0 ldrb r2, [r0, 0x11] @@ -2506,7 +2295,7 @@ ContestEffect_47: @ 80B8FF8 mov r1, r12 ldrb r0, [r1, 0x11] movs r1, 0x3D - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B902E: pop {r0} bx r0 @@ -2575,7 +2364,7 @@ _080B909A: ldr r0, _080B90BC @ =gSharedMem + 0x192D0 ldrb r0, [r0, 0x11] movs r1, 0x36 - bl sub_80B1404 + bl SetContestantStatusUnk14 _080B90B0: pop {r3,r4} mov r8, r3 @@ -2635,7 +2424,7 @@ _080B910E: adds r0, r3, 0 movs r1, 0x2C _080B9116: - bl sub_80B13EC + bl SetContestantStatusUnk13 _080B911A: movs r0, 0 _080B911C: @@ -2696,7 +2485,7 @@ _080B9174: strh r0, [r5, 0x6] adds r0, r4, 0 movs r1, 0x2F - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B91C8 .align 2, 0 _080B918C: .4byte gSharedMem + 0x192D0 @@ -2712,7 +2501,7 @@ _080B9190: strh r3, [r5, 0x6] adds r0, r4, 0 movs r1, 0x2E - bl sub_80B13EC + bl SetContestantStatusUnk13 b _080B91C8 _080B91AC: lsls r1, 24 diff --git a/include/contest.h b/include/contest.h index f8879f8a5..241fd19fc 100644 --- a/include/contest.h +++ b/include/contest.h @@ -227,7 +227,9 @@ struct UnknownContestStruct7 u8 unk0[4]; u16 unk4; u16 unk6; - u8 filler8[0xD-8]; + u8 unk8; + u8 unk9; + u8 fillerA[3]; u8 unkD[4]; u8 unk11; u8 filler12[2]; @@ -277,6 +279,7 @@ extern u16 gUnknown_02038688[4]; extern u8 gContestFinalStandings[4]; extern u8 gUnknown_02038696[4]; extern u8 gUnknown_0203869B; -void sub_80B13EC(u8 a, u8 b); +void SetContestantStatusUnk13(u8 a, u8 b); +void SetContestantStatusUnk14(u8 a, u8 b); #endif // GUARD_CONTEST_H diff --git a/src/contest.c b/src/contest.c index c27844beb..77455e882 100644 --- a/src/contest.c +++ b/src/contest.c @@ -4625,12 +4625,12 @@ void sub_80B114C(u8 contestant) } } -void sub_80B13EC(u8 a, u8 b) +void SetContestantStatusUnk13(u8 a, u8 b) { sContestantStatus[a].unk13 = b; } -void sub_80B1404(u8 a, u8 b) +void SetContestantStatusUnk14(u8 a, u8 b) { sContestantStatus[a].unk14 = b; } @@ -4638,15 +4638,15 @@ void sub_80B1404(u8 a, u8 b) void sub_80B141C(u8 a, u8 b) { if (b >= 60) - sub_80B13EC(a, 53); + SetContestantStatusUnk13(a, 53); else if (b >= 40) - sub_80B13EC(a, 52); + SetContestantStatusUnk13(a, 52); else if (b >= 30) - sub_80B13EC(a, 51); + SetContestantStatusUnk13(a, 51); else if (b >= 20) - sub_80B13EC(a, 50); + SetContestantStatusUnk13(a, 50); else if (b >= 10) - sub_80B13EC(a, 49); + SetContestantStatusUnk13(a, 49); } void sub_80B146C(u8 a, u8 b) 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 --- asm/contest_effect.s | 245 --------------------------------------------------- include/contest.h | 4 +- src/contest_effect.c | 117 +++++++++++++++++++++++- 3 files changed, 116 insertions(+), 250 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 523f4d85b..1996857eb 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,251 +5,6 @@ .text - thumb_func_start ContestEffect_09 -ContestEffect_09: @ 80B7F3C - push {r4-r6,lr} - movs r2, 0 - ldr r1, _080B7F9C @ =gSharedMem + 0x192D0 - ldrb r0, [r1, 0x11] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - beq _080B7F7C - movs r3, 0 - adds r5, r1, 0 - adds r6, r5, 0 - adds r6, 0x8 -_080B7F54: - adds r1, r2, r5 - ldrb r0, [r4] - ldrb r1, [r1] - cmp r0, r1 - bls _080B7F64 - adds r0, r3, r6 - strb r2, [r0] - adds r3, 0x1 -_080B7F64: - adds r2, 0x1 - cmp r2, 0x3 - ble _080B7F54 - ldr r0, _080B7F9C @ =gSharedMem + 0x192D0 - adds r0, 0x8 - adds r0, r3, r0 - movs r1, 0xFF - strb r1, [r0] - bl sub_80B9120 - lsls r0, 24 - lsrs r2, r0, 24 -_080B7F7C: - cmp r2, 0 - bne _080B7F8A - ldr r0, _080B7F9C @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl SetContestantStatusUnk14 -_080B7F8A: - ldr r0, _080B7F9C @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_080B7F9C: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_09 - - thumb_func_start ContestEffect_14 -ContestEffect_14: @ 80B7FA0 - push {lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x14 - cmp r0, 0x1 - bls _080B7FC2 - movs r1, 0x3C - cmp r0, 0x7 - bhi _080B7FC2 - movs r1, 0x28 -_080B7FC2: - ldr r0, _080B7FD0 @ =gSharedMem + 0x192D0 - strh r1, [r0, 0x4] - bl ContestEffect_08 - pop {r0} - bx r0 - .align 2, 0 -_080B7FD0: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_14 - - thumb_func_start ContestEffect_15 -ContestEffect_15: @ 80B7FD4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r7, 0 - ldr r0, _080B806C @ =gSharedMem + 0x192D0 - ldrb r6, [r0, 0x11] - adds r1, r6, r0 - ldrb r1, [r1] - mov r8, r0 - cmp r1, 0 - beq _080B804A - movs r5, 0 - mov r4, r8 -_080B7FEE: - adds r0, r6, r4 - adds r1, r5, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080B8044 - strb r5, [r4, 0x8] - movs r0, 0xFF - strb r0, [r4, 0x9] - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - cmp r0, 0 - beq _080B8032 - movs r1, 0xA - cmp r0, 0x2 - bls _080B8032 - movs r1, 0x14 - cmp r0, 0x4 - bls _080B8032 - movs r1, 0x1E - cmp r0, 0x6 - bls _080B8032 - movs r1, 0x3C - cmp r0, 0x8 - bhi _080B8032 - movs r1, 0x28 -_080B8032: - strh r1, [r4, 0x4] - bl sub_80B9120 - lsls r0, 24 - cmp r0, 0 - beq _080B8044 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_080B8044: - adds r5, 0x1 - cmp r5, 0x3 - ble _080B7FEE -_080B804A: - mov r1, r8 - ldrb r0, [r1, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - cmp r7, 0 - bne _080B8062 - mov r1, r8 - ldrb r0, [r1, 0x11] - movs r1, 0x36 - bl SetContestantStatusUnk14 -_080B8062: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B806C: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_15 - - thumb_func_start ContestEffect_16 -ContestEffect_16: @ 80B8070 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r9, r0 - ldr r0, _080B8108 @ =gSharedMem + 0x192D0 - ldrb r7, [r0, 0x11] - adds r1, r7, r0 - ldrb r1, [r1] - mov r10, r0 - cmp r1, 0 - beq _080B80E0 - movs r6, 0 - mov r8, r10 - mov r5, r10 - subs r5, 0x5B -_080B8094: - mov r1, r8 - adds r0, r7, r1 - adds r1, r6, r1 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080B80D8 - ldrb r1, [r5] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080B80D8 - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80B90C0 - lsls r0, 24 - cmp r0, 0 - beq _080B80D8 - ldrb r0, [r5] - movs r2, 0x11 - negs r2, r2 - adds r1, r2, 0 - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r5] - adds r0, r4, 0 - movs r1, 0x8 - bl SetContestantStatusUnk13 - movs r0, 0x1 - mov r9, r0 -_080B80D8: - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _080B8094 -_080B80E0: - mov r1, r10 - ldrb r0, [r1, 0x11] - movs r1, 0x7 - bl SetContestantStatusUnk13 - mov r2, r9 - cmp r2, 0 - bne _080B80FA - mov r1, r10 - ldrb r0, [r1, 0x11] - movs r1, 0x36 - bl SetContestantStatusUnk14 -_080B80FA: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B8108: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_16 - thumb_func_start ContestEffect_17 ContestEffect_17: @ 80B810C push {r4-r7,lr} diff --git a/include/contest.h b/include/contest.h index 241fd19fc..9ac51b536 100644 --- a/include/contest.h +++ b/include/contest.h @@ -227,9 +227,7 @@ struct UnknownContestStruct7 u8 unk0[4]; u16 unk4; u16 unk6; - u8 unk8; - u8 unk9; - u8 fillerA[3]; + u8 unk8[5]; u8 unkD[4]; u8 unk11; u8 filler12[2]; 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 --- asm/contest_effect.s | 213 --------------------------------------------------- src/contest_effect.c | 114 +++++++++++++++++++++------ 2 files changed, 91 insertions(+), 236 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 1996857eb..35c4b3518 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,219 +5,6 @@ .text - thumb_func_start ContestEffect_17 -ContestEffect_17: @ 80B810C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - mov r9, r0 - ldr r0, _080B8150 @ =gSharedMem + 0x192D0 - ldrb r1, [r0, 0x11] - mov r8, r1 - adds r1, r0 - ldrb r1, [r1] - adds r6, r0, 0 - cmp r1, 0 - beq _080B817C - movs r5, 0 - adds r4, r6, 0 - movs r7, 0 -_080B812E: - mov r2, r8 - adds r0, r2, r4 - adds r1, r5, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080B8172 - adds r0, r6, 0 - subs r0, 0x70 - adds r0, r7, r0 - ldrb r1, [r0, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080B8154 - movs r0, 0x32 - b _080B8156 - .align 2, 0 -_080B8150: .4byte gSharedMem + 0x192D0 -_080B8154: - movs r0, 0xA -_080B8156: - strh r0, [r4, 0x4] - strb r5, [r4, 0x8] - movs r0, 0xFF - strb r0, [r4, 0x9] - bl sub_80B9120 - lsls r0, 24 - cmp r0, 0 - beq _080B8172 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080B8172: - adds r7, 0x1C - adds r5, 0x1 - ldr r6, _080B81A0 @ =gSharedMem + 0x192D0 - cmp r5, 0x3 - ble _080B812E -_080B817C: - ldrb r0, [r6, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - mov r0, r9 - cmp r0, 0 - bne _080B8192 - ldrb r0, [r6, 0x11] - movs r1, 0x36 - bl SetContestantStatusUnk14 -_080B8192: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B81A0: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_17 - - thumb_func_start ContestEffect_18 -ContestEffect_18: @ 80B81A4 - push {r4,lr} - ldr r4, _080B81D0 @ =gSharedMem + 0x192D0 - ldrb r1, [r4, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r4, 0 - subs r1, 0x70 - adds r0, r1 - ldrb r1, [r0, 0x11] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x11] - bl ContestEffect_09 - ldrb r0, [r4, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080B81D0: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_18 - - thumb_func_start ContestEffect_19 -ContestEffect_19: @ 80B81D4 - push {r4,lr} - ldr r4, _080B8208 @ =gSharedMem + 0x192D0 - ldrb r1, [r4, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r4, 0 - subs r1, 0x70 - adds r0, r1 - ldrh r0, [r0, 0x6] - ldr r1, _080B820C @ =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 29 - lsrs r0, 29 - bl sub_80B9038 - ldrb r0, [r4, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080B8208: .4byte gSharedMem + 0x192D0 -_080B820C: .4byte gContestMoves - thumb_func_end ContestEffect_19 - - thumb_func_start ContestEffect_20 -ContestEffect_20: @ 80B8210 - push {lr} - movs r0, 0 - bl sub_80B9038 - ldr r0, _080B8228 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - pop {r0} - bx r0 - .align 2, 0 -_080B8228: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_20 - - thumb_func_start ContestEffect_21 -ContestEffect_21: @ 80B822C - push {lr} - movs r0, 0x1 - bl sub_80B9038 - ldr r0, _080B8244 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - pop {r0} - bx r0 - .align 2, 0 -_080B8244: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_21 - - thumb_func_start ContestEffect_22 -ContestEffect_22: @ 80B8248 - push {lr} - movs r0, 0x2 - bl sub_80B9038 - ldr r0, _080B8260 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - pop {r0} - bx r0 - .align 2, 0 -_080B8260: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_22 - - thumb_func_start ContestEffect_23 -ContestEffect_23: @ 80B8264 - push {lr} - movs r0, 0x3 - bl sub_80B9038 - ldr r0, _080B827C @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - pop {r0} - bx r0 - .align 2, 0 -_080B827C: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_23 - - thumb_func_start ContestEffect_24 -ContestEffect_24: @ 80B8280 - push {lr} - movs r0, 0x4 - bl sub_80B9038 - ldr r0, _080B8298 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - pop {r0} - bx r0 - .align 2, 0 -_080B8298: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_24 - thumb_func_start ContestEffect_25 ContestEffect_25: @ 80B829C push {r4-r7,lr} 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 --- asm/contest_effect.s | 61 ---------------------------------------------------- include/contest.h | 1 + src/contest_effect.c | 31 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 61 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 35c4b3518..b3d865b3d 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,67 +5,6 @@ .text - thumb_func_start ContestEffect_25 -ContestEffect_25: @ 80B829C - push {r4-r7,lr} - movs r4, 0 - ldr r0, _080B82E0 @ =gSharedMem + 0x192D0 - ldrb r1, [r0, 0x11] - adds r1, r0 - ldrb r1, [r1] - adds r7, r0, 0 - cmp r1, 0x3 - beq _080B82F4 - movs r5, 0 - adds r6, r7, 0 -_080B82B2: - ldrb r0, [r6, 0x11] - adds r0, r6 - ldrb r0, [r0] - adds r0, 0x1 - adds r1, r5, r6 - ldrb r1, [r1] - cmp r0, r1 - bne _080B82EE - lsls r0, r5, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80B90C0 - lsls r0, 24 - cmp r0, 0 - beq _080B82E4 - adds r0, r4, 0 - bl sub_80B157C - adds r0, r4, 0 - movs r1, 0xA - b _080B82E8 - .align 2, 0 -_080B82E0: .4byte gSharedMem + 0x192D0 -_080B82E4: - adds r0, r4, 0 - movs r1, 0x3C -_080B82E8: - bl SetContestantStatusUnk13 - movs r4, 0x1 -_080B82EE: - adds r5, 0x1 - cmp r5, 0x3 - ble _080B82B2 -_080B82F4: - ldrb r0, [r7, 0x11] - movs r1, 0x9 - bl SetContestantStatusUnk13 - cmp r4, 0 - bne _080B8308 - ldrb r0, [r7, 0x11] - movs r1, 0x36 - bl SetContestantStatusUnk14 -_080B8308: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffect_25 - thumb_func_start ContestEffect_26 ContestEffect_26: @ 80B8310 push {r4-r7,lr} diff --git a/include/contest.h b/include/contest.h index 9ac51b536..24f3331b7 100644 --- a/include/contest.h +++ b/include/contest.h @@ -279,5 +279,6 @@ extern u8 gUnknown_02038696[4]; extern u8 gUnknown_0203869B; void SetContestantStatusUnk13(u8 a, u8 b); void SetContestantStatusUnk14(u8 a, u8 b); +void sub_80B157C(u8 p); #endif // GUARD_CONTEST_H 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 --- asm/contest_effect.s | 248 --------------------------------------------------- include/contest.h | 2 + src/contest.c | 1 - src/contest_ai.c | 3 - src/contest_effect.c | 75 ++++++++++++++++ 5 files changed, 77 insertions(+), 252 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index b3d865b3d..cbab264d5 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,254 +5,6 @@ .text - thumb_func_start ContestEffect_26 -ContestEffect_26: @ 80B8310 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - movs r0, 0 - mov r9, r0 - movs r1, 0 - str r1, [sp, 0x18] - mov r0, sp - movs r1, 0xFF - movs r2, 0x5 - bl memset - movs r6, 0 - movs r4, 0 - add r2, sp, 0x10 - mov r8, r2 - add r3, sp, 0x8 - mov r10, r3 - ldr r5, _080B8384 @ =gSharedMem + 0x192D0 - adds r7, r5, 0 - subs r7, 0x70 -_080B8340: - ldrb r0, [r5, 0x11] - adds r0, r5 - adds r1, r6, r5 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _080B836E - ldrb r1, [r7, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080B836E - lsls r0, r6, 24 - lsrs r0, 24 - bl Contest_IsMonsTurnDisabled - lsls r0, 24 - cmp r0, 0 - bne _080B836E - mov r1, sp - adds r0, r1, r4 - strb r6, [r0] - adds r4, 0x1 -_080B836E: - adds r7, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _080B8340 - cmp r4, 0x1 - bne _080B8388 - movs r0, 0x3C - mov r2, r8 - strh r0, [r2] - b _080B83B6 - .align 2, 0 -_080B8384: .4byte gSharedMem + 0x192D0 -_080B8388: - cmp r4, 0x2 - bne _080B8396 - movs r0, 0x1E - mov r3, r8 - strh r0, [r3] - strh r0, [r3, 0x2] - b _080B83B6 -_080B8396: - cmp r4, 0x3 - bne _080B83A6 - movs r0, 0x14 - mov r7, r8 - strh r0, [r7] - strh r0, [r7, 0x2] - strh r0, [r7, 0x4] - b _080B83B6 -_080B83A6: - mov r1, r8 - movs r2, 0 - mov r0, r8 - adds r0, 0x6 -_080B83AE: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _080B83AE -_080B83B6: - movs r6, 0 - movs r7, 0 - mov r4, r10 -_080B83BC: - ldr r0, _080B83F0 @ =gSharedMem + 0x19260 - adds r5, r7, r0 - ldrb r1, [r5, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080B83FC - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_80B214C - lsls r0, 24 - cmp r0, 0 - beq _080B83FC - ldr r1, _080B83F4 @ =gContestMoves - ldrh r0, [r5, 0x8] - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x2] - ldr r1, _080B83F8 @ =gComboStarterLookupTable - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - b _080B83FE - .align 2, 0 -_080B83F0: .4byte gSharedMem + 0x19260 -_080B83F4: .4byte gContestMoves -_080B83F8: .4byte gComboStarterLookupTable -_080B83FC: - movs r0, 0 -_080B83FE: - strh r0, [r4] - ldr r5, _080B8494 @ =gSharedMem + 0x19260 - adds r0, r7, r5 - ldrb r0, [r0, 0xD] - lsls r0, 24 - asrs r0, 24 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - asrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 1 - ldrh r0, [r4] - subs r0, r1 - strh r0, [r4] - adds r7, 0x1C - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _080B83BC - mov r2, r8 - movs r3, 0 - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _080B84CA - movs r6, 0 - mov r0, sp - ldrb r0, [r0] - cmp r0, 0xFF - beq _080B84CA - adds r5, 0x7D - mov r4, sp -_080B8442: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r6, 1 - add r1, r8 - movs r7, 0 - ldrsh r2, [r1, r7] - ldrb r3, [r4] - lsls r1, r3, 1 - add r1, r10 - movs r7, 0 - ldrsh r1, [r1, r7] - adds r2, r1 - cmp r0, r2 - bge _080B8498 - adds r0, r3, 0 - bl sub_80B90C0 - lsls r0, 24 - cmp r0, 0 - beq _080B84A2 - ldrb r0, [r4] - bl sub_80B157C - ldrb r0, [r4] - movs r1, 0xA - bl SetContestantStatusUnk13 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - b _080B849C - .align 2, 0 -_080B8494: .4byte gSharedMem + 0x19260 -_080B8498: - movs r0, 0x1 - str r0, [sp, 0x18] -_080B849C: - ldr r1, [sp, 0x18] - cmp r1, 0 - beq _080B84B8 -_080B84A2: - movs r2, 0 - str r2, [sp, 0x18] - ldrb r0, [r4] - movs r1, 0x3C - bl SetContestantStatusUnk13 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080B84B8: - ldrb r0, [r4] - adds r0, r5 - movs r1, 0x1 - strb r1, [r0] - adds r4, 0x1 - adds r6, 0x1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _080B8442 -_080B84CA: - ldr r4, _080B84F4 @ =gSharedMem + 0x192D0 - ldrb r0, [r4, 0x11] - movs r1, 0xB - bl SetContestantStatusUnk13 - mov r3, r9 - cmp r3, 0 - bne _080B84E2 - ldrb r0, [r4, 0x11] - movs r1, 0x36 - bl SetContestantStatusUnk14 -_080B84E2: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B84F4: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_26 - thumb_func_start ContestEffect_27 ContestEffect_27: @ 80B84F8 push {r4-r7,lr} diff --git a/include/contest.h b/include/contest.h index 24f3331b7..6e3d64cd1 100644 --- a/include/contest.h +++ b/include/contest.h @@ -280,5 +280,7 @@ extern u8 gUnknown_0203869B; void SetContestantStatusUnk13(u8 a, u8 b); void SetContestantStatusUnk14(u8 a, u8 b); void sub_80B157C(u8 p); +bool8 Contest_IsMonsTurnDisabled(u8 a); +bool8 sub_80B214C(u8 a); #endif // GUARD_CONTEST_H diff --git a/src/contest.c b/src/contest.c index 77455e882..686b01476 100644 --- a/src/contest.c +++ b/src/contest.c @@ -201,7 +201,6 @@ void sub_80AF1B8(void); void sub_80AF2A0(u8); void sub_80AF2FC(void); void sub_80AF3C0(void); -bool8 Contest_IsMonsTurnDisabled(u8); s16 sub_80AF688(u8); void DetermineFinalStandings(void); bool8 sub_80AF828(s32, s32, struct UnknownContestStruct6 *); diff --git a/src/contest_ai.c b/src/contest_ai.c index 63894635b..8fce9d15f 100644 --- a/src/contest_ai.c +++ b/src/contest_ai.c @@ -5,9 +5,6 @@ #include "contest_effect.h" #include "ewram.h" -extern bool8 sub_80B214C(u8); -extern bool8 Contest_IsMonsTurnDisabled(u8); - extern u16 gSpecialVar_ContestCategory; extern u8 *gAIScriptPtr; 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 --- asm/contest_effect.s | 222 --------------------------------------------------- src/contest_effect.c | 67 ++++++++++++++++ 2 files changed, 67 insertions(+), 222 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index cbab264d5..bcc49aa02 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,228 +5,6 @@ .text - thumb_func_start ContestEffect_27 -ContestEffect_27: @ 80B84F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - mov r8, r0 - movs r6, 0 - ldr r7, _080B8580 @ =gSharedMem + 0x192D0 - adds r5, r7, 0 - subs r5, 0x63 -_080B850A: - ldrb r0, [r7, 0x11] - adds r0, r7 - adds r1, r6, r7 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080B8556 - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r0, 0 - ble _080B8556 - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80B90C0 - lsls r0, 24 - cmp r0, 0 - beq _080B8556 - movs r0, 0 - strb r0, [r5] - ldrb r1, [r5, 0x3] - movs r2, 0x31 - negs r2, r2 - adds r0, r2, 0 - ands r1, r0 - movs r0, 0x20 - orrs r1, r0 - strb r1, [r5, 0x3] - adds r0, r4, 0 - movs r1, 0xD - bl SetContestantStatusUnk13 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 -_080B8556: - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _080B850A - ldr r4, _080B8580 @ =gSharedMem + 0x192D0 - ldrb r0, [r4, 0x11] - movs r1, 0xC - bl SetContestantStatusUnk13 - mov r0, r8 - cmp r0, 0 - bne _080B8576 - ldrb r0, [r4, 0x11] - movs r1, 0x39 - bl SetContestantStatusUnk14 -_080B8576: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B8580: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_27 - - thumb_func_start ContestEffect_28 -ContestEffect_28: @ 80B8584 - push {r4-r7,lr} - movs r7, 0 - movs r5, 0 - ldr r4, _080B85B0 @ =gSharedMem + 0x192D0 - movs r6, 0 -_080B858E: - ldrb r0, [r4, 0x11] - adds r0, r4 - adds r1, r5, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080B85CE - adds r0, r4, 0 - subs r0, 0x70 - adds r0, r6, r0 - ldrb r0, [r0, 0xD] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _080B85B4 - movs r0, 0x28 - b _080B85B6 - .align 2, 0 -_080B85B0: .4byte gSharedMem + 0x192D0 -_080B85B4: - movs r0, 0xA -_080B85B6: - strh r0, [r4, 0x4] - strb r5, [r4, 0x8] - movs r0, 0xFF - strb r0, [r4, 0x9] - bl sub_80B9120 - lsls r0, 24 - cmp r0, 0 - beq _080B85CE - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_080B85CE: - adds r6, 0x1C - adds r5, 0x1 - cmp r5, 0x3 - ble _080B858E - ldr r4, _080B85F4 @ =gSharedMem + 0x192D0 - ldrb r0, [r4, 0x11] - movs r1, 0xE - bl SetContestantStatusUnk13 - cmp r7, 0 - bne _080B85EC - ldrb r0, [r4, 0x11] - movs r1, 0x39 - bl SetContestantStatusUnk14 -_080B85EC: - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B85F4: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_28 - - thumb_func_start ContestEffect_29 -ContestEffect_29: @ 80B85F8 - push {r4,lr} - ldr r0, _080B863C @ =gUnknown_02038696 - ldr r4, _080B8640 @ =gSharedMem + 0x192D0 - ldrb r2, [r4, 0x11] - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _080B8636 - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r0, r4, 0 - subs r0, 0x70 - adds r1, r0 - ldrh r0, [r1, 0x6] - ldr r3, _080B8644 @ =gContestEffects - ldr r2, _080B8648 @ =gContestMoves - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - lsls r0, 1 - ldrh r2, [r1, 0x2] - adds r0, r2 - strh r0, [r1, 0x2] - ldrb r0, [r4, 0x11] - movs r1, 0xF - bl SetContestantStatusUnk13 -_080B8636: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080B863C: .4byte gUnknown_02038696 -_080B8640: .4byte gSharedMem + 0x192D0 -_080B8644: .4byte gContestEffects -_080B8648: .4byte gContestMoves - thumb_func_end ContestEffect_29 - - thumb_func_start ContestEffect_30 -ContestEffect_30: @ 80B864C - push {r4,lr} - ldr r0, _080B8690 @ =gUnknown_02038696 - ldr r4, _080B8694 @ =gSharedMem + 0x192D0 - ldrb r2, [r4, 0x11] - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, 0x3 - bne _080B868A - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r0, r4, 0 - subs r0, 0x70 - adds r1, r0 - ldrh r0, [r1, 0x6] - ldr r3, _080B8698 @ =gContestEffects - ldr r2, _080B869C @ =gContestMoves - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - lsls r0, 1 - ldrh r2, [r1, 0x2] - adds r0, r2 - strh r0, [r1, 0x2] - ldrb r0, [r4, 0x11] - movs r1, 0x10 - bl SetContestantStatusUnk13 -_080B868A: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080B8690: .4byte gUnknown_02038696 -_080B8694: .4byte gSharedMem + 0x192D0 -_080B8698: .4byte gContestEffects -_080B869C: .4byte gContestMoves - thumb_func_end ContestEffect_30 - thumb_func_start ContestEffect_31 ContestEffect_31: @ 80B86A0 push {r4-r7,lr} 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 --- asm/contest_effect.s | 217 --------------------------------------------------- src/contest_effect.c | 62 +++++++++++++++ 2 files changed, 62 insertions(+), 217 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index bcc49aa02..ff19558d6 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,223 +5,6 @@ .text - thumb_func_start ContestEffect_31 -ContestEffect_31: @ 80B86A0 - push {r4-r7,lr} - movs r1, 0 - movs r3, 0 - ldr r4, _080B86EC @ =gSharedMem + 0x192D0 - ldrb r0, [r4, 0x11] - adds r0, r4 - ldrb r5, [r0] - movs r2, 0 - adds r6, r4, 0 - subs r6, 0x70 -_080B86B4: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r5, r0 - bls _080B86C4 - adds r0, r2, r6 - movs r7, 0x2 - ldrsh r0, [r0, r7] - adds r3, r0 -_080B86C4: - adds r2, 0x1C - adds r1, 0x1 - cmp r1, 0x3 - ble _080B86B4 - cmp r3, 0 - bge _080B86D2 - movs r3, 0 -_080B86D2: - ldr r4, _080B86EC @ =gSharedMem + 0x192D0 - ldrb r2, [r4, 0x11] - adds r0, r2, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _080B86E2 - cmp r3, 0 - bne _080B86F0 -_080B86E2: - adds r0, r2, 0 - movs r1, 0x12 - bl SetContestantStatusUnk13 - b _080B8710 - .align 2, 0 -_080B86EC: .4byte gSharedMem + 0x192D0 -_080B86F0: - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r0, r4, 0 - subs r0, 0x70 - adds r1, r0 - lsrs r0, r3, 31 - adds r0, r3, r0 - asrs r0, 1 - ldrh r2, [r1, 0x2] - adds r0, r2 - strh r0, [r1, 0x2] - ldrb r0, [r4, 0x11] - movs r1, 0x11 - bl SetContestantStatusUnk13 -_080B8710: - ldr r4, _080B873C @ =gSharedMem + 0x192D0 - ldrb r1, [r4, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r5, r4, 0 - subs r5, 0x70 - adds r0, r5 - movs r7, 0x2 - ldrsh r0, [r0, r7] - bl sub_80B9224 - ldrb r2, [r4, 0x11] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r5 - strh r0, [r1, 0x2] - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B873C: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_31 - - thumb_func_start ContestEffect_32 -ContestEffect_32: @ 80B8740 - push {r4-r7,lr} - movs r6, 0 - ldr r0, _080B8794 @ =gSharedMem + 0x192D0 - ldrb r1, [r0, 0x11] - adds r3, r1, r0 - ldrb r1, [r3] - adds r4, r0, 0 - cmp r1, 0 - beq _080B8788 - movs r2, 0 - adds r7, r4, 0 - adds r0, r1, 0 - subs r1, r0, 0x1 - movs r3, 0 - adds r5, r4, 0 - subs r5, 0x70 -_080B8760: - adds r0, r2, r7 - ldrb r0, [r0] - cmp r1, r0 - bne _080B876C - adds r0, r3, r5 - ldrh r6, [r0, 0x2] -_080B876C: - adds r3, 0x1C - adds r2, 0x1 - cmp r2, 0x3 - ble _080B8760 - adds r0, r4, 0 - ldrb r2, [r0, 0x11] - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _080B8788 - lsls r0, r6, 16 - asrs r3, r0, 16 - cmp r3, 0 - bgt _080B8798 -_080B8788: - ldrb r0, [r4, 0x11] - movs r1, 0x14 - bl SetContestantStatusUnk13 - b _080B87B2 - .align 2, 0 -_080B8794: .4byte gSharedMem + 0x192D0 -_080B8798: - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r0, r4, 0 - subs r0, 0x70 - adds r1, r0 - ldrh r0, [r1, 0x2] - adds r0, r3, r0 - strh r0, [r1, 0x2] - ldrb r0, [r4, 0x11] - movs r1, 0x13 - bl SetContestantStatusUnk13 -_080B87B2: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffect_32 - - thumb_func_start ContestEffect_33 -ContestEffect_33: @ 80B87B8 - push {lr} - ldr r0, _080B87D8 @ =gSharedMem + 0x192D0 - ldrb r2, [r0, 0x11] - adds r1, r2, r0 - ldrb r3, [r1] - mov r12, r0 - cmp r3, 0 - bne _080B87DC - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - mov r1, r12 - subs r1, 0x70 - adds r0, r1 - movs r1, 0xA - b _080B87EE - .align 2, 0 -_080B87D8: .4byte gSharedMem + 0x192D0 -_080B87DC: - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - mov r1, r12 - subs r1, 0x70 - adds r0, r1 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 -_080B87EE: - strh r1, [r0, 0x2] - cmp r3, 0 - bne _080B8800 - mov r1, r12 - ldrb r0, [r1, 0x11] - movs r1, 0x15 - bl SetContestantStatusUnk13 - b _080B882A -_080B8800: - cmp r3, 0x1 - bne _080B8810 - mov r1, r12 - ldrb r0, [r1, 0x11] - movs r1, 0x16 - bl SetContestantStatusUnk13 - b _080B882A -_080B8810: - cmp r3, 0x2 - bne _080B8820 - mov r1, r12 - ldrb r0, [r1, 0x11] - movs r1, 0x17 - bl SetContestantStatusUnk13 - b _080B882A -_080B8820: - mov r1, r12 - ldrb r0, [r1, 0x11] - movs r1, 0x18 - bl SetContestantStatusUnk13 -_080B882A: - pop {r0} - bx r0 - thumb_func_end ContestEffect_33 - thumb_func_start ContestEffect_34 ContestEffect_34: @ 80B8830 push {r4,lr} 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 --- asm/contest_effect.s | 76 ---------------------------------------------------- src/contest_effect.c | 30 +++++++++++++++++++++ 2 files changed, 30 insertions(+), 76 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index ff19558d6..3013759a1 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,82 +5,6 @@ .text - thumb_func_start ContestEffect_34 -ContestEffect_34: @ 80B8830 - push {r4,lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x2 - bhi _080B885C - movs r4, 0xA - ldr r0, _080B8858 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x1A - bl SetContestantStatusUnk13 - b _080B88B0 - .align 2, 0 -_080B8858: .4byte gSharedMem + 0x192D0 -_080B885C: - cmp r0, 0x5 - bhi _080B8874 - movs r4, 0x14 - ldr r0, _080B8870 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x1B - bl SetContestantStatusUnk13 - b _080B88B0 - .align 2, 0 -_080B8870: .4byte gSharedMem + 0x192D0 -_080B8874: - cmp r0, 0x7 - bhi _080B888C - movs r4, 0x28 - ldr r0, _080B8888 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x1C - bl SetContestantStatusUnk13 - b _080B88B0 - .align 2, 0 -_080B8888: .4byte gSharedMem + 0x192D0 -_080B888C: - cmp r1, 0x8 - bhi _080B88A4 - movs r4, 0x3C - ldr r0, _080B88A0 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x1D - bl SetContestantStatusUnk13 - b _080B88B0 - .align 2, 0 -_080B88A0: .4byte gSharedMem + 0x192D0 -_080B88A4: - movs r4, 0x50 - ldr r0, _080B88C8 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x1E - bl SetContestantStatusUnk13 -_080B88B0: - ldr r0, _080B88C8 @ =gSharedMem + 0x192D0 - ldrb r2, [r0, 0x11] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - subs r0, 0x70 - adds r1, r0 - strh r4, [r1, 0x2] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080B88C8: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_34 - thumb_func_start ContestEffect_35 ContestEffect_35: @ 80B88CC push {r4-r7,lr} 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) --- asm/contest_effect.s | 115 ---------------------------------------- src/contest_effect.c | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+), 115 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 3013759a1..6b65c85c8 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,121 +5,6 @@ .text - thumb_func_start ContestEffect_35 -ContestEffect_35: @ 80B88CC - push {r4-r7,lr} - ldr r1, _080B8940 @ =gSharedMem + 0x192D0 - ldrb r0, [r1, 0x11] - adds r0, r1 - movs r2, 0 - ldrsb r2, [r0, r2] - subs r0, r2, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - mov r12, r1 - cmp r2, 0 - beq _080B8994 - ldrb r5, [r1] - mov r6, r12 - subs r6, 0x70 -_080B88EA: - movs r2, 0 - lsls r0, r4, 24 - asrs r1, r0, 24 - adds r4, r0, 0 - cmp r5, r1 - beq _080B8910 - ldr r3, _080B8940 @ =gSharedMem + 0x192D0 -_080B88F8: - lsls r0, r2, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - bgt _080B8910 - adds r0, r3 - ldrb r0, [r0] - cmp r0, r1 - bne _080B88F8 -_080B8910: - lsls r2, 24 - asrs r1, r2, 24 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r3, r0, r6 - ldrb r1, [r3, 0xB] - movs r0, 0x80 - ands r0, r1 - adds r7, r2, 0 - cmp r0, 0 - bne _080B8932 - ldrb r1, [r3, 0xC] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _080B8944 -_080B8932: - movs r1, 0xFF - lsls r1, 24 - adds r0, r4, r1 - lsrs r4, r0, 24 - cmp r0, 0 - blt _080B8994 - b _080B88EA - .align 2, 0 -_080B8940: .4byte gSharedMem + 0x192D0 -_080B8944: - mov r2, r12 - ldrb r1, [r2, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r3, r12 - subs r3, 0x70 - adds r5, r0, r3 - ldrh r0, [r5, 0x6] - ldr r4, _080B899C @ =gContestMoves - lsls r0, 3 - adds r6, r0, r4 - ldrb r2, [r6, 0x1] - lsls r2, 29 - asrs r1, r7, 24 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x6] - lsls r0, 3 - adds r0, r4 - ldrb r0, [r0, 0x1] - lsls r0, 29 - cmp r2, r0 - bne _080B8994 - ldr r1, _080B89A0 @ =gContestEffects - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 1 - ldrh r1, [r5, 0x2] - adds r0, r1 - strh r0, [r5, 0x2] - mov r2, r12 - ldrb r0, [r2, 0x11] - movs r1, 0x1F - bl SetContestantStatusUnk13 -_080B8994: - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B899C: .4byte gContestMoves -_080B89A0: .4byte gContestEffects - thumb_func_end ContestEffect_35 - thumb_func_start ContestEffect_36 ContestEffect_36: @ 80B89A4 push {r4-r7,lr} 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 --- asm/contest_effect.s | 194 --------------------------------------------------- src/contest_effect.c | 57 +++++++++++++++ 2 files changed, 57 insertions(+), 194 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 6b65c85c8..fd648ab54 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,200 +5,6 @@ .text - thumb_func_start ContestEffect_36 -ContestEffect_36: @ 80B89A4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, _080B8A28 @ =gSharedMem + 0x192D0 - ldrb r2, [r0, 0x11] - adds r1, r2, r0 - ldrb r1, [r1] - mov r8, r0 - cmp r1, 0 - beq _080B8A3C - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - mov r1, r8 - subs r1, 0x70 - adds r0, r1 - ldrh r0, [r0, 0x6] - mov r9, r0 - movs r4, 0 - mov r6, r8 - ldr r0, _080B8A2C @ =gContestMoves - mov r12, r0 - movs r7, 0 -_080B89D4: - ldrb r2, [r6, 0x11] - adds r0, r2, r6 - ldrb r0, [r0] - subs r0, 0x1 - adds r1, r4, r6 - ldrb r1, [r1] - cmp r0, r1 - bne _080B8A34 - mov r1, r9 - lsls r0, r1, 3 - mov r1, r12 - adds r3, r0, r1 - ldrb r1, [r3, 0x1] - lsls r1, 29 - mov r5, r8 - subs r5, 0x70 - adds r0, r7, r5 - ldrh r0, [r0, 0x6] - lsls r0, 3 - add r0, r12 - ldrb r0, [r0, 0x1] - lsls r0, 29 - cmp r1, r0 - beq _080B8A34 - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r5 - ldr r2, _080B8A30 @ =gContestEffects - ldrb r0, [r3] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - lsls r0, 1 - ldrh r2, [r1, 0x2] - adds r0, r2 - strh r0, [r1, 0x2] - ldrb r0, [r6, 0x11] - movs r1, 0x20 - bl SetContestantStatusUnk13 - b _080B8A3C - .align 2, 0 -_080B8A28: .4byte gSharedMem + 0x192D0 -_080B8A2C: .4byte gContestMoves -_080B8A30: .4byte gContestEffects -_080B8A34: - adds r7, 0x1C - adds r4, 0x1 - cmp r4, 0x3 - ble _080B89D4 -_080B8A3C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffect_36 - - thumb_func_start ContestEffect_37 -ContestEffect_37: @ 80B8A48 - push {r4-r7,lr} - ldr r1, _080B8A94 @ =gSharedMem + 0x192D0 - ldrb r0, [r1, 0x11] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080B8AB0 - movs r5, 0 - adds r4, r1, 0 - adds r6, r4, 0 - subs r6, 0x70 - adds r7, r6, 0 -_080B8A60: - ldrb r2, [r4, 0x11] - adds r0, r2, r4 - ldrb r0, [r0] - subs r0, 0x1 - adds r1, r5, r4 - ldrb r1, [r1] - cmp r0, r1 - bne _080B8AA8 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r2, r0, r7 - movs r0, 0x2 - ldrsh r1, [r2, r0] - movs r3, 0x2 - ldrsh r0, [r6, r3] - cmp r1, r0 - ble _080B8A98 - adds r0, r1, 0 - lsls r0, 1 - strh r0, [r2, 0x2] - ldrb r0, [r4, 0x11] - movs r1, 0x21 - bl SetContestantStatusUnk13 - b _080B8AA8 - .align 2, 0 -_080B8A94: .4byte gSharedMem + 0x192D0 -_080B8A98: - cmp r1, r0 - bge _080B8AA8 - movs r0, 0 - strh r0, [r2, 0x2] - ldrb r0, [r4, 0x11] - movs r1, 0x22 - bl SetContestantStatusUnk13 -_080B8AA8: - adds r6, 0x1C - adds r5, 0x1 - cmp r5, 0x3 - ble _080B8A60 -_080B8AB0: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffect_37 - - thumb_func_start ContestEffect_38 -ContestEffect_38: @ 80B8AB8 - push {r4,r5,lr} - ldr r4, _080B8AFC @ =gSharedMem + 0x192D0 - ldrb r2, [r4, 0x11] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r5, r4, 0 - subs r5, 0x70 - adds r1, r0, r5 - ldrb r3, [r1, 0xD] - movs r0, 0xD - ldrsb r0, [r1, r0] - cmp r0, 0x1D - bgt _080B8B00 - adds r0, r3, 0 - adds r0, 0xA - strb r0, [r1, 0xD] - ldrb r1, [r4, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r2, [r0, 0x10] - movs r1, 0x31 - negs r1, r1 - ands r1, r2 - movs r2, 0x10 - orrs r1, r2 - strb r1, [r0, 0x10] - ldrb r0, [r4, 0x11] - movs r1, 0x23 - bl SetContestantStatusUnk13 - b _080B8B08 - .align 2, 0 -_080B8AFC: .4byte gSharedMem + 0x192D0 -_080B8B00: - adds r0, r2, 0 - movs r1, 0x3A - bl SetContestantStatusUnk13 -_080B8B08: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end ContestEffect_38 - thumb_func_start ContestEffect_39 ContestEffect_39: @ 80B8B10 push {r4,lr} 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 --- asm/contest_effect.s | 199 --------------------------------------------------- src/contest_effect.c | 50 +++++++++++++ 2 files changed, 50 insertions(+), 199 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index fd648ab54..37149e452 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,205 +5,6 @@ .text - thumb_func_start ContestEffect_39 -ContestEffect_39: @ 80B8B10 - push {r4,lr} - ldr r3, _080B8B48 @ =gSharedMem + 0x192D0 - ldrb r1, [r3, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r4, r3, 0 - subs r4, 0x70 - adds r0, r4 - ldrb r1, [r0, 0x11] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x11] - ldrb r1, [r3, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0xD] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _080B8B4C - adds r0, r1, 0 - movs r1, 0x24 - bl SetContestantStatusUnk13 - b _080B8B54 - .align 2, 0 -_080B8B48: .4byte gSharedMem + 0x192D0 -_080B8B4C: - adds r0, r1, 0 - movs r1, 0x3B - bl SetContestantStatusUnk13 -_080B8B54: - pop {r4} - pop {r0} - bx r0 - thumb_func_end ContestEffect_39 - - thumb_func_start ContestEffect_40 -ContestEffect_40: @ 80B8B5C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r1, _080B8BE4 @ =gSharedMem + 0x19204 - ldrb r0, [r1, 0x1] - cmp r0, 0x4 - bne _080B8B6E - b _080B8C76 -_080B8B6E: - movs r6, 0 - adds r7, r1, 0 - adds r7, 0xCC - adds r3, r1, 0 - adds r3, 0x5C -_080B8B78: - lsls r1, r6, 24 - asrs r1, 24 - mov r0, sp - adds r2, r0, r1 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x19] - strb r0, [r2] - adds r1, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _080B8B78 - ldrb r0, [r7, 0x11] - mov r2, sp - adds r1, r2, r0 - movs r0, 0xFF - strb r0, [r1] - movs r6, 0 - mov r12, r7 - movs r4, 0x70 - negs r4, r4 - adds r4, r7 - mov r8, r4 -_080B8BAE: - movs r5, 0 -_080B8BB0: - lsls r0, r5, 24 - asrs r2, r0, 24 - mov r0, r12 - ldrb r0, [r0, 0x11] - cmp r2, r0 - beq _080B8BE8 - lsls r0, r6, 24 - asrs r3, r0, 24 - mov r1, sp - adds r4, r1, r2 - ldrb r0, [r4] - cmp r3, r0 - bne _080B8BE8 - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r8 - lsls r0, r3, 24 - lsrs r0, 24 - ldrb r1, [r1, 0x19] - cmp r0, r1 - bne _080B8BE8 - adds r0, r3, 0x1 - strb r0, [r4] - b _080B8BF8 - .align 2, 0 -_080B8BE4: .4byte gSharedMem + 0x19204 -_080B8BE8: - lsls r0, r5, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r5, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080B8BB0 -_080B8BF8: - cmp r5, 0x4 - beq _080B8C0C - lsls r0, r6, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r6, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080B8BAE -_080B8C0C: - ldrb r0, [r7, 0x11] - mov r4, sp - adds r1, r4, r0 - movs r0, 0 - strb r0, [r1] - ldrb r0, [r7, 0x11] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r3, r7, 0 - subs r3, 0x70 - adds r1, r3 - ldrb r2, [r1, 0x10] - movs r0, 0x3F - ands r0, r2 - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1, 0x10] - movs r6, 0 -_080B8C32: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - mov r4, sp - adds r2, r4, r1 - ldrb r2, [r2] - strb r2, [r0, 0x19] - adds r1, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _080B8C32 - ldrb r0, [r7, 0x11] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r7, 0 - subs r0, 0x70 - adds r1, r0 - ldrb r2, [r1, 0x11] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1, 0x11] - ldrb r0, [r7, 0x11] - movs r1, 0x25 - bl SetContestantStatusUnk13 -_080B8C76: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffect_40 - thumb_func_start ContestEffect_41 ContestEffect_41: @ 80B8C84 push {r4-r7,lr} 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 --- asm/contest_effect.s | 305 --------------------------------------------------- src/contest_effect.c | 153 ++++++++++++++++++++++++-- 2 files changed, 144 insertions(+), 314 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 37149e452..469486a1c 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,311 +5,6 @@ .text - thumb_func_start ContestEffect_41 -ContestEffect_41: @ 80B8C84 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r1, _080B8D14 @ =gSharedMem + 0x19204 - ldrb r0, [r1, 0x1] - cmp r0, 0x4 - bne _080B8C98 - b _080B8DA6 -_080B8C98: - movs r6, 0 - adds r7, r1, 0 - adds r7, 0xCC - adds r3, r1, 0 - adds r3, 0x5C -_080B8CA2: - lsls r1, r6, 24 - asrs r1, 24 - mov r0, sp - adds r2, r0, r1 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x19] - strb r0, [r2] - adds r1, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _080B8CA2 - ldrb r0, [r7, 0x11] - mov r2, sp - adds r1, r2, r0 - movs r0, 0xFF - strb r0, [r1] - movs r6, 0x3 - mov r12, r7 - movs r4, 0x70 - negs r4, r4 - adds r4, r7 - mov r8, r4 - movs r0, 0x1 - negs r0, r0 - mov r9, r0 -_080B8CDE: - movs r5, 0 -_080B8CE0: - lsls r0, r5, 24 - asrs r2, r0, 24 - mov r1, r12 - ldrb r1, [r1, 0x11] - cmp r2, r1 - beq _080B8D18 - lsls r0, r6, 24 - asrs r3, r0, 24 - mov r0, sp - adds r4, r0, r2 - ldrb r1, [r4] - cmp r3, r1 - bne _080B8D18 - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r8 - lsls r0, r3, 24 - lsrs r0, 24 - ldrb r1, [r1, 0x19] - cmp r0, r1 - bne _080B8D18 - subs r0, r3, 0x1 - strb r0, [r4] - b _080B8D28 - .align 2, 0 -_080B8D14: .4byte gSharedMem + 0x19204 -_080B8D18: - lsls r0, r5, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r5, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080B8CE0 -_080B8D28: - cmp r5, 0x4 - beq _080B8D3C - lsls r0, r6, 24 - movs r4, 0xFF - lsls r4, 24 - adds r0, r4 - lsrs r6, r0, 24 - asrs r0, 24 - cmp r0, r9 - bgt _080B8CDE -_080B8D3C: - ldrb r0, [r7, 0x11] - mov r2, sp - adds r1, r2, r0 - movs r0, 0x3 - strb r0, [r1] - ldrb r0, [r7, 0x11] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r3, r7, 0 - subs r3, 0x70 - adds r1, r3 - ldrb r2, [r1, 0x10] - movs r0, 0x3F - ands r0, r2 - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1, 0x10] - movs r6, 0 -_080B8D62: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - mov r4, sp - adds r2, r4, r1 - ldrb r2, [r2] - strb r2, [r0, 0x19] - adds r1, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _080B8D62 - ldrb r0, [r7, 0x11] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r7, 0 - subs r0, 0x70 - adds r1, r0 - ldrb r2, [r1, 0x11] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1, 0x11] - ldrb r0, [r7, 0x11] - movs r1, 0x26 - bl SetContestantStatusUnk13 -_080B8DA6: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffect_41 - - thumb_func_start ContestEffect_42 -ContestEffect_42: @ 80B8DB4 - bx lr - thumb_func_end ContestEffect_42 - - thumb_func_start ContestEffect_43 -ContestEffect_43: @ 80B8DB8 - push {r4-r7,lr} - sub sp, 0x8 - ldr r1, _080B8E30 @ =gSharedMem + 0x19204 - ldrb r0, [r1, 0x1] - cmp r0, 0x4 - beq _080B8EAE - movs r6, 0 - add r3, sp, 0x4 - adds r5, r1, 0 - adds r5, 0x5C - adds r4, r3, 0 -_080B8DCE: - lsls r1, r6, 24 - asrs r1, 24 - mov r0, sp - adds r2, r0, r1 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x19] - strb r0, [r2] - adds r0, r4, r1 - strb r6, [r0] - adds r1, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _080B8DCE - movs r6, 0 - adds r7, r3, 0 -_080B8DF6: - bl Random - lsls r0, 16 - lsrs r0, 16 - lsls r2, r6, 24 - asrs r2, 24 - movs r1, 0x4 - subs r1, r2 - bl __modsi3 - lsls r0, 24 - lsrs r4, r0, 24 - movs r1, 0 -_080B8E10: - lsls r0, r1, 24 - asrs r2, r0, 24 - adds r3, r7, r2 - ldrb r1, [r3] - adds r5, r0, 0 - cmp r1, 0xFF - beq _080B8E3A - cmp r4, 0 - bne _080B8E34 - mov r1, sp - adds r0, r1, r2 - strb r6, [r0] - movs r0, 0xFF - strb r0, [r3] - b _080B8E48 - .align 2, 0 -_080B8E30: .4byte gSharedMem + 0x19204 -_080B8E34: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080B8E3A: - movs r3, 0x80 - lsls r3, 17 - adds r0, r5, r3 - lsrs r1, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080B8E10 -_080B8E48: - lsls r0, r6, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r6, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080B8DF6 - movs r6, 0 - ldr r4, _080B8EB8 @ =gSharedMem + 0x192D0 - adds r7, r4, 0 - subs r7, 0x70 - movs r3, 0x3F - mov r12, r3 - movs r5, 0x80 -_080B8E66: - lsls r2, r6, 24 - asrs r2, 24 - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r7 - mov r3, sp - adds r0, r3, r2 - ldrb r0, [r0] - strb r0, [r1, 0x19] - ldrb r3, [r1, 0x10] - mov r0, r12 - ands r0, r3 - orrs r0, r5 - strb r0, [r1, 0x10] - adds r2, 0x1 - lsls r2, 24 - lsrs r6, r2, 24 - asrs r2, 24 - cmp r2, 0x3 - ble _080B8E66 - ldrb r1, [r4, 0x11] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r4, 0 - subs r1, 0x70 - adds r0, r1 - ldrb r1, [r0, 0x11] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x11] - ldrb r0, [r4, 0x11] - movs r1, 0x27 - bl SetContestantStatusUnk13 -_080B8EAE: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B8EB8: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_43 - thumb_func_start ContestEffect_44 ContestEffect_44: @ 80B8EBC push {lr} 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 --- asm/contest_effect.s | 203 --------------------------------------------------- include/contest.h | 4 +- src/contest_effect.c | 82 +++++++++++++++++++++ 3 files changed, 85 insertions(+), 204 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 469486a1c..6808c9204 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,209 +5,6 @@ .text - thumb_func_start ContestEffect_44 -ContestEffect_44: @ 80B8EBC - push {lr} - ldr r3, _080B8EF0 @ =gContestMoves - ldr r1, _080B8EF4 @ =gSharedMem + 0x192D0 - ldrb r2, [r1, 0x11] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - subs r1, 0x70 - adds r2, r0, r1 - ldrh r0, [r2, 0x6] - lsls r0, 3 - adds r0, r3 - ldrb r0, [r0, 0x1] - lsls r0, 29 - ldr r1, _080B8EF8 @ =gSpecialVar_ContestCategory - lsrs r0, 29 - ldrh r1, [r1] - cmp r0, r1 - beq _080B8EEA - ldrb r0, [r2, 0x11] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x11] -_080B8EEA: - pop {r0} - bx r0 - .align 2, 0 -_080B8EF0: .4byte gContestMoves -_080B8EF4: .4byte gSharedMem + 0x192D0 -_080B8EF8: .4byte gSpecialVar_ContestCategory - thumb_func_end ContestEffect_44 - - thumb_func_start ContestEffect_45 -ContestEffect_45: @ 80B8EFC - push {r4-r7,lr} - movs r7, 0 - movs r5, 0 - ldr r4, _080B8F34 @ =gSharedMem + 0x192D0 - movs r6, 0 -_080B8F06: - ldrb r0, [r4, 0x11] - adds r0, r4 - adds r1, r5, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080B8F52 - adds r0, r4, 0 - subs r0, 0x70 - adds r1, r6, r0 - movs r2, 0x2 - ldrsh r0, [r1, r2] - cmp r0, 0 - ble _080B8F38 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x4] - movs r1, 0x4 - ldrsh r0, [r4, r1] - bl sub_80B9268 - b _080B8F3A - .align 2, 0 -_080B8F34: .4byte gSharedMem + 0x192D0 -_080B8F38: - movs r0, 0xA -_080B8F3A: - strh r0, [r4, 0x4] - strb r5, [r4, 0x8] - movs r0, 0xFF - strb r0, [r4, 0x9] - bl sub_80B9120 - lsls r0, 24 - cmp r0, 0 - beq _080B8F52 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_080B8F52: - adds r6, 0x1C - adds r5, 0x1 - cmp r5, 0x3 - ble _080B8F06 - cmp r7, 0 - bne _080B8F68 - ldr r0, _080B8F78 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl SetContestantStatusUnk14 -_080B8F68: - ldr r0, _080B8F78 @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl SetContestantStatusUnk13 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B8F78: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_45 - - thumb_func_start ContestEffect_46 -ContestEffect_46: @ 80B8F7C - push {r4,lr} - ldr r0, _080B8F98 @ =gSharedMem + 0x19204 - movs r1, 0x13 - ldrsb r1, [r0, r1] - cmp r1, 0 - bne _080B8F9C - movs r4, 0xA - adds r0, 0xCC - ldrb r0, [r0, 0x11] - movs r1, 0x1A - bl SetContestantStatusUnk13 - b _080B8FDE - .align 2, 0 -_080B8F98: .4byte gSharedMem + 0x19204 -_080B8F9C: - cmp r1, 0x1 - bne _080B8FAE - movs r4, 0x14 - adds r0, 0xCC - ldrb r0, [r0, 0x11] - movs r1, 0x1B - bl SetContestantStatusUnk13 - b _080B8FDE -_080B8FAE: - cmp r1, 0x2 - bne _080B8FC0 - movs r4, 0x1E - adds r0, 0xCC - ldrb r0, [r0, 0x11] - movs r1, 0x1C - bl SetContestantStatusUnk13 - b _080B8FDE -_080B8FC0: - cmp r1, 0x3 - bne _080B8FD2 - movs r4, 0x32 - adds r0, 0xCC - ldrb r0, [r0, 0x11] - movs r1, 0x1D - bl SetContestantStatusUnk13 - b _080B8FDE -_080B8FD2: - movs r4, 0x3C - adds r0, 0xCC - ldrb r0, [r0, 0x11] - movs r1, 0x1E - bl SetContestantStatusUnk13 -_080B8FDE: - ldr r0, _080B8FF4 @ =gSharedMem + 0x192D0 - ldrb r2, [r0, 0x11] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - subs r0, 0x70 - adds r1, r0 - strh r4, [r1, 0x2] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080B8FF4: .4byte gSharedMem + 0x192D0 - thumb_func_end ContestEffect_46 - - thumb_func_start ContestEffect_47 -ContestEffect_47: @ 80B8FF8 - push {lr} - ldr r3, _080B9034 @ =gSharedMem + 0x19328 - ldrb r2, [r3, 0x1] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _080B902E - movs r0, 0x1 - orrs r2, r0 - movs r0, 0x58 - negs r0, r0 - adds r0, r3 - mov r12, r0 - ldrb r1, [r0, 0x11] - movs r0, 0x7 - ands r0, r1 - lsls r0, 1 - movs r1, 0xF - negs r1, r1 - ands r2, r1 - orrs r2, r0 - strb r2, [r3, 0x1] - mov r1, r12 - ldrb r0, [r1, 0x11] - movs r1, 0x3D - bl SetContestantStatusUnk13 -_080B902E: - pop {r0} - bx r0 - .align 2, 0 -_080B9034: .4byte gSharedMem + 0x19328 - thumb_func_end ContestEffect_47 - thumb_func_start sub_80B9038 sub_80B9038: @ 80B9038 push {r4-r7,lr} diff --git a/include/contest.h b/include/contest.h index 6e3d64cd1..2bcf32bef 100644 --- a/include/contest.h +++ b/include/contest.h @@ -225,7 +225,7 @@ struct UnknownContestStruct5 struct UnknownContestStruct7 { u8 unk0[4]; - u16 unk4; + s16 unk4; u16 unk6; u8 unk8[5]; u8 unkD[4]; @@ -277,6 +277,8 @@ extern u16 gUnknown_02038688[4]; extern u8 gContestFinalStandings[4]; extern u8 gUnknown_02038696[4]; extern u8 gUnknown_0203869B; +extern u16 gSpecialVar_ContestCategory; + void SetContestantStatusUnk13(u8 a, u8 b); void SetContestantStatusUnk14(u8 a, u8 b); void sub_80B157C(u8 p); 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 --- asm/contest_effect.s | 129 --------------------------------------------------- src/contest_effect.c | 105 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 103 insertions(+), 131 deletions(-) diff --git a/asm/contest_effect.s b/asm/contest_effect.s index 6808c9204..22d116663 100644 --- a/asm/contest_effect.s +++ b/asm/contest_effect.s @@ -5,135 +5,6 @@ .text - thumb_func_start sub_80B9038 -sub_80B9038: @ 80B9038 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r7, 0 - movs r5, 0 - ldr r4, _080B907C @ =gSharedMem + 0x192D0 - ldr r0, _080B9080 @ =gContestMoves - mov r9, r0 - movs r6, 0 -_080B9052: - ldrb r0, [r4, 0x11] - adds r0, r4 - adds r1, r5, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080B909A - adds r0, r4, 0 - subs r0, 0x70 - adds r0, r6, r0 - ldrh r0, [r0, 0x6] - lsls r0, 3 - add r0, r9 - ldrb r0, [r0, 0x1] - lsls r0, 29 - lsrs r0, 29 - cmp r8, r0 - bne _080B9084 - movs r0, 0x28 - b _080B9086 - .align 2, 0 -_080B907C: .4byte gSharedMem + 0x192D0 -_080B9080: .4byte gContestMoves -_080B9084: - movs r0, 0xA -_080B9086: - strh r0, [r4, 0x4] - strb r5, [r4, 0x8] - movs r0, 0xFF - strb r0, [r4, 0x9] - bl sub_80B9120 - lsls r0, 24 - cmp r0, 0 - beq _080B909A - adds r7, 0x1 -_080B909A: - adds r6, 0x1C - adds r5, 0x1 - cmp r5, 0x3 - ble _080B9052 - cmp r7, 0 - bne _080B90B0 - ldr r0, _080B90BC @ =gSharedMem + 0x192D0 - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl SetContestantStatusUnk14 -_080B90B0: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080B90BC: .4byte gSharedMem + 0x192D0 - thumb_func_end sub_80B9038 - - thumb_func_start sub_80B90C0 -sub_80B90C0: @ 80B90C0 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, _080B90EC @ =gSharedMem + 0x192D0 - adds r0, r2, 0 - adds r0, 0xD - adds r0, r3, r0 - movs r1, 0x1 - strb r1, [r0] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - subs r2, 0x70 - adds r2, r0, r2 - ldrb r1, [r2, 0x10] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080B90F0 - adds r0, r3, 0 - movs r1, 0x2D - b _080B9116 - .align 2, 0 -_080B90EC: .4byte gSharedMem + 0x192D0 -_080B90F0: - ldrb r0, [r2, 0x12] - cmp r0, 0 - bne _080B910E - ldrb r1, [r2, 0xB] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B911A - ldrb r1, [r2, 0xC] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - bne _080B911A - movs r0, 0x1 - b _080B911C -_080B910E: - subs r0, 0x1 - strb r0, [r2, 0x12] - adds r0, r3, 0 - movs r1, 0x2C -_080B9116: - bl SetContestantStatusUnk13 -_080B911A: - movs r0, 0 -_080B911C: - pop {r1} - bx r1 - thumb_func_end sub_80B90C0 - thumb_func_start sub_80B9120 sub_80B9120: @ 80B9120 push {r4-r7,lr} 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) --- asm/contest_effect.s | 218 --------------------------------------------------- include/contest.h | 3 +- ld_script.txt | 1 - src/contest_effect.c | 100 +++++++++++++++++++---- 4 files changed, 86 insertions(+), 236 deletions(-) delete mode 100644 asm/contest_effect.s diff --git a/asm/contest_effect.s b/asm/contest_effect.s deleted file mode 100644 index 22d116663..000000000 --- a/asm/contest_effect.s +++ /dev/null @@ -1,218 +0,0 @@ - .include "constants/gba_constants.inc" - .include "include/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_80B9120 -sub_80B9120: @ 80B9120 - push {r4-r7,lr} - sub sp, 0xC - mov r0, sp - movs r1, 0 - movs r2, 0x8 - bl memset - movs r7, 0 - ldr r1, _080B918C @ =gSharedMem + 0x192D0 - ldrb r0, [r1, 0x8] - cmp r0, 0xFF - beq _080B91D8 - adds r5, r1, 0 -_080B913A: - adds r0, r5, 0 - adds r0, 0x8 - adds r0, r7, r0 - ldrb r4, [r0] - adds r6, r4, 0 - adds r0, r4, 0 - str r1, [sp, 0x8] - bl sub_80B90C0 - lsls r0, 24 - ldr r1, [sp, 0x8] - cmp r0, 0 - beq _080B91C8 - ldrh r0, [r1, 0x4] - strh r0, [r1, 0x6] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - subs r1, 0x70 - adds r2, r0, r1 - ldrb r1, [r2, 0x10] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080B9174 - movs r1, 0x6 - ldrsh r0, [r5, r1] - lsls r0, 1 - strh r0, [r5, 0x6] -_080B9174: - ldrb r0, [r2, 0x10] - movs r3, 0x1 - ands r3, r0 - cmp r3, 0 - beq _080B9190 - movs r0, 0xA - strh r0, [r5, 0x6] - adds r0, r4, 0 - movs r1, 0x2F - bl SetContestantStatusUnk13 - b _080B91C8 - .align 2, 0 -_080B918C: .4byte gSharedMem + 0x192D0 -_080B9190: - ldrb r1, [r2, 0xF] - ldrh r0, [r5, 0x6] - subs r0, r1 - adds r1, r0, 0 - strh r0, [r5, 0x6] - lsls r0, 16 - cmp r0, 0 - bgt _080B91AC - strh r3, [r5, 0x6] - adds r0, r4, 0 - movs r1, 0x2E - bl SetContestantStatusUnk13 - b _080B91C8 -_080B91AC: - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_80B9200 - ldrb r1, [r5, 0x6] - adds r0, r6, 0 - bl sub_80B141C - lsls r0, r6, 1 - mov r2, sp - adds r1, r2, r0 - ldrh r0, [r5, 0x6] - strh r0, [r1] -_080B91C8: - adds r7, 0x1 - ldr r1, _080B91E8 @ =gSharedMem + 0x192D0 - adds r0, r1, 0 - adds r0, 0x8 - adds r0, r7, r0 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080B913A -_080B91D8: - movs r7, 0 - mov r1, sp -_080B91DC: - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080B91EC - movs r0, 0x1 - b _080B91F6 - .align 2, 0 -_080B91E8: .4byte gSharedMem + 0x192D0 -_080B91EC: - adds r1, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - ble _080B91DC - movs r0, 0 -_080B91F6: - add sp, 0xC - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80B9120 - - thumb_func_start sub_80B9200 -sub_80B9200: @ 80B9200 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - ldr r0, _080B9220 @ =gSharedMem + 0x19260 - adds r2, r0 - ldrh r0, [r2, 0x2] - subs r0, r1 - strh r0, [r2, 0x2] - ldrb r0, [r2, 0xE] - adds r1, r0 - strb r1, [r2, 0xE] - bx lr - .align 2, 0 -_080B9220: .4byte gSharedMem + 0x19260 - thumb_func_end sub_80B9200 - - thumb_func_start sub_80B9224 -sub_80B9224: @ 80B9224 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - cmp r4, 0 - bge _080B9234 - negs r0, r4 -_080B9234: - movs r1, 0xA - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r4, 0 - bge _080B9252 - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - beq _080B925C - adds r0, r4, 0 - subs r0, 0xA - adds r0, r1, r0 - b _080B9258 -_080B9252: - lsls r0, 16 - asrs r0, 16 - subs r0, r4, r0 -_080B9258: - lsls r0, 16 - lsrs r5, r0, 16 -_080B925C: - lsls r0, r5, 16 - asrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B9224 - - thumb_func_start sub_80B9268 -sub_80B9268: @ 80B9268 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - cmp r4, 0 - bge _080B9278 - negs r0, r4 -_080B9278: - movs r1, 0xA - bl __modsi3 - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - beq _080B9290 - adds r0, r4, 0 - adds r0, 0xA - subs r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 -_080B9290: - lsls r0, r5, 16 - asrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B9268 - - .align 2, 0 @ Don't pad with nop. diff --git a/include/contest.h b/include/contest.h index 2bcf32bef..4fef98f6e 100644 --- a/include/contest.h +++ b/include/contest.h @@ -226,7 +226,7 @@ struct UnknownContestStruct7 { u8 unk0[4]; s16 unk4; - u16 unk6; + s16 unk6; u8 unk8[5]; u8 unkD[4]; u8 unk11; @@ -284,5 +284,6 @@ void SetContestantStatusUnk14(u8 a, u8 b); void sub_80B157C(u8 p); bool8 Contest_IsMonsTurnDisabled(u8 a); bool8 sub_80B214C(u8 a); +void sub_80B141C(u8 a, u8 b); #endif // GUARD_CONTEST_H diff --git a/ld_script.txt b/ld_script.txt index 2eae4d81c..3e3cb622f 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -161,7 +161,6 @@ SECTIONS { src/naming_screen.o(.text); src/money.o(.text); src/contest_effect.o(.text); - asm/contest_effect.o(.text); src/record_mixing.o(.text); src/debug/sound_check_menu.o(.text); src/secret_base.o(.text); 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 --- data/contest_effect.s | 21 - data/contest_effect_funcs.inc | 50 - data/contest_effects.inc | 289 ----- data/contest_moves.inc | 2486 ----------------------------------------- include/contest.h | 116 +- ld_script.txt | 1 - src/contest.c | 2 +- src/contest_effect.c | 140 ++- src/data/contest_moves.h | 532 +++++++++ 9 files changed, 739 insertions(+), 2898 deletions(-) delete mode 100644 data/contest_effect.s delete mode 100644 data/contest_effect_funcs.inc delete mode 100644 data/contest_effects.inc delete mode 100644 data/contest_moves.inc create mode 100644 src/data/contest_moves.h diff --git a/data/contest_effect.s b/data/contest_effect.s deleted file mode 100644 index cd960fb52..000000000 --- a/data/contest_effect.s +++ /dev/null @@ -1,21 +0,0 @@ - .include "include/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -@ 83CF594 - .include "data/contest_moves.inc" - -@ 83D00AC - .include "data/contest_effects.inc" - -@ A lookup table with TRUE for each combo starter ID and FALSE for ID 0, -@ which means "not a combo starter move". -gComboStarterLookupTable:: @ 83D016C - .byte FALSE - .rept 62 - .byte TRUE - .endr - -@ 83D01AC - .include "data/contest_effect_funcs.inc" diff --git a/data/contest_effect_funcs.inc b/data/contest_effect_funcs.inc deleted file mode 100644 index 8dbe9d595..000000000 --- a/data/contest_effect_funcs.inc +++ /dev/null @@ -1,50 +0,0 @@ - .align 2 -gContestEffectFuncs:: - .4byte ContestEffect_00 - .4byte ContestEffect_01 - .4byte ContestEffect_02 - .4byte ContestEffect_03 - .4byte ContestEffect_04 - .4byte ContestEffect_05 - .4byte ContestEffect_06 - .4byte ContestEffect_07 - .4byte ContestEffect_08 - .4byte ContestEffect_09 - .4byte ContestEffect_08 - .4byte ContestEffect_09 - .4byte ContestEffect_08 - .4byte ContestEffect_09 - .4byte ContestEffect_14 - .4byte ContestEffect_15 - .4byte ContestEffect_16 - .4byte ContestEffect_17 - .4byte ContestEffect_18 - .4byte ContestEffect_19 - .4byte ContestEffect_20 - .4byte ContestEffect_21 - .4byte ContestEffect_22 - .4byte ContestEffect_23 - .4byte ContestEffect_24 - .4byte ContestEffect_25 - .4byte ContestEffect_26 - .4byte ContestEffect_27 - .4byte ContestEffect_28 - .4byte ContestEffect_29 - .4byte ContestEffect_30 - .4byte ContestEffect_31 - .4byte ContestEffect_32 - .4byte ContestEffect_33 - .4byte ContestEffect_34 - .4byte ContestEffect_35 - .4byte ContestEffect_36 - .4byte ContestEffect_37 - .4byte ContestEffect_38 - .4byte ContestEffect_39 - .4byte ContestEffect_40 - .4byte ContestEffect_41 - .4byte ContestEffect_42 - .4byte ContestEffect_43 - .4byte ContestEffect_44 - .4byte ContestEffect_45 - .4byte ContestEffect_46 - .4byte ContestEffect_47 diff --git a/data/contest_effects.inc b/data/contest_effects.inc deleted file mode 100644 index 55d5c0e50..000000000 --- a/data/contest_effects.inc +++ /dev/null @@ -1,289 +0,0 @@ - .align 2 -gContestEffects:: -@ 0 - .byte 0 @ effect type - .byte 40 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 1 - .byte 0 @ effect type - .byte 60 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 2 - .byte 0 @ effect type - .byte 80 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 3 - .byte 0 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 4 - .byte 1 @ effect type - .byte 20 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 5 - .byte 1 @ effect type - .byte 10 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 6 - .byte 1 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 7 - .byte 1 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 8 - .byte 2 @ effect type - .byte 30 @ appeal - .byte 20 @ jam - .byte 0 @ padding - -@ 9 - .byte 3 @ effect type - .byte 30 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 10 - .byte 2 @ effect type - .byte 20 @ appeal - .byte 30 @ jam - .byte 0 @ padding - -@ 11 - .byte 3 @ effect type - .byte 20 @ appeal - .byte 20 @ jam - .byte 0 @ padding - -@ 12 - .byte 2 @ effect type - .byte 10 @ appeal - .byte 40 @ jam - .byte 0 @ padding - -@ 13 - .byte 3 @ effect type - .byte 10 @ appeal - .byte 30 @ jam - .byte 0 @ padding - -@ 14 - .byte 2 @ effect type - .byte 30 @ appeal - .byte 20 @ jam - .byte 0 @ padding - -@ 15 - .byte 3 @ effect type - .byte 30 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 16 - .byte 4 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 17 - .byte 3 @ effect type - .byte 20 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 18 - .byte 3 @ effect type - .byte 40 @ appeal - .byte 40 @ jam - .byte 0 @ padding - -@ 19 - .byte 3 @ effect type - .byte 20 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 20 - .byte 3 @ effect type - .byte 20 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 21 - .byte 3 @ effect type - .byte 20 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 22 - .byte 3 @ effect type - .byte 20 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 23 - .byte 3 @ effect type - .byte 20 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 24 - .byte 3 @ effect type - .byte 20 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 25 - .byte 4 @ effect type - .byte 20 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 26 - .byte 4 @ effect type - .byte 20 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 27 - .byte 4 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 28 - .byte 3 @ effect type - .byte 30 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 29 - .byte 5 @ effect type - .byte 20 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 30 - .byte 5 @ effect type - .byte 20 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 31 - .byte 5 @ effect type - .byte 10 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 32 - .byte 5 @ effect type - .byte 10 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 33 - .byte 5 @ effect type - .byte 10 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 34 - .byte 5 @ effect type - .byte 10 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 35 - .byte 5 @ effect type - .byte 20 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 36 - .byte 5 @ effect type - .byte 20 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 37 - .byte 5 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 38 - .byte 5 @ effect type - .byte 10 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 39 - .byte 5 @ effect type - .byte 10 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 40 - .byte 6 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 41 - .byte 6 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 42 - .byte 6 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 43 - .byte 6 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 44 - .byte 5 @ effect type - .byte 10 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 45 - .byte 3 @ effect type - .byte 20 @ appeal - .byte 10 @ jam - .byte 0 @ padding - -@ 46 - .byte 5 @ effect type - .byte 10 @ appeal - .byte 0 @ jam - .byte 0 @ padding - -@ 47 - .byte 4 @ effect type - .byte 30 @ appeal - .byte 0 @ jam - .byte 0 @ padding diff --git a/data/contest_moves.inc b/data/contest_moves.inc deleted file mode 100644 index 8765c0dbe..000000000 --- a/data/contest_moves.inc +++ /dev/null @@ -1,2486 +0,0 @@ - .align 2 -gContestMoves:: -@ NONE - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ POUND - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_TOUGH - .byte COMBO_STARTER_POUND @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ KARATE_CHOP - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DOUBLE_SLAP - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_POUND, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ COMET_PUNCH - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MEGA_PUNCH - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_MIND_READER, 0, 0 @ combo moves - .byte 0 @ padding - -@ PAY_DAY - .byte CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FIRE_PUNCH - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_FIRE_PUNCH @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, COMBO_STARTER_THUNDER_PUNCH, COMBO_STARTER_ICE_PUNCH, 0 @ combo moves - .byte 0 @ padding - -@ ICE_PUNCH - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_ICE_PUNCH @ combo starter ID - .byte COMBO_STARTER_THUNDER_PUNCH, COMBO_STARTER_FIRE_PUNCH, 0, 0 @ combo moves - .byte 0 @ padding - -@ THUNDER_PUNCH - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte COMBO_STARTER_THUNDER_PUNCH @ combo starter ID - .byte COMBO_STARTER_CHARGE, COMBO_STARTER_FIRE_PUNCH, COMBO_STARTER_ICE_PUNCH, 0 @ combo moves - .byte 0 @ padding - -@ SCRATCH - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_TOUGH - .byte COMBO_STARTER_SCRATCH @ combo starter ID - .byte COMBO_STARTER_LEER, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ VICE_GRIP - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_TOUGH - .byte COMBO_STARTER_VICE_GRIP @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ GUILLOTINE - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_VICE_GRIP, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ RAZOR_WIND - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SWORDS_DANCE - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_SWORDS_DANCE @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CUT - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SWORDS_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ GUST - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WING_ATTACK - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WHIRLWIND - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FLY - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BIND - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_VICE_GRIP, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SLAM - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_POUND, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ VINE_WHIP - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_GROWTH, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ STOMP - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, COMBO_STARTER_LEER, 0, 0 @ combo moves - .byte 0 @ padding - -@ DOUBLE_KICK - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MEGA_KICK - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_MIND_READER, 0, 0 @ combo moves - .byte 0 @ padding - -@ JUMP_KICK - .byte CONTEST_EFFECT_USER_MORE_EASILY_STARTLED - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_MIND_READER, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ROLLING_KICK - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SAND_ATTACK - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_CUTE - .byte COMBO_STARTER_SAND_ATTACK @ combo starter ID - .byte COMBO_STARTER_MUD_SLAP, COMBO_STARTER_SANDSTORM, 0, 0 @ combo moves - .byte 0 @ padding - -@ HEADBUTT - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HORN_ATTACK - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte COMBO_STARTER_HORN_ATTACK @ combo starter ID - .byte COMBO_STARTER_LEER, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FURY_ATTACK - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_HORN_ATTACK, COMBO_STARTER_PECK, 0, 0 @ combo moves - .byte 0 @ padding - -@ HORN_DRILL - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_HORN_ATTACK, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TACKLE - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_DEFENSE_CURL, COMBO_STARTER_LEER, COMBO_STARTER_HARDEN, 0 @ combo moves - .byte 0 @ padding - -@ BODY_SLAM - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WRAP - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TAKE_DOWN - .byte CONTEST_EFFECT_USER_MORE_EASILY_STARTLED - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_HARDEN, 0, 0 @ combo moves - .byte 0 @ padding - -@ THRASH - .byte CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAGE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DOUBLE_EDGE - .byte CONTEST_EFFECT_USER_MORE_EASILY_STARTLED - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_HARDEN, 0, 0 @ combo moves - .byte 0 @ padding - -@ TAIL_WHIP - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARM, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ POISON_STING - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TWINEEDLE - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ PIN_MISSILE - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ LEER - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_COOL - .byte COMBO_STARTER_LEER @ combo starter ID - .byte COMBO_STARTER_RAGE, COMBO_STARTER_SCARY_FACE, 0, 0 @ combo moves - .byte 0 @ padding - -@ BITE - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_LEER, COMBO_STARTER_SCARY_FACE, 0, 0 @ combo moves - .byte 0 @ padding - -@ GROWL - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARM, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ROAR - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SING - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_CUTE - .byte COMBO_STARTER_SING @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SUPERSONIC - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SONIC_BOOM - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DISABLE - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ACID - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ EMBER - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FLAMETHROWER - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MIST - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WATER_GUN - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_WATER_SPORT, COMBO_STARTER_MUD_SPORT, 0 @ combo moves - .byte 0 @ padding - -@ HYDRO_PUMP - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SURF - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_SURF @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_DIVE, 0, 0 @ combo moves - .byte 0 @ padding - -@ ICE_BEAM - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BLIZZARD - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_POWDER_SNOW, COMBO_STARTER_HAIL, 0, 0 @ combo moves - .byte 0 @ padding - -@ PSYBEAM - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CALM_MIND, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BUBBLE_BEAM - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ AURORA_BEAM - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HYPER_BEAM - .byte CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ PECK - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte COMBO_STARTER_PECK @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DRILL_PECK - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_PECK, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SUBMISSION - .byte CONTEST_EFFECT_USER_MORE_EASILY_STARTLED - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_MIND_READER, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ LOW_KICK - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ COUNTER - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_TAUNT, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SEISMIC_TOSS - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FAKE_OUT, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ STRENGTH - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ABSORB - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_GROWTH, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MEGA_DRAIN - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_GROWTH, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ LEECH_SEED - .byte CONTEST_EFFECT_STARTLE_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ GROWTH - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_GROWTH @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ RAZOR_LEAF - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_GROWTH, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SOLAR_BEAM - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, COMBO_STARTER_GROWTH, 0, 0 @ combo moves - .byte 0 @ padding - -@ POISON_POWDER - .byte CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SWEET_SCENT, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ STUN_SPORE - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SWEET_SCENT, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SLEEP_POWDER - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SWEET_SCENT, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ PETAL_DANCE - .byte CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_GROWTH, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ STRING_SHOT - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_SMART - .byte COMBO_STARTER_STRING_SHOT @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DRAGON_RAGE - .byte CONTEST_EFFECT_BETTER_WHEN_LATER - .byte CONTEST_COOL - .byte COMBO_STARTER_DRAGON_RAGE @ combo starter ID - .byte COMBO_STARTER_DRAGON_BREATH, COMBO_STARTER_DRAGON_DANCE, 0, 0 @ combo moves - .byte 0 @ padding - -@ FIRE_SPIN - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ THUNDER_SHOCK - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARGE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ THUNDERBOLT - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARGE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ THUNDER_WAVE - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARGE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ THUNDER - .byte CONTEST_EFFECT_STARTLE_PREV_MONS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARGE, COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_LOCK_ON, 0 @ combo moves - .byte 0 @ padding - -@ ROCK_THROW - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_TOUGH - .byte COMBO_STARTER_ROCK_THROW @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ EARTHQUAKE - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_TOUGH - .byte COMBO_STARTER_EARTHQUAKE @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FISSURE - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_EARTHQUAKE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DIG - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TOXIC - .byte CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CONFUSION - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_SMART - .byte COMBO_STARTER_CONFUSION @ combo starter ID - .byte COMBO_STARTER_PSYCHIC, COMBO_STARTER_KINESIS, COMBO_STARTER_CALM_MIND, 0 @ combo moves - .byte 0 @ padding - -@ PSYCHIC - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_SMART - .byte COMBO_STARTER_PSYCHIC @ combo starter ID - .byte COMBO_STARTER_KINESIS, COMBO_STARTER_CONFUSION, COMBO_STARTER_CALM_MIND, 0 @ combo moves - .byte 0 @ padding - -@ HYPNOSIS - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_SMART - .byte COMBO_STARTER_HYPNOSIS @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MEDITATE - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CALM_MIND, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ AGILITY - .byte CONTEST_EFFECT_NEXT_APPEAL_EARLIER - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_DOUBLE_TEAM, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ QUICK_ATTACK - .byte CONTEST_EFFECT_NEXT_APPEAL_EARLIER - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_DOUBLE_TEAM, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ RAGE - .byte CONTEST_EFFECT_REPETITION_NOT_BORING - .byte CONTEST_COOL - .byte COMBO_STARTER_RAGE @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TELEPORT - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_DOUBLE_TEAM, COMBO_STARTER_PSYCHIC, COMBO_STARTER_KINESIS, COMBO_STARTER_CONFUSION @ combo moves - .byte 0 @ padding - -@ NIGHT_SHADE - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MIMIC - .byte CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SCREECH - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DOUBLE_TEAM - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_COOL - .byte COMBO_STARTER_DOUBLE_TEAM @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ RECOVER - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HARDEN - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_TOUGH - .byte COMBO_STARTER_HARDEN @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MINIMIZE - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SMOKESCREEN - .byte CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SMOG, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CONFUSE_RAY - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WITHDRAW - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DEFENSE_CURL - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_CUTE - .byte COMBO_STARTER_DEFENSE_CURL @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BARRIER - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ LIGHT_SCREEN - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CALM_MIND, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HAZE - .byte CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ REFLECT - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CALM_MIND, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FOCUS_ENERGY - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_COOL - .byte COMBO_STARTER_FOCUS_ENERGY @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BIDE - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ METRONOME - .byte CONTEST_EFFECT_REPETITION_NOT_BORING - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MIRROR_MOVE - .byte CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SELF_DESTRUCT - .byte CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ EGG_BOMB - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SOFT_BOILED, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ LICK - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SMOG - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_TOUGH - .byte COMBO_STARTER_SMOG @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SLUDGE - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_TOUGH - .byte COMBO_STARTER_SLUDGE @ combo starter ID - .byte COMBO_STARTER_SLUDGE_BOMB, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BONE_CLUB - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_TOUGH - .byte COMBO_STARTER_BONE_CLUB @ combo starter ID - .byte COMBO_STARTER_BONEMERANG, COMBO_STARTER_BONE_RUSH, 0, 0 @ combo moves - .byte 0 @ padding - -@ FIRE_BLAST - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WATERFALL - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CLAMP - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SWIFT - .byte CONTEST_EFFECT_BETTER_IF_FIRST - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SKULL_BASH - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SPIKE_CANNON - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CONSTRICT - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ AMNESIA - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ KINESIS - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_SMART - .byte COMBO_STARTER_KINESIS @ combo starter ID - .byte COMBO_STARTER_PSYCHIC, COMBO_STARTER_CONFUSION, 0, 0 @ combo moves - .byte 0 @ padding - -@ SOFT_BOILED - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_SOFT_BOILED @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HI_JUMP_KICK - .byte CONTEST_EFFECT_USER_MORE_EASILY_STARTLED - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_MIND_READER, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ GLARE - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_LEER, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DREAM_EATER - .byte CONTEST_EFFECT_STARTLE_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_HYPNOSIS, COMBO_STARTER_CALM_MIND, 0, 0 @ combo moves - .byte 0 @ padding - -@ POISON_GAS - .byte CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BARRAGE - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ LEECH_LIFE - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ LOVELY_KISS - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SKY_ATTACK - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TRANSFORM - .byte CONTEST_EFFECT_REPETITION_NOT_BORING - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BUBBLE - .byte CONTEST_EFFECT_STARTLE_PREV_MONS - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DIZZY_PUNCH - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SPORE - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FLASH - .byte CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ PSYWAVE - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CALM_MIND, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SPLASH - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ACID_ARMOR - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CRABHAMMER - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_SWORDS_DANCE, 0, 0 @ combo moves - .byte 0 @ padding - -@ EXPLOSION - .byte CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FURY_SWIPES - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SCRATCH, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BONEMERANG - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_TOUGH - .byte COMBO_STARTER_BONEMERANG @ combo starter ID - .byte COMBO_STARTER_BONE_CLUB, COMBO_STARTER_BONE_RUSH, 0, 0 @ combo moves - .byte 0 @ padding - -@ REST - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_CUTE - .byte COMBO_STARTER_REST @ combo starter ID - .byte COMBO_STARTER_BELLY_DRUM, COMBO_STARTER_CHARM, COMBO_STARTER_YAWN, 0 @ combo moves - .byte 0 @ padding - -@ ROCK_SLIDE - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_ROCK_THROW, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HYPER_FANG - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SHARPEN - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CONVERSION - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TRI_ATTACK - .byte CONTEST_EFFECT_STARTLE_PREV_MONS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_LOCK_ON, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SUPER_FANG - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SCARY_FACE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SLASH - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SWORDS_DANCE, COMBO_STARTER_SCRATCH, 0, 0 @ combo moves - .byte 0 @ padding - -@ SUBSTITUTE - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ STRUGGLE - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SKETCH - .byte CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TRIPLE_KICK - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ THIEF - .byte CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SPIDER_WEB - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_STRING_SHOT, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MIND_READER - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_SMART - .byte COMBO_STARTER_MIND_READER @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ NIGHTMARE - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_HYPNOSIS, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FLAME_WHEEL - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SNORE - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_REST, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CURSE - .byte CONTEST_EFFECT_NEXT_APPEAL_LATER - .byte CONTEST_TOUGH - .byte COMBO_STARTER_CURSE @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FLAIL - .byte CONTEST_EFFECT_BETTER_WHEN_LATER - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_ENDURE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CONVERSION_2 - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ AEROBLAST - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ COTTON_SPORE - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ REVERSAL - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_ENDURE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SPITE - .byte CONTEST_EFFECT_BETTER_WHEN_LATER - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CURSE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ POWDER_SNOW - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_POWDER_SNOW @ combo starter ID - .byte COMBO_STARTER_HAIL, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ PROTECT - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_HARDEN, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MACH_PUNCH - .byte CONTEST_EFFECT_NEXT_APPEAL_EARLIER - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SCARY_FACE - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_TOUGH - .byte COMBO_STARTER_SCARY_FACE @ combo starter ID - .byte COMBO_STARTER_RAGE, COMBO_STARTER_LEER, 0, 0 @ combo moves - .byte 0 @ padding - -@ FAINT_ATTACK - .byte CONTEST_EFFECT_BETTER_IF_FIRST - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FAKE_OUT, COMBO_STARTER_LEER, COMBO_STARTER_POUND, 0 @ combo moves - .byte 0 @ padding - -@ SWEET_KISS - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARM, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BELLY_DRUM - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_CUTE - .byte COMBO_STARTER_BELLY_DRUM @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SLUDGE_BOMB - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_TOUGH - .byte COMBO_STARTER_SLUDGE_BOMB @ combo starter ID - .byte COMBO_STARTER_SLUDGE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MUD_SLAP - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_CUTE - .byte COMBO_STARTER_MUD_SLAP @ combo starter ID - .byte COMBO_STARTER_SAND_ATTACK, COMBO_STARTER_MUD_SPORT, COMBO_STARTER_SANDSTORM, 0 @ combo moves - .byte 0 @ padding - -@ OCTAZOOKA - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_LOCK_ON, 0, 0 @ combo moves - .byte 0 @ padding - -@ SPIKES - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ZAP_CANNON - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_LOCK_ON, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FORESIGHT - .byte CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DESTINY_BOND - .byte CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_MEAN_LOOK, COMBO_STARTER_CURSE, COMBO_STARTER_ENDURE, 0 @ combo moves - .byte 0 @ padding - -@ PERISH_SONG - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_MEAN_LOOK, COMBO_STARTER_SING, 0, 0 @ combo moves - .byte 0 @ padding - -@ ICY_WIND - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DETECT - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_TAUNT, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BONE_RUSH - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_TOUGH - .byte COMBO_STARTER_BONE_RUSH @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_BONE_CLUB, COMBO_STARTER_BONEMERANG, 0 @ combo moves - .byte 0 @ padding - -@ LOCK_ON - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_SMART - .byte COMBO_STARTER_LOCK_ON @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ OUTRAGE - .byte CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SANDSTORM - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_TOUGH - .byte COMBO_STARTER_SANDSTORM @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ GIGA_DRAIN - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_GROWTH, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ENDURE - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_TOUGH - .byte COMBO_STARTER_ENDURE @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CHARM - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_CUTE - .byte COMBO_STARTER_CHARM @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ROLLOUT - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_DEFENSE_CURL, COMBO_STARTER_HARDEN, 0, 0 @ combo moves - .byte 0 @ padding - -@ FALSE_SWIPE - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SWORDS_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SWAGGER - .byte CONTEST_EFFECT_BETTER_IF_FIRST - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MILK_DRINK - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SPARK - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARGE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FURY_CUTTER - .byte CONTEST_EFFECT_REPETITION_NOT_BORING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SWORDS_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ STEEL_WING - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MEAN_LOOK - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_MEAN_LOOK @ combo starter ID - .byte COMBO_STARTER_CURSE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ATTRACT - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SLEEP_TALK - .byte CONTEST_EFFECT_REPETITION_NOT_BORING - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_REST, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HEAL_BELL - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ RETURN - .byte CONTEST_EFFECT_EXCITE_AUDIENCE_IN_ANY_CONTEST - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ PRESENT - .byte CONTEST_EFFECT_REPETITION_NOT_BORING - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FRUSTRATION - .byte CONTEST_EFFECT_EXCITE_AUDIENCE_IN_ANY_CONTEST - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SAFEGUARD - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ PAIN_SPLIT - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_ENDURE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SACRED_FIRE - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MAGNITUDE - .byte CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DYNAMIC_PUNCH - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_MIND_READER, 0, 0 @ combo moves - .byte 0 @ padding - -@ MEGAHORN - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DRAGON_BREATH - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_COOL - .byte COMBO_STARTER_DRAGON_BREATH @ combo starter ID - .byte COMBO_STARTER_DRAGON_RAGE, COMBO_STARTER_DRAGON_DANCE, 0, 0 @ combo moves - .byte 0 @ padding - -@ BATON_PASS - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ENCORE - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ PURSUIT - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ RAPID_SPIN - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SWEET_SCENT - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_CUTE - .byte COMBO_STARTER_SWEET_SCENT @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ IRON_TAIL - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ METAL_CLAW - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_METAL_SOUND, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ VITAL_THROW - .byte CONTEST_EFFECT_NEXT_APPEAL_LATER - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FAKE_OUT, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MORNING_SUN - .byte CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SYNTHESIS - .byte CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MOONLIGHT - .byte CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HIDDEN_POWER - .byte CONTEST_EFFECT_REPETITION_NOT_BORING - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CROSS_CHOP - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TWISTER - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ RAIN_DANCE - .byte CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED - .byte CONTEST_TOUGH - .byte COMBO_STARTER_RAIN_DANCE @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SUNNY_DAY - .byte CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_SUNNY_DAY @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CRUNCH - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SCARY_FACE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MIRROR_COAT - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_TAUNT, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ PSYCH_UP - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ EXTREME_SPEED - .byte CONTEST_EFFECT_NEXT_APPEAL_EARLIER - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ANCIENT_POWER - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SHADOW_BALL - .byte CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FUTURE_SIGHT - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_PSYCHIC, COMBO_STARTER_KINESIS, COMBO_STARTER_CONFUSION, COMBO_STARTER_CALM_MIND @ combo moves - .byte 0 @ padding - -@ ROCK_SMASH - .byte CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WHIRLPOOL - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BEAT_UP - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FAKE_OUT - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_CUTE - .byte COMBO_STARTER_FAKE_OUT @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ UPROAR - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ STOCKPILE - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_TOUGH - .byte COMBO_STARTER_STOCKPILE @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SPIT_UP - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_STOCKPILE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SWALLOW - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_STOCKPILE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HEAT_WAVE - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HAIL - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_HAIL @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TORMENT - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FLATTER - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARM, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WILL_O_WISP - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MEMENTO - .byte CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FACADE - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FOCUS_PUNCH - .byte CONTEST_EFFECT_NEXT_APPEAL_LATER - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SMELLING_SALT - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FOLLOW_ME - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ NATURE_POWER - .byte CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CHARGE - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_SMART - .byte COMBO_STARTER_CHARGE @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TAUNT - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_SMART - .byte COMBO_STARTER_TAUNT @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HELPING_HAND - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TRICK - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ROLE_PLAY - .byte CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WISH - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ASSIST - .byte CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ INGRAIN - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SUPERPOWER - .byte CONTEST_EFFECT_USER_MORE_EASILY_STARTLED - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_LOCK_ON, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MAGIC_COAT - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ RECYCLE - .byte CONTEST_EFFECT_REPETITION_NOT_BORING - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ REVENGE - .byte CONTEST_EFFECT_NEXT_APPEAL_LATER - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BRICK_BREAK - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ YAWN - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_CUTE - .byte COMBO_STARTER_YAWN @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ KNOCK_OFF - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FAKE_OUT, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ENDEAVOR - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_ENDURE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ERUPTION - .byte CONTEST_EFFECT_BETTER_WHEN_LATER - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_ENDURE, COMBO_STARTER_EARTHQUAKE, COMBO_STARTER_SUNNY_DAY, 0 @ combo moves - .byte 0 @ padding - -@ SKILL_SWAP - .byte CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ IMPRISON - .byte CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ REFRESH - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_WATER_SPORT, COMBO_STARTER_SING, 0, 0 @ combo moves - .byte 0 @ padding - -@ GRUDGE - .byte CONTEST_EFFECT_BETTER_WHEN_LATER - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CURSE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SNATCH - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SECRET_POWER - .byte CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DIVE - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_BEAUTY - .byte COMBO_STARTER_DIVE @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_SURF, 0, 0 @ combo moves - .byte 0 @ padding - -@ ARM_THRUST - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_FAKE_OUT, 0, 0 @ combo moves - .byte 0 @ padding - -@ CAMOUFLAGE - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TAIL_GLOW - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ LUSTER_PURGE - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CALM_MIND, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MIST_BALL - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CALM_MIND, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FEATHER_DANCE - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TEETER_DANCE - .byte CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BLAZE_KICK - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MUD_SPORT - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_CUTE - .byte COMBO_STARTER_MUD_SPORT @ combo starter ID - .byte COMBO_STARTER_MUD_SLAP, COMBO_STARTER_WATER_SPORT, 0, 0 @ combo moves - .byte 0 @ padding - -@ ICE_BALL - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ NEEDLE_ARM - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SLACK_OFF - .byte CONTEST_EFFECT_BETTER_WHEN_LATER - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte COMBO_STARTER_YAWN, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HYPER_VOICE - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ POISON_FANG - .byte CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ CRUSH_CLAW - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SWORDS_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BLAST_BURN - .byte CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HYDRO_CANNON - .byte CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ METEOR_MASH - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ASTONISH - .byte CONTEST_EFFECT_STARTLE_PREV_MON - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WEATHER_BALL - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_SUNNY_DAY, COMBO_STARTER_HAIL, COMBO_STARTER_SANDSTORM @ combo moves - .byte 0 @ padding - -@ AROMATHERAPY - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ FAKE_TEARS - .byte CONTEST_EFFECT_BETTER_IF_LAST - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ AIR_CUTTER - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ OVERHEAT - .byte CONTEST_EFFECT_USER_MORE_EASILY_STARTLED - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SUNNY_DAY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ODOR_SLEUTH - .byte CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ROCK_TOMB - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_ROCK_THROW, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SILVER_WIND - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ METAL_SOUND - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_SMART - .byte COMBO_STARTER_METAL_SOUND @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ GRASS_WHISTLE - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ TICKLE - .byte CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ COSMIC_POWER - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WATER_SPOUT - .byte CONTEST_EFFECT_BETTER_WHEN_LATER - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SIGNAL_BEAM - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SHADOW_PUNCH - .byte CONTEST_EFFECT_BETTER_IF_FIRST - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ EXTRASENSORY - .byte CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SKY_UPPERCUT - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SAND_TOMB - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_SANDSTORM, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SHEER_COLD - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MUDDY_WATER - .byte CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BULLET_SEED - .byte CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_GROWTH, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ AERIAL_ACE - .byte CONTEST_EFFECT_BETTER_IF_FIRST - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ ICICLE_SPEAR - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ IRON_DEFENSE - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BLOCK - .byte CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ HOWL - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DRAGON_CLAW - .byte CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_DRAGON_BREATH, COMBO_STARTER_DRAGON_RAGE, COMBO_STARTER_DRAGON_DANCE, 0 @ combo moves - .byte 0 @ padding - -@ FRENZY_PLANT - .byte CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_GROWTH, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BULK_UP - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ BOUNCE - .byte CONTEST_EFFECT_AVOID_STARTLE - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MUD_SHOT - .byte CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ POISON_TAIL - .byte CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ COVET - .byte CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES - .byte CONTEST_CUTE - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ VOLT_TACKLE - .byte CONTEST_EFFECT_USER_MORE_EASILY_STARTLED - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARGE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ MAGICAL_LEAF - .byte CONTEST_EFFECT_BETTER_IF_FIRST - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_GROWTH, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WATER_SPORT - .byte CONTEST_EFFECT_HIGHLY_APPEALING - .byte CONTEST_CUTE - .byte COMBO_STARTER_WATER_SPORT @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_MUD_SPORT, 0, 0 @ combo moves - .byte 0 @ padding - -@ CALM_MIND - .byte CONTEST_EFFECT_AVOID_STARTLE_ONCE - .byte CONTEST_SMART - .byte COMBO_STARTER_CALM_MIND @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ LEAF_BLADE - .byte CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DRAGON_DANCE - .byte CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS - .byte CONTEST_COOL - .byte COMBO_STARTER_DRAGON_DANCE @ combo starter ID - .byte COMBO_STARTER_DRAGON_RAGE, COMBO_STARTER_DRAGON_BREATH, 0, 0 @ combo moves - .byte 0 @ padding - -@ ROCK_BLAST - .byte CONTEST_EFFECT_BETTER_IF_SAME_TYPE - .byte CONTEST_TOUGH - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ SHOCK_WAVE - .byte CONTEST_EFFECT_BETTER_IF_FIRST - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CHARGE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ WATER_PULSE - .byte CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER - .byte CONTEST_BEAUTY - .byte 0 @ combo starter ID - .byte COMBO_STARTER_RAIN_DANCE, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ DOOM_DESIRE - .byte CONTEST_EFFECT_DONT_EXCITE_AUDIENCE - .byte CONTEST_COOL - .byte 0 @ combo starter ID - .byte 0, 0, 0, 0 @ combo moves - .byte 0 @ padding - -@ PSYCHO_BOOST - .byte CONTEST_EFFECT_USER_MORE_EASILY_STARTLED - .byte CONTEST_SMART - .byte 0 @ combo starter ID - .byte COMBO_STARTER_CALM_MIND, 0, 0, 0 @ combo moves - .byte 0 @ padding diff --git a/include/contest.h b/include/contest.h index 4fef98f6e..24ad95504 100644 --- a/include/contest.h +++ b/include/contest.h @@ -13,13 +13,119 @@ enum enum { CONTEST_EFFECT_HIGHLY_APPEALING, - CONTEST_EFFECT_USER_MORE_STARTLED, - CONTEST_EFFECT_APPEAL_ONLY_ONCE, - CONTEST_EFFECT_REPEATABLE, + CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, + CONTEST_EFFECT_REPETITION_NOT_BORING, CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_EFFECT_AVOID_STARTLE, - CONTEST_EFFECT_AVOID_STARTLE_LITTLE, - //... + CONTEST_EFFECT_AVOID_STARTLE_SLIGHTLY, + CONTEST_EFFECT_USER_LESS_EASILY_STARTLED, + CONTEST_EFFECT_STARTLE_FRONT_MON, + CONTEST_EFFECT_SLIGHTLY_STARTLE_PREV_MONS, + CONTEST_EFFECT_STARTLE_PREV_MON, + CONTEST_EFFECT_STARTLE_PREV_MONS, + CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, + CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + CONTEST_EFFECT_STARTLE_PREV_MON_2, + CONTEST_EFFECT_STARTLE_PREV_MONS_2, + CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION, + CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, + CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, + CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, + CONTEST_EFFECT_STARTLE_MONS_COOL_APPEAL, + CONTEST_EFFECT_STARTLE_MONS_BEAUTY_APPEAL, + CONTEST_EFFECT_STARTLE_MONS_CUTE_APPEAL, + CONTEST_EFFECT_STARTLE_MONS_SMART_APPEAL, + CONTEST_EFFECT_STARTLE_MONS_TOUGH_APPEAL, + CONTEST_EFFECT_MAKE_FOLLOWING_MON_NERVOUS, + CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, + CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, + CONTEST_EFFECT_BADLY_STARTLES_MONS_IN_GOOD_CONDITION, + CONTEST_EFFECT_BETTER_IF_FIRST, + CONTEST_EFFECT_BETTER_IF_LAST, + CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES, + CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE, + CONTEST_EFFECT_BETTER_WHEN_LATER, + CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING, + CONTEST_EFFECT_BETTER_IF_SAME_TYPE, + CONTEST_EFFECT_BETTER_IF_DIFF_TYPE, + CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, + CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION, + CONTEST_EFFECT_NEXT_APPEAL_EARLIER, + CONTEST_EFFECT_NEXT_APPEAL_LATER, + CONTEST_EFFECT_MAKE_SCRAMBLING_TURN_ORDER_EASIER, + CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, + CONTEST_EFFECT_EXCITE_AUDIENCE_IN_ANY_CONTEST, + CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, + CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, + CONTEST_EFFECT_DONT_EXCITE_AUDIENCE +}; + +enum +{ + COMBO_STARTER_RAIN_DANCE = 1, + COMBO_STARTER_RAGE, + COMBO_STARTER_FOCUS_ENERGY, + COMBO_STARTER_HYPNOSIS, + COMBO_STARTER_ENDURE, + COMBO_STARTER_HORN_ATTACK, + COMBO_STARTER_SWORDS_DANCE, + COMBO_STARTER_STOCKPILE, + COMBO_STARTER_SUNNY_DAY, + COMBO_STARTER_REST, + COMBO_STARTER_VICE_GRIP, + COMBO_STARTER_DEFENSE_CURL, + COMBO_STARTER_CHARGE, + COMBO_STARTER_ROCK_THROW, + COMBO_STARTER_YAWN, + COMBO_STARTER_SCARY_FACE, + COMBO_STARTER_POWDER_SNOW, + COMBO_STARTER_LOCK_ON, + COMBO_STARTER_SOFT_BOILED, + COMBO_STARTER_MEAN_LOOK, + COMBO_STARTER_SCRATCH, + COMBO_STARTER_GROWTH, + COMBO_STARTER_HAIL, + COMBO_STARTER_SANDSTORM, + COMBO_STARTER_BELLY_DRUM, + COMBO_STARTER_MIND_READER, + COMBO_STARTER_DRAGON_BREATH, + COMBO_STARTER_DRAGON_RAGE, + COMBO_STARTER_DRAGON_DANCE, + COMBO_STARTER_SURF, + COMBO_STARTER_DIVE, + COMBO_STARTER_STRING_SHOT, + COMBO_STARTER_LEER, + COMBO_STARTER_TAUNT, + COMBO_STARTER_CHARM, + COMBO_STARTER_HARDEN, + COMBO_STARTER_SING, + COMBO_STARTER_EARTHQUAKE, + COMBO_STARTER_DOUBLE_TEAM, + COMBO_STARTER_CURSE, + COMBO_STARTER_SWEET_SCENT, + COMBO_STARTER_SLUDGE, + COMBO_STARTER_SLUDGE_BOMB, + COMBO_STARTER_THUNDER_PUNCH, + COMBO_STARTER_FIRE_PUNCH, + COMBO_STARTER_ICE_PUNCH, + COMBO_STARTER_PECK, + COMBO_STARTER_METAL_SOUND, + COMBO_STARTER_MUD_SPORT, + COMBO_STARTER_WATER_SPORT, + COMBO_STARTER_BONE_CLUB, + COMBO_STARTER_BONEMERANG, + COMBO_STARTER_BONE_RUSH, + COMBO_STARTER_SAND_ATTACK, + COMBO_STARTER_MUD_SLAP, + COMBO_STARTER_FAKE_OUT, + COMBO_STARTER_PSYCHIC, + COMBO_STARTER_KINESIS, + COMBO_STARTER_CONFUSION, + COMBO_STARTER_POUND, + COMBO_STARTER_SMOG, + COMBO_STARTER_CALM_MIND }; struct ContestMove diff --git a/ld_script.txt b/ld_script.txt index 3e3cb622f..9c47146af 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -595,7 +595,6 @@ SECTIONS { src/naming_screen.o(.rodata); src/money.o(.rodata); src/contest_effect.o(.rodata); - data/contest_effect.o(.rodata); src/record_mixing.o(.data); src/record_mixing.o(.rodata); src/debug/sound_check_menu.o(.rodata); diff --git a/src/contest.c b/src/contest.c index 686b01476..b94fd4999 100644 --- a/src/contest.c +++ b/src/contest.c @@ -715,7 +715,7 @@ void sub_80ABCDC(u8 taskId) } else if (move != 0 && sContestantStatus[gContestPlayerMonIndex].prevMove == move - && gContestMoves[move].effect != CONTEST_EFFECT_REPEATABLE) + && gContestMoves[move].effect != CONTEST_EFFECT_REPETITION_NOT_BORING) { // Gray the text because it is a repeated move r5 = StringCopy(sp8, gUnknownText_UnknownFormatting3); 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) diff --git a/src/data/contest_moves.h b/src/data/contest_moves.h new file mode 100644 index 000000000..585ff91f1 --- /dev/null +++ b/src/data/contest_moves.h @@ -0,0 +1,532 @@ +#ifndef POKERUBY_CONTEST_MOVES_H +#define POKERUBY_CONTEST_MOVES_H + +const struct ContestMove gContestMoves[] = { + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // NONE + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_POUND, {0, 0, 0, 0}}, // POUND + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0}}, // KARATE_CHOP + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_POUND, 0, 0, 0}}, // DOUBLE_SLAP + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // COMET_PUNCH + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_MIND_READER, 0, 0}}, // MEGA_PUNCH + {CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // PAY_DAY + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_FIRE_PUNCH, {COMBO_STARTER_SUNNY_DAY, COMBO_STARTER_THUNDER_PUNCH, COMBO_STARTER_ICE_PUNCH, 0}}, // FIRE_PUNCH + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_ICE_PUNCH, {COMBO_STARTER_THUNDER_PUNCH, COMBO_STARTER_FIRE_PUNCH, 0, 0}}, // ICE_PUNCH + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, COMBO_STARTER_THUNDER_PUNCH, {COMBO_STARTER_CHARGE, COMBO_STARTER_FIRE_PUNCH, COMBO_STARTER_ICE_PUNCH, 0}}, // THUNDER_PUNCH + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_SCRATCH, {COMBO_STARTER_LEER, 0, 0, 0}}, // SCRATCH + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_VICE_GRIP, {0, 0, 0, 0}}, // VICE_GRIP + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_VICE_GRIP, 0, 0, 0}}, // GUILLOTINE + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // RAZOR_WIND + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_SWORDS_DANCE, {0, 0, 0, 0}}, // SWORDS_DANCE + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_SWORDS_DANCE, 0, 0, 0}}, // CUT + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // GUST + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // WING_ATTACK + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // WHIRLWIND + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // FLY + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_VICE_GRIP, 0, 0, 0}}, // BIND + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_POUND, 0, 0, 0}}, // SLAM + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_GROWTH, 0, 0, 0}}, // VINE_WHIP + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_TOUGH, 0, {0, COMBO_STARTER_LEER, 0, 0}}, // STOMP + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // DOUBLE_KICK + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_MIND_READER, 0, 0}}, // MEGA_KICK + {CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_MIND_READER, 0, 0, 0}}, // JUMP_KICK + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // ROLLING_KICK + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_CUTE, COMBO_STARTER_SAND_ATTACK, {COMBO_STARTER_MUD_SLAP, COMBO_STARTER_SANDSTORM, 0, 0}}, // SAND_ATTACK + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0}}, // HEADBUTT + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, COMBO_STARTER_HORN_ATTACK, {COMBO_STARTER_LEER, 0, 0, 0}}, // HORN_ATTACK + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_HORN_ATTACK, COMBO_STARTER_PECK, 0, 0}}, // FURY_ATTACK + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_HORN_ATTACK, 0, 0, 0}}, // HORN_DRILL + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_DEFENSE_CURL, COMBO_STARTER_LEER, COMBO_STARTER_HARDEN, 0}}, // TACKLE + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // BODY_SLAM + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // WRAP + {CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_HARDEN, 0, 0}}, // TAKE_DOWN + {CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_RAGE, 0, 0, 0}}, // THRASH + {CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_HARDEN, 0, 0}}, // DOUBLE_EDGE + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_CHARM, 0, 0, 0}}, // TAIL_WHIP + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // POISON_STING + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // TWINEEDLE + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // PIN_MISSILE + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_COOL, COMBO_STARTER_LEER, {COMBO_STARTER_RAGE, COMBO_STARTER_SCARY_FACE, 0, 0}}, // LEER + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_LEER, COMBO_STARTER_SCARY_FACE, 0, 0}}, // BITE + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_CHARM, 0, 0, 0}}, // GROWL + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // ROAR + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_CUTE, COMBO_STARTER_SING, {0, 0, 0, 0}}, // SING + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SUPERSONIC + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // SONIC_BOOM + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // DISABLE + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // ACID + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // EMBER + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // FLAMETHROWER + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // MIST + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_WATER_SPORT, COMBO_STARTER_MUD_SPORT, 0}}, // WATER_GUN + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // HYDRO_PUMP + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_SURF, {COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_DIVE, 0, 0}}, // SURF + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // ICE_BEAM + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_POWDER_SNOW, COMBO_STARTER_HAIL, 0, 0}}, // BLIZZARD + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_CALM_MIND, 0, 0, 0}}, // PSYBEAM + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // BUBBLE_BEAM + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // AURORA_BEAM + {CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // HYPER_BEAM + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, COMBO_STARTER_PECK, {0, 0, 0, 0}}, // PECK + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_PECK, 0, 0, 0}}, // DRILL_PECK + {CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_MIND_READER, 0, 0, 0}}, // SUBMISSION + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // LOW_KICK + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_TAUNT, 0, 0, 0}}, // COUNTER + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_FAKE_OUT, 0, 0, 0}}, // SEISMIC_TOSS + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // STRENGTH + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_GROWTH, 0, 0, 0}}, // ABSORB + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_GROWTH, 0, 0, 0}}, // MEGA_DRAIN + {CONTEST_EFFECT_STARTLE_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // LEECH_SEED + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_GROWTH, {0, 0, 0, 0}}, // GROWTH + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_GROWTH, 0, 0, 0}}, // RAZOR_LEAF + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_SUNNY_DAY, COMBO_STARTER_GROWTH, 0, 0}}, // SOLAR_BEAM + {CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_SWEET_SCENT, 0, 0, 0}}, // POISON_POWDER + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_SWEET_SCENT, 0, 0, 0}}, // STUN_SPORE + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_SWEET_SCENT, 0, 0, 0}}, // SLEEP_POWDER + {CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_GROWTH, 0, 0, 0}}, // PETAL_DANCE + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_SMART, COMBO_STARTER_STRING_SHOT, {0, 0, 0, 0}}, // STRING_SHOT + {CONTEST_EFFECT_BETTER_WHEN_LATER, CONTEST_CATEGORY_COOL, COMBO_STARTER_DRAGON_RAGE, {COMBO_STARTER_DRAGON_BREATH, COMBO_STARTER_DRAGON_DANCE, 0, 0}}, // DRAGON_RAGE + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // FIRE_SPIN + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_CHARGE, 0, 0, 0}}, // THUNDER_SHOCK + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_CHARGE, 0, 0, 0}}, // THUNDERBOLT + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_CHARGE, 0, 0, 0}}, // THUNDER_WAVE + {CONTEST_EFFECT_STARTLE_PREV_MONS, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_CHARGE, COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_LOCK_ON, 0}}, // THUNDER + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_ROCK_THROW, {0, 0, 0, 0}}, // ROCK_THROW + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_EARTHQUAKE, {0, 0, 0, 0}}, // EARTHQUAKE + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_EARTHQUAKE, 0, 0, 0}}, // FISSURE + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // DIG + {CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // TOXIC + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_SMART, COMBO_STARTER_CONFUSION, {COMBO_STARTER_PSYCHIC, COMBO_STARTER_KINESIS, COMBO_STARTER_CALM_MIND, 0}}, // CONFUSION + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_SMART, COMBO_STARTER_PSYCHIC, {COMBO_STARTER_KINESIS, COMBO_STARTER_CONFUSION, COMBO_STARTER_CALM_MIND, 0}}, // PSYCHIC + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_SMART, COMBO_STARTER_HYPNOSIS, {0, 0, 0, 0}}, // HYPNOSIS + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_CALM_MIND, 0, 0, 0}}, // MEDITATE + {CONTEST_EFFECT_NEXT_APPEAL_EARLIER, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_DOUBLE_TEAM, 0, 0, 0}}, // AGILITY + {CONTEST_EFFECT_NEXT_APPEAL_EARLIER, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_DOUBLE_TEAM, 0, 0, 0}}, // QUICK_ATTACK + {CONTEST_EFFECT_REPETITION_NOT_BORING, CONTEST_CATEGORY_COOL, COMBO_STARTER_RAGE, {0, 0, 0, 0}}, // RAGE + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_DOUBLE_TEAM, COMBO_STARTER_PSYCHIC, COMBO_STARTER_KINESIS, COMBO_STARTER_CONFUSION}}, // TELEPORT + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // NIGHT_SHADE + {CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // MIMIC + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SCREECH + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_COOL, COMBO_STARTER_DOUBLE_TEAM, {0, 0, 0, 0}}, // DOUBLE_TEAM + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // RECOVER + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_HARDEN, {0, 0, 0, 0}}, // HARDEN + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // MINIMIZE + {CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_SMOG, 0, 0, 0}}, // SMOKESCREEN + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // CONFUSE_RAY + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // WITHDRAW + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_CUTE, COMBO_STARTER_DEFENSE_CURL, {0, 0, 0, 0}}, // DEFENSE_CURL + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // BARRIER + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_CALM_MIND, 0, 0, 0}}, // LIGHT_SCREEN + {CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // HAZE + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_CALM_MIND, 0, 0, 0}}, // REFLECT + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_COOL, COMBO_STARTER_FOCUS_ENERGY, {0, 0, 0, 0}}, // FOCUS_ENERGY + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // BIDE + {CONTEST_EFFECT_REPETITION_NOT_BORING, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // METRONOME + {CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // MIRROR_MOVE + {CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // SELF_DESTRUCT + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_SOFT_BOILED, 0, 0, 0}}, // EGG_BOMB + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // LICK + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_SMOG, {0, 0, 0, 0}}, // SMOG + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_SLUDGE, {COMBO_STARTER_SLUDGE_BOMB, 0, 0, 0}}, // SLUDGE + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_BONE_CLUB, {COMBO_STARTER_BONEMERANG, COMBO_STARTER_BONE_RUSH, 0, 0}}, // BONE_CLUB + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // FIRE_BLAST + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // WATERFALL + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // CLAMP + {CONTEST_EFFECT_BETTER_IF_FIRST, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // SWIFT + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // SKULL_BASH + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // SPIKE_CANNON + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // CONSTRICT + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // AMNESIA + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_SMART, COMBO_STARTER_KINESIS, {COMBO_STARTER_PSYCHIC, COMBO_STARTER_CONFUSION, 0, 0}}, // KINESIS + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_SOFT_BOILED, {0, 0, 0, 0}}, // SOFT_BOILED + {CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_MIND_READER, 0, 0, 0}}, // HI_JUMP_KICK + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_LEER, 0, 0, 0}}, // GLARE + {CONTEST_EFFECT_STARTLE_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_HYPNOSIS, COMBO_STARTER_CALM_MIND, 0, 0}}, // DREAM_EATER + {CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // POISON_GAS + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // BARRAGE + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // LEECH_LIFE + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // LOVELY_KISS + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // SKY_ATTACK + {CONTEST_EFFECT_REPETITION_NOT_BORING, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // TRANSFORM + {CONTEST_EFFECT_STARTLE_PREV_MONS, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // BUBBLE + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // DIZZY_PUNCH + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // SPORE + {CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // FLASH + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_CALM_MIND, 0, 0, 0}}, // PSYWAVE + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // SPLASH + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // ACID_ARMOR + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_SWORDS_DANCE, 0, 0}}, // CRABHAMMER + {CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // EXPLOSION + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_SCRATCH, 0, 0, 0}}, // FURY_SWIPES + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_BONEMERANG, {COMBO_STARTER_BONE_CLUB, COMBO_STARTER_BONE_RUSH, 0, 0}}, // BONEMERANG + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_CUTE, COMBO_STARTER_REST, {COMBO_STARTER_BELLY_DRUM, COMBO_STARTER_CHARM, COMBO_STARTER_YAWN, 0}}, // REST + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_ROCK_THROW, 0, 0, 0}}, // ROCK_SLIDE + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // HYPER_FANG + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // SHARPEN + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // CONVERSION + {CONTEST_EFFECT_STARTLE_PREV_MONS, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_LOCK_ON, 0, 0, 0}}, // TRI_ATTACK + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_SCARY_FACE, 0, 0, 0}}, // SUPER_FANG + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_SWORDS_DANCE, COMBO_STARTER_SCRATCH, 0, 0}}, // SLASH + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SUBSTITUTE + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // STRUGGLE + {CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SKETCH + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0}}, // TRIPLE_KICK + {CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // THIEF + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_STRING_SHOT, 0, 0, 0}}, // SPIDER_WEB + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_SMART, COMBO_STARTER_MIND_READER, {0, 0, 0, 0}}, // MIND_READER + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_HYPNOSIS, 0, 0, 0}}, // NIGHTMARE + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // FLAME_WHEEL + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_REST, 0, 0, 0}}, // SNORE + {CONTEST_EFFECT_NEXT_APPEAL_LATER, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_CURSE, {0, 0, 0, 0}}, // CURSE + {CONTEST_EFFECT_BETTER_WHEN_LATER, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_ENDURE, 0, 0, 0}}, // FLAIL + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // CONVERSION_2 + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // AEROBLAST + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // COTTON_SPORE + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_ENDURE, 0, 0, 0}}, // REVERSAL + {CONTEST_EFFECT_BETTER_WHEN_LATER, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_CURSE, 0, 0, 0}}, // SPITE + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_POWDER_SNOW, {COMBO_STARTER_HAIL, 0, 0, 0}}, // POWDER_SNOW + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_HARDEN, 0, 0, 0}}, // PROTECT + {CONTEST_EFFECT_NEXT_APPEAL_EARLIER, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // MACH_PUNCH + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_SCARY_FACE, {COMBO_STARTER_RAGE, COMBO_STARTER_LEER, 0, 0}}, // SCARY_FACE + {CONTEST_EFFECT_BETTER_IF_FIRST, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_FAKE_OUT, COMBO_STARTER_LEER, COMBO_STARTER_POUND, 0}}, // FAINT_ATTACK + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_CHARM, 0, 0, 0}}, // SWEET_KISS + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_CUTE, COMBO_STARTER_BELLY_DRUM, {0, 0, 0, 0}}, // BELLY_DRUM + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_SLUDGE_BOMB, {COMBO_STARTER_SLUDGE, 0, 0, 0}}, // SLUDGE_BOMB + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_CUTE, COMBO_STARTER_MUD_SLAP, {COMBO_STARTER_SAND_ATTACK, COMBO_STARTER_MUD_SPORT, COMBO_STARTER_SANDSTORM, 0}}, // MUD_SLAP + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_LOCK_ON, 0, 0}}, // OCTAZOOKA + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SPIKES + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_LOCK_ON, 0, 0, 0}}, // ZAP_CANNON + {CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // FORESIGHT + {CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_MEAN_LOOK, COMBO_STARTER_CURSE, COMBO_STARTER_ENDURE, 0}}, // DESTINY_BOND + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_MEAN_LOOK, COMBO_STARTER_SING, 0, 0}}, // PERISH_SONG + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // ICY_WIND + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_TAUNT, 0, 0, 0}}, // DETECT + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_BONE_RUSH, {COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_BONE_CLUB, COMBO_STARTER_BONEMERANG, 0}}, // BONE_RUSH + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_SMART, COMBO_STARTER_LOCK_ON, {0, 0, 0, 0}}, // LOCK_ON + {CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // OUTRAGE + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_SANDSTORM, {0, 0, 0, 0}}, // SANDSTORM + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_GROWTH, 0, 0, 0}}, // GIGA_DRAIN + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_ENDURE, {0, 0, 0, 0}}, // ENDURE + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_CUTE, COMBO_STARTER_CHARM, {0, 0, 0, 0}}, // CHARM + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_DEFENSE_CURL, COMBO_STARTER_HARDEN, 0, 0}}, // ROLLOUT + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_SWORDS_DANCE, 0, 0, 0}}, // FALSE_SWIPE + {CONTEST_EFFECT_BETTER_IF_FIRST, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // SWAGGER + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // MILK_DRINK + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_CHARGE, 0, 0, 0}}, // SPARK + {CONTEST_EFFECT_REPETITION_NOT_BORING, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_SWORDS_DANCE, 0, 0, 0}}, // FURY_CUTTER + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // STEEL_WING + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_MEAN_LOOK, {COMBO_STARTER_CURSE, 0, 0, 0}}, // MEAN_LOOK + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // ATTRACT + {CONTEST_EFFECT_REPETITION_NOT_BORING, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_REST, 0, 0, 0}}, // SLEEP_TALK + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // HEAL_BELL + {CONTEST_EFFECT_EXCITE_AUDIENCE_IN_ANY_CONTEST, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // RETURN + {CONTEST_EFFECT_REPETITION_NOT_BORING, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // PRESENT + {CONTEST_EFFECT_EXCITE_AUDIENCE_IN_ANY_CONTEST, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // FRUSTRATION + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // SAFEGUARD + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_ENDURE, 0, 0, 0}}, // PAIN_SPLIT + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // SACRED_FIRE + {CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // MAGNITUDE + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_MIND_READER, 0, 0}}, // DYNAMIC_PUNCH + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // MEGAHORN + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_COOL, COMBO_STARTER_DRAGON_BREATH, {COMBO_STARTER_DRAGON_RAGE, COMBO_STARTER_DRAGON_DANCE, 0, 0}}, // DRAGON_BREATH + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // BATON_PASS + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // ENCORE + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // PURSUIT + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // RAPID_SPIN + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_CUTE, COMBO_STARTER_SWEET_SCENT, {0, 0, 0, 0}}, // SWEET_SCENT + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // IRON_TAIL + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_METAL_SOUND, 0, 0, 0}}, // METAL_CLAW + {CONTEST_EFFECT_NEXT_APPEAL_LATER, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_FAKE_OUT, 0, 0, 0}}, // VITAL_THROW + {CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // MORNING_SUN + {CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // SYNTHESIS + {CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // MOONLIGHT + {CONTEST_EFFECT_REPETITION_NOT_BORING, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // HIDDEN_POWER + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0}}, // CROSS_CHOP + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // TWISTER + {CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_RAIN_DANCE, {0, 0, 0, 0}}, // RAIN_DANCE + {CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_SUNNY_DAY, {0, 0, 0, 0}}, // SUNNY_DAY + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_SCARY_FACE, 0, 0, 0}}, // CRUNCH + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_TAUNT, 0, 0, 0}}, // MIRROR_COAT + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // PSYCH_UP + {CONTEST_EFFECT_NEXT_APPEAL_EARLIER, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // EXTREME_SPEED + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // ANCIENT_POWER + {CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SHADOW_BALL + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_PSYCHIC, COMBO_STARTER_KINESIS, COMBO_STARTER_CONFUSION, COMBO_STARTER_CALM_MIND}}, // FUTURE_SIGHT + {CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // ROCK_SMASH + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // WHIRLPOOL + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // BEAT_UP + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_CUTE, COMBO_STARTER_FAKE_OUT, {0, 0, 0, 0}}, // FAKE_OUT + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // UPROAR + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_TOUGH, COMBO_STARTER_STOCKPILE, {0, 0, 0, 0}}, // STOCKPILE + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_STOCKPILE, 0, 0, 0}}, // SPIT_UP + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_STOCKPILE, 0, 0, 0}}, // SWALLOW + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // HEAT_WAVE + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_HAIL, {0, 0, 0, 0}}, // HAIL + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // TORMENT + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_CHARM, 0, 0, 0}}, // FLATTER + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // WILL_O_WISP + {CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // MEMENTO + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // FACADE + {CONTEST_EFFECT_NEXT_APPEAL_LATER, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0}}, // FOCUS_PUNCH + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SMELLING_SALT + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // FOLLOW_ME + {CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // NATURE_POWER + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_SMART, COMBO_STARTER_CHARGE, {0, 0, 0, 0}}, // CHARGE + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_SMART, COMBO_STARTER_TAUNT, {0, 0, 0, 0}}, // TAUNT + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // HELPING_HAND + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // TRICK + {CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // ROLE_PLAY + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // WISH + {CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // ASSIST + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // INGRAIN + {CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_LOCK_ON, 0, 0, 0}}, // SUPERPOWER + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // MAGIC_COAT + {CONTEST_EFFECT_REPETITION_NOT_BORING, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // RECYCLE + {CONTEST_EFFECT_NEXT_APPEAL_LATER, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // REVENGE + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0}}, // BRICK_BREAK + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_CUTE, COMBO_STARTER_YAWN, {0, 0, 0, 0}}, // YAWN + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_FAKE_OUT, 0, 0, 0}}, // KNOCK_OFF + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_ENDURE, 0, 0, 0}}, // ENDEAVOR + {CONTEST_EFFECT_BETTER_WHEN_LATER, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_ENDURE, COMBO_STARTER_EARTHQUAKE, COMBO_STARTER_SUNNY_DAY, 0}}, // ERUPTION + {CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SKILL_SWAP + {CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // IMPRISON + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_WATER_SPORT, COMBO_STARTER_SING, 0, 0}}, // REFRESH + {CONTEST_EFFECT_BETTER_WHEN_LATER, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_CURSE, 0, 0, 0}}, // GRUDGE + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SNATCH + {CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SECRET_POWER + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_BEAUTY, COMBO_STARTER_DIVE, {COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_SURF, 0, 0}}, // DIVE + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_FOCUS_ENERGY, COMBO_STARTER_FAKE_OUT, 0, 0}}, // ARM_THRUST + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // CAMOUFLAGE + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // TAIL_GLOW + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_CALM_MIND, 0, 0, 0}}, // LUSTER_PURGE + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_CALM_MIND, 0, 0, 0}}, // MIST_BALL + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // FEATHER_DANCE + {CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // TEETER_DANCE + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // BLAZE_KICK + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_CUTE, COMBO_STARTER_MUD_SPORT, {COMBO_STARTER_MUD_SLAP, COMBO_STARTER_WATER_SPORT, 0, 0}}, // MUD_SPORT + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // ICE_BALL + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // NEEDLE_ARM + {CONTEST_EFFECT_BETTER_WHEN_LATER, CONTEST_CATEGORY_CUTE, 0, {COMBO_STARTER_YAWN, 0, 0, 0}}, // SLACK_OFF + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // HYPER_VOICE + {CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // POISON_FANG + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_SWORDS_DANCE, 0, 0, 0}}, // CRUSH_CLAW + {CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // BLAST_BURN + {CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // HYDRO_CANNON + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // METEOR_MASH + {CONTEST_EFFECT_STARTLE_PREV_MON, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // ASTONISH + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_SUNNY_DAY, COMBO_STARTER_HAIL, COMBO_STARTER_SANDSTORM}}, // WEATHER_BALL + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // AROMATHERAPY + {CONTEST_EFFECT_BETTER_IF_LAST, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // FAKE_TEARS + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // AIR_CUTTER + {CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_SUNNY_DAY, 0, 0, 0}}, // OVERHEAT + {CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // ODOR_SLEUTH + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_ROCK_THROW, 0, 0, 0}}, // ROCK_TOMB + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // SILVER_WIND + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_SMART, COMBO_STARTER_METAL_SOUND, {0, 0, 0, 0}}, // METAL_SOUND + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // GRASS_WHISTLE + {CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // TICKLE + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // COSMIC_POWER + {CONTEST_EFFECT_BETTER_WHEN_LATER, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // WATER_SPOUT + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // SIGNAL_BEAM + {CONTEST_EFFECT_BETTER_IF_FIRST, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // SHADOW_PUNCH + {CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // EXTRASENSORY + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_FOCUS_ENERGY, 0, 0, 0}}, // SKY_UPPERCUT + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_SANDSTORM, 0, 0, 0}}, // SAND_TOMB + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // SHEER_COLD + {CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, CONTEST_CATEGORY_TOUGH, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // MUDDY_WATER + {CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_GROWTH, 0, 0, 0}}, // BULLET_SEED + {CONTEST_EFFECT_BETTER_IF_FIRST, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // AERIAL_ACE + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // ICICLE_SPEAR + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // IRON_DEFENSE + {CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // BLOCK + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // HOWL + {CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_DRAGON_BREATH, COMBO_STARTER_DRAGON_RAGE, COMBO_STARTER_DRAGON_DANCE, 0}}, // DRAGON_CLAW + {CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_GROWTH, 0, 0, 0}}, // FRENZY_PLANT + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_BEAUTY, 0, {0, 0, 0, 0}}, // BULK_UP + {CONTEST_EFFECT_AVOID_STARTLE, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // BOUNCE + {CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // MUD_SHOT + {CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, CONTEST_CATEGORY_SMART, 0, {0, 0, 0, 0}}, // POISON_TAIL + {CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES, CONTEST_CATEGORY_CUTE, 0, {0, 0, 0, 0}}, // COVET + {CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_CHARGE, 0, 0, 0}}, // VOLT_TACKLE + {CONTEST_EFFECT_BETTER_IF_FIRST, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_GROWTH, 0, 0, 0}}, // MAGICAL_LEAF + {CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_CATEGORY_CUTE, COMBO_STARTER_WATER_SPORT, {COMBO_STARTER_RAIN_DANCE, COMBO_STARTER_MUD_SPORT, 0, 0}}, // WATER_SPORT + {CONTEST_EFFECT_AVOID_STARTLE_ONCE, CONTEST_CATEGORY_SMART, COMBO_STARTER_CALM_MIND, {0, 0, 0, 0}}, // CALM_MIND + {CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // LEAF_BLADE + {CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, CONTEST_CATEGORY_COOL, COMBO_STARTER_DRAGON_DANCE, {COMBO_STARTER_DRAGON_RAGE, COMBO_STARTER_DRAGON_BREATH, 0, 0}}, // DRAGON_DANCE + {CONTEST_EFFECT_BETTER_IF_SAME_TYPE, CONTEST_CATEGORY_TOUGH, 0, {0, 0, 0, 0}}, // ROCK_BLAST + {CONTEST_EFFECT_BETTER_IF_FIRST, CONTEST_CATEGORY_COOL, 0, {COMBO_STARTER_CHARGE, 0, 0, 0}}, // SHOCK_WAVE + {CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, CONTEST_CATEGORY_BEAUTY, 0, {COMBO_STARTER_RAIN_DANCE, 0, 0, 0}}, // WATER_PULSE + {CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, CONTEST_CATEGORY_COOL, 0, {0, 0, 0, 0}}, // DOOM_DESIRE + {CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, CONTEST_CATEGORY_SMART, 0, {COMBO_STARTER_CALM_MIND, 0, 0, 0}}, // PSYCHO_BOOST +}; + +const struct ContestEffect gContestEffects[] = { + {0, 40, 0}, // CONTEST_EFFECT_HIGHLY_APPEALING + {0, 60, 0}, // CONTEST_EFFECT_USER_MORE_EASILY_STARTLED + {0, 80, 0}, // CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES + {0, 30, 0}, // CONTEST_EFFECT_REPETITION_NOT_BORING + {1, 20, 0}, // CONTEST_EFFECT_AVOID_STARTLE_ONCE + {1, 10, 0}, // CONTEST_EFFECT_AVOID_STARTLE + {1, 30, 0}, // CONTEST_EFFECT_AVOID_STARTLE_SLIGHTLY + {1, 30, 0}, // CONTEST_EFFECT_USER_LESS_EASILY_STARTLED + {2, 30, 20}, // CONTEST_EFFECT_STARTLE_FRONT_MON + {3, 30, 10}, // CONTEST_EFFECT_SLIGHTLY_STARTLE_PREV_MONS + {2, 20, 30}, // CONTEST_EFFECT_STARTLE_PREV_MON + {3, 20, 20}, // CONTEST_EFFECT_STARTLE_PREV_MONS + {2, 10, 40}, // CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON + {3, 10, 30}, // CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS + {2, 30, 20}, // CONTEST_EFFECT_STARTLE_PREV_MON_2 + {3, 30, 10}, // CONTEST_EFFECT_STARTLE_PREV_MONS_2 + {4, 30, 0}, // CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION + {3, 20, 10}, // CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION + {3, 40, 40}, // CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN + {3, 20, 10}, // CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL + {3, 20, 10}, // CONTEST_EFFECT_STARTLE_MONS_COOL_APPEAL + {3, 20, 10}, // CONTEST_EFFECT_STARTLE_MONS_BEAUTY_APPEAL + {3, 20, 10}, // CONTEST_EFFECT_STARTLE_MONS_CUTE_APPEAL + {3, 20, 10}, // CONTEST_EFFECT_STARTLE_MONS_SMART_APPEAL + {3, 20, 10}, // CONTEST_EFFECT_STARTLE_MONS_TOUGH_APPEAL + {4, 20, 0}, // CONTEST_EFFECT_MAKE_FOLLOWING_MON_NERVOUS + {4, 20, 0}, // CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS + {4, 30, 0}, // CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS + {3, 30, 10}, // CONTEST_EFFECT_BADLY_STARTLES_MONS_IN_GOOD_CONDITION + {5, 20, 0}, // CONTEST_EFFECT_BETTER_IF_FIRST + {5, 20, 0}, // CONTEST_EFFECT_BETTER_IF_LAST + {5, 10, 0}, // CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES + {5, 10, 0}, // CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE + {5, 10, 0}, // CONTEST_EFFECT_BETTER_WHEN_LATER + {5, 10, 0}, // CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING + {5, 20, 0}, // CONTEST_EFFECT_BETTER_IF_SAME_TYPE + {5, 20, 0}, // CONTEST_EFFECT_BETTER_IF_DIFF_TYPE + {5, 30, 0}, // CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL + {5, 10, 0}, // CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS + {5, 10, 0}, // CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION + {6, 30, 0}, // CONTEST_EFFECT_NEXT_APPEAL_EARLIER + {6, 30, 0}, // CONTEST_EFFECT_NEXT_APPEAL_LATER + {6, 30, 0}, // CONTEST_EFFECT_MAKE_SCRAMBLING_TURN_ORDER_EASIER + {6, 30, 0}, // CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER + {5, 10, 0}, // CONTEST_EFFECT_EXCITE_AUDIENCE_IN_ANY_CONTEST + {3, 20, 10}, // CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS + {5, 10, 0}, // CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED + {4, 30, 0} // CONTEST_EFFECT_DONT_EXCITE_AUDIENCE +}; + +// A lookup table with TRUE for each combo starter ID and FALSE for ID 0, +// which means "not a combo starter move". +const bool8 gComboStarterLookupTable[] = { + FALSE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE, + TRUE +}; + +void (*const gContestEffectFuncs[])(void) = { + ContestEffect_00, + ContestEffect_01, + ContestEffect_02, + ContestEffect_03, + ContestEffect_04, + ContestEffect_05, + ContestEffect_06, + ContestEffect_07, + ContestEffect_08, + ContestEffect_09, + ContestEffect_08, + ContestEffect_09, + ContestEffect_08, + ContestEffect_09, + ContestEffect_14, + ContestEffect_15, + ContestEffect_16, + ContestEffect_17, + ContestEffect_18, + ContestEffect_19, + ContestEffect_20, + ContestEffect_21, + ContestEffect_22, + ContestEffect_23, + ContestEffect_24, + ContestEffect_25, + ContestEffect_26, + ContestEffect_27, + ContestEffect_28, + ContestEffect_29, + ContestEffect_30, + ContestEffect_31, + ContestEffect_32, + ContestEffect_33, + ContestEffect_34, + ContestEffect_35, + ContestEffect_36, + ContestEffect_37, + ContestEffect_38, + ContestEffect_39, + ContestEffect_40, + ContestEffect_41, + ContestEffect_42, + ContestEffect_43, + ContestEffect_44, + ContestEffect_45, + ContestEffect_46, + ContestEffect_47 +}; + +#endif //POKERUBY_CONTEST_MOVES_H -- 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 --- include/contest.h | 52 ++-- src/battle/battle_controller_player.c | 4 +- src/contest.c | 166 ++++++------- src/contest_ai.c | 8 +- src/contest_effect.c | 446 +++++++++++++++++----------------- 5 files changed, 332 insertions(+), 344 deletions(-) diff --git a/include/contest.h b/include/contest.h index 24ad95504..40a9ad099 100644 --- a/include/contest.h +++ b/include/contest.h @@ -262,31 +262,31 @@ struct ContestantStatus /*0x0B*/ u8 unkB_0:2; u8 unkB_2:2; u8 moveRepeatCount:3; - u8 unkB_7:1; // used a one-time move? - /*0x0C*/ u8 unkC_0:1; - u8 unkC_1:2; - /*0x0D*/ s8 unkD; + u8 noMoreTurns:1; // used a one-time move? + /*0x0C*/ u8 nervous:1; + u8 numTurnsSkipped:2; + /*0x0D*/ s8 condition; /*0x0E*/ u8 unkE; - /*0x0F*/ u8 unkF; - /*0x10*/ u8 unk10_0:1; - u8 unk10_1:1; - u8 unk10_2:1; - u8 unk10_3:1; + /*0x0F*/ u8 jamReduction; + /*0x10*/ u8 resistant:1; + u8 immune:1; + u8 moreEasilyStartled:1; + u8 usedRepeatableMove:1; u8 unk10_4:2; u8 unk10_6:2; /*0x11*/ u8 unk11_0:2; - u8 unk11_2:1; - u8 unk11_3:1; + u8 turnSkipped:1; + u8 exploded:1; u8 unk11_4:1; u8 unk11_5:1; - /*0x12*/ u8 unk12; - /*0x13*/ u8 unk13; // status action? - /*0x14*/ u8 unk14; + /*0x12*/ u8 jamSafetyCount; + /*0x13*/ u8 effectStringId; // status action? + /*0x14*/ u8 effectStringId2; /*0x15*/ u8 disappointedRepeat:1; u8 unk15_1:1; u8 unk15_2:1; u8 unk15_3:1; - u8 unk15_4:1; + u8 hasJudgesAttention:1; u8 unk15_5:1; u8 unk15_6:1; /*0x16*/ u8 unk16; @@ -321,22 +321,19 @@ struct UnknownContestStruct4 struct UnknownContestStruct5 { s8 bits_0; // current move excitement? - u8 bits_8:1; - u8 bits_9:3; - u8 bits_C:4; + u8 excitementFrozen:1; + u8 excitementFreezer:3; s8 unk2; - u8 filler3; }; struct UnknownContestStruct7 { - u8 unk0[4]; - s16 unk4; - s16 unk6; + u8 turnOrder[4]; + s16 jam; + s16 jam2; u8 unk8[5]; u8 unkD[4]; - u8 unk11; - u8 filler12[2]; + u8 contestant; }; struct UnknownContestStruct8 @@ -345,7 +342,6 @@ struct UnknownContestStruct8 u16 unk2; u8 unk4_0:1; u8 unk5; - u8 filler6[2]; u32 unk8; u32 unkC; u32 unk10; @@ -385,9 +381,9 @@ extern u8 gUnknown_02038696[4]; extern u8 gUnknown_0203869B; extern u16 gSpecialVar_ContestCategory; -void SetContestantStatusUnk13(u8 a, u8 b); -void SetContestantStatusUnk14(u8 a, u8 b); -void sub_80B157C(u8 p); +void SetContestantEffectStringID(u8 a, u8 b); +void SetContestantEffectStringID2(u8 a, u8 b); +void MakeContestantNervous(u8 p); bool8 Contest_IsMonsTurnDisabled(u8 a); bool8 sub_80B214C(u8 a); void sub_80B141C(u8 a, u8 b); diff --git a/src/battle/battle_controller_player.c b/src/battle/battle_controller_player.c index 3e259a21b..f9190eb39 100644 --- a/src/battle/battle_controller_player.c +++ b/src/battle/battle_controller_player.c @@ -614,7 +614,7 @@ struct ChooseMoveStruct u8 pp[4]; u8 unkC[0x12-0xC]; u8 unk12; - u8 unk13; + u8 effectStringId; u8 filler14[0x20-0x14]; }; @@ -637,7 +637,7 @@ void sub_802C68C(void) PlaySE(SE_SELECT); if (r6->moves[gMoveSelectionCursor[gActiveBank]] == MOVE_CURSE) - r4 = (r6->unk12 != TYPE_GHOST && (r6->unk13 ^ 7)) ? 0x10 : 0; + r4 = (r6->unk12 != TYPE_GHOST && (r6->effectStringId ^ 7)) ? 0x10 : 0; else r4 = gBattleMoves[r6->moves[gMoveSelectionCursor[gActiveBank]]].target; diff --git a/src/contest.c b/src/contest.c index b94fd4999..d2fa37977 100644 --- a/src/contest.c +++ b/src/contest.c @@ -389,8 +389,8 @@ void ClearContestVars(void) for (i = 0; i < 4; i++) { sContestantStatus[i].unkB_0 = 0; - sContestantStatus[i].unk13 = 0xFF; - sContestantStatus[i].unk14 = 0xFF; + sContestantStatus[i].effectStringId = 0xFF; + sContestantStatus[i].effectStringId2 = 0xFF; } memset(&shared192D0, 0, sizeof(shared192D0)); @@ -709,7 +709,7 @@ void sub_80ABCDC(u8 taskId) if (sContestantStatus[gContestPlayerMonIndex].prevMove != MOVE_NONE && sub_80B214C(gContestPlayerMonIndex) && AreMovesContestCombo(sContestantStatus[gContestPlayerMonIndex].prevMove, move) != 0 - && sContestantStatus[gContestPlayerMonIndex].unk15_4) + && sContestantStatus[gContestPlayerMonIndex].hasJudgesAttention) { r5 = StringCopy(sp8, gUnknownText_UnknownFormatting2); } @@ -1090,7 +1090,7 @@ void sub_80AC2CC(u8 taskId) { case 0: sub_80B0D7C(); - for (i = 0; sContest.unk19214 != shared192D0.unk0[i]; i++) + for (i = 0; sContest.unk19214 != shared192D0.turnOrder[i]; i++) ; sContest.unk19215 = i; r7 = sContest.unk19215; @@ -1117,8 +1117,8 @@ void sub_80AC2CC(u8 taskId) gTasks[taskId].data[0] = 2; return; case 2: - if (sContestantStatus[r7].unkC_1 != 0 - || sContestantStatus[r7].unkB_7) + if (sContestantStatus[r7].numTurnsSkipped != 0 + || sContestantStatus[r7].noMoreTurns) { gTasks[taskId].data[0] = 31; } @@ -1155,7 +1155,7 @@ void sub_80AC2CC(u8 taskId) } return; case 5: - if (sContestantStatus[r7].unkC_0) + if (sContestantStatus[r7].nervous) { gTasks[taskId].data[0] = 33; } @@ -1202,7 +1202,7 @@ void sub_80AC2CC(u8 taskId) } else { - if (!sContestantStatus[r7].unk15_4) + if (!sContestantStatus[r7].hasJudgesAttention) sub_80B03A8(r7); sub_80B20C4(); gTasks[taskId].data[0] = 23; @@ -1218,25 +1218,25 @@ void sub_80AC2CC(u8 taskId) return; case 23: gTasks[taskId].data[1] = 0; - if (sContestantStatus[r7].unk13 != 0xFF) + if (sContestantStatus[r7].effectStringId != 0xFF) { - sub_80B146C(r7, sContestantStatus[r7].unk13); - sContestantStatus[r7].unk13 = 0xFF; + sub_80B146C(r7, sContestantStatus[r7].effectStringId); + sContestantStatus[r7].effectStringId = 0xFF; gTasks[taskId].data[0] = 24; } else { - if (sContestantStatus[r7].unk14 != 0xFF) + if (sContestantStatus[r7].effectStringId2 != 0xFF) { for (i = 0; i < 4; i++) { - if (i != r7 && sContestantStatus[i].unk13 != 0xFF) + if (i != r7 && sContestantStatus[i].effectStringId != 0xFF) break; } if (i == 4) { - sub_80B146C(r7, sContestantStatus[r7].unk14); - sContestantStatus[r7].unk14 = 0xFF; + sub_80B146C(r7, sContestantStatus[r7].effectStringId2); + sContestantStatus[r7].effectStringId2 = 0xFF; gTasks[taskId].data[0] = 24; } else @@ -1337,7 +1337,7 @@ void sub_80AC2CC(u8 taskId) for (r2 = 0; r2 < 4; r2++) { if (r2 != r7 && gUnknown_02038696[r2] == i - && sContestantStatus[r2].unk13 != 0xFF) + && sContestantStatus[r2].effectStringId != 0xFF) { r4 = 1; break; @@ -1349,8 +1349,8 @@ void sub_80AC2CC(u8 taskId) if (r4) { gTasks[taskId].data[1] = gUnknown_02038696[r2]; - sub_80B146C(r2, sContestantStatus[r2].unk13); - sContestantStatus[r2].unk13 = 0xFF; + sub_80B146C(r2, sContestantStatus[r2].effectStringId); + sContestantStatus[r2].effectStringId = 0xFF; gTasks[taskId].data[0] = 27; } else @@ -1420,8 +1420,8 @@ void sub_80AC2CC(u8 taskId) if (gTasks[taskId].data[10]++ > 9) { gTasks[taskId].data[10] = 0; - if (sContestantStatus[r7].unkC_1 != 0 - || sContestantStatus[r7].unk11_2) + if (sContestantStatus[r7].numTurnsSkipped != 0 + || sContestantStatus[r7].turnSkipped) { sub_80AF138(); StringCopy(gStringVar1, gContestMons[r7].nickname); @@ -1478,7 +1478,7 @@ void sub_80AC2CC(u8 taskId) { if (++gTasks[taskId].data[10] > 50) { - if (!sContestantStatus[r7].unk15_4) + if (!sContestantStatus[r7].hasJudgesAttention) { sub_80AFBA0( sContestantStatus[r7].appeal2, @@ -1535,7 +1535,7 @@ void sub_80AC2CC(u8 taskId) } return; case 41: - if (shared19328.bits_8 && r7 != shared19328.bits_9) + if (shared19328.excitementFrozen && r7 != shared19328.excitementFreezer) { gTasks[taskId].data[0] = 57; } @@ -1679,7 +1679,7 @@ void sub_80AC2CC(u8 taskId) return; case 57: sub_80AF138(); - StringCopy(gStringVar3, gContestMons[shared19328.bits_9].nickname); + StringCopy(gStringVar3, gContestMons[shared19328.excitementFreezer].nickname); StringCopy(gStringVar1, gContestMons[r7].nickname); StringCopy(gStringVar2, gMoveNames[sContestantStatus[r7].currMove]); StringExpandPlaceholders(gStringVar4, ContestString_CrowdWatches); @@ -1703,8 +1703,8 @@ void sub_80AC2CC(u8 taskId) } return; case 33: - if (sContestantStatus[r7].unk15_4) - sContestantStatus[r7].unk15_4 = 0; + if (sContestantStatus[r7].hasJudgesAttention) + sContestantStatus[r7].hasJudgesAttention = 0; sub_80B09B0(r7); StringCopy(gStringVar1, gContestMons[r7].nickname); StringCopy(gStringVar2, gMoveNames[sContestantStatus[r7].currMove]); @@ -2685,7 +2685,7 @@ bool8 sub_80AEE54(u8 a, u8 b) { r8 = sub_80AEE4C(a); r4 = 0; - while (sContestantStatus[a].unkD / 10 > r4) + while (sContestantStatus[a].condition / 10 > r4) { *(u16 *)(VRAM + 0xC026 + (r9 + r4) * 64) = r8; r4++; @@ -2700,7 +2700,7 @@ bool8 sub_80AEE54(u8 a, u8 b) { r8 = 0; r4 = 3; - while (sContestantStatus[a].unkD / 10 < r4) + while (sContestantStatus[a].condition / 10 < r4) { *(u16 *)(VRAM + 0xBFE6 + (r9 + r4) * 64) = r8; r4--; @@ -2725,7 +2725,7 @@ void sub_80AEF50(void) u16 r6 = sub_80AEE4C(i); r4 = 0; - while (r4 < sContestantStatus[i].unkD / 10) + while (r4 < sContestantStatus[i].condition / 10) { *(u16 *)(VRAM + 0xC026 + (r8 + r4) * 64) = r6; r4++; @@ -2771,11 +2771,11 @@ bool8 sub_80AF038(u8 a) u16 r4 = 0; u8 r6 = gUnknown_02038696[a] * 5 + 2; - if (sContestantStatus[a].unk10_0 != 0 || sContestantStatus[a].unk10_1 != 0 || sContestantStatus[a].unk12 != 0 || sContestantStatus[a].unkF != 0) + if (sContestantStatus[a].resistant != 0 || sContestantStatus[a].immune != 0 || sContestantStatus[a].jamSafetyCount != 0 || sContestantStatus[a].jamReduction != 0) r4 = sub_80AEFE8(a, 0); - else if (sContestantStatus[a].unkC_0) + else if (sContestantStatus[a].nervous) r4 = sub_80AEFE8(a, 1); - else if (sContestantStatus[a].unkC_1 != 0 || sContestantStatus[a].unkB_7) + else if (sContestantStatus[a].numTurnsSkipped != 0 || sContestantStatus[a].noMoreTurns) r4 = sub_80AEFE8(a, 2); else r5 = FALSE; @@ -2949,7 +2949,7 @@ void sub_80AF3C0(void) bool8 sub_80AF404(u8 a) { - if (sContestantStatus[a].unkC_1 != 0 || sContestantStatus[a].unkB_7) + if (sContestantStatus[a].numTurnsSkipped != 0 || sContestantStatus[a].noMoreTurns) return FALSE; else return TRUE; @@ -2964,32 +2964,32 @@ void sub_80AF438(void) // This is bitfield hell... sContestantStatus[i].appeal2 = 0; sContestantStatus[i].appeal1 = 0; - sContestantStatus[i].unk12 = 0; - if (sContestantStatus[i].unkC_1 > 0) - sContestantStatus[i].unkC_1--; + sContestantStatus[i].jamSafetyCount = 0; + if (sContestantStatus[i].numTurnsSkipped > 0) + sContestantStatus[i].numTurnsSkipped--; sContestantStatus[i].unkE = 0; - sContestantStatus[i].unk10_0 = 0; - sContestantStatus[i].unkF = 0; - sContestantStatus[i].unk10_1 = 0; - sContestantStatus[i].unk10_2 = 0; - sContestantStatus[i].unk10_3 = 0; - sContestantStatus[i].unkC_0 = 0; - sContestantStatus[i].unk13 = 0xFF; - sContestantStatus[i].unk14 = -1; + sContestantStatus[i].resistant = 0; + sContestantStatus[i].jamReduction = 0; + sContestantStatus[i].immune = 0; + sContestantStatus[i].moreEasilyStartled = 0; + sContestantStatus[i].usedRepeatableMove = 0; + sContestantStatus[i].nervous = 0; + sContestantStatus[i].effectStringId = 0xFF; + sContestantStatus[i].effectStringId2 = -1; sContestantStatus[i].unk10_4 = 0; sContestantStatus[i].unk15_2 = sContestantStatus[i].disappointedRepeat; sContestantStatus[i].disappointedRepeat = FALSE; sContestantStatus[i].unk11_0 = 0; sContestantStatus[i].unk11_5 = 0; - if (sContestantStatus[i].unk11_2) + if (sContestantStatus[i].turnSkipped) { - sContestantStatus[i].unkC_1 = 1; - sContestantStatus[i].unk11_2 = 0; + sContestantStatus[i].numTurnsSkipped = 1; + sContestantStatus[i].turnSkipped = 0; } - if (sContestantStatus[i].unk11_3) + if (sContestantStatus[i].exploded) { - sContestantStatus[i].unkB_7 = 1; - sContestantStatus[i].unk11_3 = 0; + sContestantStatus[i].noMoreTurns = 1; + sContestantStatus[i].exploded = 0; } sContestantStatus[i].unk11_4 = 0; } @@ -3000,12 +3000,12 @@ void sub_80AF438(void) sContest.unk19248[sContest.turnNumber][i] = Contest_GetMoveExcitement(sContestantStatus[i].currMove); sContestantStatus[i].currMove = MOVE_NONE; } - shared19328.bits_8 = 0; + shared19328.excitementFrozen = 0; } bool8 Contest_IsMonsTurnDisabled(u8 a) { - if (sContestantStatus[a].unkC_1 != 0 || sContestantStatus[a].unkB_7) + if (sContestantStatus[a].numTurnsSkipped != 0 || sContestantStatus[a].noMoreTurns) return TRUE; else return FALSE; @@ -4209,7 +4209,7 @@ void unref_sub_80B0994(u8 a) void sub_80B09B0(u8 a) { - if (sContestantStatus[a].unk15_4) + if (sContestantStatus[a].hasJudgesAttention) sub_80B0368(a); else sub_80B03A8(a); @@ -4543,34 +4543,34 @@ void sub_80B114C(u8 contestant) } sContestantStatus[contestant].appeal1 = gContestEffects[effect].appeal; sContestantStatus[contestant].appeal2 = gContestEffects[effect].appeal; - shared192D0.unk4 = gContestEffects[effect].jam; - shared192D0.unk6 = gContestEffects[effect].jam; - shared192D0.unk11 = contestant; + shared192D0.jam = gContestEffects[effect].jam; + shared192D0.jam2 = gContestEffects[effect].jam; + shared192D0.contestant = contestant; for (i = 0; i < 4; i++) { sContestantStatus[i].unkE = 0; shared192D0.unkD[i] = 0; } - if (sContestantStatus[contestant].unk15_4 && AreMovesContestCombo(sContestantStatus[contestant].prevMove, sContestantStatus[contestant].currMove) == 0) - sContestantStatus[contestant].unk15_4 = 0; + if (sContestantStatus[contestant].hasJudgesAttention && AreMovesContestCombo(sContestantStatus[contestant].prevMove, sContestantStatus[contestant].currMove) == 0) + sContestantStatus[contestant].hasJudgesAttention = 0; gContestEffectFuncs[effect](); if (sContestantStatus[contestant].unk10_4 == 1) - sContestantStatus[contestant].appeal2 += sContestantStatus[contestant].unkD - 10; + sContestantStatus[contestant].appeal2 += sContestantStatus[contestant].condition - 10; else if (sContestantStatus[contestant].unk11_5) - sContestantStatus[contestant].appeal2 += sContestantStatus[contestant].unkD * 3; + sContestantStatus[contestant].appeal2 += sContestantStatus[contestant].condition * 3; else - sContestantStatus[contestant].appeal2 += sContestantStatus[contestant].unkD; + sContestantStatus[contestant].appeal2 += sContestantStatus[contestant].condition; sContestantStatus[contestant].unk16 = 0; sContestantStatus[contestant].unk15_6 = 0; if (sub_80B214C(contestant)) { u8 r2 = AreMovesContestCombo(sContestantStatus[contestant].prevMove, sContestantStatus[contestant].currMove); - if (r2 != 0 && sContestantStatus[contestant].unk15_4) + if (r2 != 0 && sContestantStatus[contestant].hasJudgesAttention) { sContestantStatus[contestant].unk16 = r2; sContestantStatus[contestant].unk15_6 = 1; - sContestantStatus[contestant].unk15_4 = 0; + sContestantStatus[contestant].hasJudgesAttention = 0; sContestantStatus[contestant].unk17 = sContestantStatus[contestant].appeal1 * sContestantStatus[contestant].unk16; sContestantStatus[contestant].unk15_3 = 1; } @@ -4578,20 +4578,20 @@ void sub_80B114C(u8 contestant) { if (gContestMoves[sContestantStatus[contestant].currMove].comboStarterId != 0) { - sContestantStatus[contestant].unk15_4 = 1; + sContestantStatus[contestant].hasJudgesAttention = 1; sContestantStatus[contestant].unk15_6 = 1; } else { - sContestantStatus[contestant].unk15_4 = 0; + sContestantStatus[contestant].hasJudgesAttention = 0; } } } if (sContestantStatus[contestant].disappointedRepeat) sContestantStatus[contestant].unk18 = (sContestantStatus[contestant].moveRepeatCount + 1) * 10; - if (sContestantStatus[contestant].unkC_0) + if (sContestantStatus[contestant].nervous) { - sContestantStatus[contestant].unk15_4 = 0; + sContestantStatus[contestant].hasJudgesAttention = 0; sContestantStatus[contestant].appeal2 = 0; sContestantStatus[contestant].appeal1 = 0; } @@ -4624,41 +4624,41 @@ void sub_80B114C(u8 contestant) } } -void SetContestantStatusUnk13(u8 a, u8 b) +void SetContestantEffectStringID(u8 a, u8 b) { - sContestantStatus[a].unk13 = b; + sContestantStatus[a].effectStringId = b; } -void SetContestantStatusUnk14(u8 a, u8 b) +void SetContestantEffectStringID2(u8 a, u8 b) { - sContestantStatus[a].unk14 = b; + sContestantStatus[a].effectStringId2 = b; } void sub_80B141C(u8 a, u8 b) { if (b >= 60) - SetContestantStatusUnk13(a, 53); + SetContestantEffectStringID(a, 53); else if (b >= 40) - SetContestantStatusUnk13(a, 52); + SetContestantEffectStringID(a, 52); else if (b >= 30) - SetContestantStatusUnk13(a, 51); + SetContestantEffectStringID(a, 51); else if (b >= 20) - SetContestantStatusUnk13(a, 50); + SetContestantEffectStringID(a, 50); else if (b >= 10) - SetContestantStatusUnk13(a, 49); + SetContestantEffectStringID(a, 49); } void sub_80B146C(u8 a, u8 b) { StringCopy(gStringVar1, gContestMons[a].nickname); StringCopy(gStringVar2, gMoveNames[sContestantStatus[a].currMove]); - if (gContestMoves[sContestantStatus[shared192D0.unk11].currMove].contestCategory == CONTEST_CATEGORY_COOL) + if (gContestMoves[sContestantStatus[shared192D0.contestant].currMove].contestCategory == CONTEST_CATEGORY_COOL) StringCopy(gStringVar3, gText_Contest_Shyness); - else if (gContestMoves[sContestantStatus[shared192D0.unk11].currMove].contestCategory == CONTEST_CATEGORY_BEAUTY) + else if (gContestMoves[sContestantStatus[shared192D0.contestant].currMove].contestCategory == CONTEST_CATEGORY_BEAUTY) StringCopy(gStringVar3, gText_Contest_Anxiety); - else if (gContestMoves[sContestantStatus[shared192D0.unk11].currMove].contestCategory == CONTEST_CATEGORY_CUTE) + else if (gContestMoves[sContestantStatus[shared192D0.contestant].currMove].contestCategory == CONTEST_CATEGORY_CUTE) StringCopy(gStringVar3, gText_Contest_Laziness); - else if (gContestMoves[sContestantStatus[shared192D0.unk11].currMove].contestCategory == CONTEST_CATEGORY_SMART) + else if (gContestMoves[sContestantStatus[shared192D0.contestant].currMove].contestCategory == CONTEST_CATEGORY_SMART) StringCopy(gStringVar3, gText_Contest_Hesitancy); else StringCopy(gStringVar3, gText_Contest_Fear); @@ -4667,9 +4667,9 @@ void sub_80B146C(u8 a, u8 b) Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); } -void sub_80B157C(u8 p) +void MakeContestantNervous(u8 p) { - sContestantStatus[p].unkC_0 = 1; + sContestantStatus[p].nervous = 1; sContestantStatus[p].currMove = MOVE_NONE; } @@ -4723,7 +4723,7 @@ void sub_80B159C(void) for (i = 0; i < 4; i++) { - shared192D0.unk0[i] = sp0[i]; + shared192D0.turnOrder[i] = sp0[i]; sContestantStatus[i].unk19 = 0xFF; sContestantStatus[i].unk10_6 = 0; gUnknown_02038696[i] = sp0[i]; @@ -5114,7 +5114,7 @@ void sub_80B20C4(void) bool8 sub_80B214C(u8 a) { - if (sContestantStatus[a].disappointedRepeat || sContestantStatus[a].unkC_0) + if (sContestantStatus[a].disappointedRepeat || sContestantStatus[a].nervous) return FALSE; else return TRUE; diff --git a/src/contest_ai.c b/src/contest_ai.c index 8fce9d15f..e570dbafb 100644 --- a/src/contest_ai.c +++ b/src/contest_ai.c @@ -380,7 +380,7 @@ static u8 sub_8128A7C(u8 var) int i; for(i = 0; i < 4; i++) - if(shared192D0.unk0[i] == var) + if(shared192D0.turnOrder[i] == var) break; return i; @@ -494,7 +494,7 @@ static void ContestAICmd_unk_0A(void) static void ContestAICmd_get_user_order(void) { - eContestAI->scriptResult = shared192D0.unk0[eContestAI->unk41]; + eContestAI->scriptResult = shared192D0.turnOrder[eContestAI->unk41]; gAIScriptPtr += 1; } @@ -540,7 +540,7 @@ static void ContestAICmd_unk_0F(void) static void ContestAICmd_get_user_condition_maybe(void) { - eContestAI->scriptResult = sContestantStatus[eContestAI->unk41].unkD / 10; + eContestAI->scriptResult = sContestantStatus[eContestAI->unk41].condition / 10; gAIScriptPtr += 1; } @@ -1147,7 +1147,7 @@ static void ContestAICmd_get_condition(void) { int var = sub_8128A7C(gAIScriptPtr[1]); - eContestAI->scriptResult = sContestantStatus[var].unkD / 10; + eContestAI->scriptResult = sContestantStatus[var].condition / 10; gAIScriptPtr += 2; } 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 --- include/contest.h | 13 +------------ include/global.h | 1 + src/battle/anim/glow.c | 2 +- src/battle/anim/love_bg.c | 6 +++--- src/battle/anim/scary_face.c | 10 +++++----- src/contest_effect.c | 38 +++++++++++++++++++------------------- 6 files changed, 30 insertions(+), 40 deletions(-) diff --git a/include/contest.h b/include/contest.h index 40a9ad099..8c3495920 100644 --- a/include/contest.h +++ b/include/contest.h @@ -297,16 +297,6 @@ struct ContestantStatus /*0x1B*/ u8 unk1B; }; -struct UnknownContestStruct3 -{ - u8 unk0; - u8 unk1; - //u8 unk2_0:1; - //u8 unk2_1:1; - u8 unk2; // maybe a bitfield - u8 filler3; -}; - // possibly the same as UnknownContestStruct3? struct UnknownContestStruct4 { @@ -315,7 +305,6 @@ struct UnknownContestStruct4 u8 unk2_0:1; u8 unk2_1:1; u8 unk2_2:1; - u8 filler3; }; struct UnknownContestStruct5 @@ -331,7 +320,7 @@ struct UnknownContestStruct7 u8 turnOrder[4]; s16 jam; s16 jam2; - u8 unk8[5]; + u8 jamQueue[5]; u8 unkD[4]; u8 contestant; }; diff --git a/include/global.h b/include/global.h index faa4ace68..0949c87cb 100644 --- a/include/global.h +++ b/include/global.h @@ -17,6 +17,7 @@ void *memcpy (void *, const void *, size_t); void *memset (void *, int, size_t); int strcmp (const char *, const char *); +#define abs(a) ((a) >= 0 ? (a) : -(a)) #endif // Prevent cross-jump optimization. diff --git a/src/battle/anim/glow.c b/src/battle/anim/glow.c index 63466c0ff..174655080 100644 --- a/src/battle/anim/glow.c +++ b/src/battle/anim/glow.c @@ -13,7 +13,7 @@ extern u8 gAnimBankTarget; extern u16 gUnknown_083D7A5C[5]; -extern struct INCBIN_U8 gBattleAnimSpritePalette_206; +extern const u8 gBattleAnimSpritePalette_206[]; // glow (a whitening effect where the Pokemon glows white in a cycle.) // Used in Heal Bell. diff --git a/src/battle/anim/love_bg.c b/src/battle/anim/love_bg.c index c3828c681..72d9325f2 100644 --- a/src/battle/anim/love_bg.c +++ b/src/battle/anim/love_bg.c @@ -10,9 +10,9 @@ extern s16 gBattleAnimArgs[]; extern u8 gAnimBankAttacker; extern u8 gAnimBankTarget; -extern struct INCBIN_U8 gAttractTilemap; -extern struct INCBIN_U8 gAttractGfx; -extern struct INCBIN_U8 gAttractPal; +extern const u8 gAttractTilemap[]; +extern const u8 gAttractGfx[]; +extern const u8 gAttractPal[]; extern u16 gBattle_BG1_Y; extern u16 gBattle_BG1_X; diff --git a/src/battle/anim/scary_face.c b/src/battle/anim/scary_face.c index 8d51521ee..8bc7bbd07 100644 --- a/src/battle/anim/scary_face.c +++ b/src/battle/anim/scary_face.c @@ -10,11 +10,11 @@ extern s16 gBattleAnimArgs[]; extern u8 gAnimBankAttacker; extern u8 gAnimBankTarget; -extern struct INCBIN_U8 gBattleAnimBackgroundTilemap_ScaryFaceContest; -extern struct INCBIN_U8 gBattleAnimBackgroundTilemap_ScaryFacePlayer; -extern struct INCBIN_U8 gBattleAnimBackgroundTilemap_ScaryFaceOpponent; -extern struct INCBIN_U8 gBattleAnimBackgroundImage_ScaryFace; -extern struct INCBIN_U8 gBattleAnimBackgroundPalette_ScaryFace; +extern const u8 gBattleAnimBackgroundTilemap_ScaryFaceContest[]; +extern const u8 gBattleAnimBackgroundTilemap_ScaryFacePlayer[]; +extern const u8 gBattleAnimBackgroundTilemap_ScaryFaceOpponent[]; +extern const u8 gBattleAnimBackgroundImage_ScaryFace[]; +extern const u8 gBattleAnimBackgroundPalette_ScaryFace[]; extern u16 gBattle_BG1_Y; extern u16 gBattle_BG1_X; 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 --- include/contest.h | 17 +++++++++------- src/contest.c | 55 +++++++++++++++++++++++++------------------------- src/contest_effect.c | 57 ++++++++++++++++++++++++++-------------------------- 3 files changed, 66 insertions(+), 63 deletions(-) diff --git a/include/contest.h b/include/contest.h index 8c3495920..c41e43659 100644 --- a/include/contest.h +++ b/include/contest.h @@ -268,17 +268,20 @@ struct ContestantStatus /*0x0D*/ s8 condition; /*0x0E*/ u8 unkE; /*0x0F*/ u8 jamReduction; + + // Flags set by move effect /*0x10*/ u8 resistant:1; u8 immune:1; u8 moreEasilyStartled:1; u8 usedRepeatableMove:1; - u8 unk10_4:2; - u8 unk10_6:2; - /*0x11*/ u8 unk11_0:2; + u8 conditionMod:2; // 1: just raised condition; 2: appeal greatly improved by condition + u8 turnOrderMod:2; // 1: defined; 2: random + /*0x11*/ u8 turnOrderModAction:2; // 1: made first; 2: made last; 3: made random u8 turnSkipped:1; u8 exploded:1; - u8 unk11_4:1; - u8 unk11_5:1; + u8 overrideCategoryExcitementMod:1; + u8 appealTripleCondition:1; + /*0x12*/ u8 jamSafetyCount; /*0x13*/ u8 effectStringId; // status action? /*0x14*/ u8 effectStringId2; @@ -292,7 +295,7 @@ struct ContestantStatus /*0x16*/ u8 unk16; /*0x17*/ u8 unk17; /*0x18*/ u8 unk18; - /*0x19*/ u8 unk19; // turn position + /*0x19*/ u8 nextTurnOrder; // turn position /*0x1A*/ u8 attentionLevel; // How much the Pokemon "stood out" /*0x1B*/ u8 unk1B; }; @@ -321,7 +324,7 @@ struct UnknownContestStruct7 s16 jam; s16 jam2; u8 jamQueue[5]; - u8 unkD[4]; + u8 unnervedPokes[4]; u8 contestant; }; diff --git a/src/contest.c b/src/contest.c index d2fa37977..9d1107976 100644 --- a/src/contest.c +++ b/src/contest.c @@ -61,7 +61,6 @@ extern u16 gBattle_BG0_Y; extern u16 gBattle_BG0_X; extern u16 gBattle_BG1_X; extern u16 gBattle_WIN0H; -extern u32 gContestRngValue; // saved RNG value extern struct SpriteTemplate gUnknown_02024E8C; @@ -401,7 +400,7 @@ void ClearContestVars(void) sub_80B0F28(0); for (i = 0; i < 4; i++) { - sContestantStatus[i].unk19 = 0xFF; + sContestantStatus[i].nextTurnOrder = 0xFF; sContest.unk19218[i] = gUnknown_02038696[i]; } sub_80B159C(); @@ -1255,15 +1254,15 @@ void sub_80AC2CC(u8 taskId) gTasks[taskId].data[0] = 23; return; case 48: - if (sContestantStatus[r7].unk11_0 == 1) + if (sContestantStatus[r7].turnOrderModAction == 1) { sub_80B1710(5); } - else if (sContestantStatus[r7].unk11_0 == 2) + else if (sContestantStatus[r7].turnOrderModAction == 2) { sub_80B1710(6); } - else if (sContestantStatus[r7].unk11_0 == 3) + else if (sContestantStatus[r7].turnOrderModAction == 3) { sub_80B1710(7); } @@ -1291,7 +1290,7 @@ void sub_80AC2CC(u8 taskId) gTasks[taskId].data[0] = 35; return; case 35: - if (sContestantStatus[r7].unk10_4 == 1) + if (sContestantStatus[r7].conditionMod == 1) sub_80B1710(8); gTasks[taskId].data[0] = 36; return; @@ -1542,7 +1541,7 @@ void sub_80AC2CC(u8 taskId) else { r4 = shared19328.bits_0; - if (sContestantStatus[r7].unk11_4) + if (sContestantStatus[r7].overrideCategoryExcitementMod) { r4 = 1; StringCopy(gStringVar3, gMoveNames[sContestantStatus[r7].currMove]); @@ -2678,10 +2677,10 @@ bool8 sub_80AEE54(u8 a, u8 b) u16 r8; s32 r4; - if (sContestantStatus[a].unk10_4 == 0) + if (sContestantStatus[a].conditionMod == 0) return FALSE; r9 = gUnknown_02038696[a] * 5 + 2; - if (sContestantStatus[a].unk10_4 == 1) + if (sContestantStatus[a].conditionMod == 1) { r8 = sub_80AEE4C(a); r4 = 0; @@ -2693,7 +2692,7 @@ bool8 sub_80AEE54(u8 a, u8 b) if (b != 0) { PlaySE(SE_EXPMAX); - sContestantStatus[a].unk10_4 = 0; + sContestantStatus[a].conditionMod = 0; } } else @@ -2708,7 +2707,7 @@ bool8 sub_80AEE54(u8 a, u8 b) if (b != 0) { PlaySE(SE_FU_ZAKU2); - sContestantStatus[a].unk10_4 = 0; + sContestantStatus[a].conditionMod = 0; } } return TRUE; @@ -2976,11 +2975,11 @@ void sub_80AF438(void) sContestantStatus[i].nervous = 0; sContestantStatus[i].effectStringId = 0xFF; sContestantStatus[i].effectStringId2 = -1; - sContestantStatus[i].unk10_4 = 0; + sContestantStatus[i].conditionMod = 0; sContestantStatus[i].unk15_2 = sContestantStatus[i].disappointedRepeat; sContestantStatus[i].disappointedRepeat = FALSE; - sContestantStatus[i].unk11_0 = 0; - sContestantStatus[i].unk11_5 = 0; + sContestantStatus[i].turnOrderModAction = 0; + sContestantStatus[i].appealTripleCondition = 0; if (sContestantStatus[i].turnSkipped) { sContestantStatus[i].numTurnsSkipped = 1; @@ -2991,7 +2990,7 @@ void sub_80AF438(void) sContestantStatus[i].noMoreTurns = 1; sContestantStatus[i].exploded = 0; } - sContestantStatus[i].unk11_4 = 0; + sContestantStatus[i].overrideCategoryExcitementMod = 0; } for (i = 0; i < 4; i++) { @@ -4549,14 +4548,14 @@ void sub_80B114C(u8 contestant) for (i = 0; i < 4; i++) { sContestantStatus[i].unkE = 0; - shared192D0.unkD[i] = 0; + shared192D0.unnervedPokes[i] = 0; } if (sContestantStatus[contestant].hasJudgesAttention && AreMovesContestCombo(sContestantStatus[contestant].prevMove, sContestantStatus[contestant].currMove) == 0) sContestantStatus[contestant].hasJudgesAttention = 0; gContestEffectFuncs[effect](); - if (sContestantStatus[contestant].unk10_4 == 1) + if (sContestantStatus[contestant].conditionMod == 1) sContestantStatus[contestant].appeal2 += sContestantStatus[contestant].condition - 10; - else if (sContestantStatus[contestant].unk11_5) + else if (sContestantStatus[contestant].appealTripleCondition) sContestantStatus[contestant].appeal2 += sContestantStatus[contestant].condition * 3; else sContestantStatus[contestant].appeal2 += sContestantStatus[contestant].condition; @@ -4596,7 +4595,7 @@ void sub_80B114C(u8 contestant) sContestantStatus[contestant].appeal1 = 0; } shared19328.bits_0 = Contest_GetMoveExcitement(sContestantStatus[contestant].currMove); - if (sContestantStatus[contestant].unk11_4) + if (sContestantStatus[contestant].overrideCategoryExcitementMod) shared19328.bits_0 = 1; if (shared19328.bits_0 > 0) { @@ -4692,7 +4691,7 @@ void sub_80B159C(void) { for (j = 0; j < 4; j++) { - if (sContestantStatus[j].unk19 == i) + if (sContestantStatus[j].nextTurnOrder == i) { sp0[j] = i; sp4[j] = 1; @@ -4703,7 +4702,7 @@ void sub_80B159C(void) { for (j = 0; j < 4; j++) { - if (sp4[j] == 0 && sContestantStatus[j].unk19 == 0xFF) + if (sp4[j] == 0 && sContestantStatus[j].nextTurnOrder == 0xFF) { r12 = j; j++; @@ -4712,7 +4711,7 @@ void sub_80B159C(void) } for (; j < 4; j++) { - if (sp4[j] == 0 && sContestantStatus[j].unk19 == 0xFF + if (sp4[j] == 0 && sContestantStatus[j].nextTurnOrder == 0xFF && gUnknown_02038696[r12] > gUnknown_02038696[j]) r12 = j; } @@ -4724,8 +4723,8 @@ void sub_80B159C(void) for (i = 0; i < 4; i++) { shared192D0.turnOrder[i] = sp0[i]; - sContestantStatus[i].unk19 = 0xFF; - sContestantStatus[i].unk10_6 = 0; + sContestantStatus[i].nextTurnOrder = 0xFF; + sContestantStatus[i].turnOrderMod = 0; gUnknown_02038696[i] = sp0[i]; } } @@ -5068,7 +5067,7 @@ void sub_80B1FD0(bool8 a) for (i = 0; i < 4; i++) { - if (sContestantStatus[i].unk10_6 != 0 && a) + if (sContestantStatus[i].turnOrderMod != 0 && a) { CpuCopy32( GetTurnOrderNumberGfx(i), @@ -5086,10 +5085,10 @@ void sub_80B1FD0(bool8 a) const u8 *GetTurnOrderNumberGfx(u8 contestant) { - if (sContestantStatus[contestant].unk10_6 != 1) + if (sContestantStatus[contestant].turnOrderMod != 1) return gContestNextTurnRandomGfx; else - return gContestNextTurnNumbersGfx + sContestantStatus[contestant].unk19 * 64; + return gContestNextTurnNumbersGfx + sContestantStatus[contestant].nextTurnOrder * 64; } void sub_80B20C4(void) @@ -5098,7 +5097,7 @@ void sub_80B20C4(void) for (i = 0; i < 4; i++) { - if (shared192D0.unkD[i] != 0 && !Contest_IsMonsTurnDisabled(i)) + if (shared192D0.unnervedPokes[i] != 0 && !Contest_IsMonsTurnDisabled(i)) { u8 r4 = gUnknown_02038696[i] * 5 + 2; u16 r0 = sub_80AEFE8(i, 3); 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 --- include/contest.h | 4 +- src/contest.c | 10 +- src/contest_effect.c | 384 +++++++++++++++++++++++++-------------------------- 3 files changed, 199 insertions(+), 199 deletions(-) diff --git a/include/contest.h b/include/contest.h index c41e43659..860231cb1 100644 --- a/include/contest.h +++ b/include/contest.h @@ -266,7 +266,7 @@ struct ContestantStatus /*0x0C*/ u8 nervous:1; u8 numTurnsSkipped:2; /*0x0D*/ s8 condition; - /*0x0E*/ u8 unkE; + /*0x0E*/ u8 jam; /*0x0F*/ u8 jamReduction; // Flags set by move effect @@ -290,7 +290,7 @@ struct ContestantStatus u8 unk15_2:1; u8 unk15_3:1; u8 hasJudgesAttention:1; - u8 unk15_5:1; + u8 judgesAttentionWasRemoved:1; u8 unk15_6:1; /*0x16*/ u8 unk16; /*0x17*/ u8 unk17; diff --git a/src/contest.c b/src/contest.c index 9d1107976..6f3deea3d 100644 --- a/src/contest.c +++ b/src/contest.c @@ -1368,7 +1368,7 @@ void sub_80AC2CC(u8 taskId) case 28: for (i = 0; gTasks[taskId].data[1] != gUnknown_02038696[i]; i++) ; - sub_80AFBA0(sContestantStatus[i].appeal2 + sContestantStatus[i].unkE, -sContestantStatus[i].unkE, i); + sub_80AFBA0(sContestantStatus[i].appeal2 + sContestantStatus[i].jam, -sContestantStatus[i].jam, i); gTasks[taskId].data[0] = 29; return; case 29: @@ -1407,10 +1407,10 @@ void sub_80AC2CC(u8 taskId) PlaySE(SE_C_PASI); else PlaySE(SE_C_SYU); - if (sContestantStatus[i].unk15_5) + if (sContestantStatus[i].judgesAttentionWasRemoved) { sub_80B03A8(i); - sContestantStatus[i].unk15_5 = 0; + sContestantStatus[i].judgesAttentionWasRemoved = 0; } gTasks[taskId].data[1]++; gTasks[taskId].data[0] = 26; @@ -2966,7 +2966,7 @@ void sub_80AF438(void) sContestantStatus[i].jamSafetyCount = 0; if (sContestantStatus[i].numTurnsSkipped > 0) sContestantStatus[i].numTurnsSkipped--; - sContestantStatus[i].unkE = 0; + sContestantStatus[i].jam = 0; sContestantStatus[i].resistant = 0; sContestantStatus[i].jamReduction = 0; sContestantStatus[i].immune = 0; @@ -4547,7 +4547,7 @@ void sub_80B114C(u8 contestant) shared192D0.contestant = contestant; for (i = 0; i < 4; i++) { - sContestantStatus[i].unkE = 0; + sContestantStatus[i].jam = 0; shared192D0.unnervedPokes[i] = 0; } if (sContestantStatus[contestant].hasJudgesAttention && AreMovesContestCombo(sContestantStatus[contestant].prevMove, sContestantStatus[contestant].currMove) == 0) 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 --- include/contest.h | 66 ++++++++++++++++++++++ src/contest.c | 10 ++-- src/contest_effect.c | 152 +++++++++++++++++++++++++-------------------------- 3 files changed, 147 insertions(+), 81 deletions(-) diff --git a/include/contest.h b/include/contest.h index 860231cb1..32510fd2c 100644 --- a/include/contest.h +++ b/include/contest.h @@ -128,6 +128,72 @@ enum COMBO_STARTER_CALM_MIND }; +enum +{ + CONTEST_STRING_MORE_CONSCIOUS, + CONTEST_STRING_NO_APPEAL, + CONTEST_STRING_SETTLE_DOWN, + CONTEST_STRING_OBLIVIOUS_TO_OTHERS, + CONTEST_STRING_LESS_AWARE, + CONTEST_STRING_STOPPED_CARING, + CONTEST_STRING_STARTLE_ATTEMPT, + CONTEST_STRING_DAZZLE_ATTEMPT, + CONTEST_STRING_JUDGE_LOOK_AWAY2, + CONTEST_STRING_UNNERVE_ATTEMPT, + CONTEST_STRING_NERVOUS, + CONTEST_STRING_UNNERVE_WAITING, + CONTEST_STRING_TAUNT_WELL, + CONTEST_STRING_REGAINED_FORM, + CONTEST_STRING_JAM_WELL, + CONTEST_STRING_HUSTLE_STANDOUT, + CONTEST_STRING_WORK_HARD_UNNOTICED, + CONTEST_STRING_WORK_BEFORE, + CONTEST_STRING_APPEAL_NOT_WELL, + CONTEST_STRING_WORK_PRECEDING, + CONTEST_STRING_APPEAL_NOT_WELL2, + CONTEST_STRING_APPEAL_NOT_SHOWN_WELL, + CONTEST_STRING_APPEAL_SLIGHTLY_WELL, + CONTEST_STRING_APPEAL_PRETTY_WELL, + CONTEST_STRING_APPEAL_EXCELLENTLY, + CONTEST_STRING_APPEAL_DUD, + CONTEST_STRING_APPEAL_NOT_VERY_WELL, + CONTEST_STRING_APPEAL_SLIGHTLY_WELL2, + CONTEST_STRING_APPEAL_PRETTY_WELL2, + CONTEST_STRING_APPEAL_VERY_WELL, + CONTEST_STRING_APPEAL_EXCELLENTLY2, + CONTEST_STRING_SAME_TYPE_GOOD, + CONTEST_STRING_DIFF_TYPE_GOOD, + CONTEST_STRING_STOOD_OUT_AS_MUCH, + CONTEST_STRING_NOT_AS_WELL, + CONTEST_STRING_CONDITION_ROSE, + CONTEST_STRING_HOT_STATUS, + CONTEST_STRING_MOVE_UP_LINE, + CONTEST_STRING_MOVE_BACK_LINE, + CONTEST_STRING_SCRAMBLE_ORDER, + CONTEST_STRING_JUDGE_EXPECTANTLY2, + CONTEST_STRING_WENT_OVER_WELL, + CONTEST_STRING_WENT_OVER_VERY_WELL, + CONTEST_STRING_APPEAL_COMBO_EXCELLENTLY, + CONTEST_STRING_AVERT_GAZE, + CONTEST_STRING_AVOID_SEEING, + CONTEST_STRING_NOT_FAZED, + CONTEST_STRING_LITTLE_DISTRACTED, + CONTEST_STRING_ATTEMPT_STARTLE, + CONTEST_STRING_LOOKED_DOWN, + CONTEST_STRING_TURNED_BACK, + CONTEST_STRING_UTTER_CRY, + CONTEST_STRING_LEAPT_UP, + CONTEST_STRING_TRIPPED_OVER, + CONTEST_STRING_MESSED_UP2, + CONTEST_STRING_FAILED_TARGET_NERVOUS, + CONTEST_STRING_FAILED_ANYONE_NERVOUS, + CONTEST_STRING_IGNORED, + CONTEST_STRING_NO_CONDITION_IMPROVE, + CONTEST_STRING_BAD_CONDITION_WEAK_APPEAL, + CONTEST_STRING_UNAFFECTED, + CONTEST_STRING_ATTRACTED_ATTENTION +}; + struct ContestMove { u8 effect; diff --git a/src/contest.c b/src/contest.c index 6f3deea3d..3eec7d0ac 100644 --- a/src/contest.c +++ b/src/contest.c @@ -4636,15 +4636,15 @@ void SetContestantEffectStringID2(u8 a, u8 b) void sub_80B141C(u8 a, u8 b) { if (b >= 60) - SetContestantEffectStringID(a, 53); + SetContestantEffectStringID(a, CONTEST_STRING_TRIPPED_OVER); else if (b >= 40) - SetContestantEffectStringID(a, 52); + SetContestantEffectStringID(a, CONTEST_STRING_LEAPT_UP); else if (b >= 30) - SetContestantEffectStringID(a, 51); + SetContestantEffectStringID(a, CONTEST_STRING_UTTER_CRY); else if (b >= 20) - SetContestantEffectStringID(a, 50); + SetContestantEffectStringID(a, CONTEST_STRING_TURNED_BACK); else if (b >= 10) - SetContestantEffectStringID(a, 49); + SetContestantEffectStringID(a, CONTEST_STRING_LOOKED_DOWN); } void sub_80B146C(u8 a, u8 b) 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 b157c6a19ee965593073488f4a77de3ce11cdf93 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 31 Mar 2018 13:16:08 -0400 Subject: CONTEST_STRING_NONE --- include/contest.h | 3 ++- src/contest.c | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/contest.h b/include/contest.h index 32510fd2c..b5a1ed5a6 100644 --- a/include/contest.h +++ b/include/contest.h @@ -191,7 +191,8 @@ enum CONTEST_STRING_NO_CONDITION_IMPROVE, CONTEST_STRING_BAD_CONDITION_WEAK_APPEAL, CONTEST_STRING_UNAFFECTED, - CONTEST_STRING_ATTRACTED_ATTENTION + CONTEST_STRING_ATTRACTED_ATTENTION, + CONTEST_STRING_NONE = 255 }; struct ContestMove diff --git a/src/contest.c b/src/contest.c index 3eec7d0ac..e5008abe3 100644 --- a/src/contest.c +++ b/src/contest.c @@ -388,8 +388,8 @@ void ClearContestVars(void) for (i = 0; i < 4; i++) { sContestantStatus[i].unkB_0 = 0; - sContestantStatus[i].effectStringId = 0xFF; - sContestantStatus[i].effectStringId2 = 0xFF; + sContestantStatus[i].effectStringId = CONTEST_STRING_NONE; + sContestantStatus[i].effectStringId2 = CONTEST_STRING_NONE; } memset(&shared192D0, 0, sizeof(shared192D0)); @@ -1217,25 +1217,25 @@ void sub_80AC2CC(u8 taskId) return; case 23: gTasks[taskId].data[1] = 0; - if (sContestantStatus[r7].effectStringId != 0xFF) + if (sContestantStatus[r7].effectStringId != CONTEST_STRING_NONE) { sub_80B146C(r7, sContestantStatus[r7].effectStringId); - sContestantStatus[r7].effectStringId = 0xFF; + sContestantStatus[r7].effectStringId = CONTEST_STRING_NONE; gTasks[taskId].data[0] = 24; } else { - if (sContestantStatus[r7].effectStringId2 != 0xFF) + if (sContestantStatus[r7].effectStringId2 != CONTEST_STRING_NONE) { for (i = 0; i < 4; i++) { - if (i != r7 && sContestantStatus[i].effectStringId != 0xFF) + if (i != r7 && sContestantStatus[i].effectStringId != CONTEST_STRING_NONE) break; } if (i == 4) { sub_80B146C(r7, sContestantStatus[r7].effectStringId2); - sContestantStatus[r7].effectStringId2 = 0xFF; + sContestantStatus[r7].effectStringId2 = CONTEST_STRING_NONE; gTasks[taskId].data[0] = 24; } else @@ -1336,7 +1336,7 @@ void sub_80AC2CC(u8 taskId) for (r2 = 0; r2 < 4; r2++) { if (r2 != r7 && gUnknown_02038696[r2] == i - && sContestantStatus[r2].effectStringId != 0xFF) + && sContestantStatus[r2].effectStringId != CONTEST_STRING_NONE) { r4 = 1; break; @@ -1349,7 +1349,7 @@ void sub_80AC2CC(u8 taskId) { gTasks[taskId].data[1] = gUnknown_02038696[r2]; sub_80B146C(r2, sContestantStatus[r2].effectStringId); - sContestantStatus[r2].effectStringId = 0xFF; + sContestantStatus[r2].effectStringId = CONTEST_STRING_NONE; gTasks[taskId].data[0] = 27; } else @@ -2973,8 +2973,8 @@ void sub_80AF438(void) sContestantStatus[i].moreEasilyStartled = 0; sContestantStatus[i].usedRepeatableMove = 0; sContestantStatus[i].nervous = 0; - sContestantStatus[i].effectStringId = 0xFF; - sContestantStatus[i].effectStringId2 = -1; + sContestantStatus[i].effectStringId = CONTEST_STRING_NONE; + sContestantStatus[i].effectStringId2 = CONTEST_STRING_NONE; sContestantStatus[i].conditionMod = 0; sContestantStatus[i].unk15_2 = sContestantStatus[i].disappointedRepeat; sContestantStatus[i].disappointedRepeat = FALSE; -- 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 --- include/contest.h | 2 +- src/contest.c | 33 +++++++++++++++------------------ src/contest_effect.c | 46 +++++++++++++++++++++++----------------------- 3 files changed, 39 insertions(+), 42 deletions(-) diff --git a/include/contest.h b/include/contest.h index b5a1ed5a6..86a5ea4d7 100644 --- a/include/contest.h +++ b/include/contest.h @@ -445,6 +445,6 @@ void SetContestantEffectStringID2(u8 a, u8 b); void MakeContestantNervous(u8 p); bool8 Contest_IsMonsTurnDisabled(u8 a); bool8 sub_80B214C(u8 a); -void sub_80B141C(u8 a, u8 b); +void SetStartledString(u8 a, u8 b); #endif // GUARD_CONTEST_H diff --git a/src/contest.c b/src/contest.c index e5008abe3..2d953241a 100644 --- a/src/contest.c +++ b/src/contest.c @@ -187,7 +187,6 @@ void sub_80AE6E4(u8, u8); u8 CreateJudgeSprite(void); u8 sub_80AE8B4(void); u8 sub_80AE9FC(u16, u32, u32); -bool8 IsSpeciesNotUnown(u16); void sub_80AEB30(void); void sub_80AEBEC(u16); void sub_80AED58(void); @@ -246,7 +245,6 @@ void sub_80B146C(u8, u8); void sub_80B159C(void); void sub_80B1710(u8); void sub_80B1928(void); -s8 Contest_GetMoveExcitement(u16); u8 sub_80B1A2C(void); void c3_08130B10(u8); void sub_80B1B14(void); @@ -262,7 +260,6 @@ void sub_80B1F4C(u8); void sub_80B1FD0(bool8); const u8 *GetTurnOrderNumberGfx(u8); void sub_80B20C4(void); -bool8 sub_80B214C(u8); void sub_80B2184(void); void sub_80B2280(void); void sub_80B237C(u8); @@ -4633,24 +4630,24 @@ void SetContestantEffectStringID2(u8 a, u8 b) sContestantStatus[a].effectStringId2 = b; } -void sub_80B141C(u8 a, u8 b) +void SetStartledString(u8 contestant, u8 jam) { - if (b >= 60) - SetContestantEffectStringID(a, CONTEST_STRING_TRIPPED_OVER); - else if (b >= 40) - SetContestantEffectStringID(a, CONTEST_STRING_LEAPT_UP); - else if (b >= 30) - SetContestantEffectStringID(a, CONTEST_STRING_UTTER_CRY); - else if (b >= 20) - SetContestantEffectStringID(a, CONTEST_STRING_TURNED_BACK); - else if (b >= 10) - SetContestantEffectStringID(a, CONTEST_STRING_LOOKED_DOWN); + if (jam >= 60) + SetContestantEffectStringID(contestant, CONTEST_STRING_TRIPPED_OVER); + else if (jam >= 40) + SetContestantEffectStringID(contestant, CONTEST_STRING_LEAPT_UP); + else if (jam >= 30) + SetContestantEffectStringID(contestant, CONTEST_STRING_UTTER_CRY); + else if (jam >= 20) + SetContestantEffectStringID(contestant, CONTEST_STRING_TURNED_BACK); + else if (jam >= 10) + SetContestantEffectStringID(contestant, CONTEST_STRING_LOOKED_DOWN); } -void sub_80B146C(u8 a, u8 b) +void sub_80B146C(u8 contestant, u8 stringId) { - StringCopy(gStringVar1, gContestMons[a].nickname); - StringCopy(gStringVar2, gMoveNames[sContestantStatus[a].currMove]); + StringCopy(gStringVar1, gContestMons[contestant].nickname); + StringCopy(gStringVar2, gMoveNames[sContestantStatus[contestant].currMove]); if (gContestMoves[sContestantStatus[shared192D0.contestant].currMove].contestCategory == CONTEST_CATEGORY_COOL) StringCopy(gStringVar3, gText_Contest_Shyness); else if (gContestMoves[sContestantStatus[shared192D0.contestant].currMove].contestCategory == CONTEST_CATEGORY_BEAUTY) @@ -4661,7 +4658,7 @@ void sub_80B146C(u8 a, u8 b) StringCopy(gStringVar3, gText_Contest_Hesitancy); else StringCopy(gStringVar3, gText_Contest_Fear); - StringExpandPlaceholders(gStringVar4, gUnknown_083CC188[b]); + StringExpandPlaceholders(gStringVar4, gUnknown_083CC188[stringId]); sub_80AF138(); Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); } 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 +++++++++++++++++++++++------------------------ src/data/contest_moves.h | 96 ++++++++++++------------- 2 files changed, 139 insertions(+), 139 deletions(-) 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) { diff --git a/src/data/contest_moves.h b/src/data/contest_moves.h index 585ff91f1..9d269e789 100644 --- a/src/data/contest_moves.h +++ b/src/data/contest_moves.h @@ -479,54 +479,54 @@ const bool8 gComboStarterLookupTable[] = { }; void (*const gContestEffectFuncs[])(void) = { - ContestEffect_00, - ContestEffect_01, - ContestEffect_02, - ContestEffect_03, - ContestEffect_04, - ContestEffect_05, - ContestEffect_06, - ContestEffect_07, - ContestEffect_08, - ContestEffect_09, - ContestEffect_08, - ContestEffect_09, - ContestEffect_08, - ContestEffect_09, - ContestEffect_14, - ContestEffect_15, - ContestEffect_16, - ContestEffect_17, - ContestEffect_18, - ContestEffect_19, - ContestEffect_20, - ContestEffect_21, - ContestEffect_22, - ContestEffect_23, - ContestEffect_24, - ContestEffect_25, - ContestEffect_26, - ContestEffect_27, - ContestEffect_28, - ContestEffect_29, - ContestEffect_30, - ContestEffect_31, - ContestEffect_32, - ContestEffect_33, - ContestEffect_34, - ContestEffect_35, - ContestEffect_36, - ContestEffect_37, - ContestEffect_38, - ContestEffect_39, - ContestEffect_40, - ContestEffect_41, - ContestEffect_42, - ContestEffect_43, - ContestEffect_44, - ContestEffect_45, - ContestEffect_46, - ContestEffect_47 + ContestEffect_HighlyAppealing, + ContestEffect_UserMoreEasilyStartled, + ContestEffect_GreatAppealButNoMoreMoves, + ContestEffect_RepetitionNotBoring, + ContestEffect_AvoidStartleOnce, + ContestEffect_AvoidStartle, + ContestEffect_AvoidStartleSlightly, + ContestEffect_UserLessEasilyStartled, + ContestEffect_StartleFrontMon, + ContestEffect_StartlePrevMons, + ContestEffect_StartleFrontMon, + ContestEffect_StartlePrevMons, + ContestEffect_StartleFrontMon, + ContestEffect_StartlePrevMons, + ContestEffect_StartlePrevMon2, + ContestEffect_StartlePrevMons2, + ContestEffect_ShiftJudgeAttention, + ContestEffect_StartleMonWithJudgesAttention, + ContestEffect_JamsOthersButMissOneTurn, + ContestEffect_StartleMonsSameTypeAppeal, + ContestEffect_StartleMonsCoolAppeal, + ContestEffect_StartleMonsBeautyAppeal, + ContestEffect_StartleMonsCuteAppeal, + ContestEffect_StartleMonsSmartAppeal, + ContestEffect_StartleMonsToughAppeal, + ContestEffect_MakeFollowingMonNervous, + ContestEffect_MakeFollowingMonsNervous, + ContestEffect_WorsenConditionOfPrevMons, + ContestEffect_BadlyStartlesMonsInGoodCondition, + ContestEffect_BetterIfFirst, + ContestEffect_BetterIfLast, + ContestEffect_AppealAsGoodAsPrevOnes, + ContestEffect_AppealAsGoodAsPrevOne, + ContestEffect_BetterWhenLater, + ContestEffect_QualityDependsOnTiming, + ContestEffect_BetterIfSameType, + ContestEffect_BetterIfDiffType, + ContestEffect_AffectedByPrevAppeal, + ContestEffect_ImproveConditionPreventNervousness, + ContestEffect_BetterWithGoodCondition, + ContestEffect_NextAppealEarlier, + ContestEffect_NextAppealLater, + ContestEffect_MakeScramblingTurnOrderEasier, + ContestEffect_ScrambleNextTurnOrder, + ContestEffect_ExciteAudienceInAnyContest, + ContestEffect_BadlyStartleMonsWithGoodAppeals, + ContestEffect_BetterWhenAudienceExcited, + ContestEffect_DontExciteAudience }; #endif //POKERUBY_CONTEST_MOVES_H -- 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(-) 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