smarter AI handling of mines

This commit is contained in:
Chris Danford
2004-01-11 23:31:37 +00:00
parent 8da2490986
commit 0afed1540a
+15 -1
View File
@@ -734,7 +734,21 @@ void PlayerMinus::Step( int col, RageTimer tm )
// as "mine was hit" and everything else as "mine was avoided"
if( tn == TAP_MINE )
{
if( score > TNS_GOOD )
// The CPU hits a lot of mines. Only consider hitting the
// first mine for a row. We know we're the first mine if
// there are are no mines to the left of us.
for( int t=0; t<col; t++ )
{
if( TAP_MINE == GetTapNote(t,iIndexOverlappingNote) ) // there's a mine to the left of us
return; // avoid
}
// The CPU hits a lot of mines. Make it less likely to hit
// mines that don't have a tap note on the same row.
bool bTapsOnRow = IsThereATapOrHoldHeadAtRow( iIndexOverlappingNote );
TapNoteScore get_to_avoid = bTapsOnRow ? TNS_GREAT : TNS_GOOD;
if( score >= get_to_avoid )
{
return; // avoided
}