4#include "Etterna/Actor/Base/ActorFrame.h"
5#include "Etterna/Actor/Base/AutoActor.h"
6#include "Etterna/Screen/Others/ScreenMessage.h"
7#include "RageUtil/Sound/RageSound.h"
8#include "Etterna/Models/NoteData/NoteData.h"
9#include "Etterna/Models/Misc/TimingData.h"
24AutoScreenMessage(SM_100Combo);
25AutoScreenMessage(SM_200Combo);
26AutoScreenMessage(SM_300Combo);
27AutoScreenMessage(SM_400Combo);
28AutoScreenMessage(SM_500Combo);
29AutoScreenMessage(SM_600Combo);
30AutoScreenMessage(SM_700Combo);
31AutoScreenMessage(SM_800Combo);
32AutoScreenMessage(SM_900Combo);
33AutoScreenMessage(SM_1000Combo);
34AutoScreenMessage(SM_ComboStopped);
35AutoScreenMessage(SM_ComboContinuing);
37constexpr float initialHoldLife = 1.F;
48 void Update(
float fDeltaTime)
override;
55 static void PushPlayerMatrix(
float x,
float skew,
float center_y);
56 static void PopPlayerMatrix();
59 void DrawNoteFieldBoard();
86 virtual void UpdateHoldNotes(
int iSongRow,
88 std::vector<TrackRowTapNote>& vTN);
90 virtual void Init(
const std::string& sType,
96 virtual void Reload();
97 virtual void CrossedRows(
int iLastRowCrossed,
98 const std::chrono::steady_clock::time_point& now);
106 void ScoreAllActiveHoldsLetGo();
107 void DoTapScoreNone();
108 void AddHoldToReplayData(
int col,
110 int RowOfOverlappingNoteOrRow)
const;
111 void AddNoteToReplayData(
int col,
113 int RowOfOverlappingNoteOrRow)
const;
114 void AddMineToReplayData(
int col,
int row)
const;
116 virtual void Step(
int col,
118 const std::chrono::steady_clock::time_point& tm,
121 float padStickSeconds = 0.0F);
124 void CacheAllUsedNoteSkins()
const;
125 auto GetLastTapNoteScore() const -> TapNoteScore
127 return m_LastTapNoteScore;
129 void SetPaused(
bool bPaused) { m_bPaused = bPaused; }
131 static auto GetMaxStepDistanceSeconds() -> float;
132 static auto GetWindowSeconds(TimingWindow tw) -> float;
133 static auto GetWindowSecondsCustomScale(TimingWindow tw,
134 float timingScale = 1.F) -> float;
135 static auto GetTimingWindowScale() -> float;
136 auto GetNoteData() const -> const
NoteData& {
return m_NoteData; }
137 auto HasVisibleParts() const ->
bool {
return m_pNoteField !=
nullptr; }
139 void SetSendJudgmentAndComboMessages(
bool b)
141 m_bSendJudgmentAndComboMessages = b;
143 void RenderAllNotesIgnoreScores();
146 void PushSelf(lua_State* L)
override;
149 void ChangeLife(
float delta)
const;
150 void SetLife(
float value)
const;
151 bool m_inside_lua_set_life;
154 std::vector<int> nerv;
156 float maxwifescore = 0.F;
157 float curwifescore = 0.F;
158 float wifescorepersonalbest = 0.F;
164 virtual void UpdateTapNotesMissedOlderThan(
float fMissIfOlderThanSeconds);
165 void UpdateJudgedRows(
float fDeltaTime);
167 void UpdateVisibleParts();
170 virtual void UpdatePressedFlags();
175 virtual void UpdateHoldsAndRolls(
177 const std::chrono::steady_clock::time_point& now);
184 void UpdateCrossedRows(
const std::chrono::steady_clock::time_point& now);
185 void FlashGhostRow(
int iRow);
186 virtual void HandleTapRowScore(
unsigned row);
187 void HandleHoldScore(
const TapNote& tn)
const;
188 void HandleHoldCheckpoint(
int iRow,
189 int iNumHoldsHeldThisRow,
190 int iNumHoldsMissedThisRow,
191 const std::vector<int>& viColsWithHold);
192 void DrawTapJudgments();
193 void DrawHoldJudgments();
194 void SendComboMessages(
unsigned int iOldCombo,
195 unsigned int iOldMissCombo)
const;
196 void PlayKeysound(
const TapNote& tn, TapNoteScore score);
198 void SetMineJudgment(TapNoteScore tns,
int iTrack,
int iRow);
199 void SetJudgment(
int iRow,
int iFirstTrack,
const TapNote& tn)
204 void SetJudgment(
int iRow,
208 float fTapNoteOffset);
209 void SetHoldJudgment(
TapNote& tn,
int iTrack,
int iRow);
210 void SetCombo(
unsigned int iCombo,
unsigned int iMisses);
211 void IncrementComboOrMissCombo(
bool bComboOrMissCombo);
212 void IncrementCombo() { IncrementComboOrMissCombo(
true); };
213 void IncrementMissCombo() { IncrementComboOrMissCombo(
false); };
215 void ChangeLife(TapNoteScore tns)
const;
216 void ChangeLife(HoldNoteScore hns, TapNoteScore tns)
const;
217 void ChangeLifeRecord()
const;
219 void ChangeWifeRecord()
const;
221 auto GetClosestNoteDirectional(
int col,
225 bool bForward)
const -> int;
226 auto GetClosestNote(
int col,
231 bool bUseSongTiming =
true,
232 bool bAllowOldMines =
true) const ->
int;
233 auto GetClosestNonEmptyRowDirectional(
int iStartRow,
236 bool bForward) const ->
int;
237 auto GetClosestNonEmptyRow(
int iNoteRow,
240 bool bAllowGraded) const ->
int;
242 void HideNote(
int col,
int row)
const
244 const auto iter = m_NoteData.FindTapNote(col, row);
245 if (iter != m_NoteData.end(col)) {
246 iter->second.result.bHidden =
true;
257 float m_fNoteFieldHeight;
259 std::vector<float> lastHoldHeadsSeconds;
266 Replay* pbReplay =
nullptr;
268 std::vector<HoldJudgment*> m_vpHoldJudgment;
273 TapNoteScore m_LastTapNoteScore;
277 int m_iFirstUncrossedRow;
283 unsigned int m_iLastSeenCombo;
284 bool m_bSeenComboYet;
289 std::vector<RageSound> m_vKeysounds;
291 bool m_bSendJudgmentAndComboMessages;
294 bool m_drawing_notefield_board;
303 std::vector<bool> m_vRows;
306 void Resize(
size_t iMin);
311 auto JudgeRow(
int iRow) ->
bool
313 if (iRow < m_iStart) {
316 if (iRow >= m_iStart +
static_cast<int>(m_vRows.size())) {
317 Resize(iRow + 1 - m_iStart);
319 const int iIndex = (iRow - m_iStart + m_iOffset) % m_vRows.size();
320 const bool ret = m_vRows[iIndex];
321 m_vRows[iIndex] =
true;
322 while (m_vRows[m_iOffset]) {
323 m_vRows[m_iOffset] =
false;
325 if (++m_iOffset >=
static_cast<int>(m_vRows.size())) {
326 m_iOffset -= m_vRows.size();
331 void Reset(
int iStart)
335 m_vRows.assign(m_vRows.size(),
false);
A container for other Actors.
Definition ActorFrame.h:8
A smart pointer for Actor.
Definition AutoActor.h:13
Definition HoldJudgment.h:10
Helper class to ensure that each row is only judged once without taking too much memory.
Definition Player.h:302
The player's life.
Definition LifeMeter.h:13
Definition NoteData.h:107
Holds data about the notes that the player is supposed to hit.
Definition NoteData.h:43
An Actor that renders NoteData.
Definition NoteField.h:15
Contains statistics for one stage of play - either one song, or a whole course.
Definition PlayerStageStats.h:19
The player's indivdual state.
Definition PlayerState.h:30
Accepts input, knocks down TapNotes that were stepped on, and keeps score for the player.
Definition Player.h:42
PlayerState * m_pPlayerState
The player's present state.
Definition Player.h:253
PlayerStageStats * m_pPlayerStageStats
The player's present stage stats.
Definition Player.h:255
static auto NeedsHoldJudging(const TapNote &tn) -> bool
Determine if a TapNote needs a hold note style judgment.
Definition Player.cpp:484
void DrawPrimitives() override
Draw the primitives of the Actor.
Definition Player.cpp:1338
static auto NeedsTapJudging(const TapNote &tn) -> bool
Determine if a TapNote needs a tap note style judgment.
Definition Player.cpp:462
auto GetPlayerTimingData() const -> TimingData
Retrieve the Player's TimingData.
Definition Player.h:104
Definition RageSound.h:130
Abstract class to handle scorekeeping, stat-taking, etc.
Definition ScoreKeeper.h:20
Holds data for translating beats<->seconds.
Definition TimingData.h:54
float fTapNoteOffset
Offset, in seconds, for a tap grade.
Definition NoteTypes.h:27
TapNoteScore tns
The TapNoteScore that was achieved by the player.
Definition NoteTypes.h:19
The various properties of a tap note.
Definition NoteTypes.h:149
TapNoteResult result
The result of hitting or missing the TapNote.
Definition NoteTypes.h:158