diff --git a/build.sh b/build.sh index ee542835..c5acc7d0 100755 --- a/build.sh +++ b/build.sh @@ -91,6 +91,7 @@ mex_build "evFunction" "build/edgeguard.dat" "src/edgeguard.c" & mex_build "evFunction" "build/fc.dat" "src/fc.c" "dats/ledgedash.dat" & mex_build "evFunction" "build/sweetspot.dat" "src/sweetspot.c" & mex_build "evFunction" "build/eggs.dat" "src/eggs.c" & +mex_build "evFunction" "build/reversal.dat" "src/reversal.c"& # wait for compilation to finish wait @@ -124,6 +125,7 @@ ${gc_fst} fs TM-CE.iso \ insert TM/fc.dat build/fc.dat \ insert TM/sweetspot.dat build/sweetspot.dat \ insert TM/eggs.dat build/eggs.dat \ + insert TM/reversal.dat build/reversal.dat \ insert codes.gct build/codes.gct \ insert Start.dol build/Start.dol \ insert opening.bnr opening.bnr diff --git a/src/events.c b/src/events.c index 51a9372e..c2263f3e 100644 --- a/src/events.c +++ b/src/events.c @@ -261,6 +261,38 @@ EventDesc Reversal = { .matchData = 0, }; +static EventMatchData Reversal_MatchData = { + .timer = MATCH_TIMER_COUNTUP, + .matchType = MATCH_MATCHTYPE_TIME, + .hideGo = true, + .hideReady = true, + .isCreateHUD = true, + .timerRunOnPause = false, + .isCheckForZRetry = false, + .isShowScore = false, + + .isRunStockLogic = false, + .isDisableHit = false, + .useKOCounter = false, + .timerSeconds = 0, +}; + +EventDesc Reversal2 = { + .eventName = "Reversal Training 2\n", + .eventDescription = "Practice OoS punishes! DPad left/right\nmoves characters closer and further apart.", + .eventFile = "reversal", + .jumpTableIndex = -1, + .CSSType = SLCHRKIND_TRAINING, + .allowed_characters = { .hmn = -1, .cpu = -1 }, + .cpuKind = -1, + .stage = -1, + .disable_hazards = true, + .force_sopo = false, + .scoreType = SCORETYPE_KO, + .callbackPriority = 3, + .matchData = &Reversal_MatchData, +}; + EventDesc SDI = { .eventName = "SDI Training\n", .eventDescription = "Use Smash DI to escape\nFox's up-air!", @@ -585,6 +617,7 @@ static EventDesc *General_Events[] = { &Combo, &AttackOnShield, &Reversal, + &Reversal2, &SDI, &Powershield, &Ledgetech, diff --git a/src/reversal.c b/src/reversal.c new file mode 100644 index 00000000..927671c4 --- /dev/null +++ b/src/reversal.c @@ -0,0 +1,19 @@ +#include "reversal.h" + +void Exit(GOBJ *menu) +{ + stc_match->state = 3; + Match_EndVS(); +} + +void Event_Init(GOBJ *gobj) +{ + +} + +void Event_Think(GOBJ *event) +{ + +} + +EventMenu *Event_Menu = &Menu_Main; \ No newline at end of file diff --git a/src/reversal.h b/src/reversal.h new file mode 100644 index 00000000..2d160b85 --- /dev/null +++ b/src/reversal.h @@ -0,0 +1,81 @@ +#ifndef _REVERSAL_H_ +#define _REVERSAL_H_ + +#include "../MexTK/mex.h" +#include "events.h" + +void Exit(GOBJ *menu); + +enum options_main +{ + OPT_CPU_ATTACK, + OPT_PLAYER_DIRECTION, + OPT_CPU_DIRECTION, + OPT_EXIT, + + OPT_COUNT +}; + +enum attack +{ + RANDOM_SMASH, + FSMASH, + DSMASH, + UPSMASH, + RANDOM_AERIAL, + FAIR, + NAIR, + DAIR, + FTILT, + DTILT, + UPTILT, + DASH_ATTACK, +}; +static int Reversal_Attack[] = { RANDOM_SMASH, FSMASH, DSMASH, UPSMASH, RANDOM_AERIAL, FAIR, NAIR, DAIR, FTILT, DTILT, UPTILT, DASH_ATTACK }; +static const char *Reversal_AttackText[] = { "Rand. Smash Attack", "FSmash", "DSmash", "UpSmash", "Rand. Aerial", "Fair", "Nair", "Dair", "FTilt", "DTilt", "UpTilt", "Dash Attack" }; + +enum direction +{ + FORWARD, + BACKWARD +}; +static int ReversalOption_Direction[] = { FORWARD, BACKWARD }; +static const char *ReversalOption_DirectionText[] = { "Forward", "Backward" }; + +static EventOption Options_Main[OPT_COUNT] = { + { + .kind = OPTKIND_STRING, + .value_num = countof(Reversal_Attack), + .name = "Attack", + .desc = { "" }, + .values = Reversal_AttackText, + }, + { + .kind = OPTKIND_STRING, + .value_num = countof(ReversalOption_Direction), + .name = "P1 direction", + .desc = { "" }, + .values = ReversalOption_DirectionText, + }, + { + .kind = OPTKIND_STRING, + .value_num = countof(ReversalOption_Direction), + .name = "Opponent direction", + .desc = { "" }, + .values = ReversalOption_DirectionText, + }, + { + .kind = OPTKIND_FUNC, + .name = "Exit", + .desc = { "Return to the Event Select Screen." }, + .OnSelect = Exit, + }, +}; + +static EventMenu Menu_Main = { + .name = "Reversal Training", + .option_num = countof(Options_Main), + .options = Options_Main, +}; + +#endif \ No newline at end of file