示例#1
0
 public MissionNPC(PedHash model, Family fam, Vector3 position, float h, string nm, Mission.Type t, int r)
     : base(fam, model, position, h)
 {
     name = nm;
     missionType = t;
     repNeeded = r;
 }
示例#2
0
 public Main()
 {
     InitFamilies();
     missionMenu = new MissionMenu(OnMissionAccept);
     statusMenu = new StatusMenu(families[SaveData.Instance.GetFamily()]);
     missionCreator = new MissionCreator(families, dialogue);
     currentMission = null;
     Tick += onTick;
     KeyUp += onKeyUp;
 }
        private Mission generateDrugDealMission()
        {
            Mission m = new Mission("Name", families[2], 1);
            Vector3 start = new Vector3(123.913f, -27.832f, 67.4638f);//TODO get random start location
            Vector3 end = new Vector3(-1880.32f, 186.655f, 83.7598f);//TODO get random start location

            m.AddStep(new TravelStep(start));
            m.AddStep(new DealStep(start, 30, 10));

            return m;
        }
        private Mission generateRetrievementMission()
        {
            Mission m = new Mission("test", families[3], 50);//debug code change for release

            //Vector3 start = new Vector3(1134.89f, -1289.24f, 34.16f);//TODO get random start location
            Vector3 start = new Vector3(-1896.94f, 175.676f, 82.1884f);//TODO get random start location
            Vector3 end = new Vector3(-1880.32f, 186.655f, 83.7598f);//TODO get random start location
            MyEntity target = new MyEntity(World.CreateVehicle(VehicleHash.Adder, start));//TODO get random car

            m.AddStep(new TravelStep(start));
            m.AddStep(new CollectionStep(target));
            m.AddStep(new DeliveryStep(end, target));
            return m;
        }
 public Mission Create(Mission.Type type, Family targetFamily)
 {
     switch (type)
     {
         case Mission.Type.Assassination:
             return generateAssassinationMission();
         case Mission.Type.Retrievement:
             return generateRetrievementMission();
         case Mission.Type.DrugTrafficking:
             break;
         case Mission.Type.DrugDealing:
             return generateDrugDealMission();
         case Mission.Type.HumanTrafficking:
             break;
         case Mission.Type.Delivery:
             break;
         case Mission.Type.Recruitment:
             break;
     }
     return null;
 }
示例#6
0
 private void OnMissionAccept()
 {
     currentMission = missionCreator.Create(Mission.Type.DrugDealing, families[2]);
     currentMission.Start();
 }
示例#7
0
 private void MissionCheck()
 {
     if (currentMission == null) return;
     if (currentMission.isFailed())
     {
         currentMission = null;
     }
     else if (currentMission.isCompleted())
     {
         SaveData.Instance.AddProgress(currentMission.GetReward(), true);
         currentMission = null;
     }
 }
示例#8
0
 private string parseKey(string n, Mission.Type t, Stage s)
 {
     return string.Format("{0}{1}/{2}/{3}", startnode, n.ToLower(), t.ToString().ToLower(), s.ToString().ToLower());
 }
示例#9
0
 /// <summary>
 /// Creates a new MissionNPC
 /// </summary>
 /// <param name="fam">The family</param>
 /// <param name="model">The model</param>
 /// <param name="pos">The position</param>
 /// <param name="heading">The way the npc is facing</param>
 /// <param name="name">The name of the npc</param>
 /// <param name="mtype">The mission type this npc gives</param>
 /// <param name="rep">The repetition needed to start a mission</param>
 /// <returns>Returns a new MissionNPC</returns>
 protected MissionNPC CreateMissionNPC(Family fam, PedHash model, Vector3 pos, float heading, string name, Mission.Type mtype, int rep)
 {
     MissionNPC qm = new MissionNPC(model, fam, pos, heading, name, mtype, rep);
     for (int i = questMembers.Count-1; i >= 0 ; i--)
     {
         if (questMembers[i] == null)
         {
             continue;
         }
         MissionNPC qmem = questMembers[i];
         if (qmem.Equals(qm))
         {
             qmem.Dispose();
             questMembers.Remove(qmem);
             break;
         }
     }
     questMembers.Add(qm);
     return qm;
 }