diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-03-29 08:49:22 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-03-29 08:49:22 -0400 |
commit | 7eb178c36e5d4c5dba5f600346228969f4e33b9a (patch) | |
tree | 28c906adf3bae0763ea6e62188c8ff48e4d3ecff /src | |
parent | 59f81c5f2a25ec77baf4a30c3da9ccb7675d1562 (diff) |
Start decompiling contest_effect
Diffstat (limited to 'src')
-rw-r--r-- | src/contest.c | 2 | ||||
-rw-r--r-- | src/contest_ai.c | 2 | ||||
-rw-r--r-- | src/contest_effect.c | 33 |
3 files changed, 35 insertions, 2 deletions
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); +} + |