//------------------------------------------------------------------------------
// Purpose: determines if we can use this behavior currently
// Output : returns true if this behavior is able to run
//------------------------------------------------------------------------------
bool CAI_ASW_JumpBehavior::CanSelectSchedule()
{
    if ( !GetOuter()->IsInterruptable() )
    {
        return false;
    }

    if ( !ShouldJump() )
    {
        return false;
    }

    return BaseClass::CanSelectSchedule();
}
Example #2
0
void CASW_Alien_Jumper::PrescheduleThink( void )
{
	//New Enemy? Try to jump at him.
	if ( HasCondition( COND_NEW_ENEMY ) )
	{
		m_flJumpTime = 0.0f;
	}

	if ( ShouldJump() )
	{
		SetCondition( COND_ASW_ALIEN_CAN_JUMP );
	}
	else
	{
		ClearCondition( COND_ASW_ALIEN_CAN_JUMP );
	}

	BaseClass::PrescheduleThink();
}