diff --git a/src/NoteData.cpp b/src/NoteData.cpp index ddf2693b9f..1c73053450 100644 --- a/src/NoteData.cpp +++ b/src/NoteData.cpp @@ -513,7 +513,7 @@ int NoteData::GetNumTapNotesNoTiming( int iStartIndex, int iEndIndex ) const { FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, r, iStartIndex, iEndIndex ) { - if(GetTapNote(t, r).type != TapNoteType_Empty) + if(GetTapNote(t, r).type != TapNoteType_Empty && GetTapNote(t, r).type != TapNoteType_Mine) { iNumNotes++; } } } diff --git a/src/Player.cpp b/src/Player.cpp index c43e7d4bae..2c1b2d588c 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -669,6 +669,7 @@ void Player::Load() m_Timing = GAMESTATE->m_pCurSteps[pn]->GetTimingData(); m_Timing->NegStopAndBPMCheck(); m_Timing->SetElapsedTimesAtAllRows(GAMESTATE->m_pCurSteps[pn]->ElapsedTimesAtAllRows); + totalwifescore = 2 * m_NoteData.GetNumTapNotesNoTiming(); /* Apply transforms. */ NoteDataUtil::TransformNoteData(m_NoteData, *m_Timing, m_pPlayerState->m_PlayerOptions.GetStage(), GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType); @@ -3120,6 +3121,15 @@ void Player::SetMineJudgment( TapNoteScore tns , int iTrack ) msg.SetParam( "FirstTrack", iTrack ); msg.SetParam( "Judgment", tns); msg.SetParam( "Type", static_cast("Mine")); + + // Ms scoring implemenation - Mina + if (tns == TNS_HitMine) + curwifescore -= 8.f; + + msg.SetParam("WifePercent", 100 * curwifescore / maxwifescore); + msg.SetParam("WifeDifferential", curwifescore - maxwifescore*0.93f); + msg.SetParam("TotalPercent", 100 * curwifescore / totalwifescore); + MESSAGEMAN->Broadcast( msg ); if( m_pPlayerStageStats && ( ( tns == TNS_AvoidMine && AVOID_MINE_INCREMENTS_COMBO ) || @@ -3131,6 +3141,12 @@ void Player::SetMineJudgment( TapNoteScore tns , int iTrack ) } } +float Player::wife2(float maxms, float avedeviation, float power, int upperbound, int lowerbound) { + float y = 1 - pow(2, -1*maxms*maxms / (avedeviation*avedeviation)); + y = pow(y, power); + return (upperbound - lowerbound)*(1 - y) + lowerbound; +} + void Player::SetJudgment( int iRow, int iTrack, const TapNote &tn, TapNoteScore tns, float fTapNoteOffset ) { if( m_bSendJudgmentAndComboMessages ) @@ -3150,6 +3166,19 @@ void Player::SetJudgment( int iRow, int iTrack, const TapNote &tn, TapNoteScore if (tns != TNS_Miss) msg.SetParam("Offset", tn.result.fTapNoteOffset * 1000); // don't send out 0 ms offsets for misses, multiply by 1000 for convenience - Mina + // Ms scoring implementation - Mina + if (tns == TNS_Miss) { + curwifescore -= 8; + } + else + { + curwifescore += wife2(tn.result.fTapNoteOffset * 1000.f, 80.f, 2.f, 2, -8); + } + maxwifescore += 2; + msg.SetParam("WifePercent", 100*curwifescore/maxwifescore); + msg.SetParam("WifeDifferential", curwifescore - maxwifescore*0.93f); + msg.SetParam("TotalPercent", 100 * curwifescore / totalwifescore); + Lua* L= LUA->Get(); lua_createtable( L, 0, m_NoteData.GetNumTracks() ); // TapNotes this row lua_createtable( L, 0, m_NoteData.GetNumTracks() ); // HoldHeads of tracks held at this row. @@ -3200,6 +3229,14 @@ void Player::SetHoldJudgment( TapNote &tn, int iTrack ) msg.SetParam( "Type", static_cast("Hold")); msg.SetParam( "Val", m_pPlayerStageStats->m_iHoldNoteScores[tn.HoldResult.hns] + 1); + // Ms scoring implemenation - Mina + if( tn.HoldResult.hns == HNS_LetGo || tn.HoldResult.hns == HNS_Missed) + curwifescore -= 6.f; + + msg.SetParam("WifePercent", 100 * curwifescore / maxwifescore); + msg.SetParam("WifeDifferential", curwifescore - maxwifescore*0.93f); + msg.SetParam("TotalPercent", 100 * curwifescore / totalwifescore); + Lua* L = LUA->Get(); tn.PushSelf(L); msg.SetParamFromStack( L, "TapNote" ); diff --git a/src/Player.h b/src/Player.h index 7db8aa9a46..3c0e2dd585 100644 --- a/src/Player.h +++ b/src/Player.h @@ -106,8 +106,6 @@ class Player: public ActorFrame void ScoreAllActiveHoldsLetGo(); void DoTapScoreNone(); - size_t nervpos = 0; // hacky way to keep track of where we are in the non-empty row vector - Mina - void Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRelease ); void FadeToFail(); @@ -134,6 +132,14 @@ class Player: public ActorFrame void SetLife(float value); bool m_inside_lua_set_life; + // Mina temp stuff + size_t nervpos = 0; // hacky way to keep track of where we are in the non-empty row vector - Mina + float wife2(float maxms, float avedeviation, float power, int upperbound, int lowerbound); + float maxwifescore = 0; + float curwifescore = 0; + int totalwifescore; + vector wifedeviance; + protected: void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat ); void UpdateJudgedRows(float fDeltaTime); diff --git a/src/Steps.cpp b/src/Steps.cpp index abc65d8eb1..93b99c5314 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -495,6 +495,35 @@ RString Steps::GenerateChartKey(HiddenPtr nd, vector& etar) k.append(to_string(et)); et = lround(etar[row] * m - fso); } + + vector> doot; + vector scoot; + int intN = 1; + float intI = 0.5f; + int intT = 0; + vector intervaltaps; + + for (size_t r = 0; r < NonEmptyRowVector.size(); r++) + { + int row = NonEmptyRowVector[r]; + if (etar[row] >= intN * intI) { + doot.push_back(scoot); + scoot.clear(); + intN += 1; + + intervaltaps.push_back(intT/intI); + intT = 0; + } + scoot.push_back(row); + for (int t = 0; t < nd->GetNumTracks(); ++t) + { + const TapNote &tn = nd->GetTapNote(t, row); + if (tn.type == TapNoteType_Tap || tn.type == TapNoteType_HoldHead) { + intT += 1; + } + + } + } //ChartKeyRecord = k; o.append("X"); // I was thinking of using "C" to indicate chart.. however.. X is cooler... - Mina