change hold explosion format
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -26,18 +26,18 @@ GhostArrow::GhostArrow()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GhostArrow::Load( CString sNoteSkin, CString sButton, CString sFile, bool bLoadJustOne )
|
void GhostArrow::Load( CString sNoteSkin, CString sButton, CString sElement, bool bLoadJustOne )
|
||||||
{
|
{
|
||||||
for( int i=0; i<NUM_TAP_NOTE_SCORES; i++ )
|
for( int i=0; i<NUM_TAP_NOTE_SCORES; i++ )
|
||||||
{
|
{
|
||||||
CString sJudge = TapNoteScoreToString( (TapNoteScore)i );
|
CString sJudge = TapNoteScoreToString( (TapNoteScore)i );
|
||||||
|
|
||||||
CString sFullFile = bLoadJustOne ? sFile : sFile + " " + sJudge;
|
CString sFullElement = bLoadJustOne ? sElement : sElement + " " + sJudge;
|
||||||
|
|
||||||
// HACK: for backward noteskin compatibility
|
// HACK: for backward noteskin compatibility
|
||||||
CString sPath = NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sFullFile, true); // optional
|
CString sPath = NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sFullElement, true); // optional
|
||||||
if( sPath.empty() )
|
if( sPath.empty() )
|
||||||
sPath = NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sFile); // not optional
|
sPath = NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sElement); // not optional
|
||||||
m_spr[i].Load( sPath );
|
m_spr[i].Load( sPath );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ void GhostArrowRow::Load( PlayerNumber pn, CString NoteSkin, float fYReverseOffs
|
|||||||
m_GhostDim[c].Load( NoteSkin, Button, "tap explosion dim", false);
|
m_GhostDim[c].Load( NoteSkin, Button, "tap explosion dim", false);
|
||||||
m_GhostBright[c].Load( NoteSkin, Button, "tap explosion bright", false );
|
m_GhostBright[c].Load( NoteSkin, Button, "tap explosion bright", false );
|
||||||
m_GhostMine[c].Load( NoteSkin, Button, "tap explosion mine", true );
|
m_GhostMine[c].Load( NoteSkin, Button, "tap explosion mine", true );
|
||||||
m_HoldGhost[c].Load( NOTESKIN->GetPathToFromNoteSkinAndButton(NoteSkin, Button, "hold explosion") );
|
m_HoldGhost[c].Load( NoteSkin, Button, "hold explosion" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,10 +115,10 @@ void GhostArrowRow::DidTapNote( int iCol, TapNoteScore score, bool bBright )
|
|||||||
m_GhostDim[iCol].Step( score );
|
m_GhostDim[iCol].Step( score );
|
||||||
}
|
}
|
||||||
|
|
||||||
void GhostArrowRow::DidHoldNote( int iCol )
|
void GhostArrowRow::SetHoldIsActive( int iCol )
|
||||||
{
|
{
|
||||||
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
||||||
m_HoldGhost[iCol].Step();
|
m_HoldGhost[iCol].SetHoldIsActive( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void GhostArrowRow::DidTapMine( int iCol, TapNoteScore score )
|
void GhostArrowRow::DidTapMine( int iCol, TapNoteScore score )
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
|
|
||||||
void DidTapNote( int iCol, TapNoteScore score, bool bBright );
|
void DidTapNote( int iCol, TapNoteScore score, bool bBright );
|
||||||
void DidTapMine( int iCol, TapNoteScore score );
|
void DidTapMine( int iCol, TapNoteScore score );
|
||||||
void DidHoldNote( int iCol );
|
void SetHoldIsActive( int iCol );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_iNumCols;
|
int m_iNumCols;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Class: HoldGhostArrow
|
Class: HoldGhostArrow
|
||||||
|
|
||||||
Desc: A graphic displayed in the HoldJudgment during Dancing.
|
Desc: See header
|
||||||
|
|
||||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
Ben Nordstrom
|
Ben Nordstrom
|
||||||
@@ -15,57 +15,32 @@
|
|||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "RageException.h"
|
#include "RageException.h"
|
||||||
#include "RageTimer.h"
|
#include "RageTimer.h"
|
||||||
#include <math.h>
|
#include "NoteSkinManager.h"
|
||||||
#include "ThemeManager.h"
|
#include "GameState.h"
|
||||||
|
|
||||||
|
|
||||||
CachedThemeMetricF WARM_UP_SECONDS ("HoldGhostArrow","WarmUpSeconds");
|
|
||||||
|
|
||||||
|
|
||||||
HoldGhostArrow::HoldGhostArrow()
|
HoldGhostArrow::HoldGhostArrow()
|
||||||
{
|
{
|
||||||
WARM_UP_SECONDS.Refresh();
|
m_bHoldIsActive = false;
|
||||||
|
}
|
||||||
|
|
||||||
m_bWasSteppedOnLastFrame = false;
|
void HoldGhostArrow::Load( CString sNoteSkin, CString sButton, CString sElement )
|
||||||
m_fHeatLevel = 0;
|
{
|
||||||
|
Sprite::Load( NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sElement) ); // not optional
|
||||||
// LoadFromSpriteFile( THEME->GetPathTo(GRAPHIC_HOLD_GHOST_ARROW) );
|
m_sOnCommand = NOTESKIN->GetMetric(sNoteSkin,"HoldGhostArrow","OnCommand");
|
||||||
SetDiffuse( RageColor(1,1,1,1) );
|
this->Command( m_sOnCommand );
|
||||||
}
|
}
|
||||||
|
|
||||||
void HoldGhostArrow::Update( float fDeltaTime )
|
void HoldGhostArrow::Update( float fDeltaTime )
|
||||||
{
|
{
|
||||||
Sprite::Update( fDeltaTime );
|
Sprite::Update( fDeltaTime );
|
||||||
|
|
||||||
if( m_bWasSteppedOnLastFrame )
|
m_bHoldIsActive = false;
|
||||||
m_fHeatLevel += fDeltaTime/(float)WARM_UP_SECONDS;
|
|
||||||
else
|
|
||||||
m_fHeatLevel -= fDeltaTime/(float)WARM_UP_SECONDS;
|
|
||||||
|
|
||||||
CLAMP( m_fHeatLevel, 0, 1 );
|
|
||||||
|
|
||||||
int iStateNum = (int)min( m_fHeatLevel * GetNumStates(), GetNumStates()-1 );
|
|
||||||
SetState( iStateNum );
|
|
||||||
|
|
||||||
if( m_fHeatLevel == 1 )
|
|
||||||
{
|
|
||||||
bool bZooomALittle = fmodf( RageTimer::GetTimeSinceStart(), 1/20.0f ) > 1/40.0f;
|
|
||||||
SetZoom( bZooomALittle ? 1.04f : 1.0f );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SetZoom( 1 );
|
|
||||||
|
|
||||||
SetDiffuse( RageColor(1,1,1,m_fHeatLevel*3) );
|
|
||||||
|
|
||||||
m_bWasSteppedOnLastFrame = false; // reset for next frame
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HoldGhostArrow::DrawPrimitives()
|
void HoldGhostArrow::DrawPrimitives()
|
||||||
{
|
{
|
||||||
|
if( !m_bHoldIsActive )
|
||||||
|
return;
|
||||||
|
|
||||||
Sprite::DrawPrimitives();
|
Sprite::DrawPrimitives();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HoldGhostArrow::Step()
|
|
||||||
{
|
|
||||||
m_bWasSteppedOnLastFrame = true;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Class: HoldGhostArrow
|
Class: HoldGhostArrow
|
||||||
|
|
||||||
Desc: The "electricity around the stationary arrow as it's pressing a HoldNote.
|
Desc: The graphic shown while holding a HoldNote.
|
||||||
|
|
||||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
Ben Nordstrom
|
Ben Nordstrom
|
||||||
@@ -13,19 +13,22 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
class HoldGhostArrow : public Sprite
|
class HoldGhostArrow : public Sprite
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HoldGhostArrow();
|
HoldGhostArrow();
|
||||||
|
|
||||||
|
virtual void Load( CString sNoteSkin, CString sButton, CString sElement );
|
||||||
|
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
void Step();
|
void SetHoldIsActive( bool bHoldIsActive ) { m_bHoldIsActive = bHoldIsActive; }
|
||||||
|
|
||||||
bool m_bWasSteppedOnLastFrame;
|
bool m_bHoldIsActive;
|
||||||
float m_fHeatLevel; // brightness - between 0 and 1
|
CString m_sOnCommand;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ void NoteField::Load( const NoteData* pNoteData, PlayerNumber pn, int iFirstPixe
|
|||||||
NoteDataWithScoring::Init();
|
NoteDataWithScoring::Init();
|
||||||
|
|
||||||
m_HeldHoldNotes.clear();
|
m_HeldHoldNotes.clear();
|
||||||
|
m_ActiveHoldNotes.clear();
|
||||||
|
|
||||||
this->CopyAll( pNoteData );
|
this->CopyAll( pNoteData );
|
||||||
ASSERT( GetNumTracks() == GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer );
|
ASSERT( GetNumTracks() == GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer );
|
||||||
@@ -519,6 +520,11 @@ void NoteField::DrawPrimitives()
|
|||||||
const HoldNoteScore hns = GetHoldNoteScore( hn );
|
const HoldNoteScore hns = GetHoldNoteScore( hn );
|
||||||
const float fLife = GetHoldNoteLife( hn );
|
const float fLife = GetHoldNoteLife( hn );
|
||||||
const bool bIsHoldingNote = m_HeldHoldNotes[hn];
|
const bool bIsHoldingNote = m_HeldHoldNotes[hn];
|
||||||
|
const bool bIsActive = m_ActiveHoldNotes[hn];
|
||||||
|
|
||||||
|
if( bIsActive )
|
||||||
|
SearchForSongBeat()->m_GhostArrowRow.SetHoldIsActive( hn.iTrack );
|
||||||
|
|
||||||
|
|
||||||
if( hns == HNS_OK ) // if this HoldNote was completed
|
if( hns == HNS_OK ) // if this HoldNote was completed
|
||||||
continue; // don't draw anything
|
continue; // don't draw anything
|
||||||
@@ -628,5 +634,5 @@ void NoteField::FadeToFail()
|
|||||||
void NoteField::Step( int iCol ) { SearchForSongBeat()->m_ReceptorArrowRow.Step( iCol ); }
|
void NoteField::Step( int iCol ) { SearchForSongBeat()->m_ReceptorArrowRow.Step( iCol ); }
|
||||||
void NoteField::SetPressed( int iCol ) { SearchForSongBeat()->m_ReceptorArrowRow.SetPressed( iCol ); }
|
void NoteField::SetPressed( int iCol ) { SearchForSongBeat()->m_ReceptorArrowRow.SetPressed( iCol ); }
|
||||||
void NoteField::DidTapNote( int iCol, TapNoteScore score, bool bBright ) { SearchForSongBeat()->m_GhostArrowRow.DidTapNote( iCol, score, bBright ); }
|
void NoteField::DidTapNote( int iCol, TapNoteScore score, bool bBright ) { SearchForSongBeat()->m_GhostArrowRow.DidTapNote( iCol, score, bBright ); }
|
||||||
void NoteField::DidHoldNote( int iCol ) { SearchForSongBeat()->m_GhostArrowRow.DidHoldNote( iCol ); }
|
void NoteField::DidHoldNote( int iCol ) { /*SearchForSongBeat()->m_GhostArrowRow.DidHoldNote( iCol );*/ }
|
||||||
void NoteField::DidTapMine( int iCol, TapNoteScore score ) { SearchForSongBeat()->m_GhostArrowRow.DidTapMine( iCol, score ); }
|
void NoteField::DidTapMine( int iCol, TapNoteScore score ) { SearchForSongBeat()->m_GhostArrowRow.DidTapMine( iCol, score ); }
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ public:
|
|||||||
virtual void Unload();
|
virtual void Unload();
|
||||||
void RemoveTapNoteRow( int iIndex );
|
void RemoveTapNoteRow( int iIndex );
|
||||||
|
|
||||||
map<RowTrack,bool> m_HeldHoldNotes; // hack: Need this to know when to "light up" the center of hold notes
|
map<RowTrack,bool> m_HeldHoldNotes; // true if button is being held down
|
||||||
|
map<RowTrack,bool> m_ActiveHoldNotes; // true if hold has life > 0
|
||||||
|
|
||||||
float m_fBeginMarker, m_fEndMarker; // only used with MODE_EDIT
|
float m_fBeginMarker, m_fEndMarker; // only used with MODE_EDIT
|
||||||
|
|
||||||
|
|||||||
@@ -288,6 +288,7 @@ void PlayerMinus::Update( float fDeltaTime )
|
|||||||
HoldNoteScore hns = GetHoldNoteScore(hn);
|
HoldNoteScore hns = GetHoldNoteScore(hn);
|
||||||
|
|
||||||
m_pNoteField->m_HeldHoldNotes[hn] = false; // set hold flag so NoteField can do intelligent drawing
|
m_pNoteField->m_HeldHoldNotes[hn] = false; // set hold flag so NoteField can do intelligent drawing
|
||||||
|
m_pNoteField->m_ActiveHoldNotes[hn] = false; // set hold flag so NoteField can do intelligent drawing
|
||||||
|
|
||||||
|
|
||||||
if( hns != HNS_NONE ) // if this HoldNote already has a result
|
if( hns != HNS_NONE ) // if this HoldNote already has a result
|
||||||
@@ -315,6 +316,7 @@ void PlayerMinus::Update( float fDeltaTime )
|
|||||||
|
|
||||||
// set hold flag so NoteField can do intelligent drawing
|
// set hold flag so NoteField can do intelligent drawing
|
||||||
m_pNoteField->m_HeldHoldNotes[hn] = bIsHoldingButton && bSteppedOnTapNote;
|
m_pNoteField->m_HeldHoldNotes[hn] = bIsHoldingButton && bSteppedOnTapNote;
|
||||||
|
m_pNoteField->m_ActiveHoldNotes[hn] = bSteppedOnTapNote;
|
||||||
|
|
||||||
if( bSteppedOnTapNote ) // this note is not judged and we stepped on its head
|
if( bSteppedOnTapNote ) // this note is not judged and we stepped on its head
|
||||||
{
|
{
|
||||||
@@ -324,6 +326,7 @@ void PlayerMinus::Update( float fDeltaTime )
|
|||||||
fhn.iStartRow = min( iSongRow, fhn.iEndRow );
|
fhn.iStartRow = min( iSongRow, fhn.iEndRow );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( bSteppedOnTapNote && bIsHoldingButton )
|
if( bSteppedOnTapNote && bIsHoldingButton )
|
||||||
{
|
{
|
||||||
// Increase life
|
// Increase life
|
||||||
|
|||||||
Reference in New Issue
Block a user