Exemplo n.º 1
0
        /// <summary>
        /// Update the game object being focused on
        /// </summary>
        public void UpdateFocus()
        {
            OldPrimeFocus          = PrimeFocus;
            PrimeFocus             = null;
            OldUIInteractibleFocus = UIInteractibleFocus;
            UIInteractibleFocus    = null;

            if (m_LockedFocus != null)
            {
                PrimeFocus = m_LockedFocus;
            }
            else if (Hit && FocusHitInfo.transform != null)
            {
                PrimeFocus = FocusHitInfo.transform.gameObject;
            }

            // Bubble up from the old focused object and record all object that should get the GazeExited message
            if (OldPrimeFocus != null)
            {
                Transform trans = OldPrimeFocus.transform;
                do
                {
                    FocusExitList.Add(trans.gameObject);
                    GetNextValidParent(ref trans);
                } while (trans != null);
            }

            FocusList.Clear();

            if (PrimeFocus != null)
            {
                Transform trans = PrimeFocus.transform;
                do
                {
                    bool found = FocusExitList.Remove(trans.gameObject);
                    if (!found)
                    {
                        FocusEnterList.Add(trans.gameObject);
                    }

                    FocusList.Add(trans.gameObject);

                    if (UIInteractibleFocus == null)
                    {
                        Selectable          foundSelectable = trans.gameObject.GetComponent <Selectable>();
                        IEventSystemHandler eventHandler    = trans.gameObject.GetComponent <IEventSystemHandler>();
                        if (eventHandler != null)
                        {
                            UIInteractibleFocus = (eventHandler as Component).gameObject;
                        }
                        else if (foundSelectable != null && foundSelectable.IsInteractable())
                        {
                            UIInteractibleFocus = foundSelectable.gameObject;
                        }
                    }

                    GetNextValidParent(ref trans);
                } while (trans != null);
            }
        }
Exemplo n.º 2
0
        public void OnPoacherKilled(BaseCreature bc)
        {
            if (Poachers != null && Poachers.Contains(bc))
            {
                Poachers.Remove(bc);

                if (Poachers.Count == 0)
                {
                    if (!IsHatching)
                    {
                        IsHatching = true;
                        ColUtility.Free(Poachers);

                        Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(15, 30)), () =>
                        {
                            Hatchling = new DragonTurtleHatchling();
                            Hatchling.MoveToWorld(Location, Map);
                            Hatchling.Tamable = false;

                            SpawnPoachers(Hatchling);

                            if (Egg != null)
                            {
                                Egg.Visible = false;
                            }
                        });
                    }
                    else
                    {
                        if (Hatchling.Alive)
                        {
                            CooldownEnds = DateTime.UtcNow + ResetPeriod;
                            Timer.DelayCall(TimeSpan.FromSeconds(1), OnComplete, new object[] { Hatchling, Focus });

                            if (!FocusList.Contains(Focus))
                            {
                                FocusList.Add(Focus);
                            }
                        }
                        else
                        {
                            Delete();
                        }

                        if (DeadlineTimer != null)
                        {
                            DeadlineTimer.Stop();
                            DeadlineTimer = null;
                        }

                        Hatchling = null;
                        Focus     = null;

                        ColUtility.Free(Poachers);
                        Poachers = null;
                    }
                }
            }
        }
Exemplo n.º 3
0
        protected override async Task InitializationAsync()
        {
            var activityHomePageDetailResult = await OfoApi.GetActivityHomePageDetailAsync();

            if (await CheckOfoApiResult(activityHomePageDetailResult))
            {
                var activityHomePageDetail = activityHomePageDetailResult.Data;
                if (activityHomePageDetail?.AdList?.Count > 0)
                {
                    activityHomePageDetail.AdList.ForEach(item =>
                    {
                        ActivityList.Add(new ActivityCenterActivityItemViewModel()
                        {
                            ActivityId   = item.activityId,
                            ClickCommand = ActivityClickCommand,
                            ImgName      = item.ImgName,
                            ImgUrl       = item.ImgUrl,
                            JumpUrl      = item.JumpUrl,
                        });
                    });
                }
                if (activityHomePageDetail?.OperationList?.Count > 0)
                {
                    activityHomePageDetail.OperationList.ForEach(item =>
                    {
                        OperationList.Add(item);
                    });
                }
                if (activityHomePageDetail?.FocusList?.Count > 0)
                {
                    activityHomePageDetail.FocusList.ForEach(item =>
                    {
                        FocusList.Add(item);
                    });
                }
            }
        }
Exemplo n.º 4
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m is PlayerMobile && m.Location != oldLocation && m.InRange(Location, 3) && (!FocusList.Contains(m) || 0.015 > Utility.RandomDouble()))
            {
                EmptyNestQuest quest = QuestHelper.GetQuest((PlayerMobile)m, typeof(EmptyNestQuest)) as EmptyNestQuest;

                if (quest != null && !quest.Completed)
                {
                    if (Focus == null)
                    {
                        Focus = m;
                        m.RevealingAction();
                        SpawnPoachers(m);

                        DeadlineTimer = Timer.DelayCall(TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5), () =>
                        {
                            DeadlineTimer.Stop();

                            if (Poachers != null && Poachers.Count > 0)
                            {
                                Delete();
                            }
                            else
                            {
                                Focus        = null;
                                Hatchling    = null;
                                CooldownEnds = DateTime.MinValue;
                            }
                        });

                        DeadlineTimer.Start();
                    }
                    else if (IsInCooldown)
                    {
                        CooldownEnds = DateTime.UtcNow + TimeSpan.FromMinutes(2);
                    }
                }
            }
        }