From fb27c29beef23c353b4d42ce5f79552aabf62d3d Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 11 Apr 2003 01:49:57 +0000 Subject: [PATCH] add toggle for awarding item on combo break in battle --- stepmania/src/Inventory.cpp | 10 +++++++++- stepmania/src/NoteFieldPositioning.cpp | 2 +- stepmania/src/PlayerAI.cpp | 2 +- stepmania/src/PrefsManager.cpp | 5 ++++- stepmania/src/PrefsManager.h | 3 ++- stepmania/src/ScreenSelect.cpp | 2 +- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/stepmania/src/Inventory.cpp b/stepmania/src/Inventory.cpp index 379014a8db..ff47d58d22 100644 --- a/stepmania/src/Inventory.cpp +++ b/stepmania/src/Inventory.cpp @@ -15,6 +15,7 @@ #include "RageUtil.h" #include "GameState.h" #include "RageTimer.h" +#include "PrefsManager.h" #define NUM_ITEM_TYPES THEME->GetMetricF("Inventory","NumItemTypes") @@ -89,10 +90,17 @@ void Inventory::Update( float fDelta ) int iNewCombo = m_iLastSeenCombo; #define CROSSED(i) (iOldCombo=i) +#define BROKE_ABOVE(i) (iNewCombo=i) for( unsigned i=0; im_bBreakComboToGetItem ) + bEarnedThisItem = BROKE_ABOVE(g_Items[i].iCombo); + else + bEarnedThisItem = CROSSED(g_Items[i].iCombo); + + if( bEarnedThisItem ) { AwardItem( i ); break; diff --git a/stepmania/src/NoteFieldPositioning.cpp b/stepmania/src/NoteFieldPositioning.cpp index 52e76d1044..f031dcd656 100644 --- a/stepmania/src/NoteFieldPositioning.cpp +++ b/stepmania/src/NoteFieldPositioning.cpp @@ -189,7 +189,7 @@ bool NoteFieldPositioning::Mode::MatchesCurrentGame() const * doesn't exist, return "". */ int NoteFieldPositioning::GetID(const CString &name) const { - LOG->Trace("look for %s", name.c_str()); +// LOG->Trace("look for %s", name.c_str()); for(unsigned i = 0; i < Modes.size(); ++i) { if(Modes[i].name.CompareNoCase(name)) diff --git a/stepmania/src/PlayerAI.cpp b/stepmania/src/PlayerAI.cpp index 57519da2e2..ef036ee724 100644 --- a/stepmania/src/PlayerAI.cpp +++ b/stepmania/src/PlayerAI.cpp @@ -22,7 +22,7 @@ struct TapScoreDistribution { float fRand = randomf(0,1); ASSERT( iDifficultyExponent >= 1 ); - fRand = powf(fRand, iDifficultyExponent); + fRand = powf( fRand, (float)iDifficultyExponent ); for( int i=TNS_MISS; i<=TNS_MARVELOUS; i++ ) if( fRand <= fCumulativeProbability[i] ) return (TapNoteScore)i; diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 6ad6f32250..9c082adc60 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -85,11 +85,12 @@ PrefsManager::PrefsManager() m_iBoostAppPriority = -1; m_iPolygonRadar = -1; m_bShowSongOptions = true; - m_bDancePointsForOni = false; //DDR-Extreme style dance points instead of max2 percent + m_bDancePointsForOni = false; m_bTimestamping = false; m_bShowLyrics = true; m_bAutogenMissingTypes = true; m_bAutogenGroupCourses = true; + m_bBreakComboToGetItem = false; /* DDR Extreme-style extra stage support. * Default off so people used to the current behavior (or those with extra @@ -191,6 +192,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) ini.GetValueB( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses ); ini.GetValueB( "Options", "Timestamping", m_bTimestamping ); ini.GetValue ( "Options", "DefaultModifiers", m_sDefaultModifiers ); + ini.GetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem ); m_asAdditionalSongFolders.clear(); CString sAdditionalSongFolders; @@ -271,6 +273,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() ini.SetValueB( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses ); ini.SetValueB( "Options", "Timestamping", m_bTimestamping ); ini.SetValue ( "Options", "DefaultModifiers", m_sDefaultModifiers ); + ini.SetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem ); /* Only write these if they aren't the default. This ensures that we can change diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 671fd74ef3..9c3ecd26cd 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -69,12 +69,13 @@ public: float m_fMarathonVerSongSeconds; bool m_bShowSongOptions; bool m_bSoloSingle; - bool m_bDancePointsForOni; + bool m_bDancePointsForOni; //DDR-Extreme style dance points instead of max2 percent bool m_bTimestamping; bool m_bShowLyrics; bool m_bAutogenMissingTypes; bool m_bAutogenGroupCourses; CString m_sDefaultModifiers; + bool m_bBreakComboToGetItem; /* 0 = no; 1 = yes; -1 = auto (do whatever is appropriate for the arch). */ int m_iBoostAppPriority; diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index 996cf891dd..7c2bbfcbea 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -158,7 +158,7 @@ void ScreenSelect::DrawPrimitives() void ScreenSelect::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) { - LOG->Trace( "ScreenSelect::Input()" ); +// LOG->Trace( "ScreenSelect::Input()" ); if( MenuI.IsValid() && MenuI.button==MENU_BUTTON_START ) {