From 89bf1c8505d2b56889085bac2b6c2af70f8ae0b4 Mon Sep 17 00:00:00 2001 From: MinaciousGrace Date: Sun, 7 May 2017 02:00:51 -0400 Subject: [PATCH] kill attacks, battle mode, and rave mode, and many things exclusive to them (combinedlifemeter) --- src/ActiveAttackList.cpp | 79 ------- src/ActiveAttackList.h | 56 ----- src/Attack.cpp | 146 ------------ src/Attack.h | 117 ---------- src/AttackDisplay.cpp | 138 ----------- src/AttackDisplay.h | 58 ----- src/Character.cpp | 5 - src/Character.h | 1 - src/CombinedLifeMeter.h | 63 ----- src/CombinedLifeMeterTug.cpp | 178 -------------- src/CombinedLifeMeterTug.h | 54 ----- src/DancingCharacters.cpp | 9 - src/GameCommand.cpp | 18 -- src/GameConstantsAndTypes.cpp | 5 +- src/GameConstantsAndTypes.h | 17 -- src/GameState.cpp | 82 +------ src/GameState.h | 6 - src/Inventory.cpp | 241 ------------------- src/Inventory.h | 66 ------ src/NetworkSyncManager.cpp | 7 +- src/NoteDataUtil.cpp | 16 -- src/NoteDataUtil.h | 3 - src/NoteField.cpp | 27 --- src/NotesLoaderSM.cpp | 61 +---- src/NotesLoaderSM.h | 11 - src/NotesLoaderSMA.cpp | 7 - src/NotesLoaderSSC.cpp | 15 -- src/NotesWriterSM.cpp | 2 - src/NotesWriterSSC.cpp | 22 -- src/Player.cpp | 229 +----------------- src/Player.h | 20 +- src/PlayerAI.cpp | 19 -- src/PlayerOptions.cpp | 6 +- src/PlayerState.cpp | 143 +----------- src/PlayerState.h | 25 +- src/ScoreDisplayBattle.cpp | 98 -------- src/ScoreDisplayBattle.h | 51 ---- src/ScoreDisplayRave.cpp | 95 -------- src/ScoreDisplayRave.h | 53 ----- src/ScoreKeeper.cpp | 2 - src/ScoreKeeper.h | 5 +- src/ScoreKeeperNormal.cpp | 10 +- src/ScoreKeeperNormal.h | 3 +- src/ScoreKeeperRave.cpp | 234 ------------------- src/ScoreKeeperRave.h | 49 ---- src/ScoreKeeperShared.cpp | 5 +- src/ScoreKeeperShared.h | 3 +- src/ScreenEvaluation.cpp | 7 - src/ScreenGameplay.cpp | 176 +------------- src/ScreenGameplay.h | 18 -- src/ScreenHowToPlay.cpp | 2 +- src/ScreenSelectCharacter.cpp | 421 ---------------------------------- src/ScreenSelectCharacter.h | 94 -------- src/ScreenSelectMusic.cpp | 4 - src/Song.cpp | 5 +- src/Song.h | 9 - src/SongManager.cpp | 41 ---- src/SongManager.h | 2 - src/StageStats.cpp | 8 - src/Steps.cpp | 9 +- src/Steps.h | 12 +- 61 files changed, 32 insertions(+), 3336 deletions(-) diff --git a/src/ActiveAttackList.cpp b/src/ActiveAttackList.cpp index 72fe7ba585..e69de29bb2 100644 --- a/src/ActiveAttackList.cpp +++ b/src/ActiveAttackList.cpp @@ -1,79 +0,0 @@ -#include "global.h" -#include "ActiveAttackList.h" -#include "RageUtil.h" -#include "GameState.h" -#include "Inventory.h" -#include "RageTimer.h" -#include "PlayerOptions.h" -#include "PlayerState.h" - -ActiveAttackList::ActiveAttackList() -{ -} - -void ActiveAttackList::Init( const PlayerState* pPlayerState ) -{ - m_pPlayerState = pPlayerState; -} - -void ActiveAttackList::Update( float fDelta ) -{ - bool bTimeToRefresh = - IsFirstUpdate() || // check this before running Actor::Update() - m_pPlayerState->m_bAttackBeganThisUpdate || - m_pPlayerState->m_bAttackEndedThisUpdate; - - BitmapText::Update( fDelta ); - - if( bTimeToRefresh ) - Refresh(); -} - -void ActiveAttackList::Refresh() -{ - const AttackArray& attacks = m_pPlayerState->m_ActiveAttacks; - - vector vsThemedMods; - for( unsigned i=0; iSetText( s ); // BitmapText will not rebuild vertices if these strings are the same. -} - -/* - * (c) 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. - */ diff --git a/src/ActiveAttackList.h b/src/ActiveAttackList.h index dd5859a081..e69de29bb2 100644 --- a/src/ActiveAttackList.h +++ b/src/ActiveAttackList.h @@ -1,56 +0,0 @@ -#ifndef ACTIVE_ATTACK_LIST_H -#define ACTIVE_ATTACK_LIST_H - -#include "BitmapText.h" -class PlayerState; - -/** @brief Shows currently active Player modifiers during gameplay. */ -class ActiveAttackList : public BitmapText -{ -public: - /** @brief The constructor that does nothing. */ - ActiveAttackList(); - /** - * @brief Set up the PlayerState. - * @param pPlayerState the PlayerState involved with the attacks. */ - void Init( const PlayerState* pPlayerState ); - /** - * @brief Look into updating the list. - * @param fDelta the present time. */ - virtual void Update( float fDelta ); - /** @brief Refresh the list of attacks. */ - void Refresh(); - -protected: - /** @brief the PlayerState of the Player who is dealing with the attack list. */ - const PlayerState* m_pPlayerState; -}; - -#endif - -/** - * @file - * @author Chris Danford (c) 2004 - * @section LICENSE - * 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. - */ diff --git a/src/Attack.cpp b/src/Attack.cpp index 01021035c4..e69de29bb2 100644 --- a/src/Attack.cpp +++ b/src/Attack.cpp @@ -1,146 +0,0 @@ -#include "global.h" -#include "Attack.h" -#include "GameState.h" -#include "RageUtil.h" -#include "Song.h" -#include "Foreach.h" -#include "PlayerOptions.h" -#include "PlayerState.h" - -void Attack::GetAttackBeats( const Song *pSong, float &fStartBeat, float &fEndBeat ) const -{ - ASSERT( pSong != NULL ); - ASSERT_M( fStartSecond >= 0, ssprintf("StartSecond: %f",fStartSecond) ); - - const TimingData &timing = pSong->m_SongTiming; - fStartBeat = timing.GetBeatFromElapsedTime( fStartSecond ); - fEndBeat = timing.GetBeatFromElapsedTime( fStartSecond+fSecsRemaining ); -} - -/* Get the range for an attack that's being applied in realtime, eg. during battle - * mode. We need a PlayerState for this, so we can push the region off-screen to - * prevent popping when the attack has note modifers. */ -void Attack::GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlayerState, float &fStartBeat, float &fEndBeat ) const -{ - ASSERT( pSong != NULL ); - - if( fStartSecond >= 0 ) - { - GetAttackBeats( pSong, fStartBeat, fEndBeat ); - return; - } - - ASSERT( pPlayerState != NULL ); - - /* If reasonable, push the attack forward 8 beats so that notes on screen don't change suddenly. */ - fStartBeat = min( GAMESTATE->m_Position.m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat ); - fStartBeat = truncf(fStartBeat)+1; - - const TimingData &timing = pSong->m_SongTiming; - const float lStartSecond = timing.WhereUAtBro( fStartBeat ); - const float fEndSecond = lStartSecond + fSecsRemaining; - fEndBeat = timing.GetBeatFromElapsedTime( fEndSecond ); - fEndBeat = truncf(fEndBeat)+1; - - // loading the course should have caught this. - ASSERT_M( fEndBeat >= fStartBeat, ssprintf("EndBeat %f >= StartBeat %f", fEndBeat, fStartBeat) ); -} - -bool Attack::operator== ( const Attack &rhs ) const -{ -#define EQUAL(a) (a==rhs.a) - return - EQUAL(level) && - EQUAL(fStartSecond) && - EQUAL(fSecsRemaining) && - EQUAL(sModifiers) && - EQUAL(bOn) && - EQUAL(bGlobal); -} - -bool Attack::ContainsTransformOrTurn() const -{ - PlayerOptions po; - po.FromString( sModifiers ); - return po.ContainsTransformOrTurn(); -} - -Attack Attack::FromGlobalCourseModifier( const RString &sModifiers ) -{ - Attack a; - a.fStartSecond = 0; - a.fSecsRemaining = 10000; /* whole song */ - a.level = ATTACK_LEVEL_1; - a.sModifiers = sModifiers; - a.bGlobal = true; - return a; -} - -RString Attack::GetTextDescription() const -{ - RString s = sModifiers + " " + ssprintf("(%.2f seconds)", fSecsRemaining); - return s; -} - -int Attack::GetNumAttacks() const -{ - vector tmp; - split(this->sModifiers, ",", tmp); - return tmp.size(); -} - -bool AttackArray::ContainsTransformOrTurn() const -{ - FOREACH_CONST( Attack, *this, a ) - { - if( a->ContainsTransformOrTurn() ) - return true; - } - return false; -} - -vector AttackArray::ToVectorString() const -{ - vector ret; - FOREACH_CONST( Attack, *this, a ) - { - ret.push_back(ssprintf("TIME=%f:LEN=%f:MODS=%s", - a->fStartSecond, - a->fSecsRemaining, - a->sModifiers.c_str())); - } - return ret; -} - -void AttackArray::UpdateStartTimes(float delta) -{ - FOREACH(Attack, *this, a) - { - a->fStartSecond += delta; - } -} - -/* - * (c) 2003-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. - */ diff --git a/src/Attack.h b/src/Attack.h index da8bdcc18b..e69de29bb2 100644 --- a/src/Attack.h +++ b/src/Attack.h @@ -1,117 +0,0 @@ -#ifndef ATTACK_H -#define ATTACK_H - -#define ATTACK_STARTS_NOW (-10000.f) - -#include "GameConstantsAndTypes.h" -#include "PlayerNumber.h" -class Song; -class PlayerState; -/** @brief An action made against a Player to make things more difficult. */ -struct Attack -{ - AttackLevel level; - /** - * @brief the starting point of this attack. - * - * If this is -1, then the attack starts now. */ - float fStartSecond; - /** @brief How long does this attack last? */ - float fSecsRemaining; - /** @brief The modifiers used for this attack. */ - RString sModifiers; - bool bOn; // set and used by GAMESTATE - bool bGlobal; // true for song-wide course mods - bool bShowInAttackList; - - void MakeBlank() - { - level = ATTACK_LEVEL_1; - fStartSecond = ATTACK_STARTS_NOW; - fSecsRemaining = 0; - sModifiers = RString(); - bOn = false; - bGlobal = false; - bShowInAttackList = true; - } - Attack(): level(ATTACK_LEVEL_1), fStartSecond(ATTACK_STARTS_NOW), - fSecsRemaining(0), sModifiers(RString()), - bOn(false), bGlobal(false), bShowInAttackList(true) - {} // MakeBlank() is effectively called here. - Attack( - AttackLevel level_, - float fStartSecond_, - float fSecsRemaining_, - RString sModifiers_, - bool bOn_, - bool bGlobal_, - bool bShowInAttackList_ = true ): - level(level_), fStartSecond(fStartSecond_), - fSecsRemaining(fSecsRemaining_), sModifiers(sModifiers_), - bOn(bOn_), bGlobal(bGlobal_), - bShowInAttackList(bShowInAttackList_) {} - - void GetAttackBeats( const Song *pSong, float &fStartBeat, float &fEndBeat ) const; - void GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlayerState, float &fStartBeat, float &fEndBeat ) const; - /** - * @brief Determine if this attack has no modifiers, and is thus blank or empty. - * @return true if it is blank/empty, or false otherwise. */ - bool IsBlank() const { return sModifiers.empty(); } - /** - * @brief Determine if two Attacks are equal to each other. - * @param rhs the other Attack in question. - * @return true if the two Attacks are equal, or false otherwise. */ - bool operator== ( const Attack &rhs ) const; - bool ContainsTransformOrTurn() const; - static Attack FromGlobalCourseModifier( const RString &sModifiers ); - RString GetTextDescription() const; - - int GetNumAttacks() const; -}; - -struct AttackArray : public vector -{ - /** - * @brief Determine if the list of attacks contains a transform or turn mod. - * @return true if it does, or false otherwise. */ - bool ContainsTransformOrTurn() const; - - /** - * @brief Return a string representation used for simfiles. - * @return the string representation. */ - vector ToVectorString() const; - - /** - * @brief Adjust the starting time of all attacks. - * @param delta the amount to change. */ - void UpdateStartTimes(float delta); -}; - -#endif - -/** - * @file - * @author Chris Danford (c) 2003-2004 - * @section LICENSE - * 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. - */ diff --git a/src/AttackDisplay.cpp b/src/AttackDisplay.cpp index 81ea6d37a0..e69de29bb2 100644 --- a/src/AttackDisplay.cpp +++ b/src/AttackDisplay.cpp @@ -1,138 +0,0 @@ -#include "global.h" -#include "AttackDisplay.h" -#include "ThemeManager.h" -#include "GameState.h" -#include "ActorUtil.h" -#include "Character.h" -#include "RageLog.h" -#include -#include "PlayerState.h" - - -RString GetAttackPieceName( const RString &sAttack ) -{ - RString ret = ssprintf( "attack %s", sAttack.c_str() ); - - /* 1.5x -> 1_5x. If we pass a period to THEME->GetPathTo, it'll think - * we're looking for a specific file and not search. */ - ret.Replace( ".", "_" ); - - return ret; -} - -AttackDisplay::AttackDisplay() -{ - if( GAMESTATE->m_PlayMode != PLAY_MODE_BATTLE && - GAMESTATE->m_PlayMode != PLAY_MODE_RAVE ) - return; - - m_sprAttack.SetDiffuseAlpha( 0 ); // invisible - this->AddChild( &m_sprAttack ); -} - -void AttackDisplay::Init( const PlayerState* pPlayerState ) -{ - m_pPlayerState = pPlayerState; - - // TODO: Remove use of PlayerNumber. - PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - m_sprAttack.SetName( ssprintf("TextP%d",pn+1) ); - - if( GAMESTATE->m_PlayMode != PLAY_MODE_BATTLE && - GAMESTATE->m_PlayMode != PLAY_MODE_RAVE ) - return; - - set attacks; - for( int al=0; alm_pCurCharacters[pn]; - ASSERT( ch != NULL ); - const RString* asAttacks = ch->m_sAttacks[al]; - for( int att = 0; att < NUM_ATTACKS_PER_LEVEL; ++att ) - attacks.insert( asAttacks[att] ); - } - - for( set::const_iterator it = attacks.begin(); it != attacks.end(); ++it ) - { - const RString path = THEME->GetPathG( "AttackDisplay", GetAttackPieceName( *it ), true ); - if( path == "" ) - { - LOG->Trace( "Couldn't find \"%s\"", GetAttackPieceName( *it ).c_str() ); - continue; - } - - m_TexturePreload.Load( path ); - } -} - - -void AttackDisplay::Update( float fDelta ) -{ - ActorFrame::Update( fDelta ); - - if( GAMESTATE->m_PlayMode != PLAY_MODE_BATTLE && - GAMESTATE->m_PlayMode != PLAY_MODE_RAVE ) - return; - - if( !m_pPlayerState->m_bAttackBeganThisUpdate ) - return; - // don't handle this again - - for( unsigned s=0; sm_ActiveAttacks.size(); s++ ) - { - const Attack& attack = m_pPlayerState->m_ActiveAttacks[s]; - - if( attack.fStartSecond >= 0 ) - continue; /* hasn't started yet */ - - if( attack.fSecsRemaining <= 0 ) - continue; /* ended already */ - - if( attack.IsBlank() ) - continue; - - SetAttack( attack.sModifiers ); - break; - } -} - -void AttackDisplay::SetAttack( const RString &sText ) -{ - const RString path = THEME->GetPathG( "AttackDisplay", GetAttackPieceName(sText), true ); - if( path == "" ) - return; - - m_sprAttack.SetDiffuseAlpha( 1 ); - m_sprAttack.Load( path ); - - // TODO: Remove use of PlayerNumber. - PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - - const RString sName = ssprintf( "%sP%i", sText.c_str(), pn+1 ); - m_sprAttack.RunCommands( THEME->GetMetricA("AttackDisplay", sName + "OnCommand") ); -} - -/* - * (c) 2003 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. - */ diff --git a/src/AttackDisplay.h b/src/AttackDisplay.h index 5e4dccf3d3..e69de29bb2 100644 --- a/src/AttackDisplay.h +++ b/src/AttackDisplay.h @@ -1,58 +0,0 @@ -#ifndef AttackDisplay_H -#define AttackDisplay_H - -#include "ActorFrame.h" -#include "Sprite.h" -#include "GameConstantsAndTypes.h" // for TapNoteScore -#include "RageTexturePreloader.h" - -RString GetAttackPieceName( const RString &sAttack ); - -class PlayerState; -/** @brief A graphical display for attacks. */ -class AttackDisplay : public ActorFrame -{ -public: - AttackDisplay(); - - void Init( const PlayerState* pPlayerState ); - void SetAttack( const RString &mod ); - - virtual void Update( float fDelta ); - -protected: - const PlayerState* m_pPlayerState; - - Sprite m_sprAttack; - - RageTexturePreloader m_TexturePreload; -}; - -#endif - -/** - * @file - * @author Chris Danford (c) 2003 - * @section LICENSE - * 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. - */ diff --git a/src/Character.cpp b/src/Character.cpp index a9c621505d..371dc6b11b 100644 --- a/src/Character.cpp +++ b/src/Character.cpp @@ -55,11 +55,6 @@ bool Character::Load( RString sCharDir ) IniFile ini; if( !ini.ReadFile( sCharDir+"character.ini" ) ) return false; - for( int i=0; i METER_WIDTH ("CombinedLifeMeterTug","MeterWidth"); - -static void TugMeterPercentChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) -{ - sNameOut = "TugMeterPercentChange" + ScoreEventToString( (ScoreEvent)i ); - switch( i ) - { - default: - FAIL_M(ssprintf("Invalid ScoreEvent: %i", static_cast(i))); - case SE_W1: defaultValueOut = +0.010f; break; - case SE_W2: defaultValueOut = +0.008f; break; - case SE_W3: defaultValueOut = +0.004f; break; - case SE_W4: defaultValueOut = +0.000f; break; - case SE_W5: defaultValueOut = -0.010f; break; - case SE_Miss: defaultValueOut = -0.020f; break; - case SE_HitMine: defaultValueOut = -0.040f; break; - case SE_CheckpointHit: defaultValueOut = +0.002f; break; - case SE_CheckpointMiss: defaultValueOut = -0.002f; break; - case SE_Held: defaultValueOut = +0.008f; break; - case SE_LetGo: defaultValueOut = -0.020f; break; - case SE_Missed: defaultValueOut = +0.000f; break; - } -} - -static Preference1D g_fTugMeterPercentChange( TugMeterPercentChangeInit, NUM_ScoreEvent ); - -CombinedLifeMeterTug::CombinedLifeMeterTug() -{ - FOREACH_PlayerNumber( p ) - { - RString sStreamPath = THEME->GetPathG("CombinedLifeMeterTug",ssprintf("stream p%d",p+1)); - RString sTipPath = THEME->GetPathG("CombinedLifeMeterTug",ssprintf("tip p%d",p+1)); - m_Stream[p].Load( sStreamPath, METER_WIDTH, sTipPath ); - this->AddChild( &m_Stream[p] ); - } - m_Stream[PLAYER_2].SetZoomX( -1 ); - - m_sprSeparator.Load( THEME->GetPathG("CombinedLifeMeterTug","separator") ); - m_sprSeparator->SetName( "Separator" ); - LOAD_ALL_COMMANDS( m_sprSeparator ); - this->AddChild( m_sprSeparator ); - - m_sprFrame.Load( THEME->GetPathG("CombinedLifeMeterTug","frame") ); - m_sprFrame->SetName( "Frame" ); - LOAD_ALL_COMMANDS( m_sprFrame ); - this->AddChild( m_sprFrame ); -} - -void CombinedLifeMeterTug::Update( float fDelta ) -{ - float fPercentToShow = GAMESTATE->m_fTugLifePercentP1; - CLAMP( fPercentToShow, 0.f, 1.f ); - - m_Stream[PLAYER_1].SetPercent( fPercentToShow ); - m_Stream[PLAYER_2].SetPercent( 1-fPercentToShow ); - - float fSeparatorX = SCALE( fPercentToShow, 0.f, 1.f, -METER_WIDTH/2.f, +METER_WIDTH/2.f ); - - m_sprSeparator->SetX( fSeparatorX ); - - ActorFrame::Update( fDelta ); -} - -void CombinedLifeMeterTug::ChangeLife( PlayerNumber pn, TapNoteScore score ) -{ - float fPercentToMove = 0; - switch( score ) - { - case TNS_W1: fPercentToMove = g_fTugMeterPercentChange[SE_W1]; break; - case TNS_W2: fPercentToMove = g_fTugMeterPercentChange[SE_W2]; break; - case TNS_W3: fPercentToMove = g_fTugMeterPercentChange[SE_W3]; break; - case TNS_W4: fPercentToMove = g_fTugMeterPercentChange[SE_W4]; break; - case TNS_W5: fPercentToMove = g_fTugMeterPercentChange[SE_W5]; break; - case TNS_Miss: fPercentToMove = g_fTugMeterPercentChange[SE_Miss]; break; - case TNS_HitMine: fPercentToMove = g_fTugMeterPercentChange[SE_HitMine]; break; - case TNS_CheckpointHit: fPercentToMove = g_fTugMeterPercentChange[SE_CheckpointHit]; break; - case TNS_CheckpointMiss:fPercentToMove = g_fTugMeterPercentChange[SE_CheckpointMiss]; break; - default: - FAIL_M(ssprintf("Invalid TapNotScore: %i", score)); - } - - ChangeLife( pn, fPercentToMove ); -} - -void CombinedLifeMeterTug::HandleTapScoreNone( PlayerNumber pn ) -{ - -} - -void CombinedLifeMeterTug::ChangeLife( PlayerNumber pn, HoldNoteScore score, TapNoteScore tscore ) -{ - float fPercentToMove = 0; - switch( score ) - { - case HNS_Held: fPercentToMove = g_fTugMeterPercentChange[SE_Held]; break; - case HNS_LetGo: fPercentToMove = g_fTugMeterPercentChange[SE_LetGo]; break; - case HNS_Missed: fPercentToMove = g_fTugMeterPercentChange[SE_Missed]; break; - default: - FAIL_M(ssprintf("Invalid HoldNoteScore: %i", score)); - } - - ChangeLife( pn, fPercentToMove ); -} - -void CombinedLifeMeterTug::ChangeLife( PlayerNumber pn, float fPercentToMove ) -{ - if( PREFSMAN->m_bMercifulDrain && fPercentToMove < 0 ) - { - float fLifePercentage = 0; - switch( pn ) - { - case PLAYER_1: fLifePercentage = GAMESTATE->m_fTugLifePercentP1; break; - case PLAYER_2: fLifePercentage = 1 - GAMESTATE->m_fTugLifePercentP1; break; - default: - FAIL_M(ssprintf("Invalid player number: %i", pn)); - } - - /* Clamp the life meter only for calculating the multiplier. */ - fLifePercentage = clamp( fLifePercentage, 0.0f, 1.0f ); - fPercentToMove *= SCALE( fLifePercentage, 0.f, 1.f, 0.2f, 1.f); - } - - switch( pn ) - { - case PLAYER_1: GAMESTATE->m_fTugLifePercentP1 += fPercentToMove; break; - case PLAYER_2: GAMESTATE->m_fTugLifePercentP1 -= fPercentToMove; break; - default: - FAIL_M(ssprintf("Invalid player number: %i", pn)); - } -} - -void CombinedLifeMeterTug::SetLife(PlayerNumber pn, float value) -{ - switch(pn) - { - case PLAYER_1: - GAMESTATE->m_fTugLifePercentP1= value; - break; - case PLAYER_2: - GAMESTATE->m_fTugLifePercentP1= 1-value; - break; - default: - FAIL_M(ssprintf("Invalid player number: %i", pn)); - } -} - -/* - * (c) 2003-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. - */ diff --git a/src/CombinedLifeMeterTug.h b/src/CombinedLifeMeterTug.h index 5b7f7fa62a..e69de29bb2 100644 --- a/src/CombinedLifeMeterTug.h +++ b/src/CombinedLifeMeterTug.h @@ -1,54 +0,0 @@ -#ifndef CombinedLifeMeterTug_H -#define CombinedLifeMeterTug_H - -#include "CombinedLifeMeter.h" -#include "MeterDisplay.h" - -/** @brief Dance Magic-like tug-o-war life meter. */ -class CombinedLifeMeterTug : public CombinedLifeMeter -{ -public: - CombinedLifeMeterTug(); - virtual void Update( float fDelta ); - - virtual void ChangeLife( PlayerNumber pn, TapNoteScore score ); - virtual void ChangeLife( PlayerNumber pn, HoldNoteScore score, TapNoteScore tscore ); - virtual void ChangeLife( PlayerNumber pn, float fPercentToMove ); - virtual void SetLife(PlayerNumber pn, float value); - virtual void HandleTapScoreNone( PlayerNumber pn ); - -protected: - - MeterDisplay m_Stream[NUM_PLAYERS]; - AutoActor m_sprSeparator; - AutoActor m_sprFrame; -}; - -#endif - -/** - * @file - * @author Chris Danford (c) 2003-2004 - * @section LICENSE - * 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. - */ diff --git a/src/DancingCharacters.cpp b/src/DancingCharacters.cpp index 9c4c9bb4fe..395603fc8b 100644 --- a/src/DancingCharacters.cpp +++ b/src/DancingCharacters.cpp @@ -129,15 +129,6 @@ DancingCharacters::DancingCharacters(): m_bDrawDangerLight(false), else m_pCharacter[p]->SetX( MODEL_X_ONE_PLAYER ); - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: - m_pCharacter[p]->SetRotationY( MODEL_ROTATIONY_TWO_PLAYERS[p] ); - default: - break; - } - m_pCharacter[p]->LoadMilkshapeAscii( pChar->GetModelPath() ); m_pCharacter[p]->LoadMilkshapeAsciiBones( "rest", pChar->GetRestAnimationPath() ); m_pCharacter[p]->LoadMilkshapeAsciiBones( "warmup", pChar->GetWarmUpAnimationPath() ); diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp index 487a722f84..9935497a3d 100644 --- a/src/GameCommand.cpp +++ b/src/GameCommand.cpp @@ -457,24 +457,6 @@ static bool AreStyleAndPlayModeCompatible( const Style *style, PlayMode pm ) { if( style == NULL || pm == PlayMode_Invalid ) return true; - - switch( pm ) - { - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: - // Can't play rave if there isn't enough room for two players. - // This is correct for dance (ie, no rave for solo and doubles), - // and should be okay for pump.. not sure about other game types. - // Techno Motion scales down versus arrows, though, so allow this. - if( style->m_iColsPerPlayer >= 6 && RString(GAMESTATE->m_pCurGame->m_szName) != "techno" ) - return false; - - // Don't allow battle modes if the style takes both sides. - if( style->m_StyleType==StyleType_OnePlayerTwoSides || - style->m_StyleType==StyleType_TwoPlayersSharedSides ) - return false; - default: return true; - } } bool GameCommand::IsPlayable( RString *why ) const diff --git a/src/GameConstantsAndTypes.cpp b/src/GameConstantsAndTypes.cpp index 5b1f183d69..d072bcd239 100644 --- a/src/GameConstantsAndTypes.cpp +++ b/src/GameConstantsAndTypes.cpp @@ -67,9 +67,7 @@ LuaXType( StepsType ); static const char *PlayModeNames[] = { - "Regular", - "Battle", - "Rave", + "Regular" }; XToString( PlayMode ); XToLocalizedString( PlayMode ); @@ -290,7 +288,6 @@ static const char *TimingWindowNames[] = { "W4", "W5", "Mine", - "Attack", "Hold", "Roll", "Checkpoint" diff --git a/src/GameConstantsAndTypes.h b/src/GameConstantsAndTypes.h index 93db224db8..ebeda00b7b 100644 --- a/src/GameConstantsAndTypes.h +++ b/src/GameConstantsAndTypes.h @@ -122,8 +122,6 @@ LuaDeclareType( StepsType ); enum PlayMode { PLAY_MODE_REGULAR, /**< The normal game mode, often with a set number of stages. */ - PLAY_MODE_BATTLE, /**< Choose when to send attacks to your opponent. */ - PLAY_MODE_RAVE, /**< Have attacks launched during play automatically. */ NUM_PlayMode, PlayMode_Invalid }; @@ -282,7 +280,6 @@ enum TimingWindow TW_W4, TW_W5, TW_Mine, - TW_Attack, TW_Hold, TW_Roll, TW_Checkpoint, @@ -398,20 +395,6 @@ enum StageResult }; LuaDeclareType( StageResult ); -// Battle stuff -/** @brief The number of inventory slots available for attacks. */ -const int NUM_INVENTORY_SLOTS = 3; -enum AttackLevel -{ - ATTACK_LEVEL_1, - ATTACK_LEVEL_2, - ATTACK_LEVEL_3, - NUM_ATTACK_LEVELS -}; -const int NUM_ATTACKS_PER_LEVEL = 3; -const int ITEM_NONE = -1; - - // Coin stuff /** @brief The different coin modes to determine how one can play. */ enum CoinMode diff --git a/src/GameState.cpp b/src/GameState.cpp index 189772b271..ca642176a1 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -691,18 +691,6 @@ void GameState::BeginStage() void GameState::CancelStage() { - FOREACH_CpuPlayer( p ) - { - switch( m_PlayMode ) - { - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: - m_iPlayerStageTokens[p] = PREFSMAN->m_iSongsPerPlay; - default: - break; - } - } - FOREACH_EnabledPlayer( p ) m_iPlayerStageTokens[p] += m_iNumStagesOfThisSong; m_iNumStagesOfThisSong = 0; @@ -1018,9 +1006,6 @@ void GameState::ResetStageStatistics() } } - RemoveAllActiveAttacks(); - FOREACH_PlayerNumber( p ) - m_pPlayerState[p]->RemoveAllInventory(); m_fOpponentHealthPercent = 1; m_fHasteRate = 0; m_fLastHasteUpdateMusicSeconds = 0; @@ -1028,11 +1013,7 @@ void GameState::ResetStageStatistics() m_fTugLifePercentP1 = 0.5f; FOREACH_PlayerNumber( p ) { - m_pPlayerState[p]->m_fSuperMeter = 0; m_pPlayerState[p]->m_HealthState = HealthState_Alive; - - m_pPlayerState[p]->m_iLastPositiveSumOfAttackLevels = 0; - m_pPlayerState[p]->m_fSecondsUntilAttacksPhasedOut = 0; // PlayerAI not affected } @@ -1382,15 +1363,7 @@ bool GameState::SetCompatibleStyle(StepsType stype, PlayerNumber pn) bool GameState::IsPlayerEnabled( PlayerNumber pn ) const { - // In rave, all players are present. Non-human players are CPU controlled. - switch( m_PlayMode ) - { - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: - return true; - default: - return IsHumanPlayer(pn); - } + return IsHumanPlayer(pn); } bool GameState::IsMultiPlayerEnabled( MultiPlayer mp ) const @@ -1498,13 +1471,7 @@ bool GameState::AnyPlayersAreCpu() const bool GameState::IsBattleMode() const { - switch( m_PlayMode ) - { - case PLAY_MODE_BATTLE: - return true; - default: - return false; - } + return false; } EarnedExtraStage GameState::CalculateEarnedExtraStage() const @@ -1566,21 +1533,6 @@ PlayerNumber GameState::GetBestPlayer() const StageResult GameState::GetStageResult( PlayerNumber pn ) const { - switch( m_PlayMode ) - { - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: - if( fabsf(m_fTugLifePercentP1 - 0.5f) < 0.0001f ) - return RESULT_DRAW; - switch( pn ) - { - case PLAYER_1: return (m_fTugLifePercentP1>=0.5f)?RESULT_WIN:RESULT_LOSE; - case PLAYER_2: return (m_fTugLifePercentP1<0.5f)?RESULT_WIN:RESULT_LOSE; - default: FAIL_M("Invalid player for battle! Aborting..."); return RESULT_LOSE; - } - default: break; - } - StageResult win = RESULT_WIN; FOREACH_PlayerNumber( p ) { @@ -1666,12 +1618,6 @@ void GameState::GetAllUsedNoteSkins( vector &out ) const out.erase( unique( out.begin(), out.end() ), out.end() ); } -void GameState::RemoveAllActiveAttacks() // called on end of song -{ - FOREACH_PlayerNumber( p ) - m_pPlayerState[p]->RemoveActiveAttacks(); -} - void GameState::AddStageToPlayer( PlayerNumber pn ) { // Add one stage more to player (bonus) -cerbo @@ -1763,8 +1709,6 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector &asFeatsOu switch( mode ) { case PLAY_MODE_REGULAR: - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: { StepsType st = GetCurrentStyle(pn)->m_StepsType; @@ -1973,8 +1917,6 @@ int GameState::GetNumCols(int pn) bool GameState::DifficultiesLocked() const { - if( m_PlayMode == PLAY_MODE_RAVE ) - return true; if( GetCurrentStyle(PLAYER_INVALID)->m_bLockDifficulties ) return true; return false; @@ -2554,27 +2496,7 @@ class LunaGameState: public Luna static bool AreStyleAndPlayModeCompatible( T* p, lua_State* L, const Style *style, PlayMode pm ) { - if( pm != PLAY_MODE_BATTLE && pm != PLAY_MODE_RAVE ) - { return true; - } - - // Do not allow styles with StepsTypes with shared sides or that are one player only with Battle or Rave. - if( style->m_StyleType != StyleType_TwoPlayersSharedSides ) - { - vector vpStyles; - GAMEMAN->GetCompatibleStyles( p->m_pCurGame, 2, vpStyles ); - FOREACH_CONST( const Style*, vpStyles, s ) - { - if( (*s)->m_StepsType == style->m_StepsType ) - { - return true; - } - } - } - luaL_error( L, "Style %s is incompatible with PlayMode %s", - style->m_szName, PlayModeToString( pm ).c_str() ); - return false; } static int SetCurrentStyle( T* p, lua_State *L ) diff --git a/src/GameState.h b/src/GameState.h index 5d4146e05f..4eae23b9fb 100644 --- a/src/GameState.h +++ b/src/GameState.h @@ -1,7 +1,6 @@ #ifndef GAMESTATE_H #define GAMESTATE_H -#include "Attack.h" #include "Difficulty.h" #include "GameConstantsAndTypes.h" #include "Grade.h" @@ -275,17 +274,12 @@ class GameState RageTimer m_DanceStartTime; float m_DanceDuration; - // Random Attacks & Attack Mines - vector m_RandomAttacks; - // used in PLAY_MODE_BATTLE float m_fOpponentHealthPercent; // used in PLAY_MODE_RAVE float m_fTugLifePercentP1; - /** @brief Primarily called at the end of a song to stop all attacks. */ - void RemoveAllActiveAttacks(); PlayerNumber GetBestPlayer() const; StageResult GetStageResult( PlayerNumber pn ) const; diff --git a/src/Inventory.cpp b/src/Inventory.cpp index 7b416d35f4..e69de29bb2 100644 --- a/src/Inventory.cpp +++ b/src/Inventory.cpp @@ -1,241 +0,0 @@ -#include "global.h" -#include "Inventory.h" -#include "ThemeManager.h" -#include "RageUtil.h" -#include "GameState.h" -#include "RageTimer.h" -#include "PrefsManager.h" -#include "Song.h" -#include "ScreenManager.h" -#include "StatsManager.h" -#include "ThemeMetric.h" -#include "PlayerState.h" - -void ReloadItems(); - -#define NUM_ITEM_TYPES THEME->GetMetricF("Inventory","NumItemTypes") -#define ITEM_DURATION_SECONDS THEME->GetMetricF("Inventory","ItemDurationSeconds") -#define ITEM_COMBO( i ) THEME->GetMetricI("Inventory",ssprintf("Item%dCombo",i+1)) -#define ITEM_EFFECT( i ) THEME->GetMetric ("Inventory",ssprintf("Item%dEffect",i+1)) -#define ITEM_LEVEL( i ) THEME->GetMetricI("Inventory",ssprintf("Item%dLevel",i+1)) -ThemeMetric ITEM_USE_RATE_SECONDS("Inventory","ItemUseRateSeconds"); - -#define ITEM_USE_PROBABILITY (1.f/ITEM_USE_RATE_SECONDS) - -struct Item -{ - AttackLevel level; - unsigned int iCombo; - RString sModifier; -}; -static vector g_Items; - -void ReloadItems() -{ - g_Items.clear(); - for( int i=0; im_PlayMode; - switch( mode ) - { - case PLAY_MODE_BATTLE: - break; - default: - FAIL_M(ssprintf("Inventory not valid for PlayMode %i", mode)); - } -} - -Inventory::~Inventory() -{ - for( unsigned i=0; im_PlayMode ) - { - case PLAY_MODE_BATTLE: - { - m_soundAcquireItem.Load( THEME->GetPathS("Inventory","aquire item") ); - for( unsigned i=0; iLoad( THEME->GetPathS("Inventory",ssprintf("use item %u",i+1)) ); - m_vpSoundUseItem.push_back( pSound ); - } - m_soundItemEnding.Load( THEME->GetPathS("Inventory","item ending") ); - break; - } - default: break; - } -} - -void Inventory::Update( float fDelta ) -{ - if( m_pPlayerState->m_bAttackEndedThisUpdate ) - m_soundItemEnding.Play(false); - - // TODO: remove use of PlayerNumber - PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - - // check to see if they deserve a new item - if( STATSMAN->m_CurStageStats.m_player[pn].m_iCurCombo != m_iLastSeenCombo ) - { - unsigned int iOldCombo = m_iLastSeenCombo; - m_iLastSeenCombo = STATSMAN->m_CurStageStats.m_player[pn].m_iCurCombo; - unsigned 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; - } - } - } - - Song &song = *GAMESTATE->m_pCurSong; - // use items if this player is CPU-controlled - if( m_pPlayerState->m_PlayerController != PC_HUMAN && - GAMESTATE->m_Position.m_fSongBeat < song.GetLastBeat() ) - { - // every 1 seconds, try to use an item - int iLastSecond = (int)(RageTimer::GetTimeSinceStartFast() - fDelta); - int iThisSecond = (int)RageTimer::GetTimeSinceStartFast(); - if( iLastSecond != iThisSecond ) - { - for( int s=0; sm_Inventory[s].IsBlank() ) - if( randomf(0,1) < ITEM_USE_PROBABILITY ) - UseItem( s ); - } - } -} - -void Inventory::AwardItem( int iItemIndex ) -{ - /* CPU players and replay data are vanity only. They should not effect - * gameplay by acquiring/launching attacks. */ - if( m_pPlayerState->m_PlayerController == PC_CPU ) - return; - /* - if( m_pPlayerState->m_PlayerController == PC_CPU || - m_pPlayerState->m_PlayerController == PC_REPLAY) - { - return; - } - */ - - // search for the first open slot - int iOpenSlot = -1; - - Attack* pInventory = m_pPlayerState->m_Inventory; //[NUM_INVENTORY_SLOTS] - - if( pInventory[NUM_INVENTORY_SLOTS/2].IsBlank() ) - { - iOpenSlot = NUM_INVENTORY_SLOTS/2; - } - else - { - for( int s=0; sm_Inventory; //[NUM_INVENTORY_SLOTS] - - if( pInventory[iSlot].IsBlank() ) - return; - - PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - Attack a = pInventory[iSlot]; - - // remove the item - pInventory[iSlot].MakeBlank(); - m_vpSoundUseItem[a.level]->Play(false); - - PlayerNumber pnToAttack = OPPOSITE_PLAYER[pn]; - PlayerState *pPlayerStateToAttack = GAMESTATE->m_pPlayerState[pnToAttack]; - pPlayerStateToAttack->LaunchAttack( a ); - - float fPercentHealthToDrain = (a.level+1) / 10.f; - ASSERT( fPercentHealthToDrain > 0 ); - GAMESTATE->m_fOpponentHealthPercent -= fPercentHealthToDrain; - CLAMP( GAMESTATE->m_fOpponentHealthPercent, 0.f, 1.f ); - - // play announcer sound - SCREENMAN->SendMessageToTopScreen( ssprintf("SM_BattleDamageLevel%d",a.level+1) ); -} - -/* - * (c) 2003 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. - */ diff --git a/src/Inventory.h b/src/Inventory.h index 93712c3e17..e69de29bb2 100644 --- a/src/Inventory.h +++ b/src/Inventory.h @@ -1,66 +0,0 @@ -#ifndef Inventory_H -#define Inventory_H - -#include "Actor.h" -#include "PlayerNumber.h" -#include "RageSound.h" -#include "ScreenMessage.h" - -AutoScreenMessage( SM_BattleDamageLevel1 ); -AutoScreenMessage( SM_BattleDamageLevel2 ); -AutoScreenMessage( SM_BattleDamageLevel3 ); - -class PlayerState; -/** @brief Inventory management for PLAY_MODE_BATTLE. */ -class Inventory : public Actor -{ -public: - Inventory(); - ~Inventory(); - void Load( PlayerState* pPlayerState ); - - virtual void Update( float fDelta ); - virtual void DrawPrimitives() {}; - - void UseItem( int iSlot ); - -protected: - void AwardItem( int iItemIndex ); - - PlayerState* m_pPlayerState; - unsigned int m_iLastSeenCombo; - - /** @brief a sound played when an item has been acquired. */ - RageSound m_soundAcquireItem; - vector m_vpSoundUseItem; - RageSound m_soundItemEnding; -}; - -#endif - -/** - * @file - * @author Chris Danford (c) 2003 - * @section LICENSE - * 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. - */ diff --git a/src/NetworkSyncManager.cpp b/src/NetworkSyncManager.cpp index 64fd55c31f..c01b905f31 100644 --- a/src/NetworkSyncManager.cpp +++ b/src/NetworkSyncManager.cpp @@ -724,13 +724,8 @@ void NetworkSyncManager::ProcessInput() { PlayerNumber iPlayerNumber = (PlayerNumber)m_packet.Read1(); - if( GAMESTATE->IsPlayerEnabled( iPlayerNumber ) ) // Only attack if the player can be attacked. + if( GAMESTATE->IsPlayerEnabled( iPlayerNumber ) ) // There was an attack here, now there isnt { - Attack a; - a.fSecsRemaining = float( m_packet.Read4() ) / 1000.0f; - a.bGlobal = false; - a.sModifiers = m_packet.ReadNT(); - GAMESTATE->m_pPlayerState[iPlayerNumber]->LaunchAttack( a ); } m_packet.ClearPacket(); } diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index b5f249e494..5ff2f9754d 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -2549,22 +2549,6 @@ void NoteDataUtil::ConvertAdditionsToRegular( NoteData &inout ) inout.RevalidateATIs(vector(), false); } -void NoteDataUtil::TransformNoteData(NoteData &nd, TimingData const& timing_data, const AttackArray &aa, StepsType st, Song* pSong) -{ - FOREACH_CONST( Attack, aa, a ) - { - PlayerOptions po; - po.FromString( a->sModifiers ); - if( po.ContainsTransformOrTurn() ) - { - float fStartBeat, fEndBeat; - a->GetAttackBeats( pSong, fStartBeat, fEndBeat ); - - NoteDataUtil::TransformNoteData(nd, timing_data, po, st, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) ); - } - } -} - void NoteDataUtil::TransformNoteData( NoteData &nd, TimingData const& timing_data, const PlayerOptions &po, StepsType st, int iStartIndex, int iEndIndex ) { // Apply remove transforms before others so that we don't go removing diff --git a/src/NoteDataUtil.h b/src/NoteDataUtil.h index 0052fa3b68..48686c151f 100644 --- a/src/NoteDataUtil.h +++ b/src/NoteDataUtil.h @@ -8,7 +8,6 @@ class PlayerOptions; struct RadarValues; class NoteData; class Song; -struct AttackArray; class TimingData; void PlaceAutoKeysound( NoteData &out, int row, TapNote akTap ); @@ -161,8 +160,6 @@ namespace NoteDataUtil // True if no notes in row that aren't true in the mask bool RowPassesValidMask( NoteData &inout, int row, const bool bValidMask[] ); - void TransformNoteData(NoteData &nd, TimingData const& timing_data, - const AttackArray &aa, StepsType st, Song* pSong); void TransformNoteData(NoteData &nd, TimingData const& timing_data, const PlayerOptions &po, StepsType st, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); diff --git a/src/NoteField.cpp b/src/NoteField.cpp index e4b5a6756a..a369d4678b 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -567,15 +567,6 @@ void NoteField::draw_timing_segment_text(const RString& text, m_textMeasureNumber.Draw(); } -void NoteField::DrawAttackText(const float beat, const Attack &attack, - const RageColor& glow) -{ - set_text_measure_number_for_draw(beat, 1, 10, align_left, - RageColor(0,0.8f,0.8f,1), glow); - m_textMeasureNumber.SetText( attack.GetTextDescription() ); - m_textMeasureNumber.Draw(); -} - void NoteField::DrawBGChangeText(const float beat, const RString new_bg_name, const RageColor& glow) { @@ -838,24 +829,6 @@ void NoteField::DrawPrimitives() draw_all_segments(FloatToString(seg->GetLength()), Fake, FAKE); #undef draw_all_segments - AttackArray &attacks = GAMESTATE->m_bIsUsingStepTiming ? - GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks : - GAMESTATE->m_pCurSong->m_Attacks; - // XXX: We're somehow getting here when attacks is null. Find the actual cause later. - if (&attacks) - { - FOREACH_CONST(Attack, attacks, a) - { - float fBeat = timing.GetBeatFromElapsedTime(a->fStartSecond); - if (BeatToNoteRow(fBeat) >= m_FieldRenderArgs.first_row && - BeatToNoteRow(fBeat) <= m_FieldRenderArgs.last_row && - IS_ON_SCREEN(fBeat)) - { - this->DrawAttackText(fBeat, *a, text_glow); - } - } - } - if( !GAMESTATE->m_bIsUsingStepTiming ) { // BGChange text diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index 3418bc7165..f9d78fcdee 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -10,7 +10,6 @@ #include "Song.h" #include "SongManager.h" #include "Steps.h" -#include "Attack.h" #include "PrefsManager.h" // Everything from this line to the creation of sm_parser_helper exists to @@ -180,12 +179,6 @@ void SMSetKeysounds(SMSongTagInfo& info) { split((*info.params)[1], ",", info.song->m_vsKeysoundFile); } -void SMSetAttacks(SMSongTagInfo& info) -{ - info.loader->ProcessAttackString(info.song->m_sAttackString, (*info.params)); - info.loader->ProcessAttacks(info.song->m_Attacks, (*info.params)); -} - typedef std::map song_handler_map_t; struct sm_parser_helper_t @@ -229,7 +222,6 @@ struct sm_parser_helper_t song_tag_handlers["FGCHANGES"]= &SMSetFGChanges; song_tag_handlers["KEYSOUNDS"]= &SMSetKeysounds; // Attacks loaded from file - song_tag_handlers["ATTACKS"]= &SMSetAttacks; /* Tags that no longer exist, listed for posterity. May their names * never be forgotten for their service to Stepmania. -Kyz * LASTBEATHINT: // unable to identify at this point: ignore @@ -242,6 +234,7 @@ struct sm_parser_helper_t * SAMPLEPATH: // SamplePath was used when the song has a separate preview clip. -aj * LEADTRACK: // XXX: Does anyone know what LEADTRACK is for? -Wolfman2000 * MUSICLENGTH: // Loaded from the cache now. -Kyz + * ATTACKS: // Stupid. -mina */ } }; @@ -368,58 +361,6 @@ void SMLoader::ProcessBGChanges( Song &out, const RString &sValueName, const RSt } } -void SMLoader::ProcessAttackString( vector & attacks, MsdFile::value_t params ) -{ - for( unsigned s=1; s < params.params.size(); ++s ) - { - RString tmp = params[s]; - Trim(tmp); - if (tmp.size() > 0) - attacks.push_back( tmp ); - } -} - -void SMLoader::ProcessAttacks( AttackArray &attacks, MsdFile::value_t params ) -{ - Attack attack; - float end = -9999; - - for( unsigned j=1; j < params.params.size(); ++j ) - { - vector sBits; - split( params[j], "=", sBits, false ); - - // Need an identifer and a value for this to work - if( sBits.size() < 2 ) - continue; - - Trim( sBits[0] ); - - if( !sBits[0].CompareNoCase("TIME") ) - attack.fStartSecond = strtof( sBits[1], NULL ); - else if( !sBits[0].CompareNoCase("LEN") ) - attack.fSecsRemaining = strtof( sBits[1], NULL ); - else if( !sBits[0].CompareNoCase("END") ) - end = strtof( sBits[1], NULL ); - else if( !sBits[0].CompareNoCase("MODS") ) - { - Trim(sBits[1]); - attack.sModifiers = sBits[1]; - - if( end != -9999 ) - { - attack.fSecsRemaining = end - attack.fStartSecond; - end = -9999; - } - - if( attack.fSecsRemaining < 0.0f ) - attack.fSecsRemaining = 0.0f; - - attacks.push_back( attack ); - } - } -} - void SMLoader::ProcessInstrumentTracks( Song &out, const RString &sParam ) { vector vs1; diff --git a/src/NotesLoaderSM.h b/src/NotesLoaderSM.h index 84375742dc..519e2de42c 100644 --- a/src/NotesLoaderSM.h +++ b/src/NotesLoaderSM.h @@ -154,17 +154,6 @@ struct SMLoader virtual void ProcessBGChanges( Song &out, const RString &sValueName, const RString &sPath, const RString &sParam ); - /** - * @brief Put the attacks in the attacks string. - * @param attacks the attack string. - * @param params the params from the simfile. */ - virtual void ProcessAttackString(vector &attacks, MsdFile::value_t params); - - /** - * @brief Put the attacks in the attacks array. - * @param attacks the attacks array. - * @param params the params from the simfile. */ - void ProcessAttacks( AttackArray &attacks, MsdFile::value_t params ); void ProcessInstrumentTracks( Song &out, const RString &sParam ); /** diff --git a/src/NotesLoaderSMA.cpp b/src/NotesLoaderSMA.cpp index 1e869a7350..f95d6393c3 100644 --- a/src/NotesLoaderSMA.cpp +++ b/src/NotesLoaderSMA.cpp @@ -415,13 +415,6 @@ bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach split( sParams[1], ",", out.m_vsKeysoundFile ); } - // Attacks loaded from file - else if( sValueName=="ATTACKS" ) - { - ProcessAttackString(out.m_sAttackString, sParams); - ProcessAttacks(out.m_Attacks, sParams); - } - else if( sValueName=="NOTES" || sValueName=="NOTES2" ) { if( iNumParams < 7 ) diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index efe5a8c740..539883c843 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -227,11 +227,6 @@ void SetKeysounds(SongTagInfo& info) { keysounds = keysounds.substr(1); } split(keysounds, ",", info.song->m_vsKeysoundFile); } -void SetAttacks(SongTagInfo& info) -{ - info.loader->ProcessAttackString(info.song->m_sAttackString, (*info.params)); - info.loader->ProcessAttacks(info.song->m_Attacks, (*info.params)); -} void SetOffset(SongTagInfo& info) { info.song->m_SongTiming.m_fBeat0OffsetInSeconds = StringToFloat((*info.params)[1]); @@ -479,14 +474,6 @@ void SetStepsLabels(StepsTagInfo& info) } info.ssc_format= true; } -void SetStepsAttacks(StepsTagInfo& info) -{ - if(info.song->m_fVersion >= VERSION_SPLIT_TIMING || info.for_load_edit) - { - info.loader->ProcessAttackString(info.steps->m_sAttackString, *info.params); - info.loader->ProcessAttacks(info.steps->m_Attacks, *info.params); - } -} void SetStepsOffset(StepsTagInfo& info) { if(info.song->m_fVersion >= VERSION_SPLIT_TIMING || info.for_load_edit) @@ -584,7 +571,6 @@ struct ssc_parser_helper_t song_tag_handlers["ANIMATIONS"]= &SetBGChanges; song_tag_handlers["FGCHANGES"]= &SetFGChanges; song_tag_handlers["KEYSOUNDS"]= &SetKeysounds; - song_tag_handlers["ATTACKS"]= &SetAttacks; song_tag_handlers["OFFSET"]= &SetOffset; /* Below are the song based timings that should only be used * if the steps do not have their own timing. */ @@ -637,7 +623,6 @@ struct ssc_parser_helper_t steps_tag_handlers["LABELS"]= &SetStepsLabels; /* If this is called, the chart does not use the same attacks * as the Song's timing. No other changes are required. */ - steps_tag_handlers["ATTACKS"]= &SetStepsAttacks; steps_tag_handlers["OFFSET"]= &SetStepsOffset; steps_tag_handlers["DISPLAYBPM"]= &SetStepsDisplayBPM; steps_tag_handlers["CHARTKEY"] = &SetChartKey; diff --git a/src/NotesWriterSM.cpp b/src/NotesWriterSM.cpp index 2a1dbab167..3b8102e0a6 100644 --- a/src/NotesWriterSM.cpp +++ b/src/NotesWriterSM.cpp @@ -187,8 +187,6 @@ static void WriteGlobalTags( RageFile &f, Song &out ) f.Write( "," ); } f.PutLine( ";" ); - - f.PutLine( ssprintf("#ATTACKS:%s;", out.GetAttackString().c_str()) ); } /** diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index 8eeb5565df..3a9e643e1d 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -328,24 +328,6 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) f.PutLine(";"); } - if (!out.m_Attacks.empty()) - { - // attacks section - //f.PutLine(fmt::sprintf("#ATTACKS:%s;", out.GetAttackString().c_str())); - f.PutLine("#ATTACKS:"); - for (unsigned j = 0; j < out.m_Attacks.size(); j++) - { - const Attack &a = out.m_Attacks[j]; - f.Write(ssprintf(" TIME=%.2f:LEN=%.2f:MODS=%s", - a.fStartSecond, a.fSecsRemaining, a.sModifiers.c_str())); - - if (j + 1 < out.m_Attacks.size()) - { - f.Write(":"); - } - } - f.Write(";"); - } f.PutLine(""); } @@ -400,10 +382,6 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa GetTimingTags(lines, in.m_Timing); } - // todo: get this to output similar to course mods -aj - if (song.GetAttackString() != in.GetAttackString()) - lines.push_back(ssprintf("#ATTACKS:%s;", in.GetAttackString().c_str())); - switch (in.GetDisplayBPM()) { case DISPLAY_BPM_ACTUAL: diff --git a/src/Player.cpp b/src/Player.cpp index 7626d15e03..131d3884dc 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -14,7 +14,6 @@ #include "ThemeManager.h" #include "ScoreDisplay.h" #include "LifeMeter.h" -#include "CombinedLifeMeter.h" #include "PlayerAI.h" #include "NoteField.h" #include "NoteDataUtil.h" @@ -126,9 +125,6 @@ void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, RString &sNameOut, floa case TW_Roll: defaultValueOut = 0.500f; break; - case TW_Attack: - defaultValueOut = 0.135f; - break; case TW_Checkpoint: // similar to TW_Hold, but a little more strict/accurate to Pump play. defaultValueOut = 0.1664f; break; @@ -237,12 +233,10 @@ Player::Player( NoteData &nd, bool bVisibleParts ) : m_NoteData(nd) m_fNoteFieldHeight = 0; m_pLifeMeter = NULL; - m_pCombinedLifeMeter = NULL; m_pScoreDisplay = NULL; m_pSecondaryScoreDisplay = NULL; m_pPrimaryScoreKeeper = NULL; m_pSecondaryScoreKeeper = NULL; - m_pInventory = NULL; m_pIterNeedsTapJudging = NULL; m_pIterNeedsHoldJudging = NULL; m_pIterUncrossedRows = NULL; @@ -252,13 +246,6 @@ Player::Player( NoteData &nd, bool bVisibleParts ) : m_NoteData(nd) m_bPaused = false; m_bDelay = false; - m_pAttackDisplay = NULL; - if( bVisibleParts ) - { - m_pAttackDisplay = new AttackDisplay; - this->AddChild( m_pAttackDisplay ); - } - PlayerAI::InitFromDisk(); m_pNoteField = NULL; @@ -274,7 +261,6 @@ Player::Player( NoteData &nd, bool bVisibleParts ) : m_NoteData(nd) Player::~Player() { - SAFE_DELETE( m_pAttackDisplay ); SAFE_DELETE( m_pNoteField ); for( unsigned i = 0; i < m_vpHoldJudgment.size(); ++i ) SAFE_DELETE( m_vpHoldJudgment[i] ); @@ -293,19 +279,14 @@ void Player::Init( PlayerState* pPlayerState, PlayerStageStats* pPlayerStageStats, LifeMeter* pLM, - CombinedLifeMeter* pCombinedLM, ScoreDisplay* pScoreDisplay, ScoreDisplay* pSecondaryScoreDisplay, - Inventory* pInventory, ScoreKeeper* pPrimaryScoreKeeper, ScoreKeeper* pSecondaryScoreKeeper ) { GRAY_ARROWS_Y_STANDARD.Load( sType, "ReceptorArrowsYStandard" ); GRAY_ARROWS_Y_REVERSE.Load( sType, "ReceptorArrowsYReverse" ); - ATTACK_DISPLAY_X.Load( sType, ATTACK_DISPLAY_X_NAME, NUM_PLAYERS, 2 ); - ATTACK_DISPLAY_Y.Load( sType, "AttackDisplayY" ); - ATTACK_DISPLAY_Y_REVERSE.Load( sType, "AttackDisplayYReverse" ); HOLD_JUDGMENT_Y_STANDARD.Load( sType, "HoldJudgmentYStandard" ); HOLD_JUDGMENT_Y_REVERSE.Load( sType, "HoldJudgmentYReverse" ); BRIGHT_GHOST_COMBO_THRESHOLD.Load( sType, "BrightGhostComboThreshold" ); @@ -380,10 +361,8 @@ void Player::Init( m_pPlayerState = pPlayerState; m_pPlayerStageStats = pPlayerStageStats; m_pLifeMeter = pLM; - m_pCombinedLifeMeter = pCombinedLM; m_pScoreDisplay = pScoreDisplay; m_pSecondaryScoreDisplay = pSecondaryScoreDisplay; - m_pInventory = pInventory; m_pPrimaryScoreKeeper = pPrimaryScoreKeeper; m_pSecondaryScoreKeeper = pSecondaryScoreKeeper; @@ -407,21 +386,6 @@ void Player::Init( SoundParams.m_bSupportPan = true; m_soundMine.Load( THEME->GetPathS(sType,"mine"), true, &SoundParams ); - /* Attacks can be launched in course modes and in battle modes. They both come - * here to play, but allow loading a different sound for different modes. */ - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_RAVE: - case PLAY_MODE_BATTLE: - m_soundAttackLaunch.Load( THEME->GetPathS(sType,"battle attack launch"), true, &SoundParams ); - m_soundAttackEnding.Load( THEME->GetPathS(sType,"battle attack ending"), true, &SoundParams ); - break; - default: - m_soundAttackLaunch.Load( THEME->GetPathS(sType,"course attack launch"), true, &SoundParams ); - m_soundAttackEnding.Load( THEME->GetPathS(sType,"course attack ending"), true, &SoundParams ); - break; - } - // calculate M-mod speed here, so we can adjust properly on a per-song basis. // XXX: can we find a better location for this? // Always calculate the reading bpm, to allow switching to an mmod mid-song. @@ -468,8 +432,6 @@ void Player::Init( float fBalance = GameSoundManager::GetPlayerBalance( pn ); m_soundMine.SetProperty( "Pan", fBalance ); - m_soundAttackLaunch.SetProperty( "Pan", fBalance ); - m_soundAttackEnding.SetProperty( "Pan", fBalance ); if( HasVisibleParts() ) { @@ -523,8 +485,6 @@ void Player::Init( m_vbFretIsDown.resize( GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_iColsPerPlayer ); FOREACH( bool, m_vbFretIsDown, b ) *b = false; - - m_fActiveRandomAttackStart = -1.0f; } /** * @brief Determine if a TapNote needs a tap note style judgment. @@ -637,8 +597,6 @@ void Player::Load() { SetCombo( m_pPlayerStageStats->m_iCurCombo, m_pPlayerStageStats->m_iCurMissCombo ); // combo can persist between songs and games } - if( m_pAttackDisplay ) - m_pAttackDisplay->Init( m_pPlayerState ); /* Don't re-init this; that'll reload graphics. Add a separate Reset() call * if some ScoreDisplays need it. */ @@ -675,44 +633,6 @@ void Player::Load() // Generate some cache data structure. GenerateCacheDataStructure(m_pPlayerState, m_NoteData); - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_RAVE: - case PLAY_MODE_BATTLE: - { - // ugly, ugly, ugly. Works only w/ dance. - // Why does this work only with dance? - Steve - // it has to do with there only being four cases. This is a lame - // workaround, but since only DDR has ever really implemented those - // modes, it's stayed like this. -aj - StepsType st = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType; - NoteDataUtil::TransformNoteData(m_NoteData, *m_Timing, m_pPlayerState->m_PlayerOptions.GetStage(), st); - - if (BATTLE_RAVE_MIRROR) - { - // shuffle either p1 or p2 - static int count = 0; - switch( count ) - { - case 0: - case 3: - NoteDataUtil::Turn( m_NoteData, st, NoteDataUtil::left); - break; - case 1: - case 2: - NoteDataUtil::Turn( m_NoteData, st, NoteDataUtil::right); - break; - default: - FAIL_M(ssprintf("Count %i not in range 0-3", count)); - } - count++; - count %= 4; - } - break; - } - default: break; - } - int iDrawDistanceAfterTargetsPixels = GAMESTATE->IsEditing() ? -100 : DRAW_DISTANCE_AFTER_TARGET_PIXELS; int iDrawDistanceBeforeTargetsPixels = GAMESTATE->IsEditing() ? 400 : DRAW_DISTANCE_BEFORE_TARGET_PIXELS; @@ -725,9 +645,6 @@ void Player::Load() } bool bPlayerUsingBothSides = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->GetUsesCenteredArrows(); - if( m_pAttackDisplay ) - m_pAttackDisplay->SetX( ATTACK_DISPLAY_X.GetValue(pn, bPlayerUsingBothSides) - 40 ); - // set this in Update //m_pAttackDisplay->SetY( bReverse ? ATTACK_DISPLAY_Y_REVERSE : ATTACK_DISPLAY_Y ); // set this in Update //m_pJudgment->SetX( JUDGMENT_X.GetValue(pn,bPlayerUsingBothSides) ); @@ -841,39 +758,6 @@ void Player::Update( float fDeltaTime ) // if the Player doesn't show anything on the screen. if( HasVisibleParts() ) { - // Random Attack Mod - if( m_pPlayerState->m_PlayerOptions.GetCurrent().m_fRandAttack ) - { - float fCurrentGameTime = STATSMAN->m_CurStageStats.m_fGameplaySeconds; - - const float fAttackRunTime = ATTACK_RUN_TIME_RANDOM; - - // Don't start until 1 seconds into game, minimum - if( fCurrentGameTime > 1.0f ) - { - /* Update the attack if there are no others currently running. - * Note that we have a new one activate a little early; This is - * to have a bit of overlap rather than an abrupt change. */ - if( (fCurrentGameTime - m_fActiveRandomAttackStart) > (fAttackRunTime - 0.5f) ) - { - m_fActiveRandomAttackStart = fCurrentGameTime; - - Attack attRandomAttack; - attRandomAttack.sModifiers = ApplyRandomAttack(); - attRandomAttack.fSecsRemaining = fAttackRunTime; - m_pPlayerState->LaunchAttack( attRandomAttack ); - } - } - } - - if( g_bEnableAttackSoundPlayback ) - { - if( m_pPlayerState->m_bAttackBeganThisUpdate ) - m_soundAttackLaunch.Play(false); - if( m_pPlayerState->m_bAttackEndedThisUpdate ) - m_soundAttackEnding.Play(false); - } - float fMiniPercent = m_pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_MINI]; float fTinyPercent = m_pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY]; float fJudgmentZoom = min( powf(0.5f, fMiniPercent+fTinyPercent), 1.0f ); @@ -1080,8 +964,6 @@ void Player::Update( float fDeltaTime ) { UpdateTapNotesMissedOlderThan( GetMaxStepDistanceSeconds() ); } - // process transforms that are waiting to be applied - ApplyWaitingTransforms(); } // Update a group of holds with shared scoring/life. All of these holds will have the same start row. @@ -1478,29 +1360,6 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vectorTrace("[Player::UpdateHoldNotes] ends"); } -void Player::ApplyWaitingTransforms() -{ - for( unsigned j=0; jm_ModsToApply.size(); j++ ) - { - const Attack &mod = m_pPlayerState->m_ModsToApply[j]; - PlayerOptions po; - // if re-adding noteskin changes, blank out po.m_sNoteSkin. -aj - po.FromString( mod.sModifiers ); - - float fStartBeat, fEndBeat; - mod.GetRealtimeAttackBeats( GAMESTATE->m_pCurSong, m_pPlayerState, fStartBeat, fEndBeat ); - fEndBeat = min( fEndBeat, m_NoteData.GetLastBeat() ); - - LOG->Trace( "Applying transform '%s' from %f to %f to '%s'", mod.sModifiers.c_str(), fStartBeat, fEndBeat, - GAMESTATE->m_pCurSong->GetTranslitMainTitle().c_str() ); - - // if re-adding noteskin changes, this is one place to edit -aj - - NoteDataUtil::TransformNoteData(m_NoteData, *m_Timing, po, GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat)); - } - m_pPlayerState->m_ModsToApply.clear(); -} - void Player::DrawPrimitives() { // TODO: Remove use of PlayerNumber. @@ -1540,9 +1399,6 @@ void Player::DrawPrimitives() m_sprCombo->Draw(); } - if( m_pAttackDisplay ) - m_pAttackDisplay->Draw(); - if( TAP_JUDGMENTS_UNDER_FIELD ) DrawTapJudgments(); @@ -1647,8 +1503,6 @@ void Player::ChangeLife( TapNoteScore tns ) PlayerNumber pn = m_pPlayerState->m_PlayerNumber; if( m_pLifeMeter ) m_pLifeMeter->ChangeLife( tns ); - if( m_pCombinedLifeMeter ) - m_pCombinedLifeMeter->ChangeLife( pn, tns ); ChangeLifeRecord(); @@ -1671,8 +1525,6 @@ void Player::ChangeLife( HoldNoteScore hns, TapNoteScore tns ) PlayerNumber pn = m_pPlayerState->m_PlayerNumber; if( m_pLifeMeter ) m_pLifeMeter->ChangeLife( hns, tns ); - if( m_pCombinedLifeMeter ) - m_pCombinedLifeMeter->ChangeLife( pn, hns, tns ); ChangeLifeRecord(); } @@ -1689,10 +1541,6 @@ void Player::ChangeLife(float delta) { m_pLifeMeter->ChangeLife(delta); } - if(m_pCombinedLifeMeter) - { - m_pCombinedLifeMeter->ChangeLife(pn, delta); - } ChangeLifeRecord(); } @@ -1708,10 +1556,6 @@ void Player::SetLife(float value) { m_pLifeMeter->SetLife(value); } - if(m_pCombinedLifeMeter) - { - m_pCombinedLifeMeter->SetLife(pn, value); - } ChangeLifeRecord(); } @@ -1723,12 +1567,6 @@ void Player::ChangeLifeRecord() { fLife = m_pLifeMeter->GetLife(); } - else if( m_pCombinedLifeMeter ) - { - fLife = GAMESTATE->m_fTugLifePercentP1; - if( pn == PLAYER_2 ) - fLife = 1.0f - fLife; - } if( fLife != -1 ) if( m_pPlayerStageStats ) m_pPlayerStageStats->SetLifeRecordAt( fLife, STATSMAN->m_CurStageStats.m_fStepsSeconds ); @@ -1896,8 +1734,6 @@ void Player::DoTapScoreNone() m_pLifeMeter->HandleTapScoreNone(); // TODO: Remove use of PlayerNumber PlayerNumber pn = PLAYER_INVALID; - if( m_pCombinedLifeMeter ) - m_pCombinedLifeMeter->HandleTapScoreNone( pn ); if( PENALIZE_TAP_SCORE_NONE ) { @@ -2164,10 +2000,6 @@ void Player::Step( int col, int row, const std::chrono::steady_clock::time_point m_Timing->IsJudgableAtRow(iSongRow)) score = TNS_HitMine; break; - case TapNoteType_Attack: - if( !bRelease && fSecondsFromExact <= GetWindowSeconds(TW_Attack) && !pTN->result.bHidden ) - score = AllowW1() ? TNS_W1 : TNS_W2; // sentinel - break; case TapNoteType_HoldHead: // oh wow, this was causing the trigger before the hold heads // bug. (It was fNoteOffset > 0.f before) -DaisuMaster @@ -2312,37 +2144,6 @@ void Player::Step( int col, int row, const std::chrono::steady_clock::time_point FAIL_M(ssprintf("Invalid player controller type: %i", m_pPlayerState->m_PlayerController)); } - // handle attack notes - if( pTN->type == TapNoteType_Attack && score == TNS_W2 ) - { - score = TNS_None; // don't score this as anything - - m_soundAttackLaunch.Play(false); - - // put attack in effect - Attack attack( - ATTACK_LEVEL_1, - -1, // now - pTN->fAttackDurationSeconds, - pTN->sAttackModifiers, - true, - false - ); - - // TODO: Remove use of PlayerNumber - PlayerNumber pnToAttack = OPPOSITE_PLAYER[m_pPlayerState->m_PlayerNumber]; - PlayerState *pPlayerStateToAttack = GAMESTATE->m_pPlayerState[pnToAttack]; - pPlayerStateToAttack->LaunchAttack( attack ); - - // remove all TapAttacks on this row - for( int t=0; tm_PlayerController == PC_HUMAN && score >= TNS_W3 ) AdjustSync::HandleAutosync( fNoteOffset, fStepSeconds ); @@ -2586,23 +2387,7 @@ void Player::UpdateJudgedRows(float fDeltaTime) else if( g_bEnableMineSoundPlayback ) setSounds.insert( &m_soundMine ); - /* Attack Mines: - * Only difference is these launch an attack rather than affecting - * the lifebar. All the other mine impacts (score, dance points, - * etc.) are still applied. */ - if( m_pPlayerState->m_PlayerOptions.GetCurrent().m_bTransforms[PlayerOptions::TRANSFORM_ATTACKMINES] ) - { - const float fAttackRunTime = ATTACK_RUN_TIME_MINE; - - Attack attMineAttack; - attMineAttack.sModifiers = ApplyRandomAttack(); - attMineAttack.fStartSecond = ATTACK_STARTS_NOW; - attMineAttack.fSecsRemaining = fAttackRunTime; - - m_pPlayerState->LaunchAttack( attMineAttack ); - } - else - ChangeLife( tn.result.tns ); + ChangeLife( tn.result.tns ); if( m_pScoreDisplay ) m_pScoreDisplay->OnJudgment( tn.result.tns ); @@ -3340,18 +3125,6 @@ void Player::IncrementComboOrMissCombo(bool bComboOrMissCombo) SendComboMessages( iOldCombo, iOldMissCombo ); } -RString Player::ApplyRandomAttack() -{ - if( GAMESTATE->m_RandomAttacks.size() < 1 ) - return ""; - - DateTime now = DateTime::GetNowDate(); - int iSeed = now.tm_hour * now.tm_min * now.tm_sec * now.tm_mday; - RandomGen rnd( GAMESTATE->m_iStageSeed * iSeed ); - int iAttackToUse = rnd() % GAMESTATE->m_RandomAttacks.size(); - return GAMESTATE->m_RandomAttacks[iAttackToUse]; -} - // lua start #include "LuaBinding.h" diff --git a/src/Player.h b/src/Player.h index 0d3eb94976..a3fb47b650 100644 --- a/src/Player.h +++ b/src/Player.h @@ -5,7 +5,6 @@ #include "HoldJudgment.h" #include "NoteDataWithScoring.h" #include "RageSound.h" -#include "AttackDisplay.h" #include "NoteData.h" #include "ScreenMessage.h" #include "ThemeMetric.h" @@ -15,13 +14,12 @@ class ScoreDisplay; class LifeMeter; -class CombinedLifeMeter; class ScoreKeeper; -class Inventory; class RageTimer; class NoteField; class PlayerStageStats; class JudgedRows; +class PlayerState; // todo: replace these with a Message and MESSAGEMAN? -aj AutoScreenMessage( SM_100Combo ); @@ -84,10 +82,8 @@ class Player: public ActorFrame PlayerState* pPlayerState, PlayerStageStats* pPlayerStageStats, LifeMeter* pLM, - CombinedLifeMeter* pCombinedLM, ScoreDisplay* pScoreDisplay, ScoreDisplay* pSecondaryScoreDisplay, - Inventory* pInventory, ScoreKeeper* pPrimaryScoreKeeper, ScoreKeeper* pSecondaryScoreKeeper ); void Load(); @@ -112,7 +108,6 @@ class Player: public ActorFrame void FadeToFail(); void CacheAllUsedNoteSkins(); TapNoteScore GetLastTapNoteScore() const { return m_LastTapNoteScore; } - void ApplyWaitingTransforms(); void SetPaused( bool bPaused ) { m_bPaused = bPaused; } static float GetMaxStepDistanceSeconds(); @@ -173,8 +168,6 @@ class Player: public ActorFrame int GetClosestNonEmptyRowDirectional( int iStartRow, int iMaxRowsAhead, bool bAllowGraded, bool bForward ) const; int GetClosestNonEmptyRow( int iNoteRow, int iMaxRowsAhead, int iMaxRowsBehind, bool bAllowGraded ) const; - RString ApplyRandomAttack(); - inline void HideNote( int col, int row ) { NoteData::iterator iter = m_NoteData.FindTapNote( col, row ); @@ -204,16 +197,12 @@ class Player: public ActorFrame Actor *m_pActorWithJudgmentPosition; Actor *m_pActorWithComboPosition; - AttackDisplay *m_pAttackDisplay; - TapNoteScore m_LastTapNoteScore; LifeMeter *m_pLifeMeter; - CombinedLifeMeter *m_pCombinedLifeMeter; ScoreDisplay *m_pScoreDisplay; ScoreDisplay *m_pSecondaryScoreDisplay; ScoreKeeper *m_pPrimaryScoreKeeper; ScoreKeeper *m_pSecondaryScoreKeeper; - Inventory *m_pInventory; int m_iFirstUncrossedRow; // used by hold checkpoints logic NoteData::all_tracks_iterator *m_pIterNeedsTapJudging; @@ -226,10 +215,6 @@ class Player: public ActorFrame JudgedRows *m_pJudgedRows; RageSound m_soundMine; - RageSound m_soundAttackLaunch; - RageSound m_soundAttackEnding; - - float m_fActiveRandomAttackStart; vector m_vbFretIsDown; @@ -237,9 +222,6 @@ class Player: public ActorFrame ThemeMetric GRAY_ARROWS_Y_STANDARD; ThemeMetric GRAY_ARROWS_Y_REVERSE; - ThemeMetric2D ATTACK_DISPLAY_X; - ThemeMetric ATTACK_DISPLAY_Y; - ThemeMetric ATTACK_DISPLAY_Y_REVERSE; ThemeMetric HOLD_JUDGMENT_Y_STANDARD; ThemeMetric HOLD_JUDGMENT_Y_REVERSE; ThemeMetric BRIGHT_GHOST_COMBO_THRESHOLD; diff --git a/src/PlayerAI.cpp b/src/PlayerAI.cpp index 29b73a9bf7..f353211198 100644 --- a/src/PlayerAI.cpp +++ b/src/PlayerAI.cpp @@ -120,25 +120,6 @@ TapNoteScore PlayerAI::GetTapNoteScore( const PlayerState* pPlayerState ) int iCpuSkill = pPlayerState->m_iCpuSkill; - /* If we're in battle mode, reduce the skill based on the number of modifier - * attacks against us. If we're in demonstration or jukebox mode with - * modifiers attached, don't make demonstration miss a lot. */ - // Idea: weight certain modifiers (boomerang, tornado) more? (to simulate - // readability problems) -aj - if( !GAMESTATE->m_bDemonstrationOrJukebox ) - { - int iSumOfAttackLevels = - pPlayerState->m_fSecondsUntilAttacksPhasedOut > 0 ? - pPlayerState->m_iLastPositiveSumOfAttackLevels : - 0; - - ASSERT_M( iCpuSkill>=0 && iCpuSkillm_PlayerController == PC_CPU, ssprintf("%i", pPlayerState->m_PlayerController) ); - - iCpuSkill -= iSumOfAttackLevels*3; - CLAMP( iCpuSkill, 0, NUM_SKILL_LEVELS-1 ); - } - TapScoreDistribution& distribution = g_Distributions[iCpuSkill]; return distribution.GetTapNoteScore(); diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index e8cf30bb29..57420578d4 100644 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -904,11 +904,7 @@ bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps, PlayerN // This makes songs with sparse notes easier. if( m_bTransforms[TRANSFORM_ECHO] ) return true; - - // Removing attacks is easier in general. - if ((m_fNoAttack && pSteps->HasAttacks()) || m_fRandAttack) - return true; - + if( m_fCover ) return true; // M-mods make songs with indefinite BPMs easier because diff --git a/src/PlayerState.cpp b/src/PlayerState.cpp index 8a1b635c0c..e39653d02e 100644 --- a/src/PlayerState.cpp +++ b/src/PlayerState.cpp @@ -27,69 +27,20 @@ void PlayerState::Reset() m_iCpuSkill = 5; - m_iLastPositiveSumOfAttackLevels = 0; - m_fSecondsUntilAttacksPhasedOut = 0; - m_bAttackBeganThisUpdate = false; - m_bAttackEndedThisUpdate = false; - m_ActiveAttacks.clear(); - m_ModsToApply.clear(); - m_iTapsHitSinceLastHasteUpdate = 0; m_iTapsMissedSinceLastHasteUpdate = 0; - - m_fSuperMeter = 0; // between 0 and NUM_ATTACK_LEVELS - m_fSuperMeterGrowthScale = 1; - - for( int i=0; iUpdate is run before any of the Screen update's, // so we'll clear these flags here and let them get turned on later - m_bAttackBeganThisUpdate = false; - m_bAttackEndedThisUpdate = false; bool bRebuildPlayerOptions = false; - // See if any delayed attacks are starting or ending. - for( unsigned s=0; s 0 ) - m_fSecondsUntilAttacksPhasedOut = max( 0, m_fSecondsUntilAttacksPhasedOut - fDelta ); } void PlayerState::SetPlayerNumber(PlayerNumber pn) @@ -108,93 +59,6 @@ void PlayerState::ResetToDefaultPlayerOptions( ModsLevel l ) m_PlayerOptions.Assign( l, po ); } -/* This is called to launch an attack, or to queue an attack if a.fStartSecond - * is set. This is also called by GameState::Update when activating a queued attack. */ -void PlayerState::LaunchAttack( const Attack& a ) -{ - LOG->Trace( "Launch attack '%s' against P%d at %f", a.sModifiers.c_str(), m_PlayerNumber+1, a.fStartSecond ); - - Attack attack = a; - - /* If fStartSecond is the sentinel, it means "launch as soon as possible". For m_ActiveAttacks, - * mark the real time it's starting (now), so Update() can know when the attack - * started so it can be removed later. For m_ModsToApply, leave the sentinel in, - * so Player::Update knows to apply attack transforms correctly. (yuck) */ - m_ModsToApply.push_back( attack ); - if( attack.fStartSecond == ATTACK_STARTS_NOW ) - attack.fStartSecond = m_Position.m_fMusicSeconds; - m_ActiveAttacks.push_back( attack ); - - RebuildPlayerOptionsFromActiveAttacks(); -} - -void PlayerState::RemoveActiveAttacks( AttackLevel al ) -{ - for( unsigned s=0; sfSecsRemaining = 0; -} - -void PlayerState::RemoveAllInventory() -{ - for( int s=0; sm_SongOptions.GetStage(); - for( unsigned s=0; sGetMasterPlayerNumber() ) - GAMESTATE->m_SongOptions.Assign( ModsLevel_Song, so ); - - int iSumOfAttackLevels = GetSumOfActiveAttackLevels(); - if( iSumOfAttackLevels > 0 ) - { - m_iLastPositiveSumOfAttackLevels = iSumOfAttackLevels; - m_fSecondsUntilAttacksPhasedOut = 10000; // any positive number that won't run out before the attacks - } - else - { - // don't change! m_iLastPositiveSumOfAttackLevels[p] = iSumOfAttackLevels; - m_fSecondsUntilAttacksPhasedOut = 2; // 2 seconds to phase out - } -} - -int PlayerState::GetSumOfActiveAttackLevels() const -{ - int iSum = 0; - - for( unsigned s=0; s 0 && m_ActiveAttacks[s].level != NUM_ATTACK_LEVELS ) - iSum += m_ActiveAttacks[s].level; - - return iSum; -} - const SongPosition &PlayerState::GetDisplayedPosition() const { if( GAMESTATE->m_bIsUsingStepTiming ) @@ -267,7 +131,10 @@ class LunaPlayerState: public Luna return 1; } DEFINE_METHOD( GetHealthState, m_HealthState ); - DEFINE_METHOD( GetSuperMeterLevel, m_fSuperMeter ); + static int GetSuperMeterLevel(T* p, lua_State *L) { + lua_pushnumber(L, 0.f); + return 1; + } static int SetTargetGoal(T* p, lua_State *L) { p->playertargetgoal = FArg(1); return 1; diff --git a/src/PlayerState.h b/src/PlayerState.h index 5b82078695..0a55dde111 100644 --- a/src/PlayerState.h +++ b/src/PlayerState.h @@ -4,7 +4,6 @@ #define PlayerState_H #include "SongPosition.h" -#include "Attack.h" #include "ModsGroup.h" #include "PlayerNumber.h" #include "PlayerOptions.h" @@ -99,22 +98,7 @@ class PlayerState SampleHistory m_EffectHistory; - // Used in Battle and Rave - void LaunchAttack( const Attack& a ); - void RemoveActiveAttacks( AttackLevel al=NUM_ATTACK_LEVELS /*all*/ ); - void EndActiveAttacks(); - void RebuildPlayerOptionsFromActiveAttacks(); - int GetSumOfActiveAttackLevels() const; - int m_iCpuSkill; // only used when m_PlayerController is PC_CPU - // Attacks take a while to transition out of use. Account for this in PlayerAI - // by still penalizing it for 1 second after the player options are rebuilt. - int m_iLastPositiveSumOfAttackLevels; - float m_fSecondsUntilAttacksPhasedOut; // positive means PlayerAI is still affected - bool m_bAttackBeganThisUpdate; // flag for other objects to watch (play sounds) - bool m_bAttackEndedThisUpdate; // flag for other objects to watch (play sounds) - - AttackArray m_ActiveAttacks; - vector m_ModsToApply; + int m_iCpuSkill; // only used when m_PlayerController is PC_CPU // Haste int m_iTapsHitSinceLastHasteUpdate; @@ -123,13 +107,6 @@ class PlayerState // Stores the bpm that was picked for reading the chart if the player is using an mmod. float m_fReadBPM; - // Used in Rave - float m_fSuperMeter; // between 0 and NUM_ATTACK_LEVELS - float m_fSuperMeterGrowthScale; - // Used in Battle - void RemoveAllInventory(); - Attack m_Inventory[NUM_INVENTORY_SLOTS]; - /* why is the slow getstyles function called every time to get number of columns in places where it can't change? - Mina */ float playertargetgoal = 0.93f; diff --git a/src/ScoreDisplayBattle.cpp b/src/ScoreDisplayBattle.cpp index f3903e56b8..e69de29bb2 100644 --- a/src/ScoreDisplayBattle.cpp +++ b/src/ScoreDisplayBattle.cpp @@ -1,98 +0,0 @@ -#include "global.h" -#include "ScoreDisplayBattle.h" -#include "RageUtil.h" -#include "RageLog.h" -#include "RageLog.h" -#include "GameState.h" -#include "ThemeManager.h" -#include "PlayerState.h" -#include "ActorUtil.h" - -#define ITEM_X( i ) THEME->GetMetricF("ScoreDisplayBattle",ssprintf("Item%dX",i+1)) -#define ITEM_Y( i ) THEME->GetMetricF("ScoreDisplayBattle",ssprintf("Item%dY",i+1)) - -ScoreDisplayBattle::ScoreDisplayBattle() -{ - LOG->Trace( "ScoreDisplayBattle::ScoreDisplayBattle()" ); - - m_sprFrame.Load( THEME->GetPathG("ScoreDisplayBattle","frame") ); - this->AddChild( &m_sprFrame ); - - for( int i=0; iAddChild( &m_ItemIcon[i] ); - } - - vector asIconPaths; - GetDirListing( THEME->GetCurThemeDir()+"Graphic/ScoreDisplayBattle icon*", asIconPaths ); - for( unsigned j=0; jm_Inventory[s]; - RString sNewModifier = attack.sModifiers; - - if( sNewModifier != m_iLastSeenInventory[s] ) - { - m_iLastSeenInventory[s] = sNewModifier; - - if( sNewModifier == "" ) - { - m_ItemIcon[s].RunCommands( ActorUtil::ParseActorCommands( "linear,0.25;zoom,0" ) ); - } - else - { - // TODO: Cache all of the icon graphics so we don't load them dynamically from disk. - m_ItemIcon[s].Load( THEME->GetPathG("ScoreDisplayBattle","icon "+sNewModifier) ); - m_ItemIcon[s].StopTweening(); - apActorCommands acmds = ActorUtil::ParseActorCommands( - "diffuse,1,1,1,1;zoom,1;" - "sleep,0.1;linear,0;diffusealpha,0;" - "sleep,0.1;linear,0;diffusealpha,1;" - "sleep,0.1;linear,0;diffusealpha,0;" - "sleep,0.1;linear,0;diffusealpha,1;" - "sleep,0.1;linear,0;diffusealpha,0;" - "sleep,0.1;linear,0;diffusealpha,1;" ); - m_ItemIcon[s].RunCommands( acmds ); - } - } - } -} - -/* - * (c) 2001-2003 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. - */ diff --git a/src/ScoreDisplayBattle.h b/src/ScoreDisplayBattle.h index 0f6495a01a..e69de29bb2 100644 --- a/src/ScoreDisplayBattle.h +++ b/src/ScoreDisplayBattle.h @@ -1,51 +0,0 @@ -#ifndef SCORE_DISPLAY_BATTLE_H -#define SCORE_DISPLAY_BATTLE_H - -#include "ScoreDisplay.h" -#include "GameConstantsAndTypes.h" -#include "Sprite.h" -#include "RageTexturePreloader.h" - -/** @brief ScoreDisplay implementation for PLAY_MODE_BATTLE. */ -class ScoreDisplayBattle : public ScoreDisplay -{ -public: - ScoreDisplayBattle(); - virtual void Init( const PlayerState* pPlayerState, const PlayerStageStats* pPlayerStageStats ); - - virtual void Update( float fDelta ); - -protected: - Sprite m_sprFrame; - Sprite m_ItemIcon[NUM_INVENTORY_SLOTS]; - - RString m_iLastSeenInventory[NUM_INVENTORY_SLOTS]; - RageTexturePreloader m_TexturePreload; -}; - -#endif - -/* - * (c) 2001-2003 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. - */ diff --git a/src/ScoreDisplayRave.cpp b/src/ScoreDisplayRave.cpp index 7154a1dc9b..e69de29bb2 100644 --- a/src/ScoreDisplayRave.cpp +++ b/src/ScoreDisplayRave.cpp @@ -1,95 +0,0 @@ -#include "global.h" -#include "ScoreDisplayRave.h" -#include "RageUtil.h" -#include "RageLog.h" -#include "ThemeManager.h" -#include "ActorUtil.h" -#include "PlayerState.h" - - -ScoreDisplayRave::ScoreDisplayRave() -{ - LOG->Trace( "ScoreDisplayRave::ScoreDisplayRave()" ); - - m_lastLevelSeen = ATTACK_LEVEL_1; - - for( int i=0; iGetPathG("ScoreDisplayRave",ssprintf("stream level%d",i+1)) ); - m_sprMeter[i].SetCropRight( 1.f ); - } - - m_textLevel.LoadFromFont( THEME->GetPathF("ScoreDisplayRave","level") ); - m_textLevel.SetText( "1" ); -} - -void ScoreDisplayRave::Init( const PlayerState* pPlayerState, const PlayerStageStats* pPlayerStageStats ) -{ - ScoreDisplay::Init( pPlayerState, pPlayerStageStats ); - - PlayerNumber pn = pPlayerState->m_PlayerNumber; - - m_sprFrameBase.Load( THEME->GetPathG("ScoreDisplayRave",ssprintf("frame base p%d",pn+1)) ); - m_sprFrameBase->SetName( ssprintf("FrameBaseP%d",pn+1) ); - LOAD_ALL_COMMANDS_AND_SET_XY( m_sprFrameBase ); - this->AddChild( m_sprFrameBase ); - - for( int i=0; iAddChild( &m_sprMeter[i] ); - } - - m_textLevel.SetName( ssprintf("LevelP%d",pn+1) ); - LOAD_ALL_COMMANDS_AND_SET_XY( m_textLevel ); - this->AddChild( &m_textLevel ); - - m_sprFrameOverlay.Load( THEME->GetPathG("ScoreDisplayRave",ssprintf("frame overlay p%d",pn+1)) ); - m_sprFrameOverlay->SetName( ssprintf("FrameOverP%d",pn+1) ); - LOAD_ALL_COMMANDS_AND_SET_XY( m_sprFrameOverlay ); - this->AddChild( m_sprFrameOverlay ); -} - -void ScoreDisplayRave::Update( float fDelta ) -{ - ScoreDisplay::Update( fDelta ); - - float fLevel = m_pPlayerState->m_fSuperMeter; - AttackLevel level = (AttackLevel)(int)fLevel; - - if( level != m_lastLevelSeen ) - { - m_sprMeter[m_lastLevelSeen].SetCropRight( 1.f ); - m_lastLevelSeen = level; - m_textLevel.SetText( ssprintf("%d",level+1) ); - } - - float fPercent = fLevel - level; - m_sprMeter[level].SetCropRight( 1-fPercent ); -} - -/* - * (c) 2003 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. - */ diff --git a/src/ScoreDisplayRave.h b/src/ScoreDisplayRave.h index 88f9140cd7..e69de29bb2 100644 --- a/src/ScoreDisplayRave.h +++ b/src/ScoreDisplayRave.h @@ -1,53 +0,0 @@ -#ifndef SCORE_DISPLAY_RAVE_H -#define SCORE_DISPLAY_RAVE_H - -#include "ScoreDisplay.h" -#include "GameConstantsAndTypes.h" -#include "Sprite.h" -#include "BitmapText.h" -#include "AutoActor.h" - -/** @brief ScoreDisplay implementation for PLAY_MODE_RAVE. */ -class ScoreDisplayRave : public ScoreDisplay -{ -public: - ScoreDisplayRave(); - virtual void Init( const PlayerState* pPlayerState, const PlayerStageStats* pPlayerStageStats ); - - virtual void Update( float fDelta ); - -protected: - AutoActor m_sprFrameBase; - Sprite m_sprMeter[NUM_ATTACK_LEVELS]; - AutoActor m_sprFrameOverlay; - BitmapText m_textLevel; - - AttackLevel m_lastLevelSeen; -}; - -#endif - -/* - * (c) 2003 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. - */ diff --git a/src/ScoreKeeper.cpp b/src/ScoreKeeper.cpp index bfc3a0c983..04b7819c3d 100644 --- a/src/ScoreKeeper.cpp +++ b/src/ScoreKeeper.cpp @@ -35,8 +35,6 @@ ScoreKeeper* ScoreKeeper::MakeScoreKeeper( const RString &sClassName, PlayerStat { if( sClassName == "ScoreKeeperNormal" ) return new ScoreKeeperNormal( pPlayerState, pPlayerStageStats ); - else if( sClassName == "ScoreKeeperRave" ) - return new ScoreKeeperRave( pPlayerState, pPlayerStageStats ); else if( sClassName == "ScoreKeeperShared" ) return new ScoreKeeperShared( pPlayerState, pPlayerStageStats ); FAIL_M( ssprintf("Invalid ScoreKeeper named %s!", sClassName.c_str() )); diff --git a/src/ScoreKeeper.h b/src/ScoreKeeper.h index f9bbd81baf..061da21096 100644 --- a/src/ScoreKeeper.h +++ b/src/ScoreKeeper.h @@ -4,13 +4,11 @@ #include "GameConstantsAndTypes.h" class NoteData; -class Inventory; class Song; class Steps; class PlayerState; class PlayerStageStats; struct TapNote; -struct AttackArray; /** * @brief Abstract class to handle scorekeeping, stat-taking, etc. @@ -38,8 +36,7 @@ class ScoreKeeper virtual ~ScoreKeeper() { } virtual void Load( const vector &, - const vector &, - const vector & ) { } + const vector & ) { } virtual void DrawPrimitives() { } virtual void Update( float /* fDelta */ ) { } diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index bb239222ad..12b3601701 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -33,12 +33,10 @@ ScoreKeeperNormal::ScoreKeeperNormal( PlayerState *pPlayerState, PlayerStageStat void ScoreKeeperNormal::Load( const vector& apSongs, - const vector& apSteps, - const vector &asModifiers ) + const vector& apSteps ) { m_apSteps = apSteps; ASSERT( apSongs.size() == apSteps.size() ); - ASSERT( apSongs.size() == asModifiers.size() ); // True if a jump is one to combo, false if combo is purely based on tap count. m_ComboIsPerRow.Load( "Gameplay", "ComboIsPerRow" ); @@ -64,7 +62,6 @@ void ScoreKeeperNormal::Load( ASSERT( pSong != NULL ); Steps* pSteps = apSteps[i]; ASSERT( pSteps != NULL ); - const AttackArray &aa = asModifiers[i]; NoteData ndTemp; pSteps->GetNoteData( ndTemp); @@ -75,11 +72,6 @@ void ScoreKeeperNormal::Load( NoteData ndPre; pStyle->GetTransformedNoteDataForStyle( m_pPlayerState->m_PlayerNumber, ndTemp, ndPre ); - /* Compute RadarValues before applying any user-selected mods. Apply - * Course mods and count them in the "pre" RadarValues because they're - * forced and not chosen by the user. */ - NoteDataUtil::TransformNoteData(ndPre, *(pSteps->GetTimingData()), aa, pSteps->m_StepsType, pSong ); - /* Apply user transforms to find out how the notes will really look. * * XXX: This is brittle: if we end up combining mods for a song differently diff --git a/src/ScoreKeeperNormal.h b/src/ScoreKeeperNormal.h index 04026f89b0..52609b6e7a 100644 --- a/src/ScoreKeeperNormal.h +++ b/src/ScoreKeeperNormal.h @@ -63,8 +63,7 @@ class ScoreKeeperNormal: public ScoreKeeper void Load( const vector& apSongs, - const vector& apSteps, - const vector &asModifiers ); + const vector& apSteps); // before a song plays (called multiple times if course) void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData ); diff --git a/src/ScoreKeeperRave.cpp b/src/ScoreKeeperRave.cpp index b48d53bf23..e69de29bb2 100644 --- a/src/ScoreKeeperRave.cpp +++ b/src/ScoreKeeperRave.cpp @@ -1,234 +0,0 @@ -#include "global.h" -#include "ScoreKeeperRave.h" -#include "ThemeManager.h" -#include "RageUtil.h" -#include "GameState.h" -#include "Character.h" -#include "ScreenManager.h" -#include "PrefsManager.h" -#include "ThemeMetric.h" -#include "PlayerState.h" -#include "NoteTypes.h" - -ThemeMetric ATTACK_DURATION_SECONDS ("ScoreKeeperRave","AttackDurationSeconds"); - -static void SuperMeterPercentChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) -{ - ScoreEvent ci = (ScoreEvent)i; - sNameOut = "SuperMeterPercentChange" + ScoreEventToString( ci ); - switch(ci) - { - case SE_CheckpointHit: defaultValueOut = +0.05f; break; - case SE_W1: defaultValueOut = +0.05f; break; - case SE_W2: defaultValueOut = +0.04f; break; - case SE_W3: defaultValueOut = +0.02f; break; - case SE_W4: defaultValueOut = +0.00f; break; - case SE_W5: defaultValueOut = +0.00f; break; - case SE_Miss: defaultValueOut = -0.20f; break; - case SE_HitMine: defaultValueOut = -0.40f; break; - case SE_CheckpointMiss: defaultValueOut = -0.20f; break; - case SE_Held: defaultValueOut = +0.04f; break; - case SE_LetGo: defaultValueOut = -0.20f; break; - case SE_Missed: defaultValueOut = -0.00f; break; - DEFAULT_FAIL(ci); - } -} - -static Preference1D g_fSuperMeterPercentChange( SuperMeterPercentChangeInit, NUM_ScoreEvent ); - -ScoreKeeperRave::ScoreKeeperRave( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats ) : - ScoreKeeper(pPlayerState, pPlayerStageStats) -{ -} - -void ScoreKeeperRave::HandleTapScore( const TapNote &tn ) -{ - TapNoteScore score = tn.result.tns; - float fPercentToMove = 0; - - if( score == TNS_HitMine ) - fPercentToMove = g_fSuperMeterPercentChange[SE_HitMine]; - - AddSuperMeterDelta( fPercentToMove ); -} - -#define CROSSED( val ) (fOld < val && fNew >= val) -#define CROSSED_ATTACK_LEVEL( level ) CROSSED(1.f/NUM_ATTACK_LEVELS*(level+1)) -void ScoreKeeperRave::HandleTapRowScore( const NoteData &nd, int iRow ) -{ - TapNoteScore scoreOfLastTap; - int iNumTapsInRow; - float fPercentToMove = 0.0f; - - GetScoreOfLastTapInRow( nd, iRow, scoreOfLastTap, iNumTapsInRow ); - if( iNumTapsInRow <= 0 ) - return; - switch( scoreOfLastTap ) - { - DEFAULT_FAIL( scoreOfLastTap ); - case TNS_W1: fPercentToMove = g_fSuperMeterPercentChange[SE_W1]; break; - case TNS_W2: fPercentToMove = g_fSuperMeterPercentChange[SE_W2]; break; - case TNS_W3: fPercentToMove = g_fSuperMeterPercentChange[SE_W3]; break; - case TNS_W4: fPercentToMove = g_fSuperMeterPercentChange[SE_W4]; break; - case TNS_W5: fPercentToMove = g_fSuperMeterPercentChange[SE_W5]; break; - case TNS_Miss: fPercentToMove = g_fSuperMeterPercentChange[SE_Miss]; break; - } - AddSuperMeterDelta( fPercentToMove ); -} - -void ScoreKeeperRave::HandleHoldScore( const TapNote &tn ) -{ - // todo: should hit mine be handled in HandleTapRow score instead? -aj - TapNoteScore tapScore = tn.result.tns; - float fPercentToMove = 0.0f; - switch( tapScore ) - { - case TNS_HitMine: - fPercentToMove = g_fSuperMeterPercentChange[SE_HitMine]; - break; - default: break; - } - - // Playing with this code enabled seems to feel "wrong", but I'm leaving it - // in for player feedback. -aj - HoldNoteScore holdScore = tn.HoldResult.hns; - switch( holdScore ) - { - case HNS_Held: fPercentToMove = g_fSuperMeterPercentChange[SE_Held]; break; - case HNS_LetGo: fPercentToMove = g_fSuperMeterPercentChange[SE_LetGo]; break; - case HNS_Missed: fPercentToMove = g_fSuperMeterPercentChange[SE_Missed]; break; - default: break; - } - AddSuperMeterDelta( fPercentToMove ); -} - -extern ThemeMetric PENALIZE_TAP_SCORE_NONE; -void ScoreKeeperRave::HandleTapScoreNone() -{ - if( PENALIZE_TAP_SCORE_NONE ) - { - float fPercentToMove = g_fSuperMeterPercentChange[SE_Miss]; - AddSuperMeterDelta( fPercentToMove ); - } -} - -void ScoreKeeperRave::AddSuperMeterDelta( float fUnscaledPercentChange ) -{ - if( PREFSMAN->m_bMercifulDrain && fUnscaledPercentChange<0 ) - { - float fSuperPercentage = m_pPlayerState->m_fSuperMeter / NUM_ATTACK_LEVELS; - fUnscaledPercentChange *= SCALE( fSuperPercentage, 0.f, 1.f, 0.5f, 1.f); - } - - // more mercy: Grow super meter slower or faster depending on life. - if( PREFSMAN->m_bMercifulSuperMeter ) - { - float fLifePercentage = 0; - switch( m_pPlayerState->m_PlayerNumber ) - { - case PLAYER_1: fLifePercentage = GAMESTATE->m_fTugLifePercentP1; break; - case PLAYER_2: fLifePercentage = 1 - GAMESTATE->m_fTugLifePercentP1; break; - default: - FAIL_M(ssprintf("Invalid player number: %i", m_pPlayerState->m_PlayerNumber)); - } - CLAMP( fLifePercentage, 0.f, 1.f ); - if( fUnscaledPercentChange > 0 ) - fUnscaledPercentChange *= SCALE( fLifePercentage, 0.f, 1.f, 1.7f, 0.3f); - else // fUnscaledPercentChange <= 0 - fUnscaledPercentChange /= SCALE( fLifePercentage, 0.f, 1.f, 1.7f, 0.3f); - } - - // mercy: drop super meter faster if at a higher level - if( fUnscaledPercentChange < 0 ) - fUnscaledPercentChange *= SCALE( m_pPlayerState->m_fSuperMeter, 0.f, 1.f, 0.01f, 1.f ); - - AttackLevel oldAL = (AttackLevel)(int)m_pPlayerState->m_fSuperMeter; - - float fPercentToMove = fUnscaledPercentChange; - m_pPlayerState->m_fSuperMeter += fPercentToMove * m_pPlayerState->m_fSuperMeterGrowthScale; - CLAMP( m_pPlayerState->m_fSuperMeter, 0.f, NUM_ATTACK_LEVELS ); - - AttackLevel newAL = (AttackLevel)(int)m_pPlayerState->m_fSuperMeter; - - if( newAL > oldAL ) - { - LaunchAttack( oldAL ); - if( newAL == NUM_ATTACK_LEVELS ) // hit upper bounds of meter - m_pPlayerState->m_fSuperMeter -= 1.f; - } - - // mercy: if losing remove attacks on life drain - if( fUnscaledPercentChange < 0 ) - { - bool bWinning; - switch( m_pPlayerState->m_PlayerNumber ) - { - case PLAYER_1: bWinning = GAMESTATE->m_fTugLifePercentP1 > 0.5f; break; - case PLAYER_2: bWinning = GAMESTATE->m_fTugLifePercentP1 < 0.5f; break; - default: - bWinning = false; - FAIL_M(ssprintf("Invalid player number: %i", m_pPlayerState->m_PlayerNumber)); - } - if( !bWinning ) - m_pPlayerState->EndActiveAttacks(); - } -} - -void ScoreKeeperRave::LaunchAttack( AttackLevel al ) -{ - PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - - RString* asAttacks = GAMESTATE->m_pCurCharacters[pn]->m_sAttacks[al]; // [NUM_ATTACKS_PER_LEVEL] - RString sAttackToGive; - - if (GAMESTATE->m_pCurCharacters[pn] != NULL) - sAttackToGive = asAttacks[ RandomInt(NUM_ATTACKS_PER_LEVEL) ]; - else - { - // "If you add any noteskins here, you need to make sure they're cached, too." -? - // Noteskins probably won't work here anymore. -aj - RString DefaultAttacks[8] = { "1.5x", "2.0x", "0.5x", "reverse", "sudden", "boost", "brake", "wave" }; - sAttackToGive = DefaultAttacks[ RandomInt(8) ]; - } - - PlayerNumber pnToAttack = OPPOSITE_PLAYER[pn]; - PlayerState *pPlayerStateToAttack = GAMESTATE->m_pPlayerState[pnToAttack]; - - Attack a; - a.level = al; - a.fSecsRemaining = ATTACK_DURATION_SECONDS; - a.sModifiers = sAttackToGive; - - // remove current attack (if any) - pPlayerStateToAttack->RemoveActiveAttacks(); - - // apply new attack - pPlayerStateToAttack->LaunchAttack( a ); - -// SCREENMAN->SystemMessage( ssprintf( "attacking %d with %s", pnToAttack, sAttackToGive.c_str() ) ); -} - -/* - * (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. - */ diff --git a/src/ScoreKeeperRave.h b/src/ScoreKeeperRave.h index 3f8be61e69..e69de29bb2 100644 --- a/src/ScoreKeeperRave.h +++ b/src/ScoreKeeperRave.h @@ -1,49 +0,0 @@ -#ifndef SCORE_KEEPER_RAVE_H -#define SCORE_KEEPER_RAVE_H - -#include "ScoreKeeper.h" -#include "GameConstantsAndTypes.h" - -/** @brief Launches attacks in PLAY_MODE_RAVE. */ -class ScoreKeeperRave : public ScoreKeeper -{ -public: - ScoreKeeperRave( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats ); - void OnNextSong( int /* iSongInCourseIndex */, const Steps *, const NoteData * ) { } - void HandleTapScore( const TapNote &tn ); - void HandleTapRowScore( const NoteData &nd, int iRow ); - void HandleHoldScore( const TapNote &tn ); - void HandleHoldActiveSeconds( float /* fMusicSecondsHeld */ ) {} - void HandleTapScoreNone(); - -protected: - void LaunchAttack( AttackLevel al ); - void AddSuperMeterDelta( float fUnscaledPercentChange ); -}; - -#endif - -/* - * (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. - */ diff --git a/src/ScoreKeeperShared.cpp b/src/ScoreKeeperShared.cpp index 6686adf4f2..0e4f6db89a 100644 --- a/src/ScoreKeeperShared.cpp +++ b/src/ScoreKeeperShared.cpp @@ -13,12 +13,11 @@ ScoreKeeperShared::ScoreKeeperShared( PlayerState *pPlayerState, PlayerStageStat void ScoreKeeperShared::Load( const vector &apSongs, - const vector &apSteps, - const vector &asModifiers ) + const vector &apSteps) { if( m_pPlayerState->m_PlayerNumber != GAMESTATE->GetMasterPlayerNumber() ) return; - ScoreKeeperNormal::Load( apSongs, apSteps, asModifiers ); + ScoreKeeperNormal::Load( apSongs, apSteps); } // These ScoreKeepers don't get to draw. diff --git a/src/ScoreKeeperShared.h b/src/ScoreKeeperShared.h index 317565294a..3fe0264824 100644 --- a/src/ScoreKeeperShared.h +++ b/src/ScoreKeeperShared.h @@ -12,8 +12,7 @@ class ScoreKeeperShared : public ScoreKeeperNormal virtual void Load( const vector &apSongs, - const vector &apSteps, - const vector &asModifiers ); + const vector &apSteps); virtual void DrawPrimitives(); virtual void Update( float fDelta ); diff --git a/src/ScreenEvaluation.cpp b/src/ScreenEvaluation.cpp index b43840c087..2a8b5a4ab0 100644 --- a/src/ScreenEvaluation.cpp +++ b/src/ScreenEvaluation.cpp @@ -671,13 +671,6 @@ void ScreenEvaluation::Init() { switch( GAMESTATE->m_PlayMode ) { - case PLAY_MODE_BATTLE: - { - bool bWon = GAMESTATE->GetStageResult(GAMESTATE->GetMasterPlayerNumber()) == RESULT_WIN; - RString sResult = bWon ? "win" : "lose"; - SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation "+sResult) ); - } - break; default: SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation "+GradeToOldString(best_grade)) ); break; diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index b40e948e4e..6924e46bb9 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -28,8 +28,6 @@ #include "RageSoundReader.h" #include "RageTextureManager.h" #include "GameSoundManager.h" -#include "CombinedLifeMeterTug.h" -#include "Inventory.h" #include "NoteDataUtil.h" #include "ProfileManager.h" #include "StatsManager.h" @@ -45,7 +43,6 @@ #include "CommonMetrics.h" #include "InputMapper.h" #include "Game.h" -#include "ActiveAttackList.h" #include "Player.h" #include "StepsDisplay.h" #include "XmlFile.h" @@ -96,12 +93,12 @@ PlayerInfo::PlayerInfo(): m_pn(PLAYER_INVALID), m_mp(MultiPlayer_Invalid), m_bIsDummy(false), m_iDummyIndex(0), m_iAddToDifficulty(0), m_bPlayerEnabled(false), m_PlayerStateDummy(), m_PlayerStageStatsDummy(), m_SoundEffectControl(), - m_vpStepsQueue(), m_asModifiersQueue(), m_pLifeMeter(NULL), + m_vpStepsQueue(), m_pLifeMeter(NULL), m_ptextStepsDescription(NULL), m_pPrimaryScoreDisplay(NULL), m_pSecondaryScoreDisplay(NULL), m_pPrimaryScoreKeeper(NULL), m_pSecondaryScoreKeeper(NULL), - m_ptextPlayerOptions(NULL), m_pActiveAttackList(NULL), - m_NoteData(), m_pPlayer(NULL), m_pInventory(NULL), + m_ptextPlayerOptions(NULL), + m_NoteData(), m_pPlayer(NULL), m_pStepsDisplay(NULL), m_sprOniGameOver() {} void PlayerInfo::Load( PlayerNumber pn, MultiPlayer mp, bool bShowNoteField, int iAddToDifficulty ) @@ -120,12 +117,6 @@ void PlayerInfo::Load( PlayerNumber pn, MultiPlayer mp, bool bShowNoteField, int switch( mode ) { case PLAY_MODE_REGULAR: - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: - if( PREFSMAN->m_bPercentageScoring ) - m_pPrimaryScoreDisplay = new ScoreDisplayPercentage; - else - m_pPrimaryScoreDisplay = new ScoreDisplayNormal; break; default: FAIL_M(ssprintf("Invalid PlayMode: %i", mode)); @@ -138,32 +129,13 @@ void PlayerInfo::Load( PlayerNumber pn, MultiPlayer mp, bool bShowNoteField, int if( m_pPrimaryScoreDisplay ) m_pPrimaryScoreDisplay->Init( pPlayerState, pPlayerStageStats ); - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_RAVE: - m_pSecondaryScoreDisplay = new ScoreDisplayRave; - m_pSecondaryScoreDisplay->SetName( "ScoreDisplayRave" ); - default: - break; - } - if( m_pSecondaryScoreDisplay ) m_pSecondaryScoreDisplay->Init( pPlayerState, pPlayerStageStats ); m_pPrimaryScoreKeeper = ScoreKeeper::MakeScoreKeeper( SCORE_KEEPER_CLASS, pPlayerState, pPlayerStageStats ); - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_RAVE: - m_pSecondaryScoreKeeper = new ScoreKeeperRave( pPlayerState, pPlayerStageStats ); - default: - break; - } - m_ptextPlayerOptions = NULL; - m_pActiveAttackList = NULL; m_pPlayer = new Player( m_NoteData, bShowNoteField ); - m_pInventory = NULL; m_pStepsDisplay = NULL; if( IsMultiPlayer() ) @@ -196,9 +168,7 @@ PlayerInfo::~PlayerInfo() SAFE_DELETE( m_pPrimaryScoreKeeper ); SAFE_DELETE( m_pSecondaryScoreKeeper ); SAFE_DELETE( m_ptextPlayerOptions ); - SAFE_DELETE( m_pActiveAttackList ); SAFE_DELETE( m_pPlayer ); - SAFE_DELETE( m_pInventory ); SAFE_DELETE( m_pStepsDisplay ); } @@ -380,8 +350,6 @@ void ScreenGameplay::Init() m_pSoundMusic = NULL; set_paused_internal(false); - m_pCombinedLifeMeter = NULL; - if( GAMESTATE->m_pCurSong == NULL) return; // ScreenDemonstration will move us to the next screen. We just need to survive for one update without crashing. @@ -606,19 +574,6 @@ void ScreenGameplay::Init() m_NextSong.SetDrawOrder( DRAW_ORDER_TRANSITIONS-1 ); this->AddChild( &m_NextSong ); - // Add combined life meter - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: - m_pCombinedLifeMeter = new CombinedLifeMeterTug; - m_pCombinedLifeMeter->SetName( "CombinedLife" ); - LOAD_ALL_COMMANDS_AND_SET_XY( *m_pCombinedLifeMeter ); - this->AddChild( m_pCombinedLifeMeter ); - default: - break; - } - // Before the lifemeter loads, if Networking is required // we need to wait, so that there is no Dead On Start issues. // if you wait too long at the second checkpoint, you will @@ -653,8 +608,6 @@ void ScreenGameplay::Init() } } break; - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: default: break; } @@ -690,7 +643,7 @@ void ScreenGameplay::Init() { pi->m_pPrimaryScoreDisplay->SetName( ssprintf("Score%s",pi->GetName().c_str()) ); LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_pPrimaryScoreDisplay ); - if( GAMESTATE->m_PlayMode != PLAY_MODE_RAVE || SHOW_SCORE_IN_RAVE ) /* XXX: ugly */ + if( SHOW_SCORE_IN_RAVE ) /* XXX: ugly */ this->AddChild( pi->m_pPrimaryScoreDisplay ); } @@ -751,17 +704,6 @@ void ScreenGameplay::Init() m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetStage().GetLocalizedString() ); this->AddChild( &m_textSongOptions ); - FOREACH_VisiblePlayerInfo( m_vPlayerInfo, pi ) - { - ASSERT( pi->m_pActiveAttackList == NULL ); - pi->m_pActiveAttackList = new ActiveAttackList; - pi->m_pActiveAttackList->LoadFromFont( THEME->GetPathF(m_sName,"ActiveAttackList") ); - pi->m_pActiveAttackList->Init( pi->GetPlayerState() ); - pi->m_pActiveAttackList->SetName( ssprintf("ActiveAttackList%s",pi->GetName().c_str()) ); - LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_pActiveAttackList ); - this->AddChild( pi->m_pActiveAttackList ); - } - if( g_bShowLyrics ) { m_LyricDisplay.SetName( "LyricDisplay" ); @@ -799,16 +741,6 @@ void ScreenGameplay::Init() m_textSurviveTime.SetDiffuse( RageColor(1,1,1,0) ); this->AddChild( &m_textSurviveTime ); } - - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_BATTLE: - m_soundBattleTrickLevel1.Load( THEME->GetPathS(m_sName,"battle trick level1"), true ); - m_soundBattleTrickLevel2.Load( THEME->GetPathS(m_sName,"battle trick level2"), true ); - m_soundBattleTrickLevel3.Load( THEME->GetPathS(m_sName,"battle trick level3"), true ); - default: - break; - } } if( m_pSongBackground ) @@ -823,11 +755,9 @@ void ScreenGameplay::Init() sType, pi->GetPlayerState(), pi->GetPlayerStageStats(), - pi->m_pLifeMeter, - m_pCombinedLifeMeter, + pi->m_pLifeMeter, pi->m_pPrimaryScoreDisplay, pi->m_pSecondaryScoreDisplay, - pi->m_pInventory, pi->m_pPrimaryScoreKeeper, pi->m_pSecondaryScoreKeeper ); } @@ -849,9 +779,9 @@ void ScreenGameplay::Init() if( pi->GetPlayerStageStats() ) pi->GetPlayerStageStats()->m_bJoined = true; if( pi->m_pPrimaryScoreKeeper ) - pi->m_pPrimaryScoreKeeper->Load( m_apSongsQueue, pi->m_vpStepsQueue, pi->m_asModifiersQueue ); + pi->m_pPrimaryScoreKeeper->Load( m_apSongsQueue, pi->m_vpStepsQueue ); if( pi->m_pSecondaryScoreKeeper ) - pi->m_pSecondaryScoreKeeper->Load( m_apSongsQueue, pi->m_vpStepsQueue, pi->m_asModifiersQueue ); + pi->m_pSecondaryScoreKeeper->Load( m_apSongsQueue, pi->m_vpStepsQueue ); } GAMESTATE->m_bGameplayLeadIn.Set( true ); @@ -873,10 +803,7 @@ bool ScreenGameplay::Center1Player() const * but for now just ignore Center1Player when it's Battle or Rave * Mode. This doesn't begin to address two-player solo (6 arrows) */ return g_bCenter1Player && - (bool)ALLOW_CENTER_1_PLAYER && - GAMESTATE->m_PlayMode != PLAY_MODE_BATTLE && - GAMESTATE->m_PlayMode != PLAY_MODE_RAVE && - GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StyleType == StyleType_OnePlayerOneSide; + (bool)ALLOW_CENTER_1_PLAYER && GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StyleType == StyleType_OnePlayerOneSide; } // fill in m_apSongsQueue, m_vpStepsQueue, m_asModifiersQueue @@ -888,17 +815,6 @@ void ScreenGameplay::InitSongQueues() Steps *pSteps = GAMESTATE->m_pCurSteps[pi->GetStepsAndTrailIndex()]; pi->m_vpStepsQueue.push_back(pSteps); const PlayerOptions &p = pi->GetPlayerState()->m_PlayerOptions.GetCurrent(); - - if (p.m_fNoAttack == 0 && p.m_fRandAttack == 0 && - pSteps->m_Attacks.size() > 0) - { - pi->m_asModifiersQueue.push_back(pSteps->m_Attacks); - } - else - { - AttackArray aa; - pi->m_asModifiersQueue.push_back(aa); - } } if (GAMESTATE->m_bMultiplayer) @@ -948,7 +864,6 @@ ScreenGameplay::~ScreenGameplay() SAFE_DELETE( m_pSongBackground ); SAFE_DELETE( m_pSongForeground ); - SAFE_DELETE( m_pCombinedLifeMeter ); if( m_pSoundMusic ) m_pSoundMusic->StopPlaying(); @@ -969,13 +884,6 @@ void ScreenGameplay::SetupSong( int iSongIndex ) Steps *pSteps = pi->m_vpStepsQueue[iSongIndex]; GAMESTATE->m_pCurSteps[ pi->GetStepsAndTrailIndex() ].Set( pSteps ); - /* Load new NoteData into Player. Do this before - * RebuildPlayerOptionsFromActiveAttacks or else transform mods will get - * propagated to GAMESTATE->m_pPlayerOptions too early and be double-applied - * to the NoteData: - * once in Player::Load, then again in Player::ApplyActiveAttacks. - * This is very bad for transforms like AddMines. - */ NoteData originalNoteData; pSteps->GetNoteData( originalNoteData); @@ -983,28 +891,6 @@ void ScreenGameplay::SetupSong( int iSongIndex ) NoteData ndTransformed; pStyle->GetTransformedNoteDataForStyle( pi->GetStepsAndTrailIndex(), originalNoteData, ndTransformed ); - // HACK: Apply NoteSkins from global course options. Do this before - // Player::Load, since it needs to know which note skin to load. - pi->GetPlayerState()->m_ModsToApply.clear(); - for( unsigned i=0; im_asModifiersQueue[iSongIndex].size(); ++i ) - { - Attack a = pi->m_asModifiersQueue[iSongIndex][i]; - if( a.fStartSecond != 0 ) - continue; - a.fStartSecond = ATTACK_STARTS_NOW; // now - - PlayerOptions po; - po.FromString( a.sModifiers ); - if( po.m_sNoteSkin.empty() ) - continue; - a.sModifiers = po.m_sNoteSkin; - - pi->GetPlayerState()->LaunchAttack( a ); - } - - /* Update attack bOn flags, and rebuild Current-level options - * from Song-level options. The current NoteSkin could have changed - * because of an attack ending. */ pi->GetPlayerState()->Update( 0 ); // load player @@ -1034,20 +920,6 @@ void ScreenGameplay::SetupSong( int iSongIndex ) pi->m_SoundEffectControl.Load( sType, pi->GetPlayerState(), &pi->m_NoteData ); } - // Put course options into effect. Do this after Player::Load so - // that mods aren't double-applied. - pi->GetPlayerState()->m_ModsToApply.clear(); - for( unsigned i=0; im_asModifiersQueue[iSongIndex].size(); ++i ) - { - Attack a = pi->m_asModifiersQueue[iSongIndex][i]; - if( a.fStartSecond == 0 ) - a.fStartSecond = ATTACK_STARTS_NOW; // now - - pi->GetPlayerState()->LaunchAttack( a ); - GAMESTATE->m_SongOptions.FromString( ModsLevel_Song, a.sModifiers ); - } - - // Update attack bOn flags. pi->GetPlayerState()->Update( 0 ); // Hack: Course modifiers that are set to start immediately shouldn't tween on. @@ -1087,9 +959,6 @@ void ScreenGameplay::LoadNextSong() GAMESTATE->m_pCurSong.Set( m_apSongsQueue[iPlaySongIndex] ); STATSMAN->m_CurStageStats.m_vpPlayedSongs.push_back( GAMESTATE->m_pCurSong ); - // No need to do this here. We do it in SongFinished(). - //GAMESTATE->RemoveAllActiveAttacks(); - // Force immediate fail behavior changed to theme metric by Kyz. if(FORCE_IMMEDIATE_FAIL_FOR_BATTERY) { @@ -1126,8 +995,6 @@ void ScreenGameplay::LoadNextSong() if( pi->m_ptextPlayerOptions ) pi->m_ptextPlayerOptions->SetText( pi->GetPlayerState()->m_PlayerOptions.GetCurrent().GetString() ); - if( pi->m_pActiveAttackList ) - pi->m_pActiveAttackList->Refresh(); // reset oni game over graphic SET_XY_AND_ON_COMMAND( pi->m_sprOniGameOver ); @@ -1262,8 +1129,6 @@ void ScreenGameplay::LoadNextSong() pi->m_pSecondaryScoreDisplay->OnLoadSong(); } } - if( m_pCombinedLifeMeter ) - m_pCombinedLifeMeter->OnLoadSong(); if( m_pSongForeground ) m_pSongForeground->LoadFromSong( GAMESTATE->m_pCurSong ); @@ -1761,8 +1626,6 @@ void ScreenGameplay::Update( float fDeltaTime ) // HACK: Load incorrect directory on purpose for now. PlayAnnouncer( "gameplay battle damage level3", 0 ); - GAMESTATE->RemoveAllActiveAttacks(); - FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi ) { if( !GAMESTATE->IsCpuPlayer(pi->m_pn) ) @@ -1822,8 +1685,6 @@ void ScreenGameplay::Update( float fDeltaTime ) switch( mode ) { case PLAY_MODE_REGULAR: - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: if( GAMESTATE->OneIsHot() ) PlayAnnouncer( "gameplay comment hot", SECONDS_BETWEEN_COMMENTS ); else if( GAMESTATE->AllAreInDangerOrWorse() ) @@ -2364,11 +2225,6 @@ void ScreenGameplay::SongFinished() } AdjustSync::HandleSongEnd(); SaveStats(); // Let subclasses save the stats. - /* Extremely important: if we don't remove attacks before moving on to the next - * screen, they'll still be turned on eventually. */ - GAMESTATE->RemoveAllActiveAttacks(); - FOREACH_VisiblePlayerInfo( m_vPlayerInfo, pi ) - pi->m_pActiveAttackList->Refresh(); } void ScreenGameplay::StageFinished( bool bBackedOut ) @@ -2463,10 +2319,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) { ResetGiveUpTimers(false); // don't allow giveup while the next song is loading - /* Do this in LoadNextSong, so we don't tween off old attacks until - * m_NextSong finishes. */ - // GAMESTATE->RemoveAllActiveAttacks(); - FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) { // Mark failure. @@ -2546,13 +2398,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) m_DancingState = STATE_OUTRO; ResetGiveUpTimers(false); - GAMESTATE->RemoveAllActiveAttacks(); - FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) - { - if( pi->m_pActiveAttackList ) - pi->m_pActiveAttackList->Refresh(); - } - bool bAllReallyFailed = STATSMAN->m_CurStageStats.AllFailed(); if( bAllReallyFailed ) @@ -2644,11 +2489,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) else if( SM == SM_BattleTrickLevel2 ) m_soundBattleTrickLevel2.Play(false); else if( SM == SM_BattleTrickLevel3 ) m_soundBattleTrickLevel3.Play(false); } - else if( SM >= SM_BattleDamageLevel1 && SM <= SM_BattleDamageLevel3 ) - { - int iDamageLevel = SM-SM_BattleDamageLevel1+1; - PlayAnnouncer( ssprintf("gameplay battle damage level%d",iDamageLevel), 3 ); - } else if( SM == SM_DoPrevScreen ) { SongFinished(); diff --git a/src/ScreenGameplay.h b/src/ScreenGameplay.h index 3cd731f696..31f3b6fdb4 100644 --- a/src/ScreenGameplay.h +++ b/src/ScreenGameplay.h @@ -9,7 +9,6 @@ #include "LocalizedString.h" #include "BeginnerHelper.h" #include "LyricDisplay.h" -#include "Attack.h" #include "NetworkSyncManager.h" #include "AutoKeysounds.h" #include "ThemeMetric.h" @@ -20,13 +19,10 @@ #include "GameplayAssist.h" class LyricsLoader; -class ActiveAttackList; -class CombinedLifeMeter; class Player; class LifeMeter; class ScoreDisplay; class StepsDisplay; -class Inventory; class ScoreKeeper; class Background; class Foreground; @@ -95,11 +91,6 @@ class PlayerInfo * * The size may be greater than 1 if playing a course. */ vector m_vpStepsQueue; - /** - * @brief The list of attack modifiers a player has to go through in this set. - * - * The size may be greater than 1 if playing a course. */ - vector m_asModifiersQueue; /** @brief The LifeMeter showing a Player's health. */ LifeMeter *m_pLifeMeter; @@ -117,19 +108,12 @@ class PlayerInfo /** @brief The current PlayerOptions that are activated. */ BitmapText *m_ptextPlayerOptions; /** @brief The current attack modifiers that are in play for the moment. */ - ActiveAttackList *m_pActiveAttackList; /** @brief The NoteData the Player has to get through. */ NoteData m_NoteData; /** @brief The specific Player that is going to play. */ Player *m_pPlayer; - /** - * @brief The inventory of attacks. - * - * This is mainly used in PLAY_MODE_BATTLE. */ - Inventory *m_pInventory; - StepsDisplay *m_pStepsDisplay; AutoActor m_sprOniGameOver; @@ -269,8 +253,6 @@ class ScreenGameplay : public ScreenWithMenuElements /** @brief Used between songs in a course to show the next song. */ Transition m_NextSong; - CombinedLifeMeter* m_pCombinedLifeMeter; - BitmapText m_textSongOptions; BitmapText m_Scoreboard[NUM_NSScoreBoardColumn]; // for NSMAN, so we can have a scoreboard diff --git a/src/ScreenHowToPlay.cpp b/src/ScreenHowToPlay.cpp index a4f4cc7b18..69f48426ac 100644 --- a/src/ScreenHowToPlay.cpp +++ b/src/ScreenHowToPlay.cpp @@ -166,7 +166,7 @@ void ScreenHowToPlay::Init() GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerController = PC_AUTOPLAY; m_Player->Init("Player", GAMESTATE->m_pPlayerState[PLAYER_1], - NULL, m_pLifeMeterBar, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, m_pLifeMeterBar, NULL, NULL, NULL, NULL); m_Player.Load( m_NoteData ); m_Player->SetName( "Player" ); this->AddChild( m_Player ); diff --git a/src/ScreenSelectCharacter.cpp b/src/ScreenSelectCharacter.cpp index 872bb4acdc..e69de29bb2 100644 --- a/src/ScreenSelectCharacter.cpp +++ b/src/ScreenSelectCharacter.cpp @@ -1,421 +0,0 @@ -#include "global.h" -#include "ScreenSelectCharacter.h" -#include "ScreenManager.h" -#include "GameSoundManager.h" -#include "RageUtil.h" -#include "RageLog.h" -#include "ThemeManager.h" -#include "AnnouncerManager.h" -#include "GameState.h" -#include "Character.h" -#include "PrefsManager.h" -#include "RageTextureManager.h" -#include "CharacterManager.h" -#include "InputEventPlus.h" - - -#define TITLE_ON_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("TitleP%dOnCommand",p+1)) -#define TITLE_OFF_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("TitleP%dOffCommand",p+1)) -#define CARD_ON_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("CardP%dOnCommand",p+1)) -#define CARD_OFF_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("CardP%dOffCommand",p+1)) -#define CARD_ARROWS_ON_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("CardArrowsP%dOnCommand",p+1)) -#define CARD_ARROWS_OFF_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("CardArrowsP%dOffCommand",p+1)) -#define EXPLANATION_ON_COMMAND THEME->GetMetricA("ScreenSelectCharacter","ExplanationOnCommand") -#define EXPLANATION_OFF_COMMAND THEME->GetMetricA("ScreenSelectCharacter","ExplanationOffCommand") -#define ATTACK_FRAME_ON_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("AttackFrameP%dOnCommand",p+1)) -#define ATTACK_FRAME_OFF_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("AttackFrameP%dOffCommand",p+1)) -#define ATTACK_ICON_WIDTH THEME->GetMetricF("ScreenSelectCharacter","AttackIconWidth") -#define ATTACK_ICON_HEIGHT THEME->GetMetricF("ScreenSelectCharacter","AttackIconHeight") -#define ATTACK_ICONS_START_X( p ) THEME->GetMetricF("ScreenSelectCharacter",ssprintf("AttackIconsP%dStartX",p+1)) -#define ATTACK_ICONS_START_Y( p ) THEME->GetMetricF("ScreenSelectCharacter",ssprintf("AttackIconsP%dStartY",p+1)) -#define ATTACK_ICONS_SPACING_X THEME->GetMetricF("ScreenSelectCharacter","AttackIconsSpacingX") -#define ATTACK_ICONS_SPACING_Y THEME->GetMetricF("ScreenSelectCharacter","AttackIconsSpacingY") -#define ATTACK_ICONS_ON_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("AttackIconsP%dOnCommand",p+1)) -#define ATTACK_ICONS_OFF_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("AttackIconsP%dOffCommand",p+1)) -#define TIMER_SECONDS THEME->GetMetricI("ScreenSelectCharacter","TimerSeconds") -#define ICON_WIDTH THEME->GetMetricF("ScreenSelectCharacter","IconWidth") -#define ICON_HEIGHT THEME->GetMetricF("ScreenSelectCharacter","IconHeight") -#define ICONS_ON_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("IconsP%dOnCommand",p+1)) -#define ICONS_OFF_COMMAND( p ) THEME->GetMetricA("ScreenSelectCharacter",ssprintf("IconsP%dOffCommand",p+1)) - -#define LEVEL_CURSOR_X( p, l ) ( ICONS_START_X(p)+ICONS_SPACING_X*((NUM_ATTACKS_PER_LEVEL-1)/2.f) ) -#define LEVEL_CURSOR_Y( p, l ) ( ICONS_START_Y(p)+ICONS_SPACING_Y*l ) - -const PlayerNumber CPU_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 }; - - - -REGISTER_SCREEN_CLASS( ScreenSelectCharacter ); - - -void ScreenSelectCharacter::Init() -{ - ScreenWithMenuElements::Init(); - - vector apCharacters; - CHARMAN->GetCharacters( apCharacters ); - if( apCharacters.empty() ) - { - this->PostScreenMessage( SM_GoToNextScreen, 0 ); - return; - } - - switch( GAMESTATE->m_PlayMode ) - { - // For Rave/Battle mode, we force the players to select characters - // (by not returning in this switch) - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: - break; - - default: - /* Non Rave/Battle mode, just skip this screen if disabled. */ - if( PREFSMAN->m_ShowDancingCharacters != SDC_Select ) - { - this->PostScreenMessage( SM_GoToNextScreen, 0 ); - return; - } - } - - FOREACH_PlayerNumber( p ) - { - m_iSelectedCharacter[p] = 0; - if( GAMESTATE->IsHumanPlayer(p) ) - m_SelectionRow[p] = CHOOSING_HUMAN_CHARACTER; - } - - - FOREACH_EnabledPlayer( p ) - { - m_sprTitle[p].Load( THEME->GetPathG("ScreenSelectCharacter","title 2x2") ); - m_sprTitle[p].SetState( GAMESTATE->IsHumanPlayer(p) ? p : 2+p ); - m_sprTitle[p].StopAnimating(); - m_sprTitle[p].RunCommands( TITLE_ON_COMMAND(p) ); - - this->AddChild( &m_sprTitle[p] ); - - m_sprCard[p].RunCommands( CARD_ON_COMMAND(p) ); - this->AddChild( &m_sprCard[p] ); - - m_sprCardArrows[p].Load( THEME->GetPathG("ScreenSelectCharacter","card arrows") ); - m_sprCardArrows[p].RunCommands( CARD_ARROWS_ON_COMMAND(p) ); - this->AddChild( &m_sprCardArrows[p] ); - - for( unsigned i=0; iAddChild( &m_sprIcons[p][i] ); - } - - if(GAMESTATE->m_PlayMode == PLAY_MODE_BATTLE || GAMESTATE->m_PlayMode == PLAY_MODE_RAVE) - { - m_sprAttackFrame[p].Load( THEME->GetPathG("ScreenSelectCharacter","attack frame 1x2") ); - m_sprAttackFrame[p].StopAnimating(); - m_sprAttackFrame[p].SetState( p ); - m_sprAttackFrame[p].RunCommands( ATTACK_FRAME_ON_COMMAND(p) ); - this->AddChild( &m_sprAttackFrame[p] ); - - for( int i=0; iAddChild( &m_AttackIcons[p][i][j] ); - } - } - } - - m_sprExplanation.Load( THEME->GetPathG("ScreenSelectCharacter","explanation") ); - m_sprExplanation.RunCommands( EXPLANATION_ON_COMMAND ); - this->AddChild( &m_sprExplanation ); - - - m_soundChange.Load( THEME->GetPathS("ScreenSelectCharacter","change"), true ); - - SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("select group intro") ); - - FOREACH_PlayerNumber( p ) - { - if( GAMESTATE->IsHumanPlayer(p) ) - { - AfterRowChange( p ); - AfterValueChange( p ); - } - - for( unsigned i=0; iTrace( "ScreenSelectCharacter::~ScreenSelectCharacter()" ); - -} - - -bool ScreenSelectCharacter::Input( const InputEventPlus &input ) -{ - LOG->Trace( "ScreenSelectCharacter::Input()" ); - - if( IsTransitioning() ) - return false; - - return ScreenWithMenuElements::Input( input ); // default input handler -} - -void ScreenSelectCharacter::HandleScreenMessage( const ScreenMessage SM ) -{ - if( SM == SM_BeginFadingOut ) - { - StartTransitioningScreen( SM_GoToNextScreen ); - } - else if( SM == SM_MenuTimer ) - { - MakeSelection(PLAYER_1); - if( !AllAreFinishedChoosing() ) - ResetTimer(); - } - else - { - ScreenWithMenuElements::HandleScreenMessage( SM ); - } -} - -PlayerNumber ScreenSelectCharacter::GetAffectedPlayerNumber( PlayerNumber pn ) -{ - switch( m_SelectionRow[pn] ) - { - case CHOOSING_HUMAN_CHARACTER: - return pn; - case CHOOSING_CPU_CHARACTER: - return CPU_PLAYER[pn]; - case FINISHED_CHOOSING: - return pn; - default: - FAIL_M(ssprintf("Invalid character selection state: %i", m_SelectionRow[pn])); - } -} - -void ScreenSelectCharacter::BeforeRowChange( PlayerNumber pn ) -{ - PlayerNumber pnAffected = GetAffectedPlayerNumber(pn); - switch( m_SelectionRow[pn] ) - { - case CHOOSING_CPU_CHARACTER: - case CHOOSING_HUMAN_CHARACTER: - m_sprCardArrows[pnAffected].StopEffect(); - break; - default: break; - } -} - -void ScreenSelectCharacter::AfterRowChange( PlayerNumber pn ) -{ - PlayerNumber pnAffected = GetAffectedPlayerNumber(pn); - switch( m_SelectionRow[pn] ) - { - case CHOOSING_CPU_CHARACTER: - case CHOOSING_HUMAN_CHARACTER: - m_sprCardArrows[pnAffected].SetEffectGlowShift(1.0f, RageColor(1,1,1,0.2f), RageColor(1,1,1,0.8f)); - break; - default: break; - } -} - -void ScreenSelectCharacter::AfterValueChange( PlayerNumber pn ) -{ - PlayerNumber pnAffected = GetAffectedPlayerNumber(pn); - switch( m_SelectionRow[pn] ) - { - case CHOOSING_CPU_CHARACTER: - case CHOOSING_HUMAN_CHARACTER: - { - vector apCharacters; - CHARMAN->GetCharacters( apCharacters ); - Character* pChar = apCharacters[ m_iSelectedCharacter[pnAffected] ]; - m_sprCard[pnAffected].UnloadTexture(); - m_sprCard[pnAffected].Load( pChar->GetCardPath() ); - - if(GAMESTATE->m_PlayMode == PLAY_MODE_BATTLE || GAMESTATE->m_PlayMode == PLAY_MODE_RAVE) - for( int i=0; im_sAttacks[i][j] ); - } - - int c = m_iSelectedCharacter[pnAffected] - MAX_CHAR_ICONS_TO_SHOW/2; - wrap( c, apCharacters.size() ); - - for( unsigned i=0; i apCharacters; - CHARMAN->GetCharacters( apCharacters ); - m_iSelectedCharacter[pnAffected] += deltaValue; - wrap( m_iSelectedCharacter[pnAffected], apCharacters.size() ); - AfterValueChange(pn); - m_soundChange.Play(true); - break; - } - default: break; - } -} - -bool ScreenSelectCharacter::AllAreFinishedChoosing() const -{ - FOREACH_HumanPlayer( p ) - if( m_SelectionRow[p] != FINISHED_CHOOSING ) - return false; - return true; -} - -bool ScreenSelectCharacter::MenuStart( const InputEventPlus &input ) -{ - MakeSelection( input.pn ); - return true; -} - -void ScreenSelectCharacter::MakeSelection( PlayerNumber pn ) -{ - if( m_SelectionRow[pn] == FINISHED_CHOOSING ) - return; - - - // change row - BeforeRowChange(pn); - switch( m_SelectionRow[pn] ) - { - case CHOOSING_HUMAN_CHARACTER: - m_SelectionRow[pn] = GAMESTATE->AnyPlayersAreCpu() ? CHOOSING_CPU_CHARACTER : FINISHED_CHOOSING; - break; - case CHOOSING_CPU_CHARACTER: - m_SelectionRow[pn] = FINISHED_CHOOSING; - break; - default: break; - } - AfterRowChange(pn); - AfterValueChange(pn); - SCREENMAN->PlayStartSound(); - - if( AllAreFinishedChoosing() ) - { - FOREACH_PlayerNumber( p ) - { - vector apCharacters; - CHARMAN->GetCharacters( apCharacters ); - Character* pChar = apCharacters[ m_iSelectedCharacter[p] ]; - GAMESTATE->m_pCurCharacters[p] = pChar; - } - - StopTimer(); - this->PostScreenMessage( SM_BeginFadingOut, 0 ); - } -} - -bool ScreenSelectCharacter::MenuBack( const InputEventPlus &input ) -{ - Cancel( SM_GoToPrevScreen ); - return true; -} - -void ScreenSelectCharacter::TweenOffScreen() -{ - ScreenWithMenuElements::TweenOffScreen(); - - FOREACH_PlayerNumber( p ) - { - m_sprCard[p].RunCommands( CARD_OFF_COMMAND(p) ); - m_sprTitle[p].RunCommands( TITLE_OFF_COMMAND(p) ); - m_sprCardArrows[p].RunCommands( CARD_ARROWS_OFF_COMMAND(p) ); - if(GAMESTATE->m_PlayMode == PLAY_MODE_BATTLE || GAMESTATE->m_PlayMode == PLAY_MODE_RAVE) - { - m_sprAttackFrame[p].RunCommands( ATTACK_FRAME_OFF_COMMAND(p) ); - for( int i=0; im_PlayMode == PLAY_MODE_RAVE) - pSteps = m_vpSteps[m_iSelection[master_pn]]; - GAMESTATE->m_pCurSteps[pn].Set( pSteps ); } diff --git a/src/Song.cpp b/src/Song.cpp index b8a3c7f2a3..5671b04eda 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -216,8 +216,6 @@ Steps *Song::CreateSteps() void Song::InitSteps(Steps *pSteps) { // TimingData is initially empty (i.e. defaults to song timing) - pSteps->m_sAttackString = this->m_sAttackString; - pSteps->m_Attacks = this->m_Attacks; pSteps->SetDisplayBPM(this->m_DisplayBPMType); pSteps->SetMinBPM(this->m_fSpecifiedBPMMin); pSteps->SetMaxBPM(this->m_fSpecifiedBPMMax); @@ -1460,7 +1458,6 @@ bool Song::HasBGChanges() const } return false; } -bool Song::HasAttacks() const {return !m_Attacks.empty(); } bool Song::HasJacket() const { return m_sJacketFile != "" && IsAFile(GetJacketPath()); @@ -2211,7 +2208,7 @@ class LunaSong: public Luna } static int HasAttacks( T* p, lua_State *L ) { - lua_pushboolean(L, p->HasAttacks()); + lua_pushboolean(L, false); return 1; } static int GetDisplayBpms( T* p, lua_State *L ) diff --git a/src/Song.h b/src/Song.h index 6b089c04a9..e24dd0dd46 100644 --- a/src/Song.h +++ b/src/Song.h @@ -1,7 +1,6 @@ #ifndef SONG_H #define SONG_H -#include "Attack.h" #include "TimingData.h" #include "Difficulty.h" #include "EnumHelper.h" @@ -249,9 +248,6 @@ class Song RString m_sCDTitleFile; RString m_sPreviewVidFile; - AttackArray m_Attacks; - vector m_sAttackString; - static RString GetSongAssetPath( RString sPath, const RString &sSongPath ); RString GetMusicPath() const; RString GetInstrumentTrackPath( InstrumentTrack it ) const; @@ -453,11 +449,6 @@ class Song CachedObject m_CachedObject; - RString GetAttackString() const - { - return join(":", this->m_sAttackString); - } - // Lua void PushSelf( lua_State *L ); diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 8a97ea5b23..f8281c4a2e 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -87,7 +87,6 @@ void SongManager::InitAll( LoadingWindow *ld ) m_GroupsToNeverCache.insert(*group); } InitSongsFromDisk( ld ); - InitRandomAttacks(); } static LocalizedString RELOADING ( "SongManager", "Reloading..." ); @@ -710,46 +709,6 @@ RString SongManager::ShortenGroupName( const RString &sLongGroupName ) return title.Title; } -void SongManager::InitRandomAttacks() -{ - GAMESTATE->m_RandomAttacks.clear(); - - if( !IsAFile(ATTACK_FILE) ) - LOG->Trace( "File Data/RandomAttacks.txt was not found" ); - else - { - MsdFile msd; - - if( !msd.ReadFile( ATTACK_FILE, true ) ) - LuaHelpers::ReportScriptErrorFmt( "Error opening file '%s' for reading: %s.", ATTACK_FILE.c_str(), msd.GetError().c_str() ); - else - { - for( unsigned i=0; i 2 ) - { - LuaHelpers::ReportScriptErrorFmt( "Got \"%s:%s\" tag with too many parameters", sType.c_str(), sAttack.c_str() ); - continue; - } - - if( !sType.EqualsNoCase("ATTACK") ) - { - LuaHelpers::ReportScriptErrorFmt( "Got \"%s:%s\" tag with wrong declaration", sType.c_str(), sAttack.c_str() ); - continue; - } - - GAMESTATE->m_RandomAttacks.push_back( sAttack ); - } - } - } -} - - /* Called periodically to wipe out cached NoteData. This is called when we * change screens. */ void SongManager::Cleanup() diff --git a/src/SongManager.h b/src/SongManager.h index c2b239cf75..37226c6650 100644 --- a/src/SongManager.h +++ b/src/SongManager.h @@ -49,8 +49,6 @@ class SongManager void LoadGroupSymLinks( const RString &sDir, const RString &sGroupFolder ); - void InitRandomAttacks(); - void InitAll( LoadingWindow *ld ); // songs, groups - everything. void Reload( bool bAllowFastLoad, LoadingWindow *ld=NULL ); // songs, groups - everything. void PreloadSongImages(); diff --git a/src/StageStats.cpp b/src/StageStats.cpp index 16052b912f..9fc73af2a0 100644 --- a/src/StageStats.cpp +++ b/src/StageStats.cpp @@ -223,14 +223,6 @@ static HighScore FillInHighScore(const PlayerStageStats &pss, const PlayerState void StageStats::FinalizeScores( bool bSummary ) { - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_BATTLE: - case PLAY_MODE_RAVE: - return; // don't save scores in battle - default: break; - } - if( PREFSMAN->m_sTestInitialScreen.Get() != "" ) { FOREACH_PlayerNumber( pn ) diff --git a/src/Steps.cpp b/src/Steps.cpp index 07f70fb380..c866e0452b 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -77,11 +77,6 @@ void Steps::GetDisplayBpms( DisplayBpms &AddTo ) const } } -bool Steps::HasAttacks() const -{ - return !this->m_Attacks.empty(); -} - unsigned Steps::GetHash() const { if( m_iHash ) @@ -484,8 +479,6 @@ void Steps::CopyFrom( Steps* pSource, StepsType ntTo, float fMusicLengthSeconds noteData.SetNumTracks( GAMEMAN->GetStepsTypeInfo(ntTo).iNumTracks ); m_Timing = pSource->m_Timing; this->m_pSong = pSource->m_pSong; - this->m_Attacks = pSource->m_Attacks; - this->m_sAttackString = pSource->m_sAttackString; this->SetNoteData( noteData ); this->SetDescription( pSource->GetDescription() ); this->SetDifficulty( pSource->GetDifficulty() ); @@ -602,7 +595,7 @@ class LunaSteps: public Luna } static int HasAttacks( T* p, lua_State *L ) { - lua_pushboolean(L, p->HasAttacks()); + lua_pushboolean(L, false); return 1; } static int GetRadarValues( T* p, lua_State *L ) diff --git a/src/Steps.h b/src/Steps.h index 0f551a552d..dd242e3b01 100644 --- a/src/Steps.h +++ b/src/Steps.h @@ -1,7 +1,6 @@ #ifndef STEPS_H #define STEPS_H -#include "Attack.h" #include "GameConstantsAndTypes.h" #include "PlayerNumber.h" #include "Grade.h" @@ -14,6 +13,7 @@ class Profile; class NoteData; struct lua_State; +class Song; typedef vector SDiffs; typedef vector MinaSD; @@ -108,11 +108,6 @@ class Steps */ RString GetCredit() const { return m_sCredit; } - /** @brief The list of attacks. */ - AttackArray m_Attacks; - /** @brief The stringified list of attacks. */ - vector m_sAttackString; - RString GetChartName() const { return chartName; } void SetChartName(const RString &name) { this->chartName = name; } void SetFilename(const RString &fn) { m_sFilename = fn; } @@ -225,11 +220,6 @@ class Steps float GetMaxBPM() const { return this->specifiedBPMMax; } void GetDisplayBpms( DisplayBpms &addTo) const; - RString GetAttackString() const - { - return join(":", this->m_sAttackString); - } - private: /* We can have one or both of these; if we have both, they're always identical. * Call Compress() to force us to only have m_sNoteDataCompressed; otherwise, creation of