/////// /////// /////// // this is used to set and check whether a spot is in use or not SpawnSpotsVacant <- []; m_nTotalSpawnSpots <- 10 for ( local i=0; i= m_nTotalSpawnSpots ) return //printl( "Showing Target. Removing "+slot+" from table" ) local index = SpawnInOrder[m_nSpawnInOrderIndex].tointeger() if ( m_bIsRunningBodyDamMain && index == 5 ) { EntFire( "@hint_crouch_button", "ShowHint", "" ) if( !m_bPlayerIsCrouching && !m_bHasPlayedCrouchDialog ) { m_bHasPlayedCrouchDialog <- true EntFire( "@radiovoice", "runscriptcode", "BodyDamageCrouchForAccuracy()", 0) } } if ( m_bIsRunningBodyDamTimed ) { if ( index == 4 ) { // there was a bug here that prevented this part of the test from working and we don't have the time to fix it //EntFire( "@hint_hical_bullets_penetrate", "ShowHint", "" ); } else if ( index == 7 ) { EntFire( "@hint_crouch_is_more_accurate", "ShowHint", "" ); } } EntFire( EntityGroup[index].GetName(), "Open", "" ); m_nSpawnInOrderIndex++ m_nNumOrderTargetsVisible++ } // when a target has been hit, hide it and free up the slot again function TargetIsHidden( slot ) { if ( m_bIsRunningBodyDamIntro == true ) { if ( m_nHitIntroTargs < m_nMaxHitIntroTargs ) { m_nHitIntroTargs++ if ( m_nHitIntroTargs >= m_nMaxHitIntroTargs ) { CompleteTest() } } return } printl( "Hiding target. Adding "+slot+" to table" ); if ( m_bDisplayingInOrder ) { TargetIsHiddenInOrder() return } if ( m_nPrevVacantAddNum > -1 ) { local num = m_nPrevVacantAddNum + "" SpawnSpotsVacant.append( num ); } m_nPrevVacantAddNum = slot } // we dont care which target was hidden, just that it's time to show a new one function TargetIsHiddenInOrder() { //printl( "Hiding target. Adding "+slot+" to table" ); m_nNumOrderTargetsVisible-- // clamp if( m_nNumOrderTargetsVisible < 0 ) { m_nNumOrderTargetsVisible = 0 } m_flLastThink <- Time() } function StartRunning() { m_bIsRunningBodyDamIntro = true m_flSpawnDelay = 0 m_nOutOfAmmoTimes = 0 } function StopRunningBodyDamIntro() { m_bIsRunningBodyDamIntro = false for ( local i=0; i Time() ) return // this controls the spawns if ( m_bDisplayingInOrder == true ) { if ( m_nNumOrderTargetsVisible < m_nMaxNumOrderTargetsVisible ) { ShowTargetInOrder() printl( "ShowTargetInOrder; time = "+ Time() +"; m_nNumOrderTargetsVisible = "+ m_nNumOrderTargetsVisible ); } } else { m_flLastThink = Time(); if ( SpawnSpotsVacant.len() > 0 ) { printl( "SpawnSpotsVacant.len() = "+SpawnSpotsVacant.len() ); local nMax = (SpawnSpotsVacant.len() > 0) ? (SpawnSpotsVacant.len()-1) : 0 local targetSpot = RandomInt( 0, nMax ) ShowTarget( targetSpot ) } } }