Beispiel #1
0
        public void initializeCinematicCamSequence(StrafeRun.StrafeRunPropertiesSummary srps)
        {
            _activeSrps = srps;

            // randomly select a sequence from available sequences
            int randIdx = rng.Next(0, _sequences.Length);

            StrafeRunCinematicCam[] selectedSequence = _sequences[randIdx];
            _activeSequence = new Queue <SRCC>(selectedSequence);

            // initialize an duplicated GameplayCamera, and render from it
            Camera gpCam = Helper.duplicateGameplayCam();

            World.RenderingCamera = gpCam;
            _activeCam            = gpCam;

            // activate the 1st cam in selectedSequence and interp to it
            activateAndInterpToNextCam();

            // handle player invincibility
            if (_invincibleWhileActive)
            {
                // remember player's current invincibility state, then set player to invincible
                _initialInvincibilityState = Game.Player.IsInvincible;
                Game.Player.IsInvincible   = true;

                // if player is in vehicle, remember its invincibility state, then set vehicle to
                if (Game.Player.Character.IsInVehicle())
                {
                    _initialPlayerVeh = Game.Player.Character.CurrentVehicle;
                    _initialPlayerVehInvincibilityState = _initialPlayerVeh.IsInvincible;
                    _initialPlayerVeh.IsInvincible      = true;
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Create and return a camera created based on Strafe Run properties and predefined settings.
        /// </summary>
        /// <param name="srps">Instance of <c>StrafeRun.StrafeRunPropertiesSummary</c></param>
        /// <returns><c>Camera</c> that can be activated</returns>
        public Camera createCamera(StrafeRun.StrafeRunPropertiesSummary srps)
        {
            int randVehIdx = StrafeRunCinematicCamController.rng.Next(0, srps.vehicles.Count);

            switch (_type)
            {
            case cinematicCamType.BirdsEyeTargetStrafeVehAngle:
                return(createBirdsEyeTargetStrafeVehAngleCam(srps.targetPos, srps.vehicles[randVehIdx]));

            case cinematicCamType.BirdsEyeTargetRandomAngle:
                return(createBirdsEyeTargetCam(srps.targetPos));

            case cinematicCamType.StrafeVeh45offset:
                return(createStrafeVeh45offsetCam(srps.vehicles[randVehIdx]));

            case cinematicCamType.StrafeVehFirstPersonLookAtPos:
                return(createStrafeVehFirstPersonCam(srps.vehicles[randVehIdx], srps.targetPos));

            case cinematicCamType.PlayerLookAtStrafeVeh:
                return(createPlayerLookAtStrafeVehCam(srps.vehicles[randVehIdx]));

            case cinematicCamType.TargetLookAtStrafeVeh:
                return(createTargetLookAtStrafeVehCam(srps.targetPos, srps.vehicles[randVehIdx]));

            case cinematicCamType.StrafeVehFlyBy:
                return(createStrafeVehFlyByCam(srps.vehicles[randVehIdx]));

            case cinematicCamType.PlayerLookAtTarget:
                return(createPlayerLookAtTargetCam(srps.targetPos));

            case cinematicCamType.PlayerLookAtTargetZoomed:
                return(createPlayerLookAtTargetCam(srps.targetPos, 20f));

            default:
            case cinematicCamType.FollowStrafeVeh:
                return(createFollowStrafeVehicleCam(srps.vehicles[randVehIdx], srps.targetPos));
            }
        }