Files
itgmania212121/stepmania/src/Judgment.cpp
T

122 lines
4.6 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 "PrefsManager.h"
#include "GameState.h"
#include "ThemeManager.h"
#include "ThemeMetric.h"
2005-01-26 11:21:43 +00:00
static ThemeMetric<apActorCommands> MARVELOUS_COMMAND ("Judgment","MarvelousCommand");
static ThemeMetric<apActorCommands> PERFECT_COMMAND ("Judgment","PerfectCommand");
static ThemeMetric<apActorCommands> GREAT_COMMAND ("Judgment","GreatCommand");
static ThemeMetric<apActorCommands> GOOD_COMMAND ("Judgment","GoodCommand");
static ThemeMetric<apActorCommands> BOO_COMMAND ("Judgment","BooCommand");
static ThemeMetric<apActorCommands> MISS_COMMAND ("Judgment","MissCommand");
2005-01-26 11:21:43 +00:00
static ThemeMetric<apActorCommands> MARVELOUS_ODD_COMMAND ("Judgment","MarvelousOddCommand");
static ThemeMetric<apActorCommands> PERFECT_ODD_COMMAND ("Judgment","PerfectOddCommand");
static ThemeMetric<apActorCommands> GREAT_ODD_COMMAND ("Judgment","GreatOddCommand");
static ThemeMetric<apActorCommands> GOOD_ODD_COMMAND ("Judgment","GoodOddCommand");
static ThemeMetric<apActorCommands> BOO_ODD_COMMAND ("Judgment","BooOddCommand");
static ThemeMetric<apActorCommands> MISS_ODD_COMMAND ("Judgment","MissOddCommand");
2005-01-26 11:21:43 +00:00
static ThemeMetric<apActorCommands> MARVELOUS_EVEN_COMMAND ("Judgment","MarvelousEvenCommand");
static ThemeMetric<apActorCommands> PERFECT_EVEN_COMMAND ("Judgment","PerfectEvenCommand");
static ThemeMetric<apActorCommands> GREAT_EVEN_COMMAND ("Judgment","GreatEvenCommand");
static ThemeMetric<apActorCommands> GOOD_EVEN_COMMAND ("Judgment","GoodEvenCommand");
static ThemeMetric<apActorCommands> BOO_EVEN_COMMAND ("Judgment","BooEvenCommand");
static ThemeMetric<apActorCommands> MISS_EVEN_COMMAND ("Judgment","MissEvenCommand");
2003-02-17 12:19:42 +00:00
Judgment::Judgment()
{
m_iCount = 0;
m_sprJudgment.Load( THEME->GetPathToG("Judgment 1x6") );
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 );
2003-03-09 00:55:49 +00:00
m_sprJudgment.SetEffectNone();
m_sprJudgment.SetHidden( true );
2003-03-09 00:55:49 +00:00
}
2003-02-17 12:19:42 +00:00
void Judgment::SetJudgment( TapNoteScore score )
{
//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 );
2003-03-09 00:55:49 +00:00
switch( score )
2003-02-17 12:19:42 +00:00
{
2003-03-09 00:55:49 +00:00
case TNS_MARVELOUS:
m_sprJudgment.SetState( 0 );
2004-12-03 05:19:46 +00:00
m_sprJudgment.RunCommands( (m_iCount%2) ? MARVELOUS_ODD_COMMAND : MARVELOUS_EVEN_COMMAND );
m_sprJudgment.RunCommands( MARVELOUS_COMMAND );
2003-03-09 00:55:49 +00:00
break;
case TNS_PERFECT:
m_sprJudgment.SetState( 1 );
2004-12-03 05:19:46 +00:00
m_sprJudgment.RunCommands( (m_iCount%2) ? PERFECT_ODD_COMMAND : PERFECT_EVEN_COMMAND );
m_sprJudgment.RunCommands( PERFECT_COMMAND );
2003-03-09 00:55:49 +00:00
break;
case TNS_GREAT:
m_sprJudgment.SetState( 2 );
2004-12-03 05:19:46 +00:00
m_sprJudgment.RunCommands( (m_iCount%2) ? GREAT_ODD_COMMAND : GREAT_EVEN_COMMAND );
m_sprJudgment.RunCommands( GREAT_COMMAND );
2003-03-09 00:55:49 +00:00
break;
case TNS_GOOD:
m_sprJudgment.SetState( 3 );
2004-12-03 05:19:46 +00:00
m_sprJudgment.RunCommands( (m_iCount%2) ? GOOD_ODD_COMMAND : GOOD_EVEN_COMMAND );
m_sprJudgment.RunCommands( GOOD_COMMAND );
2003-03-09 00:55:49 +00:00
break;
case TNS_BOO:
m_sprJudgment.SetState( 4 );
2004-12-03 05:19:46 +00:00
m_sprJudgment.RunCommands( (m_iCount%2) ? BOO_ODD_COMMAND : BOO_EVEN_COMMAND );
m_sprJudgment.RunCommands( BOO_COMMAND );
2003-03-09 00:55:49 +00:00
break;
case TNS_MISS:
m_sprJudgment.SetState( 5 );
2004-12-03 05:19:46 +00:00
m_sprJudgment.RunCommands( (m_iCount%2) ? MISS_ODD_COMMAND : MISS_EVEN_COMMAND );
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
}
m_iCount++;
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.
*/