working on Player AI
This commit is contained in:
@@ -180,6 +180,20 @@ const int MAX_RANKING_NAME_LENGTH = 4;
|
||||
const CString GROUP_ALL_MUSIC = "";
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
enum PlayerController
|
||||
{
|
||||
HUMAN,
|
||||
CPU_EASY,
|
||||
CPU_MEDIUM,
|
||||
CPU_HARD,
|
||||
CPU_AUTOPLAY,
|
||||
NUM_PLAYER_CONTROLLERS
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Battle stuff
|
||||
//
|
||||
|
||||
@@ -273,6 +273,15 @@ bool GameState::IsHumanPlayer( PlayerNumber pn )
|
||||
}
|
||||
}
|
||||
|
||||
PlayerNumber GameState::GetFirstHumanPlayer()
|
||||
{
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
if( IsHumanPlayer(p) )
|
||||
return (PlayerNumber)p;
|
||||
ASSERT(0); // there must be at least 1 human player
|
||||
return PLAYER_INVALID;
|
||||
}
|
||||
|
||||
bool GameState::IsCpuPlayer( PlayerNumber pn )
|
||||
{
|
||||
return IsPlayerEnabled(pn) && !IsHumanPlayer(pn);
|
||||
|
||||
@@ -70,6 +70,7 @@ public:
|
||||
bool IsPlayerEnabled( int p ) { return IsPlayerEnabled( (PlayerNumber)p ); };
|
||||
bool IsHumanPlayer( PlayerNumber pn );
|
||||
bool IsHumanPlayer( int p ) { return IsHumanPlayer( (PlayerNumber)p ); };
|
||||
PlayerNumber GetFirstHumanPlayer();
|
||||
bool IsCpuPlayer( PlayerNumber pn );
|
||||
bool IsCpuPlayer( int p ) { return IsCpuPlayer( (PlayerNumber)p ); };
|
||||
bool AnyPlayersAreCpu()
|
||||
@@ -79,6 +80,10 @@ public:
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
PlayerController m_PlayerController[NUM_PLAYERS];
|
||||
|
||||
|
||||
bool IsCourseMode() const;
|
||||
|
||||
CString m_sLoadingMessage; // used in loading screen
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "ThemeManager.h"
|
||||
#include "RageUtil.h"
|
||||
#include "GameState.h"
|
||||
#include "RageTimer.h"
|
||||
|
||||
|
||||
#define NUM_ITEM_TYPES THEME->GetMetricF("Inventory","NumItemTypes")
|
||||
#define ITEM_DURATION_SECONDS THEME->GetMetricF("Inventory","ItemDurationSeconds")
|
||||
@@ -22,6 +24,7 @@
|
||||
|
||||
const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 };
|
||||
|
||||
|
||||
struct Item
|
||||
{
|
||||
int iCombo;
|
||||
@@ -37,6 +40,7 @@ void ReloadItems()
|
||||
Item item;
|
||||
item.iCombo = ITEM_COMBO(i);
|
||||
item.sModifier = ITEM_EFFECT(i);
|
||||
g_Items.push_back( item );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,9 +60,9 @@ void Inventory::Load( PlayerNumber pn )
|
||||
{
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_soundAcquireItem.Load( THEME->GetPathTo("Sounds",ssprintf("Inventory aquire item p%d",p+1)) );
|
||||
m_soundUseItem.Load( THEME->GetPathTo("Sounds",ssprintf("Inventory use item p%d",p+1)) );
|
||||
m_soundItemEnding.Load( THEME->GetPathTo("Sounds",ssprintf("Inventory item ending p%d",p+1)) );
|
||||
m_soundAcquireItem.Load( THEME->GetPathTo("Sounds","Inventory aquire item") );
|
||||
m_soundUseItem.Load( THEME->GetPathTo("Sounds","Inventory use item") );
|
||||
m_soundItemEnding.Load( THEME->GetPathTo("Sounds","Inventory item ending") );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,6 +95,24 @@ void Inventory::Update( float fDelta )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// use items if this player is CPU-controlled
|
||||
if( GAMESTATE->m_PlayerController[m_PlayerNumber] != HUMAN )
|
||||
{
|
||||
// every one second, consider using an item
|
||||
int iLastSecond = (int)RageTimer::GetTimeSinceStart() - fDelta;
|
||||
int iThisSecond = (int)RageTimer::GetTimeSinceStart();
|
||||
if( iLastSecond != iThisSecond )
|
||||
{
|
||||
int iSlotToConsider = rand()%NUM_INVENTORY_SLOTS;
|
||||
if( GAMESTATE->m_sInventory[m_PlayerNumber][iSlotToConsider] != "" &&
|
||||
rand()%5 == 0 )
|
||||
{
|
||||
UseItem( iSlotToConsider );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Inventory::AwardItem( int iItemIndex )
|
||||
|
||||
@@ -170,7 +170,7 @@ void MusicWheelItem::RefreshGrades()
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !data->m_pSong || // this isn't a song display
|
||||
!GAMESTATE->IsPlayerEnabled(p) ||
|
||||
!GAMESTATE->IsHumanPlayer(p) ||
|
||||
!SONGMAN->IsUsingMemoryCard((PlayerNumber)p) )
|
||||
{
|
||||
m_GradeDisplay[p].SetDiffuse( RageColor(1,1,1,0) );
|
||||
|
||||
+94
-22
@@ -42,6 +42,74 @@ CachedThemeMetricI BRIGHT_GHOST_COMBO_THRESHOLD("Player","BrightGhostComboTh
|
||||
static const float StepSearchDistanceBackwards = 1.0f;
|
||||
static const float StepSearchDistanceForwards = 1.0f;
|
||||
|
||||
struct TapScoreDistribution
|
||||
{
|
||||
float fCumulativeProbability[NUM_TAP_NOTE_SCORES];
|
||||
TapNoteScore GetTapNoteScore()
|
||||
{
|
||||
float fRand = randomf(0,1);
|
||||
for( int i=0; i<NUM_TAP_NOTE_SCORES; i++ )
|
||||
if( fRand <= fCumulativeProbability[i] )
|
||||
return (TapNoteScore)i;
|
||||
ASSERT(0); // the last probability must be 1.0, so we should never get here!
|
||||
return TNS_MARVELOUS;
|
||||
}
|
||||
};
|
||||
TapScoreDistribution TAP_SCORE_DISTRIBUTIONS[NUM_PLAYER_CONTROLLERS] =
|
||||
{
|
||||
// HUMAN
|
||||
{
|
||||
0.00f, // TNS_NONE
|
||||
1.00f, // TNS_MISS // don't ever hit automatically when human
|
||||
0.00f, // TNS_BOO
|
||||
0.00f, // TNS_GOOD
|
||||
0.00f, // TNS_GREAT
|
||||
0.00f, // TNS_PERFECT
|
||||
0.00f, // TNS_MARVELOUS
|
||||
},
|
||||
// CPU_EASY
|
||||
{
|
||||
0.00f, // TNS_NONE
|
||||
0.02f, // TNS_MISS
|
||||
0.06f, // TNS_BOO
|
||||
0.10f, // TNS_GOOD
|
||||
0.55f, // TNS_GREAT
|
||||
0.80f, // TNS_PERFECT
|
||||
1.00f, // TNS_MARVELOUS
|
||||
},
|
||||
// CPU_MEDIUM
|
||||
{
|
||||
0.00f, // TNS_NONE
|
||||
0.01f, // TNS_MISS
|
||||
0.02f, // TNS_BOO
|
||||
0.05f, // TNS_GOOD
|
||||
0.45f, // TNS_GREAT
|
||||
0.70f, // TNS_PERFECT
|
||||
1.00f, // TNS_MARVELOUS
|
||||
},
|
||||
// CPU_HARD
|
||||
{
|
||||
0.00f, // TNS_NONE
|
||||
0.005f, // TNS_MISS
|
||||
0.010f, // TNS_BOO
|
||||
0.02f, // TNS_GOOD
|
||||
0.10f, // TNS_GREAT
|
||||
0.50f, // TNS_PERFECT
|
||||
1.00f, // TNS_MARVELOUS
|
||||
},
|
||||
// CPU_AUTOPLAY
|
||||
{
|
||||
0.00f, // TNS_NONE
|
||||
0.00f, // TNS_MISS
|
||||
0.00f, // TNS_BOO
|
||||
0.00f, // TNS_GOOD
|
||||
0.00f, // TNS_GREAT
|
||||
0.00f, // TNS_PERFECT
|
||||
1.00f, // TNS_MARVELOUS
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Player::Player()
|
||||
{
|
||||
BRIGHT_GHOST_COMBO_THRESHOLD.Refresh();
|
||||
@@ -191,7 +259,7 @@ void Player::Update( float fDeltaTime )
|
||||
if( hn.fStartBeat < fSongBeat && fSongBeat < hn.fEndBeat ) // if the song beat is in the range of this hold
|
||||
{
|
||||
bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI );
|
||||
if( !GAMESTATE->m_bEditing && (PREFSMAN->m_bAutoPlay || GAMESTATE->m_bDemonstrationOrJukebox) )
|
||||
if( GAMESTATE->m_PlayerController[m_PlayerNumber] != HUMAN ) // TODO: Make the CPU miss sometimes.
|
||||
bIsHoldingButton = true;
|
||||
|
||||
m_NoteField.m_bIsHoldingHoldNote[i] = bIsHoldingButton && bSteppedOnTapNote; // set host flag so NoteField can do intelligent drawing
|
||||
@@ -348,27 +416,31 @@ void Player::Step( int col )
|
||||
if( iIndexOverlappingNote != -1 )
|
||||
{
|
||||
// compute the score for this hit
|
||||
const float fStepBeat = NoteRowToBeat( (float)iIndexOverlappingNote );
|
||||
float fStepBeat = NoteRowToBeat( (float)iIndexOverlappingNote );
|
||||
|
||||
const float fStepSeconds = GAMESTATE->m_pCurSong->GetElapsedTimeFromBeat(fStepBeat);
|
||||
float fStepSeconds = GAMESTATE->m_pCurSong->GetElapsedTimeFromBeat(fStepBeat);
|
||||
|
||||
// The offset from the actual step in seconds:
|
||||
const float fNoteOffset = fStepSeconds - GAMESTATE->m_fMusicSeconds;
|
||||
|
||||
const float fSecondsFromPerfect = fabsf( fNoteOffset ) / GAMESTATE->m_SongOptions.m_fMusicRate; // account for music rate
|
||||
float fNoteOffset = fStepSeconds - GAMESTATE->m_fMusicSeconds;
|
||||
|
||||
float fSecondsFromPerfect = fabsf( fNoteOffset ) / GAMESTATE->m_SongOptions.m_fMusicRate; // account for music rate
|
||||
|
||||
// calculate TapNoteScore
|
||||
TapNoteScore score;
|
||||
|
||||
if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowMarvelousSeconds ) score = TNS_MARVELOUS;
|
||||
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowPerfectSeconds ) score = TNS_PERFECT;
|
||||
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowGreatSeconds ) score = TNS_GREAT;
|
||||
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowGoodSeconds ) score = TNS_GOOD;
|
||||
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowBooSeconds ) score = TNS_BOO;
|
||||
else score = TNS_NONE;
|
||||
|
||||
if( !GAMESTATE->m_bEditing && (GAMESTATE->m_bDemonstrationOrJukebox || PREFSMAN->m_bAutoPlay) )
|
||||
score = TNS_MARVELOUS;
|
||||
if( GAMESTATE->m_PlayerController[m_PlayerNumber] == HUMAN )
|
||||
{
|
||||
if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowMarvelousSeconds ) score = TNS_MARVELOUS;
|
||||
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowPerfectSeconds ) score = TNS_PERFECT;
|
||||
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowGreatSeconds ) score = TNS_GREAT;
|
||||
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowGoodSeconds ) score = TNS_GOOD;
|
||||
else if( fSecondsFromPerfect <= PREFSMAN->m_fJudgeWindowBooSeconds ) score = TNS_BOO;
|
||||
else score = TNS_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
score = TAP_SCORE_DISTRIBUTIONS[GAMESTATE->m_PlayerController[m_PlayerNumber]].GetTapNoteScore();
|
||||
}
|
||||
|
||||
if( score==TNS_MARVELOUS && !PREFSMAN->m_bMarvelousTiming )
|
||||
score = TNS_PERFECT;
|
||||
@@ -505,14 +577,14 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
|
||||
|
||||
void Player::CrossedRow( int iNoteRow )
|
||||
{
|
||||
if( PREFSMAN->m_bAutoPlay || GAMESTATE->m_bDemonstrationOrJukebox )
|
||||
// check to see if there's at the crossed row
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
{
|
||||
// check to see if there's at the crossed row
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
if( GetTapNote(t, iNoteRow) != TAP_EMPTY )
|
||||
{
|
||||
if( GetTapNote(t, iNoteRow) != TAP_EMPTY )
|
||||
TapNoteScore tns = TAP_SCORE_DISTRIBUTIONS[ GAMESTATE->m_PlayerController[m_PlayerNumber] ].GetTapNoteScore();
|
||||
if( tns!=TNS_MISS )
|
||||
this->Step( t );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -531,7 +603,7 @@ void Player::HandleTapRowScore( unsigned row )
|
||||
|
||||
#ifndef DEBUG
|
||||
// don't accumulate points if AutoPlay is on.
|
||||
if( PREFSMAN->m_bAutoPlay && !GAMESTATE->m_bDemonstrationOrJukebox )
|
||||
if( m_PlayerController == CPU_AUTOPLAY && !GAMESTATE->m_bDemonstrationOrJukebox )
|
||||
return;
|
||||
#endif //DEBUG
|
||||
|
||||
@@ -552,7 +624,7 @@ void Player::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore )
|
||||
{
|
||||
#ifndef DEBUG
|
||||
// don't accumulate points if AutoPlay is on.
|
||||
if( PREFSMAN->m_bAutoPlay && !GAMESTATE->m_bDemonstrationOrJukebox )
|
||||
if( m_PlayerController == CPU_AUTOPLAY && !GAMESTATE->m_bDemonstrationOrJukebox )
|
||||
return;
|
||||
#endif //DEBUG
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ class Inventory;
|
||||
|
||||
#define SAMPLE_COUNT 16
|
||||
|
||||
|
||||
class Player : public NoteDataWithScoring, public ActorFrame
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -48,7 +48,7 @@ void RaveHelper::Update( float fDelta )
|
||||
if( GAMESTATE->m_bActiveAttackEndedThisUpdate[m_PlayerNumber] )
|
||||
m_soundAttackEnding.Play();
|
||||
|
||||
PlayerNumber pn = m_PlayerNumber;
|
||||
// PlayerNumber pn = m_PlayerNumber;
|
||||
|
||||
// TODO: Award item based on Super meter
|
||||
/*
|
||||
|
||||
@@ -26,17 +26,21 @@ ScoreDisplayBattle::ScoreDisplayBattle()
|
||||
{
|
||||
float fX = (float)SCALE(i,0.f,2.f,-60.f,60.f);
|
||||
|
||||
m_Inventory[i].SetX( fX );
|
||||
this->AddChild( &m_Inventory[i] );
|
||||
m_ItemFrame[i].Load( THEME->GetPathTo("Graphics","ScoreDisplayBattle frames") );
|
||||
m_ItemFrame[i].SetX( fX );
|
||||
m_ItemFrame[i].StopAnimating();
|
||||
m_ItemFrame[i].SetState( i );
|
||||
this->AddChild( &m_ItemFrame[i] );
|
||||
|
||||
m_ItemIcon[i].SetX( fX );
|
||||
m_ItemIcon[i].StopAnimating();
|
||||
this->AddChild( &m_ItemIcon[i] );
|
||||
}
|
||||
}
|
||||
|
||||
void ScoreDisplayBattle::Init( PlayerNumber pn )
|
||||
{
|
||||
ScoreDisplay::Init( pn );
|
||||
|
||||
for( int i=0; i<NUM_INVENTORY_SLOTS; i++ )
|
||||
m_Inventory[i].Load( m_PlayerNumber, "" );
|
||||
}
|
||||
|
||||
void ScoreDisplayBattle::Update( float fDelta )
|
||||
@@ -51,14 +55,14 @@ void ScoreDisplayBattle::Update( float fDelta )
|
||||
{
|
||||
m_iLastSeenInventory[s] = sNewItem;
|
||||
|
||||
m_Inventory[s].Load( m_PlayerNumber, sNewItem );
|
||||
|
||||
if( sNewItem == "" )
|
||||
m_Inventory[s].Command( "linear,0.25;zoom,0" );
|
||||
m_ItemIcon[s].Command( "linear,0.25;zoom,0" );
|
||||
else
|
||||
{
|
||||
m_Inventory[s].StopTweening();
|
||||
m_Inventory[s].Command( "diffuse,1,1,1,1;zoom,1;"
|
||||
// TODO: Cache all of the icon graphics so we don't load them dynamically from disk.
|
||||
m_ItemIcon[s].Load( THEME->GetPathTo("Graphics","ScoreDisplayBattle icon "+sNewItem) );
|
||||
m_ItemIcon[s].StopTweening();
|
||||
m_ItemIcon[s].Command( "diffuse,1,1,1,1;zoom,1;"
|
||||
"sleep,0.1;linear,0;diffusealpha,0;"
|
||||
"sleep,0.1;linear,0;diffusealpha,1;"
|
||||
"sleep,0.1;linear,0;diffusealpha,0;"
|
||||
@@ -67,5 +71,5 @@ void ScoreDisplayBattle::Update( float fDelta )
|
||||
"sleep,0.1;linear,0;diffusealpha,1;" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ public:
|
||||
virtual void Update( float fDelta );
|
||||
|
||||
protected:
|
||||
OptionIcon m_Inventory[NUM_INVENTORY_SLOTS];
|
||||
Sprite m_ItemFrame[NUM_INVENTORY_SLOTS];
|
||||
Sprite m_ItemIcon[NUM_INVENTORY_SLOTS];
|
||||
|
||||
CString m_iLastSeenInventory[NUM_INVENTORY_SLOTS];
|
||||
};
|
||||
|
||||
@@ -268,6 +268,7 @@ ScreenEdit::ScreenEdit()
|
||||
NOTESKIN->SwitchNoteSkin( PLAYER_1, "default" ); // change noteskin back to default before loading player
|
||||
|
||||
m_Player.Load( PLAYER_1, ¬eData, NULL, NULL, NULL, NULL );
|
||||
GAMESTATE->m_PlayerController[PLAYER_1] = HUMAN;
|
||||
m_Player.SetXY( PLAYER_X, PLAYER_Y );
|
||||
|
||||
m_Fade.SetClosed();
|
||||
@@ -1403,6 +1404,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
|
||||
m_EditMode = MODE_PLAYING;
|
||||
|
||||
m_Player.Load( PLAYER_1, (NoteData*)&m_NoteFieldEdit, NULL, NULL, NULL, NULL );
|
||||
GAMESTATE->m_PlayerController[PLAYER_1] = PREFSMAN->m_bAutoPlay?CPU_AUTOPLAY:HUMAN;
|
||||
|
||||
m_rectRecordBack.StopTweening();
|
||||
m_rectRecordBack.BeginTweening( 0.5f );
|
||||
|
||||
@@ -109,6 +109,8 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
{
|
||||
LOG->Trace( "ScreenGameplay::ScreenGameplay()" );
|
||||
|
||||
int p;
|
||||
|
||||
m_bDemonstration = bDemonstration;
|
||||
|
||||
SECONDS_BETWEEN_COMMENTS.Refresh();
|
||||
@@ -121,16 +123,21 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
/* Save selected options before we change them. */
|
||||
GAMESTATE->StoreSelectedOptions();
|
||||
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_pLifeMeter[p] = NULL;
|
||||
m_pScoreDisplay[p] = NULL;
|
||||
m_pScoreKeeper[p] = NULL;
|
||||
}
|
||||
m_pLifeMeter[p] = NULL;
|
||||
m_pScoreDisplay[p] = NULL;
|
||||
m_pScoreKeeper[p] = NULL;
|
||||
}
|
||||
|
||||
|
||||
// fill in difficulty of CPU players with that of the first human player
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsCpuPlayer(p) )
|
||||
GAMESTATE->m_pCurNotes[p] = GAMESTATE->m_pCurNotes[ GAMESTATE->GetFirstHumanPlayer() ];
|
||||
|
||||
|
||||
GAMESTATE->m_CurStageStats = StageStats(); // clear values
|
||||
|
||||
|
||||
@@ -161,7 +168,6 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
//
|
||||
// Init ScoreKeepers
|
||||
//
|
||||
int p;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
@@ -585,6 +591,29 @@ void ScreenGameplay::LoadNextSong()
|
||||
pStyleDef->GetTransformedNoteDataForStyle( (PlayerNumber)p, &pOriginalNoteData, &pNewNoteData );
|
||||
|
||||
m_Player[p].Load( (PlayerNumber)p, &pNewNoteData, m_pLifeMeter[p], m_pScoreDisplay[p], &m_Inventory[p], m_pScoreKeeper[p] );
|
||||
if( m_bDemonstration )
|
||||
GAMESTATE->m_PlayerController[p] = CPU_MEDIUM;
|
||||
else if( GAMESTATE->IsCpuPlayer(p) )
|
||||
{
|
||||
switch( GAMESTATE->m_pCurNotes[p]->GetDifficulty() )
|
||||
{
|
||||
case DIFFICULTY_BEGINNER:
|
||||
case DIFFICULTY_EASY:
|
||||
GAMESTATE->m_PlayerController[p] = CPU_EASY;
|
||||
break;
|
||||
case DIFFICULTY_MEDIUM:
|
||||
GAMESTATE->m_PlayerController[p] = CPU_MEDIUM;
|
||||
break;
|
||||
case DIFFICULTY_HARD:
|
||||
case DIFFICULTY_CHALLENGE:
|
||||
GAMESTATE->m_PlayerController[p] = CPU_HARD;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if( PREFSMAN->m_bAutoPlay )
|
||||
GAMESTATE->m_PlayerController[p] = CPU_AUTOPLAY;
|
||||
else
|
||||
GAMESTATE->m_PlayerController[p] = HUMAN;
|
||||
|
||||
m_TimingAssist.Reset();
|
||||
}
|
||||
@@ -1004,8 +1033,13 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
|
||||
m_textDebug.SetTweenDiffuse( RageColor(1,1,1,0) );
|
||||
break;
|
||||
case SDLK_F8:
|
||||
PREFSMAN->m_bAutoPlay = !PREFSMAN->m_bAutoPlay;
|
||||
UpdateAutoPlayText();
|
||||
{
|
||||
PREFSMAN->m_bAutoPlay = !PREFSMAN->m_bAutoPlay;
|
||||
UpdateAutoPlayText();
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsHumanPlayer(p) )
|
||||
GAMESTATE->m_PlayerController[p] = PREFSMAN->m_bAutoPlay?CPU_AUTOPLAY:HUMAN;
|
||||
}
|
||||
break;
|
||||
case SDLK_F9:
|
||||
case SDLK_F10:
|
||||
|
||||
@@ -57,6 +57,7 @@ ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay")
|
||||
GAMESTATE->m_bPastHereWeGo = true;
|
||||
|
||||
m_Player.Load( PLAYER_1, pND, NULL, NULL, NULL, NULL );
|
||||
GAMESTATE->m_PlayerController[PLAYER_1] = CPU_AUTOPLAY;
|
||||
m_Player.SetX( 480 );
|
||||
this->AddChild( &m_Player );
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ ScreenSelectMusic::ScreenSelectMusic()
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
if( !GAMESTATE->IsHumanPlayer(p) )
|
||||
continue; // skip
|
||||
|
||||
m_sprDifficultyFrame[p].Load( THEME->GetPathTo("Graphics","ScreenSelectMusic difficulty frame 2x1") );
|
||||
@@ -345,7 +345,7 @@ void ScreenSelectMusic::Input( const DeviceInput& DeviceI, InputEventType type,
|
||||
if( MenuI.button == MENU_BUTTON_RIGHT || MenuI.button == MENU_BUTTON_LEFT )
|
||||
{
|
||||
if( !MenuI.IsValid() ) return;
|
||||
if( !GAMESTATE->IsPlayerEnabled(MenuI.player) ) return;
|
||||
if( !GAMESTATE->IsHumanPlayer(MenuI.player) ) return;
|
||||
|
||||
/* If we're rouletting, hands off. */
|
||||
if(m_MusicWheel.IsRouletting())
|
||||
@@ -433,7 +433,7 @@ void ScreenSelectMusic::EasierDifficulty( PlayerNumber pn )
|
||||
{
|
||||
LOG->Trace( "ScreenSelectMusic::EasierDifficulty( %d )", pn );
|
||||
|
||||
if( !GAMESTATE->IsPlayerEnabled(pn) )
|
||||
if( !GAMESTATE->IsHumanPlayer(pn) )
|
||||
return;
|
||||
if( m_arrayNotes[pn].empty() )
|
||||
return;
|
||||
@@ -453,7 +453,7 @@ void ScreenSelectMusic::HarderDifficulty( PlayerNumber pn )
|
||||
{
|
||||
LOG->Trace( "ScreenSelectMusic::HarderDifficulty( %d )", pn );
|
||||
|
||||
if( !GAMESTATE->IsPlayerEnabled(pn) )
|
||||
if( !GAMESTATE->IsHumanPlayer(pn) )
|
||||
return;
|
||||
if( m_arrayNotes[pn].empty() )
|
||||
return;
|
||||
@@ -477,7 +477,7 @@ void ScreenSelectMusic::AdjustOptions()
|
||||
Difficulty dc = DIFFICULTY_INVALID;
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
if( !GAMESTATE->IsHumanPlayer(p) )
|
||||
continue; // skip
|
||||
|
||||
dc = min(dc, GAMESTATE->m_pCurNotes[p]->GetDifficulty());
|
||||
@@ -614,7 +614,7 @@ void ScreenSelectMusic::MenuStart( PlayerNumber pn )
|
||||
bool bIsHard = false;
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
||||
if( !GAMESTATE->IsHumanPlayer( (PlayerNumber)p ) )
|
||||
continue; // skip
|
||||
if( GAMESTATE->m_pCurNotes[p] && GAMESTATE->m_pCurNotes[p]->GetMeter() >= 10 )
|
||||
bIsHard = true;
|
||||
@@ -695,7 +695,7 @@ void ScreenSelectMusic::MenuBack( PlayerNumber pn )
|
||||
|
||||
void ScreenSelectMusic::AfterNotesChange( PlayerNumber pn )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(pn) )
|
||||
if( !GAMESTATE->IsHumanPlayer(pn) )
|
||||
return;
|
||||
|
||||
m_iSelection[pn] = clamp( m_iSelection[pn], 0, int(m_arrayNotes[pn].size()-1) ); // bounds clamping
|
||||
@@ -807,7 +807,7 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
m_sprCDTitle.Load( THEME->GetPathTo("Graphics","ScreenSelectMusic fallback cdtitle") );
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled( PlayerNumber(p) ) )
|
||||
if( !GAMESTATE->IsHumanPlayer( PlayerNumber(p) ) )
|
||||
continue;
|
||||
|
||||
/* Find the closest match to the user's preferred difficulty. */
|
||||
@@ -890,7 +890,7 @@ void ScreenSelectMusic::UpdateOptionsDisplays()
|
||||
{
|
||||
m_OptionIconRow[p].Refresh( (PlayerNumber)p );
|
||||
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
if( GAMESTATE->IsHumanPlayer(p) )
|
||||
{
|
||||
CString s = GAMESTATE->m_PlayerOptions[p].GetString();
|
||||
s.Replace( ", ", "\n" );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 60000
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
@@ -57,10 +57,10 @@ LINK32=link.exe
|
||||
# SUBTRACT LINK32 /verbose /pdb:none
|
||||
# Begin Special Build Tool
|
||||
IntDir=.\../Release6
|
||||
TargetDir=\temp\stepmania
|
||||
TargetDir=\stepmania\stepmania
|
||||
TargetName=StepMania
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -92,10 +92,10 @@ LINK32=link.exe
|
||||
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||
# Begin Special Build Tool
|
||||
IntDir=.\../Debug6
|
||||
TargetDir=\temp\stepmania
|
||||
TargetDir=\stepmania\stepmania
|
||||
TargetName=StepMania-debug
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -519,6 +519,14 @@ SOURCE=.\RandomSample.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RaveHelper.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RaveHelper.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Song.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -1468,6 +1476,14 @@ SOURCE=.\ScoreDisplayOni.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ScoreDisplayRave.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ScoreDisplayRave.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ScoreKeeper.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -689,6 +689,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
<File
|
||||
RelativePath=".\RandomSample.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="RaveHelper.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="RaveHelper.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Song.cpp">
|
||||
</File>
|
||||
|
||||
Reference in New Issue
Block a user