Files
itgmania212121/stepmania/src/Player.h
T

117 lines
3.4 KiB
C++
Raw Normal View History

#ifndef PLAYER_H
#define PLAYER_H
/*
-----------------------------------------------------------------------------
2002-07-23 01:41:40 +00:00
Class: Player
2002-04-28 20:42:32 +00:00
Desc: Object that accepts pad input, knocks down ColorNotes that were stepped on,
and keeps score for the player.
2002-05-19 01:59:48 +00:00
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
2002-04-28 20:42:32 +00:00
Chris Danford
-----------------------------------------------------------------------------
*/
2001-11-03 10:52:42 +00:00
2002-06-14 22:25:22 +00:00
#include "PrefsManager.h" // for GameplayStatistics
#include "Sprite.h"
2002-01-16 10:01:32 +00:00
#include "BitmapText.h"
2001-11-03 10:52:42 +00:00
2001-12-20 12:37:38 +00:00
#include "ActorFrame.h"
2002-03-10 10:30:45 +00:00
#include "RandomSample.h"
2003-02-17 12:19:42 +00:00
#include "Judgment.h"
#include "HoldJudgment.h"
2002-02-24 01:43:11 +00:00
#include "Combo.h"
2002-06-24 22:04:31 +00:00
#include "NoteDataWithScoring.h"
2003-04-14 22:32:08 +00:00
#include "ArrowBackdrop.h"
2003-07-13 00:34:30 +00:00
#include "RageTimer.h"
2003-08-01 01:18:08 +00:00
#include "ProTimingDisplay.h"
#include "RageSound.h"
#include "DancingCharacters.h"
2003-11-26 08:25:45 +00:00
#include "AttackDisplay.h"
2003-11-27 05:23:33 +00:00
#include "NoteField.h"
2003-07-13 00:34:30 +00:00
2003-02-25 02:51:04 +00:00
class ScoreDisplay;
class LifeMeter;
2003-06-30 18:08:27 +00:00
class CombinedLifeMeter;
2003-02-25 02:51:04 +00:00
class ScoreKeeper;
class Inventory;
2001-11-29 11:05:04 +00:00
2002-10-01 01:53:56 +00:00
#define SAMPLE_COUNT 16
2001-11-29 11:05:04 +00:00
2003-04-07 21:24:14 +00:00
class PlayerMinus : public NoteDataWithScoring, public ActorFrame
2001-11-03 10:52:42 +00:00
{
public:
PlayerMinus();
~PlayerMinus();
2001-11-03 10:52:42 +00:00
2002-07-28 20:28:37 +00:00
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
2002-01-16 10:01:32 +00:00
2003-11-27 05:23:33 +00:00
void Load( PlayerNumber player_no, const NoteData* pNoteData, LifeMeter* pLM, CombinedLifeMeter* pCombinedLM, ScoreDisplay* pScoreDisplay, ScoreDisplay* pSecondaryScoreDisplay, Inventory* pInventory, ScoreKeeper* pPrimaryScoreKeeper, ScoreKeeper* pSecondaryScoreKeeper, NoteField* pNoteField );
2002-07-28 20:28:37 +00:00
void CrossedRow( int iNoteRow );
2003-07-13 00:34:30 +00:00
void Step( int col, RageTimer tm );
void RandomiseNotes( int iNoteRow );
void FadeToFail();
int GetDancingCharacterState() { return m_iDCState; };
void SetCharacterState(int iDCState) { m_iDCState = iDCState; };
protected:
void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
void OnRowCompletelyJudged( int iStepIndex );
void HandleTapRowScore( unsigned row );
2003-03-16 17:45:32 +00:00
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
2003-03-26 18:48:19 +00:00
void HandleAutosync(float fNoteOffset);
void DrawTapJudgments();
void DrawHoldJudgments();
2002-07-28 20:28:37 +00:00
2003-02-17 05:25:20 +00:00
int GetClosestNoteDirectional( int col, float fBeat, float fMaxBeatsAhead, int iDirection );
int GetClosestNote( int col, float fBeat, float fMaxBeatsAhead, float fMaxBeatsBehind );
2003-02-09 02:07:30 +00:00
2003-02-09 04:05:31 +00:00
static float GetMaxStepDistanceSeconds();
2001-12-20 12:37:38 +00:00
PlayerNumber m_PlayerNumber;
2001-12-19 01:50:57 +00:00
2002-10-01 01:53:56 +00:00
float m_fOffset[SAMPLE_COUNT];//for AutoAdjust
int m_iOffsetSample; //
2003-04-14 22:32:08 +00:00
ArrowBackdrop m_ArrowBackdrop;
2003-11-27 05:23:33 +00:00
NoteField* m_pNoteField;
2002-07-23 01:41:40 +00:00
2003-02-17 12:19:42 +00:00
HoldJudgment m_HoldJudgment[MAX_NOTE_TRACKS];
2002-10-01 01:53:56 +00:00
2003-02-17 12:19:42 +00:00
Judgment m_Judgment;
2003-08-01 01:18:08 +00:00
ProTimingDisplay m_ProTimingDisplay;
2002-07-23 01:41:40 +00:00
2002-10-01 01:53:56 +00:00
Combo m_Combo;
2002-07-23 01:41:40 +00:00
2003-11-26 08:25:45 +00:00
AttackDisplay m_AttackDisplay;
int m_iDCState;
// DancingCharacters* m_pDancingCharacters; // used to adjust the 2D anims dancing states
2002-10-01 01:53:56 +00:00
LifeMeter* m_pLifeMeter;
2003-06-30 18:08:27 +00:00
CombinedLifeMeter* m_pCombinedLifeMeter;
2003-11-26 06:40:03 +00:00
ScoreDisplay* m_pScoreDisplay;
ScoreDisplay* m_pSecondaryScoreDisplay;
2003-06-30 18:08:27 +00:00
ScoreKeeper* m_pPrimaryScoreKeeper;
ScoreKeeper* m_pSecondaryScoreKeeper;
2003-02-25 02:51:04 +00:00
Inventory* m_pInventory;
2003-04-22 04:54:04 +00:00
int m_iRowLastCrossed;
2003-11-12 05:21:51 +00:00
RageSound m_soundMine;
2003-11-20 06:50:05 +00:00
RageSound m_soundAttackLaunch;
RageSound m_soundAttackEnding;
2001-11-03 10:52:42 +00:00
};
class Player : public PlayerMinus
{
public:
2003-11-26 06:40:03 +00:00
void Load( PlayerNumber player_no, const NoteData* pNoteData, LifeMeter* pLM, CombinedLifeMeter* pCombinedLM, ScoreDisplay* pScoreDisplay, ScoreDisplay* pSecondaryScoreDisplay, Inventory* pInventory, ScoreKeeper* pPrimaryScoreKeeper, ScoreKeeper* pSecondaryScoreKeeper );
protected:
2003-11-27 05:23:33 +00:00
NoteField m_NoteField;
};
#endif