Skip to content

Commit

Permalink
kill combo awards
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Dec 5, 2018
1 parent 87a1e94 commit d3d323d
Show file tree
Hide file tree
Showing 11 changed files with 156 additions and 289 deletions.
18 changes: 1 addition & 17 deletions src/GameConstantsAndTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,23 +311,7 @@ LuaFunction(StageAwardToLocalizedString,
StageAwardToLocalizedString(Enum::Check<StageAward>(L, 1)));
LuaXType(StageAward);

// Numbers are intentionally not at the front of these strings so that the
// strings can be used as XML entity names.
// Numbers are intentionally not at the back so that "1000" and "10000" don't
// conflict when searching for theme elements.
static const char* PeakComboAwardNames[] = {
"1000", "2000", "3000", "4000", "5000",
"6000", "7000", "8000", "9000", "10000",
};
XToString(PeakComboAward);
XToLocalizedString(PeakComboAward);
StringToX(PeakComboAward);
LuaFunction(PeakComboAwardToLocalizedString,
PeakComboAwardToLocalizedString(Enum::Check<PeakComboAward>(L, 1)));
LuaXType(PeakComboAward);

void
DisplayBpms::Add(float f)
void DisplayBpms::Add( float f )
{
vfBpms.push_back(f);
}
Expand Down
25 changes: 0 additions & 25 deletions src/GameConstantsAndTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,31 +482,6 @@ StageAward
StringToStageAward(const RString& pma);
LuaDeclareType(StageAward);

/** @brief The various peak combo awards should such a combo be attained during
* play. */
enum PeakComboAward
{
PeakComboAward_1000,
PeakComboAward_2000,
PeakComboAward_3000,
PeakComboAward_4000,
PeakComboAward_5000,
PeakComboAward_6000,
PeakComboAward_7000,
PeakComboAward_8000,
PeakComboAward_9000,
PeakComboAward_10000,
NUM_PeakComboAward,
PeakComboAward_Invalid,
};
const RString&
PeakComboAwardToString(PeakComboAward pma);
const RString&
PeakComboAwardToLocalizedString(PeakComboAward pma);
PeakComboAward
StringToPeakComboAward(const RString& pma);
LuaDeclareType(PeakComboAward);

/** @brief The list of BPMs to display */
struct DisplayBpms
{
Expand Down
5 changes: 1 addition & 4 deletions src/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,17 +918,14 @@ GameState::ResetStageStatistics()
StageStats OldStats = STATSMAN->m_CurStageStats;
STATSMAN->m_CurStageStats = StageStats();

m_fOpponentHealthPercent = 1;
m_fTugLifePercentP1 = 0.5f;
FOREACH_PlayerNumber(p)
FOREACH_PlayerNumber( p )
{
m_pPlayerState[p]->m_HealthState = HealthState_Alive;
}

FOREACH_PlayerNumber(p)
{
m_vLastStageAwards[p].clear();
m_vLastPeakComboAwards[p].clear();
}

// Reset the round seed. Do this here and not in FinishStage so that players
Expand Down
7 changes: 0 additions & 7 deletions src/GameState.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,6 @@ class GameState
RageTimer m_DanceStartTime;
float m_DanceDuration;

// used in PLAY_MODE_BATTLE
float m_fOpponentHealthPercent;

// used in PLAY_MODE_RAVE
float m_fTugLifePercentP1;

PlayerNumber GetBestPlayer() const;
StageResult GetStageResult(PlayerNumber pn) const;

Expand Down Expand Up @@ -328,7 +322,6 @@ class GameState
// Award stuff
// lowest priority in front, highest priority at the back.
deque<StageAward> m_vLastStageAwards[NUM_PLAYERS];
deque<PeakComboAward> m_vLastPeakComboAwards[NUM_PLAYERS];


// PlayerState
Expand Down
109 changes: 45 additions & 64 deletions src/HighScore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ struct HighScoreImpl
vector<HoldReplayResult> vHoldReplayDataVector;
vector<float> vOnlineReplayTimestampVector;
vector<int> vRescoreJudgeVector;
unsigned int iMaxCombo; // maximum combo obtained [SM5 alpha 1a+]
StageAward stageAward; // stage award [SM5 alpha 1a+]
PeakComboAward peakComboAward; // peak combo award [SM5 alpha 1a+]
string sModifiers;
DateTime dateTime; // return value of time() for when the highscore object
// was created (immediately after achieved)
string sPlayerGuid; // who made this high score
string sMachineGuid; // where this high score was made
unsigned int iMaxCombo; // maximum combo obtained [SM5 alpha 1a+]
StageAward stageAward; // stage award [SM5 alpha 1a+]
string sModifiers;
DateTime dateTime; // return value of time() for when the highscore object was created (immediately after achieved)
string sPlayerGuid; // who made this high score
string sMachineGuid; // where this high score was made
string countryCode;
int iProductID;
int iTapNoteScores[NUM_TapNoteScore];
Expand Down Expand Up @@ -107,31 +105,28 @@ struct HighScoreImpl
bool
HighScoreImpl::operator==(const HighScoreImpl& other) const
{
#define COMPARE(x) \
if ((x) != other.x) \
return false;
COMPARE(sName);
COMPARE(grade);
COMPARE(iScore);
COMPARE(iMaxCombo);
COMPARE(stageAward);
COMPARE(peakComboAward);
COMPARE(fPercentDP);
COMPARE(fSurviveSeconds);
COMPARE(sModifiers);
COMPARE(dateTime);
COMPARE(sPlayerGuid);
COMPARE(sMachineGuid);
COMPARE(iProductID);
FOREACH_ENUM(TapNoteScore, tns)
COMPARE(iTapNoteScores[tns]);
FOREACH_ENUM(HoldNoteScore, hns)
COMPARE(iHoldNoteScores[hns]);
FOREACH_ENUM(Skillset, ss)
COMPARE(fSkillsetSSRs[ss]);
COMPARE(radarValues);
COMPARE(fLifeRemainingSeconds);
COMPARE(bDisqualified);
#define COMPARE(x) if( (x)!=other.x ) return false;
COMPARE( sName );
COMPARE( grade );
COMPARE( iScore );
COMPARE( iMaxCombo );
COMPARE( stageAward );
COMPARE( fPercentDP );
COMPARE( fSurviveSeconds );
COMPARE( sModifiers );
COMPARE( dateTime );
COMPARE( sPlayerGuid );
COMPARE( sMachineGuid );
COMPARE( iProductID );
FOREACH_ENUM( TapNoteScore, tns )
COMPARE( iTapNoteScores[tns] );
FOREACH_ENUM( HoldNoteScore, hns )
COMPARE( iHoldNoteScores[hns] );
FOREACH_ENUM( Skillset, ss)
COMPARE(fSkillsetSSRs[ss]);
COMPARE( radarValues );
COMPARE( fLifeRemainingSeconds );
COMPARE( bDisqualified );
#undef COMPARE

return true;
Expand Down Expand Up @@ -284,7 +279,6 @@ HighScoreImpl::HighScoreImpl()
fSurviveSeconds = 0.f;
iMaxCombo = 0;
stageAward = StageAward_Invalid;
peakComboAward = PeakComboAward_Invalid;
sModifiers = "";
dateTime.Init();
sPlayerGuid = "";
Expand Down Expand Up @@ -332,8 +326,7 @@ HighScoreImpl::CreateNode() const
pNode->AppendChild("SurviveSeconds", fSurviveSeconds);
pNode->AppendChild("MaxCombo", iMaxCombo);
pNode->AppendChild("StageAward", StageAwardToString(stageAward));
pNode->AppendChild("PeakComboAward",
PeakComboAwardToString(peakComboAward));

pNode->AppendChild("Modifiers", sModifiers);
pNode->AppendChild("DateTime", dateTime.GetString());
pNode->AppendChild("PlayerGuid", sPlayerGuid);
Expand Down Expand Up @@ -521,22 +514,20 @@ HighScoreImpl::LoadFromNode(const XNode* pNode)
pNode->GetChildValue("SSRCalcVersion", SSRCalcVersion);
pNode->GetChildValue("Grade", s);
grade = StringToGrade(s);
pNode->GetChildValue("Score", iScore);
pNode->GetChildValue("PercentDP", fPercentDP);
pNode->GetChildValue("WifeScore", fWifeScore);
pNode->GetChildValue("SSRNormPercent", fSSRNormPercent);
pNode->GetChildValue("Rate", fMusicRate);
pNode->GetChildValue("JudgeScale", fJudgeScale);
pNode->GetChildValue("NoChordCohesion", bNoChordCohesion);
pNode->GetChildValue("EtternaValid", bEtternaValid);
pNode->GetChildValue("SurviveSeconds", fSurviveSeconds);
pNode->GetChildValue("MaxCombo", iMaxCombo);
pNode->GetChildValue("StageAward", s);
stageAward = StringToStageAward(s);
pNode->GetChildValue("PeakComboAward", s);
peakComboAward = StringToPeakComboAward(s);
pNode->GetChildValue("Modifiers", s);
sModifiers = s;
pNode->GetChildValue("Score", iScore);
pNode->GetChildValue("PercentDP", fPercentDP);
pNode->GetChildValue("WifeScore", fWifeScore);
pNode->GetChildValue("SSRNormPercent", fSSRNormPercent);
pNode->GetChildValue("Rate", fMusicRate);
pNode->GetChildValue("JudgeScale", fJudgeScale);
pNode->GetChildValue("NoChordCohesion", bNoChordCohesion);
pNode->GetChildValue("EtternaValid", bEtternaValid);
pNode->GetChildValue("Offsets", s); vOffsetVector = OffsetsToVector(s);
pNode->GetChildValue("NoteRows", s); vNoteRowVector = NoteRowsToVector(s);
pNode->GetChildValue("SurviveSeconds", fSurviveSeconds);
pNode->GetChildValue("MaxCombo", iMaxCombo);
pNode->GetChildValue("StageAward", s); stageAward = StringToStageAward(s);
pNode->GetChildValue("Modifiers", s); sModifiers = s;
if (fMusicRate == 0.f) {
size_t ew = sModifiers.find("xMusic");
size_t dew = string::npos;
Expand Down Expand Up @@ -1029,11 +1020,7 @@ HighScore::GetStageAward() const
{
return m_Impl->stageAward;
}
PeakComboAward
HighScore::GetPeakComboAward() const
{
return m_Impl->peakComboAward;
}

float
HighScore::GetPercentDP() const
{
Expand Down Expand Up @@ -1256,11 +1243,7 @@ HighScore::SetStageAward(StageAward a)
{
m_Impl->stageAward = a;
}
void
HighScore::SetPeakComboAward(PeakComboAward a)
{
m_Impl->peakComboAward = a;
}

void
HighScore::SetPercentDP(float f)
{
Expand Down Expand Up @@ -2117,7 +2100,6 @@ class LunaHighScore : public Luna<HighScore>
DEFINE_METHOD(GetWifeGrade, GetWifeGrade())
DEFINE_METHOD(ConvertDpToWife, ConvertDpToWife())
DEFINE_METHOD(GetStageAward, GetStageAward())
DEFINE_METHOD(GetPeakComboAward, GetPeakComboAward())
DEFINE_METHOD(GetChordCohesion, GetChordCohesion())
DEFINE_METHOD(GetEtternaValid, GetEtternaValid())
DEFINE_METHOD(HasReplayData, HasReplayData())
Expand Down Expand Up @@ -2151,7 +2133,6 @@ class LunaHighScore : public Luna<HighScore>
ADD_METHOD(GetWifeGrade);
ADD_METHOD(GetMaxCombo);
ADD_METHOD(GetStageAward);
ADD_METHOD(GetPeakComboAward);
ADD_METHOD(ToggleEtternaValidation);
ADD_METHOD(GetEtternaValid);
ADD_METHOD(HasReplayData);
Expand Down
30 changes: 14 additions & 16 deletions src/HighScore.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ struct HighScore
float GetSurvivalSeconds() const;
unsigned int GetMaxCombo() const;
StageAward GetStageAward() const;
PeakComboAward GetPeakComboAward() const;
/**
* @brief Get the modifiers used for this run.
* @return the modifiers. */
Expand Down Expand Up @@ -119,21 +118,20 @@ struct HighScore
void SetOnlineReplayTimestampVector(const vector<float>& v);
void SetScoreKey(const string& ck);
void SetRescoreJudgeVector(const vector<int>& v);
void SetAliveSeconds(float f);
void SetMaxCombo(unsigned int i);
void SetStageAward(StageAward a);
void SetPeakComboAward(PeakComboAward a);
void SetModifiers(const string& s);
void SetDateTime(DateTime d);
void SetPlayerGuid(const string& s);
void SetMachineGuid(const string& s);
void SetProductID(int i);
void SetTapNoteScore(TapNoteScore tns, int i);
void SetHoldNoteScore(HoldNoteScore tns, int i);
void SetRadarValues(const RadarValues& rv);
void SetLifeRemainingSeconds(float f);
void SetDisqualified(bool b);
void SetReplayType(int i);
void SetAliveSeconds( float f );
void SetMaxCombo( unsigned int i );
void SetStageAward( StageAward a );
void SetModifiers( const string &s );
void SetDateTime( DateTime d );
void SetPlayerGuid( const string &s );
void SetMachineGuid( const string &s );
void SetProductID( int i );
void SetTapNoteScore( TapNoteScore tns, int i );
void SetHoldNoteScore( HoldNoteScore tns, int i );
void SetRadarValues( const RadarValues &rv );
void SetLifeRemainingSeconds( float f );
void SetDisqualified( bool b );
void SetReplayType( int i );

string* GetNameMutable();
const string* GetNameMutable() const
Expand Down
Loading

0 comments on commit d3d323d

Please sign in to comment.