Files
itgmania212121/stepmania/src/Judgment.cpp
T

104 lines
3.5 KiB
C++
Raw Normal View History

2003-02-17 12:19:42 +00:00
#include "global.h"
#include "Judgment.h"
#include "RageUtil.h"
#include "GameConstantsAndTypes.h"
#include "GameState.h"
#include "ThemeManager.h"
#include "ThemeMetric.h"
static ThemeMetric<apActorCommands> TIER1_COMMAND ("Judgment","Tier1Command");
static ThemeMetric<apActorCommands> TIER2_COMMAND ("Judgment","Tier2Command");
static ThemeMetric<apActorCommands> TIER3_COMMAND ("Judgment","Tier3Command");
static ThemeMetric<apActorCommands> TIER4_COMMAND ("Judgment","Tier4Command");
static ThemeMetric<apActorCommands> TIER5_COMMAND ("Judgment","Tier5Command");
static ThemeMetric<apActorCommands> MISS_COMMAND ("Judgment","MissCommand");
2003-02-17 12:19:42 +00:00
Judgment::Judgment()
{
2005-04-28 00:13:01 +00:00
}
2005-04-28 00:13:01 +00:00
void Judgment::Load( bool bBeginner )
{
m_sprJudgment.Load( THEME->GetPathG("Judgment",bBeginner?"BeginnerLabel":"label") );
ASSERT( m_sprJudgment.GetNumStates() == 6 || m_sprJudgment.GetNumStates() == 12 );
2003-02-17 12:19:42 +00:00
m_sprJudgment.StopAnimating();
2003-03-09 00:55:49 +00:00
Reset();
2003-02-17 12:19:42 +00:00
this->AddChild( &m_sprJudgment );
}
2003-03-09 00:55:49 +00:00
void Judgment::Reset()
{
m_sprJudgment.FinishTweening();
2003-11-27 02:46:26 +00:00
m_sprJudgment.SetXY( 0, 0 );
2005-07-24 03:11:03 +00:00
m_sprJudgment.StopEffect();
m_sprJudgment.SetHidden( true );
2003-03-09 00:55:49 +00:00
}
2005-04-28 00:13:01 +00:00
void Judgment::SetJudgment( TapNoteScore score, bool bEarly )
2003-02-17 12:19:42 +00:00
{
//LOG->Trace( "Judgment::SetJudgment()" );
2003-03-09 00:55:49 +00:00
Reset();
2003-02-17 12:19:42 +00:00
m_sprJudgment.SetHidden( false );
2005-05-13 00:22:36 +00:00
int iStateMult = (m_sprJudgment.GetNumStates()==12) ? 2 : 1;
int iStateAdd = ( bEarly || ( iStateMult == 1 ) ) ? 0 : 1;
2005-04-28 00:13:01 +00:00
2003-03-09 00:55:49 +00:00
switch( score )
2003-02-17 12:19:42 +00:00
{
case TNS_Tier1:
2005-04-28 00:13:01 +00:00
m_sprJudgment.SetState( 0 * iStateMult + iStateAdd );
m_sprJudgment.RunCommands( TIER1_COMMAND );
2003-03-09 00:55:49 +00:00
break;
case TNS_Tier2:
2005-04-28 00:13:01 +00:00
m_sprJudgment.SetState( 1 * iStateMult + iStateAdd );
m_sprJudgment.RunCommands( TIER2_COMMAND );
2003-03-09 00:55:49 +00:00
break;
case TNS_Tier3:
2005-04-28 00:13:01 +00:00
m_sprJudgment.SetState( 2 * iStateMult + iStateAdd );
m_sprJudgment.RunCommands( TIER3_COMMAND );
2003-03-09 00:55:49 +00:00
break;
case TNS_Tier4:
2005-04-28 00:13:01 +00:00
m_sprJudgment.SetState( 3 * iStateMult + iStateAdd );
m_sprJudgment.RunCommands( TIER4_COMMAND );
2003-03-09 00:55:49 +00:00
break;
case TNS_Tier5:
2005-04-28 00:13:01 +00:00
m_sprJudgment.SetState( 4 * iStateMult + iStateAdd );
m_sprJudgment.RunCommands( TIER5_COMMAND );
2003-03-09 00:55:49 +00:00
break;
case TNS_Miss:
2005-04-28 00:13:01 +00:00
m_sprJudgment.SetState( 5 * iStateMult + iStateAdd );
2004-12-03 05:19:46 +00:00
m_sprJudgment.RunCommands( MISS_COMMAND );
2003-03-09 00:55:49 +00:00
break;
default:
ASSERT(0);
2003-02-17 12:19:42 +00:00
}
}
2004-06-08 00:08:04 +00:00
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/