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))
|
#define ITEM_LEVEL( i ) THEME->GetMetricI("Inventory",ssprintf("Item%dLevel",i+1))
|
||||||
CachedThemeMetricF ITEM_USE_RATE_SECONDS("Inventory","ItemUseRateSeconds");
|
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)
|
#define ITEM_USE_PROBABILITY (1.f/ITEM_USE_RATE_SECONDS)
|
||||||
|
|
||||||
struct Item
|
struct Item
|
||||||
|
|||||||
@@ -591,9 +591,22 @@ void PlayerMinus::Step( int col, RageTimer tm )
|
|||||||
{
|
{
|
||||||
m_soundAttack.Play();
|
m_soundAttack.Play();
|
||||||
score = TNS_NONE; // don't score this as anything
|
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
|
m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else // !IsTapAttack
|
else // !IsTapAttack
|
||||||
{
|
{
|
||||||
// TODO: move the judgments into flags in PrefsManager so we don't need logic like this per-game.
|
// TODO: move the judgments into flags in PrefsManager so we don't need logic like this per-game.
|
||||||
@@ -669,8 +682,22 @@ void PlayerMinus::Step( int col, RageTimer tm )
|
|||||||
{
|
{
|
||||||
m_soundAttack.Play();
|
m_soundAttack.Play();
|
||||||
score = TNS_NONE; // don't score this as anything
|
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
|
m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PC_AUTOPLAY:
|
case PC_AUTOPLAY:
|
||||||
@@ -685,6 +712,27 @@ void PlayerMinus::Step( int col, RageTimer tm )
|
|||||||
// Don't step on mines
|
// Don't step on mines
|
||||||
if( tn == TAP_MINE )
|
if( tn == TAP_MINE )
|
||||||
return;
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ enum PlayerNumber {
|
|||||||
PLAYER_INVALID
|
PLAYER_INVALID
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 };
|
||||||
|
|
||||||
RageColor PlayerToColor( PlayerNumber pn );
|
RageColor PlayerToColor( PlayerNumber pn );
|
||||||
RageColor PlayerToColor( int p );
|
RageColor PlayerToColor( int p );
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,6 @@
|
|||||||
|
|
||||||
CachedThemeMetricF ATTACK_DURATION_SECONDS ("ScoreKeeperRave","AttackDurationSeconds");
|
CachedThemeMetricF ATTACK_DURATION_SECONDS ("ScoreKeeperRave","AttackDurationSeconds");
|
||||||
|
|
||||||
const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 };
|
|
||||||
|
|
||||||
|
|
||||||
ScoreKeeperRave::ScoreKeeperRave(PlayerNumber pn) : ScoreKeeper(pn)
|
ScoreKeeperRave::ScoreKeeperRave(PlayerNumber pn) : ScoreKeeper(pn)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ static Menu g_BGChange( "Background Change", g_BGChangeItems );
|
|||||||
|
|
||||||
static const MenuRow g_InsertAttackItems[] =
|
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" } },
|
{ "Set modifiers", true, 0, { "PRESS START" } },
|
||||||
{ NULL, true, 0, { NULL } }
|
{ NULL, true, 0, { NULL } }
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user