Beispiel #1
0
        private static void AssignScenarios()
        {
            Models.ScenarioData fightScenarioData = new Models.ScenarioData();
            fightScenarioData.Name             = "Fight Scenario";
            fightScenarioData.ChanceToActivate = 100;
            fightScenarioData.Position         = new Vector3(2302.0f, 3071.0f, 0f);
            fightScenarioData.ActivateDistance = 100f;
            scenarios.Add(fightScenarioData);
            debugBlip1       = new Blip(fightScenarioData.Position, fightScenarioData.ActivateDistance);
            debugBlip1.Alpha = 0.5f;

            Models.ScenarioData loiteringScenarioData = new Models.ScenarioData();
            loiteringScenarioData.Name             = "Loitering Scenario";
            loiteringScenarioData.ChanceToActivate = 100;
            loiteringScenarioData.Position         = new Vector3(2325.0f, 3141.0f, 0f);
            loiteringScenarioData.ActivateDistance = 100f;
            debugBlip2       = new Blip(loiteringScenarioData.Position, loiteringScenarioData.ActivateDistance);
            debugBlip2.Alpha = 0.5f;

            scenarios.Add(loiteringScenarioData);
        }
Beispiel #2
0
 private static void UpdateScenarios()
 {
     while (true)
     {
         GameFiber.Sleep(500);
         if (scenarios.Count == 0)
         {
             continue;
         }
         Tuple <Models.ScenarioData, float> tuple = LocationHelper.SelectClosestScenarioToPlayer(scenarios);
         closestScenario = tuple.Item1;
         float scenarioDistanceToPlayer = tuple.Item2;
         if (scenarioDistanceToPlayer < closestScenario.ActivateDistance)
         {
             logicLoopShouldRun = true;
             StartLogic();
         }
         else
         {
             logicLoopShouldRun = false;
         }
         GameFiber.Yield();
     }
 }
Beispiel #3
0
 public Scenario(ScenarioData scenarioData)
 {
     this.ScenarioData = scenarioData;
 }