Exemple #1
0
 private void stageEnd()
 {
     if (Game.Player.WantedLevel == 0)
     {
         int jobPayoutEach = jobPayout / (currentCrew.Count() + 1);
         foreach (CrewMember crewMember in currentCrew)
         {
             crewMember.ped.Money    = jobPayoutEach;
             crewMember.followPlayer = false;
             crewMember.ped.Task.LeaveVehicle();
             crewMember.isAliveAtDropoff = true;
         }
         Game.Player.Money += jobPayoutEach;
         currentStageAction = Jobs.Stage.END;
         currentJob.locationSet.isComplete = true;
         if (currentStageBlip != null && currentStageBlip.Exists())
         {
             currentStageBlip.Remove();
         }
         currentLevel++;
     }
     else
     {
         currentStageAction = Jobs.Stage.FAIL;
         Random random   = new Random();
         int    index    = random.Next(Dialogue.wantedOnArrival.Count);
         string response = Dialogue.wantedOnArrival[index];
         UI.ShowSubtitle(response, 5);
         CopGenerator.MissionFailSpawn();
     }
 }
Exemple #2
0
 // Staging Methods
 private void stagePickup()
 {
     if (eligibleVehicles.Contains(Game.Player.Character.CurrentVehicle))
     {
         if (Game.Player.Character.CurrentVehicle.PassengerSeats < currentCrew.Count)
         {
             Random random   = new Random();
             int    index    = random.Next(Dialogue.notEnoughSeats.Count);
             string response = Dialogue.notEnoughSeats[index];
             UI.ShowSubtitle(response, 5);
         }
         else
         {
             foreach (CrewMember crewMember in currentCrew)
             {
                 crewMember.followPlayer = true;
             }
             currentStageAction = Jobs.Stage.PICKUP_WAIT;
         }
     }
     else
     {
         Random random   = new Random();
         int    index    = random.Next(Dialogue.notStolen.Count);
         string response = Dialogue.notStolen[index];
         UI.ShowSubtitle(response, 5);
     }
 }
Exemple #3
0
 private void stageEscape()
 {
     Game.Player.WantedLevel = 2;
     if (currentStageBlip != null && currentStageBlip.Exists())
     {
         currentStageBlip.Remove();
     }
     currentStageLocation = new Vector3(146.7975f, 321.4382f, 1000f);
     currentStageBlip     = Utility.createBlip(currentStageLocation, "Crew Drop-off");
     currentStageAction   = Jobs.Stage.ESCAPE;
 }
Exemple #4
0
 private void stagePickupWait()
 {
     if (currentStageBlip != null && currentStageBlip.Exists())
     {
         currentStageBlip.Remove();
     }
     currentStageLocation   = currentJob.locationSet.heistDropoffLocation;
     currentStageLocation.Z = World.GetGroundHeight(new Vector2(currentStageLocation.X, currentStageLocation.Y));
     currentStageBlip       = Utility.createBlip(currentStageLocation, "Heist Location");
     currentStageAction     = Jobs.Stage.JOURNEY;
 }
Exemple #5
0
 private void stageHeistWait()
 {
     jobPayout = new Random().Next(currentJob.valueLower, currentJob.valueUpper);
     foreach (CrewMember crewMember in currentCrew)
     {
         crewMember.ped.Money      = jobPayout / currentCrew.Count();
         crewMember.heistTargetPed = null;
         crewMember.isRunning      = true;
         crewMember.followPlayer   = true;
     }
     currentStageAction = Jobs.Stage.HEIST_WAIT;
 }
Exemple #6
0
        private void createNewJob()
        {
            currentJob             = JobFactory.CreateNewJob(currentLevel);
            currentStageLocation   = currentJob.locationSet.heistPickupLocation;
            currentStageLocation.Z = World.GetGroundHeight(new Vector2(currentStageLocation.X, currentStageLocation.Y));
            currentStageBlip       = Utility.createBlip(currentStageLocation, "Crew Pickup");
            currentStageAction     = Jobs.Stage.PICKUP;
            Random random      = new Random();
            int    index       = random.Next(Dialogue.docMissionReady.Count);
            string docResponse = Dialogue.docMissionReady[index];

            Utility.DisplayNotificationThisFrame(
                docResponse, "Doc", "Message"
                );
            newJobStartTick = 0;
        }
Exemple #7
0
        private void stageHeistArrival()
        {
            Ped heistTargetPed = currentJob.GetTargetPed();

            heistTargets.Add(heistTargetPed);
            Vector3 heistLocation = currentJob.locationSet.heistStartLocations[0];

            heistLocation.Z = World.GetGroundHeight(new Vector2(heistLocation.X, heistLocation.Y));
            foreach (CrewMember crewMember in currentCrew)
            {
                crewMember.setToHeistOutfit();
                crewMember.followPlayer = false;
                crewMember.ped.Task.LeaveVehicle();
                crewMember.heistTargetPed = heistTargetPed;
                crewMember.targetLocation = heistTargetPed.Position;
                crewMember.moveToTargetLocation();
            }
            currentStageAction = Jobs.Stage.HEIST_ARRIVAL;
        }
Exemple #8
0
 public static bool isStageCloseFailReady(Jobs.Stage stageAction)
 {
     return(stageAction == Jobs.Stage.FAIL && Game.Player.Character.CurrentVehicle.IsStopped && Game.Player.WantedLevel == 0);
 }
Exemple #9
0
 public static bool isStageCloseSuccessReady(Jobs.Stage stageAction, Vector3 stageLocation, Vector3 playerPosition)
 {
     return(stageAction == Jobs.Stage.END && playerPosition.DistanceTo2D(stageLocation) > 50f);
 }
Exemple #10
0
 public static bool isStageEscapeReady(Jobs.Stage stageAction, List <Crew.CrewMember> currentCrew)
 {
     return(stageAction == Jobs.Stage.HEIST_WAIT && currentCrew.All(x => x.ped.IsInVehicle()));
 }
Exemple #11
0
 public static bool isStagePickupWaitReady(Jobs.Stage stageAction, List <Crew.CrewMember> currentCrew)
 {
     return(stageAction == Jobs.Stage.PICKUP_WAIT && currentCrew.All(x => x.ped.IsInVehicle()));
 }
Exemple #12
0
 public static bool isReadyForNewJob(Jobs.Stage stageAction, int newJobStartTick)
 {
     return(stageAction == Jobs.Stage.NONE && newJobStartTick != 0 && Environment.TickCount > newJobStartTick);
 }
Exemple #13
0
 public static Vector3 heightCorrection(Vector3 givenLocation, Jobs.Stage currentStageAction)
 {
     givenLocation.Z = currentStageAction == Jobs.Stage.ESCAPE ? 111f : World.GetGroundHeight(new Vector2(givenLocation.X, givenLocation.Y));
     return(givenLocation);
 }
Exemple #14
0
        private void resetAll()
        {
            mainMenu = new UIMenu("Baby Driver", "~b~SETTINGS");

            UIMenuCheckboxItem policeCheckbox = new UIMenuCheckboxItem("Show police blips on minimap?", false);

            mainMenu.AddItem(policeCheckbox);
            mainMenu.OnCheckboxChange += (sender, item, isChecked) =>
            {
                if (item == policeCheckbox)
                {
                    showPoliceOnMap = isChecked;
                }
            };

            UIMenuListItem levelList = new UIMenuListItem("Current Level:", new List <dynamic> {
                0, 1, 2, 3
            }, 1);

            mainMenu.AddItem(levelList);
            mainMenu.OnListChange += (sender, item, index) =>
            {
                if (item == levelList)
                {
                    currentLevel = (int)item.Items[index];
                }
            };

            mainMenu.RefreshIndex();
            menuPool = new MenuPool();
            menuPool.Add(mainMenu);

            newJobStartTick       = 0;
            heistEndTick          = 0;
            jobPayout             = 0;
            currentPlayerPosition = Game.Player.Character.GetOffsetInWorldCoords(new Vector3(0, 0, 0));
            currentStageLocation  = new Vector3(0f, 0f, 0f);
            currentStageAction    = Jobs.Stage.NONE;
            currentJob            = null;

            foreach (Blip blip in World.GetActiveBlips())
            {
                if (blip.Color == BlipColor.Yellow2 && (blip.Sprite == BlipSprite.Cab || blip.Sprite == BlipSprite.DollarSign || blip.Sprite == BlipSprite.Garage))
                {
                    blip.Remove();
                }
            }
            currentStageBlip = null;

            foreach (Ped ped in World.GetAllPeds())
            {
                int headComp  = Function.Call <int>(Hash.GET_PED_DRAWABLE_VARIATION, ped, 1);
                int torsoComp = Function.Call <int>(Hash.GET_PED_DRAWABLE_VARIATION, ped, 3);
                int legsComp  = Function.Call <int>(Hash.GET_PED_DRAWABLE_VARIATION, ped, 4);
                if (ped != Game.Player.Character && (
                        (ped.Model == PedHash.Michael && headComp == 3 && torsoComp == 30 && legsComp == 4) ||
                        (ped.Model == PedHash.Trevor && headComp == 2 && torsoComp == 14 && legsComp == 18) ||
                        (ped.Model == PedHash.Franklin && headComp == 2 && torsoComp == 13 && legsComp == 13)
                        ))
                {
                    ped.Delete();
                }
            }

            currentCrew      = new List <CrewMember>();
            heistTargets     = new List <Ped>();
            eligibleVehicles = new List <Vehicle>();
        }