working on battle

This commit is contained in:
Chris Danford
2003-11-20 06:50:05 +00:00
parent a32a62faac
commit 4e80f3057a
7 changed files with 107 additions and 41 deletions
+26
View File
@@ -14,6 +14,7 @@
#include "RageUtil.h"
#include "RageLog.h"
#include "PlayerOptions.h"
#include "Song.h"
NoteType NoteDataUtil::GetSmallestNoteTypeForMeasure( const NoteData &n, int iMeasureIndex )
{
@@ -1236,6 +1237,31 @@ void NoteDataUtil::TransformNoteData( NoteData &nd, const PlayerOptions &po, Ste
if( po.m_bTransforms[PlayerOptions::TRANSFORM_TWISTER] ) NoteDataUtil::Twister(nd, fStartBeat, fEndBeat);
}
void NoteDataUtil::AddTapAttacks( NoteData &nd, Song* pSong )
{
// throw an attack in every 30 seconds
const char* szAttacks[3] =
{
"2x",
"drunk",
"dizzy",
};
for( float sec=15; sec<pSong->m_fMusicLengthSeconds; sec+=30 )
{
float fBeat = pSong->GetBeatFromElapsedTime( sec );
int iBeat = (int)fBeat;
int iTrack = iBeat % nd.GetNumTracks(); // deterministically calculates track
Attack attack;
attack.fStartSecond = -1;
attack.fSecsRemaining = 15;
attack.sModifier = szAttacks[rand()%ARRAYSIZE(szAttacks)];
attack.level = ATTACK_LEVEL_1;
nd.SetTapAttackNote( iTrack, BeatToNoteRow(iBeat), attack );
}
}
void NoteDataUtil::Scale( NoteData &nd, float fScale )
{
ASSERT( fScale > 0 );