Beispiel #1
0
	inline ActionResult<CTFBot> CTFBotRocketJump_JumpVertical::Update(CTFBot *actor, float dt)
	{
		Vector vecEyes;
		actor->EyeVectors(&vecEyes);
		
		Vector vecDown(0.0f, 0.0f, -1.0f);
		
		constexpr float tolerance = cos(5_deg);
		bool is_aiming_down	= (DotProduct(vecEyes, vecDown) >= tolerance);
		
		if (is_aiming_down) {
			const QAngle& eyeang = actor->EyeAngles();
			DevMsg("*** EyeAngles:  [ %f %f %f ]\n", eyeang.x, eyeang.y, eyeang.z);
			DevMsg("*** EyeVectors: [ %f %f %f ]\n", vecEyes.x, vecEyes.y, vecEyes.z);
			
			actor->PressJumpButton(0.1f);
			actor->PressCrouchButton(3.0f);
			actor->PressFireButton();
			return ActionResult<CTFBot>::Done("Jumped successfully");
		}
		
		if (this->m_itTimeout.IsGreaterThen(1.0f)) {
			return ActionResult<CTFBot>::Done("Timed out");
		}
		
		return ActionResult<CTFBot>::Continue();
	}
//-----------------------------------------------------------------------------
// Purpose:
//
//-----------------------------------------------------------------------------
void CBaseHelicopter::DrawRotorWash( float flAltitude, Vector vecRotorOrigin )
{
	// Shake any ropes nearby
	if ( random->RandomInt( 0, 2 ) == 0 )
	{
		CRopeKeyframe::ShakeRopes( GetAbsOrigin(), flAltitude, 128 );
	}

	if ( m_spawnflags & SF_NOROTORWASH )
		return;

	DoRotorPhysicsPush( vecRotorOrigin, flAltitude );

	// Send down the rotor wash
	Vector vecDown( 0, 0, -1 );
	UTIL_RotorWash( vecRotorOrigin, vecDown, flAltitude );
}