diff --git a/stepmania/src/Inventory.cpp b/stepmania/src/Inventory.cpp index 26df4ba5a1..88fb41c52a 100644 --- a/stepmania/src/Inventory.cpp +++ b/stepmania/src/Inventory.cpp @@ -28,8 +28,6 @@ #define ITEM_LEVEL( i ) THEME->GetMetricI("Inventory",ssprintf("Item%dLevel",i+1)) CachedThemeMetricF ITEM_USE_RATE_SECONDS("Inventory","ItemUseRateSeconds"); -const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 }; - #define ITEM_USE_PROBABILITY (1.f/ITEM_USE_RATE_SECONDS) struct Item diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 96e2796ac2..39c0469b9d 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -591,7 +591,20 @@ void PlayerMinus::Step( int col, RageTimer tm ) { m_soundAttack.Play(); score = TNS_NONE; // don't score this as anything - m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField + // put attack in effect + Attack attack = this->GetAttackAt( col, iIndexOverlappingNote ); + GAMESTATE->LaunchAttack( OPPOSITE_PLAYER[m_PlayerNumber], attack ); + + // remove all TapAttacks on this row + for( int t=0; tGetNumTracks(); t++ ) + { + TapNote tn = this->GetTapNote(t, iIndexOverlappingNote); + if( IsTapAttack(tn) ) + { + this->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField + m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField + } + } } } else // !IsTapAttack @@ -669,7 +682,21 @@ void PlayerMinus::Step( int col, RageTimer tm ) { m_soundAttack.Play(); score = TNS_NONE; // don't score this as anything - m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField + + // put attack in effect + Attack attack = this->GetAttackAt( col, iIndexOverlappingNote ); + GAMESTATE->LaunchAttack( OPPOSITE_PLAYER[m_PlayerNumber], attack ); + + // remove all TapAttacks on this row + for( int t=0; tGetNumTracks(); t++ ) + { + TapNote tn = this->GetTapNote(t, iIndexOverlappingNote); + if( IsTapAttack(tn) ) + { + this->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField + m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField + } + } } break; @@ -685,6 +712,27 @@ void PlayerMinus::Step( int col, RageTimer tm ) // Don't step on mines if( tn == TAP_MINE ) return; + + if( IsTapAttack(tn) ) + { + m_soundAttack.Play(); + score = TNS_NONE; // don't score this as anything + + // put attack in effect + Attack attack = this->GetAttackAt( col, iIndexOverlappingNote ); + GAMESTATE->LaunchAttack( OPPOSITE_PLAYER[m_PlayerNumber], attack ); + + // remove all TapAttacks on this row + for( int t=0; tGetNumTracks(); t++ ) + { + TapNote tn = this->GetTapNote(t, iIndexOverlappingNote); + if( IsTapAttack(tn) ) + { + this->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField + m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField + } + } + } break; default: ASSERT(0); diff --git a/stepmania/src/PlayerNumber.h b/stepmania/src/PlayerNumber.h index 1a261ef4c8..b473f46086 100644 --- a/stepmania/src/PlayerNumber.h +++ b/stepmania/src/PlayerNumber.h @@ -27,6 +27,8 @@ enum PlayerNumber { PLAYER_INVALID }; +const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 }; + RageColor PlayerToColor( PlayerNumber pn ); RageColor PlayerToColor( int p ); diff --git a/stepmania/src/ScoreKeeperRave.cpp b/stepmania/src/ScoreKeeperRave.cpp index 01806ea4a3..caa2c3281f 100644 --- a/stepmania/src/ScoreKeeperRave.cpp +++ b/stepmania/src/ScoreKeeperRave.cpp @@ -19,8 +19,6 @@ CachedThemeMetricF ATTACK_DURATION_SECONDS ("ScoreKeeperRave","AttackDurationSeconds"); -const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 }; - ScoreKeeperRave::ScoreKeeperRave(PlayerNumber pn) : ScoreKeeper(pn) { diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 376f4b0dc5..d955ace224 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -223,7 +223,7 @@ static Menu g_BGChange( "Background Change", g_BGChangeItems ); static const MenuRow g_InsertAttackItems[] = { - { "Duration seconds", true, 2, { "10","20","30","40","50","60","70","80","90" } }, + { "Duration seconds", true, 3, { "5","10","15","20","25","30","35","40","45" } }, { "Set modifiers", true, 0, { "PRESS START" } }, { NULL, true, 0, { NULL } } };