put attacks in effect when tap attack is stepped on
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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; t<this->GetNumTracks(); 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; t<this->GetNumTracks(); 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; t<this->GetNumTracks(); 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);
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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 } }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user