00001
00002
00003
#ifndef PLAYER_H
00004
#define PLAYER_H
00005
00006
#include "ActorFrame.h"
00007
#include "Judgment.h"
00008
#include "HoldJudgment.h"
00009
#include "Combo.h"
00010
#include "NoteDataWithScoring.h"
00011
#include "RageSound.h"
00012
#include "AttackDisplay.h"
00013
#include "NoteData.h"
00014
00015
class ScoreDisplay;
00016
class LifeMeter;
00017
class CombinedLifeMeter;
00018
class ScoreKeeper;
00019
class Inventory;
00020
class RageTimer;
00021
class NoteField;
00022
struct PlayerStageStats;
00023
00024 #define SAMPLE_COUNT 16
00025
00026 class Player:
public ActorFrame
00027 {
00028
public:
00029
Player();
00030
~Player();
00031
00032
virtual void Update(
float fDeltaTime );
00033
virtual void DrawPrimitives();
00034
00035
void Init(
00036
PlayerState* pPlayerState,
00037
PlayerStageStats* pPlayerStageStats,
00038
LifeMeter* pLM,
00039
CombinedLifeMeter* pCombinedLM,
00040
ScoreDisplay* pScoreDisplay,
00041
ScoreDisplay* pSecondaryScoreDisplay,
00042
Inventory* pInventory,
00043
ScoreKeeper* pPrimaryScoreKeeper,
00044
ScoreKeeper* pSecondaryScoreKeeper );
00045
void Load(
const NoteData& noteData );
00046
void CrossedRow(
int iNoteRow );
00047
void CrossedMineRow(
int iNoteRow );
00048
void Step(
int col,
const RageTimer &tm );
00049
void RandomizeNotes(
int iNoteRow );
00050
void FadeToFail();
00051 int GetDancingCharacterState()
const {
return m_iDCState; };
00052 void SetCharacterState(
int iDCState) {
m_iDCState = iDCState; };
00053
void ApplyWaitingTransforms();
00054
00055
static float GetMaxStepDistanceSeconds();
00056
00057
void CacheAllUsedNoteSkins(
bool bDeleteUnused );
00058
00059 NoteData m_NoteData;
00060
00061
protected:
00062
void UpdateTapNotesMissedOlderThan(
float fMissIfOlderThanThisBeat );
00063
void OnRowCompletelyJudged(
int iStepIndex );
00064
void HandleTapRowScore(
unsigned row );
00065
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
00066
void HandleAutosync(
float fNoteOffset);
00067
void DrawTapJudgments();
00068
void DrawHoldJudgments();
00069
00070
int GetClosestNoteDirectional(
int col,
int iStartRow,
int iMaxRowsAhead,
bool bAllowGraded,
bool bForward )
const;
00071
int GetClosestNote(
int col,
int iNoteRow,
int iMaxRowsAhead,
int iMaxRowsBehind,
bool bAllowGraded )
const;
00072
00073 PlayerState*
m_pPlayerState;
00074 PlayerStageStats*
m_pPlayerStageStats;
00075 float m_fNoteFieldHeight;
00076
00077 float m_fOffset[
SAMPLE_COUNT];
00078 int m_iOffsetSample;
00079
00080 NoteField*
m_pNoteField;
00081
00082 HoldJudgment m_HoldJudgment[
MAX_NOTE_TRACKS];
00083
00084 Judgment m_Judgment;
00085
00086 Combo m_Combo;
00087
00088 AttackDisplay m_AttackDisplay;
00089
00090 int m_iDCState;
00091 LifeMeter*
m_pLifeMeter;
00092 CombinedLifeMeter*
m_pCombinedLifeMeter;
00093 ScoreDisplay*
m_pScoreDisplay;
00094 ScoreDisplay*
m_pSecondaryScoreDisplay;
00095 ScoreKeeper*
m_pPrimaryScoreKeeper;
00096 ScoreKeeper*
m_pSecondaryScoreKeeper;
00097 Inventory*
m_pInventory;
00098
00099 int m_iRowLastCrossed;
00100 int m_iMineRowLastCrossed;
00101
00102 RageSound m_soundMine;
00103 RageSound m_soundAttackLaunch;
00104 RageSound m_soundAttackEnding;
00105
00106 vector<RageSound>
m_vKeysounds;
00107 };
00108
00109
#endif
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134