2002-02-24 10:31:20 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
File: ArrowEffects.cpp
|
|
|
|
|
|
2002-03-19 07:09:49 +00:00
|
|
|
Desc: Functions that return properties of arrows based on StyleDef and PlayerOptions
|
2002-02-24 10:31:20 +00:00
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-02-24 10:31:20 +00:00
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
#include "ArrowEffects.h"
|
2002-05-19 01:59:48 +00:00
|
|
|
#include "Notes.h"
|
2002-04-28 20:42:32 +00:00
|
|
|
#include "ColorNote.h"
|
2002-05-01 19:14:55 +00:00
|
|
|
#include "GameConstantsAndTypes.h"
|
2002-04-16 17:31:00 +00:00
|
|
|
#include "GameManager.h"
|
2002-02-24 10:31:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
float ArrowGetYOffset( const PlayerOptions& po, float fStepIndex, float fSongBeat )
|
|
|
|
|
{
|
2002-05-19 01:59:48 +00:00
|
|
|
float fBeatsUntilStep = NoteRowToBeat( fStepIndex ) - fSongBeat;
|
2002-02-24 10:31:20 +00:00
|
|
|
float fYOffset = fBeatsUntilStep * ARROW_GAP;
|
|
|
|
|
switch( po.m_EffectType )
|
|
|
|
|
{
|
|
|
|
|
case PlayerOptions::EFFECT_BOOST:
|
|
|
|
|
fYOffset *= 1.4f / ((fYOffset+SCREEN_HEIGHT/1.6f)/SCREEN_HEIGHT);
|
|
|
|
|
break;
|
|
|
|
|
case PlayerOptions::EFFECT_WAVE:
|
|
|
|
|
fYOffset += 15.0f*sinf( fYOffset/38.0f );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return fYOffset;
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
float ArrowGetXPos( const PlayerOptions& po, int iColNum, float fYOffset, float fSongBeat )
|
2002-02-24 10:31:20 +00:00
|
|
|
{
|
2002-05-27 08:23:27 +00:00
|
|
|
float fColOffsetFromCenter = iColNum - (GAMEMAN->GetCurrentStyleDef()->m_iColsPerPlayer-1)/2.0f;
|
2002-02-24 10:31:20 +00:00
|
|
|
float fPixelOffsetFromCenter = fColOffsetFromCenter * ARROW_SIZE;
|
|
|
|
|
|
|
|
|
|
switch( po.m_EffectType )
|
|
|
|
|
{
|
|
|
|
|
case PlayerOptions::EFFECT_DRUNK:
|
|
|
|
|
fPixelOffsetFromCenter += cosf( (GetTickCount()%1000000)/250.0f + iColNum*0.4f + fYOffset/SCREEN_HEIGHT*4) * ARROW_SIZE/3;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return fPixelOffsetFromCenter;
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
float ArrowGetRotation( const PlayerOptions& po, int iColNum, float fYOffset )
|
2002-02-24 10:31:20 +00:00
|
|
|
{
|
2002-04-01 02:04:43 +00:00
|
|
|
float fRotation = 0; //StyleDef.m_ColumnToRotation[iColNum];
|
2002-02-25 23:29:39 +00:00
|
|
|
|
2002-02-24 10:31:20 +00:00
|
|
|
switch( po.m_EffectType )
|
|
|
|
|
{
|
|
|
|
|
case PlayerOptions::EFFECT_DIZZY:
|
|
|
|
|
fRotation += fYOffset/SCREEN_HEIGHT*6;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fRotation;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float ArrowGetYPos( const PlayerOptions& po, float fYOffset )
|
|
|
|
|
{
|
|
|
|
|
return fYOffset * po.m_fArrowScrollSpeed * (po.m_bReverseScroll ? -1 : 1 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float ArrowGetAlpha( const PlayerOptions& po, float fYPos )
|
|
|
|
|
{
|
|
|
|
|
float fAlpha;
|
|
|
|
|
switch( po.m_AppearanceType )
|
|
|
|
|
{
|
|
|
|
|
case PlayerOptions::APPEARANCE_VISIBLE:
|
|
|
|
|
fAlpha = 1;
|
|
|
|
|
break;
|
|
|
|
|
case PlayerOptions::APPEARANCE_HIDDEN:
|
|
|
|
|
fAlpha = (fYPos-100)/200;
|
|
|
|
|
break;
|
|
|
|
|
case PlayerOptions::APPEARANCE_SUDDEN:
|
|
|
|
|
fAlpha = ((SCREEN_HEIGHT-fYPos)-280)/200;
|
|
|
|
|
break;
|
|
|
|
|
case PlayerOptions::APPEARANCE_STEALTH:
|
|
|
|
|
fAlpha = 0;
|
|
|
|
|
break;
|
2002-03-30 20:00:13 +00:00
|
|
|
default:
|
|
|
|
|
ASSERT( false );
|
|
|
|
|
fAlpha = 0;
|
2002-02-24 10:31:20 +00:00
|
|
|
};
|
|
|
|
|
if( fYPos < 0 )
|
|
|
|
|
fAlpha = 1;
|
|
|
|
|
|
|
|
|
|
return fAlpha;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|