Skip to content

Commit

Permalink
Added a score judge changer to eval screen, usage through effect up/d…
Browse files Browse the repository at this point in the history
…own, small fix to RescoreToDPJudge
  • Loading branch information
caiohsr14 committed Jan 24, 2017
1 parent 8b45309 commit 7544862
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 9 deletions.
Binary file removed Installer/install.ico
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function scoreBoard(pn,position)
end
}

local judge = GetTimingDifficulty()
local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats(pn)
local score = getScoreFromTable(getScoreList(PLAYER_1),pss:GetPersonalHighScoreIndex()+1)

Expand Down Expand Up @@ -118,6 +119,20 @@ function scoreBoard(pn,position)
self:diffuse(getGradeColor(pss:GetWifeGrade()))
self:settextf("%05.2f%% (%s)",notShit.floor(pss:GetWifeScore()*10000)/100, "Wife")
end,
CodeMessageCommand=function(self,params)
if params.Name == "PrevJudge" and judge > 1 then
judge = judge - 1
self:settextf("%05.2f%% (%s)", notShit.floor(score:RescoreToWifeJudge(judge)*10000)/100, "Wife J"..judge)
elseif params.Name == "NextJudge" and judge < 9 then
judge = judge + 1
if judge == 9 then
self:settextf("%05.2f%% (%s)", notShit.floor(score:RescoreToWifeJudge(judge)*10000)/100, "Wife Justice")
else
self:settextf("%05.2f%% (%s)", notShit.floor(score:RescoreToWifeJudge(judge)*10000)/100, "Wife J"..judge)
end

end
end,
};

-- DP percent
Expand All @@ -128,6 +143,16 @@ function scoreBoard(pn,position)
self:diffuse(getGradeColor(pss:GetGrade()))
self:settextf("%05.2f%% (%s)",GetPercentDP(score), "DP")
end,
CodeMessageCommand=function(self,params)
if params.Name == "PrevJudge" or params.Name == "NextJudge" then
if judge == 9 then
self:settextf("%05.2f%% (%s)", notShit.floor(score:RescoreToDPJudge(judge)*10000)/100, "DP Justice")
else
self:settextf("%05.2f%% (%s)", notShit.floor(score:RescoreToDPJudge(judge)*10000)/100, "DP J"..judge)
end

end
end,
}

t[#t+1] = LoadFont("Common Normal")..{
Expand All @@ -142,7 +167,13 @@ function scoreBoard(pn,position)
t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY+80+((k-1)*22);zoomto,frameWidth,18;halign,0;diffuse,byJudgment(v);diffusealpha,0.5)};
t[#t+1] = Def.Quad{
InitCommand=cmd(xy,frameX,frameY+80+((k-1)*22);zoomto,0,18;halign,0;diffuse,byJudgment(v);diffusealpha,0.5;),
BeginCommand=cmd(glowshift;effectcolor1,color("1,1,1,"..tostring(pss:GetPercentageOfTaps(v)*0.4));effectcolor2,color("1,1,1,0");sleep,0.5;decelerate,2;zoomx,frameWidth*pss:GetPercentageOfTaps(v))
BeginCommand=cmd(glowshift;effectcolor1,color("1,1,1,"..tostring(pss:GetPercentageOfTaps(v)*0.4));effectcolor2,color("1,1,1,0");sleep,0.5;decelerate,2;zoomx,frameWidth*pss:GetPercentageOfTaps(v)),
CodeMessageCommand=function(self,params)
if params.Name == "PrevJudge" or params.Name == "NextJudge" then
local rescoreJudges = score:RescoreJudges(judge)
self:zoomx(frameWidth*rescoreJudges[k]/pss:GetTotalTaps())
end
end,
};
t[#t+1] = LoadFont("Common Large")..{
InitCommand=cmd(xy,frameX+10,frameY+80+((k-1)*22);zoom,0.25;halign,0),
Expand All @@ -156,14 +187,26 @@ function scoreBoard(pn,position)
BeginCommand=cmd(queuecommand,"Set"),
SetCommand=function(self)
self:settext(pss:GetTapNoteScores(v))
end
end,
CodeMessageCommand=function(self,params)
if params.Name == "PrevJudge" or params.Name == "NextJudge" then
local rescoreJudges = score:RescoreJudges(judge)
self:settext(rescoreJudges[k])
end
end,
};
t[#t+1] = LoadFont("Common Normal")..{
InitCommand=cmd(xy,frameX+frameWidth-38,frameY+80+((k-1)*22);zoom,0.3;halign,0),
BeginCommand=cmd(queuecommand,"Set"),
SetCommand=function(self)
self:settextf("(%03.2f%%)",pss:GetPercentageOfTaps(v)*100)
end
end,
CodeMessageCommand=function(self,params)
if params.Name == "PrevJudge" or params.Name == "NextJudge" then
local rescoreJudges = score:RescoreJudges(judge)
self:settextf("(%03.2f%%)",rescoreJudges[k]/pss:GetTotalTaps()*100)
end
end,
};
end

Expand Down
5 changes: 5 additions & 0 deletions Themes/Til Death/metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,11 @@ Appearance,5="mod,stealth;name,Stealth"
Appearance,6="mod,blink;name,Blink"

[ScreenEvaluation]
# judge changer listener i guess
CodeNames="PrevJudge,NextJudge"
CodeNextJudge="EffectUp"
CodePrevJudge="EffectDown"

# banner
LargeBannerX=SCREEN_CENTER_X
LargeBannerY=88
Expand Down
34 changes: 31 additions & 3 deletions src/HighScore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct HighScoreImpl
bool bEtternaValid;
vector<float> vOffsetVector;
vector<int> vNoteRowVector;
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+]
Expand Down Expand Up @@ -183,6 +184,7 @@ HighScoreImpl::HighScoreImpl()
bEtternaValid = true;
vOffsetVector.clear();
vNoteRowVector.clear();
vRescoreJudgeVector.clear();
fSurviveSeconds = 0.f;
iMaxCombo = 0;
stageAward = StageAward_Invalid;
Expand Down Expand Up @@ -475,8 +477,9 @@ void HighScore::SetWifeScore(float f) {m_Impl->fWifeScore = f;}
void HighScore::SetMusicRate(float f) { m_Impl->fMusicRate = f; }
void HighScore::SetJudgeScale(float f) { m_Impl->fJudgeScale = f; }
void HighScore::SetEtternaValid(bool b) { m_Impl->bEtternaValid = b; }
void HighScore::SetOffsetVector(vector<float>& v) { m_Impl->vOffsetVector = v; }
void HighScore::SetNoteRowVector(vector<int>& v) { m_Impl->vNoteRowVector = v; }
void HighScore::SetOffsetVector(const vector<float>& v) { m_Impl->vOffsetVector = v; }
void HighScore::SetNoteRowVector(const vector<int>& v) { m_Impl->vNoteRowVector = v; }
void HighScore::SetRescoreJudgeVector(const vector<int>& v) { m_Impl->vRescoreJudgeVector = v; }
void HighScore::SetAliveSeconds( float f ) { m_Impl->fSurviveSeconds = f; }
void HighScore::SetModifiers( const RString &s ) { m_Impl->sModifiers = s; }
void HighScore::SetDateTime( DateTime d ) { m_Impl->dateTime = d; }
Expand Down Expand Up @@ -749,6 +752,7 @@ float HighScoreImpl::RescoreToWifeTS(float ts) {
float HighScore::RescoreToDPJudge(int x) {
const float tso[] = { 1.50f,1.33f,1.16f,1.00f,0.84f,0.66f,0.50f,0.33f,0.20f };
float ts = tso[x - 1];
vector<int> vRescoreJudgeVector;
int marv = 0;
int perf = 0;
int great = 0;
Expand All @@ -759,7 +763,7 @@ float HighScore::RescoreToDPJudge(int x) {
FOREACH_CONST(float, m_Impl->vOffsetVector, f) {
m2 += 2;
float x = abs(*f * 1000.f);
if (x <= 22.5f)
if (x <= ts * 22.5f)
++marv;
else if (x <= ts * 45.f)
++perf;
Expand All @@ -774,6 +778,13 @@ float HighScore::RescoreToDPJudge(int x) {
}

//LOG->Trace("Marv: %i Perf: %i, Great: %i, Good: %i, Boo: %i, Miss: %i", marv, perf, great, good, boo, miss);
vRescoreJudgeVector.push_back(marv);
vRescoreJudgeVector.push_back(perf);
vRescoreJudgeVector.push_back(great);
vRescoreJudgeVector.push_back(good);
vRescoreJudgeVector.push_back(boo);
vRescoreJudgeVector.push_back(miss);
SetRescoreJudgeVector(vRescoreJudgeVector);

int p = 0;
p += (marv + perf) * 2;
Expand All @@ -787,6 +798,11 @@ float HighScore::RescoreToDPJudge(int x) {
return p / m;
}

vector<int> HighScore::GetRescoreJudgeVector(int x) {
RescoreToDPJudge(x);
return m_Impl->vRescoreJudgeVector;
}

Grade HighScore::GetWifeGrade() {
if (GetGrade() == Grade_Failed)
return Grade_Failed;
Expand Down Expand Up @@ -860,6 +876,17 @@ class LunaHighScore: public Luna<HighScore>
static int GetHoldNoteScore( T* p, lua_State *L ) { lua_pushnumber(L, p->GetHoldNoteScore( Enum::Check<HoldNoteScore>(L, 1) ) ); return 1; }
static int RescoreToWifeJudge(T* p, lua_State *L) { lua_pushnumber(L, p->RescoreToWifeJudge(IArg(1))); return 1; }
static int RescoreToDPJudge(T* p, lua_State *L) { lua_pushnumber(L, p->RescoreToDPJudge(IArg(1))); return 1; }
static int RescoreJudges( T* p, lua_State *L )
{
lua_newtable(L);
for( int i = 0; i < 6; ++i )
{
lua_pushnumber(L, p->GetRescoreJudgeVector(IArg(1))[i]);
lua_rawseti( L, -2 , i+1 );
}

return 1;
}
static int GetRadarValues( T* p, lua_State *L )
{
RadarValues &rv = const_cast<RadarValues &>(p->GetRadarValues());
Expand Down Expand Up @@ -892,6 +919,7 @@ class LunaHighScore: public Luna<HighScore>
ADD_METHOD( GetWifeScore );
ADD_METHOD( RescoreToWifeJudge );
ADD_METHOD( RescoreToDPJudge );
ADD_METHOD( RescoreJudges );
ADD_METHOD( GetSkillsetSSR );
ADD_METHOD( GetMusicRate );
ADD_METHOD( GetJudgeScale );
Expand Down
7 changes: 4 additions & 3 deletions src/HighScore.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ struct HighScore
void SetMusicRate(float f);
void SetJudgeScale(float f);
void SetEtternaValid(bool b);
void SetOffsetVector(vector<float>& v);
void SetNoteRowVector(vector<int>& v);
void SetOffsetVector(const vector<float>& v);
void SetNoteRowVector(const vector<int>& v);
void SetRescoreJudgeVector(const vector<int>& v);
void SetAliveSeconds( float f );
void SetMaxCombo( unsigned int i );
void SetStageAward( StageAward a );
Expand Down Expand Up @@ -122,7 +123,7 @@ struct HighScore
float RescoreToDPJudge(int x);
float GetSkillsetSSR(Skillset ss) const;
void SetSkillsetSSR(Skillset ss, float ssr);

vector<int> GetRescoreJudgeVector(int x);
// Lua
void PushSelf( lua_State *L );
private:
Expand Down
2 changes: 2 additions & 0 deletions src/PlayerStageStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ class LunaPlayerStageStats: public Luna<PlayerStageStats>
DEFINE_METHOD( GetPeakComboAward, m_PeakComboAward )
DEFINE_METHOD( IsDisqualified, IsDisqualified() )
DEFINE_METHOD( GetAliveSeconds, m_fAliveSeconds )
DEFINE_METHOD( GetTotalTaps, GetTotalTaps() )
DEFINE_METHOD( GetPercentageOfTaps, GetPercentageOfTaps( Enum::Check<TapNoteScore>(L, 1) ) )
DEFINE_METHOD( GetBestFullComboTapNoteScore, GetBestFullComboTapNoteScore() )
DEFINE_METHOD( GetFailed, m_bFailed )
Expand Down Expand Up @@ -985,6 +986,7 @@ class LunaPlayerStageStats: public Luna<PlayerStageStats>
ADD_METHOD( GetLifeRecord );
ADD_METHOD( GetAliveSeconds );
ADD_METHOD( GetPercentageOfTaps );
ADD_METHOD( GetTotalTaps );
ADD_METHOD( GetRadarActual );
ADD_METHOD( GetRadarPossible );
ADD_METHOD( GetBestFullComboTapNoteScore );
Expand Down

0 comments on commit 7544862

Please sign in to comment.