Skip to content

Commit c5b3d03

Browse files
committed
Start of attempts to make useful Insert mods, not adding to themes till finished. Will refactor.
1 parent d62c422 commit c5b3d03

File tree

4 files changed

+256
-1
lines changed

4 files changed

+256
-1
lines changed

src/NoteDataUtil.cpp

Lines changed: 238 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2373,6 +2373,239 @@ void NoteDataUtil::ConvertTapsToHolds( NoteData &inout, int iSimultaneousHolds,
23732373
inout.RevalidateATIs(vector<int>(), false);
23742374
}
23752375

2376+
/* Need to redo parsing to handle multiple notes on a row
2377+
skippping breaks it (Jacks generated)
2378+
due to searching left/right it generates a lot of Left or right arrows which can also be jump jacks
2379+
need creative solution or actual math */
2380+
void NoteDataUtil::IcyWorld(NoteData &inout, StepsType st, TimingData const& timing_data, int iStartIndex, int iEndIndex)
2381+
{
2382+
// Row, tap column
2383+
std::vector<tuple<int, int>> rowsWithNotes;
2384+
int currentTap = -1;
2385+
2386+
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE(inout, r, iStartIndex, iEndIndex)
2387+
{
2388+
currentTap = inout.GetNumTracksWithTap(r);
2389+
if (currentTap != 1)
2390+
continue; // skip
2391+
2392+
for (int q = 0; q < 4; q++)
2393+
{
2394+
const TapNote getTap = inout.GetTapNote(q, r);
2395+
if (getTap.type == TapNoteType_Tap)
2396+
{
2397+
currentTap = q;
2398+
break;
2399+
}
2400+
2401+
}
2402+
rowsWithNotes.push_back(tuple<int, int>(r, currentTap));
2403+
}
2404+
2405+
int lastTap = -1;
2406+
bool flipStartSide = false;
2407+
bool skipLine = true;
2408+
int i = 0;
2409+
for (auto iterator : rowsWithNotes)
2410+
{
2411+
// Every second row with note, insert a note which doesn't collide with the previous
2412+
if (!skipLine)
2413+
{
2414+
int iNumTracksHeld = inout.GetNumTracksHeldAtRow(std::get<0>(iterator));
2415+
if (iNumTracksHeld >= 1)
2416+
{
2417+
i++;
2418+
continue;
2419+
}
2420+
2421+
int tempI = (i + 1 < rowsWithNotes.size() ? i + 1 : i);
2422+
if (flipStartSide)
2423+
{
2424+
for (int c = 3; c >-1; c--)
2425+
{
2426+
if (c != lastTap && c != std::get<1>(iterator) && c != std::get<1>(rowsWithNotes.at(tempI)))
2427+
{
2428+
inout.SetTapNote(c, std::get<0>(iterator), TAP_ADDITION_TAP);
2429+
break;
2430+
}
2431+
}
2432+
}
2433+
else
2434+
{
2435+
for (int c = 0; c < 4; c++)
2436+
{
2437+
if (c != lastTap && c != std::get<1>(iterator) && c != std::get<1>(rowsWithNotes.at(tempI)))
2438+
{
2439+
inout.SetTapNote(c, std::get<0>(iterator), TAP_ADDITION_TAP);
2440+
break;
2441+
}
2442+
}
2443+
}
2444+
flipStartSide = !flipStartSide;
2445+
}
2446+
else
2447+
{
2448+
lastTap = std::get<1>(iterator);
2449+
}
2450+
skipLine = !skipLine;
2451+
i++;
2452+
}
2453+
inout.RevalidateATIs(vector<int>(), false);
2454+
}
2455+
2456+
void NoteDataUtil::AnchorJS(NoteData &inout, StepsType st, TimingData const& timing_data, int iStartIndex, int iEndIndex)
2457+
{
2458+
// Row, tap column
2459+
std::vector<tuple<int, int>> rowsWithNotes;
2460+
int currentTap = -1;
2461+
2462+
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE(inout, r, iStartIndex, iEndIndex)
2463+
{
2464+
currentTap = inout.GetNumTracksWithTap(r);
2465+
if (currentTap != 1)
2466+
continue; // skip
2467+
2468+
for (int q = 0; q < 4; q++)
2469+
{
2470+
const TapNote getTap = inout.GetTapNote(q, r);
2471+
if (getTap.type == TapNoteType_Tap)
2472+
{
2473+
currentTap = q;
2474+
break;
2475+
}
2476+
2477+
}
2478+
rowsWithNotes.push_back(tuple<int, int>(r, currentTap));
2479+
}
2480+
2481+
int lastTap = -1;
2482+
bool flipStartSide = false;
2483+
bool skipLine = true;
2484+
int i = 0;
2485+
for (auto iterator : rowsWithNotes)
2486+
{
2487+
// Every second row with note, insert a note which doesn't collide with the previous
2488+
if (!skipLine)
2489+
{
2490+
int iNumTracksHeld = inout.GetNumTracksHeldAtRow(std::get<0>(iterator));
2491+
if (iNumTracksHeld >= 1)
2492+
{
2493+
i++;
2494+
continue;
2495+
}
2496+
2497+
int tempI = (i + 1 < rowsWithNotes.size() ? i + 1 : i);
2498+
if (flipStartSide)
2499+
{
2500+
for (int c = 3; c >-1; c--)
2501+
{
2502+
if (c != lastTap && c != std::get<1>(iterator) && c != std::get<1>(rowsWithNotes.at(tempI)))
2503+
{
2504+
inout.SetTapNote(c, std::get<0>(iterator), TAP_ADDITION_TAP);
2505+
break;
2506+
}
2507+
}
2508+
}
2509+
else
2510+
{
2511+
for (int c = 0; c < 4; c++)
2512+
{
2513+
if (c != lastTap && c != std::get<1>(iterator) && c != std::get<1>(rowsWithNotes.at(tempI)))
2514+
{
2515+
inout.SetTapNote(c, std::get<0>(iterator), TAP_ADDITION_TAP);
2516+
break;
2517+
}
2518+
}
2519+
}
2520+
flipStartSide = !flipStartSide;
2521+
}
2522+
else
2523+
{
2524+
lastTap = std::get<1>(iterator);
2525+
}
2526+
skipLine = !skipLine;
2527+
i++;
2528+
}
2529+
inout.RevalidateATIs(vector<int>(), false);
2530+
}
2531+
2532+
/* Same as AnchorJS, but it doesn't check if the next row will generate a jack.
2533+
This causes mini jacks to be formed, with JS. c: */
2534+
void NoteDataUtil::JackJS(NoteData &inout, StepsType st, TimingData const& timing_data, int iStartIndex, int iEndIndex)
2535+
{
2536+
// Row, tap column
2537+
std::vector<tuple<int, int>> rowsWithNotes;
2538+
int currentTap = -1;
2539+
2540+
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE(inout, r, iStartIndex, iEndIndex)
2541+
{
2542+
currentTap = inout.GetNumTracksWithTap(r);
2543+
if (currentTap != 1)
2544+
continue; // skip
2545+
2546+
for (int q = 0; q < 4; q++)
2547+
{
2548+
const TapNote getTap = inout.GetTapNote(q, r);
2549+
if (getTap.type == TapNoteType_Tap)
2550+
{
2551+
currentTap = q;
2552+
break;
2553+
}
2554+
2555+
}
2556+
rowsWithNotes.push_back(tuple<int, int>(r, currentTap));
2557+
}
2558+
2559+
int lastTap = -1;
2560+
bool flipStartSide = false;
2561+
bool skipLine = true;
2562+
int i = 0;
2563+
for (auto iterator : rowsWithNotes)
2564+
{
2565+
// Every second row with note, insert a note which doesn't collide with the previous
2566+
if (!skipLine)
2567+
{
2568+
int iNumTracksHeld = inout.GetNumTracksHeldAtRow(std::get<0>(iterator));
2569+
if (iNumTracksHeld >= 1)
2570+
{
2571+
i++;
2572+
continue;
2573+
}
2574+
2575+
if (flipStartSide)
2576+
{
2577+
for (int c = 3; c >-1; c--)
2578+
{
2579+
if (c != lastTap && c != std::get<1>(iterator))
2580+
{
2581+
inout.SetTapNote(c, std::get<0>(iterator), TAP_ADDITION_TAP);
2582+
break;
2583+
}
2584+
}
2585+
}
2586+
else
2587+
{
2588+
for (int c = 0; c < 4; c++)
2589+
{
2590+
if (c != lastTap && c != std::get<1>(iterator))
2591+
{
2592+
inout.SetTapNote(c, std::get<0>(iterator), TAP_ADDITION_TAP);
2593+
break;
2594+
}
2595+
}
2596+
}
2597+
flipStartSide = !flipStartSide;
2598+
}
2599+
else
2600+
{
2601+
lastTap = std::get<1>(iterator);
2602+
}
2603+
skipLine = !skipLine;
2604+
i++;
2605+
}
2606+
inout.RevalidateATIs(vector<int>(), false);
2607+
}
2608+
23762609
void NoteDataUtil::Stomp( NoteData &inout, StepsType st, int iStartIndex, int iEndIndex )
23772610
{
23782611
// Make all non jumps with ample space around them into jumps.
@@ -2390,7 +2623,7 @@ void NoteDataUtil::Stomp( NoteData &inout, StepsType st, int iStartIndex, int iE
23902623
{
23912624
// Look to see if there is enough empty space on either side of the note
23922625
// to turn this into a jump.
2393-
int iRowWindowBegin = r - BeatToNoteRow(0.5f);
2626+
int iRowWindowBegin = r - BeatToNoteRow(0.5f); // 0.5
23942627
int iRowWindowEnd = r + BeatToNoteRow(0.5f);
23952628

23962629
bool bTapInMiddle = false;
@@ -2416,6 +2649,7 @@ void NoteDataUtil::Stomp( NoteData &inout, StepsType st, int iStartIndex, int iE
24162649
inout.RevalidateATIs(vector<int>(), false);
24172650
}
24182651

2652+
24192653
void NoteDataUtil::SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteType nt2, int iStartIndex, int iEndIndex )
24202654
{
24212655
// nt2 is optional and should be NoteType_Invalid if it is not used
@@ -2720,6 +2954,9 @@ void NoteDataUtil::TransformNoteData( NoteData &nd, TimingData const& timing_dat
27202954
// Jump-adding transforms aren't much affected by additional taps.
27212955
if( po.m_bTransforms[PlayerOptions::TRANSFORM_WIDE] ) NoteDataUtil::Wide( nd, iStartIndex, iEndIndex );
27222956
if( po.m_bTransforms[PlayerOptions::TRANSFORM_STOMP] ) NoteDataUtil::Stomp( nd, st, iStartIndex, iEndIndex );
2957+
if (po.m_bTransforms[PlayerOptions::TRANSFORM_JACKJS]) NoteDataUtil::JackJS(nd, st, timing_data, iStartIndex, iEndIndex);
2958+
if (po.m_bTransforms[PlayerOptions::TRANSFORM_ANCHORJS]) NoteDataUtil::AnchorJS(nd, st, timing_data, iStartIndex, iEndIndex);
2959+
if (po.m_bTransforms[PlayerOptions::TRANSFORM_ICYWORLD]) NoteDataUtil::IcyWorld(nd, st, timing_data, iStartIndex, iEndIndex);
27232960

27242961
// Transforms that add holds go last. If they went first, most tap-adding
27252962
// transforms wouldn't do anything because tap-adding transforms skip areas

src/NoteDataUtil.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ namespace NoteDataUtil
129129
void AddMines( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
130130
void Echo( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
131131
void Stomp( NoteData &inout, StepsType st, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
132+
void JackJS(NoteData &inout, StepsType st, TimingData const& timing_data, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW);
133+
void AnchorJS(NoteData &inout, StepsType st, TimingData const& timing_data, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW);
134+
void IcyWorld(NoteData &inout, StepsType st, TimingData const& timing_data, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW);
132135
void Planted( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
133136
void Floored( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );
134137
void Twister( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW );

src/PlayerOptions.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ void PlayerOptions::GetMods( vector<RString> &AddTo, bool bForceNoteSkin ) const
270270
if( m_bTransforms[TRANSFORM_ATTACKMINES] ) AddTo.push_back( "AttackMines" );
271271
if( m_bTransforms[TRANSFORM_ECHO] ) AddTo.push_back( "Echo" );
272272
if( m_bTransforms[TRANSFORM_STOMP] ) AddTo.push_back( "Stomp" );
273+
if (m_bTransforms[TRANSFORM_JACKJS]) AddTo.push_back("JackJS");
274+
if (m_bTransforms[TRANSFORM_ANCHORJS]) AddTo.push_back("AnchorJS");
275+
if (m_bTransforms[TRANSFORM_ICYWORLD]) AddTo.push_back("IcyWorld");
273276
if( m_bTransforms[TRANSFORM_PLANTED] ) AddTo.push_back( "Planted" );
274277
if( m_bTransforms[TRANSFORM_FLOORED] ) AddTo.push_back( "Floored" );
275278
if( m_bTransforms[TRANSFORM_TWISTER] ) AddTo.push_back( "Twister" );
@@ -500,6 +503,9 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
500503
else if( sBit == "attackmines" ) m_bTransforms[TRANSFORM_ATTACKMINES] = on;
501504
else if( sBit == "echo" ) m_bTransforms[TRANSFORM_ECHO] = on;
502505
else if( sBit == "stomp" ) m_bTransforms[TRANSFORM_STOMP] = on;
506+
else if (sBit == "jackjs") m_bTransforms[TRANSFORM_JACKJS] = on;
507+
else if (sBit == "anchorjs") m_bTransforms[TRANSFORM_ANCHORJS] = on;
508+
else if (sBit == "icyworld") m_bTransforms[TRANSFORM_ICYWORLD] = on;
503509
else if( sBit == "planted" ) m_bTransforms[TRANSFORM_PLANTED] = on;
504510
else if( sBit == "floored" ) m_bTransforms[TRANSFORM_FLOORED] = on;
505511
else if( sBit == "twister" ) m_bTransforms[TRANSFORM_TWISTER] = on;
@@ -1150,6 +1156,9 @@ class LunaPlayerOptions: public Luna<PlayerOptions>
11501156
BOOL_INTERFACE(AttackMines, Transforms[PlayerOptions::TRANSFORM_ATTACKMINES]);
11511157
BOOL_INTERFACE(Echo, Transforms[PlayerOptions::TRANSFORM_ECHO]);
11521158
BOOL_INTERFACE(Stomp, Transforms[PlayerOptions::TRANSFORM_STOMP]);
1159+
BOOL_INTERFACE(JackJS, Transforms[PlayerOptions::TRANSFORM_JACKJS]);
1160+
BOOL_INTERFACE(AnchorJS, Transforms[PlayerOptions::TRANSFORM_ANCHORJS]);
1161+
BOOL_INTERFACE(IcyWorld, Transforms[PlayerOptions::TRANSFORM_ICYWORLD]);
11531162
BOOL_INTERFACE(Planted, Transforms[PlayerOptions::TRANSFORM_PLANTED]);
11541163
BOOL_INTERFACE(Floored, Transforms[PlayerOptions::TRANSFORM_FLOORED]);
11551164
BOOL_INTERFACE(Twister, Transforms[PlayerOptions::TRANSFORM_TWISTER]);
@@ -1530,6 +1539,9 @@ class LunaPlayerOptions: public Luna<PlayerOptions>
15301539
ADD_METHOD(AttackMines);
15311540
ADD_METHOD(Echo);
15321541
ADD_METHOD(Stomp);
1542+
ADD_METHOD(JackJS);
1543+
ADD_METHOD(AnchorJS);
1544+
ADD_METHOD(IcyWorld);
15331545
ADD_METHOD(Planted);
15341546
ADD_METHOD(Floored);
15351547
ADD_METHOD(Twister);

src/PlayerOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ class PlayerOptions
161161
TRANSFORM_ATTACKMINES,
162162
TRANSFORM_ECHO,
163163
TRANSFORM_STOMP,
164+
TRANSFORM_JACKJS,
165+
TRANSFORM_ANCHORJS,
166+
TRANSFORM_ICYWORLD,
164167
TRANSFORM_PLANTED,
165168
TRANSFORM_FLOORED,
166169
TRANSFORM_TWISTER,

0 commit comments

Comments
 (0)