Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions src/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -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!",
Expand Down Expand Up @@ -585,6 +617,7 @@ static EventDesc *General_Events[] = {
&Combo,
&AttackOnShield,
&Reversal,
&Reversal2,
&SDI,
&Powershield,
&Ledgetech,
Expand Down
19 changes: 19 additions & 0 deletions src/reversal.c
Original file line number Diff line number Diff line change
@@ -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;
81 changes: 81 additions & 0 deletions src/reversal.h
Original file line number Diff line number Diff line change
@@ -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