Example #1
0
        protected override void UpdateOnceWhenTriggered()
        {
            var player = GameState.Current?.LocalPlayer;

            if (!player.IsValid())
            {
                return;
            }

            var objects = LocationScene.GetAllObjects <WorldInteractiveObject>();

            foreach (var obj in objects)
            {
                if (!obj.IsValid())
                {
                    continue;
                }

                if (obj.DoorState != EDoorState.Locked)
                {
                    continue;
                }

                var offset = player.Transform.position - obj.transform.position;
                var sqrLen = offset.sqrMagnitude;

                // only unlock if near me, else you'll get a ban from BattlEye if you brute-force-unlock all objects
                if (sqrLen <= 20.0f)
                {
                    obj.DoorState = EDoorState.Shut;
                }
            }
        }
Example #2
0
 void Update()
 {
     if (CGameWorld.IsPlaying)
     {
         GameLootItemList = CGameWorld.activeGameworld.LootItems.GetValuesEnumerator().GetEnumerator();
         CorpseList       = CGameWorld.activeGameworld.LootItems.GetValuesEnumerator().GetEnumerator();
         Grenade          = CGameWorld.activeGameworld.Grenades.GetValuesEnumerator().GetEnumerator();
         Objects          = LocationScene.GetAllObjects <WorldInteractiveObject>(false).GetEnumerator();
     }
 }
Example #3
0
 void Update()
 {
     if (CGameWorld.IsPlaying)
     {
         Objects = LocationScene.GetAllObjects <WorldInteractiveObject>(false).GetEnumerator();
     }
     if (CGameWorld.IsPlaying && Settings.CDoors.bDoorUnlocker && Input.GetKeyDown(KeyCode.Mouse4))
     {
         UnlockDoor();
     }
 }
        public void OnUpdate(FrameTime p0)
        {
            if (!hasFinishedLoading)
            {
                return;
            }

            if (locationScene == null)
            {
                // If our locationScene object hasn't been setup yet, this is a good time to do it
                // We know that here, the AR components have been initiated.
                locationScene = new LocationScene(this, this, arSceneView);

                // Now lets create our location markers.
                // First, a layout
                LocationMarker layoutLocationMarker = new LocationMarker(-0.119677, 51.478494, getExampleView());

                // An example "onRender" event, called every frame
                // Updates the layout with the markers distance
                layoutLocationMarker.RenderEvent = this;
                // Adding the marker
                locationScene.MLocationMarkers.Add(layoutLocationMarker);
            }

            Frame frame = arSceneView.ArFrame;

            if (frame == null)
            {
                return;
            }

            if (frame.Camera.TrackingState != TrackingState.Tracking)
            {
                return;
            }

            if (locationScene != null)
            {
                locationScene.ProcessFrame(frame);
            }

            if (loadingMessageSnackbar != null)
            {
                foreach (Plane plane in frame.GetUpdatedTrackables(Java.Lang.Class.FromType(typeof(Plane))))
                {
                    if (plane.TrackingState == TrackingState.Tracking)
                    {
                        HideLoadingMessage();
                    }
                }
            }

            return;
        }
Example #5
0
        // 5d08d21286f774736e7c94c3 //

        private void isOnUpdate()
        {
            if (LocalPlayer.Base == null)
            {
                return;
            }

            inumDoorList = LocationScene.GetAllObjects <WorldInteractiveObject>(false);
            try
            {
                TempList    = Prioritize.SortData(inumDoorList.Cast <WorldInteractiveObject>().ToList());
                tmpDoorList = new List <WorldInteractiveObject>();
                for (int i = 0; i < TempList.Count; i++)
                {
                    if (TempList[i] is Door || TempList[i] is LootableContainer)
                    {
                        if (TempList[i].KeyId == "")
                        {
                            continue;
                        }
                        //if (excludedList.IndexOf(TempList[i].KeyId) == -1) continue;
                        if (Settings.CDoor.Distance < (int)Vector3.Distance(Camera.main.transform.position, TempList[i].transform.position))
                        {
                            continue;
                        }
                        //if (TempList[i].Id.IndexOf("autoId") == -1) continue;
                        tmpDoorList.Add(TempList[i]);
                    }
                }
                DoorList = tmpDoorList;
                autoSelectedCloseDoor       = DoorList.FirstOrDefault();
                Settings.CDoor.SelectedDoor = autoSelectedCloseDoor.Id.Replace("autoId_", "").Replace("0", "");
            }
            catch { errorCount1++; }

            if (Input.GetKeyDown(KeyCode.F6) && KeyRestored)
            {
                LocalPlayerKey = LocalPlayer.Features.GetLocalPlayerKeys();
                if (LocalPlayerKey != default(Item) && autoSelectedCloseDoor.KeyId != "")
                {
                    SelectedKeyID = LocalPlayerKey.Template._id;
                    KeyRestored   = false;
                    LocalPlayerKey.Template._id = autoSelectedCloseDoor.KeyId;
                    StartCoroutine(RevokeMechanicalKey(5f));
                }
            }
        }
Example #6
0
        private void UnlockDoors()
        {
            if (MiscOptions.DoorUnlocker)
            {
                if (Input.GetKeyDown(MiscOptions.DoorUnlockerKey))
                {
                    foreach (var door in LocationScene.GetAllObjects <WorldInteractiveObject>())
                    {
                        if (door.DoorState == EDoorState.Open || door.DoorState == EDoorState.Shut || Vector3.Distance(door.transform.position, Main.LocalPlayer.Position) > 10f)
                        {
                            continue;
                        }

                        door.DoorState = EDoorState.Shut;
                        break;
                    }
                }
            }
        }
Example #7
0
 void SetLootableContainers()
 {
     if (LocationScene.GetAllObjects <WorldInteractiveObject>(false).Count() > 0)
     {
         LootableContainerWorth = new Dictionary <Vector3, float>();
         while (Objects.MoveNext())
         {
             if (Objects.Current is LootableContainer)
             {
                 LootableContainer t = Objects.Current as LootableContainer;
                 if (LootableContainerWorth.ContainsKey(t.transform.position))
                 {
                     return;
                 }
                 foreach (EFT.InventoryLogic.Item item in t.ItemOwner.RootItem.GetAllItems(false))
                 {
                     LootableWorth += item.Template.CreditsPrice;
                 }
                 LootableContainerWorth.Add(t.transform.position, (LootableWorth / 1000));
                 LootableWorth = 0f;
             }
         }
     }
 }
Example #8
0
        public void Update()
        {
            if (!Settings.CContainer.Enable) // if not activated
            {
                return;
            }
            if (LocalPlayer.Base == null) // if gameworld is not initiated already
            {
                return;
            }
            try
            {
                lootlist         = CGameWorld.Base.LootItems.GetValuesEnumerator().GetEnumerator();
                WorldList        = LocationScene.GetAllObjects <WorldInteractiveObject>(false);
                tmpContainerList = Prioritize.SortData(WorldList.Cast <WorldInteractiveObject>().ToList());
                ContainerList    = new List <LootableContainer>();
                for (int i = 0; i < tmpContainerList.Count; i++)
                {
                    if (tmpContainerList[i] is LootableContainer)
                    {
                        var tempDistanceToObject = Vector3.Distance(Camera.main.transform.position, tmpContainerList[i].transform.position);
                        if (tempDistanceToObject < Settings.CContainer.Distance)
                        {
                            var tempLootContainer      = tmpContainerList[i] as LootableContainer;
                            IEnumerable <Item> tmpList = tempLootContainer.ItemOwner.RootItem.GetAllItems(false);

                            if (Settings.CContainer.SearchFor == "" || !Settings.switches.sb_searchForContainers)
                            {
                                var enumerator = tmpList.GetEnumerator();
                                int count      = 0;
                                while (enumerator.MoveNext())
                                {
                                    if (count == 0)
                                    {
                                        count++; continue;
                                    }
                                    var item = enumerator.Current;
                                    #region ~~Super rare search + name search
                                    if (Settings.CItem.DisplayLootSrare)     // selected super rare
                                    {
                                        if (item.Template.Rarity == JsonType.ELootRarity.Superrare)
                                        {
                                            if (Settings.CItem.SearchFor == "")
                                            {
                                                ContainerList.Add(tempLootContainer);
                                                continue;
                                            }
                                            else
                                            {
                                                if ((item.ShortName.Localized() + item.Name.Localized()).ToLower().IndexOf(Settings.CItem.SearchFor) >= 0)
                                                {
                                                    ContainerList.Add(tempLootContainer);
                                                    continue;
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                    #region ~~Everything disabled and/or search for item
                                    if (!Settings.CItem.DisplayLootSrare && !Settings.CItem.DisplayLootCustom1 && !Settings.CItem.DisplayLootCustom2 && !Settings.CItem.DisplayLootCustom3)
                                    {
                                        if (Settings.CItem.SearchFor == "" || !Settings.switches.sb_searchForItems)
                                        {
                                            ContainerList.Add(tempLootContainer);
                                            continue;
                                        }
                                        else if ((item.ShortName.Localized() + item.Name.Localized()).ToLower().IndexOf(Settings.CItem.SearchFor) >= 0)
                                        {
                                            ContainerList.Add(tempLootContainer);
                                            continue;
                                        }
                                    }
                                    #endregion
                                    #region ~~Custom1 file search + name search
                                    if (Settings.CItem.DisplayLootCustom1)                         // custom search from file
                                    {
                                        if (Settings.CItem.CustomDistance1 > tempDistanceToObject) // limit number of items on screen also checking distance
                                        {
                                            if (Array.IndexOf(CItems.IDTable1, item.TemplateId) != -1 || Array.IndexOf(CItems.IDTable1, item.Template._parent) != -1)
                                            {
                                                if (Settings.CItem.SearchFor == "" || !Settings.switches.sb_searchForItems)
                                                {
                                                    ContainerList.Add(tempLootContainer);
                                                }
                                                else
                                                {
                                                    if ((item.ShortName.Localized() + item.Name.Localized()).ToLower().IndexOf(Settings.CItem.SearchFor) >= 0)
                                                    {
                                                        ContainerList.Add(tempLootContainer);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                    #region ~~Custom2 file search + name search
                                    if (Settings.CItem.DisplayLootCustom2)                         // custom search from file
                                    {
                                        if (Settings.CItem.CustomDistance2 > tempDistanceToObject) // limit number of items on screen also checking distance
                                        {
                                            if (Array.IndexOf(CItems.IDTable2, item.TemplateId) != -1 || Array.IndexOf(CItems.IDTable2, item.Template._parent) != -1)
                                            {
                                                if (Settings.CItem.SearchFor == "" || !Settings.switches.sb_searchForItems)
                                                {
                                                    ContainerList.Add(tempLootContainer);
                                                    continue;
                                                }
                                                else
                                                {
                                                    if ((item.ShortName.Localized() + item.Name.Localized()).ToLower().IndexOf(Settings.CItem.SearchFor) >= 0)
                                                    {
                                                        ContainerList.Add(tempLootContainer);
                                                        continue;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                    #region ~~Custom3 file search + name search
                                    if (Settings.CItem.DisplayLootCustom3)                         // custom search from file
                                    {
                                        if (Settings.CItem.CustomDistance3 > tempDistanceToObject) // limit number of items on screen also checking distance
                                        {
                                            if (Array.IndexOf(CItems.IDTable3, item.TemplateId) != -1 || Array.IndexOf(CItems.IDTable3, item.Template._parent) != -1)
                                            {
                                                if (Settings.CItem.SearchFor == "" || !Settings.switches.sb_searchForItems)
                                                {
                                                    ContainerList.Add(tempLootContainer);
                                                    continue;
                                                }
                                                else
                                                {
                                                    if ((item.ShortName.Localized() + item.Name.Localized()).ToLower().IndexOf(Settings.CItem.SearchFor) >= 0)
                                                    {
                                                        ContainerList.Add(tempLootContainer);
                                                        continue;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                }
                            }
                            else
                            {
                                if (tempLootContainer.ItemOwner.Name.Localized().IndexOf(Settings.CContainer.SearchFor) != -1)
                                {
                                    ContainerList.Add(tempLootContainer);
                                    continue;
                                }
                            }
                        }
                    }
                }
                DrawingList = ContainerList;
            }
            catch { }
        }