Exemplo n.º 1
0
        public override void checkRequiredElements()
        {
            base.checkRequiredElements();

            while (Joe.bike == null || !Joe.bike.Exists())
            {
                Joe.bike = World.CreateVehicle(VehicleHash.TriBike, bikePositionAtHome);

                for (int i = 0; i < this.getObjectives().Count; i++)
                {
                    AbstractObjective objective = this.getObjectives()[i];
                    if (objective is GoToPositionInVehicle)
                    {
                        ((GoToPositionInVehicle)objective).setVehicle(Joe.bike);

                        if (objective.Checkpoint != null)
                        {
                            objective.Checkpoint.removeEntities();
                            if (i < 3)
                            {
                                objective.Checkpoint.addEntity(Joe.bike, bikePositionAtHome, 0);
                            }
                            else if (i < 6)
                            {
                                objective.Checkpoint.addEntity(Joe.bike, roadFaceToPoliceStationPosition, 0);
                            }
                            else
                            {
                                objective.Checkpoint.addEntity(Joe.bike, thirdSongBikePosition, -90);
                            }
                        }
                    }
                }
            }
            Joe.bike.EnginePowerMultiplier = 100;
            Joe.bike.IsInvincible          = true;
            Joe.bike.CanTiresBurst         = false;

            ModelManager.Instance.setDemagoModel(DemagoModel.Joe);

            Ped player = Game.Player.Character;

            player.MaxHealth = 300;
            Function.Call(Hash.SET_PED_MAX_HEALTH, player, player.MaxHealth);
            player.Health = 300;

            CameraShotsList.Instance.reset();
            AudioManager.Instance.FilesSubFolder = @"joe\joe";
            Subtitles.SubtitlesPath = @"musics\joe\joe." + DemagoScript.language + ".st";
        }
Exemplo n.º 2
0
        private void next()
        {
            currentObjectiveIndex++;

            GUIManager.Instance.missionUI.setAdvice("");
            GUIManager.Instance.missionUI.setObjective("");

            if (currentObjectiveIndex >= objectives.Count)
            {
                this.accomplish();
            }
            else
            {
                this.checkRequiredElements();
                AbstractObjective objective = objectives[currentObjectiveIndex];
                objective.start();
            }
        }
Exemplo n.º 3
0
        public override bool update()
        {
            if (!base.update())
            {
                return(false);
            }

            if (this.currentObjectiveIndex < objectives.Count)
            {
                AbstractObjective objective = objectives[currentObjectiveIndex];

                if (introEnded)
                {
                    objective.update();
                }

                if (this.loadingCheckpoint)
                {
                    if (this.currentObjectiveIndex < this.lastActivableCheckpointIndex)
                    {
                        if (this.currentObjectiveIndex == 0)
                        {
                            objectives[0].start();
                        }
                        objective.accomplish();
                    }
                    else
                    {
                        this.lastActivableCheckpointIndex = 0;
                        this.loadingCheckpoint            = false;
                        Game.FadeScreenIn(500);
                    }
                }

                GUIManager.Instance.missionUI.setMissionTime(Tools.getTextFromMilliSeconds(this.getElaspedTime()));
                GUIManager.Instance.missionUI.setObjectiveTime(Tools.getTextFromMilliSeconds(objective.getElaspedTime()));
            }
            else
            {
                this.accomplish();
            }

            return(true);
        }
Exemplo n.º 4
0
        public void addObjective(AbstractObjective objective)
        {
            objective.OnFailed += (sender, reason) => {
                #region Show checkpoint popup
                var title = reason;
                var subtitle = "Voulez-vous revenir au dernier checkpoint ?";

                ConfirmationPopup checkpointPopup = new ConfirmationPopup(title, subtitle);
                checkpointPopup.OnPopupAccept += () =>
                {
                    this.loadLastCheckpoint();
                };
                checkpointPopup.OnPopupRefuse += () =>
                {
                    this.stop(true);
                };
                checkpointPopup.show();
                #endregion
            };
            objective.OnAccomplished += (sender, elapsedTime) => {
                this.next();
            };
            objectives.Add(objective);
        }
Exemplo n.º 5
0
        public void addObjective(AbstractObjective objective)
        {
            objective.OnFailed += (sender, reason) => {
                #region Show checkpoint popup
                var title    = reason;
                var subtitle = "Voulez-vous revenir au dernier checkpoint ?";

                ConfirmationPopup checkpointPopup = new ConfirmationPopup(title, subtitle);
                checkpointPopup.OnPopupAccept += () =>
                {
                    this.loadLastCheckpoint();
                };
                checkpointPopup.OnPopupRefuse += () =>
                {
                    this.stop(true);
                };
                checkpointPopup.show();
                #endregion
            };
            objective.OnAccomplished += (sender, elapsedTime) => {
                this.next();
            };
            objectives.Add(objective);
        }